@leafygreen-ui/palette
Advanced tools
Comparing version 4.1.0 to 4.1.1
# @leafygreen-ui/palette | ||
## 4.1.1 | ||
### Patch Changes | ||
- fd0e5977d: Renames Palette story for Mongodb.design | ||
## 4.1.0 | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "@leafygreen-ui/palette", | ||
"version": "4.1.0", | ||
"version": "4.1.1", | ||
"description": "LeafyGreen UI Palettes", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -1,1 +0,1 @@ | ||
import e,{useState as n}from"react";import{transparentize as t,darken as r,readableColor as a,lighten as l}from"polished";import{css as i,cx as o}from"@leafygreen-ui/emotion";function c(){return c=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},c.apply(this,arguments)}function s(e,n){if(null==e)return{};var t,r,a=function(e,n){if(null==e)return{};var t,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)t=l[r],n.indexOf(t)>=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)t=l[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function u(e,n){return n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}function d(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,a,l,i,o=[],c=!0,s=!1;try{if(l=(t=t.call(e)).next,0===n);else for(;!(c=(r=l.call(t)).done)&&(o.push(r.value),o.length!==n);c=!0);}catch(e){s=!0,a=e}finally{try{if(!c&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(s)throw a}}return o}}(e,n)||function(e,n){if(!e)return;if("string"==typeof e)return p(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return p(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,n){n>e.length&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}var f,m,h,b,g,F,y,v,k,E={white:"#FFFFFF",black:"#001E2B",transparent:"#FFFFFF00",gray:{dark4:"#112733",dark3:"#1C2D38",dark2:"#3D4F58",dark1:"#5C6C75",base:"#889397",light1:"#C1C7C6",light2:"#E8EDEB",light3:"#F9FBFA"},green:{dark3:"#023430",dark2:"#00684A",dark1:"#00A35C",base:"#00ED64",light1:"#71F6BA",light2:"#C0FAE6",light3:"#E3FCF7"},purple:{dark3:"#2D0B59",dark2:"#5E0C9E",base:"#B45AF2",light2:"#F1D4FD",light3:"#F9EBFF"},blue:{dark3:"#0C2657",dark2:"#083C90",dark1:"#1254B7",base:"#016BF8",light1:"#0498EC",light2:"#C3E7FE",light3:"#E1F7FF"},yellow:{dark3:"#4C2100",dark2:"#944F01",base:"#FFC010",light2:"#FFEC9E",light3:"#FEF7DB"},red:{dark3:"#5B0000",dark2:"#970606",base:"#DB3030",light1:"#FF6960",light2:"#FFCDC7",light3:"#FFEAE5"}},x=["hue","shade"],C=["white","black","transparent"],w=function(e){return C.includes(e)},O=["dark4","dark3","dark2","dark1","base","light1","light2","light3"],j=i(f||(f=u(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n font-family: 'Euclid Circular A', 'Helvetica Neue', Helvetica, Arial,\n sans-serif;\n border-radius: inherit;\n"]))),A=i(m||(m=u(["\n display: inline-block;\n position: relative;\n width: ","px;\n padding-bottom: 16px;\n"])),88),B=i(h||(h=u(["\n position: relative;\n outline: none;\n border: none;\n border-top-color: transparent;\n width: 100%;\n padding-bottom: 100%;\n border-radius: 8px;\n cursor: pointer;\n vertical-align: top;\n\n &:focus-visible {\n box-shadow: 0 0 0 2px white, 0 0 0 4px #0498ec;\n }\n"]))),D=i(b||(b=u(["\n width: calc(100% - 1em);\n position: absolute;\n left: 50%;\n margin: auto;\n font-size: 13px;\n text-align: center;\n padding: 3px 0.3rem;\n border-radius: 4px;\n transform: translate(-50%, -125%);\n pointer-events: none;\n"]))),N=i(g||(g=u(["\n text-align: center;\n color: ",";\n margin: auto;\n padding-block: 0.3em;\n"])),E.gray.dark1),S=i(F||(F=u(["\n grid-template-columns: repeat(",", ","px);\n display: grid;\n gap: 24px;\n"])),O.length,88);function P(p){var f,m,h,b=p.hue,g=p.shade,F=s(p,x),C=d(n(),2),S=C[0],P=C[1],I="".concat(b," ").concat(null!==(f=g)&&void 0!==f?f:"");w(b)?m=E[b]:(g=null!==(h=g)&&void 0!==h?h:"base",m=E[b][g]);var T=i(y||(y=u(["\n grid-column: ",";\n "])),g?O.indexOf(g)+1:"0"),z=i(v||(v=u(["\n transition: all 0.3s ease;\n background-color: ",";\n box-shadow: 0 8px 6px -8px ",",\n 0 2px 3px ",";\n\n &:hover {\n transform: scale(1.05);\n box-shadow: 0 8px 6px -8px ",",\n 0 2px 3px ",";\n }\n "])),m,t(.7,r(.2,m)),t(.8,r(.5,m)),t(.7,r(.4,m)),t(.5,r(.3,m))),H=i(k||(k=u(["\n color: ",";\n background-color: ",";\n "])),a(l(.2,m)),l(.2,m));return e.createElement("div",c({className:o(A,T)},F),e.createElement("button",{className:o(B,z),onClick:function(){navigator.clipboard.writeText(m),P(!0),setTimeout((function(){P(!1)}),2e3)}},S&&e.createElement("div",{className:j,style:{color:a(m)}},"Copied!")),!S&&e.createElement("div",{className:o(D,H)},m),e.createElement("div",{className:N},I))}var I={title:"Components/Palette",component:null,parameters:{default:"AllColors"},argTypes:{className:{table:{disable:!0}}}};function T(){var n=Object.keys(E),t=n.slice(C.length,n.length);return e.createElement("div",null,e.createElement("div",{className:S},e.createElement(P,{hue:"white",name:"white"}),e.createElement(P,{hue:"black",name:"black"}),e.createElement(P,{hue:"transparent",name:"transparent"})),t.map((function(n){var t=E[n];return e.createElement("div",{key:n,className:S},Object.keys(t).map((function(r){return e.createElement(P,{key:t[r],hue:n,shade:r,name:"".concat(n," ").concat(r)})})))})))}export{T as AllColors,I as default}; | ||
import e,{useState as n}from"react";import{transparentize as t,darken as r,readableColor as a,lighten as l}from"polished";import{css as i,cx as o}from"@leafygreen-ui/emotion";function c(){return c=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},c.apply(this,arguments)}function s(e,n){if(null==e)return{};var t,r,a=function(e,n){if(null==e)return{};var t,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)t=l[r],n.indexOf(t)>=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)t=l[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function u(e,n){return n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}function d(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,a,l,i,o=[],c=!0,s=!1;try{if(l=(t=t.call(e)).next,0===n);else for(;!(c=(r=l.call(t)).done)&&(o.push(r.value),o.length!==n);c=!0);}catch(e){s=!0,a=e}finally{try{if(!c&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(s)throw a}}return o}}(e,n)||function(e,n){if(!e)return;if("string"==typeof e)return p(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return p(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,n){n>e.length&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}var f,m,h,b,g,F,y,v,k,E={white:"#FFFFFF",black:"#001E2B",transparent:"#FFFFFF00",gray:{dark4:"#112733",dark3:"#1C2D38",dark2:"#3D4F58",dark1:"#5C6C75",base:"#889397",light1:"#C1C7C6",light2:"#E8EDEB",light3:"#F9FBFA"},green:{dark3:"#023430",dark2:"#00684A",dark1:"#00A35C",base:"#00ED64",light1:"#71F6BA",light2:"#C0FAE6",light3:"#E3FCF7"},purple:{dark3:"#2D0B59",dark2:"#5E0C9E",base:"#B45AF2",light2:"#F1D4FD",light3:"#F9EBFF"},blue:{dark3:"#0C2657",dark2:"#083C90",dark1:"#1254B7",base:"#016BF8",light1:"#0498EC",light2:"#C3E7FE",light3:"#E1F7FF"},yellow:{dark3:"#4C2100",dark2:"#944F01",base:"#FFC010",light2:"#FFEC9E",light3:"#FEF7DB"},red:{dark3:"#5B0000",dark2:"#970606",base:"#DB3030",light1:"#FF6960",light2:"#FFCDC7",light3:"#FFEAE5"}},x=["hue","shade"],C=["white","black","transparent"],w=function(e){return C.includes(e)},O=["dark4","dark3","dark2","dark1","base","light1","light2","light3"],j=i(f||(f=u(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n font-family: 'Euclid Circular A', 'Helvetica Neue', Helvetica, Arial,\n sans-serif;\n border-radius: inherit;\n"]))),A=i(m||(m=u(["\n display: inline-block;\n position: relative;\n width: ","px;\n padding-bottom: 16px;\n"])),88),B=i(h||(h=u(["\n position: relative;\n outline: none;\n border: none;\n border-top-color: transparent;\n width: 100%;\n padding-bottom: 100%;\n border-radius: 8px;\n cursor: pointer;\n vertical-align: top;\n\n &:focus-visible {\n box-shadow: 0 0 0 2px white, 0 0 0 4px #0498ec;\n }\n"]))),D=i(b||(b=u(["\n width: calc(100% - 1em);\n position: absolute;\n left: 50%;\n margin: auto;\n font-size: 13px;\n text-align: center;\n padding: 3px 0.3rem;\n border-radius: 4px;\n transform: translate(-50%, -125%);\n pointer-events: none;\n"]))),N=i(g||(g=u(["\n text-align: center;\n color: ",";\n margin: auto;\n padding-block: 0.3em;\n"])),E.gray.dark1),S=i(F||(F=u(["\n grid-template-columns: repeat(",", ","px);\n display: grid;\n gap: 24px;\n"])),O.length,88);function P(p){var f,m,h,b=p.hue,g=p.shade,F=s(p,x),C=d(n(),2),S=C[0],P=C[1],I="".concat(b," ").concat(null!==(f=g)&&void 0!==f?f:"");w(b)?m=E[b]:(g=null!==(h=g)&&void 0!==h?h:"base",m=E[b][g]);var T=i(y||(y=u(["\n grid-column: ",";\n "])),g?O.indexOf(g)+1:"0"),z=i(v||(v=u(["\n transition: all 0.3s ease;\n background-color: ",";\n box-shadow: 0 8px 6px -8px ",",\n 0 2px 3px ",";\n\n &:hover {\n transform: scale(1.05);\n box-shadow: 0 8px 6px -8px ",",\n 0 2px 3px ",";\n }\n "])),m,t(.7,r(.2,m)),t(.8,r(.5,m)),t(.7,r(.4,m)),t(.5,r(.3,m))),H=i(k||(k=u(["\n color: ",";\n background-color: ",";\n "])),a(l(.2,m)),l(.2,m));return e.createElement("div",c({className:o(A,T)},F),e.createElement("button",{className:o(B,z),onClick:function(){navigator.clipboard.writeText(m),P(!0),setTimeout((function(){P(!1)}),2e3)}},S&&e.createElement("div",{className:j,style:{color:a(m)}},"Copied!")),!S&&e.createElement("div",{className:o(D,H)},m),e.createElement("div",{className:N},I))}var I={title:"Components/Palette",component:null,parameters:{default:"AllColors"},argTypes:{className:{table:{disable:!0}}}};function T(){var n=Object.keys(E),t=n.slice(C.length,n.length);return e.createElement("div",null,e.createElement("div",{className:S},e.createElement(P,{hue:"white",name:"white"}),e.createElement(P,{hue:"black",name:"black"}),e.createElement(P,{hue:"transparent",name:"transparent"})),t.map((function(n){var t=E[n];return e.createElement("div",{key:n,className:S},Object.keys(t).map((function(r){return e.createElement(P,{key:t[r],hue:n,shade:r,name:"".concat(n," ").concat(r)})})))})))}export{T as LiveExample,I as default}; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41140