@leafygreen-ui/icon 12.2.0 → 12.4.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 +12 -0
- package/README.md +7 -7
- package/dist/Moon.js +2 -0
- package/dist/Moon.js.map +1 -0
- package/dist/Sun.js +2 -0
- package/dist/Sun.js.map +1 -0
- package/dist/esm/Moon.js +2 -0
- package/dist/esm/Moon.js.map +1 -0
- package/dist/esm/Sun.js +2 -0
- package/dist/esm/Sun.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/generated/Moon.d.ts +23 -0
- package/dist/generated/Moon.d.ts.map +1 -0
- package/dist/generated/Sun.d.ts +23 -0
- package/dist/generated/Sun.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.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/generated/Moon.tsx +45 -0
- package/src/generated/Sun.tsx +45 -0
- package/src/glyphs/Moon.svg +3 -0
- package/src/glyphs/Sun.svg +11 -0
- package/src/glyphs/index.ts +4 -0
- package/src/index.ts +1 -1
- package/stories.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @leafygreen-ui/icon
|
|
2
2
|
|
|
3
|
+
## 12.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- ae44834e: Exports type `GlyphName`, a union of all default LeafyGreen icon names
|
|
8
|
+
|
|
9
|
+
## 12.3.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 684c87f1: Adds `Moon` and `Sun` glyphs.
|
|
14
|
+
|
|
3
15
|
## 12.2.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -47,13 +47,13 @@ const SomeComponent = () => <Icon glyph="Plus" fill="#FF0000" />;
|
|
|
47
47
|
|
|
48
48
|
## Properties
|
|
49
49
|
|
|
50
|
-
| Prop | Type
|
|
51
|
-
| ------------------ |
|
|
52
|
-
| `glyph` (Required) | `'ActivityFeed'`, `'AddFile'`, `'AllProducts'`, `'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'`, `'Clock'`,`'ClockWithArrow'`, `'Clone'`, `'Cloud'`, `'Code'`, `'CodeBlock'`,`'Colon'`, `'Connect'`,`'Copy'`,`'CreditCard'`, `'CurlyBraces'`, `'Dashboard'`, `'Database'`, `'Diagram'`, `'Diagram2'`, `'Diagram3'`, `'Disconnect'`, `'Download'`, `'Drag'`, `'Edit'`, `'Ellipsis'`, `'Email'`, `'Eraser'`, `'Escalation'`, `'Export'`, `'Favorite'`, `'Federation'`, `'File'`, `'Filter'`,`'Folder'`, `'Format'`, `'FullScreenEnter'`, `'FullScreenExit'`, `'Guage'`, `'GlobeAmericas'`, `'GovernmentBuilding'`, `'Hash'`, `'Highlight'`, `'Home'`, `'HorizontalDrag'`, `'Import'`, `'ImportantWithCircle'`, `'InfoWithCircle'`, `'InternalEmployee'`, `'InviteUser'`, `'Key'`, `'Laptop'`, `'LightningBolt'`, `'Link'`, `'List'`, `'Lock'`, `'LogIn'`, `'LogOut'`, `'MagnifyingGlass'`, `'Megaphone'`, `'Menu'`, `'Minus'`, `'Mobile'`, `'MultiDirectionArrow'`, `'MultiLayers'`, `'NavCollapse'`, `'NavExpand'`, `'NoFilter'`, `'NotAllowed'`, `'Note'`, `'OpenNewTab'`, `'Pause'`, `'Person'`, `'PersonGroup'`, `'PersonWithLock'`, `'Pin'`, `'Play'`, `'Plus'`, `'PlusWithCircle'`, `'Primary'`, `'Project'`, `'QuestionMarkWithCircle'`, `'Read'`, `'Recommended'`, `'Redo'`, `'Refresh'`,`'Relationship'`, `'ReplicaSet'`,`'Resize'`, `'Return'`, `'Save'`, `'SearchIndex'`, `'Secondary'`, `'Serverless'`, `'Settings'`, `'ShardedCluster'`, `'Shell'`, `'SMS'`,`'SortAscending'`, `'SortDescending'`, `'SortHorizontal'`, `'SortVertical'`,`'Sparkle'`, `'SplitHorizontal'`, `'SplitVertical'`, `'Stitch'`, `'String'`, `'Support'`, `'Sweep'`, `'Table'`, `'Tag'`, `'ThumbsDown'`, `'ThumbsUp'`, `'TimeSeries'`, `'TimeSeriesCollection'`, `'Trash'`, `'Undo'`, `'University'`, `'Unlock'`, `'Unsorted'`, `'UpDownCarets'`, `'Upload'`, `'VerticalEllipsis'`, `'Visibility'`, `'VisibilityOff'`, `'Warning'`, `'Wizard'`, `'Wrench'`, `'Write'`,`'X'`, `'XWithCircle'` | Specifies the glyph to use. | |
|
|
53
|
-
| `size` | `'small'`, `'default'`, `'large'`, `'xlarge'`, `number`
|
|
54
|
-
| `fill` | `string`
|
|
55
|
-
| `title` | `string`, `boolean`, `null`
|
|
56
|
-
| ... | `SVGR.ComponentProps`
|
|
50
|
+
| Prop | Type | Description | Default |
|
|
51
|
+
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
|
|
52
|
+
| `glyph` (Required) | `'ActivityFeed'`, `'AddFile'`, `'AllProducts'`, `'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'`, `'Clock'`,`'ClockWithArrow'`, `'Clone'`, `'Cloud'`, `'Code'`, `'CodeBlock'`,`'Colon'`, `'Connect'`,`'Copy'`,`'CreditCard'`, `'CurlyBraces'`, `'Dashboard'`, `'Database'`, `'Diagram'`, `'Diagram2'`, `'Diagram3'`, `'Disconnect'`, `'Download'`, `'Drag'`, `'Edit'`, `'Ellipsis'`, `'Email'`, `'Eraser'`, `'Escalation'`, `'Export'`, `'Favorite'`, `'Federation'`, `'File'`, `'Filter'`,`'Folder'`, `'Format'`, `'FullScreenEnter'`, `'FullScreenExit'`, `'Guage'`, `'GlobeAmericas'`, `'GovernmentBuilding'`, `'Hash'`, `'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'`, `'OpenNewTab'`, `'Pause'`, `'Person'`, `'PersonGroup'`, `'PersonWithLock'`, `'Pin'`, `'Play'`, `'Plus'`, `'PlusWithCircle'`, `'Primary'`, `'Project'`, `'QuestionMarkWithCircle'`, `'Read'`, `'Recommended'`, `'Redo'`, `'Refresh'`,`'Relationship'`, `'ReplicaSet'`,`'Resize'`, `'Return'`, `'Save'`, `'SearchIndex'`, `'Secondary'`, `'Serverless'`, `'Settings'`, `'ShardedCluster'`, `'Shell'`, `'SMS'`,`'SortAscending'`, `'SortDescending'`, `'SortHorizontal'`, `'SortVertical'`,`'Sparkle'`, `'SplitHorizontal'`, `'SplitVertical'`, `'Stitch'`, `'String'`, `'Sun'`, `'Support'`, `'Sweep'`, `'Table'`, `'Tag'`, `'ThumbsDown'`, `'ThumbsUp'`, `'TimeSeries'`, `'TimeSeriesCollection'`, `'Trash'`, `'Undo'`, `'University'`, `'Unlock'`, `'Unsorted'`, `'UpDownCarets'`, `'Upload'`, `'VerticalEllipsis'`, `'Visibility'`, `'VisibilityOff'`, `'Warning'`, `'Wizard'`, `'Wrench'`, `'Write'`,`'X'`, `'XWithCircle'` | Specifies the glyph to use. | |
|
|
53
|
+
| `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'` |
|
|
54
|
+
| `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. | |
|
|
55
|
+
| `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. | |
|
|
56
|
+
| ... | `SVGR.ComponentProps` | All other props will be spread on the `svg` element | |
|
|
57
57
|
|
|
58
58
|
# createIconComponent
|
|
59
59
|
|
package/dist/Moon.js
ADDED
|
@@ -0,0 +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).Moon=e.Moon||{},e.Moon.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 a(e){if(e&&"object"==typeof e&&"default"in e)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var i=a(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 f(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 u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)}function c(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function s(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var b,p,y={small:14,default:16,large:20,xlarge:24};var d=["className","size","title","aria-label","aria-labelledby","fill","role"],m=function(e){var t=e.className,n=e.size,a=void 0===n?16:n,l=e.title,o=e["aria-label"],m=e["aria-labelledby"],g=e.fill,v=e.role,O=void 0===v?"img":v,j=c(e,d),h=r.css(b||(b=s(["\n color: ",";\n "])),g),w=r.css(p||(p=s(["\n flex-shrink: 0;\n "]))),C=function(e,t,r){var n,a=r["aria-label"],i=r["aria-labelledby"],l=r.title;switch(e){case"img":return a||i||l?f(f(f({},"aria-labelledby",i),"aria-label",a),"title",l):{"aria-label":(n=t,"".concat(n.replace(/([a-z])([A-Z])/g,"$1 $2")," Icon"))};case"presentation":return{"aria-hidden":!0,alt:""}}}(O,"Moon",f(f({title:l},"aria-label",o),"aria-labelledby",m));return i.createElement("svg",u({className:r.cx(f({},h,null!=g),w,t),height:"number"==typeof a?a:y[a],width:"number"==typeof a?a:y[a],role:O},C,j,{viewBox:"0 0 16 16"}),i.createElement("path",{d:"M13.7868 10.0736C13.5564 9.8432 13.2012 9.7952 12.9228 9.9584C12.798 10.0352 12.6636 10.0928 12.5292 10.1504C10.7628 10.8704 8.6412 9.9392 7.8252 7.9424C7.0956 6.1472 7.7388 4.208 9.1692 3.3248C9.438 3.1616 9.5724 2.8352 9.486 2.5184C9.3996 2.2016 9.1116 2 8.7948 2H8.67C5.358 2 2.67 4.688 2.67 8C2.67 11.312 5.358 14 8.67 14C10.9164 14 12.8748 12.7616 13.902 10.9376C14.0652 10.6592 14.0076 10.304 13.7772 10.0736H13.7868Z",fill:"currentColor"}))};return m.displayName="Moon",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
|
+
//# sourceMappingURL=Moon.js.map
|
package/dist/Moon.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Moon.js","sources":["../src/glyphCommon.ts","../src/generated/Moon.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 4c2d7672aa71f7e5c28bcdf6b86b5832\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 MoonProps extends LGGlyph.ComponentProps {}\nconst Moon = ({\n className,\n size = 16,\n title,\n ['aria-label']: ariaLabel,\n ['aria-labelledby']: ariaLabelledby,\n fill,\n role = 'img',\n ...props\n}: MoonProps) => {\n const fillStyle = css`\n color: ${fill};\n `;\n const noFlexShrink = css`\n flex-shrink: 0;\n `;\n const accessibleProps = generateAccessibleProps(role, 'Moon', {\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=\"M13.7868 10.0736C13.5564 9.8432 13.2012 9.7952 12.9228 9.9584C12.798 10.0352 12.6636 10.0928 12.5292 10.1504C10.7628 10.8704 8.6412 9.9392 7.8252 7.9424C7.0956 6.1472 7.7388 4.208 9.1692 3.3248C9.438 3.1616 9.5724 2.8352 9.486 2.5184C9.3996 2.2016 9.1116 2 8.7948 2H8.67C5.358 2 2.67 4.688 2.67 8C2.67 11.312 5.358 14 8.67 14C10.9164 14 12.8748 12.7616 13.902 10.9376C14.0652 10.6592 14.0076 10.304 13.7772 10.0736H13.7868Z\" fill={'currentColor'} /></svg>;\n};\nMoon.displayName = 'Moon';\nMoon.isGlyph = true;\nMoon.propTypes = {\n fill: PropTypes.string,\n size: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n className: PropTypes.string\n};\nexport default Moon;"],"names":["_templateObject","_templateObject2","sizeMap","small","default","large","xlarge","_excluded","Moon","_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","propTypes","PropTypes","string","oneOfType","number"],"mappings":"g6DAOO,ICHHA,EAAiBC,EDGVC,EAAU,CACnBC,MAAO,GACPC,QAAS,GACTC,MAAO,GACPC,OAAQ,ICNV,IAAIC,EAAY,CAAC,YAAa,OAAQ,QAAS,aAAc,kBAAmB,OAAQ,QAWpFC,EAAO,S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jC,EAAKkC,SAAU,EACflC,EAAKmC,UAAY,CACf3B,KAAM4B,EAASxC,QAACyC,OAChBjC,KAAMgC,EAASxC,QAAC0C,UAAU,CAACF,EAASxC,QAAC2C,OAAQH,EAAAA,QAAUC,SACvDnC,UAAWkC,EAASxC,QAACyC"}
|
package/dist/Sun.js
ADDED
|
@@ -0,0 +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).Sun=e.Sun||{},e.Sun.js=t(e.React,e.PropTypes,e["@leafygreen-ui/emotion"]))}(this,(function(e,t,r){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function n(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 l=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,l.get?l:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var a=n(e),i=l(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 l=r.call(e,t);if("object"!=typeof l)return l;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 c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e},c.apply(this,arguments)}function f(e,t){if(null==e)return{};var r,l,n=function(e,t){if(null==e)return{};var r,l,n={},a=Object.keys(e);for(l=0;l<a.length;l++)r=a[l],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(l=0;l<a.length;l++)r=a[l],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function s(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var p,b,d={small:14,default:16,large:20,xlarge:24};var C=["className","size","title","aria-label","aria-labelledby","fill","role"],y=function(e){var t=e.className,l=e.size,n=void 0===l?16:l,i=e.title,o=e["aria-label"],y=e["aria-labelledby"],m=e.fill,g=e.role,v=void 0===g?"img":g,h=f(e,C),O=r.css(p||(p=s(["\n color: ",";\n "])),m),j=r.css(b||(b=s(["\n flex-shrink: 0;\n "]))),E=function(e,t,r){var l,n=r["aria-label"],a=r["aria-labelledby"],i=r.title;switch(e){case"img":return n||a||i?u(u(u({},"aria-labelledby",a),"aria-label",n),"title",i):{"aria-label":(l=t,"".concat(l.replace(/([a-z])([A-Z])/g,"$1 $2")," Icon"))};case"presentation":return{"aria-hidden":!0,alt:""}}}(v,"Sun",u(u({title:i},"aria-label",o),"aria-labelledby",y));return a.createElement("svg",c({className:r.cx(u({},O,null!=m),j,t),height:"number"==typeof n?n:d[n],width:"number"==typeof n?n:d[n],role:v},E,h,{viewBox:"0 0 16 16"}),a.createElement("path",{d:"M12.24 10.83C11.85 10.44 11.22 10.44 10.83 10.83C10.44 11.22 10.44 11.85 10.83 12.24L11.54 12.95C11.93 13.34 12.56 13.34 12.95 12.95C13.34 12.56 13.34 11.93 12.95 11.54L12.24 10.83Z",fill:"currentColor"}),a.createElement("path",{d:"M8 12C7.45 12 7 12.45 7 13V14C7 14.55 7.45 15 8 15C8.55 15 9 14.55 9 14V13C9 12.45 8.55 12 8 12Z",fill:"currentColor"}),a.createElement("path",{d:"M8 11C9.65685 11 11 9.65685 11 8C11 6.34315 9.65685 5 8 5C6.34315 5 5 6.34315 5 8C5 9.65685 6.34315 11 8 11Z",fill:"currentColor"}),a.createElement("path",{d:"M14 7H13C12.45 7 12 7.45 12 8C12 8.55 12.45 9 13 9H14C14.55 9 15 8.55 15 8C15 7.45 14.55 7 14 7Z",fill:"currentColor"}),a.createElement("path",{d:"M3.76 10.83L3.05 11.54C2.66 11.93 2.66 12.56 3.05 12.95C3.44 13.34 4.07 13.34 4.46 12.95L5.17 12.24C5.56 11.85 5.56 11.22 5.17 10.83C4.78 10.44 4.15 10.44 3.76 10.83Z",fill:"currentColor"}),a.createElement("path",{d:"M8 4C8.55 4 9 3.55 9 3V2C9 1.45 8.55 1 8 1C7.45 1 7 1.45 7 2V3C7 3.55 7.45 4 8 4Z",fill:"currentColor"}),a.createElement("path",{d:"M3.76 5.17C4.15 5.56 4.78 5.56 5.17 5.17C5.56 4.78 5.56 4.15 5.17 3.76L4.46 3.05C4.07 2.66 3.44 2.66 3.05 3.05C2.66 3.44 2.66 4.07 3.05 4.46L3.76 5.17Z",fill:"currentColor"}),a.createElement("path",{d:"M4 8C4 7.45 3.55 7 3 7H2C1.45 7 1 7.45 1 8C1 8.55 1.45 9 2 9H3C3.55 9 4 8.55 4 8Z",fill:"currentColor"}),a.createElement("path",{d:"M12.24 5.17L12.95 4.46C13.34 4.07 13.34 3.44 12.95 3.05C12.56 2.66 11.93 2.66 11.54 3.05L10.83 3.76C10.44 4.15 10.44 4.78 10.83 5.17C11.22 5.56 11.85 5.56 12.24 5.17Z",fill:"currentColor"}))};return y.displayName="Sun",y.isGlyph=!0,y.propTypes={fill:i.default.string,size:i.default.oneOfType([i.default.number,i.default.string]),className:i.default.string},y}));
|
|
2
|
+
//# sourceMappingURL=Sun.js.map
|
package/dist/Sun.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sun.js","sources":["../src/glyphCommon.ts","../src/generated/Sun.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 0c0cdc9afd7329ab5567a45016c55163\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 SunProps extends LGGlyph.ComponentProps {}\nconst Sun = ({\n className,\n size = 16,\n title,\n ['aria-label']: ariaLabel,\n ['aria-labelledby']: ariaLabelledby,\n fill,\n role = 'img',\n ...props\n}: SunProps) => {\n const fillStyle = css`\n color: ${fill};\n `;\n const noFlexShrink = css`\n flex-shrink: 0;\n `;\n const accessibleProps = generateAccessibleProps(role, 'Sun', {\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=\"M12.24 10.83C11.85 10.44 11.22 10.44 10.83 10.83C10.44 11.22 10.44 11.85 10.83 12.24L11.54 12.95C11.93 13.34 12.56 13.34 12.95 12.95C13.34 12.56 13.34 11.93 12.95 11.54L12.24 10.83Z\" fill={'currentColor'} /><path d=\"M8 12C7.45 12 7 12.45 7 13V14C7 14.55 7.45 15 8 15C8.55 15 9 14.55 9 14V13C9 12.45 8.55 12 8 12Z\" fill={'currentColor'} /><path d=\"M8 11C9.65685 11 11 9.65685 11 8C11 6.34315 9.65685 5 8 5C6.34315 5 5 6.34315 5 8C5 9.65685 6.34315 11 8 11Z\" fill={'currentColor'} /><path d=\"M14 7H13C12.45 7 12 7.45 12 8C12 8.55 12.45 9 13 9H14C14.55 9 15 8.55 15 8C15 7.45 14.55 7 14 7Z\" fill={'currentColor'} /><path d=\"M3.76 10.83L3.05 11.54C2.66 11.93 2.66 12.56 3.05 12.95C3.44 13.34 4.07 13.34 4.46 12.95L5.17 12.24C5.56 11.85 5.56 11.22 5.17 10.83C4.78 10.44 4.15 10.44 3.76 10.83Z\" fill={'currentColor'} /><path d=\"M8 4C8.55 4 9 3.55 9 3V2C9 1.45 8.55 1 8 1C7.45 1 7 1.45 7 2V3C7 3.55 7.45 4 8 4Z\" fill={'currentColor'} /><path d=\"M3.76 5.17C4.15 5.56 4.78 5.56 5.17 5.17C5.56 4.78 5.56 4.15 5.17 3.76L4.46 3.05C4.07 2.66 3.44 2.66 3.05 3.05C2.66 3.44 2.66 4.07 3.05 4.46L3.76 5.17Z\" fill={'currentColor'} /><path d=\"M4 8C4 7.45 3.55 7 3 7H2C1.45 7 1 7.45 1 8C1 8.55 1.45 9 2 9H3C3.55 9 4 8.55 4 8Z\" fill={'currentColor'} /><path d=\"M12.24 5.17L12.95 4.46C13.34 4.07 13.34 3.44 12.95 3.05C12.56 2.66 11.93 2.66 11.54 3.05L10.83 3.76C10.44 4.15 10.44 4.78 10.83 5.17C11.22 5.56 11.85 5.56 12.24 5.17Z\" fill={'currentColor'} /></svg>;\n};\nSun.displayName = 'Sun';\nSun.isGlyph = true;\nSun.propTypes = {\n fill: PropTypes.string,\n size: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n className: PropTypes.string\n};\nexport default Sun;"],"names":["_templateObject","_templateObject2","sizeMap","small","default","large","xlarge","_excluded","Sun","_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","propTypes","PropTypes","string","oneOfType","number"],"mappings":"65DAOO,ICHHA,EAAiBC,EDGVC,EAAU,CACnBC,MAAO,GACPC,QAAS,GACTC,MAAO,GACPC,OAAQ,ICNV,IAAIC,EAAY,CAAC,YAAa,OAAQ,QAAS,aAAc,kBAAmB,OAAQ,QAWpFC,EAAM,SAAaC,GACrB,IAAIC,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,GA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AACF,EAASxC,QAAC2C,OAAQH,EAAAA,QAAUC,SACvDnC,UAAWkC,EAASxC,QAACyC"}
|
package/dist/esm/Moon.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as e from"react";import r from"prop-types";import{css as t,cx as a}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 a=t.call(e,r);if("object"!=typeof a)return a;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=l(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 a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},n.apply(this,arguments)}function o(e,r){if(null==e)return{};var t,a,l=function(e,r){if(null==e)return{};var t,a,l={},i=Object.keys(e);for(a=0;a<i.length;a++)t=i[a],r.indexOf(t)>=0||(l[t]=e[t]);return l}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)t=i[a],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(l[t]=e[t])}return l}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 l=r.className,p=r.size,m=void 0===p?16:p,y=r.title,v=r["aria-label"],g=r["aria-labelledby"],d=r.fill,O=r.role,h=void 0===O?"img":O,j=o(r,b),C=t(f||(f=c(["\n color: ",";\n "])),d),w=t(u||(u=c(["\n flex-shrink: 0;\n "]))),P=function(e,r,t){var a,l=t["aria-label"],n=t["aria-labelledby"],o=t.title;switch(e){case"img":return l||n||o?i(i(i({},"aria-labelledby",n),"aria-label",l),"title",o):{"aria-label":(a=r,"".concat(a.replace(/([a-z])([A-Z])/g,"$1 $2")," Icon"))};case"presentation":return{"aria-hidden":!0,alt:""}}}(h,"Moon",i(i({title:y},"aria-label",v),"aria-labelledby",g));return e.createElement("svg",n({className:a(i({},C,null!=d),w,l),height:"number"==typeof m?m:s[m],width:"number"==typeof m?m:s[m],role:h},P,j,{viewBox:"0 0 16 16"}),e.createElement("path",{d:"M13.7868 10.0736C13.5564 9.8432 13.2012 9.7952 12.9228 9.9584C12.798 10.0352 12.6636 10.0928 12.5292 10.1504C10.7628 10.8704 8.6412 9.9392 7.8252 7.9424C7.0956 6.1472 7.7388 4.208 9.1692 3.3248C9.438 3.1616 9.5724 2.8352 9.486 2.5184C9.3996 2.2016 9.1116 2 8.7948 2H8.67C5.358 2 2.67 4.688 2.67 8C2.67 11.312 5.358 14 8.67 14C10.9164 14 12.8748 12.7616 13.902 10.9376C14.0652 10.6592 14.0076 10.304 13.7772 10.0736H13.7868Z",fill:"currentColor"}))};p.displayName="Moon",p.isGlyph=!0,p.propTypes={fill:r.string,size:r.oneOfType([r.number,r.string]),className:r.string};export{p as default};
|
|
2
|
+
//# sourceMappingURL=Moon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Moon.js","sources":["../../src/glyphCommon.ts","../../src/generated/Moon.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 4c2d7672aa71f7e5c28bcdf6b86b5832\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 MoonProps extends LGGlyph.ComponentProps {}\nconst Moon = ({\n className,\n size = 16,\n title,\n ['aria-label']: ariaLabel,\n ['aria-labelledby']: ariaLabelledby,\n fill,\n role = 'img',\n ...props\n}: MoonProps) => {\n const fillStyle = css`\n color: ${fill};\n `;\n const noFlexShrink = css`\n flex-shrink: 0;\n `;\n const accessibleProps = generateAccessibleProps(role, 'Moon', {\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=\"M13.7868 10.0736C13.5564 9.8432 13.2012 9.7952 12.9228 9.9584C12.798 10.0352 12.6636 10.0928 12.5292 10.1504C10.7628 10.8704 8.6412 9.9392 7.8252 7.9424C7.0956 6.1472 7.7388 4.208 9.1692 3.3248C9.438 3.1616 9.5724 2.8352 9.486 2.5184C9.3996 2.2016 9.1116 2 8.7948 2H8.67C5.358 2 2.67 4.688 2.67 8C2.67 11.312 5.358 14 8.67 14C10.9164 14 12.8748 12.7616 13.902 10.9376C14.0652 10.6592 14.0076 10.304 13.7772 10.0736H13.7868Z\" fill={'currentColor'} /></svg>;\n};\nMoon.displayName = 'Moon';\nMoon.isGlyph = true;\nMoon.propTypes = {\n fill: PropTypes.string,\n size: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n className: PropTypes.string\n};\nexport default Moon;"],"names":["_templateObject","_templateObject2","sizeMap","small","default","large","xlarge","_excluded","Moon","_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","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,EAAO,SAAcC,GACvB,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,OAAQU,EAAgBA,EAAgB,CAC1Ff,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,EAAG,0aACHxB,KAAM,iBAEV,EACAR,EAAKiC,YAAc,OACnBjC,EAAKkC,SAAU,EACflC,EAAKmC,UAAY,CACf3B,KAAM4B,EAAUC,OAChBjC,KAAMgC,EAAUE,UAAU,CAACF,EAAUG,OAAQH,EAAUC,SACvDnC,UAAWkC,EAAUC"}
|
package/dist/esm/Sun.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as e from"react";import r from"prop-types";import{css as t,cx as l}from"@leafygreen-ui/emotion";function a(e){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 n(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 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 o(e,r){if(null==e)return{};var t,l,a=function(e,r){if(null==e)return{};var t,l,a={},n=Object.keys(e);for(l=0;l<n.length;l++)t=n[l],r.indexOf(t)>=0||(a[t]=e[t]);return a}(e,r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(l=0;l<n.length;l++)t=n[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 u,f,C={small:14,default:16,large:20,xlarge:24};var p=["className","size","title","aria-label","aria-labelledby","fill","role"],s=function(r){var a=r.className,s=r.size,b=void 0===s?16:s,m=r.title,y=r["aria-label"],d=r["aria-labelledby"],v=r.fill,h=r.role,g=void 0===h?"img":h,O=o(r,p),j=t(u||(u=c(["\n color: ",";\n "])),v),E=t(f||(f=c(["\n flex-shrink: 0;\n "]))),w=function(e,r,t){var l,a=t["aria-label"],i=t["aria-labelledby"],o=t.title;switch(e){case"img":return a||i||o?n(n(n({},"aria-labelledby",i),"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:""}}}(g,"Sun",n(n({title:m},"aria-label",y),"aria-labelledby",d));return e.createElement("svg",i({className:l(n({},j,null!=v),E,a),height:"number"==typeof b?b:C[b],width:"number"==typeof b?b:C[b],role:g},w,O,{viewBox:"0 0 16 16"}),e.createElement("path",{d:"M12.24 10.83C11.85 10.44 11.22 10.44 10.83 10.83C10.44 11.22 10.44 11.85 10.83 12.24L11.54 12.95C11.93 13.34 12.56 13.34 12.95 12.95C13.34 12.56 13.34 11.93 12.95 11.54L12.24 10.83Z",fill:"currentColor"}),e.createElement("path",{d:"M8 12C7.45 12 7 12.45 7 13V14C7 14.55 7.45 15 8 15C8.55 15 9 14.55 9 14V13C9 12.45 8.55 12 8 12Z",fill:"currentColor"}),e.createElement("path",{d:"M8 11C9.65685 11 11 9.65685 11 8C11 6.34315 9.65685 5 8 5C6.34315 5 5 6.34315 5 8C5 9.65685 6.34315 11 8 11Z",fill:"currentColor"}),e.createElement("path",{d:"M14 7H13C12.45 7 12 7.45 12 8C12 8.55 12.45 9 13 9H14C14.55 9 15 8.55 15 8C15 7.45 14.55 7 14 7Z",fill:"currentColor"}),e.createElement("path",{d:"M3.76 10.83L3.05 11.54C2.66 11.93 2.66 12.56 3.05 12.95C3.44 13.34 4.07 13.34 4.46 12.95L5.17 12.24C5.56 11.85 5.56 11.22 5.17 10.83C4.78 10.44 4.15 10.44 3.76 10.83Z",fill:"currentColor"}),e.createElement("path",{d:"M8 4C8.55 4 9 3.55 9 3V2C9 1.45 8.55 1 8 1C7.45 1 7 1.45 7 2V3C7 3.55 7.45 4 8 4Z",fill:"currentColor"}),e.createElement("path",{d:"M3.76 5.17C4.15 5.56 4.78 5.56 5.17 5.17C5.56 4.78 5.56 4.15 5.17 3.76L4.46 3.05C4.07 2.66 3.44 2.66 3.05 3.05C2.66 3.44 2.66 4.07 3.05 4.46L3.76 5.17Z",fill:"currentColor"}),e.createElement("path",{d:"M4 8C4 7.45 3.55 7 3 7H2C1.45 7 1 7.45 1 8C1 8.55 1.45 9 2 9H3C3.55 9 4 8.55 4 8Z",fill:"currentColor"}),e.createElement("path",{d:"M12.24 5.17L12.95 4.46C13.34 4.07 13.34 3.44 12.95 3.05C12.56 2.66 11.93 2.66 11.54 3.05L10.83 3.76C10.44 4.15 10.44 4.78 10.83 5.17C11.22 5.56 11.85 5.56 12.24 5.17Z",fill:"currentColor"}))};s.displayName="Sun",s.isGlyph=!0,s.propTypes={fill:r.string,size:r.oneOfType([r.number,r.string]),className:r.string};export{s as default};
|
|
2
|
+
//# sourceMappingURL=Sun.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sun.js","sources":["../../src/glyphCommon.ts","../../src/generated/Sun.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 0c0cdc9afd7329ab5567a45016c55163\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 SunProps extends LGGlyph.ComponentProps {}\nconst Sun = ({\n className,\n size = 16,\n title,\n ['aria-label']: ariaLabel,\n ['aria-labelledby']: ariaLabelledby,\n fill,\n role = 'img',\n ...props\n}: SunProps) => {\n const fillStyle = css`\n color: ${fill};\n `;\n const noFlexShrink = css`\n flex-shrink: 0;\n `;\n const accessibleProps = generateAccessibleProps(role, 'Sun', {\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=\"M12.24 10.83C11.85 10.44 11.22 10.44 10.83 10.83C10.44 11.22 10.44 11.85 10.83 12.24L11.54 12.95C11.93 13.34 12.56 13.34 12.95 12.95C13.34 12.56 13.34 11.93 12.95 11.54L12.24 10.83Z\" fill={'currentColor'} /><path d=\"M8 12C7.45 12 7 12.45 7 13V14C7 14.55 7.45 15 8 15C8.55 15 9 14.55 9 14V13C9 12.45 8.55 12 8 12Z\" fill={'currentColor'} /><path d=\"M8 11C9.65685 11 11 9.65685 11 8C11 6.34315 9.65685 5 8 5C6.34315 5 5 6.34315 5 8C5 9.65685 6.34315 11 8 11Z\" fill={'currentColor'} /><path d=\"M14 7H13C12.45 7 12 7.45 12 8C12 8.55 12.45 9 13 9H14C14.55 9 15 8.55 15 8C15 7.45 14.55 7 14 7Z\" fill={'currentColor'} /><path d=\"M3.76 10.83L3.05 11.54C2.66 11.93 2.66 12.56 3.05 12.95C3.44 13.34 4.07 13.34 4.46 12.95L5.17 12.24C5.56 11.85 5.56 11.22 5.17 10.83C4.78 10.44 4.15 10.44 3.76 10.83Z\" fill={'currentColor'} /><path d=\"M8 4C8.55 4 9 3.55 9 3V2C9 1.45 8.55 1 8 1C7.45 1 7 1.45 7 2V3C7 3.55 7.45 4 8 4Z\" fill={'currentColor'} /><path d=\"M3.76 5.17C4.15 5.56 4.78 5.56 5.17 5.17C5.56 4.78 5.56 4.15 5.17 3.76L4.46 3.05C4.07 2.66 3.44 2.66 3.05 3.05C2.66 3.44 2.66 4.07 3.05 4.46L3.76 5.17Z\" fill={'currentColor'} /><path d=\"M4 8C4 7.45 3.55 7 3 7H2C1.45 7 1 7.45 1 8C1 8.55 1.45 9 2 9H3C3.55 9 4 8.55 4 8Z\" fill={'currentColor'} /><path d=\"M12.24 5.17L12.95 4.46C13.34 4.07 13.34 3.44 12.95 3.05C12.56 2.66 11.93 2.66 11.54 3.05L10.83 3.76C10.44 4.15 10.44 4.78 10.83 5.17C11.22 5.56 11.85 5.56 12.24 5.17Z\" fill={'currentColor'} /></svg>;\n};\nSun.displayName = 'Sun';\nSun.isGlyph = true;\nSun.propTypes = {\n fill: PropTypes.string,\n size: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n className: PropTypes.string\n};\nexport default Sun;"],"names":["_templateObject","_templateObject2","sizeMap","small","default","large","xlarge","_excluded","Sun","_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","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,EAAM,SAAaC,GACrB,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,oBAA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