@teo-garcia/react-shared 1.2.1 → 1.3.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.
Files changed (40) hide show
  1. package/README.md +138 -136
  2. package/dist/components/client-only/client-only.d.ts +11 -0
  3. package/dist/components/client-only/client-only.d.ts.map +1 -0
  4. package/dist/components/client-only/client-only.js +17 -0
  5. package/dist/components/client-only/index.d.ts +2 -0
  6. package/dist/components/client-only/index.d.ts.map +1 -0
  7. package/dist/components/client-only/index.js +1 -0
  8. package/dist/components/dev-panel/dev-panel-features.d.ts +10 -0
  9. package/dist/components/dev-panel/dev-panel-features.d.ts.map +1 -0
  10. package/dist/components/dev-panel/dev-panel-features.js +29 -0
  11. package/dist/components/dev-panel/dev-panel.d.ts +15 -17
  12. package/dist/components/dev-panel/dev-panel.d.ts.map +1 -1
  13. package/dist/components/dev-panel/dev-panel.js +619 -99
  14. package/dist/components/dev-panel/index.d.ts +1 -1
  15. package/dist/components/dev-panel/index.d.ts.map +1 -1
  16. package/dist/components/dev-panel/index.js +1 -1
  17. package/dist/components/dev-panel/use-dev-panel-diagnostics.d.ts +39 -0
  18. package/dist/components/dev-panel/use-dev-panel-diagnostics.d.ts.map +1 -0
  19. package/dist/components/dev-panel/use-dev-panel-diagnostics.js +384 -0
  20. package/dist/components/index.d.ts +1 -0
  21. package/dist/components/index.d.ts.map +1 -1
  22. package/dist/components/index.js +1 -0
  23. package/dist/components/separator/separator.d.ts +4 -4
  24. package/dist/components/separator/separator.d.ts.map +1 -1
  25. package/dist/components/separator/separator.js +18 -6
  26. package/dist/components/skeleton/skeleton.d.ts +1 -1
  27. package/dist/components/skeleton/skeleton.d.ts.map +1 -1
  28. package/dist/components/skeleton/skeleton.js +19 -4
  29. package/dist/components/skip-link/skip-link.d.ts.map +1 -1
  30. package/dist/components/skip-link/skip-link.js +8 -5
  31. package/dist/hooks/index.d.ts +1 -0
  32. package/dist/hooks/index.d.ts.map +1 -1
  33. package/dist/hooks/index.js +1 -0
  34. package/dist/hooks/use-breakpoint.d.ts +9 -0
  35. package/dist/hooks/use-breakpoint.d.ts.map +1 -0
  36. package/dist/hooks/use-breakpoint.js +47 -0
  37. package/dist/index.d.ts +2 -7
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +2 -7
  40. package/package.json +11 -1
package/README.md CHANGED
@@ -2,197 +2,199 @@
2
2
 
3
3
  # @teo-garcia/react-shared
4
4
 
5
- **Shared React hooks, utilities, and components for fullstack web templates**
5
+ Self-contained React hooks, components, dev helpers, and test utilities.
6
6
 
7
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
8
8
  [![npm](https://img.shields.io/npm/v/@teo-garcia/react-shared?color=blue)](https://www.npmjs.com/package/@teo-garcia/react-shared)
9
9
  [![React](https://img.shields.io/badge/React-19+-61DAFB?logo=react&logoColor=black)](https://react.dev)
10
10
 
11
- Part of the [@teo-garcia/templates](https://github.com/teo-garcia/templates)
12
- ecosystem
13
-
14
11
  </div>
15
12
 
16
- ---
13
+ `@teo-garcia/react-shared` is the React-specific shared library in the template
14
+ portfolio. It is intentionally narrow:
15
+
16
+ - useful React/browser primitives
17
+ - accessibility helpers
18
+ - dev-only diagnostics
19
+ - test utilities
20
+ - no design-system components
21
+ - no consumer Tailwind scanning or `@source` setup
22
+
23
+ If a future helper is framework-agnostic, it will likely move into a separate
24
+ general-purpose package later instead of growing this package sideways.
17
25
 
18
26
  ## Requirements
19
27
 
20
28
  - React 19+
21
29
  - TypeScript
22
- - Tailwind CSS in the consuming app (for `Skeleton` and `cn`)
30
+ - `@tanstack/react-query` only if you use the test wrapper helpers
31
+ - `@testing-library/react` only if you use the test utilities
23
32
 
24
33
  ## Installation
25
34
 
26
35
  ```bash
27
36
  pnpm add @teo-garcia/react-shared
28
37
 
29
- # Optional: hooks that use TanStack Query
38
+ # Optional peer deps for test utilities
30
39
  pnpm add @tanstack/react-query
31
-
32
- # Optional: test utilities
33
40
  pnpm add -D @testing-library/react
34
41
  ```
35
42
 
36
- ---
43
+ ## Design Principles
37
44
 
38
- ## Hooks
39
-
40
- All hooks are framework-agnostic and SSR-safe.
45
+ - self-contained runtime styling for shared UI primitives
46
+ - no dependency on Tailwind in consuming apps
47
+ - components should work alongside Tailwind, Material UI, shadcn/ui, or custom
48
+ UI
49
+ - prefer primitives and utilities over opinionated widgets
50
+ - dev-only helpers should disappear in production
41
51
 
42
- | Hook | Description |
43
- | --------------------------------- | ---------------------------------------------------------------------------------------------- |
44
- | `useDebounce(value, delay)` | Returns a debounced copy of `value` that updates after `delay` ms of inactivity |
45
- | `useLocalStorage(key, initial)` | `localStorage`-backed state as a tuple `[value, set, remove]`. Returns `initial` on the server |
46
- | `useMediaQuery(query)` | Tracks a CSS media query. Returns `false` on the server |
47
- | `useOnClickOutside(ref, handler)` | Fires `handler` on `mousedown`/`touchstart` outside the given ref |
48
- | `usePrevious(value)` | Returns the previous render's value of a state or prop |
49
- | `useIsomorphicLayoutEffect` | `useLayoutEffect` on the client, `useEffect` on the server — eliminates SSR warnings |
50
-
51
- Import paths: `@teo-garcia/react-shared/hooks/<hook-name>`
52
+ ## Hooks
52
53
 
53
- ---
54
+ All hooks are SSR-safe unless their entire purpose is browser-only runtime
55
+ state.
56
+
57
+ | Hook | Description |
58
+ | --------------------------- | -------------------------------------------------------------------------- |
59
+ | `useBreakpoint` | Returns `{ breakpoint, width, height }` from a configurable breakpoint map |
60
+ | `useCopyToClipboard` | Copies text and reports copy state |
61
+ | `useDebounce` | Returns a debounced copy of a value |
62
+ | `useEventListener` | Typed event listener hook for `window`, `document`, and elements |
63
+ | `useIdle` | Tracks user idle state |
64
+ | `useIntersectionObserver` | Tracks element visibility/intersection |
65
+ | `useIsomorphicLayoutEffect` | `useLayoutEffect` on the client, `useEffect` on the server |
66
+ | `useLatest` | Keeps a stable ref to the latest value |
67
+ | `useLocalStorage` | `localStorage`-backed state |
68
+ | `useMediaQuery` | Tracks a CSS media query |
69
+ | `useNetworkStatus` | Tracks online/offline state |
70
+ | `useOnClickOutside` | Calls a handler when interaction happens outside a ref |
71
+ | `usePrevious` | Returns the previous render value |
72
+ | `useRenderCount` | Counts renders for debugging |
73
+ | `useToggle` | Small boolean state helper |
74
+ | `useWhyDidYouRender` | Dev helper for prop-change inspection |
75
+
76
+ Primary imports:
77
+
78
+ ```ts
79
+ import { useBreakpoint, useToggle } from '@teo-garcia/react-shared/hooks'
80
+ import { useBreakpoint } from '@teo-garcia/react-shared/hooks/use-breakpoint'
81
+ ```
54
82
 
55
83
  ## Components
56
84
 
57
- ### `ErrorBoundary`
58
-
59
- Catches thrown errors in child trees and renders a fallback. Supports four
60
- fallback patterns, auto-reset on prop changes, and focus-restoring "Try again"
61
- in the default UI.
62
-
63
- | Prop | Type | Description |
64
- | ------------------- | --------------------------------------------- | ---------------------------------------------------------------------- |
65
- | `FallbackComponent` | `ComponentType<{ error, resetError }>` | Highest-priority fallback — receives the error and a reset callback |
66
- | `fallbackRender` | `(props: { error, resetError }) => ReactNode` | Render-prop fallback |
67
- | `fallback` | `ReactNode \| (error) => ReactNode` | Static element or function fallback |
68
- | `resetKeys` | `unknown[]` | When any value in the array changes, the boundary resets automatically |
69
- | `onError` | `(error, errorInfo) => void` | Called after every caught error — use for logging or tracking |
70
- | `onReset` | `() => void` | Called whenever the boundary resets |
71
-
72
- Import path: `@teo-garcia/react-shared/components/error-boundary`
73
-
74
- ---
75
-
76
- ### `VisuallyHidden`
77
-
78
- Renders content that is invisible on screen but fully accessible to assistive
79
- technologies. Zero dependencies, RSC-safe, no Tailwind required.
80
-
81
- Use for: icon-only button labels, skip-navigation links, form hints,
82
- screen-reader-only status messages.
85
+ These are intentionally utility-oriented and design-system agnostic.
83
86
 
84
- Import path: `@teo-garcia/react-shared/components/visually-hidden`
87
+ ### Runtime primitives
85
88
 
86
- ---
89
+ - `AspectRatio`
90
+ - `ClientOnly`
91
+ - `ErrorBoundary`
92
+ - `FocusTrap`
93
+ - `Portal`
94
+ - `VisuallyHidden`
87
95
 
88
- ### `Skeleton`
96
+ ### Utility UI
89
97
 
90
- A single-line loading placeholder using Tailwind's `animate-pulse`. Accepts
91
- `className` for sizing so it adapts to any layout without wrapper divs.
98
+ - `Separator`
99
+ - `Skeleton`
100
+ - `SkipLink`
92
101
 
93
- Use for: card skeletons, text line placeholders, avatar placeholders, table row
94
- stubs.
102
+ ### Dev-only helpers
95
103
 
96
- Import path: `@teo-garcia/react-shared/components/skeleton`
104
+ - `DebugJSON`
105
+ - `DevPanel`
97
106
 
98
- ---
107
+ Notes:
99
108
 
100
- ### `Portal`
109
+ - `ClientOnly` renders a fallback on the server and swaps to client content
110
+ after hydration.
111
+ - `Skeleton`, `Separator`, and `SkipLink` are self-styled and do not require
112
+ Tailwind.
113
+ - `DevPanel` is self-contained, remembers collapsed state, and exposes `items`
114
+ plus `children` for custom diagnostics. By default it enables every built-in
115
+ diagnostic (`ALL_DEV_PANEL_FEATURES`); pass `features={[]}` for viewport,
116
+ breakpoint, and theme only.
101
117
 
102
- Renders children into a target DOM node outside the React tree via
103
- `createPortal`. SSR-safe — returns `null` until mounted. Treats
104
- `container={null}` as "not ready" and defers rendering, which pairs cleanly with
105
- `useRef`.
118
+ Primary imports:
106
119
 
107
- Use for: modals, drawers, tooltips, toasts — anything that must escape
108
- `overflow: hidden` or stacking context.
109
-
110
- Import path: `@teo-garcia/react-shared/components/portal`
111
-
112
- ---
113
-
114
- ### `FocusTrap`
115
-
116
- Traps keyboard focus within its container while `active`. Tab wraps from last to
117
- first element; Shift+Tab wraps from first to last. Restores focus to the
118
- previously focused element on deactivation or unmount.
119
-
120
- Use for: modals, dialogs, drawers, dropdowns — any overlay where focus must not
121
- escape.
122
-
123
- | Prop | Type | Default | Description |
124
- | -------------- | --------- | ------- | ----------------------------------------------- |
125
- | `active` | `boolean` | `true` | Enables or disables the trap |
126
- | `initialFocus` | `boolean` | `true` | Focuses the first focusable child on activation |
127
-
128
- Import path: `@teo-garcia/react-shared/components/focus-trap`
129
-
130
- ---
120
+ ```tsx
121
+ import {
122
+ ClientOnly,
123
+ DevPanel,
124
+ SkipLink,
125
+ } from '@teo-garcia/react-shared/components'
126
+ import { DevPanel } from '@teo-garcia/react-shared/components/dev-panel'
127
+ ```
131
128
 
132
129
  ## Utilities
133
130
 
134
- ### `cn`
135
-
136
- Merges Tailwind class names with conflict resolution later classes win. Built
137
- on `clsx` + `tailwind-merge`.
131
+ | Utility | Description |
132
+ | -------------- | ------------------------------------------------------------------------------------- |
133
+ | `cn` | `clsx` + `tailwind-merge` for Tailwind-heavy apps that want class conflict resolution |
134
+ | `formatDate` | Small date formatting helper |
135
+ | `formatNumber` | Number formatting helper |
136
+ | `truncate` | String truncation helper |
138
137
 
139
- Import path: `@teo-garcia/react-shared/utils/cn`
138
+ `cn` is kept because it is broadly useful in Tailwind apps, but the package
139
+ itself does not require Tailwind to function.
140
140
 
141
- ---
141
+ ## Test Utilities
142
142
 
143
- ## Test utilities
143
+ | Export | Description |
144
+ | ----------------------------------- | --------------------------------------------------- |
145
+ | `createWrapper(options?)` | Creates a reusable `QueryClientProvider` wrapper |
146
+ | `renderWithProviders(ui, options?)` | Convenience wrapper around Testing Library `render` |
144
147
 
145
- Helpers for wrapping components under test with a `QueryClient` provider.
148
+ Import path:
146
149
 
147
- | Export | Description |
148
- | ----------------------------------- | -------------------------------------------------------------------------------------------------- |
149
- | `createWrapper(options?)` | Returns a `QueryClientProvider` wrapper component. Create at module level, not inside render calls |
150
- | `renderWithProviders(ui, options?)` | Convenience wrapper around `@testing-library/react` `render` with `createWrapper` pre-applied |
150
+ ```ts
151
+ import {
152
+ createWrapper,
153
+ renderWithProviders,
154
+ } from '@teo-garcia/react-shared/test-utils'
155
+ ```
151
156
 
152
- Accepts an optional `queryClient` in options to inject a custom client (useful
153
- for testing query state).
157
+ ## DevPanel Example
158
+
159
+ ```tsx
160
+ import { DevPanel } from '@teo-garcia/react-shared/components/dev-panel'
161
+ ;<DevPanel
162
+ items={[
163
+ { label: 'route', value: pathname },
164
+ { label: 'tenant', value: tenantId ?? 'none' },
165
+ ]}
166
+ >
167
+ <span>feature-x</span>
168
+ </DevPanel>
169
+ ```
154
170
 
155
- Import path: `@teo-garcia/react-shared/test-utils`
171
+ With no `features` prop, every built-in diagnostic is enabled (see export
172
+ `ALL_DEV_PANEL_FEATURES`). Pass `features={[]}` for viewport, breakpoint, and
173
+ theme only. Import `ALL_DEV_PANEL_FEATURES` when you need the full list to build
174
+ a custom subset.
156
175
 
157
- ---
176
+ ## Export Paths
158
177
 
159
- ## All export paths
178
+ - `@teo-garcia/react-shared`
179
+ - `@teo-garcia/react-shared/components`
180
+ - `@teo-garcia/react-shared/hooks`
181
+ - `@teo-garcia/react-shared/utils`
182
+ - `@teo-garcia/react-shared/test-utils`
183
+ - focused subpaths such as `components/dev-panel` and `hooks/use-breakpoint`
160
184
 
161
- | Path | Contents |
162
- | ------------------------------------------------------------- | -------------------------------------- |
163
- | `@teo-garcia/react-shared/components` | All components (barrel) |
164
- | `@teo-garcia/react-shared/components/error-boundary` | `ErrorBoundary`, `FallbackProps` |
165
- | `@teo-garcia/react-shared/components/focus-trap` | `FocusTrap` |
166
- | `@teo-garcia/react-shared/components/portal` | `Portal` |
167
- | `@teo-garcia/react-shared/components/skeleton` | `Skeleton` |
168
- | `@teo-garcia/react-shared/components/visually-hidden` | `VisuallyHidden` |
169
- | `@teo-garcia/react-shared/hooks` | All hooks (barrel) |
170
- | `@teo-garcia/react-shared/hooks/use-debounce` | `useDebounce` |
171
- | `@teo-garcia/react-shared/hooks/use-isomorphic-layout-effect` | `useIsomorphicLayoutEffect` |
172
- | `@teo-garcia/react-shared/hooks/use-local-storage` | `useLocalStorage` |
173
- | `@teo-garcia/react-shared/hooks/use-media-query` | `useMediaQuery` |
174
- | `@teo-garcia/react-shared/hooks/use-on-click-outside` | `useOnClickOutside` |
175
- | `@teo-garcia/react-shared/hooks/use-previous` | `usePrevious` |
176
- | `@teo-garcia/react-shared/utils/cn` | `cn` |
177
- | `@teo-garcia/react-shared/test-utils` | `createWrapper`, `renderWithProviders` |
185
+ ## Scope Boundary
178
186
 
179
- ---
187
+ This package should stay React-focused and utility-oriented. It should not grow
188
+ into:
180
189
 
181
- ## Related packages
190
+ - a design system
191
+ - a component kit for a specific styling stack
192
+ - a dumping ground for framework-agnostic helpers
193
+ - a Nest/shared backend package
182
194
 
183
- | Package | Description |
184
- | ------------------------------------------------------------------------------------------ | ------------------- |
185
- | [@teo-garcia/eslint-config-shared](https://github.com/teo-garcia/eslint-config-shared) | ESLint rules |
186
- | [@teo-garcia/prettier-config-shared](https://github.com/teo-garcia/prettier-config-shared) | Prettier formatting |
187
- | [@teo-garcia/tsconfig-shared](https://github.com/teo-garcia/tsconfig-shared) | TypeScript settings |
188
- | [@teo-garcia/vitest-config-shared](https://github.com/teo-garcia/vitest-config-shared) | Test configuration |
195
+ Those concerns can split later into dedicated packages when the surface area is
196
+ clear enough.
189
197
 
190
198
  ## License
191
199
 
192
200
  MIT
193
-
194
- ---
195
-
196
- <div align="center">
197
- <sub>Built by <a href="https://github.com/teo-garcia">teo-garcia</a></sub>
198
- </div>
@@ -0,0 +1,11 @@
1
+ import { type ReactNode } from 'react';
2
+ export interface ClientOnlyProps {
3
+ children: ReactNode | (() => ReactNode);
4
+ fallback?: ReactNode;
5
+ }
6
+ /**
7
+ * Renders fallback content on the server and swaps to client-only content after
8
+ * hydration. Useful for anything that depends on browser APIs or mounted state.
9
+ */
10
+ export declare function ClientOnly({ children, fallback }: ClientOnlyProps): import("react/jsx-runtime").JSX.Element;
11
+ //# sourceMappingURL=client-only.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-only.d.ts","sourceRoot":"","sources":["../../../src/components/client-only/client-only.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAuB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAE3D,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,SAAS,GAAG,CAAC,MAAM,SAAS,CAAC,CAAA;IACvC,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,QAAe,EAAE,EAAE,eAAe,2CAYxE"}
@@ -0,0 +1,17 @@
1
+ 'use client';
2
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
3
+ import { useEffect, useState } from 'react';
4
+ /**
5
+ * Renders fallback content on the server and swaps to client-only content after
6
+ * hydration. Useful for anything that depends on browser APIs or mounted state.
7
+ */
8
+ export function ClientOnly({ children, fallback = null }) {
9
+ const [mounted, setMounted] = useState(false);
10
+ useEffect(() => {
11
+ setMounted(true);
12
+ }, []);
13
+ if (!mounted) {
14
+ return _jsx(_Fragment, { children: fallback });
15
+ }
16
+ return _jsx(_Fragment, { children: typeof children === 'function' ? children() : children });
17
+ }
@@ -0,0 +1,2 @@
1
+ export { ClientOnly, type ClientOnlyProps } from './client-only.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/client-only/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAA"}
@@ -0,0 +1 @@
1
+ export { ClientOnly } from './client-only.js';
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Optional diagnostics toggles for {@link DevPanel}. Subscribe only to what you pass.
3
+ */
4
+ export type DevPanelFeature = 'colorScheme' | 'connection' | 'contrast' | 'displayMode' | 'dpr' | 'focus' | 'fullscreen' | 'grid' | 'inverted' | 'locale' | 'media' | 'memory' | 'online' | 'orientation' | 'outline' | 'perf' | 'reducedTransparency' | 'safeArea' | 'saveData' | 'scrollbar' | 'scroll' | 'visibility' | 'visualViewport';
5
+ /**
6
+ * Full feature set used when {@link DevPanel} is rendered without a `features` prop.
7
+ * Pass `features={[]}` for viewport, breakpoint, and theme only.
8
+ */
9
+ export declare const ALL_DEV_PANEL_FEATURES: readonly DevPanelFeature[];
10
+ //# sourceMappingURL=dev-panel-features.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-panel-features.d.ts","sourceRoot":"","sources":["../../../src/components/dev-panel/dev-panel-features.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,eAAe,GACvB,aAAa,GACb,YAAY,GACZ,UAAU,GACV,aAAa,GACb,KAAK,GACL,OAAO,GACP,YAAY,GACZ,MAAM,GACN,UAAU,GACV,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,aAAa,GACb,SAAS,GACT,MAAM,GACN,qBAAqB,GACrB,UAAU,GACV,UAAU,GACV,WAAW,GACX,QAAQ,GACR,YAAY,GACZ,gBAAgB,CAAA;AAEpB;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,SAAS,eAAe,EAwB5D,CAAA"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Full feature set used when {@link DevPanel} is rendered without a `features` prop.
3
+ * Pass `features={[]}` for viewport, breakpoint, and theme only.
4
+ */
5
+ export const ALL_DEV_PANEL_FEATURES = [
6
+ 'colorScheme',
7
+ 'connection',
8
+ 'contrast',
9
+ 'displayMode',
10
+ 'dpr',
11
+ 'focus',
12
+ 'fullscreen',
13
+ 'grid',
14
+ 'inverted',
15
+ 'locale',
16
+ 'media',
17
+ 'memory',
18
+ 'online',
19
+ 'orientation',
20
+ 'outline',
21
+ 'perf',
22
+ 'reducedTransparency',
23
+ 'safeArea',
24
+ 'saveData',
25
+ 'scrollbar',
26
+ 'scroll',
27
+ 'visibility',
28
+ 'visualViewport',
29
+ ];
@@ -1,27 +1,25 @@
1
1
  import { type ReactNode } from 'react';
2
+ import { type DevPanelFeature } from './dev-panel-features.js';
3
+ export { ALL_DEV_PANEL_FEATURES, type DevPanelFeature, } from './dev-panel-features.js';
4
+ export interface DevPanelItem {
5
+ label: string;
6
+ title?: string;
7
+ value: ReactNode;
8
+ }
9
+ export type DevPanelLayout = 'hud' | 'inspector' | 'stack';
2
10
  export interface DevPanelProps {
3
- /**
4
- * Tailwind breakpoint map. Defaults to standard Tailwind v4 breakpoints.
5
- * Pass your own if you've customized the theme.
6
- */
7
11
  breakpoints?: Record<string, number>;
8
- /** Additional debug content rendered inside the panel. */
9
12
  children?: ReactNode;
10
- /**
11
- * Keyboard shortcut to toggle the panel.
12
- * Format: modifier keys joined by `+`, then the key. Defaults to `'shift+d'`.
13
- */
13
+ /** Defaults to {@link ALL_DEV_PANEL_FEATURES}. Pass `[]` for core metrics only. */
14
+ features?: DevPanelFeature[];
15
+ items?: DevPanelItem[];
16
+ layout?: DevPanelLayout;
14
17
  shortcut?: string;
18
+ storageKey?: string;
15
19
  }
16
20
  /**
17
- * Fixed bottom-center overlay showing the current Tailwind breakpoint, viewport
18
- * dimensions, and color scheme. Dev-only — renders nothing in production.
19
- *
20
- * Positioned at bottom-center to avoid clashing with Next.js (top-left) and
21
- * TanStack devtools (bottom-right). Collapses to a compact pill on close.
22
- *
23
- * Pass `children` to add custom debug rows (route, user ID, feature flags…).
24
- * Toggle with the keyboard shortcut (default: Shift+D).
21
+ * Development overlay: viewport px, Tailwind-style breakpoint, resolved theme,
22
+ * plus optional diagnostics enabled via `features`.
25
23
  */
26
24
  export declare function DevPanel(props: DevPanelProps): import("react/jsx-runtime").JSX.Element | null;
27
25
  //# sourceMappingURL=dev-panel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dev-panel.d.ts","sourceRoot":"","sources":["../../../src/components/dev-panel/dev-panel.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAuB,KAAK,SAAS,EAAsB,MAAM,OAAO,CAAA;AAiC/E,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACpC,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AA8MD;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,kDAG5C"}
1
+ {"version":3,"file":"dev-panel.d.ts","sourceRoot":"","sources":["../../../src/components/dev-panel/dev-panel.tsx"],"names":[],"mappings":"AAEA,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,OAAO,CAAA;AAOd,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,yBAAyB,CAAA;AAOhC,OAAO,EACL,sBAAsB,EACtB,KAAK,eAAe,GACrB,MAAM,yBAAyB,CAAA;AAuEhC,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,SAAS,CAAA;CACjB;AAED,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,WAAW,GAAG,OAAO,CAAA;AAE1D,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACpC,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,mFAAmF;IACnF,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAA;IAC5B,KAAK,CAAC,EAAE,YAAY,EAAE,CAAA;IACtB,MAAM,CAAC,EAAE,cAAc,CAAA;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAo1BD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,kDAG5C"}