@semcore/illustration 2.29.0 → 2.30.0-prerelease.0

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 (158) hide show
  1. package/AccessDenied/index.d.ts +27 -3
  2. package/AccessDenied/index.js +211 -205
  3. package/AccessDenied/index.mjs +211 -205
  4. package/AccessLogIn/index.d.ts +27 -3
  5. package/AccessLogIn/index.js +313 -307
  6. package/AccessLogIn/index.mjs +313 -307
  7. package/AreaChart/index.d.ts +27 -3
  8. package/AreaChart/index.js +58 -52
  9. package/AreaChart/index.mjs +58 -52
  10. package/Blocked/index.d.ts +27 -3
  11. package/Blocked/index.js +462 -456
  12. package/Blocked/index.mjs +462 -456
  13. package/CHANGELOG.md +11 -1
  14. package/ChoroplethMapChart/index.d.ts +27 -3
  15. package/ChoroplethMapChart/index.js +80 -74
  16. package/ChoroplethMapChart/index.mjs +80 -74
  17. package/Coffee/index.d.ts +27 -3
  18. package/Coffee/index.js +65 -59
  19. package/Coffee/index.mjs +65 -59
  20. package/Collection/index.d.ts +27 -3
  21. package/Collection/index.js +59 -53
  22. package/Collection/index.mjs +59 -53
  23. package/CombinedChart/index.d.ts +27 -3
  24. package/CombinedChart/index.js +87 -81
  25. package/CombinedChart/index.mjs +87 -81
  26. package/Confirmation/index.d.ts +27 -3
  27. package/Confirmation/index.js +236 -230
  28. package/Confirmation/index.mjs +236 -230
  29. package/Congrats/index.d.ts +27 -3
  30. package/Congrats/index.js +116 -110
  31. package/Congrats/index.mjs +116 -110
  32. package/ConnectionLost/index.d.ts +27 -3
  33. package/ConnectionLost/index.js +268 -262
  34. package/ConnectionLost/index.mjs +268 -262
  35. package/DeletedAccount/index.d.ts +27 -3
  36. package/DeletedAccount/index.js +345 -339
  37. package/DeletedAccount/index.mjs +345 -339
  38. package/DeletedPage/index.d.ts +27 -3
  39. package/DeletedPage/index.js +50 -44
  40. package/DeletedPage/index.mjs +50 -44
  41. package/Dns/index.d.ts +27 -3
  42. package/Dns/index.js +149 -143
  43. package/Dns/index.mjs +149 -143
  44. package/DonutChart/index.d.ts +27 -3
  45. package/DonutChart/index.js +100 -94
  46. package/DonutChart/index.mjs +100 -94
  47. package/Duplicates/index.d.ts +27 -3
  48. package/Duplicates/index.js +77 -71
  49. package/Duplicates/index.mjs +77 -71
  50. package/Feedback/index.d.ts +27 -3
  51. package/Feedback/index.js +65 -59
  52. package/Feedback/index.mjs +65 -59
  53. package/FunnelChart/index.d.ts +27 -3
  54. package/FunnelChart/index.js +67 -61
  55. package/FunnelChart/index.mjs +67 -61
  56. package/Good/index.d.ts +27 -3
  57. package/Good/index.js +100 -94
  58. package/Good/index.mjs +100 -94
  59. package/HeatMapChart/index.d.ts +27 -3
  60. package/HeatMapChart/index.js +85 -79
  61. package/HeatMapChart/index.mjs +85 -79
  62. package/HorizontalBarChart/index.d.ts +27 -3
  63. package/HorizontalBarChart/index.js +71 -65
  64. package/HorizontalBarChart/index.mjs +71 -65
  65. package/KagiChart/index.d.ts +27 -3
  66. package/KagiChart/index.js +52 -46
  67. package/KagiChart/index.mjs +52 -46
  68. package/LineChart/index.d.ts +27 -3
  69. package/LineChart/index.js +55 -49
  70. package/LineChart/index.mjs +55 -49
  71. package/LollipopChart/index.d.ts +27 -3
  72. package/LollipopChart/index.js +72 -66
  73. package/LollipopChart/index.mjs +72 -66
  74. package/MailSent/index.d.ts +27 -3
  75. package/MailSent/index.js +111 -105
  76. package/MailSent/index.mjs +111 -105
  77. package/Maintenance/index.d.ts +27 -3
  78. package/Maintenance/index.js +332 -326
  79. package/Maintenance/index.mjs +332 -326
  80. package/Nexttime/index.d.ts +27 -3
  81. package/Nexttime/index.js +79 -73
  82. package/Nexttime/index.mjs +79 -73
  83. package/NoPayment/index.d.ts +27 -3
  84. package/NoPayment/index.js +273 -267
  85. package/NoPayment/index.mjs +273 -267
  86. package/NothingFound/index.d.ts +27 -3
  87. package/NothingFound/index.js +103 -97
  88. package/NothingFound/index.mjs +103 -97
  89. package/OtherData/index.d.ts +27 -3
  90. package/OtherData/index.js +86 -80
  91. package/OtherData/index.mjs +86 -80
  92. package/PageError/index.d.ts +27 -3
  93. package/PageError/index.js +193 -187
  94. package/PageError/index.mjs +193 -187
  95. package/PageNotFound/index.d.ts +27 -3
  96. package/PageNotFound/index.js +253 -247
  97. package/PageNotFound/index.mjs +253 -247
  98. package/PieChart/index.d.ts +27 -3
  99. package/PieChart/index.js +85 -79
  100. package/PieChart/index.mjs +85 -79
  101. package/Processing/index.d.ts +27 -3
  102. package/Processing/index.js +65 -59
  103. package/Processing/index.mjs +65 -59
  104. package/ProjectNotFound/index.d.ts +27 -3
  105. package/ProjectNotFound/index.js +216 -210
  106. package/ProjectNotFound/index.mjs +216 -210
  107. package/RadarChart/index.d.ts +27 -3
  108. package/RadarChart/index.js +64 -58
  109. package/RadarChart/index.mjs +64 -58
  110. package/RadialTreeChart/index.d.ts +27 -3
  111. package/RadialTreeChart/index.js +106 -100
  112. package/RadialTreeChart/index.mjs +106 -100
  113. package/SankeyChart/index.d.ts +27 -3
  114. package/SankeyChart/index.js +92 -86
  115. package/SankeyChart/index.mjs +92 -86
  116. package/ScatterPlotChart/index.d.ts +27 -3
  117. package/ScatterPlotChart/index.js +77 -71
  118. package/ScatterPlotChart/index.mjs +77 -71
  119. package/StackedAreaChart/index.d.ts +27 -3
  120. package/StackedAreaChart/index.js +79 -73
  121. package/StackedAreaChart/index.mjs +79 -73
  122. package/Suggestion/index.d.ts +27 -3
  123. package/Suggestion/index.js +63 -57
  124. package/Suggestion/index.mjs +63 -57
  125. package/Suggestions/index.d.ts +27 -3
  126. package/Suggestions/index.js +66 -60
  127. package/Suggestions/index.mjs +66 -60
  128. package/Table/index.d.ts +27 -3
  129. package/Table/index.js +50 -44
  130. package/Table/index.mjs +50 -44
  131. package/TagCloud/index.d.ts +27 -3
  132. package/TagCloud/index.js +77 -71
  133. package/TagCloud/index.mjs +77 -71
  134. package/TextLinksEtc/index.d.ts +27 -3
  135. package/TextLinksEtc/index.js +53 -47
  136. package/TextLinksEtc/index.mjs +53 -47
  137. package/Timeout/index.d.ts +27 -3
  138. package/Timeout/index.js +350 -344
  139. package/Timeout/index.mjs +350 -344
  140. package/UnderConstruction/index.d.ts +27 -3
  141. package/UnderConstruction/index.js +112 -106
  142. package/UnderConstruction/index.mjs +112 -106
  143. package/VennChart/index.d.ts +27 -3
  144. package/VennChart/index.js +78 -72
  145. package/VennChart/index.mjs +78 -72
  146. package/VerticalBarChart/index.d.ts +27 -3
  147. package/VerticalBarChart/index.js +72 -66
  148. package/VerticalBarChart/index.mjs +72 -66
  149. package/Waiting/index.d.ts +27 -3
  150. package/Waiting/index.js +65 -59
  151. package/Waiting/index.mjs +65 -59
  152. package/Warning/index.d.ts +27 -3
  153. package/Warning/index.js +60 -54
  154. package/Warning/index.mjs +60 -54
  155. package/lib/cjs/index.js +1 -1
  156. package/lib/es6/index.js +1 -1
  157. package/package.json +4 -3
  158. package/transform.ts +108 -16
package/Warning/index.js CHANGED
@@ -26,59 +26,65 @@ module.exports = __toCommonJS(stdin_exports);
26
26
  var import_react = __toESM(require("react"));
27
27
  var import_core = require("@semcore/core");
28
28
  var import_flex_box = require("@semcore/flex-box");
29
- const Warning = ({ fill = "none", width = "80", height = "80", viewBox = "0 0 80 80", ...props }, ref) => /* @__PURE__ */ import_react.default.createElement(import_flex_box.Box, {
30
- ref,
31
- width,
32
- height,
33
- viewBox,
34
- fill,
35
- tag: "svg",
36
- ...props
37
- }, /* @__PURE__ */ import_react.default.createElement("path", {
38
- d: "M40.51 79.997C62.49 79.714 79.977 61.39 79.977 39.4V.99a.994.994 0 0 0-.99-.99H54.306a.994.994 0 0 0-.99.99v2.753H27.638a.994.994 0 0 0-.99.99v35.265H.991A.985.985 0 0 0 0 41.01c.544 21.806 18.52 39.27 40.52 38.987",
39
- fill: "#E0E1E9"
40
- }), /* @__PURE__ */ import_react.default.createElement("path", {
41
- d: "M66.16 57.374s.087-.054.12-.087l6.521-4.323-3.147-1.697-3.147.756-8.334-31.681a5.73 5.73 0 0 0-6.707-4.15l-39.74 8.063-1.4-3.124-3.428 5.88a6.507 6.507 0 0 0-.217.368v.021a5.618 5.618 0 0 0-.456 4.248l10.472 36.654a2.599 2.599 0 0 0 3.19 1.794l45.459-12.344c.271-.076.52-.205.749-.346l.054-.032h.01Z",
42
- fill: "#E0E1E9",
43
- stroke: "#6C6E79",
44
- strokeLinecap: "round",
45
- strokeLinejoin: "round",
46
- strokeWidth: ".7"
47
- }), /* @__PURE__ */ import_react.default.createElement("path", {
48
- d: "M72.02 53.31 24.152 66.313a2.747 2.747 0 0 1-3.364-1.892L9.752 25.822c-.966-3.372 1.16-6.853 4.612-7.556l43.05-8.744c3.146-.638 6.25 1.286 7.053 4.377L73.95 49.98a2.729 2.729 0 0 1-1.931 3.33Z",
49
- fill: "#fff",
50
- stroke: "#6C6E79",
51
- strokeLinecap: "round",
52
- strokeLinejoin: "round",
53
- strokeWidth: ".7"
54
- }), /* @__PURE__ */ import_react.default.createElement("path", {
55
- d: "M65.682 18.57 11.076 30.512l-1.346-4.69c-.966-3.373 1.161-6.854 4.612-7.556l43.05-8.734c3.146-.638 6.25 1.286 7.053 4.378l1.226 4.669.011-.01Z",
56
- fill: "#6C6E79"
57
- }), /* @__PURE__ */ import_react.default.createElement("path", {
58
- d: "M18.433 23.174a1.873 1.873 0 0 1-1.421 2.367c-1.097.238-2.236-.454-2.54-1.524a1.868 1.868 0 0 1 1.433-2.367c1.096-.227 2.224.465 2.528 1.535v-.011Z",
59
- fill: "#fff"
60
- }), /* @__PURE__ */ import_react.default.createElement("path", {
61
- d: "M25.443 21.693c.293 1.06-.325 2.108-1.4 2.335-1.074.227-2.192-.454-2.485-1.524-.293-1.07.326-2.12 1.411-2.346 1.085-.227 2.181.465 2.474 1.524v.01Z",
62
- fill: "#E0E1E9"
63
- }), /* @__PURE__ */ import_react.default.createElement("path", {
64
- d: "M11.097 30.6s.326-3.157.608-6.389l-1.378-3.08-3.43 5.88a6.507 6.507 0 0 0-.216.367v.022a5.619 5.619 0 0 0-.456 4.248l1.4 4.908 3.472-5.967v.01Z",
65
- fill: "#6C6E79"
66
- }), /* @__PURE__ */ import_react.default.createElement("path", {
67
- d: "m40.481 27.976-7.447 28.427a.98.98 0 0 0 1.22 1.197l27.762-7.62c.73-.197.97-1.1.447-1.645L42.147 27.53c-.533-.545-1.47-.305-1.666.435v.01Z",
68
- fill: "#E0E1E9",
69
- stroke: "#6C6E79",
70
- strokeLinecap: "round",
71
- strokeLinejoin: "round",
72
- strokeWidth: ".7"
73
- }), /* @__PURE__ */ import_react.default.createElement("path", {
74
- d: "m43.443 35.477 2.373 8.645",
75
- stroke: "#6C6E79",
76
- strokeLinecap: "round",
77
- strokeLinejoin: "round",
78
- strokeWidth: "2"
79
- }), /* @__PURE__ */ import_react.default.createElement("path", {
80
- d: "M48.353 48.346c.185.675-.24 1.372-.947 1.557-.708.185-1.438-.196-1.623-.871-.185-.675.24-1.372.947-1.557.708-.185 1.427.207 1.612.871h.01Z",
81
- fill: "#6C6E79"
82
- }));
29
+ var import_useColorResolver = require("@semcore/utils/lib/use/useColorResolver");
30
+ const Warning = ({ fill = "none", width = "80", height = "80", viewBox = "0 0 80 80", primaryColor = "#E0E1E9", secondaryColor = "#6C6E79", ...props }, ref) => {
31
+ const colorResolver = (0, import_useColorResolver.useColorResolver)();
32
+ const resolvedPrimaryColor = colorResolver(primaryColor);
33
+ const resolvedSecondaryColor = colorResolver(secondaryColor);
34
+ return /* @__PURE__ */ import_react.default.createElement(import_flex_box.Box, {
35
+ ref,
36
+ width,
37
+ height,
38
+ viewBox,
39
+ fill,
40
+ tag: "svg",
41
+ ...props
42
+ }, /* @__PURE__ */ import_react.default.createElement("path", {
43
+ d: "M40.51 79.997C62.49 79.714 79.977 61.39 79.977 39.4V.99a.994.994 0 0 0-.99-.99H54.306a.994.994 0 0 0-.99.99v2.753H27.638a.994.994 0 0 0-.99.99v35.265H.991A.985.985 0 0 0 0 41.01c.544 21.806 18.52 39.27 40.52 38.987",
44
+ fill: resolvedPrimaryColor
45
+ }), /* @__PURE__ */ import_react.default.createElement("path", {
46
+ d: "M66.16 57.374s.087-.054.12-.087l6.521-4.323-3.147-1.697-3.147.756-8.334-31.681a5.73 5.73 0 0 0-6.707-4.15l-39.74 8.063-1.4-3.124-3.428 5.88a6.507 6.507 0 0 0-.217.368v.021a5.618 5.618 0 0 0-.456 4.248l10.472 36.654a2.599 2.599 0 0 0 3.19 1.794l45.459-12.344c.271-.076.52-.205.749-.346l.054-.032h.01Z",
47
+ fill: resolvedPrimaryColor,
48
+ stroke: resolvedSecondaryColor,
49
+ strokeLinecap: "round",
50
+ strokeLinejoin: "round",
51
+ strokeWidth: ".7"
52
+ }), /* @__PURE__ */ import_react.default.createElement("path", {
53
+ d: "M72.02 53.31 24.152 66.313a2.747 2.747 0 0 1-3.364-1.892L9.752 25.822c-.966-3.372 1.16-6.853 4.612-7.556l43.05-8.744c3.146-.638 6.25 1.286 7.053 4.377L73.95 49.98a2.729 2.729 0 0 1-1.931 3.33Z",
54
+ fill: "#fff",
55
+ stroke: resolvedSecondaryColor,
56
+ strokeLinecap: "round",
57
+ strokeLinejoin: "round",
58
+ strokeWidth: ".7"
59
+ }), /* @__PURE__ */ import_react.default.createElement("path", {
60
+ d: "M65.682 18.57 11.076 30.512l-1.346-4.69c-.966-3.373 1.161-6.854 4.612-7.556l43.05-8.734c3.146-.638 6.25 1.286 7.053 4.378l1.226 4.669.011-.01Z",
61
+ fill: resolvedSecondaryColor
62
+ }), /* @__PURE__ */ import_react.default.createElement("path", {
63
+ d: "M18.433 23.174a1.873 1.873 0 0 1-1.421 2.367c-1.097.238-2.236-.454-2.54-1.524a1.868 1.868 0 0 1 1.433-2.367c1.096-.227 2.224.465 2.528 1.535v-.011Z",
64
+ fill: "#fff"
65
+ }), /* @__PURE__ */ import_react.default.createElement("path", {
66
+ d: "M25.443 21.693c.293 1.06-.325 2.108-1.4 2.335-1.074.227-2.192-.454-2.485-1.524-.293-1.07.326-2.12 1.411-2.346 1.085-.227 2.181.465 2.474 1.524v.01Z",
67
+ fill: resolvedPrimaryColor
68
+ }), /* @__PURE__ */ import_react.default.createElement("path", {
69
+ d: "M11.097 30.6s.326-3.157.608-6.389l-1.378-3.08-3.43 5.88a6.507 6.507 0 0 0-.216.367v.022a5.619 5.619 0 0 0-.456 4.248l1.4 4.908 3.472-5.967v.01Z",
70
+ fill: resolvedSecondaryColor
71
+ }), /* @__PURE__ */ import_react.default.createElement("path", {
72
+ d: "m40.481 27.976-7.447 28.427a.98.98 0 0 0 1.22 1.197l27.762-7.62c.73-.197.97-1.1.447-1.645L42.147 27.53c-.533-.545-1.47-.305-1.666.435v.01Z",
73
+ fill: resolvedPrimaryColor,
74
+ stroke: resolvedSecondaryColor,
75
+ strokeLinecap: "round",
76
+ strokeLinejoin: "round",
77
+ strokeWidth: ".7"
78
+ }), /* @__PURE__ */ import_react.default.createElement("path", {
79
+ d: "m43.443 35.477 2.373 8.645",
80
+ stroke: resolvedSecondaryColor,
81
+ strokeLinecap: "round",
82
+ strokeLinejoin: "round",
83
+ strokeWidth: "2"
84
+ }), /* @__PURE__ */ import_react.default.createElement("path", {
85
+ d: "M48.353 48.346c.185.675-.24 1.372-.947 1.557-.708.185-1.438-.196-1.623-.871-.185-.675.24-1.372.947-1.557.708-.185 1.427.207 1.612.871h.01Z",
86
+ fill: resolvedSecondaryColor
87
+ }));
88
+ };
83
89
  Warning.displayName = "Warning";
84
90
  var stdin_default = (0, import_core.createBaseComponent)(Warning);
package/Warning/index.mjs CHANGED
@@ -1,60 +1,66 @@
1
1
  import React from "react";
2
2
  import { createBaseComponent } from "@semcore/core";
3
3
  import { Box } from "@semcore/flex-box";
4
- const Warning = ({ fill = "none", width = "80", height = "80", viewBox = "0 0 80 80", ...props }, ref) => /* @__PURE__ */ React.createElement(Box, {
5
- ref,
6
- width,
7
- height,
8
- viewBox,
9
- fill,
10
- tag: "svg",
11
- ...props
12
- }, /* @__PURE__ */ React.createElement("path", {
13
- d: "M40.51 79.997C62.49 79.714 79.977 61.39 79.977 39.4V.99a.994.994 0 0 0-.99-.99H54.306a.994.994 0 0 0-.99.99v2.753H27.638a.994.994 0 0 0-.99.99v35.265H.991A.985.985 0 0 0 0 41.01c.544 21.806 18.52 39.27 40.52 38.987",
14
- fill: "#E0E1E9"
15
- }), /* @__PURE__ */ React.createElement("path", {
16
- d: "M66.16 57.374s.087-.054.12-.087l6.521-4.323-3.147-1.697-3.147.756-8.334-31.681a5.73 5.73 0 0 0-6.707-4.15l-39.74 8.063-1.4-3.124-3.428 5.88a6.507 6.507 0 0 0-.217.368v.021a5.618 5.618 0 0 0-.456 4.248l10.472 36.654a2.599 2.599 0 0 0 3.19 1.794l45.459-12.344c.271-.076.52-.205.749-.346l.054-.032h.01Z",
17
- fill: "#E0E1E9",
18
- stroke: "#6C6E79",
19
- strokeLinecap: "round",
20
- strokeLinejoin: "round",
21
- strokeWidth: ".7"
22
- }), /* @__PURE__ */ React.createElement("path", {
23
- d: "M72.02 53.31 24.152 66.313a2.747 2.747 0 0 1-3.364-1.892L9.752 25.822c-.966-3.372 1.16-6.853 4.612-7.556l43.05-8.744c3.146-.638 6.25 1.286 7.053 4.377L73.95 49.98a2.729 2.729 0 0 1-1.931 3.33Z",
24
- fill: "#fff",
25
- stroke: "#6C6E79",
26
- strokeLinecap: "round",
27
- strokeLinejoin: "round",
28
- strokeWidth: ".7"
29
- }), /* @__PURE__ */ React.createElement("path", {
30
- d: "M65.682 18.57 11.076 30.512l-1.346-4.69c-.966-3.373 1.161-6.854 4.612-7.556l43.05-8.734c3.146-.638 6.25 1.286 7.053 4.378l1.226 4.669.011-.01Z",
31
- fill: "#6C6E79"
32
- }), /* @__PURE__ */ React.createElement("path", {
33
- d: "M18.433 23.174a1.873 1.873 0 0 1-1.421 2.367c-1.097.238-2.236-.454-2.54-1.524a1.868 1.868 0 0 1 1.433-2.367c1.096-.227 2.224.465 2.528 1.535v-.011Z",
34
- fill: "#fff"
35
- }), /* @__PURE__ */ React.createElement("path", {
36
- d: "M25.443 21.693c.293 1.06-.325 2.108-1.4 2.335-1.074.227-2.192-.454-2.485-1.524-.293-1.07.326-2.12 1.411-2.346 1.085-.227 2.181.465 2.474 1.524v.01Z",
37
- fill: "#E0E1E9"
38
- }), /* @__PURE__ */ React.createElement("path", {
39
- d: "M11.097 30.6s.326-3.157.608-6.389l-1.378-3.08-3.43 5.88a6.507 6.507 0 0 0-.216.367v.022a5.619 5.619 0 0 0-.456 4.248l1.4 4.908 3.472-5.967v.01Z",
40
- fill: "#6C6E79"
41
- }), /* @__PURE__ */ React.createElement("path", {
42
- d: "m40.481 27.976-7.447 28.427a.98.98 0 0 0 1.22 1.197l27.762-7.62c.73-.197.97-1.1.447-1.645L42.147 27.53c-.533-.545-1.47-.305-1.666.435v.01Z",
43
- fill: "#E0E1E9",
44
- stroke: "#6C6E79",
45
- strokeLinecap: "round",
46
- strokeLinejoin: "round",
47
- strokeWidth: ".7"
48
- }), /* @__PURE__ */ React.createElement("path", {
49
- d: "m43.443 35.477 2.373 8.645",
50
- stroke: "#6C6E79",
51
- strokeLinecap: "round",
52
- strokeLinejoin: "round",
53
- strokeWidth: "2"
54
- }), /* @__PURE__ */ React.createElement("path", {
55
- d: "M48.353 48.346c.185.675-.24 1.372-.947 1.557-.708.185-1.438-.196-1.623-.871-.185-.675.24-1.372.947-1.557.708-.185 1.427.207 1.612.871h.01Z",
56
- fill: "#6C6E79"
57
- }));
4
+ import { useColorResolver } from "@semcore/utils/lib/use/useColorResolver";
5
+ const Warning = ({ fill = "none", width = "80", height = "80", viewBox = "0 0 80 80", primaryColor = "#E0E1E9", secondaryColor = "#6C6E79", ...props }, ref) => {
6
+ const colorResolver = useColorResolver();
7
+ const resolvedPrimaryColor = colorResolver(primaryColor);
8
+ const resolvedSecondaryColor = colorResolver(secondaryColor);
9
+ return /* @__PURE__ */ React.createElement(Box, {
10
+ ref,
11
+ width,
12
+ height,
13
+ viewBox,
14
+ fill,
15
+ tag: "svg",
16
+ ...props
17
+ }, /* @__PURE__ */ React.createElement("path", {
18
+ d: "M40.51 79.997C62.49 79.714 79.977 61.39 79.977 39.4V.99a.994.994 0 0 0-.99-.99H54.306a.994.994 0 0 0-.99.99v2.753H27.638a.994.994 0 0 0-.99.99v35.265H.991A.985.985 0 0 0 0 41.01c.544 21.806 18.52 39.27 40.52 38.987",
19
+ fill: resolvedPrimaryColor
20
+ }), /* @__PURE__ */ React.createElement("path", {
21
+ d: "M66.16 57.374s.087-.054.12-.087l6.521-4.323-3.147-1.697-3.147.756-8.334-31.681a5.73 5.73 0 0 0-6.707-4.15l-39.74 8.063-1.4-3.124-3.428 5.88a6.507 6.507 0 0 0-.217.368v.021a5.618 5.618 0 0 0-.456 4.248l10.472 36.654a2.599 2.599 0 0 0 3.19 1.794l45.459-12.344c.271-.076.52-.205.749-.346l.054-.032h.01Z",
22
+ fill: resolvedPrimaryColor,
23
+ stroke: resolvedSecondaryColor,
24
+ strokeLinecap: "round",
25
+ strokeLinejoin: "round",
26
+ strokeWidth: ".7"
27
+ }), /* @__PURE__ */ React.createElement("path", {
28
+ d: "M72.02 53.31 24.152 66.313a2.747 2.747 0 0 1-3.364-1.892L9.752 25.822c-.966-3.372 1.16-6.853 4.612-7.556l43.05-8.744c3.146-.638 6.25 1.286 7.053 4.377L73.95 49.98a2.729 2.729 0 0 1-1.931 3.33Z",
29
+ fill: "#fff",
30
+ stroke: resolvedSecondaryColor,
31
+ strokeLinecap: "round",
32
+ strokeLinejoin: "round",
33
+ strokeWidth: ".7"
34
+ }), /* @__PURE__ */ React.createElement("path", {
35
+ d: "M65.682 18.57 11.076 30.512l-1.346-4.69c-.966-3.373 1.161-6.854 4.612-7.556l43.05-8.734c3.146-.638 6.25 1.286 7.053 4.378l1.226 4.669.011-.01Z",
36
+ fill: resolvedSecondaryColor
37
+ }), /* @__PURE__ */ React.createElement("path", {
38
+ d: "M18.433 23.174a1.873 1.873 0 0 1-1.421 2.367c-1.097.238-2.236-.454-2.54-1.524a1.868 1.868 0 0 1 1.433-2.367c1.096-.227 2.224.465 2.528 1.535v-.011Z",
39
+ fill: "#fff"
40
+ }), /* @__PURE__ */ React.createElement("path", {
41
+ d: "M25.443 21.693c.293 1.06-.325 2.108-1.4 2.335-1.074.227-2.192-.454-2.485-1.524-.293-1.07.326-2.12 1.411-2.346 1.085-.227 2.181.465 2.474 1.524v.01Z",
42
+ fill: resolvedPrimaryColor
43
+ }), /* @__PURE__ */ React.createElement("path", {
44
+ d: "M11.097 30.6s.326-3.157.608-6.389l-1.378-3.08-3.43 5.88a6.507 6.507 0 0 0-.216.367v.022a5.619 5.619 0 0 0-.456 4.248l1.4 4.908 3.472-5.967v.01Z",
45
+ fill: resolvedSecondaryColor
46
+ }), /* @__PURE__ */ React.createElement("path", {
47
+ d: "m40.481 27.976-7.447 28.427a.98.98 0 0 0 1.22 1.197l27.762-7.62c.73-.197.97-1.1.447-1.645L42.147 27.53c-.533-.545-1.47-.305-1.666.435v.01Z",
48
+ fill: resolvedPrimaryColor,
49
+ stroke: resolvedSecondaryColor,
50
+ strokeLinecap: "round",
51
+ strokeLinejoin: "round",
52
+ strokeWidth: ".7"
53
+ }), /* @__PURE__ */ React.createElement("path", {
54
+ d: "m43.443 35.477 2.373 8.645",
55
+ stroke: resolvedSecondaryColor,
56
+ strokeLinecap: "round",
57
+ strokeLinejoin: "round",
58
+ strokeWidth: "2"
59
+ }), /* @__PURE__ */ React.createElement("path", {
60
+ d: "M48.353 48.346c.185.675-.24 1.372-.947 1.557-.708.185-1.438-.196-1.623-.871-.185-.675.24-1.372.947-1.557.708-.185 1.427.207 1.612.871h.01Z",
61
+ fill: resolvedSecondaryColor
62
+ }));
63
+ };
58
64
  Warning.displayName = "Warning";
59
65
  var stdin_default = createBaseComponent(Warning);
60
66
  export {
package/lib/cjs/index.js CHANGED
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getIllustrationPath = void 0;
7
- var version = "2.29.0";
7
+ var version = "2.30.0";
8
8
 
9
9
  /**
10
10
  * Formats string from `access_denied` or `access-denied` to `AccessDenied`
package/lib/es6/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var version = "2.29.0";
1
+ var version = "2.30.0";
2
2
 
3
3
  /**
4
4
  * Formats string from `access_denied` or `access-denied` to `AccessDenied`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/illustration",
3
3
  "description": "Semrush Illustration Component",
4
- "version": "2.29.0",
4
+ "version": "2.30.0-prerelease.0",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -10,10 +10,11 @@
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@babel/runtime": "^7.17.9",
13
- "@semcore/flex-box": "5.29.0"
13
+ "@semcore/flex-box": "5.30.0-prerelease.0",
14
+ "colorjs.io": "0.4.3"
14
15
  },
15
16
  "peerDependencies": {
16
- "@semcore/core": "^2.17.5",
17
+ "@semcore/core": "^2.28.0-prerelease.0",
17
18
  "react": "16.8 - 18",
18
19
  "react-dom": "16.8 - 18"
19
20
  },
package/transform.ts CHANGED
@@ -3,6 +3,8 @@ import { resolve as resolvePath } from 'path';
3
3
  import svgToJsx from 'svg-to-jsx';
4
4
  import { Window } from 'happy-dom';
5
5
  import esbuild from 'esbuild';
6
+ import ColorJSIO from 'colorjs.io';
7
+ const Color = ColorJSIO as any;
6
8
 
7
9
  const illustrations = await fs.readdir('svg');
8
10
 
@@ -28,6 +30,37 @@ await Promise.all(
28
30
  document.getElementById(oldId).setAttribute('id', newId);
29
31
  idReplacements[oldId] = newId;
30
32
  }
33
+ let illustrationPrimaryColor: undefined | string;
34
+ let illustrationSecondaryColor: undefined | string;
35
+ let secondaryColorDarkness = Infinity;
36
+ const traverseSvgChildren = (element: Element) => {
37
+ if (element.tagName === 'MASK') return;
38
+ for (let i = 0; i < element.children.length; i++) {
39
+ const child = element.children[i];
40
+ traverseSvgChildren(child);
41
+ }
42
+ const color = element.getAttribute('fill') || element.getAttribute('stroke');
43
+ if (color === 'none' || !color) return;
44
+ if (String(color).toUpperCase() !== '#E0E1E9') {
45
+ const saturation = new Color(color).to('hsl').coords[1];
46
+ if (saturation < 20) {
47
+ const darkness = new Color(color).to('hsl').coords[2];
48
+ if (darkness < secondaryColorDarkness) {
49
+ illustrationSecondaryColor = color;
50
+ secondaryColorDarkness = darkness;
51
+ }
52
+ return;
53
+ }
54
+ }
55
+ if (illustrationPrimaryColor === undefined) {
56
+ illustrationPrimaryColor = color;
57
+ } else if (illustrationPrimaryColor !== color) {
58
+ throw new Error(
59
+ `Illustration ${illustration} has multiple primary colors: ${illustrationPrimaryColor} and ${color}`,
60
+ );
61
+ }
62
+ };
63
+ traverseSvgChildren(document.querySelector('svg') as any);
31
64
 
32
65
  const {
33
66
  fill = 'none',
@@ -46,22 +79,51 @@ await Promise.all(
46
79
  }
47
80
  }
48
81
 
82
+ const prerenderLines: string[] = [];
83
+ const props = [
84
+ `fill = '${fill}'`,
85
+ `width = '${width}'`,
86
+ `height = '${height}'`,
87
+ `viewBox = '${viewBox.x} ${viewBox.y} ${viewBox.width} ${viewBox.height}'`,
88
+ ];
89
+ if (illustrationPrimaryColor || illustrationSecondaryColor) {
90
+ prerenderLines.push(' const colorResolver = useColorResolver();');
91
+ }
92
+ if (illustrationPrimaryColor) {
93
+ while (jsx.includes(`"${illustrationPrimaryColor}"`)) {
94
+ jsx = jsx.replace(`"${illustrationPrimaryColor}"`, '{resolvedPrimaryColor}');
95
+ }
96
+ props.push(`primaryColor = '${illustrationPrimaryColor}'`);
97
+ prerenderLines.push(' const resolvedPrimaryColor = colorResolver(primaryColor);');
98
+ }
99
+ if (illustrationSecondaryColor) {
100
+ while (jsx.includes(`"${illustrationSecondaryColor}"`)) {
101
+ jsx = jsx.replace(`"${illustrationSecondaryColor}"`, '{resolvedSecondaryColor}');
102
+ }
103
+ props.push(`secondaryColor = '${illustrationSecondaryColor}'`);
104
+ prerenderLines.push(' const resolvedSecondaryColor = colorResolver(secondaryColor);');
105
+ }
106
+
49
107
  const component = `
50
108
  import React from 'react';
51
109
  import { createBaseComponent } from '@semcore/core';
52
110
  import { Box } from '@semcore/flex-box';
111
+ import { useColorResolver } from '@semcore/utils/lib/use/useColorResolver';
53
112
 
54
- const ${illustration} = ({fill = '${fill}', width = '${width}', height = '${height}', viewBox = '${viewBox.x} ${viewBox.y} ${viewBox.width} ${viewBox.height}', ...props}, ref) => (
55
- <Box
56
- ref={ref}
57
- width={width}
58
- height={height}
59
- viewBox={viewBox}
60
- fill={fill}
61
- tag="svg"
62
- {...props}
63
- >${jsx}</Box>
64
- );
113
+ const ${illustration} = ({${props.join(', ')}, ...props}, ref) => {
114
+ ${prerenderLines.join('\n')}
115
+ return (
116
+ <Box
117
+ ref={ref}
118
+ width={width}
119
+ height={height}
120
+ viewBox={viewBox}
121
+ fill={fill}
122
+ tag="svg"
123
+ {...props}
124
+ >${jsx}</Box>
125
+ );
126
+ }
65
127
 
66
128
  ${illustration}.displayName = '${illustration}'
67
129
 
@@ -69,13 +131,43 @@ export default createBaseComponent(${illustration})
69
131
  `;
70
132
 
71
133
  const typesDeclaration = `
72
- import { Box } from '@semcore/flex-box';
73
- declare const _default: typeof Box;
74
- export default _default;
134
+ import { BoxProps } from '@semcore/flex-box';
135
+ import { Intergalactic } from '@semcore/core';
136
+
137
+ type IllustrationProps = BoxProps & {
138
+ /**
139
+ * Main color of the illustration
140
+ **/
141
+ primaryColor?: string;
142
+ /**
143
+ * Secondary color of the illustration
144
+ **/
145
+ secondaryColor?: string;
146
+ /**
147
+ * Changes background fill of the illustration
148
+ **/
149
+ fill?: string;
150
+ /**
151
+ * Width of the illustration
152
+ **/
153
+ width?: string | number;
154
+ /**
155
+ * Height of the illustration
156
+ **/
157
+ height?: string | number;
158
+ }
159
+ declare const Illustration: Intergalactic.Component<'svg', IllustrationProps>;
160
+ export default Illustration;
75
161
  `;
76
162
 
77
- const { code: cjs } = await esbuild.transform(component, { format: 'cjs', loader: 'tsx' });
78
- const { code: esm } = await esbuild.transform(component, { format: 'esm', loader: 'tsx' });
163
+ const { code: cjs } = await esbuild.transform(component, {
164
+ format: 'cjs',
165
+ loader: 'tsx',
166
+ });
167
+ const { code: esm } = await esbuild.transform(component, {
168
+ format: 'esm',
169
+ loader: 'tsx',
170
+ });
79
171
 
80
172
  try {
81
173
  await fs.access(illustration);