@central-icons-react/all 1.1.320 → 1.1.321
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/CentralIconBase/index.d.ts +5 -5
- package/CentralIconBase/index.js +23 -3
- package/CentralIconBase/index.js.map +1 -1
- package/README.md +2 -0
- package/index.js +2 -2
- package/index.js.map +2 -2
- package/index.mjs +2 -2
- package/index.mjs.map +2 -2
- package/license-check.js +1 -1
- package/package.json +1 -1
- package/skills/central-icons-react-all/SKILL.md +1 -1
|
@@ -6,8 +6,8 @@ export type CentralIconBaseProps = {
|
|
|
6
6
|
mode?: "masked" | "raw";
|
|
7
7
|
maskId?: string;
|
|
8
8
|
} & SVGProps<SVGSVGElement>;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
type Props = CentralIconBaseProps & {
|
|
10
|
+
ariaLabel?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const CentralIconBase: React.FC<Props>;
|
|
13
|
+
export {};
|
package/CentralIconBase/index.js
CHANGED
|
@@ -1,12 +1,32 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
const ModernCentralIconBase = (props) => {
|
|
3
|
+
const instanceId = React.useId();
|
|
4
|
+
return React.createElement(CentralIconSvg, { ...props, instanceId: instanceId });
|
|
5
|
+
};
|
|
6
|
+
let nextLegacyId = 0;
|
|
7
|
+
class LegacyCentralIconBase extends React.Component {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.state = {};
|
|
11
|
+
}
|
|
12
|
+
componentDidMount() {
|
|
13
|
+
// Defer legacy IDs until mount so server and initial client markup agree.
|
|
14
|
+
this.setState({ instanceId: `legacy-${++nextLegacyId}` });
|
|
15
|
+
}
|
|
16
|
+
render() {
|
|
17
|
+
return (React.createElement(CentralIconSvg, { ...this.props.iconProps, instanceId: this.state.instanceId }));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export const CentralIconBase = (props) => typeof React.useId === "function" ? (React.createElement(ModernCentralIconBase, { ...props })) : (React.createElement(LegacyCentralIconBase, { iconProps: props }));
|
|
21
|
+
const CentralIconSvg = ({ children, size = 24, ariaLabel, color, ariaHidden = true, style, mode = "masked", maskId, instanceId, ...props }) => {
|
|
22
|
+
const uniqueMaskId = instanceId ? `${maskId}-${instanceId}` : maskId;
|
|
3
23
|
const masked = mode !== "raw" && !!maskId;
|
|
4
24
|
return (React.createElement("svg", { ...props, "aria-hidden": ariaHidden, role: ariaHidden ? undefined : "img", width: typeof size === "number" ? `${size}px` : size, height: typeof size === "number" ? `${size}px` : size, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: { color, ...style } },
|
|
5
25
|
ariaLabel && !ariaHidden && React.createElement("title", null, ariaLabel),
|
|
6
26
|
masked ? (React.createElement(React.Fragment, null,
|
|
7
|
-
React.createElement("mask", { id:
|
|
27
|
+
React.createElement("mask", { id: uniqueMaskId, maskUnits: "userSpaceOnUse", x: "0", y: "0", width: "24", height: "24" },
|
|
8
28
|
React.createElement("rect", { width: "24", height: "24", fill: "#000" }),
|
|
9
29
|
React.createElement("g", { fill: "none", style: { color: "#fff" } }, children)),
|
|
10
|
-
React.createElement("rect", { width: "24", height: "24", fill: "currentColor", mask: `url(#${
|
|
30
|
+
React.createElement("rect", { width: "24", height: "24", fill: "currentColor", mask: `url(#${uniqueMaskId})` }))) : (children)));
|
|
11
31
|
};
|
|
12
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/CentralIconBase/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/CentralIconBase/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAY1B,MAAM,qBA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,CAAC;IAC1C,OAAO,CACL,gCACM,KAAK,iBACI,UAAU,EACvB,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,EACpC,KAAK,EAAE,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,EACpD,MAAM,EAAE,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,EACrD,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE;QAEzB,SAAS,IAAI,CAAC,UAAU,IAAI,mCAAQ,SAAS,CAAS;QACtD,MAAM,CAAC,CAAC,CAAC,CACR;YACE,8BACE,EAAE,EAAE,YAAY,EAChB,SAAS,EAAC,gBAAgB,EAC1B,CAAC,EAAC,GAAG,EACL,CAAC,EAAC,GAAG,EACL,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI;gBAEX,8BAAM,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,IAAI,EAAC,MAAM,GAAG;gBAC3C,2BAAG,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IACpC,QAAQ,CACP,CACC;YACP,8BACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,IAAI,EAAC,cAAc,EACnB,IAAI,EAAE,QAAQ,YAAY,GAAG,GAC7B,CACD,CACJ,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,CACG,CACP,CAAC;AACJ,CAAC,CAAC"}
|
package/README.md
CHANGED
|
@@ -91,6 +91,8 @@ function MyComponent() {
|
|
|
91
91
|
|
|
92
92
|
## Using transparent colors
|
|
93
93
|
|
|
94
|
+
Each mounted icon has a unique mask ID, so repeated icons remain independent even when one is hidden with `display: none`. React 18+ uses `useId()` for IDs that also match during server rendering and hydration. Older React versions assign unique IDs after mounting; server-rendered icons retain shared IDs until hydration completes.
|
|
95
|
+
|
|
94
96
|
Transparent colors work out of the box. Every icon is drawn through a mask and the color is painted once, so a semi-transparent `color` (or `currentColor` with an alpha channel) renders evenly — no darker overlaps:
|
|
95
97
|
|
|
96
98
|
```jsx
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/index.js
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 55686045 bytes
|
|
4
|
+
sha256: 1265ed65119f351d1050f1122995e7f9afb3c3443199a1f2c73ff7a9d27184df
|
package/index.js.map
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/index.js.map
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 60516395 bytes
|
|
4
|
+
sha256: 02001f4a8da5f58d95fb4ba1248a0caa846b827582eaa15511167a1c02e9bc7e
|
package/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/index.mjs
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 55685272 bytes
|
|
4
|
+
sha256: f69f670164f0c78a4e59bfa5a0bd39f55c503b168524b5a9b33b666eeccc0755
|
package/index.mjs.map
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/index.mjs.map
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 60516183 bytes
|
|
4
|
+
sha256: 1ad522994107122a85fb3553dc1192b7cd5313c41171cf1c2245cec435e9a764
|
package/license-check.js
CHANGED
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ description: Use when inserting icons in React code that imports from @central-i
|
|
|
5
5
|
|
|
6
6
|
# Central Icons — React (all)
|
|
7
7
|
|
|
8
|
-
This skill helps you find and insert icons from the `@central-icons-react/all` package (version 1.1.
|
|
8
|
+
This skill helps you find and insert icons from the `@central-icons-react/all` package (version 1.1.321). The package exposes 2096 icons across 30 variants (round/square × filled/outlined × multiple corner radii and stroke widths) through a single dynamic `CentralIcon` component.
|
|
9
9
|
|
|
10
10
|
## Prefer a variant package when possible
|
|
11
11
|
|