@leafygreen-ui/icon 13.2.2 → 13.3.0
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 +10 -0
- package/README.md +7 -7
- package/dist/Guide.js +2 -0
- package/dist/Guide.js.map +1 -0
- package/dist/Resource.js +2 -0
- package/dist/Resource.js.map +1 -0
- package/dist/esm/Guide.js +2 -0
- package/dist/esm/Guide.js.map +1 -0
- package/dist/esm/Resource.js +2 -0
- package/dist/esm/Resource.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/generated/Guide.d.ts +17 -0
- package/dist/generated/Guide.d.ts.map +1 -0
- package/dist/generated/Resource.d.ts +17 -0
- package/dist/generated/Resource.d.ts.map +1 -0
- package/dist/glyphs/index.d.ts +9 -1
- package/dist/glyphs/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/generated/Guide.tsx +39 -0
- package/src/generated/Resource.tsx +39 -0
- package/src/glyphs/Guide.svg +5 -0
- package/src/glyphs/Resource.svg +5 -0
- package/src/glyphs/index.ts +4 -0
- package/stories.js +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -49,13 +49,13 @@ const OneImport = () => <PlusIcon />;
|
|
|
49
49
|
|
|
50
50
|
## Properties
|
|
51
51
|
|
|
52
|
-
| Prop | Type
|
|
53
|
-
| ------------------ |
|
|
54
|
-
| `glyph` (Required) | "ActivityFeed", "AddFile", "AllProducts", "AnalyticsNode", "Apps", "Array", "ArrowDown", "ArrowLeft", "ArrowRight", "ArrowUp", "Beaker", "Bell", "Biometric", "Boolean", "Building", "Bulb", "Calendar", "Camera", "Cap", "CaretDown", "CaretLeft", "CaretRight", "CaretUp", "ChartFilled", "Charts", "Checkmark", "CheckmarkWithCircle", "ChevronDown", "ChevronLeft", "ChevronRight", "ChevronUp", "Circle", "Clock", "ClockWithArrow", "Clone", "Cloud", "Code", "CodeBlock", "Coin", "Colon", "Config", "Connect", "Copy", "CreditCard", "CurlyBraces", "Cursor", "Dashboard", "Database", "Diagram", "Diagram2", "Diagram3", "Disconnect", "Download", "Drag", "Edit", "Ellipsis", "Email", "EmptyDatabase", "EmptyFolder", "Eraser", "Escalation", "Export", "Favorite", "Federation", "File", "Filter", "Folder", "Format", "FullScreenEnter", "FullScreenExit", "Function", "Gauge", "GlobeAmericas", "GovernmentBuilding", "Hash", "HiddenSecondaryNode", "Highlight", "Home", "HorizontalDrag", "Import", "ImportantWithCircle", "InfoWithCircle", "InternalEmployee", "InviteUser", "Key", "Laptop", "LightningBolt", "Link", "List", "Lock", "LogIn", "LogOut", "MagnifyingGlass", "Megaphone", "Menu", "Minus", "Mobile", "Moon", "MultiDirectionArrow", "MultiLayers", "NavCollapse", "NavExpand", "NoFilter", "NotAllowed", "Note", "NumberedList", "OpenNewTab", "OutlineFavorite", "Package", "Pause", "Pending", "Person", "PersonGroup", "PersonWithLock", "Pin", "Play", "Plus", "PlusWithCircle", "Primary", "Project", "QuestionMarkWithCircle", "Read", "Recommended", "Redo", "Refresh", "Relationship", "ReplicaSet", "Resize", "Return", "Revert", "Router", "SMS", "Save", "SearchIndex", "Secondary", "Serverless", "Settings", "ShardedCluster", "Shell", "Shirt", "SortAscending", "SortDescending", "Sparkle", "SplitHorizontal", "SplitVertical", "Stitch", "Stop", "String", "Sun", "Support", "Sweep", "Table", "Tag", "TemporaryTable", "ThumbsDown", "ThumbsUp", "TimeSeries", "TimeSeriesCollection", "Trash", "Undo", "University", "Unlock", "Unsorted", "UpDownCarets", "Upload", "VerticalEllipsis", "View", "Visibility", "VisibilityOff", "Warning", "Wizard", "Wrench", "Write", "X", "XWithCircle" | Specifies the glyph to use. | |
|
|
55
|
-
| `size` | `'small'`, `'default'`, `'large'`, `'xlarge'`, `number`
|
|
56
|
-
| `fill` | `string`
|
|
57
|
-
| `title` | `string`, `boolean`, `null`
|
|
58
|
-
| ... | `SVGR.ComponentProps`
|
|
52
|
+
| Prop | Type | Description | Default |
|
|
53
|
+
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
|
|
54
|
+
| `glyph` (Required) | "ActivityFeed", "AddFile", "AllProducts", "AnalyticsNode", "Apps", "Array", "ArrowDown", "ArrowLeft", "ArrowRight", "ArrowUp", "Beaker", "Bell", "Biometric", "Boolean", "Building", "Bulb", "Calendar", "Camera", "Cap", "CaretDown", "CaretLeft", "CaretRight", "CaretUp", "ChartFilled", "Charts", "Checkmark", "CheckmarkWithCircle", "ChevronDown", "ChevronLeft", "ChevronRight", "ChevronUp", "Circle", "Clock", "ClockWithArrow", "Clone", "Cloud", "Code", "CodeBlock", "Coin", "Colon", "Config", "Connect", "Copy", "CreditCard", "CurlyBraces", "Cursor", "Dashboard", "Database", "Diagram", "Diagram2", "Diagram3", "Disconnect", "Download", "Drag", "Edit", "Ellipsis", "Email", "EmptyDatabase", "EmptyFolder", "Eraser", "Escalation", "Export", "Favorite", "Federation", "File", "Filter", "Folder", "Format", "FullScreenEnter", "FullScreenExit", "Function", "Gauge", "GlobeAmericas", "GovernmentBuilding", "Guide", "Hash", "HiddenSecondaryNode", "Highlight", "Home", "HorizontalDrag", "Import", "ImportantWithCircle", "InfoWithCircle", "InternalEmployee", "InviteUser", "Key", "Laptop", "LightningBolt", "Link", "List", "Lock", "LogIn", "LogOut", "MagnifyingGlass", "Megaphone", "Menu", "Minus", "Mobile", "Moon", "MultiDirectionArrow", "MultiLayers", "NavCollapse", "NavExpand", "NoFilter", "NotAllowed", "Note", "NumberedList", "OpenNewTab", "OutlineFavorite", "Package", "Pause", "Pending", "Person", "PersonGroup", "PersonWithLock", "Pin", "Play", "Plus", "PlusWithCircle", "Primary", "Project", "QuestionMarkWithCircle", "Read", "Recommended", "Redo", "Refresh", "Relationship", "ReplicaSet", "Resize", "Resource", "Return", "Revert", "Router", "SMS", "Save", "SearchIndex", "Secondary", "Serverless", "Settings", "ShardedCluster", "Shell", "Shirt", "SortAscending", "SortDescending", "Sparkle", "SplitHorizontal", "SplitVertical", "Stitch", "Stop", "String", "Sun", "Support", "Sweep", "Table", "Tag", "TemporaryTable", "ThumbsDown", "ThumbsUp", "TimeSeries", "TimeSeriesCollection", "Trash", "Undo", "University", "Unlock", "Unsorted", "UpDownCarets", "Upload", "VerticalEllipsis", "View", "Visibility", "VisibilityOff", "Warning", "Wizard", "Wrench", "Write", "X", "XWithCircle" | Specifies the glyph to use. | |
|
|
55
|
+
| `size` | `'small'`, `'default'`, `'large'`, `'xlarge'`, `number` | The height and width of the glyph's viewBox. This can be any `number` or one of the following `'small'`, `'default'`, `'large'`, `'xlarge'` | `'default'` |
|
|
56
|
+
| `fill` | `string` | The fill color that is passed to the glyph. By default, the glyph will inherit its fill from the CSS color property of its nearest ancestor. | |
|
|
57
|
+
| `title` | `string`, `boolean`, `null` | Renders a title tag with the passed string within the SVG element for screen reader accessibility. Setting this value to `false` will entirely unset the title. <br />If title is `undefined` or `null`, a human-readable title will be generated based on the glyph's name. | |
|
|
58
|
+
| ... | `SVGR.ComponentProps` | All other props will be spread on the `svg` element | |
|
|
59
59
|
|
|
60
60
|
# createIconComponent
|
|
61
61
|
|
package/dist/Guide.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
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).Guide=e.Guide||{},e.Guide.js=r(e.React,e["@leafygreen-ui/emotion"]))}(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 l=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,l.get?l:{enumerable:!0,get:function(){return e[t]}})}})),r.default=e,Object.freeze(r)}var l=t(e);function n(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=n(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 l in t)Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l])}return e},a.apply(this,arguments)}function o(e,r){if(null==e)return{};var t,l,n=function(e,r){if(null==e)return{};var t,l,n={},i=Object.keys(e);for(l=0;l<i.length;l++)t=i[l],r.indexOf(t)>=0||(n[t]=e[t]);return n}(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)&&(n[t]=e[t])}return n}function u(e,r){return r||(r=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(r)}}))}var c,f,b={small:14,default:16,large:20,xlarge:24};var s=["className","size","title","aria-label","aria-labelledby","fill","role"],d=function(e){var t=e.className,n=e.size,d=void 0===n?16:n,p=e.title,y=e["aria-label"],m=e["aria-labelledby"],C=e.fill,v=e.role,g=void 0===v?"img":v,O=o(e,s),j=r.css(c||(c=u(["\n color: ",";\n "])),C),h=r.css(f||(f=u(["\n flex-shrink: 0;\n "]))),H=function(e,r,t){var l,n=t["aria-label"],a=t["aria-labelledby"],o=t.title;switch(e){case"img":return n||a||o?i(i(i({},"aria-labelledby",a),"aria-label",n),"title",o):{"aria-label":(l=r,"".concat(l.replace(/([a-z])([A-Z])/g,"$1 $2")," Icon"))};case"presentation":return{"aria-hidden":!0,alt:""}}}(g,"Guide",i(i({title:p},"aria-label",y),"aria-labelledby",m));return l.createElement("svg",a({className:r.cx(i({},j,null!=C),h,t),height:"number"==typeof d?d:b[d],width:"number"==typeof d?d:b[d],role:g},H,O,{viewBox:"0 0 16 16"}),l.createElement("path",{d:"M5.37041 4.32956C5.03839 4.32956 4.76923 4.61178 4.76923 4.95993C4.76923 5.30808 5.03839 5.5903 5.37041 5.5903H8.17592C8.50794 5.5903 8.7771 5.30808 8.7771 4.95993C8.7771 4.61178 8.50794 4.32956 8.17592 4.32956H5.37041Z",fill:"currentColor"}),l.createElement("path",{d:"M5.37041 6.4308C5.03839 6.4308 4.76923 6.71303 4.76923 7.06117C4.76923 7.40932 5.03839 7.69155 5.37041 7.69155H6.97356C7.30558 7.69155 7.57474 7.40932 7.57474 7.06117C7.57474 6.71303 7.30558 6.4308 6.97356 6.4308H5.37041Z",fill:"currentColor"}),l.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.4956 2.86667V7.73074C12.952 8.2308 14 9.62499 14 11.2667C14 13.3285 12.3469 15 10.3077 15C8.97652 15 7.80987 14.2877 7.16021 13.2195H3.84615C2.82655 13.2195 2 12.3838 2 11.3529V2.86666C2 1.83573 2.82655 1 3.84615 1H9.64941C10.669 1 11.4956 1.83574 11.4956 2.86667ZM3.84615 2.86666L9.64941 2.86667L9.64941 7.59249C7.92428 7.9064 6.61538 9.43198 6.61538 11.2667C6.61538 11.2955 6.61571 11.3242 6.61635 11.3529H3.84615L3.84615 2.86666ZM10.8352 9.13333C10.8352 9.42789 10.599 9.66667 10.3077 9.66667C10.0164 9.66667 9.78022 9.42789 9.78022 9.13333C9.78022 8.83878 10.0164 8.6 10.3077 8.6C10.599 8.6 10.8352 8.83878 10.8352 9.13333ZM10.3077 10.2C10.599 10.2 10.8352 10.4388 10.8352 10.7333V12.8667H11.0989C11.2446 12.8667 11.3626 12.9861 11.3626 13.1333C11.3626 13.2806 11.2446 13.4 11.0989 13.4H9.51648C9.37083 13.4 9.25275 13.2806 9.25275 13.1333C9.25275 12.9861 9.37083 12.8667 9.51648 12.8667H9.78022V10.7333H9.51648C9.37083 10.7333 9.25275 10.6139 9.25275 10.4667C9.25275 10.3194 9.37083 10.2 9.51648 10.2H10.3077Z",fill:"currentColor"}))};return d.displayName="Guide",d.isGlyph=!0,d}));
|
|
2
|
+
//# sourceMappingURL=Guide.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Guide.js","sources":["../src/glyphCommon.ts","../src/generated/Guide.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.ts\n* @checksum 18812b652dec3c87cd0064139d828f55\n*/\nimport * as React from \"react\";\nimport { css, cx } from '@leafygreen-ui/emotion';\nimport { generateAccessibleProps, sizeMap } from '../glyphCommon';\nimport { LGGlyph } from '../types';\nexport interface GuideProps extends LGGlyph.ComponentProps {}\nconst Guide = ({\n className,\n size = 16,\n title,\n ['aria-label']: ariaLabel,\n ['aria-labelledby']: ariaLabelledby,\n fill,\n role = 'img',\n ...props\n}: GuideProps) => {\n const fillStyle = css`\n color: ${fill};\n `;\n const noFlexShrink = css`\n flex-shrink: 0;\n `;\n const accessibleProps = generateAccessibleProps(role, 'Guide', {\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.37041 4.32956C5.03839 4.32956 4.76923 4.61178 4.76923 4.95993C4.76923 5.30808 5.03839 5.5903 5.37041 5.5903H8.17592C8.50794 5.5903 8.7771 5.30808 8.7771 4.95993C8.7771 4.61178 8.50794 4.32956 8.17592 4.32956H5.37041Z\" fill={'currentColor'} /><path d=\"M5.37041 6.4308C5.03839 6.4308 4.76923 6.71303 4.76923 7.06117C4.76923 7.40932 5.03839 7.69155 5.37041 7.69155H6.97356C7.30558 7.69155 7.57474 7.40932 7.57474 7.06117C7.57474 6.71303 7.30558 6.4308 6.97356 6.4308H5.37041Z\" fill={'currentColor'} /><path fillRule=\"evenodd\" clipRule=\"evenodd\" d=\"M11.4956 2.86667V7.73074C12.952 8.2308 14 9.62499 14 11.2667C14 13.3285 12.3469 15 10.3077 15C8.97652 15 7.80987 14.2877 7.16021 13.2195H3.84615C2.82655 13.2195 2 12.3838 2 11.3529V2.86666C2 1.83573 2.82655 1 3.84615 1H9.64941C10.669 1 11.4956 1.83574 11.4956 2.86667ZM3.84615 2.86666L9.64941 2.86667L9.64941 7.59249C7.92428 7.9064 6.61538 9.43198 6.61538 11.2667C6.61538 11.2955 6.61571 11.3242 6.61635 11.3529H3.84615L3.84615 2.86666ZM10.8352 9.13333C10.8352 9.42789 10.599 9.66667 10.3077 9.66667C10.0164 9.66667 9.78022 9.42789 9.78022 9.13333C9.78022 8.83878 10.0164 8.6 10.3077 8.6C10.599 8.6 10.8352 8.83878 10.8352 9.13333ZM10.3077 10.2C10.599 10.2 10.8352 10.4388 10.8352 10.7333V12.8667H11.0989C11.2446 12.8667 11.3626 12.9861 11.3626 13.1333C11.3626 13.2806 11.2446 13.4 11.0989 13.4H9.51648C9.37083 13.4 9.25275 13.2806 9.25275 13.1333C9.25275 12.9861 9.37083 12.8667 9.51648 12.8667H9.78022V10.7333H9.51648C9.37083 10.7333 9.25275 10.6139 9.25275 10.4667C9.25275 10.3194 9.37083 10.2 9.51648 10.2H10.3077Z\" fill={'currentColor'} /></svg>;\n};\nGuide.displayName = 'Guide';\nGuide.isGlyph = true;\nexport default Guide;"],"names":["_templateObject","_templateObject2","sizeMap","small","default","large","xlarge","_excluded","Guide","_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","fillRule","clipRule","displayName","isGlyph"],"mappings":"myDAOO,ICNHA,EAAiBC,EDMVC,EAAU,CACnBC,MAAO,GACPC,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BN,EAAO,CACzBoB,QAAS,cACMN,EAAMC,cAAc,OAAQ,CAC3CM,EAAG,8NACHxB,KAAM,iBACSiB,EAAMC,cAAc,OAAQ,CAC3CM,EAAG,gOACHxB,KAAM,iBACSiB,EAAMC,cAAc,OAAQ,CAC3CO,SAAU,UACVC,SAAU,UACVF,EAAG,6/BACHxB,KAAM,iBAEV,SACAR,EAAMmC,YAAc,QACpBnC,EAAMoC,SAAU"}
|
package/dist/Resource.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
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).Resource=e.Resource||{},e.Resource.js=r(e.React,e["@leafygreen-ui/emotion"]))}(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 l=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,l.get?l:{enumerable:!0,get:function(){return e[t]}})}})),r.default=e,Object.freeze(r)}var l=t(e);function n(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=n(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 l in t)Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l])}return e},a.apply(this,arguments)}function o(e,r){if(null==e)return{};var t,l,n=function(e,r){if(null==e)return{};var t,l,n={},i=Object.keys(e);for(l=0;l<i.length;l++)t=i[l],r.indexOf(t)>=0||(n[t]=e[t]);return n}(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)&&(n[t]=e[t])}return n}function u(e,r){return r||(r=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(r)}}))}var c,f,s={small:14,default:16,large:20,xlarge:24};var b=["className","size","title","aria-label","aria-labelledby","fill","role"],d=function(e){var t=e.className,n=e.size,d=void 0===n?16:n,p=e.title,y=e["aria-label"],v=e["aria-labelledby"],m=e.fill,g=e.role,O=void 0===g?"img":g,j=o(e,b),h=r.css(c||(c=u(["\n color: ",";\n "])),m),H=r.css(f||(f=u(["\n flex-shrink: 0;\n "]))),L=function(e,r,t){var l,n=t["aria-label"],a=t["aria-labelledby"],o=t.title;switch(e){case"img":return n||a||o?i(i(i({},"aria-labelledby",a),"aria-label",n),"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,"Resource",i(i({title:p},"aria-label",y),"aria-labelledby",v));return l.createElement("svg",a({className:r.cx(i({},h,null!=m),H,t),height:"number"==typeof d?d:s[d],width:"number"==typeof d?d:s[d],role:O},L,j,{viewBox:"0 0 16 16"}),l.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.09999 1.99998C5.71339 1.99998 5.39999 2.31338 5.39999 2.69998V13.3C5.39999 13.6866 5.71339 14 6.09999 14H8.19999C8.58659 14 8.89999 13.6866 8.89999 13.3V2.69998C8.89999 2.31338 8.58659 1.99998 8.19999 1.99998H6.09999ZM8.02499 2.99998H6.27499V3.99998H8.02499V2.99998ZM6.27499 4.99998H8.02499V5.49998H6.27499V4.99998ZM8.02499 12H6.27499V13H8.02499V12Z",fill:"currentColor"}),l.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.84432 2.35808C9.46647 2.4399 9.22758 2.81229 9.31074 3.18984L11.5698 13.4468C11.653 13.8243 12.0267 14.0641 12.4046 13.9823L14.4557 13.5381C14.8335 13.4563 15.0724 13.0839 14.9893 12.7064L12.7302 2.44944C12.647 2.07189 12.2733 1.83215 11.8954 1.91396L9.84432 2.35808ZM11.9381 2.91964L10.2283 3.28984L10.4417 4.25852L12.1514 3.88832L11.9381 2.91964ZM10.6551 5.22735L12.3648 4.85715L12.4715 5.34149L10.7618 5.71169L10.6551 5.22735ZM13.8583 11.6377L12.1485 12.0079L12.3619 12.9766L14.0716 12.6064L13.8583 11.6377Z",fill:"currentColor"}),l.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.09999 1.99998C1.71339 1.99998 1.39999 2.31338 1.39999 2.69998V13.3C1.39999 13.6866 1.71339 14 2.09999 14H4.19999C4.58659 14 4.89999 13.6866 4.89999 13.3V2.69998C4.89999 2.31338 4.58659 1.99998 4.19999 1.99998H2.09999ZM4.02499 2.99998H2.27499V3.99998H4.02499V2.99998ZM2.27499 4.99998H4.02499V5.49998H2.27499V4.99998ZM4.02499 12H2.27499V13H4.02499V12Z",fill:"currentColor"}))};return d.displayName="Resource",d.isGlyph=!0,d}));
|
|
2
|
+
//# sourceMappingURL=Resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Resource.js","sources":["../src/glyphCommon.ts","../src/generated/Resource.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.ts\n* @checksum dd1161fb99ad7a4495d5f8cbf225139b\n*/\nimport * as React from \"react\";\nimport { css, cx } from '@leafygreen-ui/emotion';\nimport { generateAccessibleProps, sizeMap } from '../glyphCommon';\nimport { LGGlyph } from '../types';\nexport interface ResourceProps extends LGGlyph.ComponentProps {}\nconst Resource = ({\n className,\n size = 16,\n title,\n ['aria-label']: ariaLabel,\n ['aria-labelledby']: ariaLabelledby,\n fill,\n role = 'img',\n ...props\n}: ResourceProps) => {\n const fillStyle = css`\n color: ${fill};\n `;\n const noFlexShrink = css`\n flex-shrink: 0;\n `;\n const accessibleProps = generateAccessibleProps(role, 'Resource', {\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.09999 1.99998C5.71339 1.99998 5.39999 2.31338 5.39999 2.69998V13.3C5.39999 13.6866 5.71339 14 6.09999 14H8.19999C8.58659 14 8.89999 13.6866 8.89999 13.3V2.69998C8.89999 2.31338 8.58659 1.99998 8.19999 1.99998H6.09999ZM8.02499 2.99998H6.27499V3.99998H8.02499V2.99998ZM6.27499 4.99998H8.02499V5.49998H6.27499V4.99998ZM8.02499 12H6.27499V13H8.02499V12Z\" fill={'currentColor'} /><path fillRule=\"evenodd\" clipRule=\"evenodd\" d=\"M9.84432 2.35808C9.46647 2.4399 9.22758 2.81229 9.31074 3.18984L11.5698 13.4468C11.653 13.8243 12.0267 14.0641 12.4046 13.9823L14.4557 13.5381C14.8335 13.4563 15.0724 13.0839 14.9893 12.7064L12.7302 2.44944C12.647 2.07189 12.2733 1.83215 11.8954 1.91396L9.84432 2.35808ZM11.9381 2.91964L10.2283 3.28984L10.4417 4.25852L12.1514 3.88832L11.9381 2.91964ZM10.6551 5.22735L12.3648 4.85715L12.4715 5.34149L10.7618 5.71169L10.6551 5.22735ZM13.8583 11.6377L12.1485 12.0079L12.3619 12.9766L14.0716 12.6064L13.8583 11.6377Z\" fill={'currentColor'} /><path fillRule=\"evenodd\" clipRule=\"evenodd\" d=\"M2.09999 1.99998C1.71339 1.99998 1.39999 2.31338 1.39999 2.69998V13.3C1.39999 13.6866 1.71339 14 2.09999 14H4.19999C4.58659 14 4.89999 13.6866 4.89999 13.3V2.69998C4.89999 2.31338 4.58659 1.99998 4.19999 1.99998H2.09999ZM4.02499 2.99998H2.27499V3.99998H4.02499V2.99998ZM2.27499 4.99998H4.02499V5.49998H2.27499V4.99998ZM4.02499 12H2.27499V13H4.02499V12Z\" fill={'currentColor'} /></svg>;\n};\nResource.displayName = 'Resource';\nResource.isGlyph = true;\nexport default Resource;"],"names":["_templateObject","_templateObject2","sizeMap","small","default","large","xlarge","_excluded","Resource","_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":"4yDAOO,ICNHA,EAAiBC,EDM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AAQU,GACjDM,KAAMA,GACLO,EAAiBN,EAAO,CACzBoB,QAAS,cACMN,EAAMC,cAAc,OAAQ,CAC3CM,SAAU,UACVC,SAAU,UACVC,EAAG,mWACH1B,KAAM,iBACSiB,EAAMC,cAAc,OAAQ,CAC3CM,SAAU,UACVC,SAAU,UACVC,EAAG,ogBACH1B,KAAM,iBACSiB,EAAMC,cAAc,OAAQ,CAC3CM,SAAU,UACVC,SAAU,UACVC,EAAG,mWACH1B,KAAM,iBAEV,SACAR,EAASmC,YAAc,WACvBnC,EAASoC,SAAU"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as e from"react";import{css as r,cx as t}from"@leafygreen-ui/emotion";function l(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 a(e,r,t){return(r=l(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 c,u,f={small:14,default:16,large:20,xlarge:24};var b=["className","size","title","aria-label","aria-labelledby","fill","role"],s=function(l){var s=l.className,p=l.size,C=void 0===p?16:p,d=l.title,m=l["aria-label"],y=l["aria-labelledby"],v=l.fill,g=l.role,h=void 0===g?"img":g,O=n(l,b),j=r(c||(c=o(["\n color: ",";\n "])),v),H=r(u||(u=o(["\n flex-shrink: 0;\n "]))),w=function(e,r,t){var l,i=t["aria-label"],n=t["aria-labelledby"],o=t.title;switch(e){case"img":return i||n||o?a(a(a({},"aria-labelledby",n),"aria-label",i),"title",o):{"aria-label":(l=r,"".concat(l.replace(/([a-z])([A-Z])/g,"$1 $2")," Icon"))};case"presentation":return{"aria-hidden":!0,alt:""}}}(h,"Guide",a(a({title:d},"aria-label",m),"aria-labelledby",y));return e.createElement("svg",i({className:t(a({},j,null!=v),H,s),height:"number"==typeof C?C:f[C],width:"number"==typeof C?C:f[C],role:h},w,O,{viewBox:"0 0 16 16"}),e.createElement("path",{d:"M5.37041 4.32956C5.03839 4.32956 4.76923 4.61178 4.76923 4.95993C4.76923 5.30808 5.03839 5.5903 5.37041 5.5903H8.17592C8.50794 5.5903 8.7771 5.30808 8.7771 4.95993C8.7771 4.61178 8.50794 4.32956 8.17592 4.32956H5.37041Z",fill:"currentColor"}),e.createElement("path",{d:"M5.37041 6.4308C5.03839 6.4308 4.76923 6.71303 4.76923 7.06117C4.76923 7.40932 5.03839 7.69155 5.37041 7.69155H6.97356C7.30558 7.69155 7.57474 7.40932 7.57474 7.06117C7.57474 6.71303 7.30558 6.4308 6.97356 6.4308H5.37041Z",fill:"currentColor"}),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.4956 2.86667V7.73074C12.952 8.2308 14 9.62499 14 11.2667C14 13.3285 12.3469 15 10.3077 15C8.97652 15 7.80987 14.2877 7.16021 13.2195H3.84615C2.82655 13.2195 2 12.3838 2 11.3529V2.86666C2 1.83573 2.82655 1 3.84615 1H9.64941C10.669 1 11.4956 1.83574 11.4956 2.86667ZM3.84615 2.86666L9.64941 2.86667L9.64941 7.59249C7.92428 7.9064 6.61538 9.43198 6.61538 11.2667C6.61538 11.2955 6.61571 11.3242 6.61635 11.3529H3.84615L3.84615 2.86666ZM10.8352 9.13333C10.8352 9.42789 10.599 9.66667 10.3077 9.66667C10.0164 9.66667 9.78022 9.42789 9.78022 9.13333C9.78022 8.83878 10.0164 8.6 10.3077 8.6C10.599 8.6 10.8352 8.83878 10.8352 9.13333ZM10.3077 10.2C10.599 10.2 10.8352 10.4388 10.8352 10.7333V12.8667H11.0989C11.2446 12.8667 11.3626 12.9861 11.3626 13.1333C11.3626 13.2806 11.2446 13.4 11.0989 13.4H9.51648C9.37083 13.4 9.25275 13.2806 9.25275 13.1333C9.25275 12.9861 9.37083 12.8667 9.51648 12.8667H9.78022V10.7333H9.51648C9.37083 10.7333 9.25275 10.6139 9.25275 10.4667C9.25275 10.3194 9.37083 10.2 9.51648 10.2H10.3077Z",fill:"currentColor"}))};s.displayName="Guide",s.isGlyph=!0;export{s as default};
|
|
2
|
+
//# sourceMappingURL=Guide.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Guide.js","sources":["../../src/glyphCommon.ts","../../src/generated/Guide.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.ts\n* @checksum 18812b652dec3c87cd0064139d828f55\n*/\nimport * as React from \"react\";\nimport { css, cx } from '@leafygreen-ui/emotion';\nimport { generateAccessibleProps, sizeMap } from '../glyphCommon';\nimport { LGGlyph } from '../types';\nexport interface GuideProps extends LGGlyph.ComponentProps {}\nconst Guide = ({\n className,\n size = 16,\n title,\n ['aria-label']: ariaLabel,\n ['aria-labelledby']: ariaLabelledby,\n fill,\n role = 'img',\n ...props\n}: GuideProps) => {\n const fillStyle = css`\n color: ${fill};\n `;\n const noFlexShrink = css`\n flex-shrink: 0;\n `;\n const accessibleProps = generateAccessibleProps(role, 'Guide', {\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.37041 4.32956C5.03839 4.32956 4.76923 4.61178 4.76923 4.95993C4.76923 5.30808 5.03839 5.5903 5.37041 5.5903H8.17592C8.50794 5.5903 8.7771 5.30808 8.7771 4.95993C8.7771 4.61178 8.50794 4.32956 8.17592 4.32956H5.37041Z\" fill={'currentColor'} /><path d=\"M5.37041 6.4308C5.03839 6.4308 4.76923 6.71303 4.76923 7.06117C4.76923 7.40932 5.03839 7.69155 5.37041 7.69155H6.97356C7.30558 7.69155 7.57474 7.40932 7.57474 7.06117C7.57474 6.71303 7.30558 6.4308 6.97356 6.4308H5.37041Z\" fill={'currentColor'} /><path fillRule=\"evenodd\" clipRule=\"evenodd\" d=\"M11.4956 2.86667V7.73074C12.952 8.2308 14 9.62499 14 11.2667C14 13.3285 12.3469 15 10.3077 15C8.97652 15 7.80987 14.2877 7.16021 13.2195H3.84615C2.82655 13.2195 2 12.3838 2 11.3529V2.86666C2 1.83573 2.82655 1 3.84615 1H9.64941C10.669 1 11.4956 1.83574 11.4956 2.86667ZM3.84615 2.86666L9.64941 2.86667L9.64941 7.59249C7.92428 7.9064 6.61538 9.43198 6.61538 11.2667C6.61538 11.2955 6.61571 11.3242 6.61635 11.3529H3.84615L3.84615 2.86666ZM10.8352 9.13333C10.8352 9.42789 10.599 9.66667 10.3077 9.66667C10.0164 9.66667 9.78022 9.42789 9.78022 9.13333C9.78022 8.83878 10.0164 8.6 10.3077 8.6C10.599 8.6 10.8352 8.83878 10.8352 9.13333ZM10.3077 10.2C10.599 10.2 10.8352 10.4388 10.8352 10.7333V12.8667H11.0989C11.2446 12.8667 11.3626 12.9861 11.3626 13.1333C11.3626 13.2806 11.2446 13.4 11.0989 13.4H9.51648C9.37083 13.4 9.25275 13.2806 9.25275 13.1333C9.25275 12.9861 9.37083 12.8667 9.51648 12.8667H9.78022V10.7333H9.51648C9.37083 10.7333 9.25275 10.6139 9.25275 10.4667C9.25275 10.3194 9.37083 10.2 9.51648 10.2H10.3077Z\" fill={'currentColor'} /></svg>;\n};\nGuide.displayName = 'Guide';\nGuide.isGlyph = true;\nexport default Guide;"],"names":["_templateObject","_templateObject2","sizeMap","small","default","large","xlarge","_excluded","Guide","_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","fillRule","clipRule","displayName","isGlyph"],"mappings":"urCAOO,ICNHA,EAAiBC,EDMVC,EAAU,CACnBC,MAAO,GACPC,QAAS,GACTC,MAAO,GACP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,OAAQ,CAC3CM,EAAG,8NACHxB,KAAM,iBACSiB,EAAMC,cAAc,OAAQ,CAC3CM,EAAG,gOACHxB,KAAM,iBACSiB,EAAMC,cAAc,OAAQ,CAC3CO,SAAU,UACVC,SAAU,UACVF,EAAG,6/BACHxB,KAAM,iBAEV,EACAR,EAAMmC,YAAc,QACpBnC,EAAMoC,SAAU"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as e from"react";import{css as r,cx as l}from"@leafygreen-ui/emotion";function t(e){var r=function(e,r){if("object"!=typeof e||!e)return e;var l=e[Symbol.toPrimitive];if(void 0!==l){var t=l.call(e,r);if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof r?r:r+""}function a(e,r,l){return(r=t(r))in e?Object.defineProperty(e,r,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[r]=l,e}function i(){return i=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var l=arguments[r];for(var t in l)Object.prototype.hasOwnProperty.call(l,t)&&(e[t]=l[t])}return e},i.apply(this,arguments)}function n(e,r){if(null==e)return{};var l,t,a=function(e,r){if(null==e)return{};var l,t,a={},i=Object.keys(e);for(t=0;t<i.length;t++)l=i[t],r.indexOf(l)>=0||(a[l]=e[l]);return a}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t<i.length;t++)l=i[t],r.indexOf(l)>=0||Object.prototype.propertyIsEnumerable.call(e,l)&&(a[l]=e[l])}return a}function o(e,r){return r||(r=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(r)}}))}var c,u,f={small:14,default:16,large:20,xlarge:24};var b=["className","size","title","aria-label","aria-labelledby","fill","role"],s=function(t){var s=t.className,d=t.size,p=void 0===d?16:d,v=t.title,m=t["aria-label"],y=t["aria-labelledby"],g=t.fill,h=t.role,H=void 0===h?"img":h,L=n(t,b),O=r(c||(c=o(["\n color: ",";\n "])),g),V=r(u||(u=o(["\n flex-shrink: 0;\n "]))),C=function(e,r,l){var t,i=l["aria-label"],n=l["aria-labelledby"],o=l.title;switch(e){case"img":return i||n||o?a(a(a({},"aria-labelledby",n),"aria-label",i),"title",o):{"aria-label":(t=r,"".concat(t.replace(/([a-z])([A-Z])/g,"$1 $2")," Icon"))};case"presentation":return{"aria-hidden":!0,alt:""}}}(H,"Resource",a(a({title:v},"aria-label",m),"aria-labelledby",y));return e.createElement("svg",i({className:l(a({},O,null!=g),V,s),height:"number"==typeof p?p:f[p],width:"number"==typeof p?p:f[p],role:H},C,L,{viewBox:"0 0 16 16"}),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.09999 1.99998C5.71339 1.99998 5.39999 2.31338 5.39999 2.69998V13.3C5.39999 13.6866 5.71339 14 6.09999 14H8.19999C8.58659 14 8.89999 13.6866 8.89999 13.3V2.69998C8.89999 2.31338 8.58659 1.99998 8.19999 1.99998H6.09999ZM8.02499 2.99998H6.27499V3.99998H8.02499V2.99998ZM6.27499 4.99998H8.02499V5.49998H6.27499V4.99998ZM8.02499 12H6.27499V13H8.02499V12Z",fill:"currentColor"}),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.84432 2.35808C9.46647 2.4399 9.22758 2.81229 9.31074 3.18984L11.5698 13.4468C11.653 13.8243 12.0267 14.0641 12.4046 13.9823L14.4557 13.5381C14.8335 13.4563 15.0724 13.0839 14.9893 12.7064L12.7302 2.44944C12.647 2.07189 12.2733 1.83215 11.8954 1.91396L9.84432 2.35808ZM11.9381 2.91964L10.2283 3.28984L10.4417 4.25852L12.1514 3.88832L11.9381 2.91964ZM10.6551 5.22735L12.3648 4.85715L12.4715 5.34149L10.7618 5.71169L10.6551 5.22735ZM13.8583 11.6377L12.1485 12.0079L12.3619 12.9766L14.0716 12.6064L13.8583 11.6377Z",fill:"currentColor"}),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.09999 1.99998C1.71339 1.99998 1.39999 2.31338 1.39999 2.69998V13.3C1.39999 13.6866 1.71339 14 2.09999 14H4.19999C4.58659 14 4.89999 13.6866 4.89999 13.3V2.69998C4.89999 2.31338 4.58659 1.99998 4.19999 1.99998H2.09999ZM4.02499 2.99998H2.27499V3.99998H4.02499V2.99998ZM2.27499 4.99998H4.02499V5.49998H2.27499V4.99998ZM4.02499 12H2.27499V13H4.02499V12Z",fill:"currentColor"}))};s.displayName="Resource",s.isGlyph=!0;export{s as default};
|
|
2
|
+
//# sourceMappingURL=Resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Resource.js","sources":["../../src/glyphCommon.ts","../../src/generated/Resource.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.ts\n* @checksum dd1161fb99ad7a4495d5f8cbf225139b\n*/\nimport * as React from \"react\";\nimport { css, cx } from '@leafygreen-ui/emotion';\nimport { generateAccessibleProps, sizeMap } from '../glyphCommon';\nimport { LGGlyph } from '../types';\nexport interface ResourceProps extends LGGlyph.ComponentProps {}\nconst Resource = ({\n className,\n size = 16,\n title,\n ['aria-label']: ariaLabel,\n ['aria-labelledby']: ariaLabelledby,\n fill,\n role = 'img',\n ...props\n}: ResourceProps) => {\n const fillStyle = css`\n color: ${fill};\n `;\n const noFlexShrink = css`\n flex-shrink: 0;\n `;\n const accessibleProps = generateAccessibleProps(role, 'Resource', {\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.09999 1.99998C5.71339 1.99998 5.39999 2.31338 5.39999 2.69998V13.3C5.39999 13.6866 5.71339 14 6.09999 14H8.19999C8.58659 14 8.89999 13.6866 8.89999 13.3V2.69998C8.89999 2.31338 8.58659 1.99998 8.19999 1.99998H6.09999ZM8.02499 2.99998H6.27499V3.99998H8.02499V2.99998ZM6.27499 4.99998H8.02499V5.49998H6.27499V4.99998ZM8.02499 12H6.27499V13H8.02499V12Z\" fill={'currentColor'} /><path fillRule=\"evenodd\" clipRule=\"evenodd\" d=\"M9.84432 2.35808C9.46647 2.4399 9.22758 2.81229 9.31074 3.18984L11.5698 13.4468C11.653 13.8243 12.0267 14.0641 12.4046 13.9823L14.4557 13.5381C14.8335 13.4563 15.0724 13.0839 14.9893 12.7064L12.7302 2.44944C12.647 2.07189 12.2733 1.83215 11.8954 1.91396L9.84432 2.35808ZM11.9381 2.91964L10.2283 3.28984L10.4417 4.25852L12.1514 3.88832L11.9381 2.91964ZM10.6551 5.22735L12.3648 4.85715L12.4715 5.34149L10.7618 5.71169L10.6551 5.22735ZM13.8583 11.6377L12.1485 12.0079L12.3619 12.9766L14.0716 12.6064L13.8583 11.6377Z\" fill={'currentColor'} /><path fillRule=\"evenodd\" clipRule=\"evenodd\" d=\"M2.09999 1.99998C1.71339 1.99998 1.39999 2.31338 1.39999 2.69998V13.3C1.39999 13.6866 1.71339 14 2.09999 14H4.19999C4.58659 14 4.89999 13.6866 4.89999 13.3V2.69998C4.89999 2.31338 4.58659 1.99998 4.19999 1.99998H2.09999ZM4.02499 2.99998H2.27499V3.99998H4.02499V2.99998ZM2.27499 4.99998H4.02499V5.49998H2.27499V4.99998ZM4.02499 12H2.27499V13H4.02499V12Z\" fill={'currentColor'} /></svg>;\n};\nResource.displayName = 'Resource';\nResource.isGlyph = true;\nexport default Resource;"],"names":["_templateObject","_templateObject2","sizeMap","small","default","large","xlarge","_excluded","Resource","_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":"urCAOO,ICNHA,EAAiBC,EDMVC,EAAU,CACnBC,MAAO,GACPC,QAAS,GACTC,MAAO,GACPC,OAAQ,ICTV,IAAIC,EAAY,CAAC,YAAa,OAAQ,QAAS,aAAc,kBAAmB,OAAQ,QAUpFC,EAAW,SAAkBC,GAC/B,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,I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