automoby-kit 1.0.0 → 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 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
- // const context = useContext(MobileContext);
2161
- // if (context === undefined) {
2162
- // throw new Error('useMobile must be used within a MobileProvider');
2163
- // }
2164
- const context = {
2165
- isMobile: isMobile || false,
2166
- userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1',
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) => {
@@ -3019,4 +3017,3 @@ exports.Tabs = Tabs;
3019
3017
  exports.Typography = Typography;
3020
3018
  exports.initializeAutomobiKit = initializeAutomobiKit;
3021
3019
  exports.useMobile = useMobile;
3022
- //# sourceMappingURL=index.cjs.js.map
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
- // const context = useContext(MobileContext);
2159
- // if (context === undefined) {
2160
- // throw new Error('useMobile must be used within a MobileProvider');
2161
- // }
2162
- const context = {
2163
- isMobile: isMobile || false,
2164
- userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1',
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) => {
@@ -3003,4 +3001,3 @@ const RadioGroup = withLicenseProtection(RadioGroup$1, 'RadioGroup');
3003
3001
  const Chips = withLicenseProtection(Chips$1, 'Chips');
3004
3002
 
3005
3003
  export { Accordion, Backdrop, Breadcrumb, Button, Chips, Divider, Drawer, Input, MobileProvider, Pagination, RadioGroup, Tabs, Typography, initializeAutomobiKit, useMobile };
3006
- //# sourceMappingURL=index.esm.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "automoby-kit",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "A comprehensive React UI component library with built-in licensing system - created in war 2025",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",