@bazza-ui/react 0.1.0-canary.15 → 0.1.0-canary.17

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 (146) hide show
  1. package/dist/combobox/index.cjs +1 -1
  2. package/dist/combobox/index.cjs.map +1 -1
  3. package/dist/combobox/index.d.ts +842 -834
  4. package/dist/combobox/index.js +1 -1
  5. package/dist/combobox/index.js.map +1 -1
  6. package/dist/command-menu/index.cjs +1 -1
  7. package/dist/command-menu/index.cjs.map +1 -1
  8. package/dist/command-menu/index.d.ts +123 -96
  9. package/dist/command-menu/index.js +1 -1
  10. package/dist/command-menu/index.js.map +1 -1
  11. package/dist/context-menu/index.cjs +1 -1
  12. package/dist/context-menu/index.cjs.map +1 -1
  13. package/dist/context-menu/index.d.ts +701 -658
  14. package/dist/context-menu/index.js +1 -1
  15. package/dist/context-menu/index.js.map +1 -1
  16. package/dist/dropdown-menu/index.cjs +1 -1
  17. package/dist/dropdown-menu/index.cjs.map +1 -1
  18. package/dist/dropdown-menu/index.d.ts +723 -680
  19. package/dist/dropdown-menu/index.js +1 -1
  20. package/dist/dropdown-menu/index.js.map +1 -1
  21. package/dist/events-DDOsDu4X.d.ts +2091 -0
  22. package/dist/index-Cabqj7qI.d.ts +2003 -0
  23. package/dist/index-D8OrKThQ.d.ts +977 -0
  24. package/dist/internal/listbox/index.cjs +1 -2
  25. package/dist/internal/listbox/index.d.ts +2 -272
  26. package/dist/internal/listbox/index.js +1 -2
  27. package/dist/internal/popup-menu/index.cjs +1 -2
  28. package/dist/internal/popup-menu/index.d.ts +4 -238
  29. package/dist/internal/popup-menu/index.js +1 -2
  30. package/dist/items-CD2hw6-3.js +2 -0
  31. package/dist/items-CD2hw6-3.js.map +1 -0
  32. package/dist/items-DYDljwnt.cjs +2 -0
  33. package/dist/items-DYDljwnt.cjs.map +1 -0
  34. package/dist/{items-B6HeFO_8.d.cts → items-ceX--VIv.d.ts} +21 -19
  35. package/dist/kbd/index.cjs +1 -1
  36. package/dist/kbd/index.cjs.map +1 -1
  37. package/dist/kbd/index.d.ts +35 -35
  38. package/dist/kbd/index.js +1 -1
  39. package/dist/kbd/index.js.map +1 -1
  40. package/dist/listbox-CnwUlLZA.js +2 -0
  41. package/dist/listbox-CnwUlLZA.js.map +1 -0
  42. package/dist/listbox-DYvJTiF6.cjs +2 -0
  43. package/dist/listbox-DYvJTiF6.cjs.map +1 -0
  44. package/dist/loaders/index.cjs +1 -1
  45. package/dist/loaders/index.cjs.map +1 -1
  46. package/dist/loaders/index.d.ts +218 -188
  47. package/dist/loaders/index.js +1 -1
  48. package/dist/loaders/index.js.map +1 -1
  49. package/dist/merge-element-props-0mpNO7ZH.cjs +2 -0
  50. package/dist/merge-element-props-0mpNO7ZH.cjs.map +1 -0
  51. package/dist/merge-element-props-PxUvRHax.js +2 -0
  52. package/dist/merge-element-props-PxUvRHax.js.map +1 -0
  53. package/dist/platform-C-sxBTRa.cjs +2 -0
  54. package/dist/platform-C-sxBTRa.cjs.map +1 -0
  55. package/dist/platform-C4_cGUkS.js +2 -0
  56. package/dist/platform-C4_cGUkS.js.map +1 -0
  57. package/dist/popup-menu-BBAzAXIe.cjs +2 -0
  58. package/dist/popup-menu-BBAzAXIe.cjs.map +1 -0
  59. package/dist/popup-menu-HmBMJEZc.js +2 -0
  60. package/dist/popup-menu-HmBMJEZc.js.map +1 -0
  61. package/dist/resolve-state-props-C-zbhdXd.cjs +2 -0
  62. package/dist/resolve-state-props-C-zbhdXd.cjs.map +1 -0
  63. package/dist/resolve-state-props-D31kizRZ.js +2 -0
  64. package/dist/resolve-state-props-D31kizRZ.js.map +1 -0
  65. package/dist/rolldown-runtime-5lHFv1cW.cjs +1 -0
  66. package/dist/rolldown-runtime-DK3Fl9T5.js +1 -0
  67. package/dist/select/index.cjs +1 -1
  68. package/dist/select/index.cjs.map +1 -1
  69. package/dist/select/index.d.ts +835 -828
  70. package/dist/select/index.js +1 -1
  71. package/dist/select/index.js.map +1 -1
  72. package/dist/suggestion-menu/index.cjs +4 -0
  73. package/dist/suggestion-menu/index.cjs.map +1 -0
  74. package/dist/suggestion-menu/index.d.ts +359 -0
  75. package/dist/suggestion-menu/index.js +4 -0
  76. package/dist/suggestion-menu/index.js.map +1 -0
  77. package/dist/types-BbN28E3_.d.ts +50 -0
  78. package/dist/video-player/index.cjs +2 -2
  79. package/dist/video-player/index.cjs.map +1 -1
  80. package/dist/video-player/index.d.ts +964 -1000
  81. package/dist/video-player/index.js +2 -2
  82. package/dist/video-player/index.js.map +1 -1
  83. package/package.json +14 -5
  84. package/dist/ListboxStore-B8oTpM57.d.cts +0 -453
  85. package/dist/ListboxStore-CV5vPUUc.d.ts +0 -453
  86. package/dist/chunk-4C666HHU.js +0 -2
  87. package/dist/chunk-4C666HHU.js.map +0 -1
  88. package/dist/chunk-5T5B5SPR.cjs +0 -2
  89. package/dist/chunk-5T5B5SPR.cjs.map +0 -1
  90. package/dist/chunk-A4Z5BY7H.js +0 -2
  91. package/dist/chunk-A4Z5BY7H.js.map +0 -1
  92. package/dist/chunk-BEWVWSAW.cjs +0 -2
  93. package/dist/chunk-BEWVWSAW.cjs.map +0 -1
  94. package/dist/chunk-EDZTZHQ4.js +0 -2
  95. package/dist/chunk-EDZTZHQ4.js.map +0 -1
  96. package/dist/chunk-IT372NHF.js +0 -2
  97. package/dist/chunk-IT372NHF.js.map +0 -1
  98. package/dist/chunk-JFEVUUPC.cjs +0 -2
  99. package/dist/chunk-JFEVUUPC.cjs.map +0 -1
  100. package/dist/chunk-KO3DXT3Y.js +0 -2
  101. package/dist/chunk-KO3DXT3Y.js.map +0 -1
  102. package/dist/chunk-LXXK4S4Q.js +0 -2
  103. package/dist/chunk-LXXK4S4Q.js.map +0 -1
  104. package/dist/chunk-M4G6J7DP.cjs +0 -2
  105. package/dist/chunk-M4G6J7DP.cjs.map +0 -1
  106. package/dist/chunk-SCDHQZFI.cjs +0 -2
  107. package/dist/chunk-SCDHQZFI.cjs.map +0 -1
  108. package/dist/chunk-XMZZ62VJ.cjs +0 -2
  109. package/dist/chunk-XMZZ62VJ.cjs.map +0 -1
  110. package/dist/combobox/index.d.cts +0 -1066
  111. package/dist/command-menu/index.d.cts +0 -154
  112. package/dist/command-score-CTJ9NV6n.d.cts +0 -23
  113. package/dist/command-score-CTJ9NV6n.d.ts +0 -23
  114. package/dist/context-menu/index.d.cts +0 -696
  115. package/dist/dropdown-menu/index.d.cts +0 -723
  116. package/dist/events-BTHQ2OoH.d.ts +0 -1860
  117. package/dist/events-DVcrtGe3.d.cts +0 -1860
  118. package/dist/input-C95v6jB0.d.cts +0 -46
  119. package/dist/input-CYweYB_i.d.ts +0 -46
  120. package/dist/internal/listbox/index.cjs.map +0 -1
  121. package/dist/internal/listbox/index.d.cts +0 -272
  122. package/dist/internal/listbox/index.js.map +0 -1
  123. package/dist/internal/popup-menu/index.cjs.map +0 -1
  124. package/dist/internal/popup-menu/index.d.cts +0 -238
  125. package/dist/internal/popup-menu/index.js.map +0 -1
  126. package/dist/items-B6HeFO_8.d.ts +0 -37
  127. package/dist/kbd/index.d.cts +0 -61
  128. package/dist/loaders/index.d.cts +0 -363
  129. package/dist/loading-C6WZGUc3.d.cts +0 -29
  130. package/dist/loading-CC4n55sR.d.ts +0 -29
  131. package/dist/resolve-B-j0eW24.d.cts +0 -406
  132. package/dist/resolve-B1F-a3P1.d.ts +0 -406
  133. package/dist/scroll-arrow-BBoKckL_.d.cts +0 -544
  134. package/dist/scroll-arrow-fl3B5sVO.d.ts +0 -544
  135. package/dist/select/index.d.cts +0 -1005
  136. package/dist/separator-Dn15rte3.d.ts +0 -275
  137. package/dist/separator-NjsBVzek.d.cts +0 -275
  138. package/dist/surface-context-CGLDpMej.d.ts +0 -14
  139. package/dist/surface-context-CN4Lb_6F.d.cts +0 -14
  140. package/dist/type-guards-BHHzjRvZ.d.cts +0 -351
  141. package/dist/type-guards-C0e_GpeY.d.ts +0 -351
  142. package/dist/types-DT4FOOa2.d.cts +0 -51
  143. package/dist/types-DT4FOOa2.d.ts +0 -51
  144. package/dist/use-listbox-item-NzZuY34-.d.cts +0 -212
  145. package/dist/use-listbox-item-NzZuY34-.d.ts +0 -212
  146. package/dist/video-player/index.d.cts +0 -1391
@@ -1,61 +0,0 @@
1
- import * as React from 'react';
2
- import { C as ComponentProps } from '../types-DT4FOOa2.cjs';
3
-
4
- interface KbdKeyState extends Record<string, unknown> {
5
- }
6
- interface KbdKeyProps extends ComponentProps<'kbd', KbdKey.State> {
7
- label?: string;
8
- }
9
- declare const KbdKey: React.ForwardRefExoticComponent<Omit<KbdKey.Props, "ref"> & React.RefAttributes<HTMLElement>>;
10
- declare namespace KbdKey {
11
- type State = KbdKeyState;
12
- interface Props extends KbdKeyProps {
13
- }
14
- }
15
-
16
- type Platform$2 = 'apple' | 'other';
17
- interface KbdRootState extends Record<string, unknown> {
18
- platform: Platform$2;
19
- }
20
- interface KbdRootProps extends Omit<ComponentProps<'span', KbdRoot.State>, 'children'> {
21
- keys: string;
22
- platform?: Platform$2;
23
- separator?: React.ReactNode;
24
- }
25
- declare const KbdRoot: React.ForwardRefExoticComponent<Omit<KbdRoot.Props, "ref"> & React.RefAttributes<HTMLSpanElement>>;
26
- declare namespace KbdRoot {
27
- type State = KbdRootState;
28
- interface Props extends KbdRootProps {
29
- }
30
- }
31
-
32
- declare namespace index_parts {
33
- export { KbdKey as Key, KbdRoot as Root };
34
- }
35
-
36
- interface KeyChord {
37
- meta: boolean;
38
- ctrl: boolean;
39
- alt: boolean;
40
- shift: boolean;
41
- mod: boolean;
42
- key: string | null;
43
- }
44
- interface Keybinding {
45
- chords: KeyChord[];
46
- }
47
- type Platform$1 = 'apple' | 'other';
48
- declare function parseKeybinding(keys: string): Keybinding;
49
- declare function getKeyLabel(key: string, platform: Platform$1): string;
50
- declare function getChordLabels(chord: KeyChord, platform: Platform$1): string[];
51
-
52
- type Platform = 'apple' | 'other';
53
- declare function isApplePlatform(): boolean;
54
- /**
55
- * Returns the current platform while keeping the first client render aligned with
56
- * SSR. Without an override, this starts as "other" and corrects to "apple" after
57
- * mount when appropriate, avoiding hydration mismatches.
58
- */
59
- declare function usePlatform(override?: Platform): Platform;
60
-
61
- export { index_parts as Kbd, type KeyChord, type Keybinding, getChordLabels, getKeyLabel, isApplePlatform, parseKeybinding, usePlatform };
@@ -1,363 +0,0 @@
1
- import * as React from 'react';
2
- import { N as NodeDef, ai as InitialQueryBehavior, ap as LoaderComponentProps, ar as QueryLoaderConfig, aF as StaticLoaderConfig, U as AsyncLoaderResult } from '../events-DVcrtGe3.cjs';
3
- import '../types-DT4FOOa2.cjs';
4
-
5
- /**
6
- * SWR result shape (subset of SWRResponse).
7
- * This allows the adapter to work without requiring `swr` as a dependency.
8
- */
9
- interface SWRResult<TData, TError = Error> {
10
- data: TData | undefined;
11
- error: TError | undefined;
12
- isLoading?: boolean;
13
- isValidating: boolean;
14
- isPaused?: boolean;
15
- mutate: (...args: unknown[]) => unknown;
16
- }
17
- /**
18
- * Converts an SWR result to an AsyncLoaderResult.
19
- */
20
- declare function toAsyncLoaderResultFromSWR<TData, TError = Error>(result: SWRResult<TData, TError>): AsyncLoaderResult<TData, SWRResult<TData, TError>>;
21
- /**
22
- * Props for creating a static SWR loader component.
23
- */
24
- interface CreateSWRStaticLoaderProps {
25
- /** Hook that returns an SWR result. */
26
- useSWR: () => SWRResult<NodeDef[]>;
27
- /**
28
- * When to trigger the loader:
29
- * - 'eager': Load when root menu opens
30
- * - 'lazy': Load when submenu opens (default)
31
- */
32
- loadStrategy?: 'eager' | 'lazy';
33
- }
34
- /**
35
- * Creates a static loader configuration backed by SWR.
36
- */
37
- declare function createSWRStaticLoader(props: CreateSWRStaticLoaderProps): StaticLoaderConfig;
38
- /**
39
- * Props for creating a query SWR loader component.
40
- */
41
- interface CreateSWRQueryLoaderProps {
42
- /**
43
- * Hook that returns an SWR result based on the search query.
44
- * `options.enabled` can be used to derive a `null` key and disable fetching.
45
- */
46
- useSWR: (query: string, options?: {
47
- enabled: boolean;
48
- }) => SWRResult<NodeDef[]>;
49
- /**
50
- * Minimum query length before fetching.
51
- * @default 1
52
- */
53
- minQueryLength?: number;
54
- /**
55
- * Initial query behavior before user input reaches minQueryLength.
56
- * Defaults to fetching with an empty query.
57
- */
58
- initialQueryBehavior?: InitialQueryBehavior | false;
59
- /**
60
- * @deprecated Use `initialQueryBehavior` instead.
61
- */
62
- initialQuery?: string;
63
- /**
64
- * When to trigger the loader:
65
- * - 'eager': Load when root menu opens (good for deep search)
66
- * - 'lazy': Load when submenu opens (default)
67
- * @default 'lazy'
68
- */
69
- loadStrategy?: 'eager' | 'lazy';
70
- /**
71
- * What to show when query is below minQueryLength.
72
- * @default 'empty'
73
- */
74
- belowMinBehavior?: 'empty' | 'placeholder';
75
- /**
76
- * Placeholder nodes shown when query is below minQueryLength.
77
- */
78
- placeholderNodes?: NodeDef[];
79
- }
80
- /**
81
- * Creates a query loader configuration backed by SWR.
82
- */
83
- declare function createSWRQueryLoader(props: CreateSWRQueryLoaderProps): QueryLoaderConfig;
84
- /**
85
- * Creates a loader component that wraps an SWR hook.
86
- */
87
- declare function createSWRLoaderComponent(useSWRFn: (query: string) => SWRResult<NodeDef[]>): React.FC<LoaderComponentProps>;
88
-
89
- /**
90
- * TanStack Query result shape (subset of UseQueryResult).
91
- * This allows the adapter to work without requiring @tanstack/react-query as a dependency.
92
- */
93
- interface TanStackQueryResult<TData, TError = Error> {
94
- /** TanStack status (`pending` | `error` | `success`) */
95
- status?: 'pending' | 'error' | 'success';
96
- /** TanStack fetch status (`fetching` | `paused` | `idle`) */
97
- fetchStatus?: 'fetching' | 'paused' | 'idle';
98
- data: TData | undefined;
99
- error: TError | null | undefined;
100
- /** v5: true when first fetch is in-flight */
101
- isLoading?: boolean;
102
- /** v5: true when status is pending */
103
- isPending?: boolean;
104
- /** true when status is success */
105
- isSuccess?: boolean;
106
- /** true when status is error */
107
- isError?: boolean;
108
- /** true while any fetch is in-flight */
109
- isFetching?: boolean;
110
- /** true while background refetch is in-flight */
111
- isRefetching?: boolean;
112
- /** true when fetch is paused */
113
- isPaused?: boolean;
114
- /** true once query has fetched at least once */
115
- isFetched?: boolean;
116
- refetch: () => unknown;
117
- }
118
- /**
119
- * Converts a TanStack Query result to an AsyncLoaderResult.
120
- * Use this to wrap your useQuery hook result.
121
- *
122
- * @example
123
- * ```tsx
124
- * function MyLoader({ query, children }) {
125
- * const result = useQuery({
126
- * queryKey: ['items', query],
127
- * queryFn: () => fetchItems(query),
128
- * })
129
- * return children(toAsyncLoaderResult(result))
130
- * }
131
- * ```
132
- */
133
- declare function toAsyncLoaderResult<TData, TError = Error>(result: TanStackQueryResult<TData, TError>): AsyncLoaderResult<TData, TanStackQueryResult<TData, TError>>;
134
- /**
135
- * Props for creating a static loader component.
136
- */
137
- interface CreateStaticLoaderProps {
138
- /**
139
- * Hook that returns a TanStack Query result.
140
- * This hook will be called inside the loader component.
141
- */
142
- useQuery: () => TanStackQueryResult<NodeDef[]>;
143
- /**
144
- * When to trigger the loader:
145
- * - 'eager': Load when root menu opens
146
- * - 'lazy': Load when submenu opens (default)
147
- */
148
- loadStrategy?: 'eager' | 'lazy';
149
- }
150
- /**
151
- * Creates a static loader configuration for use with async menus.
152
- * The hook is called inside a component, so it follows React's rules of hooks.
153
- *
154
- * @example
155
- * ```tsx
156
- * const recentFilesLoader = createStaticLoader({
157
- * useQuery: () => useQuery({
158
- * queryKey: ['recent-files'],
159
- * queryFn: fetchRecentFiles,
160
- * staleTime: 5 * 60 * 1000,
161
- * }),
162
- * })
163
- *
164
- * // Use in submenu
165
- * {
166
- * kind: 'submenu',
167
- * value: 'Recent Files',
168
- * asyncNodes: {
169
- * ...recentFilesLoader,
170
- * loadStrategy: 'eager',
171
- * },
172
- * render: ...
173
- * }
174
- * ```
175
- */
176
- declare function createStaticLoader(props: CreateStaticLoaderProps): StaticLoaderConfig;
177
- /**
178
- * Props for creating a query loader component.
179
- */
180
- interface CreateQueryLoaderProps {
181
- /**
182
- * Hook that returns a TanStack Query result based on the search query.
183
- * This hook will be called inside the loader component with the current query.
184
- */
185
- useQuery: (query: string, options?: {
186
- enabled: boolean;
187
- }) => TanStackQueryResult<NodeDef[]>;
188
- /**
189
- * Minimum query length before fetching.
190
- * @default 1
191
- */
192
- minQueryLength?: number;
193
- /**
194
- * Initial query behavior before user input reaches minQueryLength.
195
- * Defaults to fetching with an empty query.
196
- */
197
- initialQueryBehavior?: InitialQueryBehavior | false;
198
- /**
199
- * @deprecated Use `initialQueryBehavior` instead.
200
- */
201
- initialQuery?: string;
202
- /**
203
- * When to trigger the loader:
204
- * - 'eager': Load when root menu opens (good for deep search)
205
- * - 'lazy': Load when submenu opens (default)
206
- * @default 'lazy'
207
- */
208
- loadStrategy?: 'eager' | 'lazy';
209
- /**
210
- * What to show when query is below minQueryLength.
211
- * @default 'empty'
212
- */
213
- belowMinBehavior?: 'empty' | 'placeholder';
214
- /**
215
- * Placeholder nodes shown when query is below minQueryLength.
216
- */
217
- placeholderNodes?: NodeDef[];
218
- }
219
- /**
220
- * Creates a query loader configuration for use with async menus.
221
- * The loader will re-fetch when the search query changes.
222
- *
223
- * @example
224
- * ```tsx
225
- * const searchLoader = createQueryLoader({
226
- * useQuery: (query, options) => useQuery({
227
- * queryKey: ['search', query],
228
- * queryFn: () => searchItems(query),
229
- * enabled: options?.enabled,
230
- * }),
231
- * minQueryLength: 2,
232
- * })
233
- *
234
- * // Use in submenu
235
- * {
236
- * kind: 'submenu',
237
- * value: 'Search',
238
- * includeInDeepSearch: true,
239
- * asyncNodes: searchLoader,
240
- * render: ...
241
- * }
242
- * ```
243
- */
244
- declare function createQueryLoader(props: CreateQueryLoaderProps): QueryLoaderConfig;
245
- /**
246
- * Creates a loader component that wraps a TanStack Query hook.
247
- * This is a lower-level utility for custom loader implementations.
248
- *
249
- * @example
250
- * ```tsx
251
- * const MyLoader = createLoaderComponent((query) =>
252
- * useQuery({
253
- * queryKey: ['items', query],
254
- * queryFn: () => fetchItems(query),
255
- * })
256
- * )
257
- * ```
258
- */
259
- declare function createLoaderComponent(useQueryFn: (query: string) => TanStackQueryResult<NodeDef[]>): React.FC<LoaderComponentProps>;
260
-
261
- /**
262
- * Props for creating a static loader with vanilla fetch.
263
- */
264
- interface CreateVanillaStaticLoaderProps {
265
- /**
266
- * Async function that fetches the menu items.
267
- */
268
- fetcher: () => Promise<NodeDef[]>;
269
- /**
270
- * When to trigger the loader:
271
- * - 'eager': Load when root menu opens
272
- * - 'lazy': Load when submenu opens (default)
273
- */
274
- loadStrategy?: 'eager' | 'lazy';
275
- }
276
- /**
277
- * Creates a static loader configuration using plain fetch/promises.
278
- * No external data library required.
279
- *
280
- * @example
281
- * ```tsx
282
- * const recentFilesLoader = createVanillaStaticLoader({
283
- * fetcher: async () => {
284
- * const res = await fetch('/api/recent-files')
285
- * const data = await res.json()
286
- * return data.map(file => ({
287
- * kind: 'item',
288
- * value: file.name,
289
- * render: ...
290
- * }))
291
- * },
292
- * })
293
- * ```
294
- */
295
- declare function createVanillaStaticLoader(props: CreateVanillaStaticLoaderProps): StaticLoaderConfig;
296
- /**
297
- * Props for creating a query loader with vanilla fetch.
298
- */
299
- interface CreateVanillaQueryLoaderProps {
300
- /**
301
- * Async function that fetches menu items based on the search query.
302
- * Receives an optional `signal` that is aborted when a newer query is issued,
303
- * allowing you to cancel in-flight requests (e.g. pass it to `fetch()`).
304
- */
305
- fetcher: (query: string, options?: {
306
- signal?: AbortSignal;
307
- }) => Promise<NodeDef[]>;
308
- /**
309
- * Minimum query length before fetching.
310
- * @default 1
311
- */
312
- minQueryLength?: number;
313
- /**
314
- * Initial query behavior before user input reaches minQueryLength.
315
- * Defaults to fetching with an empty query.
316
- */
317
- initialQueryBehavior?: InitialQueryBehavior | false;
318
- /**
319
- * @deprecated Use `initialQueryBehavior` instead.
320
- */
321
- initialQuery?: string;
322
- /**
323
- * When to trigger the loader:
324
- * - 'eager': Load when root menu opens (good for deep search)
325
- * - 'lazy': Load when submenu opens (default)
326
- * @default 'lazy'
327
- */
328
- loadStrategy?: 'eager' | 'lazy';
329
- /**
330
- * What to show when query is below minQueryLength.
331
- * @default 'empty'
332
- */
333
- belowMinBehavior?: 'empty' | 'placeholder';
334
- /**
335
- * Placeholder nodes shown when query is below minQueryLength.
336
- */
337
- placeholderNodes?: NodeDef[];
338
- }
339
- /**
340
- * Creates a query loader configuration using plain fetch/promises.
341
- * No external data library required.
342
- *
343
- * @example
344
- * ```tsx
345
- * const searchLoader = createVanillaQueryLoader({
346
- * fetcher: async (query, options) => {
347
- * const res = await fetch(`/api/search?q=${encodeURIComponent(query)}`, {
348
- * signal: options?.signal, // aborts when a newer query is issued
349
- * })
350
- * const data = await res.json()
351
- * return data.map(item => ({
352
- * kind: 'item',
353
- * value: item.name,
354
- * render: ...
355
- * }))
356
- * },
357
- * minQueryLength: 2,
358
- * })
359
- * ```
360
- */
361
- declare function createVanillaQueryLoader(props: CreateVanillaQueryLoaderProps): QueryLoaderConfig;
362
-
363
- export { type CreateQueryLoaderProps, type CreateSWRQueryLoaderProps, type CreateSWRStaticLoaderProps, type CreateStaticLoaderProps, type CreateVanillaQueryLoaderProps, type CreateVanillaStaticLoaderProps, type SWRResult, type TanStackQueryResult, createLoaderComponent, createQueryLoader, createSWRLoaderComponent, createSWRQueryLoader, createSWRStaticLoader, createStaticLoader, createVanillaQueryLoader, createVanillaStaticLoader, toAsyncLoaderResult, toAsyncLoaderResultFromSWR };
@@ -1,29 +0,0 @@
1
- import * as React from 'react';
2
- import { C as ComponentProps } from './types-DT4FOOa2.cjs';
3
-
4
- interface PopupMenuLoadingState extends Record<string, unknown> {
5
- first: boolean;
6
- last: boolean;
7
- }
8
- interface PopupMenuLoadingProps extends ComponentProps<'div', PopupMenuLoading.State> {
9
- children: React.ReactNode;
10
- /**
11
- * Whether to force render the loading indicator regardless of async loading state.
12
- * When true, the component always renders, allowing you to control visibility externally.
13
- * @default false
14
- */
15
- forceMount?: boolean;
16
- }
17
- /**
18
- * Renders when async content is in initial loading.
19
- * Only visible during first-load phases (unless `forceMount` is true).
20
- * Renders a `<div>` element.
21
- */
22
- declare const PopupMenuLoading: React.ForwardRefExoticComponent<Omit<PopupMenuLoading.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
23
- declare namespace PopupMenuLoading {
24
- type State = PopupMenuLoadingState;
25
- interface Props extends PopupMenuLoadingProps {
26
- }
27
- }
28
-
29
- export { PopupMenuLoading as P, type PopupMenuLoadingProps as a, type PopupMenuLoadingState as b };
@@ -1,29 +0,0 @@
1
- import * as React from 'react';
2
- import { C as ComponentProps } from './types-DT4FOOa2.js';
3
-
4
- interface PopupMenuLoadingState extends Record<string, unknown> {
5
- first: boolean;
6
- last: boolean;
7
- }
8
- interface PopupMenuLoadingProps extends ComponentProps<'div', PopupMenuLoading.State> {
9
- children: React.ReactNode;
10
- /**
11
- * Whether to force render the loading indicator regardless of async loading state.
12
- * When true, the component always renders, allowing you to control visibility externally.
13
- * @default false
14
- */
15
- forceMount?: boolean;
16
- }
17
- /**
18
- * Renders when async content is in initial loading.
19
- * Only visible during first-load phases (unless `forceMount` is true).
20
- * Renders a `<div>` element.
21
- */
22
- declare const PopupMenuLoading: React.ForwardRefExoticComponent<Omit<PopupMenuLoading.Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
23
- declare namespace PopupMenuLoading {
24
- type State = PopupMenuLoadingState;
25
- interface Props extends PopupMenuLoadingProps {
26
- }
27
- }
28
-
29
- export { PopupMenuLoading as P, type PopupMenuLoadingProps as a, type PopupMenuLoadingState as b };