Skip to content

Commit

Permalink
feat(deps-dev): upgrade @carbon/icons 11.37 -> 11.41
Browse files Browse the repository at this point in the history
  • Loading branch information
metonym committed May 12, 2024
1 parent 094c317 commit 520aa34
Show file tree
Hide file tree
Showing 6 changed files with 37 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>`;
};
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();

Check failure on line 9 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / test

error: expect(received).toMatchSnapshot(expected)

Expected: [ "Accessibility", "AccessibilityAlt", "AccessibilityColor", "AccessibilityColorFilled", "Account", "AccumulationIce", "AccumulationPrecipitation", "AccumulationRain", "AccumulationSnow", "Activity", "Add", "AddAlt", "AddComment", "AddFilled", "AddLarge", "AgricultureAnalytics", "Ai", "AiGovernanceLifecycle", "AiGovernanceTracked", "AiGovernanceUntracked", "AiLaunch", "AirlineDigitalGate", "AirlineManageGates", "AirlinePassengerCare", "AirlineRapidBoard", "Airplay", "AirplayFilled", "AirportLocation", "Airport_01", "Airport_02", "Alarm", "AlarmAdd", "AlarmSubtract", "AlignBoxBottomCenter", "AlignBoxBottomLeft", "AlignBoxBottomRight", "AlignBoxMiddleCenter", "AlignBoxMiddleLeft", "AlignBoxMiddleRight", "AlignBoxTopCenter", "AlignBoxTopLeft", "AlignBoxTopRight", "AlignHorizontalCenter", "AlignHorizontalLeft", "AlignHorizontalRight", "AlignVerticalBottom", "AlignVerticalCenter", "AlignVerticalTop", "Analytics", "AnalyticsCustom", "AnalyticsReference", "Aperture", "Api", "Api_1", "App", "AppConnectivity", "Apple", "AppleDash", "Application", "ApplicationMobile", "ApplicationVirtual", "ApplicationWeb", "Apps", "Archive", "Area", "AreaCustom", "ArithmeticMean", "ArithmeticMedian", "Arrival", "ArrowDown", "ArrowDownLeft", "ArrowDownRight", "ArrowLeft", "ArrowRight", "ArrowShiftDown", "ArrowUp", "ArrowUpLeft", "ArrowUpRight", "ArrowsHorizontal", "ArrowsVertical", "Asleep", "AsleepFilled", "Assembly", "AssemblyCluster", "AssemblyReference", "Asset", "AssetConfirm", "AssetDigitalTwin", "AssetView", "Asterisk", "Async", "At", "Attachment", "AudioConsole", "AugmentedReality", "Automatic", "Autoscaling", "Awake", "Badge", "BaggageClaim", "Bar", "Barcode", "BareMetalServer", "BareMetalServer_01", "BareMetalServer_02", "Basketball", "BastionHost", "Bat", "BatchJob", "BatchJobStep", "BatteryCharging", "BatteryEmpty", "BatteryFull", "BatteryHalf", "BatteryLow", "BatteryQuarter", "Bee", "BeeBat", "Beta", "Bicycle", "Binoculars", "BlockStorage", "BlockStorageAlt", "Blockchain", "Blog", "Bluetooth", "BluetoothOff", "Book", "Bookmark", "BookmarkAdd", "BookmarkFilled", "Boolean", "Boot", "BootVolume", "BootVolumeAlt", "BorderBottom", "BorderFull", "BorderLeft", "BorderNone", "BorderRight", "BorderTop", "Bot", "BottlesContainer", "Bottles_01", "Bottles_01Dash", "Bottles_02", "Bottles_02Dash", "Box", "BoxExtraLarge", "BoxLarge", "BoxMedium", "BoxPlot", "BoxSmall", "Branch", "BreakingChange", "BrightnessContrast", "BringForward", "BringToFront", "BuildTool", "Building", "BuildingInsights_1", "BuildingInsights_2", "BuildingInsights_3", "Bullhorn", "Buoy", "Bus", "BusinessProcesses", "ButtonCentered", "ButtonFlushLeft", "CabinCare", "CabinCareAlert", "CabinCareAlt", "Cad", "Cafe", "Calculation", "CalculationAlt", "Calculator", "CalculatorCheck", "Calendar", "CalendarAdd", "CalendarAddAlt", "CalendarHeatMap", "CalendarSettings", "CalendarTools", "Calibrate", "Calls", "CallsAll", "CallsIncoming", "Camera", "CameraAction", "Campsite", "Car", "CarFront", "Carbon", "CarbonAccounting", "CarbonForIbmDotcom", "CarbonForIbmProduct", "CarbonForMobile", "CarbonForSalesforce", "CarbonUiBuilder", "CaretDown", "CaretDownGlyph", "CaretLeft", "CaretLeftGlyph", "CaretRight", "CaretRightGlyph", "CaretSort", "CaretSortDown", "CaretSortUp", "CaretUp", "CaretUpGlyph", "CarouselHorizontal", "CarouselVertical", "Catalog", "CatalogPublish", "Categories", "Category", "CategoryAdd", "CategoryAnd", "CategoryNew", "CategoryNewEach", "CautionGlyph", "CautionInvertedGlyph", "Cda", "CellTower", "CenterCircle", "CenterSquare", "CenterToFit", "Certificate", "CertificateCheck", "ChangeCatalog", "CharacterDecimal",
});

Expand Down

0 comments on commit 520aa34

Please sign in to comment.