@omnitron-dev/prism 0.1.1
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/LICENSE +21 -0
- package/README.md +44 -0
- package/bin/prism.js +13 -0
- package/dist/accessibility/index.d.ts +157 -0
- package/dist/accessibility/index.js +186 -0
- package/dist/accessibility/index.js.map +1 -0
- package/dist/blocks/index.d.ts +1239 -0
- package/dist/blocks/index.js +1712 -0
- package/dist/blocks/index.js.map +1 -0
- package/dist/chunk-77KIJLPP.js +37 -0
- package/dist/chunk-77KIJLPP.js.map +1 -0
- package/dist/chunk-BTIT7WYH.js +339 -0
- package/dist/chunk-BTIT7WYH.js.map +1 -0
- package/dist/chunk-BV32OJ2A.js +1409 -0
- package/dist/chunk-BV32OJ2A.js.map +1 -0
- package/dist/chunk-DDY7TLUI.js +139 -0
- package/dist/chunk-DDY7TLUI.js.map +1 -0
- package/dist/chunk-DXXZ3ITR.js +4227 -0
- package/dist/chunk-DXXZ3ITR.js.map +1 -0
- package/dist/chunk-E3XANPTO.js +2319 -0
- package/dist/chunk-E3XANPTO.js.map +1 -0
- package/dist/chunk-FU52GL2E.js +3 -0
- package/dist/chunk-FU52GL2E.js.map +1 -0
- package/dist/chunk-GYDT5EKX.js +16505 -0
- package/dist/chunk-GYDT5EKX.js.map +1 -0
- package/dist/chunk-HO2GKTWJ.js +28 -0
- package/dist/chunk-HO2GKTWJ.js.map +1 -0
- package/dist/chunk-JDTC2SBY.js +140 -0
- package/dist/chunk-JDTC2SBY.js.map +1 -0
- package/dist/chunk-JNU4QHJK.js +6 -0
- package/dist/chunk-JNU4QHJK.js.map +1 -0
- package/dist/chunk-LAEY5USO.js +2621 -0
- package/dist/chunk-LAEY5USO.js.map +1 -0
- package/dist/chunk-UR6X3W5I.js +530 -0
- package/dist/chunk-UR6X3W5I.js.map +1 -0
- package/dist/chunk-WC2WM2JD.js +883 -0
- package/dist/chunk-WC2WM2JD.js.map +1 -0
- package/dist/chunk-XWL6J6IO.js +40 -0
- package/dist/chunk-XWL6J6IO.js.map +1 -0
- package/dist/cli/index.js +2695 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/config-BA6IeTq9.d.ts +100 -0
- package/dist/core/index.d.ts +454 -0
- package/dist/core/index.js +9 -0
- package/dist/core/index.js.map +1 -0
- package/dist/forms/index.d.ts +562 -0
- package/dist/forms/index.js +545 -0
- package/dist/forms/index.js.map +1 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/index.js +10 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/http/index.d.ts +233 -0
- package/dist/http/index.js +282 -0
- package/dist/http/index.js.map +1 -0
- package/dist/index-odhPSv9I.d.ts +2491 -0
- package/dist/index.css +131 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +9109 -0
- package/dist/index.js +13280 -0
- package/dist/index.js.map +1 -0
- package/dist/layouts/index.d.ts +854 -0
- package/dist/layouts/index.js +6 -0
- package/dist/layouts/index.js.map +1 -0
- package/dist/netron/index.d.ts +4 -0
- package/dist/netron/index.js +4 -0
- package/dist/netron/index.js.map +1 -0
- package/dist/registry/index.d.ts +352 -0
- package/dist/registry/index.js +4 -0
- package/dist/registry/index.js.map +1 -0
- package/dist/registry-BrDNftd5.d.ts +574 -0
- package/dist/settings-plpR26Xk.d.ts +455 -0
- package/dist/state/index.d.ts +981 -0
- package/dist/state/index.js +5 -0
- package/dist/state/index.js.map +1 -0
- package/dist/theme/index.d.ts +1049 -0
- package/dist/theme/index.js +5 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme-CrXLfP1c.d.ts +389 -0
- package/dist/types/index.d.ts +146 -0
- package/dist/types/index.js +5 -0
- package/dist/types/index.js.map +1 -0
- package/dist/use-timeout-D7U3EAtH.d.ts +808 -0
- package/package.json +194 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { T as ThemeConfig } from './theme-CrXLfP1c.js';
|
|
2
|
+
import { R as RegistryConfig } from './registry-BrDNftd5.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Configuration Type Definitions
|
|
6
|
+
*
|
|
7
|
+
* @module @omnitron-dev/prism/types/config
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Style framework options.
|
|
12
|
+
*/
|
|
13
|
+
type StyleFramework = 'mui' | 'tailwind' | 'emotion';
|
|
14
|
+
/**
|
|
15
|
+
* Paths configuration.
|
|
16
|
+
*/
|
|
17
|
+
interface PathsConfig {
|
|
18
|
+
/** Path to components directory */
|
|
19
|
+
components: string;
|
|
20
|
+
/** Path to blocks directory */
|
|
21
|
+
blocks: string;
|
|
22
|
+
/** Path to theme directory */
|
|
23
|
+
themes: string;
|
|
24
|
+
/** Path to utilities directory */
|
|
25
|
+
utils: string;
|
|
26
|
+
/** Path to types directory */
|
|
27
|
+
types: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Style configuration.
|
|
31
|
+
*/
|
|
32
|
+
interface StyleConfig {
|
|
33
|
+
/** Style framework */
|
|
34
|
+
framework: StyleFramework;
|
|
35
|
+
/** Enable CSS variables */
|
|
36
|
+
cssVariables: boolean;
|
|
37
|
+
/** CSS variable prefix */
|
|
38
|
+
prefix: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Features configuration.
|
|
42
|
+
*/
|
|
43
|
+
interface FeaturesConfig {
|
|
44
|
+
/** Enable dark mode */
|
|
45
|
+
darkMode: boolean;
|
|
46
|
+
/** Enable RTL support */
|
|
47
|
+
rtl: boolean;
|
|
48
|
+
/** Enable i18n support */
|
|
49
|
+
i18n: boolean;
|
|
50
|
+
/** Enable analytics */
|
|
51
|
+
analytics: boolean;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Prism CLI configuration.
|
|
55
|
+
*/
|
|
56
|
+
interface PrismConfig {
|
|
57
|
+
/** Project name */
|
|
58
|
+
name?: string;
|
|
59
|
+
/** Paths configuration */
|
|
60
|
+
paths: PathsConfig;
|
|
61
|
+
/** Registry configuration */
|
|
62
|
+
registries: RegistryConfig;
|
|
63
|
+
/** Theme configuration */
|
|
64
|
+
theme: ThemeConfig;
|
|
65
|
+
/** Style configuration */
|
|
66
|
+
style: StyleConfig;
|
|
67
|
+
/** Features configuration */
|
|
68
|
+
features: FeaturesConfig;
|
|
69
|
+
/** TypeScript enabled */
|
|
70
|
+
typescript: boolean;
|
|
71
|
+
/** Custom aliases */
|
|
72
|
+
aliases?: Record<string, string>;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Prism config file (prism.config.ts).
|
|
76
|
+
*/
|
|
77
|
+
interface PrismConfigFile {
|
|
78
|
+
/** Configuration object or factory function */
|
|
79
|
+
default: PrismConfig | (() => PrismConfig) | (() => Promise<PrismConfig>);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Default configuration values.
|
|
83
|
+
*/
|
|
84
|
+
declare const defaultPrismConfig: PrismConfig;
|
|
85
|
+
/**
|
|
86
|
+
* Partial config for user-defined overrides.
|
|
87
|
+
*/
|
|
88
|
+
type PartialPrismConfig = DeepPartial<PrismConfig>;
|
|
89
|
+
/**
|
|
90
|
+
* Deep partial type helper.
|
|
91
|
+
*/
|
|
92
|
+
type DeepPartial<T> = {
|
|
93
|
+
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Define config helper type.
|
|
97
|
+
*/
|
|
98
|
+
type DefineConfigFn = (config: PartialPrismConfig) => PrismConfig;
|
|
99
|
+
|
|
100
|
+
export { type DefineConfigFn as D, type FeaturesConfig as F, type PartialPrismConfig as P, type StyleConfig as S, type PathsConfig as a, type PrismConfig as b, type PrismConfigFile as c, type StyleFramework as d, defaultPrismConfig as e };
|
|
@@ -0,0 +1,454 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode, ComponentType, FC } from 'react';
|
|
3
|
+
import { b as PrismConfig, P as PartialPrismConfig } from '../config-BA6IeTq9.js';
|
|
4
|
+
import { o as PrismTheme, a as ThemeMode, b as ThemePreset, c as ThemeDirection } from '../theme-CrXLfP1c.js';
|
|
5
|
+
import { b as NavLayout, N as NavColor } from '../settings-plpR26Xk.js';
|
|
6
|
+
export { C as CopyState, a as CountdownControls, b as CountdownState, S as SetState, U as UseCopyToClipboardOptions, c as UseCopyToClipboardReturn, d as UseCountdownOptions, e as UseCountdownReturn, f as UseMountedReturn, g as UseMultiSelectOptions, h as UseMultiSelectReturn, i as UseSetStateReturn, j as UseTimeoutReturn, u as useBoolean, k as useBreakpoints, l as useClickOutside, m as useCopyToClipboard, n as useCountdown, o as useDebounce, p as useDebounceCallback, q as useEventListener, r as useInterval, s as useIsClient, t as useLocalStorage, v as useMounted, w as useMultiSelect, x as usePrevious, y as useSetState, z as useTimeout } from '../use-timeout-D7U3EAtH.js';
|
|
7
|
+
import { SxProps, Theme } from '@mui/material';
|
|
8
|
+
export { useMediaQuery } from '@mui/material';
|
|
9
|
+
import '../registry-BrDNftd5.js';
|
|
10
|
+
import '@mui/material/styles';
|
|
11
|
+
import 'zustand';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Settings state managed by Prism.
|
|
15
|
+
* @deprecated Use useSettingsStore from '@omnitron-dev/prism/state' for full settings access.
|
|
16
|
+
* This interface is maintained for backwards compatibility with PrismContext.
|
|
17
|
+
*/
|
|
18
|
+
interface PrismSettingsState {
|
|
19
|
+
/** Current theme mode */
|
|
20
|
+
mode: ThemeMode;
|
|
21
|
+
/** Current theme preset */
|
|
22
|
+
preset: ThemePreset;
|
|
23
|
+
/** Text direction */
|
|
24
|
+
direction: ThemeDirection;
|
|
25
|
+
/** Sidebar collapsed state */
|
|
26
|
+
sidebarCollapsed: boolean;
|
|
27
|
+
/** Settings drawer open */
|
|
28
|
+
settingsDrawerOpen: boolean;
|
|
29
|
+
/** Primary color override */
|
|
30
|
+
primaryColor: string | null;
|
|
31
|
+
/** High contrast mode */
|
|
32
|
+
contrast: 'default' | 'high';
|
|
33
|
+
/** Base font size (12-20) */
|
|
34
|
+
fontSize: number;
|
|
35
|
+
/** Selected font family */
|
|
36
|
+
fontFamily: string;
|
|
37
|
+
/** Navigation layout */
|
|
38
|
+
navLayout: NavLayout;
|
|
39
|
+
/** Navigation color mode */
|
|
40
|
+
navColor: NavColor;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Prism context value.
|
|
44
|
+
*/
|
|
45
|
+
interface PrismContextValue {
|
|
46
|
+
/** Current configuration */
|
|
47
|
+
config: PrismConfig;
|
|
48
|
+
/** Current theme */
|
|
49
|
+
theme: PrismTheme;
|
|
50
|
+
/** Settings state */
|
|
51
|
+
settings: PrismSettingsState;
|
|
52
|
+
/** Set theme mode */
|
|
53
|
+
setMode: (mode: ThemeMode) => void;
|
|
54
|
+
/** Toggle between light/dark */
|
|
55
|
+
toggleMode: () => void;
|
|
56
|
+
/** Set theme preset */
|
|
57
|
+
setPreset: (preset: ThemePreset) => void;
|
|
58
|
+
/** Set text direction */
|
|
59
|
+
setDirection: (direction: ThemeDirection) => void;
|
|
60
|
+
/** Toggle sidebar */
|
|
61
|
+
toggleSidebar: () => void;
|
|
62
|
+
/** Set sidebar collapsed */
|
|
63
|
+
setSidebarCollapsed: (collapsed: boolean) => void;
|
|
64
|
+
/** Open settings drawer */
|
|
65
|
+
openSettingsDrawer: () => void;
|
|
66
|
+
/** Close settings drawer */
|
|
67
|
+
closeSettingsDrawer: () => void;
|
|
68
|
+
/** Toggle settings drawer */
|
|
69
|
+
toggleSettingsDrawer: () => void;
|
|
70
|
+
/** Reset all settings to defaults */
|
|
71
|
+
resetSettings: () => void;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Prism context.
|
|
75
|
+
*/
|
|
76
|
+
declare const PrismContext: react.Context<PrismContextValue | null>;
|
|
77
|
+
/**
|
|
78
|
+
* Hook to access Prism context.
|
|
79
|
+
*
|
|
80
|
+
* @returns Prism context value
|
|
81
|
+
* @throws If used outside PrismProvider
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```tsx
|
|
85
|
+
* function MyComponent() {
|
|
86
|
+
* const { theme, setMode, toggleSidebar } = usePrismContext();
|
|
87
|
+
*
|
|
88
|
+
* return (
|
|
89
|
+
* <Button onClick={() => setMode('dark')}>
|
|
90
|
+
* Switch to Dark Mode
|
|
91
|
+
* </Button>
|
|
92
|
+
* );
|
|
93
|
+
* }
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
declare function usePrismContext(): PrismContextValue;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Prism Provider
|
|
100
|
+
*
|
|
101
|
+
* Root provider for the Prism design system.
|
|
102
|
+
* Uses useSettingsStore (Zustand) as the single source of truth for settings.
|
|
103
|
+
*
|
|
104
|
+
* @module @omnitron-dev/prism/core/provider
|
|
105
|
+
*/
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Props for PrismProvider.
|
|
109
|
+
*/
|
|
110
|
+
interface PrismProviderProps {
|
|
111
|
+
/** Child components */
|
|
112
|
+
children: ReactNode;
|
|
113
|
+
/** Configuration overrides */
|
|
114
|
+
config?: PartialPrismConfig;
|
|
115
|
+
/** Default settings (overrides defaults but not persisted values) */
|
|
116
|
+
defaultSettings?: Partial<PrismSettingsState>;
|
|
117
|
+
/** Disable CSS baseline */
|
|
118
|
+
disableCssBaseline?: boolean;
|
|
119
|
+
/** Custom theme overrides */
|
|
120
|
+
themeOverrides?: Record<string, unknown>;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* PrismProvider - Root provider for Prism design system.
|
|
124
|
+
*
|
|
125
|
+
* Provides theme, settings, and configuration to all child components.
|
|
126
|
+
* Uses Zustand's useSettingsStore as the single source of truth for settings.
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```tsx
|
|
130
|
+
* import { PrismProvider } from '@omnitron-dev/prism';
|
|
131
|
+
*
|
|
132
|
+
* function App() {
|
|
133
|
+
* return (
|
|
134
|
+
* <PrismProvider
|
|
135
|
+
* config={{
|
|
136
|
+
* theme: { preset: 'luxury', mode: 'dark' },
|
|
137
|
+
* features: { darkMode: true, rtl: true },
|
|
138
|
+
* }}
|
|
139
|
+
* >
|
|
140
|
+
* <YourApp />
|
|
141
|
+
* </PrismProvider>
|
|
142
|
+
* );
|
|
143
|
+
* }
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
146
|
+
declare function PrismProvider({ children, config: configOverrides, defaultSettings, disableCssBaseline, themeOverrides, }: PrismProviderProps): ReactNode;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Provider Stack Utilities
|
|
150
|
+
*
|
|
151
|
+
* Composable provider pattern for building flexible provider hierarchies.
|
|
152
|
+
*
|
|
153
|
+
* @module @omnitron-dev/prism/core/provider-stack
|
|
154
|
+
*/
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* A provider component with its props.
|
|
158
|
+
*/
|
|
159
|
+
type ProviderEntry<P = Record<string, unknown>> = [ComponentType<P & {
|
|
160
|
+
children: ReactNode;
|
|
161
|
+
}>, P];
|
|
162
|
+
/**
|
|
163
|
+
* A provider that takes only children.
|
|
164
|
+
*/
|
|
165
|
+
type SimpleProvider = ComponentType<{
|
|
166
|
+
children: ReactNode;
|
|
167
|
+
}>;
|
|
168
|
+
/**
|
|
169
|
+
* Provider entry that can be a simple component or a tuple with props.
|
|
170
|
+
*/
|
|
171
|
+
type ProviderConfig = SimpleProvider | ProviderEntry;
|
|
172
|
+
/**
|
|
173
|
+
* Options for createProviderStack.
|
|
174
|
+
*/
|
|
175
|
+
interface ProviderStackOptions {
|
|
176
|
+
/** Display name for debugging */
|
|
177
|
+
displayName?: string;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Compose multiple providers into a single component.
|
|
181
|
+
* Providers are applied from left to right (first provider wraps outermost).
|
|
182
|
+
*
|
|
183
|
+
* @param providers - Array of providers to compose
|
|
184
|
+
* @returns A single component that renders all providers
|
|
185
|
+
*
|
|
186
|
+
* @example
|
|
187
|
+
* ```tsx
|
|
188
|
+
* const AppProviders = composeProviders([
|
|
189
|
+
* ThemeProvider,
|
|
190
|
+
* [AuthProvider, { client: authClient }],
|
|
191
|
+
* [QueryProvider, { client: queryClient }],
|
|
192
|
+
* ToastProvider,
|
|
193
|
+
* ]);
|
|
194
|
+
*
|
|
195
|
+
* function App() {
|
|
196
|
+
* return (
|
|
197
|
+
* <AppProviders>
|
|
198
|
+
* <YourApp />
|
|
199
|
+
* </AppProviders>
|
|
200
|
+
* );
|
|
201
|
+
* }
|
|
202
|
+
* ```
|
|
203
|
+
*/
|
|
204
|
+
declare function composeProviders(providers: ProviderConfig[]): FC<{
|
|
205
|
+
children: ReactNode;
|
|
206
|
+
}>;
|
|
207
|
+
/**
|
|
208
|
+
* Create a provider stack factory for building customizable provider hierarchies.
|
|
209
|
+
*
|
|
210
|
+
* @param baseProviders - Base providers that are always included
|
|
211
|
+
* @param options - Configuration options
|
|
212
|
+
* @returns A factory function for creating provider components
|
|
213
|
+
*
|
|
214
|
+
* @example
|
|
215
|
+
* ```tsx
|
|
216
|
+
* // Define base stack
|
|
217
|
+
* const createAppProviders = createProviderStack([
|
|
218
|
+
* ThemeProvider,
|
|
219
|
+
* [I18nProvider, { locale: 'en' }],
|
|
220
|
+
* ]);
|
|
221
|
+
*
|
|
222
|
+
* // Create with additional providers
|
|
223
|
+
* const AppProviders = createAppProviders({
|
|
224
|
+
* prepend: [ErrorBoundaryProvider],
|
|
225
|
+
* append: [ToastProvider, NotificationProvider],
|
|
226
|
+
* });
|
|
227
|
+
*
|
|
228
|
+
* // Or use without modifications
|
|
229
|
+
* const SimpleProviders = createAppProviders();
|
|
230
|
+
* ```
|
|
231
|
+
*/
|
|
232
|
+
declare function createProviderStack(baseProviders: ProviderConfig[], options?: ProviderStackOptions): (config?: {
|
|
233
|
+
prepend?: ProviderConfig[];
|
|
234
|
+
append?: ProviderConfig[];
|
|
235
|
+
replace?: ProviderConfig[];
|
|
236
|
+
}) => FC<{
|
|
237
|
+
children: ReactNode;
|
|
238
|
+
}>;
|
|
239
|
+
/**
|
|
240
|
+
* Props for ProviderStack component.
|
|
241
|
+
*/
|
|
242
|
+
interface ProviderStackProps {
|
|
243
|
+
/** Provider configurations */
|
|
244
|
+
providers: ProviderConfig[];
|
|
245
|
+
/** Child components */
|
|
246
|
+
children: ReactNode;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* ProviderStack - Declarative provider composition component.
|
|
250
|
+
*
|
|
251
|
+
* @example
|
|
252
|
+
* ```tsx
|
|
253
|
+
* function App() {
|
|
254
|
+
* const providers = useMemo(() => [
|
|
255
|
+
* ThemeProvider,
|
|
256
|
+
* [AuthProvider, { client }],
|
|
257
|
+
* ToastProvider,
|
|
258
|
+
* ], [client]);
|
|
259
|
+
*
|
|
260
|
+
* return (
|
|
261
|
+
* <ProviderStack providers={providers}>
|
|
262
|
+
* <YourApp />
|
|
263
|
+
* </ProviderStack>
|
|
264
|
+
* );
|
|
265
|
+
* }
|
|
266
|
+
* ```
|
|
267
|
+
*/
|
|
268
|
+
declare function ProviderStack({ providers, children }: ProviderStackProps): ReactNode;
|
|
269
|
+
/**
|
|
270
|
+
* Create a provider component with bound props.
|
|
271
|
+
* Useful for creating reusable provider configurations.
|
|
272
|
+
*
|
|
273
|
+
* @param Provider - The provider component
|
|
274
|
+
* @param props - Props to bind to the provider
|
|
275
|
+
* @returns A new component with bound props
|
|
276
|
+
*
|
|
277
|
+
* @example
|
|
278
|
+
* ```tsx
|
|
279
|
+
* const BoundQueryProvider = withProviderProps(QueryClientProvider, {
|
|
280
|
+
* client: queryClient,
|
|
281
|
+
* });
|
|
282
|
+
*
|
|
283
|
+
* // Use like a simple provider
|
|
284
|
+
* <BoundQueryProvider>
|
|
285
|
+
* <App />
|
|
286
|
+
* </BoundQueryProvider>
|
|
287
|
+
* ```
|
|
288
|
+
*/
|
|
289
|
+
declare function withProviderProps<P extends object>(Provider: ComponentType<P & {
|
|
290
|
+
children: ReactNode;
|
|
291
|
+
}>, props: P): SimpleProvider;
|
|
292
|
+
/**
|
|
293
|
+
* Create a conditional provider that only renders when condition is true.
|
|
294
|
+
*
|
|
295
|
+
* @param Provider - The provider component
|
|
296
|
+
* @param condition - Whether to render the provider
|
|
297
|
+
* @returns A provider that renders conditionally
|
|
298
|
+
*
|
|
299
|
+
* @example
|
|
300
|
+
* ```tsx
|
|
301
|
+
* const providers = [
|
|
302
|
+
* ThemeProvider,
|
|
303
|
+
* conditionalProvider(DevToolsProvider, process.env.NODE_ENV === 'development'),
|
|
304
|
+
* AuthProvider,
|
|
305
|
+
* ];
|
|
306
|
+
* ```
|
|
307
|
+
*/
|
|
308
|
+
declare function conditionalProvider<P extends {
|
|
309
|
+
children: ReactNode;
|
|
310
|
+
}>(Provider: ComponentType<P>, condition: boolean, props?: Omit<P, 'children'>): ProviderConfig | null;
|
|
311
|
+
/**
|
|
312
|
+
* Filter out null/undefined providers from a provider array.
|
|
313
|
+
*
|
|
314
|
+
* @param providers - Array of providers that may contain nulls
|
|
315
|
+
* @returns Filtered array of valid providers
|
|
316
|
+
*
|
|
317
|
+
* @example
|
|
318
|
+
* ```tsx
|
|
319
|
+
* const providers = filterProviders([
|
|
320
|
+
* ThemeProvider,
|
|
321
|
+
* conditionalProvider(DevToolsProvider, isDev),
|
|
322
|
+
* conditionalProvider(MockProvider, isMocking),
|
|
323
|
+
* AuthProvider,
|
|
324
|
+
* ]);
|
|
325
|
+
* ```
|
|
326
|
+
*/
|
|
327
|
+
declare function filterProviders(providers: (ProviderConfig | null | undefined)[]): ProviderConfig[];
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* Skip Link Component
|
|
331
|
+
*
|
|
332
|
+
* Provides keyboard users a way to skip navigation and jump to main content.
|
|
333
|
+
*
|
|
334
|
+
* @module @omnitron-dev/prism/core/accessibility/skip-link
|
|
335
|
+
*/
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Props for SkipLink component.
|
|
339
|
+
*/
|
|
340
|
+
interface SkipLinkProps {
|
|
341
|
+
/** Target element ID to skip to */
|
|
342
|
+
href: string;
|
|
343
|
+
/** Link content (typically "Skip to main content") */
|
|
344
|
+
children: ReactNode;
|
|
345
|
+
/** MUI sx prop */
|
|
346
|
+
sx?: SxProps<Theme>;
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Skip link that is visually hidden until focused.
|
|
350
|
+
* Allows keyboard users to skip navigation and jump to main content.
|
|
351
|
+
*
|
|
352
|
+
* @example
|
|
353
|
+
* ```tsx
|
|
354
|
+
* <SkipLink href="#main-content">Skip to main content</SkipLink>
|
|
355
|
+
* ```
|
|
356
|
+
*/
|
|
357
|
+
declare function SkipLink({ href, children, sx }: SkipLinkProps): ReactNode;
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Accessibility Utilities
|
|
361
|
+
*
|
|
362
|
+
* WCAG 2.1 compliant accessibility components and utilities.
|
|
363
|
+
*
|
|
364
|
+
* @module @omnitron-dev/prism/core/accessibility
|
|
365
|
+
*/
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Generate ID for accessibility references.
|
|
369
|
+
*/
|
|
370
|
+
declare function generateAriaId(prefix: string): string;
|
|
371
|
+
/**
|
|
372
|
+
* Combine multiple aria-describedby values.
|
|
373
|
+
*/
|
|
374
|
+
declare function combineAriaDescribedBy(...ids: (string | undefined)[]): string | undefined;
|
|
375
|
+
/**
|
|
376
|
+
* Screen reader only styles (visually hidden but accessible).
|
|
377
|
+
*/
|
|
378
|
+
declare const srOnly: {
|
|
379
|
+
position: "absolute";
|
|
380
|
+
width: string;
|
|
381
|
+
height: string;
|
|
382
|
+
padding: number;
|
|
383
|
+
margin: string;
|
|
384
|
+
overflow: string;
|
|
385
|
+
clip: string;
|
|
386
|
+
whiteSpace: "nowrap";
|
|
387
|
+
border: number;
|
|
388
|
+
};
|
|
389
|
+
/**
|
|
390
|
+
* Focus visible styles for keyboard navigation.
|
|
391
|
+
*/
|
|
392
|
+
declare const focusVisibleStyles: (theme: {
|
|
393
|
+
palette: {
|
|
394
|
+
primary: {
|
|
395
|
+
main: string;
|
|
396
|
+
};
|
|
397
|
+
};
|
|
398
|
+
}) => {
|
|
399
|
+
'&:focus-visible': {
|
|
400
|
+
outline: string;
|
|
401
|
+
outlineOffset: number;
|
|
402
|
+
};
|
|
403
|
+
};
|
|
404
|
+
/**
|
|
405
|
+
* Handle keyboard navigation for list items.
|
|
406
|
+
*/
|
|
407
|
+
declare function handleListKeyDown(event: React.KeyboardEvent, options: {
|
|
408
|
+
items: HTMLElement[];
|
|
409
|
+
currentIndex: number;
|
|
410
|
+
onSelect?: (index: number) => void;
|
|
411
|
+
orientation?: 'vertical' | 'horizontal';
|
|
412
|
+
}): void;
|
|
413
|
+
/**
|
|
414
|
+
* Standard ARIA landmark labels.
|
|
415
|
+
*/
|
|
416
|
+
declare const ARIA_LABELS: {
|
|
417
|
+
/** Main navigation */
|
|
418
|
+
readonly mainNav: "Main navigation";
|
|
419
|
+
/** Secondary navigation */
|
|
420
|
+
readonly secondaryNav: "Secondary navigation";
|
|
421
|
+
/** Search */
|
|
422
|
+
readonly search: "Search";
|
|
423
|
+
/** Main content */
|
|
424
|
+
readonly main: "Main content";
|
|
425
|
+
/** Header */
|
|
426
|
+
readonly header: "Header";
|
|
427
|
+
/** Footer */
|
|
428
|
+
readonly footer: "Footer";
|
|
429
|
+
/** Sidebar */
|
|
430
|
+
readonly sidebar: "Sidebar";
|
|
431
|
+
/** Breadcrumb navigation */
|
|
432
|
+
readonly breadcrumb: "Breadcrumb navigation";
|
|
433
|
+
/** User menu */
|
|
434
|
+
readonly userMenu: "User menu";
|
|
435
|
+
/** Settings */
|
|
436
|
+
readonly settings: "Settings";
|
|
437
|
+
};
|
|
438
|
+
/**
|
|
439
|
+
* Common ARIA expanded patterns.
|
|
440
|
+
*/
|
|
441
|
+
interface AriaExpandedProps {
|
|
442
|
+
'aria-expanded': boolean;
|
|
443
|
+
'aria-controls'?: string;
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Get aria-expanded props.
|
|
447
|
+
*/
|
|
448
|
+
declare function getAriaExpanded(expanded: boolean, controlsId?: string): AriaExpandedProps;
|
|
449
|
+
/**
|
|
450
|
+
* Announce message to screen readers.
|
|
451
|
+
*/
|
|
452
|
+
declare function announceToScreenReader(message: string, priority?: 'polite' | 'assertive'): void;
|
|
453
|
+
|
|
454
|
+
export { ARIA_LABELS, type AriaExpandedProps, PrismContext, PrismProvider, type PrismProviderProps, type ProviderConfig, type ProviderEntry, ProviderStack, type ProviderStackOptions, type ProviderStackProps, type SimpleProvider, SkipLink, type SkipLinkProps, announceToScreenReader, combineAriaDescribedBy, composeProviders, conditionalProvider, createProviderStack, filterProviders, focusVisibleStyles, generateAriaId, getAriaExpanded, handleListKeyDown, srOnly, usePrismContext, withProviderProps };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { PrismContext, PrismProvider, ProviderStack, composeProviders, conditionalProvider, createProviderStack, filterProviders, useBreakpoints, useClickOutside, useCopyToClipboard, useCountdown, useDebounce, useDebounceCallback, useEventListener, useInterval, useIsClient, useLocalStorage, useMuiMediaQuery as useMediaQuery, useMounted, useMultiSelect, usePrevious, usePrismContext, useSetState, useTimeout, withProviderProps } from '../chunk-WC2WM2JD.js';
|
|
2
|
+
import '../chunk-DXXZ3ITR.js';
|
|
3
|
+
export { ARIA_LABELS, SkipLink, announceToScreenReader, combineAriaDescribedBy, focusVisibleStyles, generateAriaId, getAriaExpanded, handleListKeyDown, srOnly } from '../chunk-JDTC2SBY.js';
|
|
4
|
+
export { useBoolean } from '../chunk-HO2GKTWJ.js';
|
|
5
|
+
import '../chunk-XWL6J6IO.js';
|
|
6
|
+
import '../chunk-DDY7TLUI.js';
|
|
7
|
+
import '../chunk-77KIJLPP.js';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|