@ngrok/mantle 0.76.11 → 0.78.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/accordion.d.ts +63 -21
- package/dist/accordion.js +1 -1
- package/dist/agent.json +7 -1
- package/dist/alert-dialog.d.ts +19 -26
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.d.ts +16 -24
- package/dist/alert.js +1 -1
- package/dist/{anchor-BtgEJoPN.js → anchor-C_tjSVy6.js} +1 -1
- package/dist/anchor.d.ts +3 -4
- package/dist/anchor.js +1 -1
- package/dist/{as-child-uN_018tj.d.ts → as-child-CYEVu1WY.d.ts} +0 -7
- package/dist/badge.d.ts +5 -56
- package/dist/badge.js +1 -1
- package/dist/breadcrumb.d.ts +212 -0
- package/dist/breadcrumb.js +1 -0
- package/dist/browser-only-CPH56Xw_.js +1 -0
- package/dist/browser-only.d.ts +2 -6
- package/dist/browser-only.js +1 -1
- package/dist/{button-CERx95KE.js → button-5t6-JS_I.js} +1 -1
- package/dist/button-AS5Ir3DE.js +1 -0
- package/dist/{button-mfYak6Rx.d.ts → button-Bw9MpShl.d.ts} +26 -8
- package/dist/button.d.ts +5 -4
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +2 -8
- package/dist/calendar.js +1 -1
- package/dist/card.d.ts +8 -8
- package/dist/card.js +1 -1
- package/dist/centered-layout.d.ts +147 -0
- package/dist/centered-layout.js +1 -0
- package/dist/checkbox-DJ2xl7Rc.js +1 -0
- package/dist/checkbox.d.ts +11 -9
- package/dist/checkbox.js +1 -1
- package/dist/choice-DOdyNzFC.js +1 -0
- package/dist/choice.d.ts +253 -0
- package/dist/choice.js +1 -0
- package/dist/code-block.d.ts +5 -17
- package/dist/code-block.js +1 -1
- package/dist/code-block_highlight-utils.d.ts +1 -1
- package/dist/code-block_highlight-utils.js +1 -1
- package/dist/code.d.ts +4 -5
- package/dist/code.js +1 -1
- package/dist/combobox.d.ts +40 -19
- package/dist/combobox.js +1 -1
- package/dist/command.d.ts +60 -38
- package/dist/command.js +1 -1
- package/dist/{copy-to-clipboard-Baw30q9O.js → copy-to-clipboard-BsCQ9m6K.js} +1 -1
- package/dist/cx-IiQEAKf5.js +1 -0
- package/dist/cx.js +1 -1
- package/dist/data-slot-CChfb_cv.d.ts +17 -0
- package/dist/data-table.d.ts +45 -131
- package/dist/data-table.js +1 -1
- package/dist/description-list.d.ts +7 -7
- package/dist/description-list.js +1 -1
- package/dist/{dialog-Cp0S2jsG.js → dialog-DVDFVT_-.js} +1 -1
- package/dist/dialog.d.ts +155 -48
- package/dist/dialog.js +1 -1
- package/dist/{direction-CcTY0FmA.d.ts → direction-BjU0bPST.d.ts} +1 -1
- package/dist/{dropdown-menu-OEuW4GLp.js → dropdown-menu-ByUQkAvJ.js} +1 -1
- package/dist/{dropdown-menu-CADgs9gz.d.ts → dropdown-menu-DT30TQzL.d.ts} +21 -24
- package/dist/dropdown-menu.d.ts +2 -1
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty.d.ts +133 -53
- package/dist/empty.js +1 -1
- package/dist/{field-context-4k1kI7Bo.js → field-context-BR01g789.js} +1 -1
- package/dist/field.d.ts +24 -36
- package/dist/field.js +1 -1
- package/dist/flag.d.ts +2 -9
- package/dist/flag.js +1 -1
- package/dist/hooks.d.ts +139 -81
- package/dist/hooks.js +1 -1
- package/dist/hover-card.d.ts +34 -14
- package/dist/hover-card.js +1 -1
- package/dist/icon-CDtYjF_H.js +1 -0
- package/dist/{icon-n49kOh4_.d.ts → icon-Cevjo93X.d.ts} +2 -3
- package/dist/{icon-button-DiX9iZ9n.js → icon-button-CxVsZ2N1.js} +1 -1
- package/dist/{icon-button-D7hs6bX2.d.ts → icon-button-DuRSCsPh.d.ts} +5 -6
- package/dist/icon.d.ts +3 -3
- package/dist/icon.js +1 -1
- package/dist/icons.d.ts +7 -19
- package/dist/icons.js +1 -1
- package/dist/{in-view-BC3wmz-a.d.ts → in-view-nkSOdED2.d.ts} +21 -10
- package/dist/index-BnI3OppC.d.ts +1 -0
- package/dist/{index-CTU6apE6.d.ts → index-CDwfBOAA.d.ts} +5 -4
- package/dist/{index-Bed_XLWa.d.ts → index-D47aqlpz.d.ts} +3 -2
- package/dist/index-Rv8RL7xy.d.ts +25 -0
- package/dist/input-Ct1YOqSy.js +1 -0
- package/dist/input.d.ts +10 -56
- package/dist/input.js +1 -1
- package/dist/{kbd-D6k4Dnrf.js → kbd-K8iaZ-Ti.js} +1 -1
- package/dist/kbd.d.ts +3 -8
- package/dist/kbd.js +1 -1
- package/dist/{label-BLXfnQmn.js → label-BMlHW_2D.js} +1 -1
- package/dist/label-v2-bv98k.d.ts +69 -0
- package/dist/label.d.ts +1 -68
- package/dist/label.js +1 -1
- package/dist/list.d.ts +295 -0
- package/dist/list.js +1 -0
- package/dist/llms.txt +7 -1
- package/dist/main.d.ts +4 -27
- package/dist/main.js +1 -1
- package/dist/mantle.css +6 -6
- package/dist/media-object.d.ts +6 -7
- package/dist/media-object.js +1 -1
- package/dist/multi-select.d.ts +80 -33
- package/dist/multi-select.js +1 -1
- package/dist/otp-input.d.ts +7 -8
- package/dist/otp-input.js +1 -1
- package/dist/pagination.d.ts +11 -22
- package/dist/pagination.js +1 -1
- package/dist/{popover-Bq52EC7X.js → popover-D5WxxnBY.js} +1 -1
- package/dist/popover.d.ts +6 -7
- package/dist/popover.js +1 -1
- package/dist/{primitive-FoWela9a.d.ts → primitive-C64-m48O.d.ts} +0 -1
- package/dist/{primitive-BFUir4UB.js → primitive-wm7Wk-gy.js} +1 -1
- package/dist/progress.d.ts +55 -46
- package/dist/progress.js +1 -1
- package/dist/qr-code.d.ts +10 -9
- package/dist/qr-code.js +1 -1
- package/dist/radio-group.d.ts +71 -60
- package/dist/radio-group.js +1 -1
- package/dist/{resolve-pre-rendered-props-DxJ9-DAl.d.ts → resolve-pre-rendered-props-B6OlZrSI.d.ts} +13 -26
- package/dist/{resolve-pre-rendered-props-DwIF_M_K.js → resolve-pre-rendered-props-C3e5Auo3.js} +1 -1
- package/dist/sandboxed-on-click.d.ts +4 -8
- package/dist/sandboxed-on-click.js +1 -1
- package/dist/{select-BUGOJMER.d.ts → select-Bwt2YduR.d.ts} +11 -12
- package/dist/{select-xfyY5Vt1.js → select-D-5u0Blc.js} +1 -1
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list.d.ts +725 -0
- package/dist/selectable-list.js +1 -0
- package/dist/{separator-CqohKk4z.js → separator-kBnnv3Cw.js} +1 -1
- package/dist/separator.d.ts +6 -37
- package/dist/separator.js +1 -1
- package/dist/sheet.d.ts +231 -47
- package/dist/sheet.js +1 -1
- package/dist/sizes-Dje_rwKc.d.ts +29 -0
- package/dist/skeleton-Bu3tgNcW.js +1 -0
- package/dist/skeleton.d.ts +2 -2
- package/dist/skeleton.js +1 -1
- package/dist/skip-to-main-link.d.ts +4 -34
- package/dist/skip-to-main-link.js +1 -1
- package/dist/slider.d.ts +2 -21
- package/dist/slider.js +1 -1
- package/dist/slot-DmPrjM7N.js +1 -0
- package/dist/slot.d.ts +1 -1
- package/dist/slot.js +1 -1
- package/dist/split-button.d.ts +20 -12
- package/dist/split-button.js +1 -1
- package/dist/{svg-only-f6ToFLH0.d.ts → svg-only-BFeFS1aa.d.ts} +2 -3
- package/dist/{svg-only-CSOaF1tL.js → svg-only-DDx6FtJd.js} +1 -1
- package/dist/switch.d.ts +6 -3
- package/dist/switch.js +1 -1
- package/dist/{table-CAitdL78.js → table-CPH2md2-.js} +1 -1
- package/dist/{table-BWD9IlIN.d.ts → table-CwFHXC-G.d.ts} +10 -10
- package/dist/table.d.ts +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.d.ts +29 -15
- package/dist/tabs.js +1 -1
- package/dist/text-area.d.ts +2 -3
- package/dist/text-area.js +1 -1
- package/dist/theme-D8kZCOzM.js +1 -0
- package/dist/theme-provider-Djj_jBo6.js +1 -0
- package/dist/theme-switcher.d.ts +45 -0
- package/dist/theme-switcher.js +1 -0
- package/dist/theme.d.ts +15 -101
- package/dist/theme.js +1 -1
- package/dist/{toast-Bwno5LUs.js → toast-RkhbliFh.js} +1 -1
- package/dist/toast.d.ts +13 -37
- package/dist/toast.js +1 -1
- package/dist/tooltip.d.ts +10 -44
- package/dist/tooltip.js +1 -1
- package/dist/types-C19IR7jf.d.ts +48 -0
- package/dist/{types-BvUzforF.d.ts → types-D1RY5Tcj.d.ts} +0 -1
- package/dist/types.d.ts +3 -3
- package/dist/use-copy-to-clipboard-DqQ0_N3E.js +1 -0
- package/dist/use-prefers-reduced-motion-CagaNRgm.js +1 -0
- package/dist/utils.d.ts +2 -3
- package/dist/utils.js +1 -1
- package/dist/{validation-xyX_6kph.d.ts → validation-7QeiTFwl.d.ts} +3 -12
- package/dist/{validation-DCyx-ceH.js → validation-Bpptk_9t.js} +1 -1
- package/dist/virtual-DZMBu7Ch.js +1 -0
- package/dist/well.d.ts +3 -3
- package/dist/well.js +1 -1
- package/dist/{with-style-props-CyImx7vd.d.ts → with-style-props-Dq5Vntqy.d.ts} +0 -1
- package/package.json +79 -344
- package/dist/browser-only-BSl_hruR.js +0 -1
- package/dist/button-C9GW9nAr.js +0 -1
- package/dist/cx-C1UYP5We.js +0 -1
- package/dist/icon-SUx16Sl3.js +0 -1
- package/dist/index-CJbKEKr2.d.ts +0 -20
- package/dist/slot-DT_E5BQx.js +0 -1
- package/dist/theme-provider-BNFS3Acf.js +0 -1
- package/dist/use-copy-to-clipboard-BLpquU9d.js +0 -1
- package/dist/use-prefers-reduced-motion-CWIoFA6W.js +0 -1
package/dist/hooks.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { n as MarginType, o as useComposedRefs, s as copyToClipboard } from "./in-view-
|
|
2
|
-
import { RefObject,
|
|
3
|
-
|
|
1
|
+
import { n as MarginType, o as useComposedRefs, s as copyToClipboard } from "./in-view-nkSOdED2.js";
|
|
2
|
+
import { RefObject, useLayoutEffect } from "react";
|
|
4
3
|
//#region src/hooks/use-breakpoint.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Tailwind CSS breakpoints in descending order (largest → smallest).
|
|
@@ -170,6 +169,43 @@ declare function useCallbackRef<T extends (...args: unknown[]) => unknown>(callb
|
|
|
170
169
|
*/
|
|
171
170
|
declare function useCopyToClipboard(): typeof copyToClipboard;
|
|
172
171
|
//#endregion
|
|
172
|
+
//#region src/hooks/use-debounce.d.ts
|
|
173
|
+
/**
|
|
174
|
+
* Options for {@link useDebounce}.
|
|
175
|
+
*/
|
|
176
|
+
type Options$1 = {
|
|
177
|
+
/**
|
|
178
|
+
* The delay in milliseconds to wait after the last change to `value`
|
|
179
|
+
* before the debounced copy updates.
|
|
180
|
+
*/
|
|
181
|
+
waitMs: number;
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* Returns a debounced copy of `value`: it only updates after `value` has
|
|
185
|
+
* stopped changing for `options.waitMs` milliseconds. Each change restarts
|
|
186
|
+
* the timer, so rapid successive changes collapse into a single trailing
|
|
187
|
+
* update.
|
|
188
|
+
*
|
|
189
|
+
* SSR-safe: the server render simply returns the current value (timers
|
|
190
|
+
* never run there). To debounce a function instead of a value, use
|
|
191
|
+
* {@link useDebouncedCallback}.
|
|
192
|
+
*
|
|
193
|
+
* @param value - The value to debounce. The returned copy lags behind it.
|
|
194
|
+
* @param options - Debounce options.
|
|
195
|
+
* @param options.waitMs - Milliseconds of inactivity to wait before the
|
|
196
|
+
* debounced copy updates.
|
|
197
|
+
* @returns The debounced copy of `value`.
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* ```tsx
|
|
201
|
+
* const [searchQuery, setSearchQuery] = useState("");
|
|
202
|
+
* const debouncedSearchQuery = useDebounce(searchQuery, { waitMs: 300 });
|
|
203
|
+
* // debouncedSearchQuery lags searchQuery until typing pauses for 300ms,
|
|
204
|
+
* // so queries keyed on it fire once per pause instead of per keystroke
|
|
205
|
+
* ```
|
|
206
|
+
*/
|
|
207
|
+
declare function useDebounce<T>(value: T, options: Options$1): T;
|
|
208
|
+
//#endregion
|
|
173
209
|
//#region src/hooks/use-debounced-callback.d.ts
|
|
174
210
|
/**
|
|
175
211
|
* Options for {@link useDebouncedCallback}.
|
|
@@ -224,28 +260,24 @@ declare function useDebouncedCallback<T extends (...args: unknown[]) => unknown>
|
|
|
224
260
|
//#endregion
|
|
225
261
|
//#region src/hooks/use-is-hydrated.d.ts
|
|
226
262
|
/**
|
|
227
|
-
*
|
|
228
|
-
* on the client
|
|
229
|
-
*
|
|
230
|
-
*
|
|
231
|
-
* server and client rendering, preventing hydration mismatches.
|
|
232
|
-
*
|
|
233
|
-
* - On the server, it always returns `false`.
|
|
234
|
-
* - On the client (after hydration), it returns `true`.
|
|
235
|
-
*
|
|
236
|
-
* @see https://tkdodo.eu/blog/avoiding-hydration-mismatches-with-use-sync-external-store
|
|
263
|
+
* Returns `false` during server rendering and the initial hydration render,
|
|
264
|
+
* then `true` on the client — without hydration mismatches, because React
|
|
265
|
+
* uses the server snapshot for the hydration pass and re-renders once with
|
|
266
|
+
* the client snapshot afterwards.
|
|
237
267
|
*
|
|
238
|
-
*
|
|
239
|
-
*
|
|
268
|
+
* Use it to gate UI whose initial state only the client can know (for
|
|
269
|
+
* example, uncontrolled inputs whose mount-time defaults come from
|
|
270
|
+
* localStorage): render a same-size placeholder until hydration so the real
|
|
271
|
+
* UI mounts exactly once, with the real client-side values.
|
|
240
272
|
*
|
|
241
273
|
* @example
|
|
242
|
-
*
|
|
243
|
-
*
|
|
244
|
-
*
|
|
245
|
-
*
|
|
274
|
+
* ```tsx
|
|
275
|
+
* function PreferencesPanel() {
|
|
276
|
+
* const isHydrated = useIsHydrated();
|
|
277
|
+
* // localStorage-backed defaults are only correct on the client
|
|
278
|
+
* return isHydrated ? <PreferenceControls /> : <PreferencesSkeleton />;
|
|
246
279
|
* }
|
|
247
|
-
*
|
|
248
|
-
* return <span>Ready!</span>;
|
|
280
|
+
* ```
|
|
249
281
|
*/
|
|
250
282
|
declare function useIsHydrated(): boolean;
|
|
251
283
|
//#endregion
|
|
@@ -282,7 +314,41 @@ declare function useIsHydrated(): boolean;
|
|
|
282
314
|
*
|
|
283
315
|
* return <div ref={ref}>Width: {width}</div>;
|
|
284
316
|
*/
|
|
285
|
-
declare const useIsomorphicLayoutEffect: typeof
|
|
317
|
+
declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
|
|
318
|
+
//#endregion
|
|
319
|
+
//#region src/hooks/use-local-storage.d.ts
|
|
320
|
+
/**
|
|
321
|
+
* SSR-safe `useSyncExternalStore`-backed localStorage string state.
|
|
322
|
+
*
|
|
323
|
+
* Contract:
|
|
324
|
+
*
|
|
325
|
+
* - Server rendering returns `defaultValue` and never touches localStorage.
|
|
326
|
+
* - Values are JSON-encoded on write and JSON-decoded on read — the same
|
|
327
|
+
* wire format popular hooks libraries (e.g. `@uidotdev/usehooks`) use,
|
|
328
|
+
* so existing stored entries remain readable.
|
|
329
|
+
* - The setter dispatches a synthetic `storage` event (tagged with its
|
|
330
|
+
* `storageArea`) so every same-key hook instance in the tab stays in
|
|
331
|
+
* sync; the native `storage` event covers other tabs. Subscriptions are
|
|
332
|
+
* filtered per key and per storage area, so unrelated keys and
|
|
333
|
+
* sessionStorage churn never wake this hook.
|
|
334
|
+
* - Missing, corrupt, or non-string entries resolve to `defaultValue`; the
|
|
335
|
+
* hook never seeds `defaultValue` into storage on its own (reading is
|
|
336
|
+
* side-effect free).
|
|
337
|
+
*
|
|
338
|
+
* @param key - The localStorage key to read and write.
|
|
339
|
+
* @param defaultValue - Returned when no valid entry exists for `key` and
|
|
340
|
+
* during server rendering.
|
|
341
|
+
* @returns A `[value, setValue]` tuple. `setValue` persists the value and
|
|
342
|
+
* notifies every same-key hook instance.
|
|
343
|
+
*
|
|
344
|
+
* @example
|
|
345
|
+
* ```tsx
|
|
346
|
+
* const [dateFormat, setDateFormat] = useLocalStorage("dateFormat", "MMM d, y");
|
|
347
|
+
* // dateFormat === "MMM d, y" until a preference is stored
|
|
348
|
+
* setDateFormat("y-MM-dd"); // persists + syncs every subscribed instance
|
|
349
|
+
* ```
|
|
350
|
+
*/
|
|
351
|
+
declare function useLocalStorage(key: string, defaultValue: string): readonly [value: string, setValue: (next: string) => void];
|
|
286
352
|
//#endregion
|
|
287
353
|
//#region src/hooks/use-matches-media-query.d.ts
|
|
288
354
|
/**
|
|
@@ -315,6 +381,36 @@ declare const useIsomorphicLayoutEffect: typeof useEffect;
|
|
|
315
381
|
*/
|
|
316
382
|
declare function useMatchesMediaQuery(query: string): boolean;
|
|
317
383
|
//#endregion
|
|
384
|
+
//#region src/hooks/use-session-storage.d.ts
|
|
385
|
+
/**
|
|
386
|
+
* SSR-safe `useSyncExternalStore`-backed sessionStorage string state. The
|
|
387
|
+
* per-tab sibling of {@link useLocalStorage}, with the same contract:
|
|
388
|
+
*
|
|
389
|
+
* - Server rendering returns `defaultValue` and never touches sessionStorage.
|
|
390
|
+
* - Values are JSON-encoded on write and JSON-decoded on read.
|
|
391
|
+
* - The setter dispatches a synthetic `storage` event (tagged with its
|
|
392
|
+
* `storageArea`) so every same-key hook instance in the tab stays in
|
|
393
|
+
* sync. Subscriptions are filtered per key and per storage area, so
|
|
394
|
+
* unrelated keys and localStorage churn never wake this hook.
|
|
395
|
+
* - Missing, corrupt, or non-string entries resolve to `defaultValue`; the
|
|
396
|
+
* hook never seeds `defaultValue` into storage on its own (reading is
|
|
397
|
+
* side-effect free).
|
|
398
|
+
*
|
|
399
|
+
* @param key - The sessionStorage key to read and write.
|
|
400
|
+
* @param defaultValue - Returned when no valid entry exists for `key` and
|
|
401
|
+
* during server rendering.
|
|
402
|
+
* @returns A `[value, setValue]` tuple. `setValue` persists the value for
|
|
403
|
+
* the rest of the tab session and notifies every same-key hook instance.
|
|
404
|
+
*
|
|
405
|
+
* @example
|
|
406
|
+
* ```tsx
|
|
407
|
+
* const [showWarning, setShowWarning] = useSessionStorage("show-warning", "true");
|
|
408
|
+
* // showWarning === "true" until this tab stores a preference
|
|
409
|
+
* setShowWarning("false"); // persists for the rest of the tab session
|
|
410
|
+
* ```
|
|
411
|
+
*/
|
|
412
|
+
declare function useSessionStorage(key: string, defaultValue: string): readonly [value: string, setValue: (next: string) => void];
|
|
413
|
+
//#endregion
|
|
318
414
|
//#region src/hooks/use-prefers-reduced-motion.d.ts
|
|
319
415
|
/**
|
|
320
416
|
* Imperatively reads the current `prefers-reduced-motion` preference once at
|
|
@@ -376,49 +472,6 @@ declare function getPrefersReducedMotion(): boolean;
|
|
|
376
472
|
*/
|
|
377
473
|
declare function usePrefersReducedMotion(): boolean;
|
|
378
474
|
//#endregion
|
|
379
|
-
//#region src/hooks/use-random-stable-id.d.ts
|
|
380
|
-
/**
|
|
381
|
-
* React hook that returns a random, stable id (e.g. `"mantle-a3f9k7q"`)
|
|
382
|
-
* suitable for DOM `id` attributes and `aria-*` references.
|
|
383
|
-
*
|
|
384
|
-
* Unlike React's built-in `useId`, the generated suffix does not contain
|
|
385
|
-
* special characters (`:`). The default id is safe to use directly in CSS
|
|
386
|
-
* selectors and `querySelector` calls; if you provide a custom `prefix`,
|
|
387
|
-
* keep it selector-safe or escape the final id with `CSS.escape()` before
|
|
388
|
-
* querying. The id is generated once for the lifetime of the component and
|
|
389
|
-
* is stable across re-renders, but a new value is produced when `prefix`
|
|
390
|
-
* changes.
|
|
391
|
-
*
|
|
392
|
-
* @param prefix - Optional string prepended to the generated suffix.
|
|
393
|
-
* Whitespace-only or empty values fall back to `"mantle"`. Use a
|
|
394
|
-
* selector-safe prefix if you plan to reference the id in CSS selectors
|
|
395
|
-
* without escaping. Defaults to `"mantle"`.
|
|
396
|
-
* @returns A string of the form `"<prefix>-<7-char-random>"`.
|
|
397
|
-
*
|
|
398
|
-
* @example
|
|
399
|
-
* // Associate a label with a custom input
|
|
400
|
-
* const id = useRandomStableId("email-input");
|
|
401
|
-
*
|
|
402
|
-
* return (
|
|
403
|
-
* <>
|
|
404
|
-
* <label htmlFor={id}>Email</label>
|
|
405
|
-
* <input id={id} type="email" />
|
|
406
|
-
* </>
|
|
407
|
-
* );
|
|
408
|
-
*
|
|
409
|
-
* @example
|
|
410
|
-
* // Use as an aria-controls reference
|
|
411
|
-
* const panelId = useRandomStableId("panel");
|
|
412
|
-
*
|
|
413
|
-
* return (
|
|
414
|
-
* <>
|
|
415
|
-
* <button aria-controls={panelId}>Toggle</button>
|
|
416
|
-
* <div id={panelId}>Panel contents</div>
|
|
417
|
-
* </>
|
|
418
|
-
* );
|
|
419
|
-
*/
|
|
420
|
-
declare const useRandomStableId: (prefix?: string) => string;
|
|
421
|
-
//#endregion
|
|
422
475
|
//#region src/hooks/use-scroll-behavior.d.ts
|
|
423
476
|
/**
|
|
424
477
|
* `scroll-behavior` values:
|
|
@@ -535,25 +588,23 @@ type UseInViewOptions = {
|
|
|
535
588
|
* const ref = useRef<HTMLDivElement>(null);
|
|
536
589
|
* const isInView = useInView(ref, { amount: 0.5 });
|
|
537
590
|
*/
|
|
538
|
-
declare function useInView(ref: RefObject<Element | null>, {
|
|
539
|
-
root,
|
|
540
|
-
margin,
|
|
541
|
-
amount,
|
|
542
|
-
once,
|
|
543
|
-
initial
|
|
544
|
-
}?: UseInViewOptions): boolean;
|
|
591
|
+
declare function useInView(ref: RefObject<Element | null>, { root, margin, amount, once, initial }?: UseInViewOptions): boolean;
|
|
545
592
|
//#endregion
|
|
546
593
|
//#region src/hooks/use-undo-redo.d.ts
|
|
547
594
|
type UseUndoRedoReturn<T> = {
|
|
548
|
-
/** Whether there are actions to undo. */
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
595
|
+
/** Whether there are actions to undo. */
|
|
596
|
+
canUndo: boolean;
|
|
597
|
+
/** Whether there are actions to redo. */
|
|
598
|
+
canRedo: boolean;
|
|
599
|
+
/** Push a snapshot onto the undo stack. Clears the redo stack. */
|
|
600
|
+
push: (snapshot: T) => void;
|
|
601
|
+
/** Pop the last snapshot from the undo stack. Returns `undefined` if empty. */
|
|
602
|
+
undo: (current: T) => T | undefined;
|
|
603
|
+
/** Pop the last snapshot from the redo stack. Returns `undefined` if empty. */
|
|
552
604
|
redo: (current: T) => T | undefined;
|
|
553
605
|
};
|
|
554
606
|
/**
|
|
555
|
-
* Generic undo/redo hook
|
|
556
|
-
* stacks (undo and redo).
|
|
607
|
+
* Generic undo/redo hook that maintains two history stacks (undo and redo).
|
|
557
608
|
*
|
|
558
609
|
* The hook does not own your application state — instead it helps you
|
|
559
610
|
* snapshot it. Call `push(snapshot)` *before* mutating state to capture
|
|
@@ -562,8 +613,15 @@ type UseUndoRedoReturn<T> = {
|
|
|
562
613
|
* the snapshot to apply, or `undefined` if their stack is empty. Pushing a
|
|
563
614
|
* new snapshot clears the redo stack, matching standard editor semantics.
|
|
564
615
|
*
|
|
616
|
+
* `push`, `undo`, and `redo` operate on the live history, so calling them
|
|
617
|
+
* multiple times within a single event handler works as expected — each
|
|
618
|
+
* call sees the result of the previous one.
|
|
619
|
+
*
|
|
565
620
|
* @typeParam T - The type of the value being snapshotted (e.g. a list of
|
|
566
|
-
* items, a serialized form value, etc.).
|
|
621
|
+
* items, a serialized form value, etc.). Constrained to non-nullish
|
|
622
|
+
* values: `undefined` is reserved as the "stack is empty" sentinel and
|
|
623
|
+
* cannot itself be stored as a snapshot, and `null` snapshots would
|
|
624
|
+
* defeat the truthiness checks used at typical call sites.
|
|
567
625
|
*
|
|
568
626
|
* @returns An object with the current undo/redo capability flags and
|
|
569
627
|
* actions:
|
|
@@ -613,6 +671,6 @@ type UseUndoRedoReturn<T> = {
|
|
|
613
671
|
* </div>
|
|
614
672
|
* );
|
|
615
673
|
*/
|
|
616
|
-
declare function useUndoRedo<T
|
|
674
|
+
declare function useUndoRedo<T extends NonNullable<unknown>>(): UseUndoRedoReturn<T>;
|
|
617
675
|
//#endregion
|
|
618
|
-
export { type Breakpoint, type TailwindBreakpoint, type UseInViewOptions, type UseUndoRedoReturn, breakpoints, getPrefersReducedMotion, useBreakpoint, useCallbackRef, useComposedRefs, useCopyToClipboard, useDebouncedCallback, useInView, useIsBelowBreakpoint, useIsHydrated, useIsomorphicLayoutEffect, useMatchesMediaQuery, usePrefersReducedMotion,
|
|
676
|
+
export { type Breakpoint, type TailwindBreakpoint, type UseInViewOptions, type UseUndoRedoReturn, breakpoints, getPrefersReducedMotion, useBreakpoint, useCallbackRef, useComposedRefs, useCopyToClipboard, useDebounce, useDebouncedCallback, useInView, useIsBelowBreakpoint, useIsHydrated, useIsomorphicLayoutEffect, useLocalStorage, useMatchesMediaQuery, usePrefersReducedMotion, useScrollBehavior, useSessionStorage, useUndoRedo };
|
package/dist/hooks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{n as t}from"./compose-refs-Cjf2gfB8.js";import{t as n}from"./use-matches-media-query-CMSxHR9n.js";import{r}from"./browser-only-
|
|
1
|
+
import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{n as t}from"./compose-refs-Cjf2gfB8.js";import{t as n}from"./use-matches-media-query-CMSxHR9n.js";import{r}from"./browser-only-CPH56Xw_.js";import{t as i}from"./use-copy-to-clipboard-DqQ0_N3E.js";import{n as a,t as o}from"./use-prefers-reduced-motion-CagaNRgm.js";import{t as s}from"./in-view-C2DpZ6s0.js";import{useCallback as c,useEffect as l,useMemo as u,useReducer as d,useRef as f,useState as p,useSyncExternalStore as m}from"react";const h=[`2xl`,`xl`,`lg`,`md`,`sm`,`xs`,`2xs`],g=[`default`,...h];function _(){return m(j,M,()=>`default`)}function v(e){return m(P(e),I(e),()=>!1)}const y={"2xl":`(min-width: 96rem)`,xl:`(min-width: 80rem)`,lg:`(min-width: 64rem)`,md:`(min-width: 48rem)`,sm:`(min-width: 40rem)`,xs:`(min-width: 30rem)`,"2xs":`(min-width: 22.5rem)`},b={"2xl":`(max-width: 95.99rem)`,xl:`(max-width: 79.99rem)`,lg:`(max-width: 63.99rem)`,md:`(max-width: 47.99rem)`,sm:`(max-width: 39.99rem)`,xs:`(max-width: 29.99rem)`,"2xs":`(max-width: 22.49rem)`};let x=null,S=null;function C(){return x||={"2xl":window.matchMedia(y[`2xl`]),xl:window.matchMedia(y.xl),lg:window.matchMedia(y.lg),md:window.matchMedia(y.md),sm:window.matchMedia(y.sm),xs:window.matchMedia(y.xs),"2xs":window.matchMedia(y[`2xs`])},x}function w(e){return S||={"2xl":window.matchMedia(b[`2xl`]),xl:window.matchMedia(b.xl),lg:window.matchMedia(b.lg),md:window.matchMedia(b.md),sm:window.matchMedia(b.sm),xs:window.matchMedia(b.xs),"2xs":window.matchMedia(b[`2xs`])},S[e]}let T=`default`;const E=new Set;let D=!1;function O(){let e=C();for(let t of h)if(e[t].matches)return t;return`default`}let k=!1;function A(){k||(k=!0,requestAnimationFrame(()=>{k=!1;let e=O();if(e!==T){T=e;for(let e of E)e()}}))}function j(e){if(E.add(e),!D){D=!0;let e=C();T=O();for(let t of Object.values(e))t.addEventListener(`change`,A)}return e(),()=>{if(E.delete(e),E.size===0&&D){D=!1;let e=C();for(let t of Object.values(e))t.removeEventListener(`change`,A)}}}function M(){return T}const N=new Map;function P(e){let t=N.get(e);return t||(t=t=>{let n=w(e),r=!1,i=()=>{r||(r=!0,requestAnimationFrame(()=>{r=!1,t()}))};return n.addEventListener(`change`,i),()=>{n.removeEventListener(`change`,i)}},N.set(e,t),t)}const F=new Map;function I(e){let t=F.get(e);return t||(t=()=>w(e).matches,F.set(e,t),t)}function L(e){let t=f(e);return l(()=>{t.current=e}),u(()=>((...e)=>t.current?.(...e)),[])}function R(e,t){let[n,r]=p(e);return l(()=>{let n=window.setTimeout(()=>{r(e)},t.waitMs);return()=>{window.clearTimeout(n)}},[e,t.waitMs]),n}function z(e,t){let n=L(e),r=f(0);return l(()=>()=>window.clearTimeout(r.current),[]),c((...e)=>{window.clearTimeout(r.current),r.current=window.setTimeout(()=>n(...e),t.waitMs)},[n,t.waitMs])}function B(e){return function(t){function n(n){let r=n.storageArea==null||n.storageArea===window.localStorage,i=n.key==null||n.key===e;r&&i&&t()}return window.addEventListener(`storage`,n),()=>{window.removeEventListener(`storage`,n)}}}function V(){return null}function H(e,t){try{let n=JSON.parse(e);return typeof n==`string`?n:t}catch{return t}}function U(e,t){let n=m(u(()=>B(e),[e]),()=>window.localStorage.getItem(e),V);return[n==null?t:H(n,t),c(t=>{let n=JSON.stringify(t);window.localStorage.setItem(e,n),window.dispatchEvent(new StorageEvent(`storage`,{key:e,newValue:n,storageArea:window.localStorage}))},[e])]}function W(e){return function(t){function n(n){let r=n.storageArea==null||n.storageArea===window.sessionStorage,i=n.key==null||n.key===e;r&&i&&t()}return window.addEventListener(`storage`,n),()=>{window.removeEventListener(`storage`,n)}}}function G(){return null}function K(e,t){try{let n=JSON.parse(e);return typeof n==`string`?n:t}catch{return t}}function q(e,t){let n=m(u(()=>W(e),[e]),()=>window.sessionStorage.getItem(e),G);return[n==null?t:K(n,t),c(t=>{let n=JSON.stringify(t);window.sessionStorage.setItem(e,n),window.dispatchEvent(new StorageEvent(`storage`,{key:e,newValue:n,storageArea:window.sessionStorage}))},[e])]}function J(){let e=a();return u(()=>e?`auto`:`smooth`,[e])}function Y(e,{root:t,margin:n,amount:r,once:i=!1,initial:a=!1}={}){let[o,c]=p(a);return l(()=>{if(!e.current||i&&o)return;function a(){return c(!0),i?void 0:()=>c(!1)}let l={root:t&&t.current||void 0,margin:n,amount:r};return s(e.current,a,l)},[t,e,n,i,r]),o}function X(){let e=f([]),t=f([]),[,n]=d(e=>e+1,0),r=c(r=>{e.current.push(r),t.current=[],n()},[]),i=c(r=>{let i=e.current[e.current.length-1];if(i!==void 0)return e.current.pop(),t.current.push(r),n(),i},[]),a=c(r=>{let i=t.current[t.current.length-1];if(i!==void 0)return t.current.pop(),e.current.push(r),n(),i},[]),o=e.current.length>0,s=t.current.length>0;return u(()=>({canUndo:o,canRedo:s,push:r,undo:i,redo:a}),[o,s,r,i,a])}export{g as breakpoints,o as getPrefersReducedMotion,_ as useBreakpoint,L as useCallbackRef,t as useComposedRefs,i as useCopyToClipboard,R as useDebounce,z as useDebouncedCallback,Y as useInView,v as useIsBelowBreakpoint,r as useIsHydrated,e as useIsomorphicLayoutEffect,U as useLocalStorage,n as useMatchesMediaQuery,a as usePrefersReducedMotion,J as useScrollBehavior,q as useSessionStorage,X as useUndoRedo};
|
package/dist/hover-card.d.ts
CHANGED
|
@@ -1,7 +1,34 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef } from "react";
|
|
2
2
|
import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
|
|
3
|
-
|
|
4
3
|
//#region src/components/hover-card/hover-card.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* A floating card that appears when a user hovers over a trigger element.
|
|
6
|
+
* This is the root, stateful component that manages the open/closed state of the hover card.
|
|
7
|
+
*
|
|
8
|
+
* `HoverCard.Content` renders at Tailwind `z-50`, Mantle's shared floating
|
|
9
|
+
* z-index. When multiple shared layers are open, the most recently mounted
|
|
10
|
+
* layer renders on top.
|
|
11
|
+
*
|
|
12
|
+
* @see https://mantle.ngrok.com/components/overlays/hover-card#hovercardroot
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* <HoverCard.Root>
|
|
17
|
+
* <HoverCard.Trigger asChild>
|
|
18
|
+
* <Button type="button" appearance="outlined">
|
|
19
|
+
* Hover me
|
|
20
|
+
* </Button>
|
|
21
|
+
* </HoverCard.Trigger>
|
|
22
|
+
* <HoverCard.Content>
|
|
23
|
+
* <p>This is the hover card content.</p>
|
|
24
|
+
* </HoverCard.Content>
|
|
25
|
+
* </HoverCard.Root>
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
declare const Root: {
|
|
29
|
+
({ closeDelay, openDelay, ...props }: ComponentPropsWithoutRef<typeof HoverCardPrimitive.Root>): import("react").JSX.Element;
|
|
30
|
+
displayName: string;
|
|
31
|
+
};
|
|
5
32
|
/**
|
|
6
33
|
* A floating card that appears when a user hovers over a trigger element.
|
|
7
34
|
*
|
|
@@ -17,7 +44,7 @@ import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
|
|
|
17
44
|
* z-index. When multiple shared layers are open, the most recently mounted
|
|
18
45
|
* layer renders on top.
|
|
19
46
|
*
|
|
20
|
-
* @see https://mantle.ngrok.com/components/hover-card
|
|
47
|
+
* @see https://mantle.ngrok.com/components/overlays/hover-card
|
|
21
48
|
*
|
|
22
49
|
* @example
|
|
23
50
|
* Composition:
|
|
@@ -49,7 +76,7 @@ declare const HoverCard: {
|
|
|
49
76
|
* z-index. When multiple shared layers are open, the most recently mounted
|
|
50
77
|
* layer renders on top.
|
|
51
78
|
*
|
|
52
|
-
* @see https://mantle.ngrok.com/components/hover-card#hovercardroot
|
|
79
|
+
* @see https://mantle.ngrok.com/components/overlays/hover-card#hovercardroot
|
|
53
80
|
*
|
|
54
81
|
* @example
|
|
55
82
|
* ```tsx
|
|
@@ -63,14 +90,7 @@ declare const HoverCard: {
|
|
|
63
90
|
* </HoverCard.Root>
|
|
64
91
|
* ```
|
|
65
92
|
*/
|
|
66
|
-
readonly Root:
|
|
67
|
-
({
|
|
68
|
-
closeDelay,
|
|
69
|
-
openDelay,
|
|
70
|
-
...props
|
|
71
|
-
}: ComponentPropsWithoutRef<typeof HoverCardPrimitive.Root>): import("react").JSX.Element;
|
|
72
|
-
displayName: string;
|
|
73
|
-
};
|
|
93
|
+
readonly Root: typeof Root;
|
|
74
94
|
/**
|
|
75
95
|
* The content to render inside the hover card. Appears in a portal with rich styling and animations.
|
|
76
96
|
*
|
|
@@ -78,7 +98,7 @@ declare const HoverCard: {
|
|
|
78
98
|
* z-index. When multiple shared layers are open, the most recently mounted
|
|
79
99
|
* layer renders on top.
|
|
80
100
|
*
|
|
81
|
-
* @see https://mantle.ngrok.com/components/hover-card#hovercardcontent
|
|
101
|
+
* @see https://mantle.ngrok.com/components/overlays/hover-card#hovercardcontent
|
|
82
102
|
*
|
|
83
103
|
* @example
|
|
84
104
|
* ```tsx
|
|
@@ -103,7 +123,7 @@ declare const HoverCard: {
|
|
|
103
123
|
* do not need to use `HoverCard.Portal` directly. Use it only when you need to
|
|
104
124
|
* customize portal placement or wrap multiple `HoverCard.Content` instances.
|
|
105
125
|
*
|
|
106
|
-
* @see https://mantle.ngrok.com/components/hover-card#hovercardportal
|
|
126
|
+
* @see https://mantle.ngrok.com/components/overlays/hover-card#hovercardportal
|
|
107
127
|
*
|
|
108
128
|
* @example
|
|
109
129
|
* ```tsx
|
|
@@ -125,7 +145,7 @@ declare const HoverCard: {
|
|
|
125
145
|
/**
|
|
126
146
|
* The trigger element that opens the hover card when hovered.
|
|
127
147
|
*
|
|
128
|
-
* @see https://mantle.ngrok.com/components/hover-card#hovercardtrigger
|
|
148
|
+
* @see https://mantle.ngrok.com/components/overlays/hover-card#hovercardtrigger
|
|
129
149
|
*
|
|
130
150
|
* @example
|
|
131
151
|
* ```tsx
|
package/dist/hover-card.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{forwardRef as t}from"react";import{jsx as n}from"react/jsx-runtime";import*as r from"@radix-ui/react-hover-card";const i=({closeDelay:e=300,openDelay:t=100,...i})=>n(r.Root,{closeDelay:e,openDelay:t,...i});i.displayName=`HoverCard`;const a=t((e,t)=>n(r.Trigger,{ref:t,"data-slot":`hover-card-trigger`,...e}));a.displayName=`HoverCardTrigger`;const o=r.Portal;o.displayName=`HoverCardPortal`;const s=t(({className:t,onClick:i,align:a=`center`,sideOffset:s=4,...c},l)=>n(o,{children:n(r.Content,{ref:l,"data-slot":`hover-card-content`,align:a,sideOffset:s,className:e(`bg-popover border-popover z-50 w-64 rounded-md border p-4 shadow-md outline-hidden`,`data-state-open:animate-in data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:fade-in-0 data-state-closed:zoom-out-95 data-state-open:zoom-in-95 data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2`,t),onClick:e=>{e.stopPropagation(),i?.(e)},...c})}));s.displayName=r.Content.displayName;const c={Root:i,Content:s,Portal:o,Trigger:a};export{c as HoverCard};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./svg-only-DDx6FtJd.js";import{forwardRef as n}from"react";import{jsx as r}from"react/jsx-runtime";const i=n(({className:n,style:i,svg:a,...o},s)=>r(t,{ref:s,"data-slot":`icon`,className:e(`size-5`,n),style:i,svg:a,...o}));i.displayName=`Icon`;export{i as t};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { t as SvgAttributes } from "./types-
|
|
1
|
+
import { t as SvgAttributes } from "./types-D1RY5Tcj.js";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
|
-
|
|
4
3
|
//#region src/components/icon/icon.d.ts
|
|
5
4
|
type IconProps = Omit<SvgAttributes, "children"> & {
|
|
6
5
|
/**
|
|
@@ -11,7 +10,7 @@ type IconProps = Omit<SvgAttributes, "children"> & {
|
|
|
11
10
|
/**
|
|
12
11
|
* Decorates an svg icon with automatic sizing styles and a `shrink-0` class.
|
|
13
12
|
*
|
|
14
|
-
* @see https://mantle.ngrok.com/components/icon
|
|
13
|
+
* @see https://mantle.ngrok.com/components/data-display/icon
|
|
15
14
|
*
|
|
16
15
|
* @example
|
|
17
16
|
* ```tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./icon-CDtYjF_H.js";import{t as n}from"./slot-DmPrjM7N.js";import{t as r}from"./booleanish-BfvnW6vy.js";import{Children as i,cloneElement as a,forwardRef as o,isValidElement as s}from"react";import c from"tiny-invariant";import{Fragment as l,jsx as u,jsxs as d}from"react/jsx-runtime";import{cva as f}from"class-variance-authority";import{CircleNotchIcon as p}from"@phosphor-icons/react/CircleNotch";const m=e(`icon-button`,`inline-flex shrink-0 items-center justify-center rounded-[var(--icon-button-border-radius,0.375rem)] border`,`focus:outline-hidden focus-visible:ring-4`,`disabled:cursor-default disabled:opacity-50`,`not-disabled:active:scale-97 ease-out transition-transform duration-150`),h=f(m,{variants:{appearance:{ghost:`text-strong focus-visible:ring-focus-accent not-disabled:hover:bg-neutral-500/10 not-disabled:hover:text-strong border-transparent`,outlined:`border-form bg-form text-strong focus-visible:border-accent-600 focus-visible:ring-focus-accent not-disabled:hover:border-neutral-400 not-disabled:hover:bg-form-hover not-disabled:hover:text-strong focus-visible:not-disabled:hover:border-accent-600 focus-visible:not-disabled:active:border-accent-600`},isLoading:{false:``,true:`opacity-50`},size:{xs:`size-6`,sm:`size-7`,md:`size-9`,lg:`size-10`,xl:`size-12`}},defaultVariants:{appearance:`outlined`,size:`md`}}),g=o(({"aria-disabled":o,appearance:f,asChild:m=!1,children:g,className:_,disabled:v,icon:y,isLoading:b=!1,label:x,size:S=`md`,type:C,...w},T)=>{let E=r(o??v??b),D=b?u(p,{className:`animate-spin`}):y,O={"aria-disabled":E,"data-slot":`icon-button`,className:e(h({appearance:f,isLoading:b,size:S}),_),"data-appearance":f,"data-disabled":E,"data-icon-button":!0,"data-loading":b,"data-size":S,disabled:E,ref:T,...w},k=d(l,{children:[u(`span`,{className:`sr-only`,children:x}),u(t,{svg:D})]});return m?(c(s(g)&&i.only(g),"When using `asChild`, IconButton must be passed a single child as a JSX tag."),u(n,{...O,children:a(g,{},k)})):u(`button`,{...O,type:C??`button`,children:k})});g.displayName=`IconButton`;export{m as n,h as r,g as t};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { t as WithAsChild } from "./as-child-
|
|
2
|
-
import { i as DeepNonNullable, r as VariantProps } from "./index-
|
|
1
|
+
import { t as WithAsChild } from "./as-child-CYEVu1WY.js";
|
|
2
|
+
import { i as DeepNonNullable, r as VariantProps } from "./index-D47aqlpz.js";
|
|
3
3
|
import { ButtonHTMLAttributes, ReactNode } from "react";
|
|
4
|
-
|
|
5
4
|
//#region src/components/button/icon-button.d.ts
|
|
6
5
|
declare const iconButtonVariants: (props?: ({
|
|
7
6
|
appearance?: "ghost" | "outlined" | null | undefined;
|
|
8
7
|
isLoading?: boolean | null | undefined;
|
|
9
|
-
size?: "
|
|
8
|
+
size?: "lg" | "md" | "sm" | "xl" | "xs" | null | undefined;
|
|
10
9
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
10
|
type IconButtonVariants = VariantProps<typeof iconButtonVariants>;
|
|
12
11
|
/**
|
|
@@ -48,7 +47,7 @@ type IconButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & WithAsChild & I
|
|
|
48
47
|
* as submitting a form or opening a dialog.
|
|
49
48
|
* Renders only a single icon as children with an accessible, screen-reader-only label.
|
|
50
49
|
*
|
|
51
|
-
* @see https://mantle.ngrok.com/components/icon-button
|
|
50
|
+
* @see https://mantle.ngrok.com/components/actions/icon-button
|
|
52
51
|
*
|
|
53
52
|
* @example
|
|
54
53
|
* ```tsx
|
|
@@ -70,7 +69,7 @@ type IconButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & WithAsChild & I
|
|
|
70
69
|
declare const IconButton: import("react").ForwardRefExoticComponent<ButtonHTMLAttributes<HTMLButtonElement> & WithAsChild & Partial<DeepNonNullable<import("class-variance-authority").VariantProps<(props?: ({
|
|
71
70
|
appearance?: "ghost" | "outlined" | null | undefined;
|
|
72
71
|
isLoading?: boolean | null | undefined;
|
|
73
|
-
size?: "
|
|
72
|
+
size?: "lg" | "md" | "sm" | "xl" | "xs" | null | undefined;
|
|
74
73
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string>>> & {
|
|
75
74
|
/**
|
|
76
75
|
* The accessible label for the icon. This label will be visually hidden but announced to screen reader users, similar to alt text for img tags.
|
package/dist/icon.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as SvgAttributes } from "./types-
|
|
2
|
-
import { n as IconProps, t as Icon } from "./icon-
|
|
3
|
-
import { n as SvgOnlyProps, t as SvgOnly } from "./svg-only-
|
|
1
|
+
import { t as SvgAttributes } from "./types-D1RY5Tcj.js";
|
|
2
|
+
import { n as IconProps, t as Icon } from "./icon-Cevjo93X.js";
|
|
3
|
+
import { n as SvgOnlyProps, t as SvgOnly } from "./svg-only-BFeFS1aa.js";
|
|
4
4
|
export { Icon, type IconProps, type SvgAttributes, SvgOnly, type SvgOnlyProps };
|
package/dist/icon.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./svg-only-
|
|
1
|
+
import{t as e}from"./svg-only-DDx6FtJd.js";import{t}from"./icon-CDtYjF_H.js";export{t as Icon,e as SvgOnly};
|
package/dist/icons.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { t as SvgAttributes } from "./types-
|
|
2
|
-
import { a as AlphanumericSortingDirection, c as TimeSortingDirection, o as SortingDirection, s as SortingMode } from "./direction-
|
|
1
|
+
import { t as SvgAttributes } from "./types-D1RY5Tcj.js";
|
|
2
|
+
import { a as AlphanumericSortingDirection, c as TimeSortingDirection, o as SortingDirection, s as SortingMode } from "./direction-BjU0bPST.js";
|
|
3
3
|
import { i as Theme } from "./themes-CYNpplwN.js";
|
|
4
4
|
import { ComponentProps } from "react";
|
|
5
|
-
|
|
6
5
|
//#region src/components/icons/sort.d.ts
|
|
7
6
|
type Props = SvgAttributes & ({
|
|
8
7
|
mode: Extract<SortingMode, "alphanumeric">;
|
|
@@ -21,18 +20,10 @@ type Props = SvgAttributes & ({
|
|
|
21
20
|
*/
|
|
22
21
|
direction: TimeSortingDirection | SortingDirection;
|
|
23
22
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
declare const SortIcon: {
|
|
29
|
-
({
|
|
30
|
-
mode,
|
|
31
|
-
direction,
|
|
32
|
-
...props
|
|
33
|
-
}: Props): import("react").JSX.Element;
|
|
34
|
-
displayName: string;
|
|
35
|
-
};
|
|
23
|
+
declare function SortIcon({ mode, direction, ...props }: Props): import("react").JSX.Element;
|
|
24
|
+
declare namespace SortIcon {
|
|
25
|
+
var displayName: string;
|
|
26
|
+
}
|
|
36
27
|
//#endregion
|
|
37
28
|
//#region src/components/icons/traffic-policy-file.d.ts
|
|
38
29
|
/**
|
|
@@ -67,10 +58,7 @@ type ThemeIconProps = SvgAttributes & {
|
|
|
67
58
|
* - `light-high-contrast`: SunIcon (fill)
|
|
68
59
|
* - `dark-high-contrast`: MoonIcon (fill)
|
|
69
60
|
*/
|
|
70
|
-
declare function ThemeIcon({
|
|
71
|
-
theme,
|
|
72
|
-
...props
|
|
73
|
-
}: ThemeIconProps): import("react").JSX.Element;
|
|
61
|
+
declare function ThemeIcon({ theme, ...props }: ThemeIconProps): import("react").JSX.Element;
|
|
74
62
|
declare namespace ThemeIcon {
|
|
75
63
|
var displayName: string;
|
|
76
64
|
}
|
package/dist/icons.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{t as e}from"./traffic-policy-file-0g5RXFqu.js";import{t}from"./sort-BPX2Fk9t.js";import{n,t as r}from"./theme-D8kZCOzM.js";import{jsx as i}from"react/jsx-runtime";function a(e){return i(`svg`,{fill:`currentColor`,height:`1em`,viewBox:`0 0 94 36`,width:`2.61em`,...e,children:i(`path`,{d:`M32.272 12.011c-1.298-1.466-2.904-2.205-4.812-2.205-1.176 0-2.26.233-3.255.7a7.995 7.995 0 0 0-2.581 1.906 9.205 9.205 0 0 0-1.715 2.853 9.773 9.773 0 0 0-.628 3.546c0 1.25.194 2.39.58 3.419.362.98.918 1.877 1.635 2.636A7.543 7.543 0 0 0 24 26.584c.965.41 2.025.617 3.176.617.522 0 1.005-.041 1.445-.116.439-.075.858-.2 1.26-.37.4-.175.79-.398 1.18-.664.385-.27.792-.612 1.21-1.018v4.353h-.005v.421h-5.33l-4.005 4.64v.798h15.037v-24.98h-5.697v1.746Zm-.014 7.979a4.25 4.25 0 0 1-.786 1.215 3.555 3.555 0 0 1-2.592 1.1 3.627 3.627 0 0 1-1.464-.292 3.508 3.508 0 0 1-1.166-.808 3.93 3.93 0 0 1-1.054-2.72c0-.519.097-1.006.298-1.457a3.77 3.77 0 0 1 .804-1.181 4.114 4.114 0 0 1 1.162-.808 3.484 3.484 0 0 1 2.817-.016c.448.19.844.463 1.181.81.336.347.6.743.804 1.194.202.452.298.95.298 1.493 0 .505-.104 1.005-.302 1.47m-16.261-7.708a6.173 6.173 0 0 0-2.06-1.602 4.875 4.875 0 0 0-.57-.22 6.383 6.383 0 0 0-.923-.216H8.383L5.697 13.39v-3.082H.002v16.61h5.695V15.712h5.35l.444-.01v11.214h5.697V16.528c0-.885-.084-1.674-.25-2.366a4.655 4.655 0 0 0-.941-1.877zm38.367-2.018h-6.213l-2.47 2.863v-2.864h-5.7v16.61h5.71l.004-11.117h4.144l4.526-5.26zm31.051 7.672 7.79-7.392v-.281H85.7l-5.975 5.991V0h-5.696v26.87h5.696v-6.766l6.262 6.763h7.663v-.316l-8.233-8.617zm-16.11-5.78a9.436 9.436 0 0 0-3.085-1.842 10.953 10.953 0 0 0-3.855-.664c-1.407 0-2.705.226-3.884.678a9.611 9.611 0 0 0-3.072 1.858 8.488 8.488 0 0 0-2.016 2.788 8.281 8.281 0 0 0-.722 3.449c0 1.362.24 2.596.722 3.707a8.52 8.52 0 0 0 2.002 2.862c.85.798 1.86 1.415 3.036 1.847 1.177.432 2.455.647 3.842.647 1.406 0 2.707-.215 3.919-.647 1.204-.431 2.24-1.04 3.098-1.833a8.583 8.583 0 0 0 2.031-2.816c.493-1.09.742-2.29.742-3.611 0-1.316-.244-2.52-.722-3.612a8.424 8.424 0 0 0-2.035-2.81Zm-3.558 7.864c-.2.461-.463.869-.786 1.215a3.573 3.573 0 0 1-2.592 1.1c-.502 0-.981-.096-1.434-.291a3.44 3.44 0 0 1-1.16-.809 4.155 4.155 0 0 1-.788-1.215 3.825 3.825 0 0 1-.297-1.537c0-.517.098-1.004.297-1.456.201-.451.46-.849.787-1.194a3.579 3.579 0 0 1 2.597-1.1c.502 0 .98.096 1.43.29.448.19.839.461 1.16.81.328.345.586.752.786 1.214.2.461.297.954.297 1.471 0 .538-.096 1.04-.297 1.502`})})}function o(e){return i(`svg`,{fill:`currentColor`,height:`1em`,viewBox:`0 0 32 32`,width:`1em`,...e,children:i(`path`,{d:`M27.2 6.18a9.47 9.47 0 0 0-3.12-2.5A9.42 9.42 0 0 0 21.82 3h-6.14l-4.06 4.9V3.1H3V29h8.62V11.53h8.09l.67-.02v17.48H29V12.8c0-1.37-.13-2.6-.38-3.68a7.35 7.35 0 0 0-1.42-2.93Z`})})}export{r as AutoThemeIcon,o as NgrokLettermarkIcon,a as NgrokWordmarkIcon,t as SortIcon,n as ThemeIcon,e as TrafficPolicyFileIcon};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Ref } from "react";
|
|
2
|
-
|
|
3
2
|
//#region src/utils/copy-to-clipboard.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Copy the given string to the clipboard. Uses the Clipboard API when
|
|
@@ -14,13 +13,29 @@ declare function copyToClipboard(value: string): Promise<void>;
|
|
|
14
13
|
//#region src/utils/compose-refs/compose-refs.d.ts
|
|
15
14
|
type PossibleRef<T> = Ref<T> | undefined;
|
|
16
15
|
/**
|
|
17
|
-
* A utility
|
|
18
|
-
*
|
|
16
|
+
* A utility that composes multiple refs into a single callback ref. Accepts
|
|
17
|
+
* callback refs and RefObject(s); the returned ref writes the node to every
|
|
18
|
+
* given ref.
|
|
19
|
+
*
|
|
20
|
+
* Prefer {@link useComposedRefs} inside components — it keeps a stable
|
|
21
|
+
* function identity across renders.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* const setRefs = composeRefs(internalRef, forwardedRef);
|
|
25
|
+
* return <input ref={setRefs} />;
|
|
19
26
|
*/
|
|
20
27
|
declare function composeRefs<T>(...refs: PossibleRef<T>[]): (node: T | null) => void;
|
|
21
28
|
/**
|
|
22
|
-
* A custom hook that composes multiple refs
|
|
23
|
-
* Accepts callback refs and RefObject(s)
|
|
29
|
+
* A custom hook that composes multiple refs into a single stable callback
|
|
30
|
+
* ref. Accepts callback refs and RefObject(s); the latest refs passed on
|
|
31
|
+
* each render are the ones written to.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* const MyInput = forwardRef<HTMLInputElement>((props, forwardedRef) => {
|
|
35
|
+
* const internalRef = useRef<HTMLInputElement>(null);
|
|
36
|
+
* const ref = useComposedRefs(internalRef, forwardedRef);
|
|
37
|
+
* return <input ref={ref} {...props} />;
|
|
38
|
+
* });
|
|
24
39
|
*/
|
|
25
40
|
declare function useComposedRefs<T>(...refs: PossibleRef<T>[]): (node: T | null) => void;
|
|
26
41
|
//#endregion
|
|
@@ -86,10 +101,6 @@ type ViewChangeHandler = (entry: IntersectionObserverEntry) => void;
|
|
|
86
101
|
* // Later, stop observing:
|
|
87
102
|
* stop();
|
|
88
103
|
*/
|
|
89
|
-
declare function inView(element: Element, onStart: (element: Element, entry: IntersectionObserverEntry) => void | ViewChangeHandler, {
|
|
90
|
-
root,
|
|
91
|
-
margin: rootMargin,
|
|
92
|
-
amount
|
|
93
|
-
}?: InViewOptions): VoidFunction;
|
|
104
|
+
declare function inView(element: Element, onStart: (element: Element, entry: IntersectionObserverEntry) => void | ViewChangeHandler, { root, margin: rootMargin, amount }?: InViewOptions): VoidFunction;
|
|
94
105
|
//#endregion
|
|
95
106
|
export { composeRefs as a, inView as i, MarginType as n, useComposedRefs as o, ViewChangeHandler as r, copyToClipboard as s, InViewOptions as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./dropdown-menu-DT30TQzL.js";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { t as WithAsChild } from "./as-child-
|
|
2
|
-
import { r as VariantProps } from "./index-
|
|
1
|
+
import { t as WithAsChild } from "./as-child-CYEVu1WY.js";
|
|
2
|
+
import { r as VariantProps } from "./index-D47aqlpz.js";
|
|
3
|
+
import "./button-Bw9MpShl.js";
|
|
4
|
+
import "./icon-button-DuRSCsPh.js";
|
|
3
5
|
import { ComponentProps } from "react";
|
|
4
|
-
|
|
5
6
|
//#region src/components/button/button-group.d.ts
|
|
6
7
|
declare const buttonGroupVariants: (props?: ({
|
|
7
8
|
appearance?: "ghost" | "outlined" | "panel" | null | undefined;
|
|
@@ -11,7 +12,7 @@ type ButtonGroupProps = ComponentProps<"div"> & ButtonGroupVariants & WithAsChil
|
|
|
11
12
|
/**
|
|
12
13
|
* A contained group of related buttons.
|
|
13
14
|
*
|
|
14
|
-
* @see https://mantle.ngrok.com/components/button
|
|
15
|
+
* @see https://mantle.ngrok.com/components/actions/button
|
|
15
16
|
*
|
|
16
17
|
* @example
|
|
17
18
|
* ```tsx
|