@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
@@ -10,6 +10,7 @@ interface StatefulComponentFactorySource {
10
10
  fallback?: IconFallbackTemplate;
11
11
  allStates: IconStatesList;
12
12
  supportedStates: Set<string>;
13
+ staticClassname?: string;
13
14
  defaultStateValues: Record<string, string | boolean>;
14
15
  supportedStateValues: Record<string, string | boolean>;
15
16
  context: StatefulIconSelectorsContext;
@@ -1 +1 @@
1
- export { };
1
+ export {};
@@ -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 { addVueComponentTypes } from "./helpers/ts/vue.js";
16
-
17
16
  /**
18
17
  * Create functional Vue component code
19
18
  */
@@ -43,8 +42,8 @@ function createVueFunctionalComponent(data, options) {
43
42
  if (!fallback) props.xmlns = "http://www.w3.org/2000/svg";
44
43
  let computedFallback = false;
45
44
  if (statefulData) {
46
- const { supportedStates, allStates } = statefulData;
47
- if (supportedStates.size) {
45
+ const { supportedStates, allStates, staticClassname } = statefulData;
46
+ if (supportedStates.size || staticClassname) {
48
47
  const computedStates = [];
49
48
  let addedStateFunc = false;
50
49
  for (const state of allStates) if (typeof state === "string") {
@@ -78,6 +77,15 @@ function createVueFunctionalComponent(data, options) {
78
77
  }
79
78
  }
80
79
  }
80
+ if (staticClassname) {
81
+ const state = "static";
82
+ props[state] = {
83
+ type: "boolean",
84
+ value: state,
85
+ template: ""
86
+ };
87
+ computedStates.push(`'${state}': props['${state}']`);
88
+ }
81
89
  if (computedStates.length) {
82
90
  componentCode.push(`const states = computed(() => ({ ${computedStates.join(", ")} }));`);
83
91
  if (fallback && statefulData.fallback) {
@@ -161,5 +169,4 @@ function createVueFunctionalComponent(data, options) {
161
169
  dependencies: dependencies.size ? dependencies : void 0
162
170
  };
163
171
  }
164
-
165
- export { createVueFunctionalComponent };
172
+ export { createVueFunctionalComponent };
@@ -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 { addVueComponentTypes } from "./helpers/ts/vue.js";
17
-
18
17
  /**
19
18
  * Create Vue component code
20
19
  */
@@ -44,8 +43,8 @@ function createVueComponent(data, options) {
44
43
  if (!fallback) props.xmlns = "http://www.w3.org/2000/svg";
45
44
  let computedFallback = false;
46
45
  if (statefulData) {
47
- const { supportedStates, allStates } = statefulData;
48
- if (supportedStates.size) {
46
+ const { supportedStates, allStates, staticClassname } = statefulData;
47
+ if (supportedStates.size || staticClassname) {
49
48
  const computedStates = [];
50
49
  let addedStateFunc = false;
51
50
  for (const state of allStates) if (typeof state === "string") {
@@ -79,6 +78,15 @@ function createVueComponent(data, options) {
79
78
  }
80
79
  }
81
80
  }
81
+ if (staticClassname) {
82
+ const state = "static";
83
+ props[state] = {
84
+ type: "boolean",
85
+ value: state,
86
+ template: ""
87
+ };
88
+ computedStates.push(`'${state}': props['${state}']`);
89
+ }
82
90
  if (computedStates.length) {
83
91
  componentCode.push(`const states = computed(() => ({ ${computedStates.join(", ")} }));`);
84
92
  if (fallback && statefulData.fallback) {
@@ -163,5 +171,4 @@ ${template}
163
171
  dependencies: dependencies.size ? dependencies : void 0
164
172
  };
165
173
  }
166
-
167
- export { createVueComponent };
174
+ export { createVueComponent };
@@ -1,5 +1,4 @@
1
1
  import { findCSSPropertyValues } from "./prop.js";
2
-
3
2
  const reservedAnimationNames = new Set([
4
3
  "none",
5
4
  "inherit",
@@ -31,5 +30,4 @@ function findUsedKeyframes(content) {
31
30
  });
32
31
  return Array.from(keyframes);
33
32
  }
34
-
35
- export { findUsedKeyframes };
33
+ export { findUsedKeyframes };
@@ -1,5 +1,4 @@
1
1
  import { splitClassName } from "../../classname/toggle.js";
2
-
3
2
  /**
4
3
  * Find class names in content
5
4
  */
@@ -10,5 +9,4 @@ function findUsedClassNames(content) {
10
9
  });
11
10
  return Array.from(classNames);
12
11
  }
13
-
14
- export { findUsedClassNames };
12
+ export { findUsedClassNames };
@@ -8,5 +8,4 @@ function findCSSPropertyValues(content, property) {
8
8
  });
9
9
  return values;
10
10
  }
11
-
12
- export { findCSSPropertyValues };
11
+ export { findCSSPropertyValues };
package/lib/css/hash.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { sortObject } from "../helpers/misc/sort-object.js";
2
2
  import { getUniqueHash } from "../helpers/hash/unique.js";
3
-
4
3
  /**
5
4
  * Get class name for CSS rules
6
5
  */
@@ -11,5 +10,4 @@ function createCSSClassName(rules, options) {
11
10
  ...options
12
11
  });
13
12
  }
14
-
15
- export { createCSSClassName };
13
+ export { createCSSClassName };
package/lib/css/minify.js CHANGED
@@ -1,5 +1,4 @@
1
1
  function minifyCSS(value) {
2
2
  return value.replace(/\s+/g, " ").replace(/\s*([;:{}])\s*/g, "$1").replace(/;}/g, "}").trim();
3
3
  }
4
-
5
- export { minifyCSS };
4
+ export { minifyCSS };
package/lib/css/rules.js CHANGED
@@ -22,5 +22,4 @@ function mergeCSSRules(rules, oldRules) {
22
22
  ...splitCSSRules(rules)
23
23
  };
24
24
  }
25
-
26
- export { mergeCSSRules, splitCSSRules };
25
+ export { mergeCSSRules, splitCSSRules };
@@ -50,5 +50,4 @@ function stringifyCSSKeyframes(animationName, keyframes, depth = 0) {
50
50
  if (content.includes("@keyframes")) return content;
51
51
  return `${indent(depth)}@keyframes ${animationName} {\n${indent(depth + 1)}${content}\n}\n`;
52
52
  }
53
-
54
- export { stringifyCSSAnimationFrames, stringifyCSSKeyframes, stringifyCSSRules, stringifyCSSSelector };
53
+ export { stringifyCSSAnimationFrames, stringifyCSSKeyframes, stringifyCSSRules, stringifyCSSSelector };
@@ -1,6 +1,5 @@
1
1
  import { stringifyCSSKeyframes, stringifyCSSSelector } from "./stringify.js";
2
2
  import { mergeCSSRules } from "./rules.js";
3
-
4
3
  /**
5
4
  * Create empty stylesheet
6
5
  */
@@ -65,5 +64,4 @@ function stringifyStylesheet(stylesheet) {
65
64
  }
66
65
  return lines.join("\n");
67
66
  }
68
-
69
- export { addGeneratedSelector, createEmptyStylesheet, stringifyStylesheet };
67
+ export { addGeneratedSelector, createEmptyStylesheet, stringifyStylesheet };
package/lib/css/types.js CHANGED
@@ -1 +1 @@
1
- export { };
1
+ export {};
@@ -34,5 +34,4 @@ function compactItem(context, stringifiedValue, parent, key, actualValue) {
34
34
  });
35
35
  parent[key] = value;
36
36
  }
37
-
38
- export { compactItem, createCompactContext };
37
+ export { compactItem, createCompactContext };
@@ -5,5 +5,4 @@ function expandItem(list, parent, key) {
5
5
  const index = parent[key];
6
6
  if (typeof index === "number" && list[index]) parent[key] = list[index];
7
7
  }
8
-
9
- export { expandItem };
8
+ export { expandItem };
@@ -4,5 +4,4 @@
4
4
  function createUniqueHashContext() {
5
5
  return { cache: Object.create(null) };
6
6
  }
7
-
8
- export { createUniqueHashContext };
7
+ export { createUniqueHashContext };
@@ -14,5 +14,4 @@ function hashString(str, seed = 0) {
14
14
  h2 ^= Math.imul(h1 ^ h1 >>> 13, 3266489909);
15
15
  return [h2 >>> 0, h1 >>> 0];
16
16
  }
17
-
18
- export { hashString };
17
+ export { hashString };
@@ -28,5 +28,4 @@ function hashToString(value, css, hasPrefix = true, limit = 8) {
28
28
  num = Math.floor(num / letterRadix);
29
29
  }
30
30
  }
31
-
32
- export { hashToString };
31
+ export { hashToString };
@@ -1 +1 @@
1
- export { };
1
+ export {};
@@ -1,7 +1,6 @@
1
1
  import { sortObject } from "../misc/sort-object.js";
2
2
  import { hashToString } from "./stringify.js";
3
3
  import { hashString } from "./hash.js";
4
-
5
4
  /**
6
5
  * Hash an object, make sure hash is unique
7
6
  *
@@ -35,5 +34,4 @@ function getUniqueHash(data, options) {
35
34
  }
36
35
  return result;
37
36
  }
38
-
39
- export { getUniqueHash };
37
+ export { getUniqueHash };
@@ -4,5 +4,4 @@
4
4
  function cloneObject(item) {
5
5
  return JSON.parse(JSON.stringify(item));
6
6
  }
7
-
8
- export { cloneObject };
7
+ export { cloneObject };
@@ -1,5 +1,4 @@
1
1
  import { sortObject } from "./sort-object.js";
2
-
3
2
  /**
4
3
  * Compare sets, returns true if identical
5
4
  */
@@ -15,5 +14,4 @@ function compareSets(set1, set2) {
15
14
  function compareValues(value1, value2) {
16
15
  return value1 === value2 || JSON.stringify(sortObject(value1)) === JSON.stringify(sortObject(value2));
17
16
  }
18
-
19
- export { compareSets, compareValues };
17
+ export { compareSets, compareValues };
@@ -1,5 +1,4 @@
1
1
  import { sortObject } from "./sort-object.js";
2
-
3
2
  /**
4
3
  * Compare keys, return true on match
5
4
  */
@@ -8,5 +7,4 @@ function compareKeys(key1, key2) {
8
7
  if (typeof key1 !== "object" || typeof key2 !== "object" || !key1 || !key2) return false;
9
8
  return JSON.stringify(sortObject(key1)) === JSON.stringify(sortObject(key2));
10
9
  }
11
-
12
- export { compareKeys };
10
+ export { compareKeys };
@@ -1,5 +1,4 @@
1
1
  import { compareKeys } from "./keys.js";
2
-
3
2
  let cache = [];
4
3
  /**
5
4
  * Make sure multiple instances of Promise or callback are not ran at the same time
@@ -46,5 +45,4 @@ function uniquePromise(key, callback) {
46
45
  else done(true, cb);
47
46
  });
48
47
  }
49
-
50
- export { uniquePromise };
48
+ export { uniquePromise };
@@ -17,5 +17,4 @@ function sortObject(data) {
17
17
  for (const key of keys) newObject[key] = sortObject(data[key]);
18
18
  return newObject;
19
19
  }
20
-
21
- export { sortObject };
20
+ export { sortObject };
@@ -23,5 +23,4 @@ function camelToKebab(key) {
23
23
  function snakelize(str) {
24
24
  return camelToKebab(str).replace(/-/g, "_");
25
25
  }
26
-
27
- export { camelToKebab, camelize, pascalize, snakelize };
26
+ export { camelToKebab, camelize, pascalize, snakelize };
@@ -1,3 +1,2 @@
1
1
  const prefersReduceMotion = "@media not (prefers-reduced-motion)";
2
-
3
- export { prefersReduceMotion };
2
+ export { prefersReduceMotion };
@@ -1,5 +1,4 @@
1
1
  import { wrapSVGContent } from "../../svg/content/defs.js";
2
-
3
2
  /**
4
3
  * Normalise icon: apply transformations
5
4
  */
@@ -59,5 +58,4 @@ function normaliseIconifyIcon(data) {
59
58
  viewBox
60
59
  };
61
60
  }
62
-
63
- export { normaliseIconifyIcon };
61
+ export { normaliseIconifyIcon };
@@ -1 +1 @@
1
- export { };
1
+ export {};
@@ -15,5 +15,4 @@ function getIconifyIconSetDefaults(data) {
15
15
  }
16
16
  return defaultValues;
17
17
  }
18
-
19
- export { getIconifyIconSetDefaults };
18
+ export { getIconifyIconSetDefaults };
@@ -1,5 +1,4 @@
1
1
  import { getIconifyIconSetDefaults } from "./defaults.js";
2
-
3
2
  /**
4
3
  * Get icon data from Iconify icon set
5
4
  */
@@ -20,5 +19,4 @@ function getIconifyIconSetIcon(data, name) {
20
19
  } : null;
21
20
  }
22
21
  }
23
-
24
- export { getIconifyIconSetIcon };
22
+ export { getIconifyIconSetIcon };
@@ -1,5 +1,4 @@
1
1
  import { getIconifyIconSetDefaults } from "./defaults.js";
2
-
3
2
  /**
4
3
  * Parse Iconify icon set and call callback for each icon
5
4
  */
@@ -27,5 +26,4 @@ function parseIconifyIconSet(data, callback) {
27
26
  }
28
27
  if (data.not_found) for (const name of data.not_found) callback(name, null);
29
28
  }
30
-
31
- export { parseIconifyIconSet };
29
+ export { parseIconifyIconSet };
@@ -1 +1 @@
1
- export { };
1
+ export {};
package/lib/index.js CHANGED
@@ -31,5 +31,4 @@ import { getObjectFromStates } from "./svg-css/states/object.js";
31
31
  import { getSVGCSSIconFromIconSet } from "./svg-css/icon-set/get.js";
32
32
  import { addIconToSVGCSSIconSet } from "./svg-css/icon-set/add.js";
33
33
  import { createEmptySVGCSSIconSet } from "./svg-css/icon-set/create.js";
34
-
35
- export { addGeneratedSelector, addIconToSVGCSSIconSet, changeIDInString, changeSVGIDs, classProps, cloneObject, compareKeys, compareSets, compareValues, convertSVGContentToCSSRules, convertSVGRootToCSS, createCSSClassName, createEmptySVGCSSIconSet, createEmptyStylesheet, createUniqueHashContext, createUniqueIDs, defaultClassProp, getAdvancedStateDefaultValue, getIconFallback, getObjectFromStates, getSVGCSSIconFromIconSet, getStateValue, getStatesFromKey, getUniqueHash, hashString, hashToString, iterateXMLContent, mergeCSSRules, minifyCSS, parseXMLContent, removeDuplicateIDs, removeUnusedIDs, sortObject, splitCSSRules, splitClassName, stringifyCSSAnimationFrames, stringifyCSSKeyframes, stringifyCSSRules, stringifyCSSSelector, stringifyStylesheet, stringifyXMLContent, toggleClassName, uniquePromise };
34
+ export { addGeneratedSelector, addIconToSVGCSSIconSet, changeIDInString, changeSVGIDs, classProps, cloneObject, compareKeys, compareSets, compareValues, convertSVGContentToCSSRules, convertSVGRootToCSS, createCSSClassName, createEmptySVGCSSIconSet, createEmptyStylesheet, createUniqueHashContext, createUniqueIDs, defaultClassProp, getAdvancedStateDefaultValue, getIconFallback, getObjectFromStates, getSVGCSSIconFromIconSet, getStateValue, getStatesFromKey, getUniqueHash, hashString, hashToString, iterateXMLContent, mergeCSSRules, minifyCSS, parseXMLContent, removeDuplicateIDs, removeUnusedIDs, sortObject, splitCSSRules, splitClassName, stringifyCSSAnimationFrames, stringifyCSSKeyframes, stringifyCSSRules, stringifyCSSSelector, stringifyStylesheet, stringifyXMLContent, toggleClassName, uniquePromise };
@@ -40,5 +40,4 @@ function wrapSVGContent(body, start, end) {
40
40
  const split = splitSVGDefs(body);
41
41
  return mergeDefsAndContent(split.defs, start + split.content + end);
42
42
  }
43
-
44
- export { mergeDefsAndContent, splitSVGDefs, wrapSVGContent };
43
+ export { mergeDefsAndContent, splitSVGDefs, wrapSVGContent };
@@ -1,7 +1,6 @@
1
1
  import { iterateXMLContent } from "../../xml/iterate.js";
2
2
  import { stringifyXMLContent } from "../../xml/stringify.js";
3
3
  import { changeIDInString } from "./string.js";
4
-
5
4
  /**
6
5
  * Change IDs in SVG using a callback function
7
6
  */
@@ -113,5 +112,4 @@ function changeSVGIDs(root, callback) {
113
112
  }
114
113
  return results;
115
114
  }
116
-
117
- export { changeSVGIDs };
115
+ export { changeSVGIDs };
@@ -1,5 +1,4 @@
1
1
  import { iterateXMLContent } from "../../xml/iterate.js";
2
-
3
2
  /**
4
3
  * Remove duplicate IDs from SVG
5
4
  */
@@ -18,5 +17,4 @@ function removeDuplicateIDs(root, data) {
18
17
  }
19
18
  return root;
20
19
  }
21
-
22
- export { removeDuplicateIDs };
20
+ export { removeDuplicateIDs };
@@ -5,5 +5,4 @@ function changeIDInString(value, oldID, newID) {
5
5
  const escapedID = oldID.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
6
6
  return value.replace(new RegExp("([#;\"])(" + escapedID + ")([\")]|\\.[a-z])", "g"), "$1" + newID + "$3");
7
7
  }
8
-
9
- export { changeIDInString };
8
+ export { changeIDInString };
@@ -1 +1 @@
1
- export { };
1
+ export {};
@@ -1,6 +1,5 @@
1
1
  import { getUniqueHash } from "../../helpers/hash/unique.js";
2
2
  import { changeSVGIDs } from "./change.js";
3
-
4
3
  /**
5
4
  * Create unique IDs for SVG elements
6
5
  */
@@ -12,5 +11,4 @@ function createUniqueIDs(root, options) {
12
11
  ...options
13
12
  }));
14
13
  }
15
-
16
- export { createUniqueIDs };
14
+ export { createUniqueIDs };
@@ -1,5 +1,4 @@
1
1
  import { iterateXMLContent } from "../../xml/iterate.js";
2
-
3
2
  /**
4
3
  * Remove duplicate IDs from SVG
5
4
  */
@@ -20,5 +19,4 @@ function removeUnusedIDs(root, data) {
20
19
  });
21
20
  return root;
22
21
  }
23
-
24
- export { removeUnusedIDs };
22
+ export { removeUnusedIDs };
@@ -30,5 +30,4 @@ function calculateSize(size, ratio, precision) {
30
30
  isNumber = !isNumber;
31
31
  }
32
32
  }
33
-
34
- export { calculateSize };
33
+ export { calculateSize };
@@ -4,5 +4,4 @@
4
4
  function stringifyProps(props) {
5
5
  return Object.entries(props).map(([key, value]) => `${key}="${value}"`).join(" ");
6
6
  }
7
-
8
- export { stringifyProps };
7
+ export { stringifyProps };
@@ -11,5 +11,4 @@ function minifyViewBox(viewBox) {
11
11
  if (viewBox.cx && viewBox.cx * 2 !== viewBox.width) result.cx = viewBox.cx;
12
12
  return result;
13
13
  }
14
-
15
- export { minifyViewBox };
14
+ export { minifyViewBox };
@@ -13,5 +13,4 @@ function parseViewBox(value) {
13
13
  height: nums[3]
14
14
  };
15
15
  }
16
-
17
- export { parseViewBox };
16
+ export { parseViewBox };
@@ -20,5 +20,4 @@ function makeSquareViewBox(viewBox) {
20
20
  height
21
21
  };
22
22
  }
23
-
24
- export { makeSquareViewBox };
23
+ export { makeSquareViewBox };
@@ -1 +1 @@
1
- export { };
1
+ export {};
@@ -4,5 +4,4 @@
4
4
  function stringifyIconViewBox(viewBox) {
5
5
  return `${viewBox.left ?? 0} ${viewBox.top ?? 0} ${viewBox.width} ${viewBox.height}`;
6
6
  }
7
-
8
- export { stringifyIconViewBox };
7
+ export { stringifyIconViewBox };
@@ -1,7 +1,6 @@
1
1
  import { parseXMLContent } from "../xml/parse.js";
2
2
  import { stringifyXMLContent } from "../xml/stringify.js";
3
3
  import { convertSVGRootToCSS } from "./root.js";
4
-
5
4
  /**
6
5
  * Convert SVG content string to SVG+CSS
7
6
  */
@@ -18,5 +17,4 @@ function convertSVGContentToCSSRules(content, options) {
18
17
  }
19
18
  return { content };
20
19
  }
21
-
22
- export { convertSVGContentToCSSRules };
20
+ export { convertSVGContentToCSSRules };
@@ -1,7 +1,6 @@
1
1
  import { addGeneratedSelector, createEmptyStylesheet } from "../../css/stylesheet.js";
2
2
  import { prefersReduceMotion } from "../../helpers/reduce-motion.js";
3
3
  import { getSelectorsForStateValues } from "../states/selector/parse.js";
4
-
5
4
  /**
6
5
  * Add styles for stateful icon to stylesheet
7
6
  *
@@ -19,7 +18,11 @@ function renderStatefulSVGCSSIconStyle(icon, context, commonStylesheet = createE
19
18
  return stylesheets[className];
20
19
  };
21
20
  for (const className in icon.classes) addGeneratedSelector(getStylesheet(className), [`.${className}`], icon.classes[className]);
22
- for (const className in icon.animations) addGeneratedSelector(getStylesheet(className), [prefersReduceMotion, `.${className}`], icon.animations[className]);
21
+ for (const className in icon.animations) {
22
+ const tree = [prefersReduceMotion];
23
+ if (context?.staticClassname) tree.push(`svg:not(.${context.staticClassname})`);
24
+ addGeneratedSelector(getStylesheet(className), [...tree, `.${className}`], icon.animations[className]);
25
+ }
23
26
  for (const keyframeName in icon.keyframes) getStylesheet(keyframeName).keyframes[keyframeName] = icon.keyframes[keyframeName];
24
27
  if (context) for (const className in icon.statefulClasses) {
25
28
  const baseClassName = `.${className}`;
@@ -53,5 +56,4 @@ function renderStatefulSVGCSSIconStyle(icon, context, commonStylesheet = createE
53
56
  function renderSVGCSSIconStyle(icon, commonStylesheet) {
54
57
  return renderStatefulSVGCSSIconStyle(icon, null, commonStylesheet);
55
58
  }
56
-
57
- export { renderSVGCSSIconStyle, renderStatefulSVGCSSIconStyle };
59
+ export { renderSVGCSSIconStyle, renderStatefulSVGCSSIconStyle };
@@ -1 +1 @@
1
- export { };
1
+ export {};
@@ -1,7 +1,6 @@
1
1
  import { stringifyCSSAnimationFrames, stringifyCSSRules } from "../../css/stringify.js";
2
2
  import { minifyCSS } from "../../css/minify.js";
3
3
  import { expandSVGCSSIconSetFallback } from "./minify/expand.js";
4
-
5
4
  function minifyRules(value) {
6
5
  return (value ? minifyCSS(typeof value === "string" ? value : stringifyCSSRules(value)) : void 0) || void 0;
7
6
  }
@@ -56,5 +55,4 @@ function addIconToSVGCSSIconSet(iconSet, iconName, icon) {
56
55
  }
57
56
  }
58
57
  }
59
-
60
- export { addIconToSVGCSSIconSet };
58
+ export { addIconToSVGCSSIconSet };
@@ -7,5 +7,4 @@ function createEmptySVGCSSIconSet() {
7
7
  icons: Object.create(null)
8
8
  };
9
9
  }
10
-
11
- export { createEmptySVGCSSIconSet };
10
+ export { createEmptySVGCSSIconSet };
@@ -1,7 +1,6 @@
1
1
  import { findUsedKeyframes } from "../../css/find/animations.js";
2
2
  import { findUsedClassNames } from "../../css/find/classname.js";
3
3
  import { expandSVGCSSIconSetClass } from "./minify/expand.js";
4
-
5
4
  function getSVGCSSIconFromIconSet(iconSet, name) {
6
5
  const fullName = iconSet.aliases?.[name] || name;
7
6
  const data = iconSet.icons[fullName];
@@ -88,5 +87,4 @@ function getSVGCSSIconFromIconSet(iconSet, name) {
88
87
  }
89
88
  return result;
90
89
  }
91
-
92
- export { getSVGCSSIconFromIconSet };
90
+ export { getSVGCSSIconFromIconSet };
@@ -1,6 +1,5 @@
1
1
  import { expandItem } from "../../../helpers/data/expand.js";
2
2
  import { iconSetMinifySimpleKeys, iconSetMinifyStatefulKeys } from "./keys.js";
3
-
4
3
  /**
5
4
  * Expand class content from icon set
6
5
  */
@@ -46,5 +45,4 @@ function expandSVGCSSIconSet(iconSet) {
46
45
  delete iconSet.css;
47
46
  }
48
47
  }
49
-
50
- export { expandSVGCSSIconSet, expandSVGCSSIconSetClass, expandSVGCSSIconSetFallback };
48
+ export { expandSVGCSSIconSet, expandSVGCSSIconSetClass, expandSVGCSSIconSetFallback };
@@ -5,5 +5,4 @@ const iconSetMinifySimpleKeys = [
5
5
  ];
6
6
  const iconSetMinifyStatefulKeys = ["sr", "st"];
7
7
  const iconSetMinifyKeys = [...iconSetMinifySimpleKeys, ...iconSetMinifyStatefulKeys];
8
-
9
- export { iconSetMinifyKeys, iconSetMinifySimpleKeys, iconSetMinifyStatefulKeys };
8
+ export { iconSetMinifyKeys, iconSetMinifySimpleKeys, iconSetMinifyStatefulKeys };
@@ -1,7 +1,6 @@
1
1
  import { iconSetMinifyKeys, iconSetMinifySimpleKeys, iconSetMinifyStatefulKeys } from "./keys.js";
2
2
  import { stringifyIconViewBox } from "../../../svg/viewbox/value.js";
3
3
  import { compactItem, createCompactContext } from "../../../helpers/data/compact.js";
4
-
5
4
  /**
6
5
  * Create context for minification
7
6
  */
@@ -97,5 +96,4 @@ function minifySVGCSSIconSet(iconSet) {
97
96
  }
98
97
  }
99
98
  }
100
-
101
- export { createIconSetMinifyContext, minifySVGCSSIconSet };
99
+ export { createIconSetMinifyContext, minifySVGCSSIconSet };