@swan-io/lake 8.10.4 → 8.11.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swan-io/lake",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.11.0",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=20.9.0",
|
|
6
6
|
"yarn": "^1.22.0"
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"@types/react-dom": "^18.3.0",
|
|
50
50
|
"@types/react-native": "^0.72.8",
|
|
51
51
|
"@types/three": "^0.163.0",
|
|
52
|
+
"@types/uuid": "^10.0.0",
|
|
52
53
|
"jsdom": "^24.1.1",
|
|
53
54
|
"type-fest": "^4.23.0"
|
|
54
55
|
}
|
|
@@ -162,7 +162,7 @@ maxCharCount, help, warning = false, renderEnd, ...props }, forwardRef) => {
|
|
|
162
162
|
hasError && styles.error,
|
|
163
163
|
valid && styles.valid,
|
|
164
164
|
stylesFromProps,
|
|
165
|
-
], ref: containerRef, children: [isNotNullish(icon) && (_jsx(Icon, { name: icon, size: 20, color: colors.current.primary, style: styles.icon })), _jsx(TextInput, { "aria-expanded": ariaExpanded, "aria-controls": ariaControls, inputMode: inputMode, ...props, defaultValue: defaultValue, value: isNullish(defaultValue) ? value !== null && value !== void 0 ? value : "" : value, onFocus: onFocus, onBlur: onBlur, readOnly: !isInteractive, onChange: onChange, multiline: multiline, ref: mergedRef, style: [
|
|
165
|
+
], ref: containerRef, children: [isNotNullish(icon) && (_jsx(Icon, { name: icon, size: 20, color: colors.current.primary, style: styles.icon })), _jsx(TextInput, { "aria-expanded": ariaExpanded, "aria-controls": ariaControls, inputMode: inputMode, ...props, defaultValue: defaultValue, value: isNullish(defaultValue) ? (value !== null && value !== void 0 ? value : "") : value, onFocus: onFocus, onBlur: onBlur, readOnly: !isInteractive, onChange: onChange, multiline: multiline, ref: mergedRef, style: [
|
|
166
166
|
styles.input,
|
|
167
167
|
multiline && styles.multilineInput,
|
|
168
168
|
readOnly && hasError && styles.readOnlyError,
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import { useEffect } from "react";
|
|
2
|
+
const counters = {};
|
|
2
3
|
export const useBodyClassName = (className, { enabled = true } = {}) => {
|
|
3
4
|
useEffect(() => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
else {
|
|
8
|
-
document.body.classList.remove(className);
|
|
5
|
+
var _a;
|
|
6
|
+
if (!enabled) {
|
|
7
|
+
return; // effect cleanup remove the class if disabled
|
|
9
8
|
}
|
|
9
|
+
const currentCount = (_a = counters[className]) !== null && _a !== void 0 ? _a : 0;
|
|
10
|
+
counters[className] = currentCount + 1;
|
|
11
|
+
document.body.classList.add(className);
|
|
10
12
|
return () => {
|
|
11
|
-
|
|
13
|
+
var _a;
|
|
14
|
+
const currentCount = (_a = counters[className]) !== null && _a !== void 0 ? _a : 0;
|
|
15
|
+
counters[className] = currentCount - 1;
|
|
16
|
+
if (counters[className] <= 0) {
|
|
17
|
+
document.body.classList.remove(className);
|
|
18
|
+
}
|
|
12
19
|
};
|
|
13
20
|
}, [className, enabled]);
|
|
14
21
|
};
|
|
@@ -2,6 +2,6 @@ import { useCallback } from "react";
|
|
|
2
2
|
import { useBreakpoint } from "./useBreakpoint";
|
|
3
3
|
export const useResponsive = (breakpoint = 992) => {
|
|
4
4
|
const desktop = useBreakpoint(breakpoint);
|
|
5
|
-
const media = useCallback((values) => { var _a; return desktop ? (_a = values.desktop) !== null && _a !== void 0 ? _a : values.mobile : values.mobile; }, [desktop]);
|
|
5
|
+
const media = useCallback((values) => { var _a; return desktop ? ((_a = values.desktop) !== null && _a !== void 0 ? _a : values.mobile) : values.mobile; }, [desktop]);
|
|
6
6
|
return { desktop, media };
|
|
7
7
|
};
|