@purpurds/illustrative-icon 7.6.1 → 7.7.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/dist/animated-illustrative-icon-DHFverVA.js.map +1 -1
- package/dist/animated-illustrative-icon-DIij22F1.mjs.map +1 -1
- package/dist/animated-illustrative-icon.d.ts +4 -21
- package/dist/animated-illustrative-icon.d.ts.map +1 -1
- package/dist/illustrative-icon.cjs.js.map +1 -1
- package/dist/illustrative-icon.es.js.map +1 -1
- package/dist/static-illustrative-icon-D7TEjcF7.js.map +1 -1
- package/dist/static-illustrative-icon-z57e5Jl2.mjs.map +1 -1
- package/dist/static-illustrative-icon.d.ts +4 -9
- package/dist/static-illustrative-icon.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/animated-illustrative-icon.tsx +5 -15
- package/src/illustrative-icon.stories.tsx +0 -1
- package/src/static-illustrative-icon.tsx +5 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static-illustrative-icon-D7TEjcF7.js","sources":["../../../common/temp/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/bind.js","../src/static-illustrative-icon.tsx"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue.call(this, arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn this && this[arg] || arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(this, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, this && this[key] || key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import React, {
|
|
1
|
+
{"version":3,"file":"static-illustrative-icon-D7TEjcF7.js","sources":["../../../common/temp/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/bind.js","../src/static-illustrative-icon.tsx"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue.call(this, arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn this && this[arg] || arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(this, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, this && this[key] || key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import React, { forwardRef } from \"react\";\nimport type { BaseProps } from \"@purpurds/common-types\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./illustrative-icon.module.scss\";\n\nconst cx = c.bind(styles);\nconst rootClassName = \"purpur-illustrative-icon\";\n\ntype CreateSvg = {\n content?: string;\n title?: string;\n ariaHidden?: boolean;\n};\n\nexport type StaticIllustrativeBaseIconProps = Omit<BaseProps<\"span\">, \"children\"> & {\n allyTitle?: string;\n};\n\nexport type StaticIllustrativeIconProps = {\n svg: string;\n} & StaticIllustrativeBaseIconProps;\n\n// Create string from array of attributes\nconst getAttributesString = (attributeCollection: Record<string, unknown>[]) =>\n attributeCollection\n .filter((attr) => Object.keys(attr).length >= 1) // remove empty object\n .map((item) => `${item.name}=\"${item.value}\"`)\n .join(\" \");\n\nconst createSvg = ({ content = \"\", title }: CreateSvg = {}) => {\n const attributeCollection = [\n { name: \"xmlns\", value: \"http://www.w3.org/2000/svg\" },\n { name: \"fill\", value: \"none\" },\n { name: \"viewBox\", value: \"0 0 64 64\" },\n title ? { name: \"role\", value: \"img\" } : { name: \"aria-hidden\", value: \"true\" },\n ];\n\n const titleElement = title ? `<title>${title}</title>` : \"\";\n return `<svg ${getAttributesString(attributeCollection)}>${titleElement}${content}</svg>`;\n};\n\n// Remove svg tags\nconst getSvgContent = (svg: string): string => svg.replace(/<(\\/?)svg([^>]*)>/g, \"\").trim();\n\nexport const StaticIllustrativeIcon = forwardRef<HTMLSpanElement, StaticIllustrativeIconProps>(\n ({ svg, allyTitle, className, ...props }, ref) => {\n const svgString = createSvg({\n content: getSvgContent(svg),\n title: allyTitle,\n });\n\n return (\n <span\n className={cx(rootClassName, className)}\n dangerouslySetInnerHTML={{ __html: svgString }}\n ref={ref}\n {...props}\n />\n );\n }\n);\n\nStaticIllustrativeIcon.displayName = \"StaticIllustrativeIcon\";\n"],"names":["hasOwn","classNames","classes","i","arg","appendClass","parseValue","key","value","newClass","module","cx","c","styles","rootClassName","getAttributesString","attributeCollection","attr","item","createSvg","content","title","titleElement","getSvgContent","svg","StaticIllustrativeIcon","forwardRef","allyTitle","className","props","ref","svgString","jsx"],"mappings":";;;;iDAOC,UAAY,CAGZ,IAAIA,EAAS,CAAA,EAAG,eAEhB,SAASC,GAAc,CAGtB,QAFIC,EAAU,GAELC,EAAI,EAAGA,EAAI,UAAU,OAAQA,IAAK,CAC1C,IAAIC,EAAM,UAAUD,CAAC,EACjBC,IACHF,EAAUG,EAAYH,EAASI,EAAW,KAAK,KAAMF,CAAG,CAAC,EAE7D,CAEE,OAAOF,CACT,CAEC,SAASI,EAAYF,EAAK,CACzB,GAAI,OAAOA,GAAQ,UAAY,OAAOA,GAAQ,SAC7C,OAAO,MAAQ,KAAKA,CAAG,GAAKA,EAG7B,GAAI,OAAOA,GAAQ,SAClB,MAAO,GAGR,GA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AAyBC,EAAA,WACpC,CAAC,CAAE,IAAAF,EAAK,UAAAG,EAAW,UAAAC,EAAW,GAAGC,GAASC,IAAQ,CAChD,MAAMC,EAAYZ,EAAU,CAC1B,QAASI,EAAcC,CAAG,EAC1B,MAAOG,CAAA,CACR,EAGC,OAAAK,EAAA,IAAC,OAAA,CACC,UAAWrB,EAAGG,EAAec,CAAS,EACtC,wBAAyB,CAAE,OAAQG,CAAU,EAC7C,IAAAD,EACC,GAAGD,CAAA,CACN,CAAA,CAGN,EAEAJ,EAAuB,YAAc","x_google_ignoreList":[0]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static-illustrative-icon-z57e5Jl2.mjs","sources":["../../../common/temp/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/bind.js","../src/static-illustrative-icon.tsx"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue.call(this, arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn this && this[arg] || arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(this, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, this && this[key] || key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import React, {
|
|
1
|
+
{"version":3,"file":"static-illustrative-icon-z57e5Jl2.mjs","sources":["../../../common/temp/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/bind.js","../src/static-illustrative-icon.tsx"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue.call(this, arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn this && this[arg] || arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(this, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, this && this[key] || key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import React, { forwardRef } from \"react\";\nimport type { BaseProps } from \"@purpurds/common-types\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./illustrative-icon.module.scss\";\n\nconst cx = c.bind(styles);\nconst rootClassName = \"purpur-illustrative-icon\";\n\ntype CreateSvg = {\n content?: string;\n title?: string;\n ariaHidden?: boolean;\n};\n\nexport type StaticIllustrativeBaseIconProps = Omit<BaseProps<\"span\">, \"children\"> & {\n allyTitle?: string;\n};\n\nexport type StaticIllustrativeIconProps = {\n svg: string;\n} & StaticIllustrativeBaseIconProps;\n\n// Create string from array of attributes\nconst getAttributesString = (attributeCollection: Record<string, unknown>[]) =>\n attributeCollection\n .filter((attr) => Object.keys(attr).length >= 1) // remove empty object\n .map((item) => `${item.name}=\"${item.value}\"`)\n .join(\" \");\n\nconst createSvg = ({ content = \"\", title }: CreateSvg = {}) => {\n const attributeCollection = [\n { name: \"xmlns\", value: \"http://www.w3.org/2000/svg\" },\n { name: \"fill\", value: \"none\" },\n { name: \"viewBox\", value: \"0 0 64 64\" },\n title ? { name: \"role\", value: \"img\" } : { name: \"aria-hidden\", value: \"true\" },\n ];\n\n const titleElement = title ? `<title>${title}</title>` : \"\";\n return `<svg ${getAttributesString(attributeCollection)}>${titleElement}${content}</svg>`;\n};\n\n// Remove svg tags\nconst getSvgContent = (svg: string): string => svg.replace(/<(\\/?)svg([^>]*)>/g, \"\").trim();\n\nexport const StaticIllustrativeIcon = forwardRef<HTMLSpanElement, StaticIllustrativeIconProps>(\n ({ svg, allyTitle, className, ...props }, ref) => {\n const svgString = createSvg({\n content: getSvgContent(svg),\n title: allyTitle,\n });\n\n return (\n <span\n className={cx(rootClassName, className)}\n dangerouslySetInnerHTML={{ __html: svgString }}\n ref={ref}\n {...props}\n />\n );\n }\n);\n\nStaticIllustrativeIcon.displayName = \"StaticIllustrativeIcon\";\n"],"names":["hasOwn","classNames","classes","i","arg","appendClass","parseValue","key","value","newClass","module","cx","c","styles","rootClassName","getAttributesString","attributeCollection","attr","item","createSvg","content","title","titleElement","getSvgContent","svg","StaticIllustrativeIcon","forwardRef","allyTitle","className","props","ref","svgString","jsx"],"mappings":";;;;;;;;;;;;AAOA,KAAC,WAAY;AAGZ,UAAIA,IAAS,CAAA,EAAG;AAEhB,eAASC,IAAc;AAGtB,iBAFIC,IAAU,IAELC,IAAI,GAAGA,IAAI,UAAU,QAAQA,KAAK;AAC1C,cAAIC,IAAM,UAAUD,CAAC;AACrB,UAAIC,MACHF,IAAUG,EAAYH,GAASI,EAAW,KAAK,MAAMF,CAAG,CAAC;AAAA,QAE7D;AAEE,eAAOF;AAAA,MACT;AAEC,eAASI,EAAYF,GAAK;AACzB,YAAI,OAAOA,KAAQ,YAAY,OAAOA,KAAQ;AAC7C,iBAAO,QAAQ,KAAKA,CAAG,KAAKA;AAG7B,YAAI,OAAOA,KAAQ;AAClB,iBAAO;AAGR,YAAI,MAAM,QAAQA,CAAG;AACpB,iBAAOH,EAAW,MAAM,MAAMG,CAAG;AAGlC,YAAIA,EAAI,aAAa,OAAO,UAAU,YAAY,CAACA,EAAI,SAAS,SAAQ,EAAG,SAAS,eAAe;AAClG,iBAAOA,EAAI,SAAU;AAG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AAChD,UAAMC,IAAYZ,EAAU;AAAA,MAC1B,SAASI,EAAcC,CAAG;AAAA,MAC1B,OAAOG;AAAA,IAAA,CACR;AAGC,WAAA,gBAAAK;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWrB,EAAGG,GAAec,CAAS;AAAA,QACtC,yBAAyB,EAAE,QAAQG,EAAU;AAAA,QAC7C,KAAAD;AAAA,QACC,GAAGD;AAAA,MAAA;AAAA,IACN;AAAA,EAAA;AAGN;AAEAJ,EAAuB,cAAc;","x_google_ignoreList":[0]}
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import { default as React
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseProps } from '@purpurds/common-types';
|
|
2
3
|
|
|
3
|
-
export type StaticIllustrativeBaseIconProps =
|
|
4
|
-
["data-testid"]?: string;
|
|
4
|
+
export type StaticIllustrativeBaseIconProps = Omit<BaseProps<"span">, "children"> & {
|
|
5
5
|
allyTitle?: string;
|
|
6
6
|
};
|
|
7
7
|
export type StaticIllustrativeIconProps = {
|
|
8
8
|
svg: string;
|
|
9
9
|
} & StaticIllustrativeBaseIconProps;
|
|
10
|
-
export declare const StaticIllustrativeIcon: React.ForwardRefExoticComponent<
|
|
11
|
-
svg: string;
|
|
12
|
-
} & React.HTMLAttributes<HTMLSpanElement> & {
|
|
13
|
-
"data-testid"?: string;
|
|
14
|
-
allyTitle?: string;
|
|
15
|
-
} & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export declare const StaticIllustrativeIcon: React.ForwardRefExoticComponent<Omit<StaticIllustrativeIconProps, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
16
11
|
//# sourceMappingURL=static-illustrative-icon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static-illustrative-icon.d.ts","sourceRoot":"","sources":["../src/static-illustrative-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"static-illustrative-icon.d.ts","sourceRoot":"","sources":["../src/static-illustrative-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAcxD,MAAM,MAAM,+BAA+B,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,GAAG;IAClF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,GAAG,EAAE,MAAM,CAAC;CACb,GAAG,+BAA+B,CAAC;AAwBpC,eAAO,MAAM,sBAAsB,kHAgBlC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@purpurds/illustrative-icon",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.7.0",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"main": "./dist/illustrative-icon.cjs.js",
|
|
6
6
|
"types": "./dist/illustrative-icon.d.ts",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"classnames": "~2.5.0",
|
|
19
19
|
"lottie-web": "^5.13.0",
|
|
20
|
-
"@purpurds/tokens": "7.
|
|
20
|
+
"@purpurds/tokens": "7.7.0",
|
|
21
|
+
"@purpurds/common-types": "7.7.0"
|
|
21
22
|
},
|
|
22
23
|
"devDependencies": {
|
|
23
24
|
"eslint": "9.24.0",
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
|
|
3
|
-
forwardRef,
|
|
4
|
-
type HTMLAttributes,
|
|
5
|
-
useEffect,
|
|
6
|
-
useRef,
|
|
7
|
-
useState,
|
|
8
|
-
} from "react";
|
|
1
|
+
import React, { forwardRef, useEffect, useRef, useState } from "react";
|
|
2
|
+
import type { BaseProps } from "@purpurds/common-types";
|
|
9
3
|
import lottie, { type AnimationItem } from "lottie-web/build/player/lottie_light";
|
|
10
4
|
|
|
11
|
-
export type AnimatedIllustrativeBaseIconProps =
|
|
12
|
-
["data-testid"]?: string;
|
|
5
|
+
export type AnimatedIllustrativeBaseIconProps = Omit<BaseProps, "children"> & {
|
|
13
6
|
/**
|
|
14
7
|
* Only available for animated icons.
|
|
15
8
|
*/
|
|
@@ -29,11 +22,8 @@ export type AnimatedIllustrativeIconProps = {
|
|
|
29
22
|
json: object;
|
|
30
23
|
} & AnimatedIllustrativeBaseIconProps;
|
|
31
24
|
|
|
32
|
-
export const AnimatedIllustrativeIcon = forwardRef(
|
|
33
|
-
(
|
|
34
|
-
{ json, autoplay = true, delay = 0, onAnimationEnd, ...props }: AnimatedIllustrativeIconProps,
|
|
35
|
-
ref: ForwardedRef<HTMLDivElement>
|
|
36
|
-
) => {
|
|
25
|
+
export const AnimatedIllustrativeIcon = forwardRef<HTMLDivElement, AnimatedIllustrativeIconProps>(
|
|
26
|
+
({ json, autoplay = true, delay = 0, onAnimationEnd, ...props }, ref) => {
|
|
37
27
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
38
28
|
const animationRef = useRef<AnimationItem | null>(null);
|
|
39
29
|
const [reduceMotion, setReduceMotion] = useState(false);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import type { BaseProps } from "@purpurds/common-types";
|
|
2
3
|
import c from "classnames/bind";
|
|
3
4
|
|
|
4
5
|
import styles from "./illustrative-icon.module.scss";
|
|
@@ -12,8 +13,7 @@ type CreateSvg = {
|
|
|
12
13
|
ariaHidden?: boolean;
|
|
13
14
|
};
|
|
14
15
|
|
|
15
|
-
export type StaticIllustrativeBaseIconProps =
|
|
16
|
-
["data-testid"]?: string;
|
|
16
|
+
export type StaticIllustrativeBaseIconProps = Omit<BaseProps<"span">, "children"> & {
|
|
17
17
|
allyTitle?: string;
|
|
18
18
|
};
|
|
19
19
|
|
|
@@ -43,11 +43,8 @@ const createSvg = ({ content = "", title }: CreateSvg = {}) => {
|
|
|
43
43
|
// Remove svg tags
|
|
44
44
|
const getSvgContent = (svg: string): string => svg.replace(/<(\/?)svg([^>]*)>/g, "").trim();
|
|
45
45
|
|
|
46
|
-
export const StaticIllustrativeIcon = forwardRef(
|
|
47
|
-
(
|
|
48
|
-
{ svg, allyTitle, className, ...props }: StaticIllustrativeIconProps,
|
|
49
|
-
ref: ForwardedRef<HTMLDivElement>
|
|
50
|
-
) => {
|
|
46
|
+
export const StaticIllustrativeIcon = forwardRef<HTMLSpanElement, StaticIllustrativeIconProps>(
|
|
47
|
+
({ svg, allyTitle, className, ...props }, ref) => {
|
|
51
48
|
const svgString = createSvg({
|
|
52
49
|
content: getSvgContent(svg),
|
|
53
50
|
title: allyTitle,
|