automoby-kit 1.0.1 → 1.0.2
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/index.cjs.js +7 -9
- package/dist/index.esm.js +8 -10
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -2157,15 +2157,13 @@ const MobileProvider = ({ userAgent, children, }) => {
|
|
|
2157
2157
|
return (jsxRuntimeExports.jsx(MobileContext.Provider, { value: value, children: children }));
|
|
2158
2158
|
};
|
|
2159
2159
|
const useMobile = (isMobile) => {
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
};
|
|
2168
|
-
return context;
|
|
2160
|
+
const context = React.useContext(MobileContext);
|
|
2161
|
+
if (context === undefined) {
|
|
2162
|
+
throw new Error('useMobile must be used within a MobileProvider');
|
|
2163
|
+
}
|
|
2164
|
+
return isMobile === undefined
|
|
2165
|
+
? context
|
|
2166
|
+
: { isMobile, userAgent: context.userAgent };
|
|
2169
2167
|
};
|
|
2170
2168
|
|
|
2171
2169
|
const Input$1 = React.forwardRef(({ state = 'default', label, value, onChange, helperText, startIcon, endIcon, type = 'text', ...props }, ref) => {
|
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { createContext, useMemo, useState, useId, useRef, useEffect, forwardRef, createElement } from 'react';
|
|
1
|
+
import React, { createContext, useContext, useMemo, useState, useId, useRef, useEffect, forwardRef, createElement } from 'react';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = {exports: {}};
|
|
4
4
|
|
|
@@ -2155,15 +2155,13 @@ const MobileProvider = ({ userAgent, children, }) => {
|
|
|
2155
2155
|
return (jsxRuntimeExports.jsx(MobileContext.Provider, { value: value, children: children }));
|
|
2156
2156
|
};
|
|
2157
2157
|
const useMobile = (isMobile) => {
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
};
|
|
2166
|
-
return context;
|
|
2158
|
+
const context = useContext(MobileContext);
|
|
2159
|
+
if (context === undefined) {
|
|
2160
|
+
throw new Error('useMobile must be used within a MobileProvider');
|
|
2161
|
+
}
|
|
2162
|
+
return isMobile === undefined
|
|
2163
|
+
? context
|
|
2164
|
+
: { isMobile, userAgent: context.userAgent };
|
|
2167
2165
|
};
|
|
2168
2166
|
|
|
2169
2167
|
const Input$1 = React.forwardRef(({ state = 'default', label, value, onChange, helperText, startIcon, endIcon, type = 'text', ...props }, ref) => {
|
package/package.json
CHANGED