Skip to content

Commit

Permalink
feat(deps-dev): upgrade @carbon/icons 11.37 -> 11.41 (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
metonym authored May 27, 2024
1 parent 094c317 commit 997f3d0
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 8 deletions.
27 changes: 26 additions & 1 deletion ICON_INDEX.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Icon Index

> 2237 icons from [@carbon/icons@11.37.0](https://unpkg.com/browse/@carbon/icons@11.37.0/)
> 2262 icons from [@carbon/icons@11.41.0](https://unpkg.com/browse/@carbon/icons@11.41.0/)
- Accessibility
- AccessibilityAlt
Expand Down Expand Up @@ -358,6 +358,7 @@
- CircleDash
- CircleFillGlyph
- CircleFilled
- CircleOutline
- CirclePacking
- CircleSolid
- CircleStrokeGlyph
Expand Down Expand Up @@ -566,6 +567,8 @@
- Diagram
- DiagramReference
- DiamondFillGlyph
- DiamondOutline
- DiamondSolid
- DirectLink
- DirectionBearRight_01
- DirectionBearRight_01Filled
Expand Down Expand Up @@ -847,6 +850,10 @@
- Help
- HelpDesk
- HelpFilled
- HexagonOutline
- HexagonSolid
- HexagonVerticalOutline
- HexagonVerticalSolid
- Home
- HorizontalView
- Hospital
Expand Down Expand Up @@ -1404,6 +1411,14 @@
- PenFountain
- Pending
- PendingFilled
- PentagonDownOutline
- PentagonDownSolid
- PentagonLeftOutline
- PentagonLeftSolid
- PentagonOutline
- PentagonRightOutline
- PentagonRightSolid
- PentagonSolid
- Percentage
- PercentageFilled
- Person
Expand Down Expand Up @@ -1736,6 +1751,8 @@
- Sprout
- Sql
- SquareFillGlyph
- SquareOutline
- SquareSolid
- StackLimitation
- Stamp
- Star
Expand Down Expand Up @@ -1926,6 +1943,14 @@
- TreeFallRisk
- TreeView
- TreeViewAlt
- TriangleDownOutline
- TriangleDownSolid
- TriangleLeftOutline
- TriangleLeftSolid
- TriangleOutline
- TriangleRightOutline
- TriangleRightSolid
- TriangleSolid
- Trophy
- TrophyFilled
- TropicalStorm
Expand Down
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/src/build-info.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"devDependencies": {
"@carbon/icon-helpers": "latest",
"@carbon/icons": "11.37.0",
"@carbon/icons": "11.41.0",
"@carbon/icons-11.31": "npm:@carbon/[email protected]",
"@types/bun": "latest",
"@types/carbon__icon-helpers": "latest",
Expand Down
12 changes: 8 additions & 4 deletions src/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,19 @@ export const template = ({ descriptor }: IconOutput) => `<script>
{...attributes}
{...$$restProps}>
{#if title}<title>{title}</title>{/if}
${descriptor.content.map((element) => toString(element)).join("")}
${descriptor?.content?.map((element) => toString(element)).join("")}
</svg>`;

export const templateSvg = ({ moduleName, descriptor }: IconOutput) => {
const isGlyph = /Glyph$/.test(moduleName);
const { width, height, ...rest } = descriptor.attrs;
const { width, height, ...rest } = descriptor?.attrs;

if (!descriptor?.content) {
console.error(`No content found for ${moduleName}`);
}

let attrs = formatAttributes(
isGlyph ? descriptor.attrs : { ...rest, width: 16, height: 16 }
isGlyph ? descriptor?.attrs : { ...rest, width: 16, height: 16 }
);

return `<svg
Expand All @@ -41,6 +45,6 @@ export const templateSvg = ({ moduleName, descriptor }: IconOutput) => {
${attrs}
fill="currentColor"
preserveAspectRatio="xMidYMid meet">
${descriptor.content.map((element) => toString(element)).join("")}
${descriptor?.content?.map((element) => toString(element)).join("")}
</svg>`;
};
25 changes: 25 additions & 0 deletions tests/__snapshots__/index.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ exports[`imports 1`] = `
"CircleDash",
"CircleFillGlyph",
"CircleFilled",
"CircleOutline",
"CirclePacking",
"CircleSolid",
"CircleStrokeGlyph",
Expand Down Expand Up @@ -566,6 +567,8 @@ exports[`imports 1`] = `
"Diagram",
"DiagramReference",
"DiamondFillGlyph",
"DiamondOutline",
"DiamondSolid",
"DirectLink",
"DirectionBearRight_01",
"DirectionBearRight_01Filled",
Expand Down Expand Up @@ -847,6 +850,10 @@ exports[`imports 1`] = `
"Help",
"HelpDesk",
"HelpFilled",
"HexagonOutline",
"HexagonSolid",
"HexagonVerticalOutline",
"HexagonVerticalSolid",
"Home",
"HorizontalView",
"Hospital",
Expand Down Expand Up @@ -1404,6 +1411,14 @@ exports[`imports 1`] = `
"PenFountain",
"Pending",
"PendingFilled",
"PentagonDownOutline",
"PentagonDownSolid",
"PentagonLeftOutline",
"PentagonLeftSolid",
"PentagonOutline",
"PentagonRightOutline",
"PentagonRightSolid",
"PentagonSolid",
"Percentage",
"PercentageFilled",
"Person",
Expand Down Expand Up @@ -1736,6 +1751,8 @@ exports[`imports 1`] = `
"Sprout",
"Sql",
"SquareFillGlyph",
"SquareOutline",
"SquareSolid",
"StackLimitation",
"Stamp",
"Star",
Expand Down Expand Up @@ -1926,6 +1943,14 @@ exports[`imports 1`] = `
"TreeFallRisk",
"TreeView",
"TreeViewAlt",
"TriangleDownOutline",
"TriangleDownSolid",
"TriangleLeftOutline",
"TriangleLeftSolid",
"TriangleOutline",
"TriangleRightOutline",
"TriangleRightSolid",
"TriangleSolid",
"Trophy",
"TrophyFilled",
"TropicalStorm",
Expand Down
2 changes: 1 addition & 1 deletion tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { template } from "../src/template";

test("imports", async () => {
const icons = await buildIcons();
expect(icons.length).toEqual(2237);
expect(icons.length).toEqual(2262);
expect(icons).toMatchSnapshot();
});

Expand Down

0 comments on commit 997f3d0

Please sign in to comment.