Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix global namespace collisions #80

Merged
merged 3 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@phosphor-icons/react",
"version": "2.0.14",
"version": "2.0.15",
"description": "A clean and friendly icon family for React",
"author": {
"name": "Tobias Fried",
Expand Down
22 changes: 12 additions & 10 deletions scripts/assemble.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,14 @@ import type { Icon } from "../lib/types";
import IconBase from "../lib/IconBase";
import weights from "../defs/${name}";

export const ${name}: Icon = forwardRef((props, ref) => (
const I: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

${name}.displayName = "${name}";
I.displayName = "${name}";
export { I as ${name}${
!!ALIASES[key] ? `, I as ${pascalize(ALIASES[key])}` : ""
} }
`;

let ssrString = `
Expand All @@ -95,11 +98,14 @@ import type { Icon } from "../lib/types";
import SSRBase from "../lib/SSRBase";
import weights from "../defs/${name}";

export const ${name}: Icon = forwardRef((props, ref) => (
const I: Icon = forwardRef((props, ref) => (
<SSRBase ref={ref} {...props} weights={weights} />
));

${name}.displayName = "${name}";
I.displayName = "${name}";
export { I as ${name}${
!!ALIASES[key] ? `, I as ${pascalize(ALIASES[key])}` : ""
} }
`;

try {
Expand Down Expand Up @@ -150,14 +156,10 @@ export { default as SSRBase } from "../lib/SSRBase";
for (let key in icons) {
const name = pascalize(key);
csrIndex += `\
export { ${name}${
!!ALIASES[key] ? `, ${name} as ${pascalize(ALIASES[key])}` : ""
} } from "./csr/${name}";
export * from "./csr/${name}";
`;
ssrIndex += `\
export { ${name}${
!!ALIASES[key] ? `, ${name} as ${pascalize(ALIASES[key])}` : ""
} } from "./${name}";
export * from "./${name}";
`;
}
try {
Expand Down
5 changes: 3 additions & 2 deletions src/csr/AddressBook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import type { Icon } from "../lib/types";
import IconBase from "../lib/IconBase";
import weights from "../defs/AddressBook";

export const AddressBook: Icon = forwardRef((props, ref) => (
const I: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AddressBook.displayName = "AddressBook";
I.displayName = "AddressBook";
export { I as AddressBook };
5 changes: 3 additions & 2 deletions src/csr/AirTrafficControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import type { Icon } from "../lib/types";
import IconBase from "../lib/IconBase";
import weights from "../defs/AirTrafficControl";

export const AirTrafficControl: Icon = forwardRef((props, ref) => (
const I: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AirTrafficControl.displayName = "AirTrafficControl";
I.displayName = "AirTrafficControl";
export { I as AirTrafficControl };
5 changes: 3 additions & 2 deletions src/csr/Airplane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import type { Icon } from "../lib/types";
import IconBase from "../lib/IconBase";
import weights from "../defs/Airplane";

export const Airplane: Icon = forwardRef((props, ref) => (
const I: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

Airplane.displayName = "Airplane";
I.displayName = "Airplane";
export { I as Airplane };
5 changes: 3 additions & 2 deletions src/csr/AirplaneInFlight.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import type { Icon } from "../lib/types";
import IconBase from "../lib/IconBase";
import weights from "../defs/AirplaneInFlight";

export const AirplaneInFlight: Icon = forwardRef((props, ref) => (
const I: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AirplaneInFlight.displayName = "AirplaneInFlight";
I.displayName = "AirplaneInFlight";
export { I as AirplaneInFlight };
5 changes: 3 additions & 2 deletions src/csr/AirplaneLanding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import type { Icon } from "../lib/types";
import IconBase from "../lib/IconBase";
import weights from "../defs/AirplaneLanding";

export const AirplaneLanding: Icon = forwardRef((props, ref) => (
const I: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AirplaneLanding.displayName = "AirplaneLanding";
I.displayName = "AirplaneLanding";
export { I as AirplaneLanding };
5 changes: 3 additions & 2 deletions src/csr/AirplaneTakeoff.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import type { Icon } from "../lib/types";
import IconBase from "../lib/IconBase";
import weights from "../defs/AirplaneTakeoff";

export const AirplaneTakeoff: Icon = forwardRef((props, ref) => (
const I: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AirplaneTakeoff.displayName = "AirplaneTakeoff";
I.displayName = "AirplaneTakeoff";
export { I as AirplaneTakeoff };
5 changes: 3 additions & 2 deletions src/csr/AirplaneTilt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import type { Icon } from "../lib/types";
import IconBase from "../lib/IconBase";
import weights from "../defs/AirplaneTilt";

export const AirplaneTilt: Icon = forwardRef((props, ref) => (
const I: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AirplaneTilt.displayName = "AirplaneTilt";
I.displayName = "AirplaneTilt";
export { I as AirplaneTilt };
5 changes: 3 additions & 2 deletions src/csr/Airplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import type { Icon } from "../lib/types";
import IconBase from "../lib/IconBase";
import weights from "../defs/Airplay";

export const Airplay: Icon = forwardRef((props, ref) => (
const I: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

Airplay.displayName = "Airplay";
I.displayName = "Airplay";
export { I as Airplay };
5 changes: 3 additions & 2 deletions src/csr/Alarm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import type { Icon } from "../lib/types";
import IconBase from "../lib/IconBase";
import weights from "../defs/Alarm";

export const Alarm: Icon = forwardRef((props, ref) => (
const I: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

Alarm.displayName = "Alarm";
I.displayName = "Alarm";
export { I as Alarm };
5 changes: 3 additions & 2 deletions src/csr/Alien.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import type { Icon } from "../lib/types";
import IconBase from "../lib/IconBase";
import weights from "../defs/Alien";

export const Alien: Icon = forwardRef((props, ref) => (
const I: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

Alien.displayName = "Alien";
I.displayName = "Alien";
export { I as Alien };
5 changes: 3 additions & 2 deletions src/csr/AlignBottom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import type { Icon } from "../lib/types";
import IconBase from "../lib/IconBase";
import weights from "../defs/AlignBottom";

export const AlignBottom: Icon = forwardRef((props, ref) => (
const I: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AlignBottom.displayName = "AlignBottom";
I.displayName = "AlignBottom";
export { I as AlignBottom };
5 changes: 3 additions & 2 deletions src/csr/AlignBottomSimple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import type { Icon } from "../lib/types";
import IconBase from "../lib/IconBase";
import weights from "../defs/AlignBottomSimple";

export const AlignBottomSimple: Icon = forwardRef((props, ref) => (
const I: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AlignBottomSimple.displayName = "AlignBottomSimple";
I.displayName = "AlignBottomSimple";
export { I as AlignBottomSimple };
5 changes: 3 additions & 2 deletions src/csr/AlignCenterHorizontal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import type { Icon } from "../lib/types";
import IconBase from "../lib/IconBase";
import weights from "../defs/AlignCenterHorizontal";

export const AlignCenterHorizontal: Icon = forwardRef((props, ref) => (
const I: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AlignCenterHorizontal.displayName = "AlignCenterHorizontal";
I.displayName = "AlignCenterHorizontal";
export { I as AlignCenterHorizontal };
5 changes: 3 additions & 2 deletions src/csr/AlignCenterHorizontalSimple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import type { Icon } from "../lib/types";
import IconBase from "../lib/IconBase";
import weights from "../defs/AlignCenterHorizontalSimple";

export const AlignCenterHorizontalSimple: Icon = forwardRef((props, ref) => (
const I: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AlignCenterHorizontalSimple.displayName = "AlignCenterHorizontalSimple";
I.displayName = "AlignCenterHorizontalSimple";
export { I as AlignCenterHorizontalSimple };
5 changes: 3 additions & 2 deletions src/csr/AlignCenterVertical.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import type { Icon } from "../lib/types";
import IconBase from "../lib/IconBase";
import weights from "../defs/AlignCenterVertical";

export const AlignCenterVertical: Icon = forwardRef((props, ref) => (
const I: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AlignCenterVertical.displayName = "AlignCenterVertical";
I.displayName = "AlignCenterVertical";
export { I as AlignCenterVertical };
5 changes: 3 additions & 2 deletions src/csr/AlignCenterVerticalSimple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import type { Icon } from "../lib/types";
import IconBase from "../lib/IconBase";
import weights from "../defs/AlignCenterVerticalSimple";

export const AlignCenterVerticalSimple: Icon = forwardRef((props, ref) => (
const I: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AlignCenterVerticalSimple.displayName = "AlignCenterVerticalSimple";
I.displayName = "AlignCenterVerticalSimple";
export { I as AlignCenterVerticalSimple };
5 changes: 3 additions & 2 deletions src/csr/AlignLeft.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import type { Icon } from "../lib/types";
import IconBase from "../lib/IconBase";
import weights from "../defs/AlignLeft";

export const AlignLeft: Icon = forwardRef((props, ref) => (
const I: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AlignLeft.displayName = "AlignLeft";
I.displayName = "AlignLeft";
export { I as AlignLeft };
5 changes: 3 additions & 2 deletions src/csr/AlignLeftSimple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import type { Icon } from "../lib/types";
import IconBase from "../lib/IconBase";
import weights from "../defs/AlignLeftSimple";

export const AlignLeftSimple: Icon = forwardRef((props, ref) => (
const I: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AlignLeftSimple.displayName = "AlignLeftSimple";
I.displayName = "AlignLeftSimple";
export { I as AlignLeftSimple };
5 changes: 3 additions & 2 deletions src/csr/AlignRight.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import type { Icon } from "../lib/types";
import IconBase from "../lib/IconBase";
import weights from "../defs/AlignRight";

export const AlignRight: Icon = forwardRef((props, ref) => (
const I: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AlignRight.displayName = "AlignRight";
I.displayName = "AlignRight";
export { I as AlignRight };
5 changes: 3 additions & 2 deletions src/csr/AlignRightSimple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import type { Icon } from "../lib/types";
import IconBase from "../lib/IconBase";
import weights from "../defs/AlignRightSimple";

export const AlignRightSimple: Icon = forwardRef((props, ref) => (
const I: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AlignRightSimple.displayName = "AlignRightSimple";
I.displayName = "AlignRightSimple";
export { I as AlignRightSimple };
5 changes: 3 additions & 2 deletions src/csr/AlignTop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import type { Icon } from "../lib/types";
import IconBase from "../lib/IconBase";
import weights from "../defs/AlignTop";

export const AlignTop: Icon = forwardRef((props, ref) => (
const I: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AlignTop.displayName = "AlignTop";
I.displayName = "AlignTop";
export { I as AlignTop };
5 changes: 3 additions & 2 deletions src/csr/AlignTopSimple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import type { Icon } from "../lib/types";
import IconBase from "../lib/IconBase";
import weights from "../defs/AlignTopSimple";

export const AlignTopSimple: Icon = forwardRef((props, ref) => (
const I: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AlignTopSimple.displayName = "AlignTopSimple";
I.displayName = "AlignTopSimple";
export { I as AlignTopSimple };
5 changes: 3 additions & 2 deletions src/csr/AmazonLogo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import type { Icon } from "../lib/types";
import IconBase from "../lib/IconBase";
import weights from "../defs/AmazonLogo";

export const AmazonLogo: Icon = forwardRef((props, ref) => (
const I: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AmazonLogo.displayName = "AmazonLogo";
I.displayName = "AmazonLogo";
export { I as AmazonLogo };
5 changes: 3 additions & 2 deletions src/csr/Anchor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import type { Icon } from "../lib/types";
import IconBase from "../lib/IconBase";
import weights from "../defs/Anchor";

export const Anchor: Icon = forwardRef((props, ref) => (
const I: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

Anchor.displayName = "Anchor";
I.displayName = "Anchor";
export { I as Anchor };
5 changes: 3 additions & 2 deletions src/csr/AnchorSimple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import type { Icon } from "../lib/types";
import IconBase from "../lib/IconBase";
import weights from "../defs/AnchorSimple";

export const AnchorSimple: Icon = forwardRef((props, ref) => (
const I: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AnchorSimple.displayName = "AnchorSimple";
I.displayName = "AnchorSimple";
export { I as AnchorSimple };
5 changes: 3 additions & 2 deletions src/csr/AndroidLogo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import type { Icon } from "../lib/types";
import IconBase from "../lib/IconBase";
import weights from "../defs/AndroidLogo";

export const AndroidLogo: Icon = forwardRef((props, ref) => (
const I: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AndroidLogo.displayName = "AndroidLogo";
I.displayName = "AndroidLogo";
export { I as AndroidLogo };
5 changes: 3 additions & 2 deletions src/csr/AngularLogo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import type { Icon } from "../lib/types";
import IconBase from "../lib/IconBase";
import weights from "../defs/AngularLogo";

export const AngularLogo: Icon = forwardRef((props, ref) => (
const I: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

AngularLogo.displayName = "AngularLogo";
I.displayName = "AngularLogo";
export { I as AngularLogo };
5 changes: 3 additions & 2 deletions src/csr/Aperture.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import type { Icon } from "../lib/types";
import IconBase from "../lib/IconBase";
import weights from "../defs/Aperture";

export const Aperture: Icon = forwardRef((props, ref) => (
const I: Icon = forwardRef((props, ref) => (
<IconBase ref={ref} {...props} weights={weights} />
));

Aperture.displayName = "Aperture";
I.displayName = "Aperture";
export { I as Aperture };
Loading