@leafygreen-ui/icon 14.3.0 → 14.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 +6 -0
- package/README.md +14 -27
- package/dist/Award.js +2 -0
- package/dist/Award.js.map +1 -0
- package/dist/checksums.json +1 -0
- package/dist/esm/Award.js +2 -0
- package/dist/esm/Award.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types/generated/Award.d.ts +17 -0
- package/dist/types/generated/Award.d.ts.map +1 -0
- package/dist/types/glyphs/index.d.ts +5 -1
- package/dist/types/glyphs/index.d.ts.map +1 -1
- package/dist/umd/Award.js +2 -0
- package/dist/umd/Award.js.map +1 -0
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +2 -2
- package/src/generated/Award.tsx +39 -0
- package/src/glyphs/Award.svg +4 -0
- package/src/glyphs/index.ts +2 -0
- package/stories.js +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -6,6 +6,12 @@
|
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
9
|
+
### PNPM
|
|
10
|
+
|
|
11
|
+
```shell
|
|
12
|
+
pnpm add @leafygreen-ui/icon
|
|
13
|
+
```
|
|
14
|
+
|
|
9
15
|
### Yarn
|
|
10
16
|
|
|
11
17
|
```shell
|
|
@@ -28,34 +34,15 @@ const SomeComponent = () => <Icon glyph="Plus" fill="#FF0000" />;
|
|
|
28
34
|
const OneImport = () => <PlusIcon />;
|
|
29
35
|
```
|
|
30
36
|
|
|
31
|
-
**Output HTML**
|
|
32
|
-
|
|
33
|
-
```html
|
|
34
|
-
<svg
|
|
35
|
-
width="16"
|
|
36
|
-
height="16"
|
|
37
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
38
|
-
viewBox="0 0 16 16"
|
|
39
|
-
class="leafygreen-ui-1gvnm9k"
|
|
40
|
-
role="img"
|
|
41
|
-
aria-label="Beaker Icon"
|
|
42
|
-
>
|
|
43
|
-
<path
|
|
44
|
-
d="M10.623 1a.886.886 0 01.041 1.772V5.34c0 .114.035.239.095.343l3.516 5.647.002.003c.232.387.356.818.356 1.254 0 .4-.106.804-.318 1.17l-.003.006-.004.007-.095.158A2.36 2.36 0 0112.217 15h-8.4c-.44 0-.86-.118-1.22-.333a2.448 2.448 0 01-.875-.904l-.001-.003a2.428 2.428 0 01-.301-1.163c0-.438.123-.877.367-1.268l3.53-5.647a.695.695 0 00.094-.343V2.772A.885.885 0 015.452 1zM8.904 2.774H7.185V5.34c0 .457-.136.892-.365 1.27l-.001.001-3.522 5.657a.644.644 0 00-.103.343c0 .102.026.2.081.296l.003.005a.62.62 0 00.553.329h8.4c.12 0 .223-.031.316-.087a.675.675 0 00.238-.898L9.272 6.612a2.324 2.324 0 01-.368-1.273V2.774zm.606 6.633l1.553 2.49a.227.227 0 01.01.243.223.223 0 01-.206.122H5.195c-.122 0-.187-.075-.206-.122-.028-.056-.056-.15.01-.243l1.553-2.49H9.51z"
|
|
45
|
-
fill="currentColor"
|
|
46
|
-
></path>
|
|
47
|
-
</svg>
|
|
48
|
-
```
|
|
49
|
-
|
|
50
37
|
## Properties
|
|
51
38
|
|
|
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", "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", "Shield", "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`
|
|
39
|
+
| Prop | Type | Description | Default |
|
|
40
|
+
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
|
|
41
|
+
| `glyph` (Required) | "ActivityFeed", "AddFile", "AllProducts", "AnalyticsNode", "Apps", "Array", "ArrowDown", "ArrowLeft", "ArrowRight", "ArrowUp", "Award", "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", "Shield", "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. | |
|
|
42
|
+
| `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'` |
|
|
43
|
+
| `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. | |
|
|
44
|
+
| `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. | |
|
|
45
|
+
| ... | `SVGR.ComponentProps` | All other props will be spread on the `svg` element | |
|
|
59
46
|
|
|
60
47
|
# createIconComponent
|
|
61
48
|
|
|
@@ -153,5 +140,5 @@ A `LGGlyph.Component`
|
|
|
153
140
|
|
|
154
141
|
- After uploading a new SVG file to `src/glyphs`, replace all `fill` property values for strokes with `#000`.
|
|
155
142
|
- Update `src/glyphs/index.ts` to import/export the SVG file.
|
|
156
|
-
- Build the package with `
|
|
143
|
+
- Build the package with `pnpm run build` to create the component in `src/generated`.
|
|
157
144
|
- Update README
|
package/dist/Award.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).Award=e.Award||{},e.Award.js=r(e.React,e.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 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 a(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 i(e,r){return r||(r=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(r)}}))}var o,u,f={small:14,default:16,large:20,xlarge:24};var c=["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,p=e["aria-label"],y=e["aria-labelledby"],v=e.fill,m=e.role,C=void 0===m?"img":m,g=function(e,r){if(null==e)return{};var t,n,a=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)&&(a[t]=e[t])}return a}(e,c),O=r.css(o||(o=i(["\n color: ",";\n "])),v),h=r.css(u||(u=i(["\n flex-shrink: 0;\n "]))),j=function(e,r,t){var n,l=t["aria-label"],i=t["aria-labelledby"],o=t.title;switch(e){case"img":return l||i||o?a(a(a({},"aria-labelledby",i),"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:""}}}(C,"Award",a(a({title:d},"aria-label",p),"aria-labelledby",y));return n.createElement("svg",l({className:r.cx(a({},O,null!=v),h,t),height:"number"==typeof s?s:f[s],width:"number"==typeof s?s:f[s],role:C},j,g,{viewBox:"0 0 16 16"}),n.createElement("path",{d:"M7.86523 4.50095C7.91495 4.37545 8.08505 4.37545 8.13477 4.50095L8.58203 5.63056C8.60293 5.68332 8.64988 5.71981 8.7041 5.72453L9.86621 5.82242C9.99499 5.83357 10.0474 6.00227 9.94922 6.09063L9.06445 6.88644C9.023 6.92372 9.00492 6.98243 9.01758 7.03817L9.28711 8.22749C9.31712 8.35959 9.18073 8.46438 9.07031 8.3939L8.07617 7.75568C8.0296 7.72581 7.9704 7.72581 7.92383 7.75568L6.92969 8.3939C6.81926 8.46437 6.68288 8.35959 6.71289 8.22749L6.98242 7.03817C6.99508 6.98243 6.977 6.92372 6.93555 6.88644L6.05078 6.09063C5.95261 6.00227 6.00503 5.83356 6.13379 5.82242L7.2959 5.72453C7.35011 5.7198 7.39706 5.68331 7.41797 5.63056L7.86523 4.50095Z",fill:"currentColor"}),n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 1.3999C10.7614 1.3999 13 3.64376 13 6.41169C13 7.54003 12.6278 8.58111 12 9.41877V13.5975C12 14.1511 11.5523 14.5999 11 14.5999H10.9727C10.8025 14.5999 10.635 14.5565 10.4863 14.4736L8 13.0856L5.51367 14.4736C5.36498 14.5565 5.1975 14.5999 5.02734 14.5999H5C4.44772 14.5999 4 14.1511 4 13.5975V9.41877C3.37223 8.58111 3 7.54003 3 6.41169C3 3.64376 5.23858 1.3999 8 1.3999ZM11 10.4201C10.1642 11.0496 9.1259 11.4235 8 11.4235C6.8741 11.4235 5.83577 11.0496 5 10.4201V13.5975H5.02734L7.51367 12.2095C7.81599 12.0409 8.18401 12.0409 8.48633 12.2095L10.9727 13.5975H11V10.4201ZM8 2.40226C5.79086 2.40226 4 4.19734 4 6.41169C4 8.62604 5.79086 10.4211 8 10.4211C10.2091 10.4211 12 8.62604 12 6.41169C12 4.19734 10.2091 2.40226 8 2.40226Z",fill:"currentColor"}))};return b.displayName="Award",b.isGlyph=!0,b});
|
|
2
|
+
//# sourceMappingURL=Award.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Award.js","sources":["../../src/glyphCommon.ts","../../src/generated/Award.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 2af5130aab048c3e288e34ff76af2958\n*/\nimport * as React from \"react\";\nimport { css, cx } from '@leafygreen-ui/emotion';\nimport { generateAccessibleProps, sizeMap } from '../glyphCommon';\nimport { LGGlyph } from '../types';\nexport interface AwardProps extends LGGlyph.ComponentProps {}\nconst Award = ({\n className,\n size = 16,\n title,\n ['aria-label']: ariaLabel,\n ['aria-labelledby']: ariaLabelledby,\n fill,\n role = 'img',\n ...props\n}: AwardProps) => {\n const fillStyle = css`\n color: ${fill};\n `;\n const noFlexShrink = css`\n flex-shrink: 0;\n `;\n const accessibleProps = generateAccessibleProps(role, 'Award', {\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=\"M7.86523 4.50095C7.91495 4.37545 8.08505 4.37545 8.13477 4.50095L8.58203 5.63056C8.60293 5.68332 8.64988 5.71981 8.7041 5.72453L9.86621 5.82242C9.99499 5.83357 10.0474 6.00227 9.94922 6.09063L9.06445 6.88644C9.023 6.92372 9.00492 6.98243 9.01758 7.03817L9.28711 8.22749C9.31712 8.35959 9.18073 8.46438 9.07031 8.3939L8.07617 7.75568C8.0296 7.72581 7.9704 7.72581 7.92383 7.75568L6.92969 8.3939C6.81926 8.46437 6.68288 8.35959 6.71289 8.22749L6.98242 7.03817C6.99508 6.98243 6.977 6.92372 6.93555 6.88644L6.05078 6.09063C5.95261 6.00227 6.00503 5.83356 6.13379 5.82242L7.2959 5.72453C7.35011 5.7198 7.39706 5.68331 7.41797 5.63056L7.86523 4.50095Z\" fill={'currentColor'} /><path fillRule=\"evenodd\" clipRule=\"evenodd\" d=\"M8 1.3999C10.7614 1.3999 13 3.64376 13 6.41169C13 7.54003 12.6278 8.58111 12 9.41877V13.5975C12 14.1511 11.5523 14.5999 11 14.5999H10.9727C10.8025 14.5999 10.635 14.5565 10.4863 14.4736L8 13.0856L5.51367 14.4736C5.36498 14.5565 5.1975 14.5999 5.02734 14.5999H5C4.44772 14.5999 4 14.1511 4 13.5975V9.41877C3.37223 8.58111 3 7.54003 3 6.41169C3 3.64376 5.23858 1.3999 8 1.3999ZM11 10.4201C10.1642 11.0496 9.1259 11.4235 8 11.4235C6.8741 11.4235 5.83577 11.0496 5 10.4201V13.5975H5.02734L7.51367 12.2095C7.81599 12.0409 8.18401 12.0409 8.48633 12.2095L10.9727 13.5975H11V10.4201ZM8 2.40226C5.79086 2.40226 4 4.19734 4 6.41169C4 8.62604 5.79086 10.4211 8 10.4211C10.2091 10.4211 12 8.62604 12 6.41169C12 4.19734 10.2091 2.40226 8 2.40226Z\" fill={'currentColor'} /></svg>;\n};\nAward.displayName = 'Award';\nAward.isGlyph = true;\nexport default Award;"],"names":["_templateObject","_templateObject2","sizeMap","small","default","large","xlarge","_excluded","Award","_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":"24CAOO,ICNHA,EAAiBC,EDMVC,EAAU,CACnBC,MAAO,GACPC,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iBN,EAAO,CACzBoB,QAAS,cACMN,EAAMC,cAAc,OAAQ,CAC3CM,EAAG,yoBACHxB,KAAM,iBACSiB,EAAMC,cAAc,OAAQ,CAC3CO,SAAU,UACVC,SAAU,UACVF,EAAG,iuBACHxB,KAAM,iBAEV,SACAR,EAAMmC,YAAc,QACpBnC,EAAMoC,SAAU"}
|
package/dist/checksums.json
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"ArrowLeft": "f377c2cf7f24d2775a9639a5c3a69e9c",
|
|
11
11
|
"ArrowRight": "7d70468ac5bba3349bbcef4a57012c13",
|
|
12
12
|
"ArrowUp": "117a622c21bea07e57fcb4d124a57b38",
|
|
13
|
+
"Award": "2af5130aab048c3e288e34ff76af2958",
|
|
13
14
|
"Beaker": "637fb4f7877cc523849a231b654a18c0",
|
|
14
15
|
"Bell": "a58b50dad9731cb5d2fe51979c226d1e",
|
|
15
16
|
"Biometric": "3db4b9837dff136264775ffc89a61f28",
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as e from"react";import{css as r,cx as l}from"@leafygreen-ui/emotion";function a(e,r,l){return(r=function(e){var r=function(e,r){if("object"!=typeof e||!e)return e;var l=e[Symbol.toPrimitive];if(void 0!==l){var a=l.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+""}(r))in e?Object.defineProperty(e,r,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[r]=l,e}function t(){return t=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var l=arguments[r];for(var a in l)({}).hasOwnProperty.call(l,a)&&(e[a]=l[a])}return e},t.apply(null,arguments)}function i(e,r){return r||(r=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(r)}}))}var n,o,u={small:14,default:16,large:20,xlarge:24};var c=["className","size","title","aria-label","aria-labelledby","fill","role"],f=function(f){var b=f.className,s=f.size,d=void 0===s?16:s,m=f.title,p=f["aria-label"],v=f["aria-labelledby"],C=f.fill,y=f.role,g=void 0===y?"img":y,h=function(e,r){if(null==e)return{};var l,a,t=function(e,r){if(null==e)return{};var l={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(-1!==r.indexOf(a))continue;l[a]=e[a]}return l}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)l=i[a],-1===r.indexOf(l)&&{}.propertyIsEnumerable.call(e,l)&&(t[l]=e[l])}return t}(f,c),L=r(n||(n=i(["\n color: ",";\n "])),C),O=r(o||(o=i(["\n flex-shrink: 0;\n "]))),w=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:""}}}(g,"Award",a(a({title:m},"aria-label",p),"aria-labelledby",v));return e.createElement("svg",t({className:l(a({},L,null!=C),O,b),height:"number"==typeof d?d:u[d],width:"number"==typeof d?d:u[d],role:g},w,h,{viewBox:"0 0 16 16"}),e.createElement("path",{d:"M7.86523 4.50095C7.91495 4.37545 8.08505 4.37545 8.13477 4.50095L8.58203 5.63056C8.60293 5.68332 8.64988 5.71981 8.7041 5.72453L9.86621 5.82242C9.99499 5.83357 10.0474 6.00227 9.94922 6.09063L9.06445 6.88644C9.023 6.92372 9.00492 6.98243 9.01758 7.03817L9.28711 8.22749C9.31712 8.35959 9.18073 8.46438 9.07031 8.3939L8.07617 7.75568C8.0296 7.72581 7.9704 7.72581 7.92383 7.75568L6.92969 8.3939C6.81926 8.46437 6.68288 8.35959 6.71289 8.22749L6.98242 7.03817C6.99508 6.98243 6.977 6.92372 6.93555 6.88644L6.05078 6.09063C5.95261 6.00227 6.00503 5.83356 6.13379 5.82242L7.2959 5.72453C7.35011 5.7198 7.39706 5.68331 7.41797 5.63056L7.86523 4.50095Z",fill:"currentColor"}),e.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 1.3999C10.7614 1.3999 13 3.64376 13 6.41169C13 7.54003 12.6278 8.58111 12 9.41877V13.5975C12 14.1511 11.5523 14.5999 11 14.5999H10.9727C10.8025 14.5999 10.635 14.5565 10.4863 14.4736L8 13.0856L5.51367 14.4736C5.36498 14.5565 5.1975 14.5999 5.02734 14.5999H5C4.44772 14.5999 4 14.1511 4 13.5975V9.41877C3.37223 8.58111 3 7.54003 3 6.41169C3 3.64376 5.23858 1.3999 8 1.3999ZM11 10.4201C10.1642 11.0496 9.1259 11.4235 8 11.4235C6.8741 11.4235 5.83577 11.0496 5 10.4201V13.5975H5.02734L7.51367 12.2095C7.81599 12.0409 8.18401 12.0409 8.48633 12.2095L10.9727 13.5975H11V10.4201ZM8 2.40226C5.79086 2.40226 4 4.19734 4 6.41169C4 8.62604 5.79086 10.4211 8 10.4211C10.2091 10.4211 12 8.62604 12 6.41169C12 4.19734 10.2091 2.40226 8 2.40226Z",fill:"currentColor"}))};f.displayName="Award",f.isGlyph=!0;export{f as default};
|
|
2
|
+
//# sourceMappingURL=Award.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Award.js","sources":["../../src/glyphCommon.ts","../../src/generated/Award.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 2af5130aab048c3e288e34ff76af2958\n*/\nimport * as React from \"react\";\nimport { css, cx } from '@leafygreen-ui/emotion';\nimport { generateAccessibleProps, sizeMap } from '../glyphCommon';\nimport { LGGlyph } from '../types';\nexport interface AwardProps extends LGGlyph.ComponentProps {}\nconst Award = ({\n className,\n size = 16,\n title,\n ['aria-label']: ariaLabel,\n ['aria-labelledby']: ariaLabelledby,\n fill,\n role = 'img',\n ...props\n}: AwardProps) => {\n const fillStyle = css`\n color: ${fill};\n `;\n const noFlexShrink = css`\n flex-shrink: 0;\n `;\n const accessibleProps = generateAccessibleProps(role, 'Award', {\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=\"M7.86523 4.50095C7.91495 4.37545 8.08505 4.37545 8.13477 4.50095L8.58203 5.63056C8.60293 5.68332 8.64988 5.71981 8.7041 5.72453L9.86621 5.82242C9.99499 5.83357 10.0474 6.00227 9.94922 6.09063L9.06445 6.88644C9.023 6.92372 9.00492 6.98243 9.01758 7.03817L9.28711 8.22749C9.31712 8.35959 9.18073 8.46438 9.07031 8.3939L8.07617 7.75568C8.0296 7.72581 7.9704 7.72581 7.92383 7.75568L6.92969 8.3939C6.81926 8.46437 6.68288 8.35959 6.71289 8.22749L6.98242 7.03817C6.99508 6.98243 6.977 6.92372 6.93555 6.88644L6.05078 6.09063C5.95261 6.00227 6.00503 5.83356 6.13379 5.82242L7.2959 5.72453C7.35011 5.7198 7.39706 5.68331 7.41797 5.63056L7.86523 4.50095Z\" fill={'currentColor'} /><path fillRule=\"evenodd\" clipRule=\"evenodd\" d=\"M8 1.3999C10.7614 1.3999 13 3.64376 13 6.41169C13 7.54003 12.6278 8.58111 12 9.41877V13.5975C12 14.1511 11.5523 14.5999 11 14.5999H10.9727C10.8025 14.5999 10.635 14.5565 10.4863 14.4736L8 13.0856L5.51367 14.4736C5.36498 14.5565 5.1975 14.5999 5.02734 14.5999H5C4.44772 14.5999 4 14.1511 4 13.5975V9.41877C3.37223 8.58111 3 7.54003 3 6.41169C3 3.64376 5.23858 1.3999 8 1.3999ZM11 10.4201C10.1642 11.0496 9.1259 11.4235 8 11.4235C6.8741 11.4235 5.83577 11.0496 5 10.4201V13.5975H5.02734L7.51367 12.2095C7.81599 12.0409 8.18401 12.0409 8.48633 12.2095L10.9727 13.5975H11V10.4201ZM8 2.40226C5.79086 2.40226 4 4.19734 4 6.41169C4 8.62604 5.79086 10.4211 8 10.4211C10.2091 10.4211 12 8.62604 12 6.41169C12 4.19734 10.2091 2.40226 8 2.40226Z\" fill={'currentColor'} /></svg>;\n};\nAward.displayName = 'Award';\nAward.isGlyph = true;\nexport default Award;"],"names":["_templateObject","_templateObject2","sizeMap","small","default","large","xlarge","_excluded","Award","_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":"ozBAOO,ICNHA,EAAiBC,E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