@leafygreen-ui/icon 14.6.0 → 14.6.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 +8 -0
- package/dist/umd/Biometric.js +1 -1
- package/dist/umd/Biometric.js.map +1 -1
- package/dist/umd/Clone.js +1 -1
- package/dist/umd/Clone.js.map +1 -1
- package/dist/umd/SortDescending.js +1 -1
- package/dist/umd/SortDescending.js.map +1 -1
- package/package.json +10 -7
- package/scripts/build/build-batch.ts +13 -4
- package/scripts/postbuild/index.ts +71 -0
- package/scripts/tsconfig.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @leafygreen-ui/icon
|
|
2
2
|
|
|
3
|
+
## 14.6.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c6b4d3f: Updates build process to avoid race conditions in `rollup` plugins that intermittently caused `@emotion/server/create-instance` to be marked as a direct dependency of icon
|
|
8
|
+
- Updated dependencies [92693df]
|
|
9
|
+
- @leafygreen-ui/emotion@5.1.0
|
|
10
|
+
|
|
3
11
|
## 14.6.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
package/dist/umd/Biometric.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r(require("react"),require("@
|
|
1
|
+
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r(require("react"),require("@leafygreen-ui/emotion")):"function"==typeof define&&define.amd?define(["react","@leafygreen-ui/emotion"],r):(e="undefined"!=typeof globalThis?globalThis:e||self).leafyGreenIconBiometric=r(e.React,e.leafyGreenEmotion)}(this,function(e,r){"use strict";function t(e){if(e&&"object"==typeof e&&"default"in e)return e;var r=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}}),r.default=e,Object.freeze(r)}var n=t(e);function i(e,r,t){return(r=function(e){var r=function(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,r);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof r?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function l(){return l=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},l.apply(null,arguments)}function a(e,r){return r||(r=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(r)}}))}var o,c,f={small:14,default:16,large:20,xlarge:24};var u=["className","size","title","aria-label","aria-labelledby","fill","role"],b=function(e){var t=e.className,b=e.size,s=void 0===b?16:b,d=e.title,y=e["aria-label"],C=e["aria-labelledby"],p=e.fill,m=e.role,v=void 0===m?"img":m,g=function(e,r){if(null==e)return{};var t,n,i=function(e,r){if(null==e)return{};var t={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==r.indexOf(n))continue;t[n]=e[n]}return t}(e,r);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)t=l[n],-1===r.indexOf(t)&&{}.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}(e,u),O=r.css(o||(o=a(["\n color: ",";\n "])),p),h=r.css(c||(c=a(["\n flex-shrink: 0;\n "]))),j=function(e,r,t){var n,l=t["aria-label"],a=t["aria-labelledby"],o=t.title;switch(e){case"img":return l||a||o?i(i(i({},"aria-labelledby",a),"aria-label",l),"title",o):{"aria-label":(n=r,"".concat(n.replace(/([a-z])([A-Z])/g,"$1 $2")," Icon"))};case"presentation":return{"aria-hidden":!0,alt:""}}}(v,"Biometric",i(i({title:d},"aria-label",y),"aria-labelledby",C));return n.createElement("svg",l({className:r.cx(i({},O,null!=p),h,t),height:"number"==typeof s?s:f[s],width:"number"==typeof s?s:f[s],role:v},j,g,{viewBox:"0 0 16 16"}),n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.5 1C4.46243 1 2 3.46243 2 6.5V9.5C2 12.5376 4.46243 15 7.5 15H8.5C11.5376 15 14 12.5376 14 9.5V6.5C14 3.46243 11.5376 1 8.5 1H7.5ZM8.57432 7.75001C8.57432 7.43282 8.31719 7.17569 8 7.17569C7.68281 7.17569 7.42567 7.43282 7.42567 7.75001V10.2069C7.42567 10.5241 7.68281 10.7812 8 10.7812C8.31719 10.7812 8.57432 10.5241 8.57432 10.2069V7.75001ZM8.00001 5.33783C6.66781 5.33783 5.58785 6.41779 5.58785 7.74999V10.3164C5.58785 10.5802 5.48308 10.8331 5.2966 11.0196C5.07232 11.2438 5.07232 11.6075 5.2966 11.8318C5.52089 12.0561 5.88453 12.0561 6.10882 11.8318C6.51071 11.4299 6.7365 10.8848 6.7365 10.3164V7.74999C6.7365 7.05217 7.30219 6.48648 8.00001 6.48648C8.69783 6.48648 9.26352 7.05217 9.26352 7.74999V10.3983C9.26352 10.8104 9.03068 11.1871 8.66208 11.3714C8.37838 11.5133 8.26338 11.8583 8.40524 12.142C8.54709 12.4257 8.89207 12.5407 9.17577 12.3988C9.93352 12.0199 10.4122 11.2455 10.4122 10.3983V7.74999C10.4122 6.41779 9.33221 5.33783 8.00001 5.33783ZM4.89865 7.75C4.89865 6.03717 6.28717 4.64865 8 4.64865C8.6033 4.64865 9.16475 4.82034 9.64017 5.11727C9.9092 5.28529 10.2635 5.20341 10.4315 4.93438C10.5996 4.66535 10.5177 4.31104 10.2486 4.14302C9.59605 3.73544 8.82464 3.5 8 3.5C5.65279 3.5 3.75 5.40279 3.75 7.75V10.0473C3.75 10.3645 4.00713 10.6216 4.32432 10.6216C4.64151 10.6216 4.89865 10.3645 4.89865 10.0473V7.75ZM11.7861 5.81757C11.6417 5.53515 11.2957 5.42326 11.0133 5.56765C10.7309 5.71205 10.619 6.05805 10.7634 6.34047C10.9793 6.76274 11.1014 7.24128 11.1014 7.75V9.12838C11.1014 9.44557 11.3585 9.7027 11.6757 9.7027C11.9929 9.7027 12.25 9.44557 12.25 9.12838V7.75C12.25 7.0553 12.0829 6.39796 11.7861 5.81757Z",fill:"currentColor"}))};return b.displayName="Biometric",b.isGlyph=!0,b});
|
|
2
2
|
//# sourceMappingURL=Biometric.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Biometric.js","sources":["
|
|
1
|
+
{"version":3,"file":"Biometric.js","sources":["../../src/glyphCommon.ts","../../src/generated/Biometric.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 packages/icon/scripts/prebuild/index.ts\n* @checksum b38fe171af2489e14639cf28ce6f82a9\n*/\nimport * as React from \"react\";\nimport { css, cx } from '@leafygreen-ui/emotion';\nimport { generateAccessibleProps, sizeMap } from '../glyphCommon';\nimport { LGGlyph } from '../types';\nexport interface BiometricProps extends LGGlyph.ComponentProps {}\nconst Biometric = ({\n className,\n size = 16,\n title,\n ['aria-label']: ariaLabel,\n ['aria-labelledby']: ariaLabelledby,\n fill,\n role = 'img',\n ...props\n}: BiometricProps) => {\n const fillStyle = css`\n color: ${fill};\n `;\n const noFlexShrink = css`\n flex-shrink: 0;\n `;\n const accessibleProps = generateAccessibleProps(role, 'Biometric', {\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=\"M7.5 1C4.46243 1 2 3.46243 2 6.5V9.5C2 12.5376 4.46243 15 7.5 15H8.5C11.5376 15 14 12.5376 14 9.5V6.5C14 3.46243 11.5376 1 8.5 1H7.5ZM8.57432 7.75001C8.57432 7.43282 8.31719 7.17569 8 7.17569C7.68281 7.17569 7.42567 7.43282 7.42567 7.75001V10.2069C7.42567 10.5241 7.68281 10.7812 8 10.7812C8.31719 10.7812 8.57432 10.5241 8.57432 10.2069V7.75001ZM8.00001 5.33783C6.66781 5.33783 5.58785 6.41779 5.58785 7.74999V10.3164C5.58785 10.5802 5.48308 10.8331 5.2966 11.0196C5.07232 11.2438 5.07232 11.6075 5.2966 11.8318C5.52089 12.0561 5.88453 12.0561 6.10882 11.8318C6.51071 11.4299 6.7365 10.8848 6.7365 10.3164V7.74999C6.7365 7.05217 7.30219 6.48648 8.00001 6.48648C8.69783 6.48648 9.26352 7.05217 9.26352 7.74999V10.3983C9.26352 10.8104 9.03068 11.1871 8.66208 11.3714C8.37838 11.5133 8.26338 11.8583 8.40524 12.142C8.54709 12.4257 8.89207 12.5407 9.17577 12.3988C9.93352 12.0199 10.4122 11.2455 10.4122 10.3983V7.74999C10.4122 6.41779 9.33221 5.33783 8.00001 5.33783ZM4.89865 7.75C4.89865 6.03717 6.28717 4.64865 8 4.64865C8.6033 4.64865 9.16475 4.82034 9.64017 5.11727C9.9092 5.28529 10.2635 5.20341 10.4315 4.93438C10.5996 4.66535 10.5177 4.31104 10.2486 4.14302C9.59605 3.73544 8.82464 3.5 8 3.5C5.65279 3.5 3.75 5.40279 3.75 7.75V10.0473C3.75 10.3645 4.00713 10.6216 4.32432 10.6216C4.64151 10.6216 4.89865 10.3645 4.89865 10.0473V7.75ZM11.7861 5.81757C11.6417 5.53515 11.2957 5.42326 11.0133 5.56765C10.7309 5.71205 10.619 6.05805 10.7634 6.34047C10.9793 6.76274 11.1014 7.24128 11.1014 7.75V9.12838C11.1014 9.44557 11.3585 9.7027 11.6757 9.7027C11.9929 9.7027 12.25 9.44557 12.25 9.12838V7.75C12.25 7.0553 12.0829 6.39796 11.7861 5.81757Z\" fill={'currentColor'} /></svg>;\n};\nBiometric.displayName = 'Biometric';\nBiometric.isGlyph = true;\nexport default Biometric;"],"names":["_templateObject","_templateObject2","sizeMap","small","default","large","xlarge","_excluded","Biometric","_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"],"mappings":"84CAOO,ICNHA,EAAiBC,EDMVC,EAAU,CACnBC,MAAO,GACPC,QAAS,GACTC,MAAO,GACPC,OAAQ,ICTV,IAAIC,EAAY,CAAC,YAAa,OAAQ,QAAS,aAAc,kBAAmB,OAAQ,QAUpFC,EAAY,SAAmBC,GACjC,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,+WAAQC,CAAyBX,EAAMF,GACrCc,EAAYC,EAAAA,IAAItB,IAAoBA,EAAkBuB,EAAuB,CAAC,oBAAqB,eAAgBP,GACnHQ,EAAeF,EAAGA,IAACrB,IAAqBA,EAAmBsB,EAAuB,CAAC,wCACnFE,EDZC,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,CCNwBC,CAAwBd,EAAM,YAAaU,EAAgBA,EAAgB,CAC/Ff,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,6mDACH1B,KAAM,iBAEV,SACAR,EAAUmC,YAAc,YACxBnC,EAAUoC,SAAU"}
|
package/dist/umd/Clone.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r(require("react"),require("@
|
|
1
|
+
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r(require("react"),require("@leafygreen-ui/emotion")):"function"==typeof define&&define.amd?define(["react","@leafygreen-ui/emotion"],r):(e="undefined"!=typeof globalThis?globalThis:e||self).leafyGreenIconClone=r(e.React,e.leafyGreenEmotion)}(this,function(e,r){"use strict";function t(e){if(e&&"object"==typeof e&&"default"in e)return e;var r=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}}),r.default=e,Object.freeze(r)}var n=t(e);function l(e,r,t){return(r=function(e){var r=function(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,r);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof r?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function a(){return a=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},a.apply(null,arguments)}function i(e,r){return r||(r=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(r)}}))}var o,f,c={small:14,default:16,large:20,xlarge:24};var u=["className","size","title","aria-label","aria-labelledby","fill","role"],b=function(e){var t=e.className,b=e.size,s=void 0===b?16:b,y=e.title,d=e["aria-label"],p=e["aria-labelledby"],m=e.fill,v=e.role,g=void 0===v?"img":v,O=function(e,r){if(null==e)return{};var t,n,l=function(e,r){if(null==e)return{};var t={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==r.indexOf(n))continue;t[n]=e[n]}return t}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],-1===r.indexOf(t)&&{}.propertyIsEnumerable.call(e,t)&&(l[t]=e[t])}return l}(e,u),h=r.css(o||(o=i(["\n color: ",";\n "])),m),j=r.css(f||(f=i(["\n flex-shrink: 0;\n "]))),w=function(e,r,t){var n,a=t["aria-label"],i=t["aria-labelledby"],o=t.title;switch(e){case"img":return a||i||o?l(l(l({},"aria-labelledby",i),"aria-label",a),"title",o):{"aria-label":(n=r,"".concat(n.replace(/([a-z])([A-Z])/g,"$1 $2")," Icon"))};case"presentation":return{"aria-hidden":!0,alt:""}}}(g,"Clone",l(l({title:y},"aria-label",d),"aria-labelledby",p));return n.createElement("svg",a({className:r.cx(l({},h,null!=m),j,t),height:"number"==typeof s?s:c[s],width:"number"==typeof s?s:c[s],role:g},w,O,{viewBox:"0 0 16 16"}),n.createElement("path",{d:"M5.5 12C5.5 13.1046 6.39543 14 7.5 14H12.5C13.6046 14 14.5 13.1046 14.5 12V8C14.5 6.89543 13.6046 6 12.5 6H7.5C6.39543 6 5.5 6.89543 5.5 8V12Z",fill:"currentColor"}),n.createElement("path",{d:"M4.25 10H3.5C2.39543 10 1.5 9.10457 1.5 8V4C1.5 2.89543 2.39543 2 3.5 2H8.5C9.60457 2 10.5 2.89543 10.5 4V4.75H8.5V4H3.5L3.5 8H4.25V10Z",fill:"currentColor"}))};return b.displayName="Clone",b.isGlyph=!0,b});
|
|
2
2
|
//# sourceMappingURL=Clone.js.map
|
package/dist/umd/Clone.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Clone.js","sources":["
|
|
1
|
+
{"version":3,"file":"Clone.js","sources":["../../src/glyphCommon.ts","../../src/generated/Clone.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 packages/icon/scripts/prebuild/index.ts\n* @checksum c49bb6f86ac38132c73ffe2cd13d6343\n*/\nimport * as React from \"react\";\nimport { css, cx } from '@leafygreen-ui/emotion';\nimport { generateAccessibleProps, sizeMap } from '../glyphCommon';\nimport { LGGlyph } from '../types';\nexport interface CloneProps extends LGGlyph.ComponentProps {}\nconst Clone = ({\n className,\n size = 16,\n title,\n ['aria-label']: ariaLabel,\n ['aria-labelledby']: ariaLabelledby,\n fill,\n role = 'img',\n ...props\n}: CloneProps) => {\n const fillStyle = css`\n color: ${fill};\n `;\n const noFlexShrink = css`\n flex-shrink: 0;\n `;\n const accessibleProps = generateAccessibleProps(role, 'Clone', {\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 d=\"M5.5 12C5.5 13.1046 6.39543 14 7.5 14H12.5C13.6046 14 14.5 13.1046 14.5 12V8C14.5 6.89543 13.6046 6 12.5 6H7.5C6.39543 6 5.5 6.89543 5.5 8V12Z\" fill={'currentColor'} /><path d=\"M4.25 10H3.5C2.39543 10 1.5 9.10457 1.5 8V4C1.5 2.89543 2.39543 2 3.5 2H8.5C9.60457 2 10.5 2.89543 10.5 4V4.75H8.5V4H3.5L3.5 8H4.25V10Z\" fill={'currentColor'} /></svg>;\n};\nClone.displayName = 'Clone';\nClone.isGlyph = true;\nexport default Clone;"],"names":["_templateObject","_templateObject2","sizeMap","small","default","large","xlarge","_excluded","Clone","_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","d","displayName","isGlyph"],"mappings":"04CAOO,ICNHA,EAAiBC,EDMVC,EAAU,CACnBC,MAAO,GACPC,QAAS,GACTC,MAAO,GACPC,OAAQ,ICTV,IAAIC,EAAY,CAAC,YAAa,OAAQ,QAAS,aAAc,kBAAmB,OAAQ,QAUpFC,EAAQ,SAAeC,GACzB,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,+WAAQC,CAAyBX,EAAMF,GACrCc,EAAYC,EAAAA,IAAItB,IAAoBA,EAAkBuB,EAAuB,CAAC,oBAAqB,eAAgBP,GACnHQ,EAAeF,EAAGA,IAACrB,IAAqBA,EAAmBsB,EAAuB,CAAC,wCACnFE,EDZC,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,CCNwBC,CAAwBd,EAAM,QAASU,EAAgBA,EAAgB,CAC3Ff,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,EAAG,iJACHxB,KAAM,iBACSiB,EAAMC,cAAc,OAAQ,CAC3CM,EAAG,0IACHxB,KAAM,iBAEV,SACAR,EAAMiC,YAAc,QACpBjC,EAAMkC,SAAU"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r(require("react"),require("@
|
|
1
|
+
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r(require("react"),require("@leafygreen-ui/emotion")):"function"==typeof define&&define.amd?define(["react","@leafygreen-ui/emotion"],r):(e="undefined"!=typeof globalThis?globalThis:e||self).leafyGreenIconSortDescending=r(e.React,e.leafyGreenEmotion)}(this,function(e,r){"use strict";function t(e){if(e&&"object"==typeof e&&"default"in e)return e;var r=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}}),r.default=e,Object.freeze(r)}var n=t(e);function l(e,r,t){return(r=function(e){var r=function(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,r);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof r?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function a(){return a=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},a.apply(null,arguments)}function i(e,r){return r||(r=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(r)}}))}var o,c,f={small:14,default:16,large:20,xlarge:24};var u=["className","size","title","aria-label","aria-labelledby","fill","role"],s=function(e){var t=e.className,s=e.size,b=void 0===s?16:s,d=e.title,y=e["aria-label"],p=e["aria-labelledby"],m=e.fill,v=e.role,g=void 0===v?"img":v,C=function(e,r){if(null==e)return{};var t,n,l=function(e,r){if(null==e)return{};var t={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==r.indexOf(n))continue;t[n]=e[n]}return t}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],-1===r.indexOf(t)&&{}.propertyIsEnumerable.call(e,t)&&(l[t]=e[t])}return l}(e,u),h=r.css(o||(o=i(["\n color: ",";\n "])),m),O=r.css(c||(c=i(["\n flex-shrink: 0;\n "]))),j=function(e,r,t){var n,a=t["aria-label"],i=t["aria-labelledby"],o=t.title;switch(e){case"img":return a||i||o?l(l(l({},"aria-labelledby",i),"aria-label",a),"title",o):{"aria-label":(n=r,"".concat(n.replace(/([a-z])([A-Z])/g,"$1 $2")," Icon"))};case"presentation":return{"aria-hidden":!0,alt:""}}}(g,"SortDescending",l(l({title:d},"aria-label",y),"aria-labelledby",p));return n.createElement("svg",a({className:r.cx(l({},h,null!=m),O,t),height:"number"==typeof b?b:f[b],width:"number"==typeof b?b:f[b],role:g},j,C,{viewBox:"0 0 16 16"}),n.createElement("path",{d:"M4.44991 14.6959C4.23029 14.8861 3.90429 14.8861 3.68466 14.6959L1.20302 12.5467C0.793944 12.1925 1.04449 11.5205 1.58564 11.5205H2.89835V2.16894C2.89835 1.52335 3.4217 1 4.06729 1C4.71287 1 5.23623 1.52335 5.23623 2.16894V11.5205H6.54893C7.09009 11.5205 7.34063 12.1925 6.93156 12.5467L4.44991 14.6959Z",fill:"currentColor"}),n.createElement("path",{d:"M8 3C7.44772 3 7 3.44772 7 4C7 4.55229 7.44772 5 8 5H14C14.5523 5 15 4.55229 15 4C15 3.44772 14.5523 3 14 3H8Z",fill:"currentColor"}),n.createElement("path",{d:"M7 7C7 6.44772 7.44772 6 8 6H12C12.5523 6 13 6.44772 13 7C13 7.55229 12.5523 8 12 8H8C7.44772 8 7 7.55229 7 7Z",fill:"currentColor"}),n.createElement("path",{d:"M8 9C7.44772 9 7 9.44771 7 10C7 10.5523 7.44772 11 8 11H10C10.5523 11 11 10.5523 11 10C11 9.44771 10.5523 9 10 9H8Z",fill:"currentColor"}))};return s.displayName="SortDescending",s.isGlyph=!0,s});
|
|
2
2
|
//# sourceMappingURL=SortDescending.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortDescending.js","sources":["
|
|
1
|
+
{"version":3,"file":"SortDescending.js","sources":["../../src/glyphCommon.ts","../../src/generated/SortDescending.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 packages/icon/scripts/prebuild/index.ts\n* @checksum 77ca38381a8dfb3d248f686f85aae34c\n*/\nimport * as React from \"react\";\nimport { css, cx } from '@leafygreen-ui/emotion';\nimport { generateAccessibleProps, sizeMap } from '../glyphCommon';\nimport { LGGlyph } from '../types';\nexport interface SortDescendingProps extends LGGlyph.ComponentProps {}\nconst SortDescending = ({\n className,\n size = 16,\n title,\n ['aria-label']: ariaLabel,\n ['aria-labelledby']: ariaLabelledby,\n fill,\n role = 'img',\n ...props\n}: SortDescendingProps) => {\n const fillStyle = css`\n color: ${fill};\n `;\n const noFlexShrink = css`\n flex-shrink: 0;\n `;\n const accessibleProps = generateAccessibleProps(role, 'SortDescending', {\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 d=\"M4.44991 14.6959C4.23029 14.8861 3.90429 14.8861 3.68466 14.6959L1.20302 12.5467C0.793944 12.1925 1.04449 11.5205 1.58564 11.5205H2.89835V2.16894C2.89835 1.52335 3.4217 1 4.06729 1C4.71287 1 5.23623 1.52335 5.23623 2.16894V11.5205H6.54893C7.09009 11.5205 7.34063 12.1925 6.93156 12.5467L4.44991 14.6959Z\" fill={'currentColor'} /><path d=\"M8 3C7.44772 3 7 3.44772 7 4C7 4.55229 7.44772 5 8 5H14C14.5523 5 15 4.55229 15 4C15 3.44772 14.5523 3 14 3H8Z\" fill={'currentColor'} /><path d=\"M7 7C7 6.44772 7.44772 6 8 6H12C12.5523 6 13 6.44772 13 7C13 7.55229 12.5523 8 12 8H8C7.44772 8 7 7.55229 7 7Z\" fill={'currentColor'} /><path d=\"M8 9C7.44772 9 7 9.44771 7 10C7 10.5523 7.44772 11 8 11H10C10.5523 11 11 10.5523 11 10C11 9.44771 10.5523 9 10 9H8Z\" fill={'currentColor'} /></svg>;\n};\nSortDescending.displayName = 'SortDescending';\nSortDescending.isGlyph = true;\nexport default SortDescending;"],"names":["_templateObject","_templateObject2","sizeMap","small","default","large","xlarge","_excluded","SortDescending","_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","d","displayName","isGlyph"],"mappings":"m5CAOO,ICNHA,EAAiBC,EDMVC,EAAU,CACnBC,MAAO,GACPC,QAAS,GACTC,MAAO,GACPC,OAAQ,ICTV,IAAIC,EAAY,CAAC,YAAa,OAAQ,QAAS,aAAc,kBAAmB,OAAQ,QAUpFC,EAAiB,SAAwBC,GAC3C,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,+WAAQC,CAAyBX,EAAMF,GACrCc,EAAYC,EAAAA,IAAItB,IAAoBA,EAAkBuB,EAAuB,CAAC,oBAAqB,eAAgBP,GACnHQ,EAAeF,EAAGA,IAACrB,IAAqBA,EAAmBsB,EAAuB,CAAC,wCACnFE,EDZC,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,CCNwBC,CAAwBd,EAAM,iBAAkBU,EAAgBA,EAAgB,CACpGf,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,EAAG,kTACHxB,KAAM,iBACSiB,EAAMC,cAAc,OAAQ,CAC3CM,EAAG,iHACHxB,KAAM,iBACSiB,EAAMC,cAAc,OAAQ,CAC3CM,EAAG,iHACHxB,KAAM,iBACSiB,EAAMC,cAAc,OAAQ,CAC3CM,EAAG,sHACHxB,KAAM,iBAEV,SACAR,EAAeiC,YAAc,iBAC7BjC,EAAekC,SAAU"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafygreen-ui/icon",
|
|
3
|
-
"version": "14.6.
|
|
3
|
+
"version": "14.6.1",
|
|
4
4
|
"description": "LeafyGreen UI Kit Icons",
|
|
5
5
|
"main": "./dist/umd/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -29,22 +29,24 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"lodash": "^4.17.21",
|
|
32
|
-
"@leafygreen-ui/emotion": "^5.0
|
|
32
|
+
"@leafygreen-ui/emotion": "^5.1.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
+
"@rollup/plugin-node-resolve": "15.1.0",
|
|
35
36
|
"@svgr/core": "^5.3.1",
|
|
36
37
|
"@types/xml2json": "^0.11.0",
|
|
37
38
|
"commander": "^11.0.0",
|
|
39
|
+
"fs-extra": "11.1.1",
|
|
40
|
+
"p-queue": "^8.1.0",
|
|
38
41
|
"rollup": "4.16.1",
|
|
42
|
+
"rollup-plugin-node-externals": "7.1.1",
|
|
39
43
|
"ts-node": "^10.9.2",
|
|
40
44
|
"xml2json": "^0.12.0",
|
|
41
|
-
"
|
|
42
|
-
"fs-extra": "11.1.1",
|
|
43
|
-
"@leafygreen-ui/lib": "^15.6.1",
|
|
44
|
-
"@leafygreen-ui/palette": "^5.0.2",
|
|
45
|
+
"@leafygreen-ui/lib": "^15.6.2",
|
|
45
46
|
"@lg-tools/build": "^0.8.3",
|
|
47
|
+
"@leafygreen-ui/palette": "^5.0.2",
|
|
46
48
|
"@lg-tools/lint": "^3.1.0",
|
|
47
|
-
"@lg-tools/storybook-utils": "^0.3.
|
|
49
|
+
"@lg-tools/storybook-utils": "^0.3.3"
|
|
48
50
|
},
|
|
49
51
|
"gitHead": "dd71a2d404218ccec2e657df9c0263dc1c15b9e0",
|
|
50
52
|
"homepage": "https://github.com/mongodb/leafygreen-ui/tree/main/packages/icon",
|
|
@@ -59,6 +61,7 @@
|
|
|
59
61
|
"scripts": {
|
|
60
62
|
"prebuild": "ts-node ./scripts/prebuild/index.ts",
|
|
61
63
|
"build": "ts-node ./scripts/build/build.ts",
|
|
64
|
+
"postbuild": "ts-node ./scripts/postbuild/index.ts",
|
|
62
65
|
"tsc": "lg-build tsc",
|
|
63
66
|
"docs": "lg-build docs"
|
|
64
67
|
}
|
|
@@ -10,6 +10,8 @@ async function getBatchBuildOptions(
|
|
|
10
10
|
'@lg-tools/build/config/utils/constructUMDGlobalName.mjs'
|
|
11
11
|
);
|
|
12
12
|
|
|
13
|
+
const { nodeExternals } = await import('rollup-plugin-node-externals');
|
|
14
|
+
|
|
13
15
|
const { esmConfig, umdConfig } = await import(
|
|
14
16
|
'@lg-tools/build/config/rollup.config.mjs'
|
|
15
17
|
);
|
|
@@ -20,6 +22,11 @@ async function getBatchBuildOptions(
|
|
|
20
22
|
...esmConfig,
|
|
21
23
|
input: batch.map(icon => `${GENERATED_DIR}/${icon}.tsx`),
|
|
22
24
|
output: [esmConfig.output],
|
|
25
|
+
plugins: [
|
|
26
|
+
// Ensure @emotion packages are externalized (not bundled into icons)
|
|
27
|
+
nodeExternals({ deps: true, include: [/@emotion/] }),
|
|
28
|
+
...esmConfig.plugins,
|
|
29
|
+
],
|
|
23
30
|
},
|
|
24
31
|
// UMD builds need a single input file
|
|
25
32
|
...batch.map(iconName => {
|
|
@@ -33,6 +40,11 @@ async function getBatchBuildOptions(
|
|
|
33
40
|
dir: `dist/umd`,
|
|
34
41
|
},
|
|
35
42
|
],
|
|
43
|
+
plugins: [
|
|
44
|
+
// Ensure @emotion packages are externalized (not bundled into icons)
|
|
45
|
+
nodeExternals({ deps: true, include: [/@emotion/] }),
|
|
46
|
+
...umdConfig.plugins,
|
|
47
|
+
],
|
|
36
48
|
};
|
|
37
49
|
}),
|
|
38
50
|
];
|
|
@@ -45,16 +57,13 @@ export async function buildBatch(
|
|
|
45
57
|
batch: Array<string>,
|
|
46
58
|
verbose = false,
|
|
47
59
|
): Promise<void> {
|
|
60
|
+
verbose && console.log('Building batch', batch);
|
|
48
61
|
try {
|
|
49
62
|
const rollupConfigs = await getBatchBuildOptions(batch);
|
|
50
63
|
|
|
51
64
|
for (const config of rollupConfigs) {
|
|
52
65
|
const bundle = await rollup(config);
|
|
53
66
|
|
|
54
|
-
if (verbose) {
|
|
55
|
-
console.log(bundle.watchFiles);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
67
|
await Promise.all(config.output.map(bundle.write));
|
|
59
68
|
await bundle.close();
|
|
60
69
|
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Validates that built icon files do not import @emotion packages directly.
|
|
7
|
+
* Icons should only depend on @leafygreen-ui/emotion, not @emotion/* packages.
|
|
8
|
+
*/
|
|
9
|
+
function validateBuiltIcons(): void {
|
|
10
|
+
const distDirs = ['dist/esm', 'dist/umd'];
|
|
11
|
+
const emotionPattern = /@emotion\//g;
|
|
12
|
+
let hasErrors = false;
|
|
13
|
+
const errors: Array<{ file: string; matches: Array<string> }> = [];
|
|
14
|
+
|
|
15
|
+
console.log('Validating built icons...\n');
|
|
16
|
+
|
|
17
|
+
for (const distDir of distDirs) {
|
|
18
|
+
const fullPath = path.join(process.cwd(), distDir);
|
|
19
|
+
|
|
20
|
+
if (!fs.existsSync(fullPath)) {
|
|
21
|
+
console.warn(`Warning: ${distDir} directory does not exist. Skipping...`);
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const files = fs.readdirSync(fullPath);
|
|
26
|
+
const jsFiles = files.filter(file => file.endsWith('.js'));
|
|
27
|
+
|
|
28
|
+
for (const file of jsFiles) {
|
|
29
|
+
// Skip the main index file and glyphCommon as they may have different rules
|
|
30
|
+
if (file === 'index.js' || file === 'glyphCommon.js') {
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const filePath = path.join(fullPath, file);
|
|
35
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
36
|
+
|
|
37
|
+
// Check for @emotion imports/requires
|
|
38
|
+
const matches = content.match(emotionPattern);
|
|
39
|
+
|
|
40
|
+
if (matches) {
|
|
41
|
+
hasErrors = true;
|
|
42
|
+
const uniqueMatches = Array.from(new Set(matches));
|
|
43
|
+
errors.push({ file: `${distDir}/${file}`, matches: uniqueMatches });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (hasErrors) {
|
|
49
|
+
console.error('❌ ERROR: Found @emotion imports in built icon files!\n');
|
|
50
|
+
console.error(
|
|
51
|
+
'Icons should only depend on @leafygreen-ui/emotion, not @emotion/* packages directly.\n',
|
|
52
|
+
);
|
|
53
|
+
console.error('Files with @emotion imports:');
|
|
54
|
+
for (const error of errors) {
|
|
55
|
+
console.error(` - ${error.file}`);
|
|
56
|
+
for (const match of error.matches) {
|
|
57
|
+
console.error(` → ${match}`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
console.error('\nThis indicates a build configuration issue.');
|
|
61
|
+
console.error(
|
|
62
|
+
'Check packages/icon/scripts/build/build-batch.ts for proper externalization rules.',
|
|
63
|
+
);
|
|
64
|
+
process.exit(1);
|
|
65
|
+
} else {
|
|
66
|
+
console.log('Icon builds OK \n');
|
|
67
|
+
process.exit(0);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
validateBuiltIcons();
|