@mirohq/design-system-icons 1.45.1-reactdismissablelayer.0 → 1.45.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +35 -9
- package/dist/main.js.map +1 -1
- package/dist/module.js +36 -10
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +10 -7
- package/package.json +2 -2
package/dist/main.js
CHANGED
|
@@ -4,26 +4,52 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
4
4
|
var react = require('react');
|
|
5
5
|
var designSystemBaseIcon = require('@mirohq/design-system-base-icon');
|
|
6
6
|
var designSystemUseLocalStorage = require('@mirohq/design-system-use-local-storage');
|
|
7
|
+
var designSystemUtils = require('@mirohq/design-system-utils');
|
|
7
8
|
var designSystemPrimitive = require('@mirohq/design-system-primitive');
|
|
8
9
|
var designSystemStitches = require('@mirohq/design-system-stitches');
|
|
9
|
-
var designSystemUtils = require('@mirohq/design-system-utils');
|
|
10
10
|
|
|
11
|
-
const
|
|
11
|
+
const BaseStyledIcon = designSystemStitches.styled(designSystemPrimitive.Primitive.svg, {
|
|
12
12
|
display: "inline-flex",
|
|
13
13
|
verticalAlign: "text-bottom",
|
|
14
14
|
forcedColorAdjust: "auto",
|
|
15
15
|
variants: {
|
|
16
16
|
...designSystemBaseIcon.styles,
|
|
17
|
-
color: designSystemUtils.mapKeysToVariants(designSystemStitches.theme.colors, "color")
|
|
18
|
-
debug: {
|
|
19
|
-
true: {
|
|
20
|
-
color: "#06D834 !important"
|
|
21
|
-
},
|
|
22
|
-
false: {}
|
|
23
|
-
}
|
|
17
|
+
color: designSystemUtils.mapKeysToVariants(designSystemStitches.theme.colors, "color")
|
|
24
18
|
}
|
|
25
19
|
});
|
|
26
20
|
|
|
21
|
+
const DEBUG_COLOR = "#06D834";
|
|
22
|
+
const DEBUG_STORAGE_KEY = "MIRO_DS_DEBUG_ICON";
|
|
23
|
+
function isDebugFlagEnabled(debugProp) {
|
|
24
|
+
var _a;
|
|
25
|
+
if (debugProp === true) return true;
|
|
26
|
+
if (typeof window === "undefined") return false;
|
|
27
|
+
try {
|
|
28
|
+
return JSON.parse((_a = window.localStorage.getItem(DEBUG_STORAGE_KEY)) != null ? _a : "false") === true;
|
|
29
|
+
} catch {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const StyledIcon = react.forwardRef(
|
|
34
|
+
({ debug, ...props }, forwardedRef) => {
|
|
35
|
+
const internalRef = react.useRef(null);
|
|
36
|
+
react.useLayoutEffect(() => {
|
|
37
|
+
const el = internalRef.current;
|
|
38
|
+
if (el == null || !isDebugFlagEnabled(debug)) return;
|
|
39
|
+
el.style.setProperty("color", DEBUG_COLOR, "important");
|
|
40
|
+
el.style.setProperty("fill", DEBUG_COLOR, "important");
|
|
41
|
+
return () => {
|
|
42
|
+
el.style.removeProperty("color");
|
|
43
|
+
el.style.removeProperty("fill");
|
|
44
|
+
};
|
|
45
|
+
}, [debug]);
|
|
46
|
+
return react.createElement(BaseStyledIcon, {
|
|
47
|
+
...props,
|
|
48
|
+
ref: designSystemUtils.mergeRefs([internalRef, forwardedRef])
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
|
|
27
53
|
const IconActivitySparkle = react.forwardRef(
|
|
28
54
|
({ size = "medium", ...props }, forwardRef2) => {
|
|
29
55
|
const [debug] = designSystemUseLocalStorage.useLocalStorage("DEBUG_ICON", false);
|