@atls-ui-generators/icons 1.1.3 → 1.1.6
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/CHANGELOG.md +26 -0
- package/dist/icons.interfaces.d.ts +0 -2
- package/dist/replacement-utils/create-replacements/tests/create-replacements.test.constants.js +7 -7
- package/dist/replacement-utils/get-color-replacement/get-color-replacement.interfaces.d.ts +0 -1
- package/dist/replacement-utils/get-color-replacement/get-color-replacement.util.cjs +1 -1
- package/dist/replacement-utils/get-color-replacement/get-color-replacement.util.js +1 -1
- package/dist/svgr-utils/compile-icons.util.js +4 -6
- package/package.json +18 -18
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
## [1.1.6](https://github.com/atls/hyperion/compare/@atls-ui-generators/icons@1.1.5...@atls-ui-generators/icons@1.1.6) (2025-06-24)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
* **icons:** add added color extraction from theme via icon sprinkles ([2f37178](https://github.com/atls/hyperion/commit/2f37178dabc502d922db0172a75ae2c5da6e2a5c))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## [1.1.5](https://github.com/atls/hyperion/compare/@atls-ui-generators/icons@1.1.3...@atls-ui-generators/icons@1.1.5) (2025-04-29)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [1.1.3](https://github.com/atls/hyperion/compare/@atls-ui-generators/icons@1.1.3...@atls-ui-generators/icons@1.1.3) (2025-04-28)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
3
29
|
## [1.1.3](https://github.com/atls/hyperion/compare/@atls-ui-generators/icons@1.1.2...@atls-ui-generators/icons@1.1.3) (2025-04-10)
|
|
4
30
|
|
|
5
31
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Config } from '@svgr/core';
|
|
2
1
|
export interface Icon {
|
|
3
2
|
name: string;
|
|
4
3
|
source: string;
|
|
@@ -10,4 +9,3 @@ export interface Source {
|
|
|
10
9
|
withReplacement: boolean;
|
|
11
10
|
}
|
|
12
11
|
export type Replacements = Record<string, Record<string, string>>;
|
|
13
|
-
export type CreateSvgrTemplate = (withReplacement: boolean) => Config['template'];
|
package/dist/replacement-utils/create-replacements/tests/create-replacements.test.constants.js
CHANGED
|
@@ -10,10 +10,10 @@ export const testCases = [
|
|
|
10
10
|
},
|
|
11
11
|
expectedResult: {
|
|
12
12
|
CircleIcon: {
|
|
13
|
-
'#18181B': '
|
|
13
|
+
'#18181B': 'currentColor',
|
|
14
14
|
},
|
|
15
15
|
LeftIcon: {
|
|
16
|
-
'#18181B': '
|
|
16
|
+
'#18181B': 'currentColor',
|
|
17
17
|
},
|
|
18
18
|
},
|
|
19
19
|
},
|
|
@@ -24,13 +24,13 @@ export const testCases = [
|
|
|
24
24
|
},
|
|
25
25
|
expectedResult: {
|
|
26
26
|
CircleIcon: {
|
|
27
|
-
'#18181B': '
|
|
28
|
-
'#000000': '
|
|
27
|
+
'#18181B': 'currentColor',
|
|
28
|
+
'#000000': 'currentColor',
|
|
29
29
|
},
|
|
30
30
|
LeftIcon: {
|
|
31
|
-
'#18181B': '
|
|
32
|
-
'#000000': '
|
|
33
|
-
'#0000FF': '
|
|
31
|
+
'#18181B': 'currentColor',
|
|
32
|
+
'#000000': 'currentColor',
|
|
33
|
+
'#0000FF': 'currentColor',
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
36
|
},
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getColorReplacement = void 0;
|
|
4
4
|
const getColorReplacement = (options) => ({
|
|
5
|
-
[options.color]: `
|
|
5
|
+
[options.color]: `currentColor`,
|
|
6
6
|
});
|
|
7
7
|
exports.getColorReplacement = getColorReplacement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { transform } from '@svgr/core';
|
|
2
|
-
const
|
|
2
|
+
const svgrTemplate = ({ jsx, componentName }, { tpl }) => tpl `
|
|
3
3
|
import type { IconProps } from '../icons.interfaces.js'
|
|
4
4
|
|
|
5
5
|
import type { ReactNode } from 'react'
|
|
@@ -7,11 +7,9 @@ const createSvgrTemplate = (withReplacement) => ({ jsx, componentName }, { tpl }
|
|
|
7
7
|
import React from 'react'
|
|
8
8
|
import { clsx } from 'clsx'
|
|
9
9
|
|
|
10
|
-
${withReplacement ? `import { vars } from '@ui/theme'` : ''}
|
|
11
|
-
|
|
12
10
|
import { iconSprinkles } from '../icon.css.js'
|
|
13
11
|
|
|
14
|
-
export const ${componentName} = (
|
|
12
|
+
export const ${componentName} = (props: IconProps): ReactNode => {
|
|
15
13
|
const { className, style, otherProps } = iconSprinkles(props)
|
|
16
14
|
|
|
17
15
|
const iconStyle = { ...style, ...otherProps.style }
|
|
@@ -26,10 +24,10 @@ export const compileIcons = async (icons, replacements) => Promise.all(icons.map
|
|
|
26
24
|
code: await transform(icon.source.replace(/mask0/g, icon.name), {
|
|
27
25
|
icon: true,
|
|
28
26
|
typescript: true,
|
|
29
|
-
template:
|
|
27
|
+
template: svgrTemplate,
|
|
30
28
|
plugins: ['@svgr/plugin-svgo', '@svgr/plugin-jsx', '@svgr/plugin-prettier'],
|
|
31
29
|
svgProps: {
|
|
32
|
-
className: `{clsx(className,
|
|
30
|
+
className: `{clsx(className, String(otherProps.className || ''))}`,
|
|
33
31
|
style: '{iconStyle}',
|
|
34
32
|
},
|
|
35
33
|
replaceAttrValues: { ...replacements[icon.name] },
|
package/package.json
CHANGED
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atls-ui-generators/icons",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
"./package.json": "./package.json",
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./replacement": {
|
|
14
|
+
"import": "./dist/replacement-utils/index.js",
|
|
15
|
+
"require": "./dist/replacement-utils/index.cjs",
|
|
16
|
+
"types": "./dist/replacement-utils/index.d.ts",
|
|
17
|
+
"default": "./dist/replacement-utils/index.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
6
20
|
"main": "dist/index.js",
|
|
7
21
|
"bin": {
|
|
8
22
|
"generate-icons": "dist/icons.generator.js"
|
|
@@ -17,15 +31,15 @@
|
|
|
17
31
|
"postpack": "rm -rf dist"
|
|
18
32
|
},
|
|
19
33
|
"dependencies": {
|
|
20
|
-
"@atls-ui-generators/utils": "1.0.
|
|
34
|
+
"@atls-ui-generators/utils": "1.0.5",
|
|
21
35
|
"@svgr/core": "8.1.0",
|
|
22
36
|
"@swc-node/register": "1.9.0",
|
|
23
37
|
"@swc/core": "1.6.1",
|
|
24
38
|
"commander": "13.1.0",
|
|
25
|
-
"glob": "11.0.
|
|
39
|
+
"glob": "11.0.2"
|
|
26
40
|
},
|
|
27
41
|
"devDependencies": {
|
|
28
|
-
"@types/node": "22.
|
|
42
|
+
"@types/node": "22.15.3",
|
|
29
43
|
"tsx": "4.19.3",
|
|
30
44
|
"typescript": "5.5.4"
|
|
31
45
|
},
|
|
@@ -49,19 +63,5 @@
|
|
|
49
63
|
"typings": "dist/index.d.ts"
|
|
50
64
|
},
|
|
51
65
|
"typecheckSkipLibCheck": true,
|
|
52
|
-
"exports": {
|
|
53
|
-
"./package.json": "./package.json",
|
|
54
|
-
".": {
|
|
55
|
-
"import": "./dist/index.js",
|
|
56
|
-
"types": "./dist/index.d.ts",
|
|
57
|
-
"default": "./dist/index.js"
|
|
58
|
-
},
|
|
59
|
-
"./replacement": {
|
|
60
|
-
"import": "./dist/replacement-utils/index.js",
|
|
61
|
-
"require": "./dist/replacement-utils/index.cjs",
|
|
62
|
-
"types": "./dist/replacement-utils/index.d.ts",
|
|
63
|
-
"default": "./dist/replacement-utils/index.js"
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
66
|
"typings": "dist/index.d.ts"
|
|
67
67
|
}
|