@atls-ui-generators/icons 1.2.1 → 1.2.3

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.
Files changed (82) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/dist/commands/base-icons.command.d.ts +1 -1
  3. package/dist/commands/base-icons.command.js +1 -0
  4. package/dist/commands/generate-icons.command.js +2 -1
  5. package/dist/commands/generate-replacements.command.js +1 -0
  6. package/dist/replacement-utils/build-replacements/build-replacements.d.ts +3 -0
  7. package/dist/replacement-utils/build-replacements/index.d.ts +1 -1
  8. package/dist/replacement-utils/build-replacements/index.js +1 -1
  9. package/dist/replacement-utils/create-replacement-icon-colors/create-replacement-icon-colors.d.ts +3 -0
  10. package/dist/replacement-utils/create-replacement-icon-colors/{create-replacement-icon-colors.util.js → create-replacement-icon-colors.js} +1 -1
  11. package/dist/replacement-utils/create-replacement-icon-colors/index.d.ts +1 -1
  12. package/dist/replacement-utils/create-replacement-icon-colors/index.js +1 -1
  13. package/dist/replacement-utils/create-replacements/create-replacements.d.ts +3 -0
  14. package/dist/replacement-utils/create-replacements/index.cjs +1 -1
  15. package/dist/replacement-utils/create-replacements/index.d.cts +1 -1
  16. package/dist/replacement-utils/create-replacements/index.d.ts +1 -1
  17. package/dist/replacement-utils/create-replacements/index.js +1 -1
  18. package/dist/replacement-utils/create-replacements/tests/create-replacements.test.interfaces.d.ts +1 -1
  19. package/dist/replacement-utils/get-color-replacement/get-color-replacement.d.ts +2 -0
  20. package/dist/replacement-utils/get-color-replacement/index.cjs +1 -1
  21. package/dist/replacement-utils/get-color-replacement/index.d.cts +1 -1
  22. package/dist/replacement-utils/get-color-replacement/index.d.ts +1 -1
  23. package/dist/replacement-utils/get-color-replacement/index.js +1 -1
  24. package/dist/replacement-utils/write-replacements-file/index.d.ts +1 -1
  25. package/dist/replacement-utils/write-replacements-file/index.js +1 -1
  26. package/dist/replacement-utils/write-replacements-file/{write-replacements-file.util.d.ts → write-replacements-file.d.ts} +1 -1
  27. package/dist/svgr-utils/{build-svgr.util.d.ts → build-svgr.d.ts} +1 -1
  28. package/dist/svgr-utils/{build-svgr.util.js → build-svgr.js} +2 -2
  29. package/dist/svgr-utils/compile-icons/{compile-icons.constants.js → constants.js} +8 -2
  30. package/dist/svgr-utils/compile-icons/{compile-icon-jsx.util.d.ts → icon-jsx.d.ts} +1 -1
  31. package/dist/svgr-utils/compile-icons/{compile-icon-jsx.util.js → icon-jsx.js} +2 -2
  32. package/dist/svgr-utils/compile-icons/icons.d.ts +4 -0
  33. package/dist/svgr-utils/compile-icons/{compile-icons.util.js → icons.js} +6 -6
  34. package/dist/svgr-utils/compile-icons/index.d.ts +3 -3
  35. package/dist/svgr-utils/compile-icons/index.js +3 -3
  36. package/dist/svgr-utils/compile-icons/interfaces.d.ts +2 -0
  37. package/dist/svgr-utils/compile-icons/{compile-icons.template.js → template.js} +0 -1
  38. package/dist/svgr-utils/{discover-icons.util.d.ts → discover-icons.d.ts} +1 -1
  39. package/dist/svgr-utils/get-svg-colors/constants.d.ts +1 -0
  40. package/dist/svgr-utils/get-svg-colors/constants.js +1 -0
  41. package/dist/svgr-utils/get-svg-colors/{extract-color-from-element.helper.d.ts → extract-color-from-element.d.ts} +2 -2
  42. package/dist/svgr-utils/get-svg-colors/{extract-color-from-element.helper.js → extract-color-from-element.js} +2 -2
  43. package/dist/svgr-utils/get-svg-colors/{get-svg-colors.util.d.ts → get-svg-colors.d.ts} +1 -1
  44. package/dist/svgr-utils/get-svg-colors/{get-svg-colors.util.js → get-svg-colors.js} +3 -3
  45. package/dist/svgr-utils/get-svg-colors/{validate-color.helper.d.ts → helpers/validate-color.d.ts} +1 -1
  46. package/dist/svgr-utils/get-svg-colors/index.d.ts +2 -2
  47. package/dist/svgr-utils/get-svg-colors/index.js +1 -1
  48. package/dist/svgr-utils/get-svg-colors/interfaces.js +1 -0
  49. package/dist/svgr-utils/index.d.ts +2 -2
  50. package/dist/svgr-utils/index.js +2 -2
  51. package/dist/svgr-utils/{write-compiled-icons.util.d.ts → write-compiled-icons.d.ts} +1 -1
  52. package/dist/svgr-utils/{write-compiled-icons.util.js → write-compiled-icons.js} +1 -1
  53. package/package.json +7 -4
  54. package/dist/replacement-utils/build-replacements/build-replacements.util.d.ts +0 -3
  55. package/dist/replacement-utils/create-replacement-icon-colors/create-replacement-icon-colors.util.d.ts +0 -3
  56. package/dist/replacement-utils/create-replacements/create-replacements.util.d.ts +0 -3
  57. package/dist/replacement-utils/get-color-replacement/get-color-replacement.util.d.ts +0 -2
  58. package/dist/svgr-utils/compile-icons/compile-icons.util.d.ts +0 -4
  59. package/dist/svgr-utils/get-svg-colors/get-svg-colors.constants.d.ts +0 -1
  60. package/dist/svgr-utils/get-svg-colors/get-svg-colors.constants.js +0 -1
  61. /package/dist/{icons.generator.d.ts → generator.d.ts} +0 -0
  62. /package/dist/{icons.generator.js → generator.js} +0 -0
  63. /package/dist/{icons.interfaces.d.ts → interfaces.d.ts} +0 -0
  64. /package/dist/{icons.interfaces.js → interfaces.js} +0 -0
  65. /package/dist/replacement-utils/build-replacements/{build-replacements.util.js → build-replacements.js} +0 -0
  66. /package/dist/replacement-utils/create-replacement-icon-colors/{create-replacement-icon-colors.constants.d.ts → constants.d.ts} +0 -0
  67. /package/dist/replacement-utils/create-replacement-icon-colors/{create-replacement-icon-colors.constants.js → constants.js} +0 -0
  68. /package/dist/replacement-utils/create-replacements/{create-replacements.util.cjs → create-replacements.cjs} +0 -0
  69. /package/dist/replacement-utils/create-replacements/{create-replacements.util.d.cts → create-replacements.d.cts} +0 -0
  70. /package/dist/replacement-utils/create-replacements/{create-replacements.util.js → create-replacements.js} +0 -0
  71. /package/dist/replacement-utils/get-color-replacement/{get-color-replacement.util.cjs → get-color-replacement.cjs} +0 -0
  72. /package/dist/replacement-utils/get-color-replacement/{get-color-replacement.util.d.cts → get-color-replacement.d.cts} +0 -0
  73. /package/dist/replacement-utils/get-color-replacement/{get-color-replacement.util.js → get-color-replacement.js} +0 -0
  74. /package/dist/replacement-utils/get-color-replacement/{get-color-replacement.interfaces.d.ts → interfaces.d.ts} +0 -0
  75. /package/dist/replacement-utils/get-color-replacement/{get-color-replacement.interfaces.js → interfaces.js} +0 -0
  76. /package/dist/replacement-utils/write-replacements-file/{write-replacements-file.util.js → write-replacements-file.js} +0 -0
  77. /package/dist/svgr-utils/compile-icons/{compile-icons.constants.d.ts → constants.d.ts} +0 -0
  78. /package/dist/svgr-utils/{get-svg-colors/get-svg-colors.interfaces.js → compile-icons/interfaces.js} +0 -0
  79. /package/dist/svgr-utils/compile-icons/{compile-icons.template.d.ts → template.d.ts} +0 -0
  80. /package/dist/svgr-utils/{discover-icons.util.js → discover-icons.js} +0 -0
  81. /package/dist/svgr-utils/get-svg-colors/{validate-color.helper.js → helpers/validate-color.js} +0 -0
  82. /package/dist/svgr-utils/get-svg-colors/{get-svg-colors.interfaces.d.ts → interfaces.d.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,51 @@
1
1
 
2
2
 
3
+ ## [1.2.3](https://github.com/atls/hyperion/compare/@atls-ui-generators/icons@1.2.2...@atls-ui-generators/icons@1.2.3) (2026-09-09)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+
9
+ * **atls-ui-generators:** return cheerio generator instead of regex ([5d548f7](https://github.com/atls/hyperion/commit/5d548f71935d6170d805a4ca8e16a99d89b0104a))
10
+ * **atls-ui-generators:** stabilize icon generation ([b3e16c6](https://github.com/atls/hyperion/commit/b3e16c6d3b8c5ae522cd6359201c67066ca03d58))
11
+ * **icons:** declare svgr plugin dependencies ([afb9201](https://github.com/atls/hyperion/commit/afb9201d900e5f55e2db802816f26d986bd5242b))
12
+
13
+
14
+
15
+
16
+
17
+ ## [1.2.2](https://github.com/atls/hyperion/compare/@atls-ui-generators/icons@1.2.2...@atls-ui-generators/icons@1.2.2) (2026-06-12)
18
+
19
+
20
+
21
+
22
+
23
+
24
+ ## [1.2.2](https://github.com/atls/hyperion/compare/@atls-ui-generators/icons@1.2.2...@atls-ui-generators/icons@1.2.2) (2025-10-25)
25
+
26
+
27
+
28
+
29
+
30
+
31
+ ## [1.2.2](https://github.com/atls/hyperion/compare/@atls-ui-generators/icons@1.2.1...@atls-ui-generators/icons@1.2.2) (2025-10-09)
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+ ## [1.2.2] (2025-10-10)
41
+
42
+
43
+ ### BREAKING CHANGES
44
+
45
+
46
+ * Requires React version 18 or higher for proper component functionality
47
+
48
+
3
49
  ## [1.2.1](https://github.com/atls/hyperion/compare/@atls-ui-generators/icons@1.1.8...@atls-ui-generators/icons@1.2.1) (2025-09-23)
4
50
 
5
51
 
@@ -1,4 +1,4 @@
1
- import type { ResolvedIconsPath } from '../icons.interfaces.js';
1
+ import type { ResolvedIconsPath } from '../interfaces.js';
2
2
  import { Command } from 'clipanion';
3
3
  export declare class BaseIconsCommand extends Command {
4
4
  static readonly usage: import("clipanion").Usage;
@@ -27,6 +27,7 @@ export class BaseIconsCommand extends Command {
27
27
  }
28
28
  catch (error) {
29
29
  this.logger.error(error);
30
+ process.exitCode = 1;
30
31
  }
31
32
  }
32
33
  }
@@ -30,7 +30,7 @@ export class GenerateIconsCommand extends BaseIconsCommand {
30
30
  assert.ok(lstatSync(replacementsPath).isFile(), 'Replacements path should point to a file');
31
31
  this.logger.info(`Extract replacements from ${replacementsPath}`);
32
32
  const exports = processFile(replacementsPath);
33
- replacements = Object.values(exports)?.[0];
33
+ replacements = Object.values(exports)[0];
34
34
  }
35
35
  this.logger.info(`Icon generation started into ${outputPath}`);
36
36
  await buildSvgr(iconsPath, outputPath, replacements);
@@ -38,6 +38,7 @@ export class GenerateIconsCommand extends BaseIconsCommand {
38
38
  }
39
39
  catch (error) {
40
40
  this.logger.error(error);
41
+ process.exitCode = 1;
41
42
  }
42
43
  }
43
44
  }
@@ -26,6 +26,7 @@ export class GenerateReplacementsCommand extends BaseIconsCommand {
26
26
  }
27
27
  catch (error) {
28
28
  this.logger.error(error);
29
+ process.exitCode = 1;
29
30
  }
30
31
  }
31
32
  }
@@ -0,0 +1,3 @@
1
+ import type { Icon } from '../../interfaces.js';
2
+ import type { Replacements } from '../../interfaces.js';
3
+ export declare const buildReplacements: (icons: Array<Icon>) => Promise<Replacements>;
@@ -1 +1 @@
1
- export * from './build-replacements.util.js';
1
+ export * from './build-replacements.js';
@@ -1 +1 @@
1
- export * from "./build-replacements.util.js";
1
+ export * from "./build-replacements.js";
@@ -0,0 +1,3 @@
1
+ import type { Icon } from '../../interfaces.js';
2
+ import type { ReplacementIconColors } from '../../interfaces.js';
3
+ export declare const createReplacementIconColors: (icons: Array<Icon>) => Promise<ReplacementIconColors>;
@@ -1,6 +1,6 @@
1
1
  import { compileIconJsx } from '../../svgr-utils/index.js';
2
2
  import { getSvgColors } from '../../svgr-utils/index.js';
3
- import { getSvgColorsOptions } from './create-replacement-icon-colors.constants.js';
3
+ import { getSvgColorsOptions } from './constants.js';
4
4
  export const createReplacementIconColors = async (icons) => {
5
5
  const promises = icons.map(async (icon) => {
6
6
  const source = await compileIconJsx(icon);
@@ -1 +1 @@
1
- export * from './create-replacement-icon-colors.util.js';
1
+ export * from './create-replacement-icon-colors.js';
@@ -1 +1 @@
1
- export * from "./create-replacement-icon-colors.util.js";
1
+ export * from "./create-replacement-icon-colors.js";
@@ -0,0 +1,3 @@
1
+ import type { Replacements } from '../../interfaces.js';
2
+ import type { ReplacementIconColors } from '../../interfaces.js';
3
+ export declare const createReplacements: (replacementIconColors: ReplacementIconColors) => Replacements;
@@ -14,4 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./create-replacements.util.cjs"), exports);
17
+ __exportStar(require("./create-replacements.cjs"), exports);
@@ -1 +1 @@
1
- export * from './create-replacements.util.cjs';
1
+ export * from './create-replacements.cjs';
@@ -1 +1 @@
1
- export * from './create-replacements.util.js';
1
+ export * from './create-replacements.js';
@@ -1 +1 @@
1
- export * from "./create-replacements.util.js";
1
+ export * from "./create-replacements.js";
@@ -1,4 +1,4 @@
1
- import type { Replacements } from '../../../icons.interfaces.js';
1
+ import type { Replacements } from '../../../interfaces.js';
2
2
  export interface TestCase {
3
3
  replacementIcons: Record<string, Array<string> | string>;
4
4
  expectedResult?: Replacements;
@@ -0,0 +1,2 @@
1
+ import type { GetColorReplacement } from './interfaces.js';
2
+ export declare const getColorReplacement: GetColorReplacement;
@@ -14,4 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./get-color-replacement.util.cjs"), exports);
17
+ __exportStar(require("./get-color-replacement.cjs"), exports);
@@ -1 +1 @@
1
- export * from './get-color-replacement.util.cjs';
1
+ export * from './get-color-replacement.cjs';
@@ -1 +1 @@
1
- export * from './get-color-replacement.util.js';
1
+ export * from './get-color-replacement.js';
@@ -1 +1 @@
1
- export * from "./get-color-replacement.util.js";
1
+ export * from "./get-color-replacement.js";
@@ -1 +1 @@
1
- export * from './write-replacements-file.util.js';
1
+ export * from './write-replacements-file.js';
@@ -1 +1 @@
1
- export * from "./write-replacements-file.util.js";
1
+ export * from "./write-replacements-file.js";
@@ -1,2 +1,2 @@
1
- import type { Replacements } from '../../icons.interfaces.js';
1
+ import type { Replacements } from '../../interfaces.js';
2
2
  export declare const writeReplacementsFile: (targetFile: string, replacements: Replacements) => void;
@@ -1,2 +1,2 @@
1
- import type { Replacements } from '../icons.interfaces.js';
1
+ import type { Replacements } from '../interfaces.js';
2
2
  export declare const buildSvgr: (iconsPath: string, targetDir: string, replacements: Replacements) => Promise<void>;
@@ -1,6 +1,6 @@
1
1
  import { compileIcons } from './compile-icons/index.js';
2
- import { discoverIcons } from './discover-icons.util.js';
3
- import { writeCompiledIcons } from './write-compiled-icons.util.js';
2
+ import { discoverIcons } from './discover-icons.js';
3
+ import { writeCompiledIcons } from './write-compiled-icons.js';
4
4
  export const buildSvgr = async (iconsPath, targetDir, replacements) => {
5
5
  const icons = await discoverIcons(iconsPath);
6
6
  const sources = await compileIcons(icons, replacements);
@@ -1,4 +1,10 @@
1
- import { svgrTemplate } from './compile-icons.template.js';
1
+ import { createRequire } from 'node:module';
2
+ import { svgrTemplate } from './template.js';
3
+ const require = createRequire(import.meta.url);
4
+ const svgoPlugin = require('@svgr/plugin-svgo');
5
+ const jsxPlugin = require('@svgr/plugin-jsx');
6
+ const prettierPlugin = require('@svgr/plugin-prettier');
7
+ const svgrTransformPlugins = [svgoPlugin, jsxPlugin, prettierPlugin];
2
8
  export const MASK_ID_PATTERN = /mask0/g;
3
9
  export const PROPS_SPREAD_FROM = '...props';
4
10
  export const PROPS_SPREAD_TO = '...otherProps';
@@ -8,7 +14,7 @@ export const svgrTransformConfig = {
8
14
  icon: true,
9
15
  typescript: true,
10
16
  template: svgrTemplate,
11
- plugins: ['@svgr/plugin-svgo', '@svgr/plugin-jsx', '@svgr/plugin-prettier'],
17
+ plugins: svgrTransformPlugins,
12
18
  svgProps: {
13
19
  className: `{clsx(className, String(otherProps.className || ''))}`,
14
20
  style: '{iconStyle}',
@@ -1,2 +1,2 @@
1
- import type { Icon } from '../../icons.interfaces.js';
1
+ import type { Icon } from '../../interfaces.js';
2
2
  export declare const compileIconJsx: (icon: Icon) => Promise<string>;
@@ -1,6 +1,6 @@
1
1
  import { transform } from '@svgr/core';
2
- import { MASK_ID_PATTERN } from './compile-icons.constants.js';
3
- import { svgrTransformConfig } from './compile-icons.constants.js';
2
+ import { MASK_ID_PATTERN } from './constants.js';
3
+ import { svgrTransformConfig } from './constants.js';
4
4
  export const compileIconJsx = async (icon) => transform(icon.source.replace(MASK_ID_PATTERN, icon.name), {
5
5
  ...svgrTransformConfig,
6
6
  template: ({ jsx }, { tpl }) => tpl `${jsx}`,
@@ -0,0 +1,4 @@
1
+ import type { Icon } from '../../interfaces.js';
2
+ import type { Replacements } from '../../interfaces.js';
3
+ import type { Source } from '../../interfaces.js';
4
+ export declare const compileIcons: (icons: Array<Icon>, replacements: Replacements) => Promise<Array<Source>>;
@@ -1,10 +1,10 @@
1
1
  import { transform } from '@svgr/core';
2
- import { MASK_ID_PATTERN } from './compile-icons.constants.js';
3
- import { PROPS_SPREAD_FROM } from './compile-icons.constants.js';
4
- import { PROPS_SPREAD_TO } from './compile-icons.constants.js';
5
- import { FIFTY_PLUS_PATTERN } from './compile-icons.constants.js';
6
- import { FIFTY_PLUS_REPLACEMENT } from './compile-icons.constants.js';
7
- import { svgrTransformConfig } from './compile-icons.constants.js';
2
+ import { MASK_ID_PATTERN } from './constants.js';
3
+ import { PROPS_SPREAD_FROM } from './constants.js';
4
+ import { PROPS_SPREAD_TO } from './constants.js';
5
+ import { FIFTY_PLUS_PATTERN } from './constants.js';
6
+ import { FIFTY_PLUS_REPLACEMENT } from './constants.js';
7
+ import { svgrTransformConfig } from './constants.js';
8
8
  export const compileIcons = async (icons, replacements) => {
9
9
  const promises = icons.map(async (icon) => {
10
10
  const transformed = await transform(icon.source, {
@@ -1,3 +1,3 @@
1
- export * from './compile-icon-jsx.util.js';
2
- export * from './compile-icons.template.js';
3
- export * from './compile-icons.util.js';
1
+ export * from './icon-jsx.js';
2
+ export * from './icons.js';
3
+ export * from './template.js';
@@ -1,3 +1,3 @@
1
- export * from "./compile-icon-jsx.util.js";
2
- export * from "./compile-icons.template.js";
3
- export * from "./compile-icons.util.js";
1
+ export * from "./icon-jsx.js";
2
+ export * from "./icons.js";
3
+ export * from "./template.js";
@@ -0,0 +1,2 @@
1
+ import type { Config } from '@svgr/core';
2
+ export type SvgrPlugin = NonNullable<Config['plugins']>[number];
@@ -3,7 +3,6 @@ export const svgrTemplate = ({ jsx, componentName }, { tpl }) => tpl `
3
3
 
4
4
  import type { ReactNode } from 'react'
5
5
 
6
- import React from 'react'
7
6
  import { clsx } from 'clsx'
8
7
 
9
8
  import { iconSprinkles } from '../icon.css.js'
@@ -1,2 +1,2 @@
1
- import type { Icon } from '../icons.interfaces.js';
1
+ import type { Icon } from '../interfaces.js';
2
2
  export declare const discoverIcons: (svgDirectory: string) => Promise<Array<Icon>>;
@@ -0,0 +1 @@
1
+ export declare const styleColorAttributeKey = "style";
@@ -0,0 +1 @@
1
+ export const styleColorAttributeKey = 'style';
@@ -1,4 +1,4 @@
1
- import type { CheerioAPI } from 'cheerio';
1
+ import type { CheerioAPI } from 'cheerio/slim';
2
2
  import type { AnyNode } from 'domhandler';
3
- import type { GetSvgColorsOptions } from './get-svg-colors.interfaces.js';
3
+ import type { GetSvgColorsOptions } from './interfaces.js';
4
4
  export declare const extractColorFromElement: (cheerio: CheerioAPI, element: AnyNode, options: GetSvgColorsOptions) => Set<string>;
@@ -1,4 +1,4 @@
1
- import { STYLE_COLOR_ATTRIBUTE_KEY } from './get-svg-colors.constants.js';
1
+ import { styleColorAttributeKey } from './constants.js';
2
2
  export const extractColorFromElement = (cheerio, element, options) => {
3
3
  const colors = new Set();
4
4
  const attributes = cheerio(element).attr() ?? {};
@@ -6,7 +6,7 @@ export const extractColorFromElement = (cheerio, element, options) => {
6
6
  if (options.colorAttributes?.has(name)) {
7
7
  colors.add(value);
8
8
  }
9
- if (name === STYLE_COLOR_ATTRIBUTE_KEY) {
9
+ if (name === styleColorAttributeKey) {
10
10
  options.colorAttributes?.forEach((colorAttribute) => {
11
11
  colors.add(cheerio(element).css(colorAttribute) || '');
12
12
  });
@@ -1,2 +1,2 @@
1
- import type { GetSvgColorsOptions } from './get-svg-colors.interfaces.js';
1
+ import type { GetSvgColorsOptions } from './interfaces.js';
2
2
  export declare const getSvgColors: (source: string, options?: GetSvgColorsOptions) => Array<string>;
@@ -1,6 +1,6 @@
1
- import { load } from 'cheerio';
2
- import { extractColorFromElement } from './extract-color-from-element.helper.js';
3
- import { validateColor } from './validate-color.helper.js';
1
+ import { load } from 'cheerio/slim';
2
+ import { extractColorFromElement } from './extract-color-from-element.js';
3
+ import { validateColor } from './helpers/validate-color.js';
4
4
  export const getSvgColors = (source, options = {}) => {
5
5
  const colors = new Set();
6
6
  const cheerio = load(source, { xml: true });
@@ -1,2 +1,2 @@
1
- import type { GetSvgColorsOptions } from './get-svg-colors.interfaces.js';
1
+ import type { GetSvgColorsOptions } from '../interfaces.js';
2
2
  export declare const validateColor: (color: string, options: GetSvgColorsOptions) => boolean;
@@ -1,2 +1,2 @@
1
- export * from './get-svg-colors.util.js';
2
- export type * from './get-svg-colors.interfaces.js';
1
+ export * from './get-svg-colors.js';
2
+ export type * from './interfaces.js';
@@ -1 +1 @@
1
- export * from "./get-svg-colors.util.js";
1
+ export * from "./get-svg-colors.js";
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- export * from './build-svgr.util.js';
1
+ export * from './build-svgr.js';
2
2
  export * from './compile-icons/index.js';
3
- export * from './discover-icons.util.js';
3
+ export * from './discover-icons.js';
4
4
  export * from './get-svg-colors/index.js';
@@ -1,4 +1,4 @@
1
- export * from "./build-svgr.util.js";
1
+ export * from "./build-svgr.js";
2
2
  export * from "./compile-icons/index.js";
3
- export * from "./discover-icons.util.js";
3
+ export * from "./discover-icons.js";
4
4
  export * from "./get-svg-colors/index.js";
@@ -1,2 +1,2 @@
1
- import type { Source } from '../icons.interfaces.js';
1
+ import type { Source } from '../interfaces.js';
2
2
  export declare const writeCompiledIcons: (sources: Array<Source>, targetDir: string) => Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import fs from 'node:fs';
2
- import path from 'path';
2
+ import path from 'node:path';
3
3
  import { pretty } from '@atls-ui-generators/utils';
4
4
  const writeSourceFile = async (source, targetDir) => {
5
5
  const filename = path.join(targetDir, `${source.name}.tsx`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atls-ui-generators/icons",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "license": "BSD-3-Clause",
5
5
  "type": "module",
6
6
  "exports": {
@@ -19,30 +19,33 @@
19
19
  },
20
20
  "main": "dist/index.js",
21
21
  "bin": {
22
- "generate-icons": "dist/icons.generator.js"
22
+ "generate-icons": "dist/generator.js"
23
23
  },
24
24
  "files": [
25
25
  "dist"
26
26
  ],
27
27
  "scripts": {
28
28
  "build": "yarn library build",
29
- "generate-icons": "tsx src/icons.generator.ts",
29
+ "generate-icons": "tsx src/generator.ts",
30
30
  "prepack": "yarn run build",
31
31
  "postpack": "rm -rf dist"
32
32
  },
33
33
  "dependencies": {
34
34
  "@atls-ui-generators/utils": "1.0.5",
35
35
  "@svgr/core": "8.1.0",
36
+ "@svgr/plugin-jsx": "8.1.0",
37
+ "@svgr/plugin-prettier": "8.1.0",
38
+ "@svgr/plugin-svgo": "8.1.0",
36
39
  "@swc-node/register": "1.9.0",
37
40
  "@swc/core": "1.6.1",
38
41
  "cheerio": "1.1.2",
39
42
  "clipanion": "4.0.0-rc.4",
43
+ "domhandler": "5.0.3",
40
44
  "glob": "11.0.2",
41
45
  "is-svg": "6.1.0"
42
46
  },
43
47
  "devDependencies": {
44
48
  "@types/node": "22.15.3",
45
- "domhandler": "5.0.3",
46
49
  "tsx": "4.20.5",
47
50
  "typescript": "5.5.4"
48
51
  },
@@ -1,3 +0,0 @@
1
- import type { Icon } from '../../icons.interfaces.js';
2
- import type { Replacements } from '../../icons.interfaces.js';
3
- export declare const buildReplacements: (icons: Array<Icon>) => Promise<Replacements>;
@@ -1,3 +0,0 @@
1
- import type { Icon } from '../../icons.interfaces.js';
2
- import type { ReplacementIconColors } from '../../icons.interfaces.js';
3
- export declare const createReplacementIconColors: (icons: Array<Icon>) => Promise<ReplacementIconColors>;
@@ -1,3 +0,0 @@
1
- import type { Replacements } from '../../icons.interfaces.js';
2
- import type { ReplacementIconColors } from '../../icons.interfaces.js';
3
- export declare const createReplacements: (replacementIconColors: ReplacementIconColors) => Replacements;
@@ -1,2 +0,0 @@
1
- import type { GetColorReplacement } from './get-color-replacement.interfaces.js';
2
- export declare const getColorReplacement: GetColorReplacement;
@@ -1,4 +0,0 @@
1
- import type { Icon } from '../../icons.interfaces.js';
2
- import type { Replacements } from '../../icons.interfaces.js';
3
- import type { Source } from '../../icons.interfaces.js';
4
- export declare const compileIcons: (icons: Array<Icon>, replacements: Replacements) => Promise<Array<Source>>;
@@ -1 +0,0 @@
1
- export declare const STYLE_COLOR_ATTRIBUTE_KEY = "style";
@@ -1 +0,0 @@
1
- export const STYLE_COLOR_ATTRIBUTE_KEY = 'style';
File without changes
File without changes
File without changes
File without changes