@frontify/fondue-icons 0.2.1 → 0.2.2
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/fondue-icons2.js +1 -1
- package/dist/fondue-icons2.js.map +1 -1
- package/package.json +31 -28
package/dist/fondue-icons2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fondue-icons2.js","sources":["../src/createFondueIcon.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n createElement,\n forwardRef,\n type ForwardRefExoticComponent,\n type ReactSVG,\n type RefAttributes,\n type SVGProps,\n} from 'react';\n\nimport { defaultAttributes } from './constants';\nimport { htmlKeysToJsxKeys } from './utilities/jsxKeyFormat';\nimport { kebabCase } from './utilities/stringCasing';\n\nexport type IconNode = [elementName: keyof ReactSVG, attrs: Record<string, string>, children?: IconNode][];\n\nexport type SVGAttributes = Partial<SVGProps<SVGSVGElement>>;\ntype ComponentAttributes = RefAttributes<SVGSVGElement> & SVGAttributes;\n\ntype IconSizeAsNumber = 12 | 16 | 20 | 24 | 32;\n\n/**\n * @deprecated Use a string or number instead\n */\nexport enum IconSize {\n Size12 = 'Size12',\n Size16 = 'Size16',\n Size20 = 'Size20',\n Size24 = 'Size24',\n Size32 = 'Size32',\n}\n\nexport type FondueIconProps = ComponentAttributes & {\n size?: `${IconSizeAsNumber}` | IconSizeAsNumber | IconSize;\n};\n\nexport type FondueIcon = ForwardRefExoticComponent<FondueIconProps>;\n\nconst iconSizeToNumber: Record<Exclude<FondueIconProps['size'], undefined>, IconSizeAsNumber> = {\n [IconSize.Size12]: 12,\n [IconSize.Size16]: 16,\n [IconSize.Size20]: 20,\n [IconSize.Size24]: 24,\n [IconSize.Size32]: 32,\n 12: 12,\n 16: 16,\n 20: 20,\n 24: 24,\n 32: 32,\n};\n\nconst renderIconNode = (iconNode: IconNode, iconName: string): ReturnType<typeof createElement>[] => {\n return iconNode.map(([tagName, attributes, children]) =>\n createElement(\n tagName,\n {\n key: `${iconName}-${tagName}`,\n ...(attributes ? htmlKeysToJsxKeys(attributes) : {}),\n },\n Array.isArray(children) && children.length > 0\n ? children.map((item) => renderIconNode([item], `${iconName}-${tagName}`))\n : [],\n ),\n );\n};\n\nexport const createFondueIcon = (iconName: string, iconNode: IconNode): FondueIcon => {\n const Component = forwardRef<SVGSVGElement, FondueIconProps>(\n ({ color = 'currentColor', size = 24, className = '', children, ...rest }, ref) => {\n return createElement(\n 'svg',\n {\n ref,\n ...defaultAttributes,\n color,\n width: iconSizeToNumber[size],\n height: iconSizeToNumber[size],\n className: ['fondue', `fondue-${kebabCase(iconName)}`, className].filter(Boolean).join(' '),\n 'data-test-id': `fondue-icons-${kebabCase(iconName)}`,\n key: `fondue-icons-${kebabCase(iconName)}`,\n ...rest,\n },\n [\n ...renderIconNode(iconNode, kebabCase(iconName)),\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n ...(Array.isArray(children) ? children : [children]),\n ],\n );\n },\n );\n\n Component.displayName = iconName
|
|
1
|
+
{"version":3,"file":"fondue-icons2.js","sources":["../src/createFondueIcon.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n createElement,\n forwardRef,\n type ForwardRefExoticComponent,\n type ReactSVG,\n type RefAttributes,\n type SVGProps,\n} from 'react';\n\nimport { defaultAttributes } from './constants';\nimport { htmlKeysToJsxKeys } from './utilities/jsxKeyFormat';\nimport { kebabCase } from './utilities/stringCasing';\n\nexport type IconNode = [elementName: keyof ReactSVG, attrs: Record<string, string>, children?: IconNode][];\n\nexport type SVGAttributes = Partial<SVGProps<SVGSVGElement>>;\ntype ComponentAttributes = RefAttributes<SVGSVGElement> & SVGAttributes;\n\ntype IconSizeAsNumber = 12 | 16 | 20 | 24 | 32;\n\n/**\n * @deprecated Use a string or number instead\n */\nexport enum IconSize {\n Size12 = 'Size12',\n Size16 = 'Size16',\n Size20 = 'Size20',\n Size24 = 'Size24',\n Size32 = 'Size32',\n}\n\nexport type FondueIconProps = ComponentAttributes & {\n size?: `${IconSizeAsNumber}` | IconSizeAsNumber | IconSize;\n};\n\nexport type FondueIcon = ForwardRefExoticComponent<FondueIconProps>;\n\nconst iconSizeToNumber: Record<Exclude<FondueIconProps['size'], undefined>, IconSizeAsNumber> = {\n [IconSize.Size12]: 12,\n [IconSize.Size16]: 16,\n [IconSize.Size20]: 20,\n [IconSize.Size24]: 24,\n [IconSize.Size32]: 32,\n 12: 12,\n 16: 16,\n 20: 20,\n 24: 24,\n 32: 32,\n};\n\nconst renderIconNode = (iconNode: IconNode, iconName: string): ReturnType<typeof createElement>[] => {\n return iconNode.map(([tagName, attributes, children]) =>\n createElement(\n tagName,\n {\n key: `${iconName}-${tagName}`,\n ...(attributes ? htmlKeysToJsxKeys(attributes) : {}),\n },\n Array.isArray(children) && children.length > 0\n ? children.map((item) => renderIconNode([item], `${iconName}-${tagName}`))\n : [],\n ),\n );\n};\n\nexport const createFondueIcon = (iconName: string, iconNode: IconNode): FondueIcon => {\n const Component = forwardRef<SVGSVGElement, FondueIconProps>(\n ({ color = 'currentColor', size = 24, className = '', children, ...rest }, ref) => {\n return createElement(\n 'svg',\n {\n ref,\n ...defaultAttributes,\n color,\n width: iconSizeToNumber[size],\n height: iconSizeToNumber[size],\n className: ['fondue', `fondue-${kebabCase(iconName)}`, className].filter(Boolean).join(' '),\n 'data-test-id': `fondue-icons-${kebabCase(iconName)}`,\n key: `fondue-icons-${kebabCase(iconName)}`,\n ...rest,\n },\n [\n ...renderIconNode(iconNode, kebabCase(iconName)),\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n ...(Array.isArray(children) ? children : [children]),\n ],\n );\n },\n );\n\n Component.displayName = `Icon${iconName}`;\n\n return Component;\n};\n"],"names":["IconSize","iconSizeToNumber","renderIconNode","iconNode","iconName","tagName","attributes","children","createElement","htmlKeysToJsxKeys","item","createFondueIcon","Component","forwardRef","color","size","className","rest","ref","defaultAttributes","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AAgB,gBAAgBI,EAAUhB,CAAQ,CAAC;AAAA,QACnD,KAAK,gBAAgBgB,EAAUhB,CAAQ,CAAC;AAAA,QACxC,GAAGa;AAAA,MACP;AAAA,MACA;AAAA,QACI,GAAGf,EAAeC,GAAUiB,EAAUhB,CAAQ,CAAC;AAAA;AAAA,QAE/C,GAAI,MAAM,QAAQG,CAAQ,IAAIA,IAAW,CAACA,CAAQ;AAAA,MACtD;AAAA,IAAA;AAAA,EAER;AAGM,SAAAK,EAAA,cAAc,OAAOR,CAAQ,IAEhCQ;AACX;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontify/fondue-icons",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.2",
|
|
5
5
|
"description": "Frontify's icon SVGs",
|
|
6
6
|
"homepage": "https://github.com/Frontify/fondue",
|
|
7
7
|
"repository": {
|
|
@@ -38,43 +38,46 @@
|
|
|
38
38
|
"react": "^18"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@
|
|
41
|
+
"@babel/core": "^7.24.7",
|
|
42
|
+
"@etchteam/storybook-addon-status": "^5.0.0",
|
|
42
43
|
"@frontify/eslint-config-react": "^0.17.6",
|
|
43
44
|
"@iconify/tools": "^4.0.4",
|
|
44
|
-
"@storybook/addon-a11y": "^8.
|
|
45
|
-
"@storybook/addon-essentials": "^8.
|
|
46
|
-
"@storybook/addon-interactions": "^8.
|
|
47
|
-
"@storybook/addon-links": "^8.
|
|
48
|
-
"@storybook/blocks": "^8.
|
|
49
|
-
"@storybook/manager-api": "^8.
|
|
50
|
-
"@storybook/preview-api": "^8.
|
|
51
|
-
"@storybook/react": "^8.
|
|
52
|
-
"@storybook/react-vite": "^8.
|
|
53
|
-
"@storybook/theming": "^8.
|
|
54
|
-
"@types/lodash-es": "^4.17.
|
|
55
|
-
"@types/node": "^20.
|
|
56
|
-
"@types/react": "^18.
|
|
57
|
-
"@vitejs/plugin-react": "^4.
|
|
45
|
+
"@storybook/addon-a11y": "^8.1.10",
|
|
46
|
+
"@storybook/addon-essentials": "^8.1.10",
|
|
47
|
+
"@storybook/addon-interactions": "^8.1.10",
|
|
48
|
+
"@storybook/addon-links": "^8.1.10",
|
|
49
|
+
"@storybook/blocks": "^8.1.10",
|
|
50
|
+
"@storybook/manager-api": "^8.1.10",
|
|
51
|
+
"@storybook/preview-api": "^8.1.10",
|
|
52
|
+
"@storybook/react": "^8.1.10",
|
|
53
|
+
"@storybook/react-vite": "^8.1.10",
|
|
54
|
+
"@storybook/theming": "^8.1.10",
|
|
55
|
+
"@types/lodash-es": "^4.17.12",
|
|
56
|
+
"@types/node": "^20.14.7",
|
|
57
|
+
"@types/react": "^18.3.3",
|
|
58
|
+
"@vitejs/plugin-react": "^4.3.1",
|
|
58
59
|
"autoprefixer": "^10.4.19",
|
|
59
|
-
"dotenv-cli": "^7.4.
|
|
60
|
+
"dotenv-cli": "^7.4.2",
|
|
60
61
|
"eslint": "^8.57.0",
|
|
62
|
+
"eslint-plugin-notice": "^1.0.0",
|
|
63
|
+
"eslint-plugin-storybook": "^0.8.0",
|
|
61
64
|
"figma-api": "^1.11.0",
|
|
62
|
-
"fuzzysort": "^
|
|
65
|
+
"fuzzysort": "^3.0.2",
|
|
63
66
|
"lodash-es": "^4.17.21",
|
|
64
67
|
"postcss": "^8.4.38",
|
|
65
|
-
"prettier": "^3.2
|
|
66
|
-
"react": "^18.
|
|
67
|
-
"storybook": "^8.
|
|
68
|
-
"storybook-dark-mode": "^4.0.
|
|
68
|
+
"prettier": "^3.3.2",
|
|
69
|
+
"react": "^18.3.1",
|
|
70
|
+
"storybook": "^8.1.10",
|
|
71
|
+
"storybook-dark-mode": "^4.0.2",
|
|
69
72
|
"svgson": "^5.3.1",
|
|
70
|
-
"tailwindcss": "^3.4.
|
|
71
|
-
"tsx": "^4.7
|
|
72
|
-
"typescript": "^5.
|
|
73
|
-
"vite": "^5.
|
|
74
|
-
"vite-plugin-dts": "^3.
|
|
73
|
+
"tailwindcss": "^3.4.4",
|
|
74
|
+
"tsx": "^4.15.7",
|
|
75
|
+
"typescript": "^5.5.2",
|
|
76
|
+
"vite": "^5.3.1",
|
|
77
|
+
"vite-plugin-dts": "^3.9.1",
|
|
75
78
|
"vite-plugin-external": "^4.3.1",
|
|
76
79
|
"vite-tsconfig-paths": "^4.3.2",
|
|
77
|
-
"@frontify/fondue-tokens": "^3.5.
|
|
80
|
+
"@frontify/fondue-tokens": "^3.5.2"
|
|
78
81
|
},
|
|
79
82
|
"scripts": {
|
|
80
83
|
"build": "pnpm build:download-new-icons && pnpm build:generate-react-icons && vite build",
|