@cyberalien/svg-utils 1.2.6 → 1.2.8

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 (145) hide show
  1. package/lib/classname/const.js +1 -2
  2. package/lib/classname/toggle.js +1 -3
  3. package/lib/components/export/dependencies.js +1 -2
  4. package/lib/components/export/exports.js +1 -2
  5. package/lib/components/export/file.js +1 -3
  6. package/lib/components/export/filename.js +1 -2
  7. package/lib/components/export/fs.js +1 -3
  8. package/lib/components/export/merge.js +1 -3
  9. package/lib/components/helpers/code/lines.js +1 -2
  10. package/lib/components/helpers/content/ratio.js +1 -2
  11. package/lib/components/helpers/content/size.js +1 -3
  12. package/lib/components/helpers/content/stringify.js +1 -3
  13. package/lib/components/helpers/css/generate.d.ts +1 -1
  14. package/lib/components/helpers/css/generate.js +1 -3
  15. package/lib/components/helpers/filenames/asset.js +1 -2
  16. package/lib/components/helpers/filenames/css.js +1 -3
  17. package/lib/components/helpers/filenames/path.js +1 -2
  18. package/lib/components/helpers/filenames/types.js +1 -3
  19. package/lib/components/helpers/functions/custom.js +3 -5
  20. package/lib/components/helpers/functions/fallback.js +3 -5
  21. package/lib/components/helpers/functions/innerhtml.js +1 -3
  22. package/lib/components/helpers/functions/size.js +3 -5
  23. package/lib/components/helpers/imports/add.js +1 -2
  24. package/lib/components/helpers/imports/create.js +1 -2
  25. package/lib/components/helpers/imports/stringify.js +1 -2
  26. package/lib/components/helpers/imports/types.js +1 -1
  27. package/lib/components/helpers/props/object.js +1 -3
  28. package/lib/components/helpers/props/stringify.js +1 -2
  29. package/lib/components/helpers/props/ts.js +1 -2
  30. package/lib/components/helpers/props/types.js +1 -1
  31. package/lib/components/helpers/ts/jsx.js +1 -3
  32. package/lib/components/helpers/ts/solid.js +1 -3
  33. package/lib/components/helpers/ts/svelte.js +1 -3
  34. package/lib/components/helpers/ts/vue.js +1 -3
  35. package/lib/components/helpers/ts/wrapper.js +1 -3
  36. package/lib/components/jsx.js +13 -5
  37. package/lib/components/prepare/iconify.js +2 -4
  38. package/lib/components/prepare/options.js +1 -3
  39. package/lib/components/prepare/states.js +4 -4
  40. package/lib/components/raw.js +1 -3
  41. package/lib/components/solid.js +12 -5
  42. package/lib/components/svelte.js +12 -5
  43. package/lib/components/types/component.js +1 -1
  44. package/lib/components/types/css.js +1 -1
  45. package/lib/components/types/data.js +1 -1
  46. package/lib/components/types/jsx.js +1 -1
  47. package/lib/components/types/options.d.ts +1 -0
  48. package/lib/components/types/options.js +1 -1
  49. package/lib/components/types/source.d.ts +1 -0
  50. package/lib/components/types/source.js +1 -1
  51. package/lib/components/vue-func.js +12 -5
  52. package/lib/components/vue.js +12 -5
  53. package/lib/css/find/animations.js +1 -3
  54. package/lib/css/find/classname.js +1 -3
  55. package/lib/css/find/prop.js +1 -2
  56. package/lib/css/hash.js +1 -3
  57. package/lib/css/minify.js +1 -2
  58. package/lib/css/rules.js +1 -2
  59. package/lib/css/stringify.js +1 -2
  60. package/lib/css/stylesheet.js +1 -3
  61. package/lib/css/types.js +1 -1
  62. package/lib/helpers/data/compact.js +1 -2
  63. package/lib/helpers/data/expand.js +1 -2
  64. package/lib/helpers/hash/context.js +1 -2
  65. package/lib/helpers/hash/hash.js +1 -2
  66. package/lib/helpers/hash/stringify.js +1 -2
  67. package/lib/helpers/hash/types.js +1 -1
  68. package/lib/helpers/hash/unique.js +1 -3
  69. package/lib/helpers/misc/clone.js +1 -2
  70. package/lib/helpers/misc/compare.js +1 -3
  71. package/lib/helpers/misc/keys.js +1 -3
  72. package/lib/helpers/misc/promises.js +1 -3
  73. package/lib/helpers/misc/sort-object.js +1 -2
  74. package/lib/helpers/misc/strings.js +1 -2
  75. package/lib/helpers/reduce-motion.js +1 -2
  76. package/lib/iconify/icon/{nornalise.js → normalise.js} +1 -3
  77. package/lib/iconify/icon/types.js +1 -1
  78. package/lib/iconify/icon-set/defaults.js +1 -2
  79. package/lib/iconify/icon-set/icon.js +1 -3
  80. package/lib/iconify/icon-set/parse.js +1 -3
  81. package/lib/iconify/icon-set/types.js +1 -1
  82. package/lib/index.js +1 -2
  83. package/lib/svg/content/defs.js +1 -2
  84. package/lib/svg/ids/change.js +1 -3
  85. package/lib/svg/ids/duplicate.js +1 -3
  86. package/lib/svg/ids/string.js +1 -2
  87. package/lib/svg/ids/types.js +1 -1
  88. package/lib/svg/ids/unique.js +1 -3
  89. package/lib/svg/ids/unused.js +1 -3
  90. package/lib/svg/props/size.js +1 -2
  91. package/lib/svg/props/stringify.js +1 -2
  92. package/lib/svg/viewbox/minify.js +1 -2
  93. package/lib/svg/viewbox/parse.js +1 -2
  94. package/lib/svg/viewbox/square.js +1 -2
  95. package/lib/svg/viewbox/types.js +1 -1
  96. package/lib/svg/viewbox/value.js +1 -2
  97. package/lib/svg-css/content.js +1 -3
  98. package/lib/svg-css/icon/css.js +6 -4
  99. package/lib/svg-css/icon/types.js +1 -1
  100. package/lib/svg-css/icon-set/add.js +1 -3
  101. package/lib/svg-css/icon-set/create.js +1 -2
  102. package/lib/svg-css/icon-set/get.js +1 -3
  103. package/lib/svg-css/icon-set/minify/expand.js +1 -3
  104. package/lib/svg-css/icon-set/minify/keys.js +1 -2
  105. package/lib/svg-css/icon-set/minify/minify.js +1 -3
  106. package/lib/svg-css/icon-set/types.js +1 -1
  107. package/lib/svg-css/props/prop.js +1 -2
  108. package/lib/svg-css/props/props.js +3 -5
  109. package/lib/svg-css/props/tags.js +2 -3
  110. package/lib/svg-css/props/types.js +1 -1
  111. package/lib/svg-css/root.js +1 -3
  112. package/lib/svg-css/states/cleanup-values.js +1 -3
  113. package/lib/svg-css/states/fallback/parse.js +1 -2
  114. package/lib/svg-css/states/fallback/stringify.js +1 -2
  115. package/lib/svg-css/states/fallback/test.js +1 -3
  116. package/lib/svg-css/states/fallback/types.js +1 -1
  117. package/lib/svg-css/states/generator.js +1 -3
  118. package/lib/svg-css/states/key.js +1 -2
  119. package/lib/svg-css/states/object.js +1 -3
  120. package/lib/svg-css/states/selector/helpers/iterate.js +1 -2
  121. package/lib/svg-css/states/selector/merge.js +1 -3
  122. package/lib/svg-css/states/selector/parse.d.ts +1 -1
  123. package/lib/svg-css/states/selector/parse.js +3 -4
  124. package/lib/svg-css/states/selector/part/merge.js +1 -3
  125. package/lib/svg-css/states/selector/part/split.js +1 -3
  126. package/lib/svg-css/states/selector/part/stringify.js +1 -3
  127. package/lib/svg-css/states/selector/split.js +1 -3
  128. package/lib/svg-css/states/selector/stringify.js +1 -3
  129. package/lib/svg-css/states/selector/sub/merge.js +1 -2
  130. package/lib/svg-css/states/selector/sub/split.js +1 -2
  131. package/lib/svg-css/states/selector/sub/stringify.js +1 -2
  132. package/lib/svg-css/states/selector/types.d.ts +1 -0
  133. package/lib/svg-css/states/selector/types.js +1 -1
  134. package/lib/svg-css/states/types.js +1 -1
  135. package/lib/svg-css/states/validate.js +1 -2
  136. package/lib/svg-css/states/value.js +1 -2
  137. package/lib/svg-css/types.js +1 -1
  138. package/lib/xml/iterate.js +1 -2
  139. package/lib/xml/parse.js +1 -2
  140. package/lib/xml/stringify.js +1 -2
  141. package/lib/xml/types.js +1 -1
  142. package/package.json +6 -11
  143. package/lib/svg-css/states/focus.d.ts +0 -10
  144. package/lib/svg-css/states/focus.js +0 -14
  145. /package/lib/iconify/icon/{nornalise.d.ts → normalise.d.ts} +0 -0
@@ -1,4 +1,3 @@
1
1
  const defaultClassProp = "class";
2
2
  const classProps = [defaultClassProp];
3
-
4
- export { classProps, defaultClassProp };
3
+ export { classProps, defaultClassProp };
@@ -1,5 +1,4 @@
1
1
  import { defaultClassProp } from "./const.js";
2
-
3
2
  /**
4
3
  * Split class name by spaces
5
4
  */
@@ -25,5 +24,4 @@ function toggleClassName(attribs, className, add, prop = defaultClassProp) {
25
24
  }
26
25
  attribs[prop] = Array.from(list).sort().join(" ");
27
26
  }
28
-
29
- export { splitClassName, toggleClassName };
27
+ export { splitClassName, toggleClassName };
@@ -14,5 +14,4 @@ function createDependenciesForPackage(dependencies, customVersions) {
14
14
  return result;
15
15
  }
16
16
  }
17
-
18
- export { addComponentDependencies, createDependenciesForPackage };
17
+ export { addComponentDependencies, createDependenciesForPackage };
@@ -14,5 +14,4 @@ function createExportsForMainFiles(data, options = {}) {
14
14
  }
15
15
  return result;
16
16
  }
17
-
18
- export { createExportsForMainFiles };
17
+ export { createExportsForMainFiles };
@@ -1,5 +1,4 @@
1
1
  import { getGeneratedComponentFilename } from "./filename.js";
2
-
3
2
  /**
4
3
  * Add icon and filename to generated component
5
4
  */
@@ -13,5 +12,4 @@ function convertGeneratedComponentToFile(icon, item, options) {
13
12
  ...item
14
13
  };
15
14
  }
16
-
17
- export { convertGeneratedComponentToFile };
15
+ export { convertGeneratedComponentToFile };
@@ -11,5 +11,4 @@ function getGeneratedComponentFilename(icon, componentExtension, options) {
11
11
  const { prefixDirsForComponents } = options;
12
12
  return (prefixDirsForComponents ? `${typeof prefixDirsForComponents === "string" ? prefixDirsForComponents : prefix}/` : "") + (options.doubleDirsForComponents ? `${name.slice(0, 1).toLowerCase()}/` : "") + name + componentExtension;
13
13
  }
14
-
15
- export { getGeneratedComponentFilename };
14
+ export { getGeneratedComponentFilename };
@@ -1,5 +1,4 @@
1
1
  import { mkdir, writeFile } from "node:fs/promises";
2
-
3
2
  /**
4
3
  * Save exported files to filesystem
5
4
  */
@@ -16,5 +15,4 @@ async function saveExportedFilesToFS(files, dir) {
16
15
  }
17
16
  return saved;
18
17
  }
19
-
20
- export { saveExportedFilesToFS };
18
+ export { saveExportedFilesToFS };
@@ -1,5 +1,4 @@
1
1
  import { stringifyStylesheet } from "../../css/stylesheet.js";
2
-
3
2
  /**
4
3
  * Merge exported component files into single array
5
4
  */
@@ -25,5 +24,4 @@ function mergeExportedComponentFiles(items, files) {
25
24
  }
26
25
  return files;
27
26
  }
28
-
29
- export { mergeExportedComponentFiles };
27
+ export { mergeExportedComponentFiles };
@@ -5,5 +5,4 @@ function stringifyFactoryIconCodeLines(lines, padding = 0) {
5
5
  const pad = " ".repeat(padding);
6
6
  return lines.map((line) => pad + line).join("\n");
7
7
  }
8
-
9
- export { stringifyFactoryIconCodeLines };
8
+ export { stringifyFactoryIconCodeLines };
@@ -5,5 +5,4 @@ function getViewBoxRatio(viewBox) {
5
5
  const ratio = viewBox.width / viewBox.height;
6
6
  return (Math.ceil(ratio * 100) / 100).toFixed(2).replace(/\.?0+$/, "");
7
7
  }
8
-
9
- export { getViewBoxRatio };
8
+ export { getViewBoxRatio };
@@ -1,5 +1,4 @@
1
1
  import { calculateSize } from "../../../svg/props/size.js";
2
-
3
2
  /**
4
3
  * Get size values for component
5
4
  */
@@ -18,5 +17,4 @@ function getComponentSizeValues(options, viewBox) {
18
17
  height: square ? width : calculateSize(width, viewBox.height / viewBox.width)
19
18
  };
20
19
  }
21
-
22
- export { getComponentSizeValues };
20
+ export { getComponentSizeValues };
@@ -1,5 +1,4 @@
1
1
  import { stringifyStylesheet } from "../../../css/stylesheet.js";
2
-
3
2
  /**
4
3
  * Convert icon content to a string literal
5
4
  */
@@ -7,5 +6,4 @@ function stringifyFactoryIconContent(icon, embedCSS) {
7
6
  const style = embedCSS ? stringifyStylesheet(embedCSS) : "";
8
7
  return "`" + (style ? `<style>${style}</style>${icon.content}` : icon.content).replace(/`/g, "\\`") + "`";
9
8
  }
10
-
11
- export { stringifyFactoryIconContent };
9
+ export { stringifyFactoryIconContent };
@@ -3,7 +3,7 @@ import { GeneratedAssetFile } from "../../types/component.js";
3
3
  import { ComponentFactorySource } from "../../types/source.js";
4
4
  import { ComponentFactoryOptions } from "../../types/options.js";
5
5
  import { FactoryComponentImports } from "../imports/types.js";
6
- interface Options extends Pick<ComponentFactoryOptions, 'cssMode' | 'cssPath' | 'doubleDirsForCSS' | 'mergeCSS'> {
6
+ interface Options extends Pick<ComponentFactoryOptions, 'cssMode' | 'cssPath' | 'doubleDirsForCSS' | 'mergeCSS' | 'staticState'> {
7
7
  componentType?: 'svelte';
8
8
  }
9
9
  /**
@@ -1,7 +1,6 @@
1
1
  import { createEmptyStylesheet, stringifyStylesheet } from "../../../css/stylesheet.js";
2
2
  import { getGeneratedCSSFilename } from "../filenames/css.js";
3
3
  import { renderStatefulSVGCSSIconStyle } from "../../../svg-css/icon/css.js";
4
-
5
4
  /**
6
5
  * Generate CSS files for component
7
6
  *
@@ -65,5 +64,4 @@ function generateCSSFilesForComponent(content, imports, assets, options) {
65
64
  }
66
65
  return returnCSS ? commonStylesheet : void 0;
67
66
  }
68
-
69
- export { generateCSSFilesForComponent };
67
+ export { generateCSSFilesForComponent };
@@ -13,5 +13,4 @@ function getGeneratedAssetFilename(filename, rootPath) {
13
13
  filename: `${basePath ? basePath + "/" : ""}${filename}`
14
14
  };
15
15
  }
16
-
17
- export { defaultHelpersDirectory, getGeneratedAssetFilename };
16
+ export { defaultHelpersDirectory, getGeneratedAssetFilename };
@@ -1,5 +1,4 @@
1
1
  import { getGeneratedAssetFilename } from "./asset.js";
2
-
3
2
  /**
4
3
  * Generate CSS filename based on options
5
4
  */
@@ -7,5 +6,4 @@ function getGeneratedCSSFilename(name, options) {
7
6
  const { cssPath, doubleDirsForCSS } = options;
8
7
  return getGeneratedAssetFilename(`${doubleDirsForCSS ? `${name.slice(0, 1).toLowerCase()}/${name}` : name}.css`, cssPath);
9
8
  }
10
-
11
- export { getGeneratedCSSFilename };
9
+ export { getGeneratedCSSFilename };
@@ -13,5 +13,4 @@ function getFactoryRelativeRootPath(options, pathPrefix) {
13
13
  filename: pathPrefix ?? ""
14
14
  };
15
15
  }
16
-
17
- export { getFactoryRelativeRootPath };
16
+ export { getFactoryRelativeRootPath };
@@ -1,7 +1,6 @@
1
1
  import { getUniqueHash } from "../../../helpers/hash/unique.js";
2
2
  import { getGeneratedAssetFilename } from "./asset.js";
3
3
  import { getGeneratedComponentFilename } from "../../export/filename.js";
4
-
5
4
  /**
6
5
  * Generate component types filename based on options
7
6
  */
@@ -18,5 +17,4 @@ function getGeneratedComponentTypesFilename(icon, content, options) {
18
17
  import: `./${filename.split("/").pop()}`
19
18
  };
20
19
  }
21
-
22
- export { getGeneratedComponentTypesFilename };
20
+ export { getGeneratedComponentTypesFilename };
@@ -1,17 +1,15 @@
1
- import { defaultHelpersDirectory, getGeneratedAssetFilename } from "../filenames/asset.js";
1
+ import { getGeneratedAssetFilename } from "../filenames/asset.js";
2
2
  import { camelToKebab } from "../../../helpers/misc/strings.js";
3
-
4
3
  /**
5
4
  * Adds a custom function to assets
6
5
  */
7
6
  function addCustomFunctionAsset(imports, assets, options, data) {
8
7
  const { functionName, content, exportNames } = data;
9
- const filename = getGeneratedAssetFilename(`${options.helpersDirectory ?? defaultHelpersDirectory}/${data.jsName ?? camelToKebab(functionName)}.js`, options.rootPath);
8
+ const filename = getGeneratedAssetFilename(`${options.helpersDirectory ?? "helpers"}/${data.jsName ?? camelToKebab(functionName)}.js`, options.rootPath);
10
9
  assets.push({
11
10
  ...filename,
12
11
  content
13
12
  });
14
13
  imports.named[filename.import] = exportNames ?? new Set([functionName]);
15
14
  }
16
-
17
- export { addCustomFunctionAsset };
15
+ export { addCustomFunctionAsset };
@@ -1,7 +1,6 @@
1
1
  import { createUniqueHashContext } from "../../../helpers/hash/context.js";
2
2
  import { getUniqueHash } from "../../../helpers/hash/unique.js";
3
- import { defaultHelpersDirectory, getGeneratedAssetFilename } from "../filenames/asset.js";
4
-
3
+ import { getGeneratedAssetFilename } from "../filenames/asset.js";
5
4
  const sharedFunctionName = "getIconFallback";
6
5
  const hashedFunctionName = "getFallback";
7
6
  const functionContent = `
@@ -32,7 +31,7 @@ function addFallbackFunctionAsset(imports, assets, options, defaultValues) {
32
31
  css: true,
33
32
  length: 10
34
33
  });
35
- const assetDirectory = options.helpersDirectory ?? defaultHelpersDirectory;
34
+ const assetDirectory = options.helpersDirectory ?? "helpers";
36
35
  const sharedFilename = getGeneratedAssetFilename(`${assetDirectory}/fallback.js`, options.rootPath);
37
36
  assets.push({
38
37
  ...sharedFilename,
@@ -49,5 +48,4 @@ export const ${hashedFunctionName} = ${sharedFunctionName}.bind(null, ${JSON.str
49
48
  imports.named[hashedFilename.import] = new Set([hashedFunctionName]);
50
49
  return hashedFunctionName;
51
50
  }
52
-
53
- export { addFallbackFunctionAsset };
51
+ export { addFallbackFunctionAsset };
@@ -1,5 +1,4 @@
1
1
  import { addCustomFunctionAsset } from "./custom.js";
2
-
3
2
  const functionName = "cleanupHTML";
4
3
  /**
5
4
  * Adds cleanUpInnerHTML() function to assets
@@ -31,5 +30,4 @@ export function ${functionName}(html) {
31
30
  });
32
31
  return functionName;
33
32
  }
34
-
35
- export { addInnerHTMLFunctionAsset };
33
+ export { addInnerHTMLFunctionAsset };
@@ -1,5 +1,4 @@
1
- import { defaultHelpersDirectory, getGeneratedAssetFilename } from "../filenames/asset.js";
2
-
1
+ import { getGeneratedAssetFilename } from "../filenames/asset.js";
3
2
  const functionName = "getSizeProps";
4
3
  const functionContent = `
5
4
  const unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;
@@ -67,7 +66,7 @@ export { ${functionName} };
67
66
  * Adds getSizeProps() function to assets
68
67
  */
69
68
  function addSizeFunctionAsset(imports, assets, options) {
70
- const filename = getGeneratedAssetFilename(`${options.helpersDirectory ?? defaultHelpersDirectory}/size.js`, options.rootPath);
69
+ const filename = getGeneratedAssetFilename(`${options.helpersDirectory ?? "helpers"}/size.js`, options.rootPath);
71
70
  assets.push({
72
71
  ...filename,
73
72
  content: functionContent
@@ -75,5 +74,4 @@ function addSizeFunctionAsset(imports, assets, options) {
75
74
  imports.named[filename.import] = new Set([functionName]);
76
75
  return functionName;
77
76
  }
78
-
79
- export { addSizeFunctionAsset };
77
+ export { addSizeFunctionAsset };
@@ -14,5 +14,4 @@ function addNamedImport(data, source, names) {
14
14
  function addTypeImport(data, source, types) {
15
15
  addToSet(data.types[source] ??= /* @__PURE__ */ new Set(), types);
16
16
  }
17
-
18
- export { addNamedImport, addTypeImport };
17
+ export { addNamedImport, addTypeImport };
@@ -10,5 +10,4 @@ function createFactoryImports() {
10
10
  css: /* @__PURE__ */ new Set()
11
11
  };
12
12
  }
13
-
14
- export { createFactoryImports };
13
+ export { createFactoryImports };
@@ -41,5 +41,4 @@ function stringifyFactoryImports(imports, includeTypes = true) {
41
41
  if (lines.length) lines.push("");
42
42
  return lines.join("\n");
43
43
  }
44
-
45
- export { stringifyFactoryImports };
44
+ export { stringifyFactoryImports };
@@ -1 +1 @@
1
- export { };
1
+ export {};
@@ -1,10 +1,8 @@
1
1
  import { stringifyFactoryProps } from "./stringify.js";
2
-
3
2
  /**
4
3
  * Stringify properties for component as JS object
5
4
  */
6
5
  function stringifyFactoryPropsAsJSON(props, separator = "\n ") {
7
6
  return stringifyFactoryProps(props, "\"{prop}\": {value},", "\"{prop}\": \"{value}\",", separator);
8
7
  }
9
-
10
- export { stringifyFactoryPropsAsJSON };
8
+ export { stringifyFactoryPropsAsJSON };
@@ -17,5 +17,4 @@ function stringifyFactoryProps(props, dynamicTemplate, staticTemplate = factoryP
17
17
  }
18
18
  return result.join(separator);
19
19
  }
20
-
21
- export { factoryPropTemplate, stringifyFactoryProps };
20
+ export { factoryPropTemplate, stringifyFactoryProps };
@@ -23,5 +23,4 @@ function stringifyFactoryPropTypes(props) {
23
23
  function getUsedFactoryProps(props) {
24
24
  return parse(props, (key) => key);
25
25
  }
26
-
27
- export { getUsedFactoryProps, stringifyFactoryPropTypes };
26
+ export { getUsedFactoryProps, stringifyFactoryPropTypes };
@@ -1 +1 @@
1
- export { };
1
+ export {};
@@ -1,5 +1,4 @@
1
1
  import { addComponentTypes, omitComponentSVGProps } from "./wrapper.js";
2
-
3
2
  const iconPropsTemplate = `interface IconProps {
4
3
  /* PROPS */
5
4
  }`;
@@ -34,5 +33,4 @@ ${exportTemplate}
34
33
  }
35
34
  return addComponentTypes(template, data, options, assets, props);
36
35
  }
37
-
38
- export { addJSXComponentTypes };
36
+ export { addJSXComponentTypes };
@@ -1,5 +1,4 @@
1
1
  import { addComponentTypes, omitComponentSVGProps } from "./wrapper.js";
2
-
3
2
  /**
4
3
  * Add Solid component types
5
4
  */
@@ -16,5 +15,4 @@ declare const Component: (
16
15
  export { type IconProps };
17
16
  export default Component;
18
17
  `);
19
-
20
- export { addSolidComponentTypes };
18
+ export { addSolidComponentTypes };
@@ -1,5 +1,4 @@
1
1
  import { addComponentTypes } from "./wrapper.js";
2
-
3
2
  /**
4
3
  * Add Svelte component types
5
4
  */
@@ -15,5 +14,4 @@ declare class Component extends SvelteComponent<Omit<SvelteHTMLElements['svg'],
15
14
  export { type IconProps };
16
15
  export default Component;
17
16
  `);
18
-
19
- export { addSvelteComponentTypes };
17
+ export { addSvelteComponentTypes };
@@ -1,5 +1,4 @@
1
1
  import { addComponentTypes } from "./wrapper.js";
2
-
3
2
  /**
4
3
  * Add Vue component types
5
4
  */
@@ -14,5 +13,4 @@ declare const Component: DefineSetupFnComponent<IconProps, {}, {}, IconProps & {
14
13
  export { type IconProps };
15
14
  export default Component;
16
15
  `);
17
-
18
- export { addVueComponentTypes };
16
+ export { addVueComponentTypes };
@@ -1,6 +1,5 @@
1
1
  import { stringifyFactoryPropTypes } from "../props/ts.js";
2
2
  import { getGeneratedComponentTypesFilename } from "../filenames/types.js";
3
-
4
3
  /**
5
4
  * Properties to omit
6
5
  */
@@ -18,5 +17,4 @@ function addComponentTypes(template, data, options, assets, props) {
18
17
  });
19
18
  return filename.filename;
20
19
  }
21
-
22
- export { addComponentTypes, omitComponentSVGProps };
20
+ export { addComponentTypes, omitComponentSVGProps };
@@ -14,7 +14,6 @@ import { addJSXComponentTypes } from "./helpers/ts/jsx.js";
14
14
  import { addCustomFunctionAsset } from "./helpers/functions/custom.js";
15
15
  import { addFallbackFunctionAsset } from "./helpers/functions/fallback.js";
16
16
  import { addInnerHTMLFunctionAsset } from "./helpers/functions/innerhtml.js";
17
-
18
17
  /**
19
18
  * Create React component code
20
19
  */
@@ -60,8 +59,8 @@ function createJSXComponent(data, options) {
60
59
  };
61
60
  let computedFallback = false;
62
61
  if (statefulData) {
63
- const { supportedStates, allStates } = statefulData;
64
- if (supportedStates.size) {
62
+ const { supportedStates, allStates, staticClassname } = statefulData;
63
+ if (supportedStates.size || staticClassname) {
65
64
  const computedStates = [];
66
65
  const computedStateNames = [];
67
66
  let addedStateFunc = false;
@@ -98,6 +97,16 @@ function createJSXComponent(data, options) {
98
97
  }
99
98
  }
100
99
  }
100
+ if (staticClassname) {
101
+ const state = "static";
102
+ props[state] = {
103
+ type: "boolean",
104
+ value: state,
105
+ template: ""
106
+ };
107
+ computedStates.push(`'${state}': ${state}`);
108
+ computedStateNames.push(state);
109
+ }
101
110
  if (computedStates.length) {
102
111
  componentInternalCode.push(`const states = useMemo(() => ({ ${computedStates.join(", ")} }), [${computedStateNames.join(", ")}]);`);
103
112
  if (hasFallback && statefulData.fallback) {
@@ -192,5 +201,4 @@ function createJSXComponent(data, options) {
192
201
  dependencies: dependencies.size ? dependencies : void 0
193
202
  };
194
203
  }
195
-
196
- export { createJSXComponent };
204
+ export { createJSXComponent };
@@ -1,7 +1,6 @@
1
1
  import { convertSVGContentToCSSRules } from "../../svg-css/content.js";
2
2
  import { getGeneratedAssetFilename } from "../helpers/filenames/asset.js";
3
- import { normaliseIconifyIcon } from "../../iconify/icon/nornalise.js";
4
-
3
+ import { normaliseIconifyIcon } from "../../iconify/icon/normalise.js";
5
4
  /**
6
5
  * Convert IconifyIcon data to FactoryIconData
7
6
  */
@@ -36,5 +35,4 @@ function getIconifyIconsetMetadataAsset(iconSet, rootPath) {
36
35
  });
37
36
  return assets;
38
37
  }
39
-
40
- export { convertIconifyIconToFactoryContent, getIconifyIconsetMetadataAsset };
38
+ export { convertIconifyIconToFactoryContent, getIconifyIconsetMetadataAsset };
@@ -1,6 +1,5 @@
1
1
  import { getGeneratedAssetFilename } from "../helpers/filenames/asset.js";
2
2
  import { getFactoryRelativeRootPath } from "../helpers/filenames/path.js";
3
-
4
3
  /**
5
4
  * Generate file system options
6
5
  */
@@ -21,5 +20,4 @@ function componentFactoryFileSystemOptions(base, pathPrefix) {
21
20
  sharedTypes: base.sharedTypes ?? false
22
21
  };
23
22
  }
24
-
25
- export { componentFactoryFileSystemOptions };
23
+ export { componentFactoryFileSystemOptions };
@@ -2,7 +2,6 @@ import { getStateValue } from "../../svg-css/states/value.js";
2
2
  import { createStatefulIconSelectorsContext } from "../../svg-css/states/selector/parse.js";
3
3
  import { parseIconFallbackTemplate } from "../../svg-css/states/fallback/parse.js";
4
4
  import { parseViewBox } from "../../svg/viewbox/parse.js";
5
-
6
5
  /**
7
6
  * Check states for stateful icon
8
7
  */
@@ -35,12 +34,14 @@ function prepareComponentFactoryStatefulIcon(icon, options) {
35
34
  supportedStateValues[stateName] = defaultValue;
36
35
  }
37
36
  }
37
+ const staticClassname = Object.keys(icon.animations ?? {}).length > 0 && options?.staticState !== false ? "state-static" : void 0;
38
38
  const statefulData = {
39
39
  allStates,
40
40
  supportedStates,
41
41
  defaultStateValues,
42
42
  supportedStateValues,
43
- context: createStatefulIconSelectorsContext(config, allStates)
43
+ staticClassname,
44
+ context: createStatefulIconSelectorsContext(config, allStates, staticClassname)
44
45
  };
45
46
  if (isStatefulFallback) {
46
47
  let fallbackTemplate = parseIconFallbackTemplate(fallback, allStates);
@@ -69,5 +70,4 @@ function prepareComponentFactoryStatefulIcon(icon, options) {
69
70
  statefulData
70
71
  };
71
72
  }
72
-
73
- export { prepareComponentFactoryStatefulIcon };
73
+ export { prepareComponentFactoryStatefulIcon };
@@ -7,7 +7,6 @@ import { generateCSSFilesForComponent } from "./helpers/css/generate.js";
7
7
  import { factoryPropTemplate, stringifyFactoryProps } from "./helpers/props/stringify.js";
8
8
  import { stringifyFactoryImports } from "./helpers/imports/stringify.js";
9
9
  import { getGeneratedComponentTypesFilename } from "./helpers/filenames/types.js";
10
-
11
10
  /**
12
11
  * Create raw component code
13
12
  */
@@ -43,5 +42,4 @@ function createRawComponent(data, options) {
43
42
  style: isEmbeddedCSS ? void 0 : style
44
43
  };
45
44
  }
46
-
47
- export { createRawComponent };
45
+ export { createRawComponent };
@@ -13,7 +13,6 @@ import { getViewBoxRatio } from "./helpers/content/ratio.js";
13
13
  import { addCustomFunctionAsset } from "./helpers/functions/custom.js";
14
14
  import { addFallbackFunctionAsset } from "./helpers/functions/fallback.js";
15
15
  import { addSolidComponentTypes } from "./helpers/ts/solid.js";
16
-
17
16
  /**
18
17
  * Create Solid component code
19
18
  */
@@ -45,8 +44,8 @@ function createSolidComponent(data, options) {
45
44
  if (!fallback) props.xmlns = "http://www.w3.org/2000/svg";
46
45
  let computedFallback = false;
47
46
  if (statefulData) {
48
- const { supportedStates, allStates } = statefulData;
49
- if (supportedStates.size) {
47
+ const { supportedStates, allStates, staticClassname } = statefulData;
48
+ if (supportedStates.size || staticClassname) {
50
49
  const computedStates = [];
51
50
  let addedStateFunc = false;
52
51
  for (const state of allStates) if (typeof state === "string") {
@@ -80,6 +79,15 @@ function createSolidComponent(data, options) {
80
79
  }
81
80
  }
82
81
  }
82
+ if (staticClassname) {
83
+ const state = "static";
84
+ props[state] = {
85
+ type: "boolean",
86
+ value: state,
87
+ template: ""
88
+ };
89
+ computedStates.push(`'${state}': local['${state}']`);
90
+ }
83
91
  if (computedStates.length) {
84
92
  componentInternalCode.push(`const states = createMemo(() => ({ ${computedStates.join(", ")} }));`);
85
93
  if (fallback && statefulData.fallback) {
@@ -166,5 +174,4 @@ function createSolidComponent(data, options) {
166
174
  dependencies: dependencies.size ? dependencies : void 0
167
175
  };
168
176
  }
169
-
170
- export { createSolidComponent };
177
+ export { createSolidComponent };
@@ -14,7 +14,6 @@ import { getViewBoxRatio } from "./helpers/content/ratio.js";
14
14
  import { addCustomFunctionAsset } from "./helpers/functions/custom.js";
15
15
  import { addFallbackFunctionAsset } from "./helpers/functions/fallback.js";
16
16
  import { addSvelteComponentTypes } from "./helpers/ts/svelte.js";
17
-
18
17
  /**
19
18
  * Create Svelte component code
20
19
  */
@@ -45,8 +44,8 @@ function createSvelteComponent(data, options) {
45
44
  if (!fallback) props.xmlns = "http://www.w3.org/2000/svg";
46
45
  let computedFallback = false;
47
46
  if (statefulData) {
48
- const { supportedStates, allStates } = statefulData;
49
- if (supportedStates.size) {
47
+ const { supportedStates, allStates, staticClassname } = statefulData;
48
+ if (supportedStates.size || staticClassname) {
50
49
  const computedStates = [];
51
50
  let addedStateFunc = false;
52
51
  for (const state of allStates) if (typeof state === "string") {
@@ -80,6 +79,15 @@ function createSvelteComponent(data, options) {
80
79
  }
81
80
  }
82
81
  }
82
+ if (staticClassname) {
83
+ const state = "static";
84
+ props[state] = {
85
+ type: "boolean",
86
+ value: state,
87
+ template: ""
88
+ };
89
+ computedStates.push(`'${state}': ${state}`);
90
+ }
83
91
  if (computedStates.length) {
84
92
  componentCode.push(`let states = $derived(({ ${computedStates.join(", ")} }));`);
85
93
  if (fallback && statefulData.fallback) {
@@ -167,5 +175,4 @@ ${template}
167
175
  dependencies: dependencies.size ? dependencies : void 0
168
176
  };
169
177
  }
170
-
171
- export { createSvelteComponent };
178
+ export { createSvelteComponent };
@@ -1 +1 @@
1
- export { };
1
+ export {};
@@ -1 +1 @@
1
- export { };
1
+ export {};
@@ -1 +1 @@
1
- export { };
1
+ export {};
@@ -1 +1 @@
1
- export { };
1
+ export {};
@@ -25,6 +25,7 @@ interface ComponentFactoryFileSystemOptions {
25
25
  */
26
26
  interface ComponentFactoryStatefulIconRenderingOptions {
27
27
  stateSelectors?: StatefulIconSelectorsConfig;
28
+ staticState?: boolean;
28
29
  }
29
30
  /**
30
31
  * Rendering options for component factory
@@ -1 +1 @@
1
- export { };
1
+ export {};