@papernote/ui 1.3.1 → 1.5.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/dist/components/BottomNavigation.d.ts +98 -0
- package/dist/components/BottomNavigation.d.ts.map +1 -0
- package/dist/components/Checkbox.d.ts +2 -0
- package/dist/components/Checkbox.d.ts.map +1 -1
- package/dist/components/CheckboxList.d.ts +81 -0
- package/dist/components/CheckboxList.d.ts.map +1 -0
- package/dist/components/Chip.d.ts +92 -1
- package/dist/components/Chip.d.ts.map +1 -1
- package/dist/components/ConfirmDialog.d.ts +43 -1
- package/dist/components/ConfirmDialog.d.ts.map +1 -1
- package/dist/components/DataTable.d.ts +10 -1
- package/dist/components/DataTable.d.ts.map +1 -1
- package/dist/components/DataTableCardView.d.ts +99 -0
- package/dist/components/DataTableCardView.d.ts.map +1 -0
- package/dist/components/ExpandablePanel.d.ts +142 -0
- package/dist/components/ExpandablePanel.d.ts.map +1 -0
- package/dist/components/FloatingActionButton.d.ts +98 -0
- package/dist/components/FloatingActionButton.d.ts.map +1 -0
- package/dist/components/Input.d.ts +45 -1
- package/dist/components/Input.d.ts.map +1 -1
- package/dist/components/MobileHeader.d.ts +98 -0
- package/dist/components/MobileHeader.d.ts.map +1 -0
- package/dist/components/MobileLayout.d.ts +121 -0
- package/dist/components/MobileLayout.d.ts.map +1 -0
- package/dist/components/Modal.d.ts +50 -1
- package/dist/components/Modal.d.ts.map +1 -1
- package/dist/components/PullToRefresh.d.ts +87 -0
- package/dist/components/PullToRefresh.d.ts.map +1 -0
- package/dist/components/QueryTransparency.d.ts +1 -1
- package/dist/components/QueryTransparency.d.ts.map +1 -1
- package/dist/components/SearchableList.d.ts +83 -0
- package/dist/components/SearchableList.d.ts.map +1 -0
- package/dist/components/Select.d.ts +16 -2
- package/dist/components/Select.d.ts.map +1 -1
- package/dist/components/Sidebar.d.ts +40 -1
- package/dist/components/Sidebar.d.ts.map +1 -1
- package/dist/components/SwipeActions.d.ts +93 -0
- package/dist/components/SwipeActions.d.ts.map +1 -0
- package/dist/components/Switch.d.ts +1 -0
- package/dist/components/Switch.d.ts.map +1 -1
- package/dist/components/Textarea.d.ts +13 -0
- package/dist/components/Textarea.d.ts.map +1 -1
- package/dist/components/index.d.ts +27 -3
- package/dist/components/index.d.ts.map +1 -1
- package/dist/context/MobileContext.d.ts +168 -0
- package/dist/context/MobileContext.d.ts.map +1 -0
- package/dist/hooks/useResponsive.d.ts +158 -0
- package/dist/hooks/useResponsive.d.ts.map +1 -0
- package/dist/index.d.ts +1653 -56
- package/dist/index.esm.js +2832 -194
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2865 -192
- package/dist/index.js.map +1 -1
- package/dist/styles.css +404 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/BottomNavigation.stories.tsx +142 -0
- package/src/components/BottomNavigation.tsx +225 -0
- package/src/components/Checkbox.stories.tsx +162 -0
- package/src/components/Checkbox.tsx +22 -6
- package/src/components/CheckboxList.stories.tsx +311 -0
- package/src/components/CheckboxList.tsx +433 -0
- package/src/components/Chip.stories.tsx +389 -0
- package/src/components/Chip.tsx +182 -3
- package/src/components/ConfirmDialog.tsx +56 -4
- package/src/components/DataTable.tsx +60 -1
- package/src/components/DataTableCardView.stories.tsx +307 -0
- package/src/components/DataTableCardView.tsx +419 -0
- package/src/components/ExpandablePanel.stories.tsx +620 -0
- package/src/components/ExpandablePanel.tsx +383 -0
- package/src/components/FloatingActionButton.stories.tsx +197 -0
- package/src/components/FloatingActionButton.tsx +301 -0
- package/src/components/Grid.stories.tsx +16 -16
- package/src/components/Input.stories.tsx +214 -0
- package/src/components/Input.tsx +81 -4
- package/src/components/MobileHeader.stories.tsx +205 -0
- package/src/components/MobileHeader.tsx +233 -0
- package/src/components/MobileLayout.stories.tsx +338 -0
- package/src/components/MobileLayout.tsx +313 -0
- package/src/components/Modal.stories.tsx +183 -0
- package/src/components/Modal.tsx +84 -3
- package/src/components/PullToRefresh.stories.tsx +321 -0
- package/src/components/PullToRefresh.tsx +294 -0
- package/src/components/QueryTransparency.tsx +1 -1
- package/src/components/SearchableList.stories.tsx +437 -0
- package/src/components/SearchableList.tsx +326 -0
- package/src/components/Select.stories.tsx +190 -0
- package/src/components/Select.tsx +353 -137
- package/src/components/Sidebar.tsx +191 -8
- package/src/components/SwipeActions.stories.tsx +327 -0
- package/src/components/SwipeActions.tsx +387 -0
- package/src/components/Switch.stories.tsx +158 -0
- package/src/components/Switch.tsx +12 -3
- package/src/components/Textarea.tsx +31 -1
- package/src/components/index.ts +63 -3
- package/src/context/MobileContext.tsx +296 -0
- package/src/hooks/useResponsive.ts +360 -0
- package/src/types/index.ts +4 -0
- package/tailwind.config.js +56 -1
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { Breakpoint, Orientation, ViewportSize } from '../hooks/useResponsive';
|
|
3
|
+
/**
|
|
4
|
+
* Mobile context value interface
|
|
5
|
+
*
|
|
6
|
+
* Provides comprehensive responsive state for the entire application.
|
|
7
|
+
*/
|
|
8
|
+
export interface MobileContextValue {
|
|
9
|
+
/** True when viewport width < 768px */
|
|
10
|
+
isMobile: boolean;
|
|
11
|
+
/** True when viewport width is 768px - 1023px */
|
|
12
|
+
isTablet: boolean;
|
|
13
|
+
/** True when viewport width >= 1024px */
|
|
14
|
+
isDesktop: boolean;
|
|
15
|
+
/** True when device supports touch input */
|
|
16
|
+
isTouchDevice: boolean;
|
|
17
|
+
/** Current Tailwind breakpoint: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' */
|
|
18
|
+
breakpoint: Breakpoint;
|
|
19
|
+
/** Current orientation: 'portrait' | 'landscape' */
|
|
20
|
+
orientation: Orientation;
|
|
21
|
+
/** Current viewport dimensions */
|
|
22
|
+
viewport: ViewportSize;
|
|
23
|
+
/** Safe area insets for notched devices */
|
|
24
|
+
safeAreaInsets: {
|
|
25
|
+
top: number;
|
|
26
|
+
right: number;
|
|
27
|
+
bottom: number;
|
|
28
|
+
left: number;
|
|
29
|
+
};
|
|
30
|
+
/** True when mobile OR touch device (useful for UI decisions) */
|
|
31
|
+
useMobileUI: boolean;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Mobile context
|
|
35
|
+
*/
|
|
36
|
+
declare const MobileContext: React.Context<MobileContextValue>;
|
|
37
|
+
/**
|
|
38
|
+
* MobileProvider props
|
|
39
|
+
*/
|
|
40
|
+
export interface MobileProviderProps {
|
|
41
|
+
/** Child components that will have access to mobile context */
|
|
42
|
+
children: ReactNode;
|
|
43
|
+
/**
|
|
44
|
+
* Force mobile UI mode regardless of device detection.
|
|
45
|
+
* Useful for testing or forcing mobile layout on tablets.
|
|
46
|
+
*/
|
|
47
|
+
forceMobileUI?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Force desktop UI mode regardless of device detection.
|
|
50
|
+
* Useful for testing or forcing desktop layout on mobile.
|
|
51
|
+
*/
|
|
52
|
+
forceDesktopUI?: boolean;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* MobileProvider - Provides responsive state to the entire application
|
|
56
|
+
*
|
|
57
|
+
* Wrap your application with MobileProvider to enable auto-responsive
|
|
58
|
+
* behavior in notebook-ui components.
|
|
59
|
+
*
|
|
60
|
+
* @example Basic usage
|
|
61
|
+
* ```tsx
|
|
62
|
+
* import { MobileProvider } from 'notebook-ui';
|
|
63
|
+
*
|
|
64
|
+
* function App() {
|
|
65
|
+
* return (
|
|
66
|
+
* <MobileProvider>
|
|
67
|
+
* <YourApplication />
|
|
68
|
+
* </MobileProvider>
|
|
69
|
+
* );
|
|
70
|
+
* }
|
|
71
|
+
* ```
|
|
72
|
+
*
|
|
73
|
+
* @example Force mobile UI for testing
|
|
74
|
+
* ```tsx
|
|
75
|
+
* <MobileProvider forceMobileUI>
|
|
76
|
+
* <YourApplication />
|
|
77
|
+
* </MobileProvider>
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export declare function MobileProvider({ children, forceMobileUI, forceDesktopUI, }: MobileProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
81
|
+
/**
|
|
82
|
+
* useMobileContext - Hook to access mobile responsive state
|
|
83
|
+
*
|
|
84
|
+
* Must be used within a MobileProvider. Returns comprehensive
|
|
85
|
+
* responsive state for making UI decisions.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```tsx
|
|
89
|
+
* function MyComponent() {
|
|
90
|
+
* const { isMobile, useMobileUI, breakpoint } = useMobileContext();
|
|
91
|
+
*
|
|
92
|
+
* return useMobileUI ? <MobileView /> : <DesktopView />;
|
|
93
|
+
* }
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
export declare function useMobileContext(): MobileContextValue;
|
|
97
|
+
/**
|
|
98
|
+
* withMobileContext - HOC to inject mobile context as props
|
|
99
|
+
*
|
|
100
|
+
* For class components or when you prefer props over hooks.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```tsx
|
|
104
|
+
* interface Props {
|
|
105
|
+
* mobile: MobileContextValue;
|
|
106
|
+
* }
|
|
107
|
+
*
|
|
108
|
+
* class MyComponent extends React.Component<Props> {
|
|
109
|
+
* render() {
|
|
110
|
+
* const { isMobile } = this.props.mobile;
|
|
111
|
+
* return isMobile ? <Mobile /> : <Desktop />;
|
|
112
|
+
* }
|
|
113
|
+
* }
|
|
114
|
+
*
|
|
115
|
+
* export default withMobileContext(MyComponent);
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
export declare function withMobileContext<P extends {
|
|
119
|
+
mobile: MobileContextValue;
|
|
120
|
+
}>(Component: React.ComponentType<P>): {
|
|
121
|
+
(props: Omit<P, "mobile">): import("react/jsx-runtime").JSX.Element;
|
|
122
|
+
displayName: string;
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* MobileOnly - Renders children only on mobile devices
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* ```tsx
|
|
129
|
+
* <MobileOnly>
|
|
130
|
+
* <BottomNavigation items={navItems} />
|
|
131
|
+
* </MobileOnly>
|
|
132
|
+
* ```
|
|
133
|
+
*/
|
|
134
|
+
export declare function MobileOnly({ children }: {
|
|
135
|
+
children: ReactNode;
|
|
136
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
137
|
+
/**
|
|
138
|
+
* DesktopOnly - Renders children only on desktop devices
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* ```tsx
|
|
142
|
+
* <DesktopOnly>
|
|
143
|
+
* <Sidebar items={navItems} />
|
|
144
|
+
* </DesktopOnly>
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
147
|
+
export declare function DesktopOnly({ children }: {
|
|
148
|
+
children: ReactNode;
|
|
149
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
150
|
+
/**
|
|
151
|
+
* Responsive - Renders different content based on device type
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* ```tsx
|
|
155
|
+
* <Responsive
|
|
156
|
+
* mobile={<MobileNavigation />}
|
|
157
|
+
* tablet={<TabletNavigation />}
|
|
158
|
+
* desktop={<DesktopNavigation />}
|
|
159
|
+
* />
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
export declare function Responsive({ mobile, tablet, desktop, }: {
|
|
163
|
+
mobile?: ReactNode;
|
|
164
|
+
tablet?: ReactNode;
|
|
165
|
+
desktop?: ReactNode;
|
|
166
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
167
|
+
export default MobileContext;
|
|
168
|
+
//# sourceMappingURL=MobileContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MobileContext.d.ts","sourceRoot":"","sources":["../../src/context/MobileContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAsC,SAAS,EAAE,MAAM,OAAO,CAAC;AAC7E,OA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AC,CAAC,CAAC;YAIA,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC;;EAQnD;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,kDAG/D;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,kDAGhE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,MAAM,EACN,OAAO,GACR,EAAE;IACD,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB,2CAWA;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tailwind breakpoint values in pixels
|
|
3
|
+
*/
|
|
4
|
+
export declare const BREAKPOINTS: {
|
|
5
|
+
readonly xs: 0;
|
|
6
|
+
readonly sm: 640;
|
|
7
|
+
readonly md: 768;
|
|
8
|
+
readonly lg: 1024;
|
|
9
|
+
readonly xl: 1280;
|
|
10
|
+
readonly '2xl': 1536;
|
|
11
|
+
};
|
|
12
|
+
export type Breakpoint = keyof typeof BREAKPOINTS;
|
|
13
|
+
/**
|
|
14
|
+
* Viewport size state
|
|
15
|
+
*/
|
|
16
|
+
export interface ViewportSize {
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Orientation type
|
|
22
|
+
*/
|
|
23
|
+
export type Orientation = 'portrait' | 'landscape';
|
|
24
|
+
/**
|
|
25
|
+
* useViewportSize - Returns current viewport dimensions
|
|
26
|
+
*
|
|
27
|
+
* Updates on window resize with debouncing for performance.
|
|
28
|
+
* SSR-safe with sensible defaults.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* const { width, height } = useViewportSize();
|
|
32
|
+
* console.log(`Viewport: ${width}x${height}`);
|
|
33
|
+
*/
|
|
34
|
+
export declare function useViewportSize(): ViewportSize;
|
|
35
|
+
/**
|
|
36
|
+
* useBreakpoint - Returns the current Tailwind breakpoint
|
|
37
|
+
*
|
|
38
|
+
* Automatically updates when viewport crosses breakpoint thresholds.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* const breakpoint = useBreakpoint();
|
|
42
|
+
* // Returns: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'
|
|
43
|
+
*/
|
|
44
|
+
export declare function useBreakpoint(): Breakpoint;
|
|
45
|
+
/**
|
|
46
|
+
* useMediaQuery - React hook for CSS media queries
|
|
47
|
+
*
|
|
48
|
+
* SSR-safe implementation that returns false during SSR and
|
|
49
|
+
* updates reactively when media query match state changes.
|
|
50
|
+
*
|
|
51
|
+
* @param query - CSS media query string (e.g., '(max-width: 768px)')
|
|
52
|
+
* @returns boolean indicating if the media query matches
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* const isDarkMode = useMediaQuery('(prefers-color-scheme: dark)');
|
|
56
|
+
* const isReducedMotion = useMediaQuery('(prefers-reduced-motion: reduce)');
|
|
57
|
+
* const isPortrait = useMediaQuery('(orientation: portrait)');
|
|
58
|
+
*/
|
|
59
|
+
export declare function useMediaQuery(query: string): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* useIsMobile - Returns true when viewport is mobile-sized (< 768px)
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* const isMobile = useIsMobile();
|
|
65
|
+
* return isMobile ? <MobileNav /> : <DesktopNav />;
|
|
66
|
+
*/
|
|
67
|
+
export declare function useIsMobile(): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* useIsTablet - Returns true when viewport is tablet-sized (768px - 1023px)
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* const isTablet = useIsTablet();
|
|
73
|
+
*/
|
|
74
|
+
export declare function useIsTablet(): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* useIsDesktop - Returns true when viewport is desktop-sized (>= 1024px)
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* const isDesktop = useIsDesktop();
|
|
80
|
+
*/
|
|
81
|
+
export declare function useIsDesktop(): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* useIsTouchDevice - Detects if the device supports touch input
|
|
84
|
+
*
|
|
85
|
+
* Uses multiple detection methods for reliability:
|
|
86
|
+
* - Touch event support
|
|
87
|
+
* - Pointer coarse media query
|
|
88
|
+
* - Max touch points
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* const isTouchDevice = useIsTouchDevice();
|
|
92
|
+
* // Show swipe hints on touch devices
|
|
93
|
+
*/
|
|
94
|
+
export declare function useIsTouchDevice(): boolean;
|
|
95
|
+
/**
|
|
96
|
+
* useOrientation - Returns current screen orientation
|
|
97
|
+
*
|
|
98
|
+
* @returns 'portrait' | 'landscape'
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* const orientation = useOrientation();
|
|
102
|
+
* // Adjust layout based on orientation
|
|
103
|
+
*/
|
|
104
|
+
export declare function useOrientation(): Orientation;
|
|
105
|
+
/**
|
|
106
|
+
* useBreakpointValue - Returns different values based on breakpoint
|
|
107
|
+
*
|
|
108
|
+
* Mobile-first: Returns the value for the current breakpoint or the
|
|
109
|
+
* closest smaller breakpoint that has a value defined.
|
|
110
|
+
*
|
|
111
|
+
* @param values - Object mapping breakpoints to values
|
|
112
|
+
* @param defaultValue - Fallback value if no breakpoint matches
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* const columns = useBreakpointValue({ xs: 1, sm: 2, lg: 4 }, 1);
|
|
116
|
+
* // Returns 1 on xs, 2 on sm/md, 4 on lg/xl/2xl
|
|
117
|
+
*
|
|
118
|
+
* const padding = useBreakpointValue({ xs: 'p-2', md: 'p-4', xl: 'p-8' });
|
|
119
|
+
*/
|
|
120
|
+
export declare function useBreakpointValue<T>(values: Partial<Record<Breakpoint, T>>, defaultValue?: T): T | undefined;
|
|
121
|
+
/**
|
|
122
|
+
* useResponsiveCallback - Returns a memoized callback that receives responsive info
|
|
123
|
+
*
|
|
124
|
+
* Useful for callbacks that need to behave differently based on viewport.
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* const handleClick = useResponsiveCallback((isMobile) => {
|
|
128
|
+
* if (isMobile) {
|
|
129
|
+
* openBottomSheet();
|
|
130
|
+
* } else {
|
|
131
|
+
* openModal();
|
|
132
|
+
* }
|
|
133
|
+
* });
|
|
134
|
+
*/
|
|
135
|
+
export declare function useResponsiveCallback<T extends (...args: any[]) => any>(callback: (isMobile: boolean, isTablet: boolean, isDesktop: boolean) => T): T;
|
|
136
|
+
/**
|
|
137
|
+
* useSafeAreaInsets - Returns safe area insets for notched devices
|
|
138
|
+
*
|
|
139
|
+
* Uses CSS environment variables (env(safe-area-inset-*)) to get
|
|
140
|
+
* safe area dimensions for devices with notches or home indicators.
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* const { top, bottom } = useSafeAreaInsets();
|
|
144
|
+
* // Add padding-bottom for home indicator
|
|
145
|
+
*/
|
|
146
|
+
export declare function useSafeAreaInsets(): {
|
|
147
|
+
top: number;
|
|
148
|
+
right: number;
|
|
149
|
+
bottom: number;
|
|
150
|
+
left: number;
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* usePrefersMobile - Checks if user prefers reduced data/animations (mobile-friendly)
|
|
154
|
+
*
|
|
155
|
+
* Combines multiple preferences that might indicate mobile/low-power usage.
|
|
156
|
+
*/
|
|
157
|
+
export declare function usePrefersMobile(): boolean;
|
|
158
|
+
//# sourceMappingURL=useResponsive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResponsive.d.ts","sourceRoot":"","sources":["../../src/hooks/useResponsive.ts"],"names":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