@leafygreen-ui/icon 12.5.3 → 12.5.4
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/Federation.js +1 -1
- package/dist/Federation.js.map +1 -1
- package/dist/esm/Federation.js +1 -1
- package/dist/esm/Federation.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/generated/Federation.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/Federation.tsx +2 -2
- package/src/glyphs/Federation.svg +1 -1
- package/stories.js +1 -1
package/CHANGELOG.md
CHANGED
package/dist/Federation.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).Federation=e.Federation||{},e.Federation.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
|
|
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).Federation=e.Federation||{},e.Federation.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 i(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 a=i(e),l=n(t);function o(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function u(e,t,r){return(t=o(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f(){return f=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},f.apply(this,arguments)}function c(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function s(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var b,d,p={small:14,default:16,large:20,xlarge:24};var y=["className","size","title","aria-label","aria-labelledby","fill","role"],m=function(e){var t=e.className,n=e.size,i=void 0===n?16:n,l=e.title,o=e["aria-label"],m=e["aria-labelledby"],v=e.fill,g=e.role,C=void 0===g?"img":g,O=c(e,y),j=r.css(b||(b=s(["\n color: ",";\n "])),v),h=r.css(d||(d=s(["\n flex-shrink: 0;\n "]))),w=function(e,t,r){var n,i=r["aria-label"],a=r["aria-labelledby"],l=r.title;switch(e){case"img":return i||a||l?u(u(u({},"aria-labelledby",a),"aria-label",i),"title",l):{"aria-label":(n=t,"".concat(n.replace(/([a-z])([A-Z])/g,"$1 $2")," Icon"))};case"presentation":return{"aria-hidden":!0,alt:""}}}(C,"Federation",u(u({title:l},"aria-label",o),"aria-labelledby",m));return a.createElement("svg",f({className:r.cx(u({},j,null!=v),h,t),height:"number"==typeof i?i:p[i],width:"number"==typeof i?i:p[i],role:C},w,O,{viewBox:"0 0 16 16"}),a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.33297 4.19058C9.33297 4.89542 8.76158 5.4668 8.05674 5.4668C7.3519 5.4668 6.78051 4.89542 6.78051 4.19058C6.78051 3.48574 7.3519 2.91435 8.05674 2.91435C8.76158 2.91435 9.33297 3.48574 9.33297 4.19058ZM9.01391 7.23507C10.3084 6.82851 11.2473 5.61919 11.2473 4.19058C11.2473 2.42848 9.81884 1.00002 8.05674 1.00002C6.29464 1.00002 4.86618 2.42848 4.86618 4.19058C4.86618 5.61919 5.80512 6.82851 7.09957 7.23507L7.09957 8.86181L5.39438 9.8463C5.21435 9.67476 5.01126 9.52169 4.78638 9.39185C3.26036 8.51081 1.30904 9.03366 0.427987 10.5597C-0.453063 12.0857 0.0697915 14.037 1.59581 14.9181C3.12184 15.7991 5.07316 15.2763 5.95421 13.7502C6.35888 13.0493 6.46738 12.2587 6.31853 11.5232L8.05034 10.5234L9.69164 11.471C9.40129 12.7926 9.9793 14.2054 11.2136 14.9181C12.7396 15.7991 14.691 15.2763 15.572 13.7502C16.4531 12.2242 15.9302 10.2729 14.4042 9.39185C13.1641 8.67587 11.6431 8.88702 10.6439 9.81025L9.01391 8.8692V7.23507ZM12.1708 13.2602C11.5604 12.9078 11.3512 12.1273 11.7037 11.5168C12.0561 10.9064 12.8366 10.6973 13.447 11.0497C14.0574 11.4021 14.2666 12.1827 13.9141 12.7931C13.5617 13.4035 12.7812 13.6126 12.1708 13.2602ZM2.08585 11.5168C1.73343 12.1273 1.94257 12.9078 2.55298 13.2602C3.16339 13.6126 3.94392 13.4035 4.29634 12.7931C4.64876 12.1827 4.43962 11.4021 3.82921 11.0497C3.2188 10.6973 2.43827 10.9064 2.08585 11.5168Z",fill:"currentColor"}))};return m.displayName="Federation",m.isGlyph=!0,m.propTypes={fill:l.default.string,size:l.default.oneOfType([l.default.number,l.default.string]),className:l.default.string},m}));
|
|
2
2
|
//# sourceMappingURL=Federation.js.map
|
package/dist/Federation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Federation.js","sources":["../src/glyphCommon.ts","../src/generated/Federation.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":"Federation.js","sources":["../src/glyphCommon.ts","../src/generated/Federation.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 821c8522e29ba782bc780484fd649ef2\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 FederationProps extends LGGlyph.ComponentProps {}\nconst Federation = ({\n className,\n size = 16,\n title,\n ['aria-label']: ariaLabel,\n ['aria-labelledby']: ariaLabelledby,\n fill,\n role = 'img',\n ...props\n}: FederationProps) => {\n const fillStyle = css`\n color: ${fill};\n `;\n const noFlexShrink = css`\n flex-shrink: 0;\n `;\n const accessibleProps = generateAccessibleProps(role, 'Federation', {\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=\"M9.33297 4.19058C9.33297 4.89542 8.76158 5.4668 8.05674 5.4668C7.3519 5.4668 6.78051 4.89542 6.78051 4.19058C6.78051 3.48574 7.3519 2.91435 8.05674 2.91435C8.76158 2.91435 9.33297 3.48574 9.33297 4.19058ZM9.01391 7.23507C10.3084 6.82851 11.2473 5.61919 11.2473 4.19058C11.2473 2.42848 9.81884 1.00002 8.05674 1.00002C6.29464 1.00002 4.86618 2.42848 4.86618 4.19058C4.86618 5.61919 5.80512 6.82851 7.09957 7.23507L7.09957 8.86181L5.39438 9.8463C5.21435 9.67476 5.01126 9.52169 4.78638 9.39185C3.26036 8.51081 1.30904 9.03366 0.427987 10.5597C-0.453063 12.0857 0.0697915 14.037 1.59581 14.9181C3.12184 15.7991 5.07316 15.2763 5.95421 13.7502C6.35888 13.0493 6.46738 12.2587 6.31853 11.5232L8.05034 10.5234L9.69164 11.471C9.40129 12.7926 9.9793 14.2054 11.2136 14.9181C12.7396 15.7991 14.691 15.2763 15.572 13.7502C16.4531 12.2242 15.9302 10.2729 14.4042 9.39185C13.1641 8.67587 11.6431 8.88702 10.6439 9.81025L9.01391 8.8692V7.23507ZM12.1708 13.2602C11.5604 12.9078 11.3512 12.1273 11.7037 11.5168C12.0561 10.9064 12.8366 10.6973 13.447 11.0497C14.0574 11.4021 14.2666 12.1827 13.9141 12.7931C13.5617 13.4035 12.7812 13.6126 12.1708 13.2602ZM2.08585 11.5168C1.73343 12.1273 1.94257 12.9078 2.55298 13.2602C3.16339 13.6126 3.94392 13.4035 4.29634 12.7931C4.64876 12.1827 4.43962 11.4021 3.82921 11.0497C3.2188 10.6973 2.43827 10.9064 2.08585 11.5168Z\" fill={'currentColor'} /></svg>;\n};\nFederation.displayName = 'Federation';\nFederation.isGlyph = true;\nFederation.propTypes = {\n fill: PropTypes.string,\n size: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n className: PropTypes.string\n};\nexport default Federation;"],"names":["_templateObject","_templateObject2","sizeMap","small","default","large","xlarge","_excluded","Federation","_ref","className","_ref$size","size","title","ariaLabel","ariaLabelledby","fill","_ref$role","role","props","_objectWithoutProperties","fillStyle","css","_taggedTemplateLiteral","noFlexShrink","accessibleProps","glyphName","name","_defineProperty","concat","replace","alt","generateAccessibleProps","React","createElement","_extends","cx","height","width","viewBox","fillRule","clipRule","d","displayName","isGlyph","propTypes","PropTypes","string","oneOfType","number"],"mappings":"k7DAOO,ICHHA,EAAiBC,EDGVC,EAAU,CACnBC,MAAO,GACPC,QAAS,GACTC,MAAO,GACPC,OAAQ,ICNV,IAAIC,EAAY,CAAC,YAAa,OAAQ,QAAS,aAAc,kBAAmB,OAAQ,QAWpFC,EAAa,SAAoBC,GACnC,IAAIC,EAAYD,EAAKC,UACnBC,EAAYF,EAAKG,KACjBA,OAAqB,IAAdD,EAAuB,GAAKA,EACnCE,EAAQJ,EAAKI,MACbC,EAAYL,EAAK,cACjBM,EAAiBN,EAAK,mBACtBO,EAAOP,EAAKO,KACZC,EAAYR,EAAKS,KACjBA,OAAqB,IAAdD,EAAuB,MAAQA,EACtCE,EAAQC,EAAyBX,EAAMF,GACrCc,EAAYC,EAAAA,IAAItB,IAAoBA,EAAkBuB,EAAuB,CAAC,oBAAqB,eAAgBP,GACnHQ,EAAeF,EAAGA,IAACrB,IAAqBA,EAAmBsB,EAAuB,CAAC,wCACnFE,EDhBC,SAAiCP,EAAMQ,EAAWjB,GACvD,IAkB4BkB,EAlBxBb,EAAYL,EAAK,cACnBM,EAAiBN,EAAK,mBACtBI,EAAQJ,EAAKI,MACf,OAAQK,GACN,IAAK,MACH,OAAKJ,GAAcC,GAAmBF,EAK/Be,EAAgBA,EAAgBA,EAAgB,CAAE,EAAE,kBAAmBb,GAAiB,aAAcD,GAAY,QAASD,GAJzH,CACL,cAWoBc,EAXQD,EAY7B,GAAGG,OAAOF,EAAKG,QAAQ,kBAAmB,SAAU,WARzD,IAAK,eACH,MAAO,CACL,eAAe,EACfC,IAAK,IAGb,CCFwBC,CAAwBd,EAAM,aAAcU,EAAgBA,EAAgB,CAChGf,MAAOA,GACN,aAAcC,GAAY,kBAAmBC,IAChD,OAAoBkB,EAAMC,cAAc,MAAOC,EAAS,CACtDzB,UAAW0B,EAAAA,GAAGR,EAAgB,GAAIP,EAAmB,MAARL,GAAeQ,EAAcd,GAC1E2B,OAAwB,iBAATzB,EAAoBA,EAAOV,EAAQU,GAClD0B,MAAuB,iBAAT1B,EAAoBA,EAAOV,EAAQU,GACjDM,KAAMA,GACLO,EAAiBN,EAAO,CACzBoB,QAAS,cACMN,EAAMC,cAAc,OAAQ,CAC3CM,SAAU,UACVC,SAAU,UACVC,EAAG,s0CACH1B,KAAM,iBAEV,SACAR,EAAWmC,YAAc,aACzBnC,EAAWoC,SAAU,EACrBpC,EAAWqC,UAAY,CACrB7B,KAAM8B,EAAS1C,QAAC2C,OAChBnC,KAAMkC,EAAS1C,QAAC4C,UAAU,CAACF,EAAS1C,QAAC6C,OAAQH,EAAAA,QAAUC,SACvDrC,UAAWoC,EAAS1C,QAAC2C"}
|
package/dist/esm/Federation.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as e from"react";import r from"prop-types";import{css as t,cx as
|
|
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){var r=function(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var l=t.call(e,r);if("object"!=typeof l)return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof r?r:r+""}function i(e,r,t){return(r=a(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function n(){return n=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},n.apply(this,arguments)}function o(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 c(e,r){return r||(r=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(r)}}))}var f,u,s={small:14,default:16,large:20,xlarge:24};var b=["className","size","title","aria-label","aria-labelledby","fill","role"],p=function(r){var a=r.className,p=r.size,m=void 0===p?16:p,y=r.title,d=r["aria-label"],v=r["aria-labelledby"],C=r.fill,g=r.role,O=void 0===g?"img":g,h=o(r,b),j=t(f||(f=c(["\n color: ",";\n "])),C),w=t(u||(u=c(["\n flex-shrink: 0;\n "]))),P=function(e,r,t){var l,a=t["aria-label"],n=t["aria-labelledby"],o=t.title;switch(e){case"img":return a||n||o?i(i(i({},"aria-labelledby",n),"aria-label",a),"title",o):{"aria-label":(l=r,"".concat(l.replace(/([a-z])([A-Z])/g,"$1 $2")," Icon"))};case"presentation":return{"aria-hidden":!0,alt:""}}}(O,"Federation",i(i({title:y},"aria-label",d),"aria-labelledby",v));return e.createElement("svg",n({className:l(i({},j,null!=C),w,a),height:"number"==typeof m?m:s[m],width:"number"==typeof m?m:s[m],role:O},P,h,{viewBox:"0 0 16 16"}),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.33297 4.19058C9.33297 4.89542 8.76158 5.4668 8.05674 5.4668C7.3519 5.4668 6.78051 4.89542 6.78051 4.19058C6.78051 3.48574 7.3519 2.91435 8.05674 2.91435C8.76158 2.91435 9.33297 3.48574 9.33297 4.19058ZM9.01391 7.23507C10.3084 6.82851 11.2473 5.61919 11.2473 4.19058C11.2473 2.42848 9.81884 1.00002 8.05674 1.00002C6.29464 1.00002 4.86618 2.42848 4.86618 4.19058C4.86618 5.61919 5.80512 6.82851 7.09957 7.23507L7.09957 8.86181L5.39438 9.8463C5.21435 9.67476 5.01126 9.52169 4.78638 9.39185C3.26036 8.51081 1.30904 9.03366 0.427987 10.5597C-0.453063 12.0857 0.0697915 14.037 1.59581 14.9181C3.12184 15.7991 5.07316 15.2763 5.95421 13.7502C6.35888 13.0493 6.46738 12.2587 6.31853 11.5232L8.05034 10.5234L9.69164 11.471C9.40129 12.7926 9.9793 14.2054 11.2136 14.9181C12.7396 15.7991 14.691 15.2763 15.572 13.7502C16.4531 12.2242 15.9302 10.2729 14.4042 9.39185C13.1641 8.67587 11.6431 8.88702 10.6439 9.81025L9.01391 8.8692V7.23507ZM12.1708 13.2602C11.5604 12.9078 11.3512 12.1273 11.7037 11.5168C12.0561 10.9064 12.8366 10.6973 13.447 11.0497C14.0574 11.4021 14.2666 12.1827 13.9141 12.7931C13.5617 13.4035 12.7812 13.6126 12.1708 13.2602ZM2.08585 11.5168C1.73343 12.1273 1.94257 12.9078 2.55298 13.2602C3.16339 13.6126 3.94392 13.4035 4.29634 12.7931C4.64876 12.1827 4.43962 11.4021 3.82921 11.0497C3.2188 10.6973 2.43827 10.9064 2.08585 11.5168Z",fill:"currentColor"}))};p.displayName="Federation",p.isGlyph=!0,p.propTypes={fill:r.string,size:r.oneOfType([r.number,r.string]),className:r.string};export{p as default};
|
|
2
2
|
//# sourceMappingURL=Federation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Federation.js","sources":["../../src/glyphCommon.ts","../../src/generated/Federation.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":"Federation.js","sources":["../../src/glyphCommon.ts","../../src/generated/Federation.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 821c8522e29ba782bc780484fd649ef2\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 FederationProps extends LGGlyph.ComponentProps {}\nconst Federation = ({\n className,\n size = 16,\n title,\n ['aria-label']: ariaLabel,\n ['aria-labelledby']: ariaLabelledby,\n fill,\n role = 'img',\n ...props\n}: FederationProps) => {\n const fillStyle = css`\n color: ${fill};\n `;\n const noFlexShrink = css`\n flex-shrink: 0;\n `;\n const accessibleProps = generateAccessibleProps(role, 'Federation', {\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=\"M9.33297 4.19058C9.33297 4.89542 8.76158 5.4668 8.05674 5.4668C7.3519 5.4668 6.78051 4.89542 6.78051 4.19058C6.78051 3.48574 7.3519 2.91435 8.05674 2.91435C8.76158 2.91435 9.33297 3.48574 9.33297 4.19058ZM9.01391 7.23507C10.3084 6.82851 11.2473 5.61919 11.2473 4.19058C11.2473 2.42848 9.81884 1.00002 8.05674 1.00002C6.29464 1.00002 4.86618 2.42848 4.86618 4.19058C4.86618 5.61919 5.80512 6.82851 7.09957 7.23507L7.09957 8.86181L5.39438 9.8463C5.21435 9.67476 5.01126 9.52169 4.78638 9.39185C3.26036 8.51081 1.30904 9.03366 0.427987 10.5597C-0.453063 12.0857 0.0697915 14.037 1.59581 14.9181C3.12184 15.7991 5.07316 15.2763 5.95421 13.7502C6.35888 13.0493 6.46738 12.2587 6.31853 11.5232L8.05034 10.5234L9.69164 11.471C9.40129 12.7926 9.9793 14.2054 11.2136 14.9181C12.7396 15.7991 14.691 15.2763 15.572 13.7502C16.4531 12.2242 15.9302 10.2729 14.4042 9.39185C13.1641 8.67587 11.6431 8.88702 10.6439 9.81025L9.01391 8.8692V7.23507ZM12.1708 13.2602C11.5604 12.9078 11.3512 12.1273 11.7037 11.5168C12.0561 10.9064 12.8366 10.6973 13.447 11.0497C14.0574 11.4021 14.2666 12.1827 13.9141 12.7931C13.5617 13.4035 12.7812 13.6126 12.1708 13.2602ZM2.08585 11.5168C1.73343 12.1273 1.94257 12.9078 2.55298 13.2602C3.16339 13.6126 3.94392 13.4035 4.29634 12.7931C4.64876 12.1827 4.43962 11.4021 3.82921 11.0497C3.2188 10.6973 2.43827 10.9064 2.08585 11.5168Z\" fill={'currentColor'} /></svg>;\n};\nFederation.displayName = 'Federation';\nFederation.isGlyph = true;\nFederation.propTypes = {\n fill: PropTypes.string,\n size: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n className: PropTypes.string\n};\nexport default Federation;"],"names":["_templateObject","_templateObject2","sizeMap","small","default","large","xlarge","_excluded","Federation","_ref","className","_ref$size","size","title","ariaLabel","ariaLabelledby","fill","_ref$role","role","props","_objectWithoutProperties","fillStyle","css","_taggedTemplateLiteral","noFlexShrink","accessibleProps","glyphName","name","_defineProperty","concat","replace","alt","generateAccessibleProps","React","createElement","_extends","cx","height","width","viewBox","fillRule","clipRule","d","displayName","isGlyph","propTypes","PropTypes","string","oneOfType","number"],"mappings":"itCAOO,ICHHA,EAAiBC,EDGVC,EAAU,CACnBC,MAAO,GACPC,QAAS,GACTC,MAAO,GACPC,OAAQ,ICNV,IAAIC,EAAY,CAAC,YAAa,OAAQ,QAAS,aAAc,kBAAmB,OAAQ,QAWpFC,EAAa,SAAoBC,GACnC,IAAIC,EAAYD,EAAKC,UACnBC,EAAYF,EAAKG,KACjBA,OAAqB,IAAdD,EAAuB,GAAKA,EACnCE,EAAQJ,EAAKI,MACbC,EAAYL,EAAK,cACjBM,EAAiBN,EAAK,mBACtBO,EAAOP,EAAKO,KACZC,EAAYR,EAAKS,KACjBA,OAAqB,IAAdD,EAAuB,MAAQA,EACtCE,EAAQC,EAAyBX,EAAMF,GACrCc,EAAYC,EAAItB,IAAoBA,EAAkBuB,EAAuB,CAAC,oBAAqB,eAAgBP,GACnHQ,EAAeF,EAAIrB,IAAqBA,EAAmBsB,EAAuB,CAAC,wCACnFE,EDhBC,SAAiCP,EAAMQ,EAAWjB,GACvD,IAkB4BkB,EAlBxBb,EAAYL,EAAK,cACnBM,EAAiBN,EAAK,mBACtBI,EAAQJ,EAAKI,MACf,OAAQK,GACN,IAAK,MACH,OAAKJ,GAAcC,GAAmBF,EAK/Be,EAAgBA,EAAgBA,EAAgB,CAAE,EAAE,kBAAmBb,GAAiB,aAAcD,GAAY,QAASD,GAJzH,CACL,cAWoBc,EAXQD,EAY7B,GAAGG,OAAOF,EAAKG,QAAQ,kBAAmB,SAAU,WARzD,IAAK,eACH,MAAO,CACL,eAAe,EACfC,IAAK,IAGb,CCFwBC,CAAwBd,EAAM,aAAcU,EAAgBA,EAAgB,CAChGf,MAAOA,GACN,aAAcC,GAAY,kBAAmBC,IAChD,OAAoBkB,EAAMC,cAAc,MAAOC,EAAS,CACtDzB,UAAW0B,EAAGR,EAAgB,GAAIP,EAAmB,MAARL,GAAeQ,EAAcd,GAC1E2B,OAAwB,iBAATzB,EAAoBA,EAAOV,EAAQU,GAClD0B,MAAuB,iBAAT1B,EAAoBA,EAAOV,EAAQU,GACjDM,KAAMA,GACLO,EAAiBN,EAAO,CACzBoB,QAAS,cACMN,EAAMC,cAAc,OAAQ,CAC3CM,SAAU,UACVC,SAAU,UACVC,EAAG,s0CACH1B,KAAM,iBAEV,EACAR,EAAWmC,YAAc,aACzBnC,EAAWoC,SAAU,EACrBpC,EAAWqC,UAAY,CACrB7B,KAAM8B,EAAUC,OAChBnC,KAAMkC,EAAUE,UAAU,CAACF,EAAUG,OAAQH,EAAUC,SACvDrC,UAAWoC,EAAUC"}
|