@leafygreen-ui/icon 11.25.0 → 11.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/Key.js +1 -1
- package/dist/Key.js.map +1 -1
- package/dist/esm/Key.js +1 -1
- package/dist/esm/Key.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/generated/Key.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/generated/Key.tsx +2 -2
- package/src/glyphs/Key.svg +1 -1
- package/stories.js +1 -1
package/CHANGELOG.md
CHANGED
package/dist/Key.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react"),require("prop-types"),require("@leafygreen-ui/emotion")):"function"==typeof define&&define.amd?define(["react","prop-types","@leafygreen-ui/emotion"],t):((e="undefined"!=typeof globalThis?globalThis:e||self).Key=e.Key||{},e.Key.js=t(e.React,e.PropTypes,e["@leafygreen-ui/emotion"]))}(this,(function(e,t,r){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function l(e){if(e&&"object"==typeof e&&"default"in e)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var i=l(e),a=n(t);function o(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)}function f(e,t){if(null==e)return{};var r,n,l=function(e,t){if(null==e)return{};var r,n,l={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(l[r]=e[r]);return l}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(l[r]=e[r])}return l}function c(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var s,b,p={small:14,default:16,large:20,xlarge:24};var y=["className","size","title","aria-label","aria-labelledby","fill","role"],d=function(e){var t,n=e.className,l=e.size,a=void 0===l?16:l,d=e.title,m=e["aria-label"],g=e["aria-labelledby"],v=e.fill,O=e.role,j=void 0===O?"img":O,h=f(e,y),C=r.css(s||(s=c(["\n color: ",";\n "])),v),w=r.css(b||(b=c(["\n flex-shrink: 0;\n "]))),P=function(e,t,r){var n,l,i=r["aria-label"],a=r["aria-labelledby"],u=r.title;switch(e){case"img":return i||a||u?(o(n={},"aria-labelledby",a),o(n,"aria-label",i),o(n,"title",u),n):{"aria-label":(l=t,"".concat(l.replace(/([a-z])([A-Z])/g,"$1 $2")," Icon"))};case"presentation":return{"aria-hidden":!0,alt:""}}}(j,"Key",(o(t={title:d},"aria-label",m),o(t,"aria-labelledby",g),t));return i.createElement("svg",u({className:r.cx(o({},C,null!=v),w,n),height:"number"==typeof a?a:p[a],width:"number"==typeof a?a:p[a],role:j},P,h,{viewBox:"0 0 16 16"}),i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react"),require("prop-types"),require("@leafygreen-ui/emotion")):"function"==typeof define&&define.amd?define(["react","prop-types","@leafygreen-ui/emotion"],t):((e="undefined"!=typeof globalThis?globalThis:e||self).Key=e.Key||{},e.Key.js=t(e.React,e.PropTypes,e["@leafygreen-ui/emotion"]))}(this,(function(e,t,r){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function l(e){if(e&&"object"==typeof e&&"default"in e)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var i=l(e),a=n(t);function o(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)}function f(e,t){if(null==e)return{};var r,n,l=function(e,t){if(null==e)return{};var r,n,l={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(l[r]=e[r]);return l}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(l[r]=e[r])}return l}function c(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var s,b,p={small:14,default:16,large:20,xlarge:24};var y=["className","size","title","aria-label","aria-labelledby","fill","role"],d=function(e){var t,n=e.className,l=e.size,a=void 0===l?16:l,d=e.title,m=e["aria-label"],g=e["aria-labelledby"],v=e.fill,O=e.role,j=void 0===O?"img":O,h=f(e,y),C=r.css(s||(s=c(["\n color: ",";\n "])),v),w=r.css(b||(b=c(["\n flex-shrink: 0;\n "]))),P=function(e,t,r){var n,l,i=r["aria-label"],a=r["aria-labelledby"],u=r.title;switch(e){case"img":return i||a||u?(o(n={},"aria-labelledby",a),o(n,"aria-label",i),o(n,"title",u),n):{"aria-label":(l=t,"".concat(l.replace(/([a-z])([A-Z])/g,"$1 $2")," Icon"))};case"presentation":return{"aria-hidden":!0,alt:""}}}(j,"Key",(o(t={title:d},"aria-label",m),o(t,"aria-labelledby",g),t));return i.createElement("svg",u({className:r.cx(o({},C,null!=v),w,n),height:"number"==typeof a?a:p[a],width:"number"==typeof a?a:p[a],role:j},P,h,{viewBox:"0 0 16 16"}),i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.01504 10.0301C6.66679 10.0301 7.28227 9.8748 7.82649 9.5992L9.33772 11.1104L8.41683 12.0313C8.15573 12.2924 8.15573 12.7157 8.41683 12.9768L9.244 13.804C9.5051 14.0651 9.92843 14.0651 10.1895 13.804L11.1104 12.8831L11.8602 13.6329C12.3497 14.1224 13.1433 14.1224 13.6329 13.6329C14.1224 13.1433 14.1224 12.3497 13.6329 11.8602L9.59919 7.82651C9.87479 7.28228 10.0301 6.6668 10.0301 6.01504C10.0301 3.7976 8.23249 2 6.01504 2C3.7976 2 2 3.7976 2 6.01504C2 8.23249 3.7976 10.0301 6.01504 10.0301ZM5.26224 6.51692C5.95519 6.51692 6.51694 5.95517 6.51694 5.26222C6.51694 4.56927 5.95519 4.00752 5.26224 4.00752C4.56929 4.00752 4.00754 4.56927 4.00754 5.26222C4.00754 5.95517 4.56929 6.51692 5.26224 6.51692Z",fill:"currentColor"}))};return d.displayName="Key",d.isGlyph=!0,d.propTypes={fill:a.default.string,size:a.default.oneOfType([a.default.number,a.default.string]),className:a.default.string},d}));
|
|
2
2
|
//# sourceMappingURL=Key.js.map
|
package/dist/Key.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Key.js","sources":["../src/glyphCommon.ts","../src/generated/Key.tsx"],"sourcesContent":["export const Size = {\n Small: 'small',\n Default: 'default',\n Large: 'large',\n XLarge: 'xlarge',\n} as const;\n\nexport type Size = (typeof Size)[keyof typeof Size];\n\nexport const sizeMap: Record<Size, number> = {\n small: 14,\n default: 16,\n large: 20,\n xlarge: 24,\n} as const;\n\ninterface AccessibleFunctionParams {\n 'aria-labelledby'?: string;\n 'aria-label'?: string;\n title?: string | null;\n}\n\ntype AccessibleFunctionReturnType =\n | AccessibleFunctionParams\n | { 'aria-hidden': true; alt: '' };\n\nexport function generateAccessibleProps(\n role: 'img' | 'presentation',\n glyphName: string,\n {\n ['aria-label']: ariaLabel,\n ['aria-labelledby']: ariaLabelledby,\n title,\n }: AccessibleFunctionParams,\n): AccessibleFunctionReturnType {\n switch (role) {\n case 'img':\n if (!ariaLabel && !ariaLabelledby && !title) {\n return { 'aria-label': getGlyphLabel(glyphName) };\n }\n\n return {\n ['aria-labelledby']: ariaLabelledby,\n ['aria-label']: ariaLabel,\n title,\n };\n\n case 'presentation':\n return { 'aria-hidden': true, alt: '' };\n }\n}\n\nexport function getGlyphLabel(name: string) {\n return `${name.replace(/([a-z])([A-Z])/g, '$1 $2')} Icon`;\n}\n","/**\n* This is a generated file. Do not modify it manually.\n*\n* @script ./node_modules/.bin/ts-node packages/icon/scripts/build.ts\n* @checksum
|
|
1
|
+
{"version":3,"file":"Key.js","sources":["../src/glyphCommon.ts","../src/generated/Key.tsx"],"sourcesContent":["export const Size = {\n Small: 'small',\n Default: 'default',\n Large: 'large',\n XLarge: 'xlarge',\n} as const;\n\nexport type Size = (typeof Size)[keyof typeof Size];\n\nexport const sizeMap: Record<Size, number> = {\n small: 14,\n default: 16,\n large: 20,\n xlarge: 24,\n} as const;\n\ninterface AccessibleFunctionParams {\n 'aria-labelledby'?: string;\n 'aria-label'?: string;\n title?: string | null;\n}\n\ntype AccessibleFunctionReturnType =\n | AccessibleFunctionParams\n | { 'aria-hidden': true; alt: '' };\n\nexport function generateAccessibleProps(\n role: 'img' | 'presentation',\n glyphName: string,\n {\n ['aria-label']: ariaLabel,\n ['aria-labelledby']: ariaLabelledby,\n title,\n }: AccessibleFunctionParams,\n): AccessibleFunctionReturnType {\n switch (role) {\n case 'img':\n if (!ariaLabel && !ariaLabelledby && !title) {\n return { 'aria-label': getGlyphLabel(glyphName) };\n }\n\n return {\n ['aria-labelledby']: ariaLabelledby,\n ['aria-label']: ariaLabel,\n title,\n };\n\n case 'presentation':\n return { 'aria-hidden': true, alt: '' };\n }\n}\n\nexport function getGlyphLabel(name: string) {\n return `${name.replace(/([a-z])([A-Z])/g, '$1 $2')} Icon`;\n}\n","/**\n* This is a generated file. Do not modify it manually.\n*\n* @script ./node_modules/.bin/ts-node packages/icon/scripts/build.ts\n* @checksum 0e68d2d43abc00d908961394d698765c\n*/\nimport * as React from \"react\";\nimport PropTypes from 'prop-types';\nimport { css, cx } from '@leafygreen-ui/emotion';\nimport { generateAccessibleProps, sizeMap } from '../glyphCommon';\nimport { LGGlyph } from '../types';\nexport interface KeyProps extends LGGlyph.ComponentProps {}\nconst Key = ({\n className,\n size = 16,\n title,\n ['aria-label']: ariaLabel,\n ['aria-labelledby']: ariaLabelledby,\n fill,\n role = 'img',\n ...props\n}: KeyProps) => {\n const fillStyle = css`\n color: ${fill};\n `;\n const noFlexShrink = css`\n flex-shrink: 0;\n `;\n const accessibleProps = generateAccessibleProps(role, 'Key', {\n title,\n ['aria-label']: ariaLabel,\n ['aria-labelledby']: ariaLabelledby\n });\n return <svg className={cx({\n [fillStyle]: fill != null\n }, noFlexShrink, className)} height={typeof size === 'number' ? size : sizeMap[size]} width={typeof size === 'number' ? size : sizeMap[size]} role={role} {...accessibleProps} {...props} viewBox=\"0 0 16 16\"><path fillRule=\"evenodd\" clipRule=\"evenodd\" d=\"M6.01504 10.0301C6.66679 10.0301 7.28227 9.8748 7.82649 9.5992L9.33772 11.1104L8.41683 12.0313C8.15573 12.2924 8.15573 12.7157 8.41683 12.9768L9.244 13.804C9.5051 14.0651 9.92843 14.0651 10.1895 13.804L11.1104 12.8831L11.8602 13.6329C12.3497 14.1224 13.1433 14.1224 13.6329 13.6329C14.1224 13.1433 14.1224 12.3497 13.6329 11.8602L9.59919 7.82651C9.87479 7.28228 10.0301 6.6668 10.0301 6.01504C10.0301 3.7976 8.23249 2 6.01504 2C3.7976 2 2 3.7976 2 6.01504C2 8.23249 3.7976 10.0301 6.01504 10.0301ZM5.26224 6.51692C5.95519 6.51692 6.51694 5.95517 6.51694 5.26222C6.51694 4.56927 5.95519 4.00752 5.26224 4.00752C4.56929 4.00752 4.00754 4.56927 4.00754 5.26222C4.00754 5.95517 4.56929 6.51692 5.26224 6.51692Z\" fill={'currentColor'} /></svg>;\n};\nKey.displayName = 'Key';\nKey.isGlyph = true;\nKey.propTypes = {\n fill: PropTypes.string,\n size: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n className: PropTypes.string\n};\nexport default Key;"],"names":["_templateObject","_templateObject2","sizeMap","small","default","large","xlarge","_excluded","Key","_ref","_generateAccessiblePr","className","_ref$size","size","title","ariaLabel","ariaLabelledby","fill","_ref$role","role","props","_objectWithoutProperties","fillStyle","css","_taggedTemplateLiteral","noFlexShrink","accessibleProps","glyphName","_ref2","name","_defineProperty","concat","replace","alt","generateAccessibleProps","React","createElement","_extends","cx","height","width","viewBox","fillRule","clipRule","d","displayName","isGlyph","propTypes","PropTypes","string","oneOfType","number"],"mappings":"q8DAOO,ICHHA,EAAiBC,EDGVC,EAAU,CACnBC,MAAO,GACPC,QAAS,GACTC,MAAO,GACPC,OAAQ,ICNV,IAAIC,EAAY,CAAC,YAAa,OAAQ,QAAS,aAAc,kBAAmB,OAAQ,QAWpFC,EAAM,SAAaC,GACrB,IAAIC,EACAC,EAAYF,EAAKE,UACnBC,EAAYH,EAAKI,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B,KAAM,iBAEV,SACAT,EAAIqC,YAAc,MAClBrC,EAAIsC,SAAU,EACdtC,EAAIuC,UAAY,CACd9B,KAAM+B,EAAS5C,QAAC6C,OAChBpC,KAAMmC,EAAS5C,QAAC8C,UAAU,CAACF,EAAS5C,QAAC+C,OAAQH,EAAAA,QAAUC,SACvDtC,UAAWqC,EAAS5C,QAAC6C"}
|
package/dist/esm/Key.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as e from"react";import r from"prop-types";import{css as t,cx as l}from"@leafygreen-ui/emotion";function a(e,r,t){return(r=function(e){var r=function(e,r){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var l=t.call(e,r||"default");if("object"!=typeof l)return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:String(r)}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function i(){return i=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l])}return e},i.apply(this,arguments)}function n(e,r){if(null==e)return{};var t,l,a=function(e,r){if(null==e)return{};var t,l,a={},i=Object.keys(e);for(l=0;l<i.length;l++)t=i[l],r.indexOf(t)>=0||(a[t]=e[t]);return a}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(l=0;l<i.length;l++)t=i[l],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function o(e,r){return r||(r=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(r)}}))}var u,f,c={small:14,default:16,large:20,xlarge:24};var s=["className","size","title","aria-label","aria-labelledby","fill","role"],b=function(r){var b,p=r.className,y=r.size,m=void 0===y?16:y,v=r.title,d=r["aria-label"],g=r["aria-labelledby"],O=r.fill,h=r.role,C=void 0===h?"img":h,j=n(r,s),w=t(u||(u=o(["\n color: ",";\n "])),O),P=t(f||(f=o(["\n flex-shrink: 0;\n "]))),x=function(e,r,t){var l,i,n=t["aria-label"],o=t["aria-labelledby"],u=t.title;switch(e){case"img":return n||o||u?(a(l={},"aria-labelledby",o),a(l,"aria-label",n),a(l,"title",u),l):{"aria-label":(i=r,"".concat(i.replace(/([a-z])([A-Z])/g,"$1 $2")," Icon"))};case"presentation":return{"aria-hidden":!0,alt:""}}}(C,"Key",(a(b={title:v},"aria-label",d),a(b,"aria-labelledby",g),b));return e.createElement("svg",i({className:l(a({},w,null!=O),P,p),height:"number"==typeof m?m:c[m],width:"number"==typeof m?m:c[m],role:C},x,j,{viewBox:"0 0 16 16"}),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6
|
|
1
|
+
import*as e from"react";import r from"prop-types";import{css as t,cx as l}from"@leafygreen-ui/emotion";function a(e,r,t){return(r=function(e){var r=function(e,r){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var l=t.call(e,r||"default");if("object"!=typeof l)return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:String(r)}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function i(){return i=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l])}return e},i.apply(this,arguments)}function n(e,r){if(null==e)return{};var t,l,a=function(e,r){if(null==e)return{};var t,l,a={},i=Object.keys(e);for(l=0;l<i.length;l++)t=i[l],r.indexOf(t)>=0||(a[t]=e[t]);return a}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(l=0;l<i.length;l++)t=i[l],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function o(e,r){return r||(r=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(r)}}))}var u,f,c={small:14,default:16,large:20,xlarge:24};var s=["className","size","title","aria-label","aria-labelledby","fill","role"],b=function(r){var b,p=r.className,y=r.size,m=void 0===y?16:y,v=r.title,d=r["aria-label"],g=r["aria-labelledby"],O=r.fill,h=r.role,C=void 0===h?"img":h,j=n(r,s),w=t(u||(u=o(["\n color: ",";\n "])),O),P=t(f||(f=o(["\n flex-shrink: 0;\n "]))),x=function(e,r,t){var l,i,n=t["aria-label"],o=t["aria-labelledby"],u=t.title;switch(e){case"img":return n||o||u?(a(l={},"aria-labelledby",o),a(l,"aria-label",n),a(l,"title",u),l):{"aria-label":(i=r,"".concat(i.replace(/([a-z])([A-Z])/g,"$1 $2")," Icon"))};case"presentation":return{"aria-hidden":!0,alt:""}}}(C,"Key",(a(b={title:v},"aria-label",d),a(b,"aria-labelledby",g),b));return e.createElement("svg",i({className:l(a({},w,null!=O),P,p),height:"number"==typeof m?m:c[m],width:"number"==typeof m?m:c[m],role:C},x,j,{viewBox:"0 0 16 16"}),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.01504 10.0301C6.66679 10.0301 7.28227 9.8748 7.82649 9.5992L9.33772 11.1104L8.41683 12.0313C8.15573 12.2924 8.15573 12.7157 8.41683 12.9768L9.244 13.804C9.5051 14.0651 9.92843 14.0651 10.1895 13.804L11.1104 12.8831L11.8602 13.6329C12.3497 14.1224 13.1433 14.1224 13.6329 13.6329C14.1224 13.1433 14.1224 12.3497 13.6329 11.8602L9.59919 7.82651C9.87479 7.28228 10.0301 6.6668 10.0301 6.01504C10.0301 3.7976 8.23249 2 6.01504 2C3.7976 2 2 3.7976 2 6.01504C2 8.23249 3.7976 10.0301 6.01504 10.0301ZM5.26224 6.51692C5.95519 6.51692 6.51694 5.95517 6.51694 5.26222C6.51694 4.56927 5.95519 4.00752 5.26224 4.00752C4.56929 4.00752 4.00754 4.56927 4.00754 5.26222C4.00754 5.95517 4.56929 6.51692 5.26224 6.51692Z",fill:"currentColor"}))};b.displayName="Key",b.isGlyph=!0,b.propTypes={fill:r.string,size:r.oneOfType([r.number,r.string]),className:r.string};export{b as default};
|
|
2
2
|
//# sourceMappingURL=Key.js.map
|
package/dist/esm/Key.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Key.js","sources":["../../src/glyphCommon.ts","../../src/generated/Key.tsx"],"sourcesContent":["export const Size = {\n Small: 'small',\n Default: 'default',\n Large: 'large',\n XLarge: 'xlarge',\n} as const;\n\nexport type Size = (typeof Size)[keyof typeof Size];\n\nexport const sizeMap: Record<Size, number> = {\n small: 14,\n default: 16,\n large: 20,\n xlarge: 24,\n} as const;\n\ninterface AccessibleFunctionParams {\n 'aria-labelledby'?: string;\n 'aria-label'?: string;\n title?: string | null;\n}\n\ntype AccessibleFunctionReturnType =\n | AccessibleFunctionParams\n | { 'aria-hidden': true; alt: '' };\n\nexport function generateAccessibleProps(\n role: 'img' | 'presentation',\n glyphName: string,\n {\n ['aria-label']: ariaLabel,\n ['aria-labelledby']: ariaLabelledby,\n title,\n }: AccessibleFunctionParams,\n): AccessibleFunctionReturnType {\n switch (role) {\n case 'img':\n if (!ariaLabel && !ariaLabelledby && !title) {\n return { 'aria-label': getGlyphLabel(glyphName) };\n }\n\n return {\n ['aria-labelledby']: ariaLabelledby,\n ['aria-label']: ariaLabel,\n title,\n };\n\n case 'presentation':\n return { 'aria-hidden': true, alt: '' };\n }\n}\n\nexport function getGlyphLabel(name: string) {\n return `${name.replace(/([a-z])([A-Z])/g, '$1 $2')} Icon`;\n}\n","/**\n* This is a generated file. Do not modify it manually.\n*\n* @script ./node_modules/.bin/ts-node packages/icon/scripts/build.ts\n* @checksum
|
|
1
|
+
{"version":3,"file":"Key.js","sources":["../../src/glyphCommon.ts","../../src/generated/Key.tsx"],"sourcesContent":["export const Size = {\n Small: 'small',\n Default: 'default',\n Large: 'large',\n XLarge: 'xlarge',\n} as const;\n\nexport type Size = (typeof Size)[keyof typeof Size];\n\nexport const sizeMap: Record<Size, number> = {\n small: 14,\n default: 16,\n large: 20,\n xlarge: 24,\n} as const;\n\ninterface AccessibleFunctionParams {\n 'aria-labelledby'?: string;\n 'aria-label'?: string;\n title?: string | null;\n}\n\ntype AccessibleFunctionReturnType =\n | AccessibleFunctionParams\n | { 'aria-hidden': true; alt: '' };\n\nexport function generateAccessibleProps(\n role: 'img' | 'presentation',\n glyphName: string,\n {\n ['aria-label']: ariaLabel,\n ['aria-labelledby']: ariaLabelledby,\n title,\n }: AccessibleFunctionParams,\n): AccessibleFunctionReturnType {\n switch (role) {\n case 'img':\n if (!ariaLabel && !ariaLabelledby && !title) {\n return { 'aria-label': getGlyphLabel(glyphName) };\n }\n\n return {\n ['aria-labelledby']: ariaLabelledby,\n ['aria-label']: ariaLabel,\n title,\n };\n\n case 'presentation':\n return { 'aria-hidden': true, alt: '' };\n }\n}\n\nexport function getGlyphLabel(name: string) {\n return `${name.replace(/([a-z])([A-Z])/g, '$1 $2')} Icon`;\n}\n","/**\n* This is a generated file. Do not modify it manually.\n*\n* @script ./node_modules/.bin/ts-node packages/icon/scripts/build.ts\n* @checksum 0e68d2d43abc00d908961394d698765c\n*/\nimport * as React from \"react\";\nimport PropTypes from 'prop-types';\nimport { css, cx } from '@leafygreen-ui/emotion';\nimport { generateAccessibleProps, sizeMap } from '../glyphCommon';\nimport { LGGlyph } from '../types';\nexport interface KeyProps extends LGGlyph.ComponentProps {}\nconst Key = ({\n className,\n size = 16,\n title,\n ['aria-label']: ariaLabel,\n ['aria-labelledby']: ariaLabelledby,\n fill,\n role = 'img',\n ...props\n}: KeyProps) => {\n const fillStyle = css`\n color: ${fill};\n `;\n const noFlexShrink = css`\n flex-shrink: 0;\n `;\n const accessibleProps = generateAccessibleProps(role, 'Key', {\n title,\n ['aria-label']: ariaLabel,\n ['aria-labelledby']: ariaLabelledby\n });\n return <svg className={cx({\n [fillStyle]: fill != null\n }, noFlexShrink, className)} height={typeof size === 'number' ? size : sizeMap[size]} width={typeof size === 'number' ? size : sizeMap[size]} role={role} {...accessibleProps} {...props} viewBox=\"0 0 16 16\"><path fillRule=\"evenodd\" clipRule=\"evenodd\" d=\"M6.01504 10.0301C6.66679 10.0301 7.28227 9.8748 7.82649 9.5992L9.33772 11.1104L8.41683 12.0313C8.15573 12.2924 8.15573 12.7157 8.41683 12.9768L9.244 13.804C9.5051 14.0651 9.92843 14.0651 10.1895 13.804L11.1104 12.8831L11.8602 13.6329C12.3497 14.1224 13.1433 14.1224 13.6329 13.6329C14.1224 13.1433 14.1224 12.3497 13.6329 11.8602L9.59919 7.82651C9.87479 7.28228 10.0301 6.6668 10.0301 6.01504C10.0301 3.7976 8.23249 2 6.01504 2C3.7976 2 2 3.7976 2 6.01504C2 8.23249 3.7976 10.0301 6.01504 10.0301ZM5.26224 6.51692C5.95519 6.51692 6.51694 5.95517 6.51694 5.26222C6.51694 4.56927 5.95519 4.00752 5.26224 4.00752C4.56929 4.00752 4.00754 4.56927 4.00754 5.26222C4.00754 5.95517 4.56929 6.51692 5.26224 6.51692Z\" fill={'currentColor'} /></svg>;\n};\nKey.displayName = 'Key';\nKey.isGlyph = true;\nKey.propTypes = {\n fill: PropTypes.string,\n size: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n className: PropTypes.string\n};\nexport default Key;"],"names":["_templateObject","_templateObject2","sizeMap","small","default","large","xlarge","_excluded","Key","_ref","_generateAccessiblePr","className","_ref$size","size","title","ariaLabel","ariaLabelledby","fill","_ref$role","role","props","_objectWithoutProperties","fillStyle","css","_taggedTemplateLiteral","noFlexShrink","accessibleProps","glyphName","_ref2","name","_defineProperty","concat","replace","alt","generateAccessibleProps","React","createElement","_extends","cx","height","width","viewBox","fillRule","clipRule","d","displayName","isGlyph","propTypes","PropTypes","string","oneOfType","number"],"mappings":"yvCAOO,ICHHA,EAAiBC,EDGVC,EAAU,CACnBC,MAAO,GACPC,QAAS,GACTC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