@ngrok/mantle 0.88.0 → 0.90.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (247) hide show
  1. package/dist/accordion.d.ts +10 -9
  2. package/dist/accordion.js +1 -1
  3. package/dist/agent.json +1530 -1
  4. package/dist/{alert-DCVfviBx.d.ts → alert-BzPDUaU7.d.ts} +16 -15
  5. package/dist/alert-DO00UiQe.js +1 -0
  6. package/dist/alert-ZaUBtgno.js +1 -0
  7. package/dist/alert-center.d.ts +7 -7
  8. package/dist/alert-center.js +1 -1
  9. package/dist/alert-dialog.d.ts +17 -16
  10. package/dist/alert-dialog.js +1 -1
  11. package/dist/alert.d.ts +1 -1
  12. package/dist/alert.js +1 -1
  13. package/dist/anchor-CgcbWEUs.js +1 -0
  14. package/dist/anchor.js +1 -1
  15. package/dist/app-layout.d.ts +1183 -45
  16. package/dist/app-layout.js +1 -1
  17. package/dist/area-chart.d.ts +41 -18
  18. package/dist/area-chart.js +1 -1
  19. package/dist/avatar.js +1 -1
  20. package/dist/badge.d.ts +3 -2
  21. package/dist/badge.js +1 -1
  22. package/dist/bar-chart.d.ts +37 -13
  23. package/dist/bar-chart.js +1 -1
  24. package/dist/breadcrumb.js +1 -1
  25. package/dist/browser-only.js +1 -1
  26. package/dist/button-69InNC_m.js +1 -0
  27. package/dist/button-BMfUxs_j.js +1 -0
  28. package/dist/{button-DO53OA70.d.ts → button-CHoYpOzx.d.ts} +5 -4
  29. package/dist/{button-B52_vczK.js → button-D8rr-1AB.js} +1 -1
  30. package/dist/{button-crUf0hbR.d.ts → button-DL7V4bzW.d.ts} +5 -4
  31. package/dist/button-b2HKEIE2.js +1 -0
  32. package/dist/{button-B5i9n7Qp.d.ts → button-mzUR1U0Y.d.ts} +5 -4
  33. package/dist/button.d.ts +3 -3
  34. package/dist/button.js +1 -1
  35. package/dist/calendar.d.ts +3 -2
  36. package/dist/calendar.js +1 -1
  37. package/dist/card.d.ts +15 -7
  38. package/dist/card.js +1 -1
  39. package/dist/centered-layout.js +1 -1
  40. package/dist/{chart-DgaWVBqi.d.ts → chart-23KQ1ZNO.d.ts} +128 -62
  41. package/dist/chart-BRkJfptA.js +2 -0
  42. package/dist/checkbox-C3N2afhB.js +1 -0
  43. package/dist/checkbox.d.ts +3 -2
  44. package/dist/checkbox.js +1 -1
  45. package/dist/{choice-PESu-9s8.d.ts → choice-BCiyqLgO.d.ts} +12 -11
  46. package/dist/choice-DQmecLfy.js +1 -0
  47. package/dist/choice.d.ts +1 -1
  48. package/dist/choice.js +1 -1
  49. package/dist/code-block-4Esx_gV-.js +12 -0
  50. package/dist/code-block.d.ts +17 -16
  51. package/dist/code-block.js +6 -6
  52. package/dist/code-block_highlight-utils.js +1 -1
  53. package/dist/code.d.ts +2 -1
  54. package/dist/code.js +1 -1
  55. package/dist/combobox.d.ts +15 -14
  56. package/dist/combobox.js +1 -1
  57. package/dist/command.d.ts +13 -13
  58. package/dist/command.js +1 -1
  59. package/dist/cx-CK7o_rVv.js +1 -0
  60. package/dist/cx.js +1 -1
  61. package/dist/data-table.d.ts +32 -31
  62. package/dist/data-table.js +1 -1
  63. package/dist/description-list.d.ts +6 -6
  64. package/dist/description-list.js +1 -1
  65. package/dist/dialog-CaGJD02w.js +1 -0
  66. package/dist/{dialog-DXpqpdJj.d.ts → dialog-DQdeqvq-.d.ts} +28 -15
  67. package/dist/dialog.d.ts +1 -1
  68. package/dist/dialog.js +1 -1
  69. package/dist/{dropdown-menu-BloQKE_y.d.ts → dropdown-menu-Cef0Cz2B.d.ts} +17 -17
  70. package/dist/dropdown-menu-CutWQ0bl.js +1 -0
  71. package/dist/dropdown-menu-DMA8dGxZ.d.ts +1 -0
  72. package/dist/dropdown-menu.d.ts +2 -2
  73. package/dist/dropdown-menu.js +1 -1
  74. package/dist/empty.d.ts +14 -6
  75. package/dist/empty.js +1 -1
  76. package/dist/field.d.ts +16 -15
  77. package/dist/field.js +1 -1
  78. package/dist/flag.d.ts +4 -3
  79. package/dist/flag.js +1 -1
  80. package/dist/hooks.d.ts +251 -1
  81. package/dist/hooks.js +1 -1
  82. package/dist/hover-card.d.ts +5 -4
  83. package/dist/hover-card.js +1 -1
  84. package/dist/icon-BudQMD2S.js +1 -0
  85. package/dist/icon-kK0c-POG.js +1 -0
  86. package/dist/{icon-w0HUe7tr.d.ts → icon-r2NvfTWW.d.ts} +3 -2
  87. package/dist/{icon-BmJ57Tgh.d.ts → icon-ucVgZeXn.d.ts} +3 -2
  88. package/dist/icon.d.ts +2 -2
  89. package/dist/icon.js +1 -1
  90. package/dist/icons-CAtjMNti.js +1 -0
  91. package/dist/{icons-Bu-2boul.js → icons-CH3tD_wq.js} +1 -1
  92. package/dist/icons-CSwTVV2m.js +1 -0
  93. package/dist/icons.js +1 -1
  94. package/dist/in-view-Dxv_GrUU.js +1 -0
  95. package/dist/input-D_DjD9lT.js +1 -0
  96. package/dist/{input-DpnC3Xgj.d.ts → input-bbB1tC0h.d.ts} +3 -2
  97. package/dist/input.d.ts +5 -4
  98. package/dist/input.js +1 -1
  99. package/dist/kbd-CLHsJ99p.js +1 -0
  100. package/dist/kbd.d.ts +2 -1
  101. package/dist/kbd.js +1 -1
  102. package/dist/label-5T8i7I4X.js +1 -0
  103. package/dist/{label-Bnfe9YJ6.d.ts → label-C-KbNls8.d.ts} +3 -2
  104. package/dist/label.d.ts +1 -1
  105. package/dist/label.js +1 -1
  106. package/dist/{layer-container-R7aux3n8.js → layer-container-DLf-6eBz.js} +1 -1
  107. package/dist/layer-container.js +1 -1
  108. package/dist/line-chart.d.ts +40 -15
  109. package/dist/line-chart.js +1 -1
  110. package/dist/list-DOVZoz9t.js +1 -0
  111. package/dist/list.d.ts +3 -2
  112. package/dist/list.js +1 -1
  113. package/dist/live-region-DQ1QLv3L.js +1 -0
  114. package/dist/live-region.d.ts +3 -2
  115. package/dist/live-region.js +1 -1
  116. package/dist/llms.txt +118 -2
  117. package/dist/{main-Dv2zuT_b.js → main-CC1L9IsH.js} +1 -1
  118. package/dist/main.js +1 -1
  119. package/dist/mantle.css +12 -0
  120. package/dist/media-object.js +1 -1
  121. package/dist/migrations/0002-data-table-action-header.yml +526 -0
  122. package/dist/migrations/0003-dialog-footer-dom-order.yml +271 -0
  123. package/dist/migrations/0004-priority-to-intent.yml +1728 -0
  124. package/dist/migrations/0005-field-item-owns-control-id.yml +234 -0
  125. package/dist/migrations/0006-data-table-tanstack-v9.yml +423 -0
  126. package/dist/migrations/0008-tabs-separator.yml +1212 -0
  127. package/dist/migrations/0009-chart-root-mode.yml +871 -0
  128. package/dist/multi-select.d.ts +23 -22
  129. package/dist/multi-select.js +1 -1
  130. package/dist/otp-input.d.ts +9 -8
  131. package/dist/otp-input.js +1 -1
  132. package/dist/pagination.d.ts +9 -8
  133. package/dist/pagination.js +1 -1
  134. package/dist/{popover-Cco1nw8I.d.ts → popover-Dvls7-j4.d.ts} +5 -4
  135. package/dist/popover-oQDUvcZ2.js +1 -0
  136. package/dist/popover.d.ts +1 -1
  137. package/dist/popover.js +1 -1
  138. package/dist/primitive-AGoxSJBI.js +1 -0
  139. package/dist/progress.d.ts +9 -8
  140. package/dist/progress.js +1 -1
  141. package/dist/qr-code.d.ts +9 -8
  142. package/dist/qr-code.js +1 -1
  143. package/dist/radio-group.d.ts +19 -18
  144. package/dist/radio-group.js +1 -1
  145. package/dist/sandbar.d.ts +7 -7
  146. package/dist/sandbar.js +1 -1
  147. package/dist/{sandboxed-on-click-BLvvSqOP.js → sandboxed-on-click-C7pPu-2M.js} +1 -1
  148. package/dist/sandboxed-on-click.js +1 -1
  149. package/dist/scatter-plot.d.ts +39 -14
  150. package/dist/scatter-plot.js +1 -1
  151. package/dist/select-DcL0-duV.js +1 -0
  152. package/dist/{select-BITJP7I5.d.ts → select-DlohFa54.d.ts} +3 -3
  153. package/dist/select.d.ts +1 -1
  154. package/dist/select.js +1 -1
  155. package/dist/selectable-list.d.ts +16 -15
  156. package/dist/selectable-list.js +1 -1
  157. package/dist/{separator-Bo4nY_3M.d.ts → separator-BWGjCIl7.d.ts} +11 -3
  158. package/dist/separator-DvPe27fH.js +1 -0
  159. package/dist/separator.d.ts +1 -1
  160. package/dist/separator.js +1 -1
  161. package/dist/sheet-H8zvhSuA.js +1 -0
  162. package/dist/sheet.d.ts +13 -12
  163. package/dist/sheet.js +1 -1
  164. package/dist/sidebar.d.ts +163 -102
  165. package/dist/sidebar.js +1 -1
  166. package/dist/skeleton-zfqoDAxT.js +1 -0
  167. package/dist/skeleton.d.ts +3 -2
  168. package/dist/skeleton.js +1 -1
  169. package/dist/skip-to-main-link.js +1 -1
  170. package/dist/slider.d.ts +3 -2
  171. package/dist/slider.js +1 -1
  172. package/dist/{slot-BsvE2ntj.js → slot-DdYN1L1C.js} +1 -1
  173. package/dist/{slot-DdgxmuI5.d.ts → slot-Q996Hqk9.d.ts} +1 -1
  174. package/dist/slot.d.ts +1 -1
  175. package/dist/slot.js +1 -1
  176. package/dist/split-button.d.ts +6 -5
  177. package/dist/split-button.js +1 -1
  178. package/dist/strata.d.ts +544 -0
  179. package/dist/strata.js +1 -0
  180. package/dist/switch.d.ts +3 -2
  181. package/dist/switch.js +1 -1
  182. package/dist/{table-DEI-qvSC.d.ts → table-BhzITa19.d.ts} +10 -9
  183. package/dist/table-DBbKqOVq.js +1 -0
  184. package/dist/table.d.ts +1 -1
  185. package/dist/table.js +1 -1
  186. package/dist/tabs.d.ts +2 -2
  187. package/dist/tabs.js +1 -1
  188. package/dist/text-area.d.ts +3 -2
  189. package/dist/text-area.js +1 -1
  190. package/dist/theme-6Q65C1Rx.js +1 -0
  191. package/dist/theme-switcher.d.ts +3 -3
  192. package/dist/theme-switcher.js +1 -1
  193. package/dist/theme.js +1 -1
  194. package/dist/toast.d.ts +10 -9
  195. package/dist/toast.js +1 -1
  196. package/dist/{tooltip-nuUCoqq8.d.ts → tooltip-CngH7Kl6.d.ts} +7 -6
  197. package/dist/tooltip-NhYXqStK.js +1 -0
  198. package/dist/tooltip.d.ts +1 -1
  199. package/dist/tooltip.js +1 -1
  200. package/dist/truncated-text.d.ts +138 -0
  201. package/dist/truncated-text.js +1 -0
  202. package/dist/types.js +1 -1
  203. package/dist/use-breakpoint--mo7kr9d.js +1 -0
  204. package/dist/use-is-hydrated-after-paint-r9Cl2mGp.js +1 -0
  205. package/dist/use-prefers-reduced-motion-DimzRx-M.js +1 -0
  206. package/dist/use-swipe-to-dismiss-Cj-AayFd.js +1 -0
  207. package/dist/utils.js +1 -1
  208. package/dist/visually-hidden.d.ts +2 -1
  209. package/dist/visually-hidden.js +1 -1
  210. package/dist/well.d.ts +10 -2
  211. package/dist/well.js +1 -1
  212. package/package.json +17 -15
  213. package/dist/alert-OP_-aGJD.js +0 -1
  214. package/dist/anchor-BnMhJYS4.js +0 -1
  215. package/dist/button-BFpCB99R.js +0 -1
  216. package/dist/button-Dij5vCQG.js +0 -1
  217. package/dist/button-pwkdtR3U.js +0 -1
  218. package/dist/chart-aZLMj4xx.js +0 -2
  219. package/dist/checkbox-DbJSqSNN.js +0 -1
  220. package/dist/choice-SRyLguqU.js +0 -1
  221. package/dist/code-block-BE3Q0iAo.js +0 -12
  222. package/dist/cx-0HCjnNv1.js +0 -1
  223. package/dist/dialog-HIdb5d3I.js +0 -1
  224. package/dist/dropdown-menu-BR_AQNMj.js +0 -1
  225. package/dist/dropdown-menu-Dlpb7600.d.ts +0 -1
  226. package/dist/icon-BT8FnkkJ.js +0 -1
  227. package/dist/icon-U24NfYv7.js +0 -1
  228. package/dist/icons-BQRcOU6J.js +0 -1
  229. package/dist/icons-C3rVfpx9.js +0 -1
  230. package/dist/in-view-T_AAYaaF.js +0 -1
  231. package/dist/input-yq0jLE4e.js +0 -1
  232. package/dist/kbd-CJ8hNZfS.js +0 -1
  233. package/dist/label-BAy0Mg59.js +0 -1
  234. package/dist/list-BleZ-43e.js +0 -1
  235. package/dist/live-region-B2vJRvPH.js +0 -1
  236. package/dist/popover-BJ5XNwzD.js +0 -1
  237. package/dist/primitive-w3wFk2La.js +0 -1
  238. package/dist/select-CUWLEeuf.js +0 -1
  239. package/dist/separator-D98be0gY.js +0 -1
  240. package/dist/sheet-B5x8EO9Y.js +0 -1
  241. package/dist/skeleton-bVDP8BzY.js +0 -1
  242. package/dist/table-D2jh52KA.js +0 -1
  243. package/dist/theme-C1kFFdIk.js +0 -1
  244. package/dist/tooltip-H03l7E4Y.js +0 -1
  245. package/dist/use-is-hydrated-after-paint-Drj0lNi4.js +0 -1
  246. package/dist/use-prefers-reduced-motion-Cj9tJ181.js +0 -1
  247. /package/dist/{types-D85fCNV3.js → css-properties-D85fCNV3.js} +0 -0
package/dist/hooks.d.ts CHANGED
@@ -256,6 +256,121 @@ type Options = {
256
256
  */
257
257
  declare function useDebouncedCallback<T extends (...args: unknown[]) => unknown>(callbackFn: T, options: Options): (...args: Parameters<T>) => void;
258
258
  //#endregion
259
+ //#region src/hooks/use-focus-trap.d.ts
260
+ /**
261
+ * The options for {@link useFocusTrap}.
262
+ *
263
+ * @see https://mantle.ngrok.com/hooks#usefocustrap
264
+ *
265
+ * @example
266
+ * ```tsx
267
+ * useFocusTrap(panelRef, { active: open && coversThePage });
268
+ * ```
269
+ */
270
+ type UseFocusTrapOptions = {
271
+ /**
272
+ * Whether the trap holds focus. Flip it to engage and release the trap on
273
+ * one mounted element: a panel that covers the page at one viewport width
274
+ * and sits beside it at another keeps its DOM and turns the trap on and off.
275
+ *
276
+ * @default true
277
+ */
278
+ active?: boolean;
279
+ };
280
+ /**
281
+ * Keeps keyboard focus inside the element `ref` points at while `active` is
282
+ * `true`. On activation, when focus is outside the element, it moves focus to
283
+ * the element's first tab stop, else to the element itself, which gets
284
+ * `tabindex="-1"` for the trap's lifetime when it has none. An element that
285
+ * opens with a transition can hold nothing focusable in the commit that
286
+ * activates the trap, so the move retries for up to a second of frames until
287
+ * focus lands. While active, Tab on the last tab stop wraps to the first and
288
+ * Shift+Tab on the first wraps to the last, in document order. A child that
289
+ * prevents the default on `Tab` keeps it. On release the trap leaves focus
290
+ * where it is, so the caller decides where focus returns.
291
+ *
292
+ * It traps the keyboard only. Focus that a pointer or a script moves out of
293
+ * the element stays out, so a menu, a popover, or a dialog that portals out of
294
+ * the element keeps working. Make the rest of the page `inert` to block
295
+ * pointer focus, the way `AppLayout.SidePanel` does when it covers the page.
296
+ *
297
+ * The element must be mounted when `active` turns on; the hook reads the ref
298
+ * then and not on a later mount.
299
+ *
300
+ * @see https://mantle.ngrok.com/hooks#usefocustrap
301
+ *
302
+ * @example
303
+ * ```tsx
304
+ * function CoverPanel({ open, children }: { open: boolean; children: ReactNode }) {
305
+ * const panelRef = useRef<HTMLDivElement>(null);
306
+ * const coversThePage = useMatchesMediaQuery("(width < 48rem)");
307
+ * useFocusTrap(panelRef, { active: open && coversThePage });
308
+ *
309
+ * return (
310
+ * <div ref={panelRef} role="region" aria-label="Assistant" inert={!open}>
311
+ * {children}
312
+ * </div>
313
+ * );
314
+ * }
315
+ * ```
316
+ */
317
+ declare function useFocusTrap(ref: RefObject<HTMLElement | null>, { active }?: UseFocusTrapOptions): void;
318
+ //#endregion
319
+ //#region src/hooks/use-inert-siblings.d.ts
320
+ /**
321
+ * The options for {@link useInertSiblings}.
322
+ *
323
+ * @see https://mantle.ngrok.com/hooks#useinertsiblings
324
+ *
325
+ * @example
326
+ * ```tsx
327
+ * useInertSiblings(panelRef, { active: open && coversThePage });
328
+ * ```
329
+ */
330
+ type UseInertSiblingsOptions = {
331
+ /**
332
+ * Whether the siblings are inert. Flip it to make them inert and release
333
+ * them on one mounted element.
334
+ *
335
+ * @default true
336
+ */
337
+ active?: boolean;
338
+ };
339
+ /**
340
+ * Sets `inert` on every other child of the element's parent while `active`
341
+ * is `true`, so nothing beside the element is clickable, focusable, or read
342
+ * by assistive technology. A sibling that mounts while the hook is active
343
+ * goes inert too. On release it clears `inert` from the siblings it set and
344
+ * leaves alone one that was inert already.
345
+ *
346
+ * It reaches siblings only, not the rest of the document, so it fits a
347
+ * surface that covers one row of a layout in place: a panel that covers the
348
+ * card and the rail beside it, with a notice above the row still usable.
349
+ * Pair it with `useFocusTrap` to keep keyboard focus inside the element.
350
+ *
351
+ * The element must be mounted when `active` turns on; the hook reads the ref
352
+ * then and not on a later mount.
353
+ *
354
+ * @see https://mantle.ngrok.com/hooks#useinertsiblings
355
+ *
356
+ * @example
357
+ * ```tsx
358
+ * function CoverPanel({ open, children }: { open: boolean; children: ReactNode }) {
359
+ * const panelRef = useRef<HTMLDivElement>(null);
360
+ * const coversThePage = useMatchesMediaQuery("(width < 48rem)");
361
+ * useInertSiblings(panelRef, { active: open && coversThePage });
362
+ * useFocusTrap(panelRef, { active: open && coversThePage });
363
+ *
364
+ * return (
365
+ * <div ref={panelRef} role="region" aria-label="Assistant" inert={!open}>
366
+ * {children}
367
+ * </div>
368
+ * );
369
+ * }
370
+ * ```
371
+ */
372
+ declare function useInertSiblings(ref: RefObject<HTMLElement | null>, { active }?: UseInertSiblingsOptions): void;
373
+ //#endregion
259
374
  //#region src/hooks/use-is-hydrated.d.ts
260
375
  /**
261
376
  * Returns `false` during server rendering and the initial hydration render,
@@ -563,6 +678,141 @@ type ScrollBehavior = "auto" | "smooth";
563
678
  */
564
679
  export declare function useScrollBehavior(): ScrollBehavior;
565
680
  //#endregion
681
+ //#region src/hooks/use-swipe-to-dismiss.d.ts
682
+ /**
683
+ * The direction a swipe travels to dismiss the target: the edge it slides
684
+ * off. A panel on the right edge of the page dismisses to the `"right"`.
685
+ *
686
+ * @see https://mantle.ngrok.com/hooks#useswipetodismiss
687
+ */
688
+ type SwipeDirection = "left" | "right" | "up" | "down";
689
+ /**
690
+ * The CSS property a drag writes on the target. `translate` slides the target
691
+ * toward the edge. `flex-basis` shrinks the target from its current size
692
+ * toward nothing, for a flex item that collapses in a lane when dismissed.
693
+ *
694
+ * @see https://mantle.ngrok.com/hooks#useswipetodismiss
695
+ */
696
+ type SwipeProperty = "translate" | "flex-basis";
697
+ /**
698
+ * The options for {@link useSwipeToDismiss}.
699
+ *
700
+ * @see https://mantle.ngrok.com/hooks#useswipetodismiss
701
+ *
702
+ * @example
703
+ * ```tsx
704
+ * useSwipeToDismiss(headerRef, {
705
+ * target: panelRef,
706
+ * direction: "right",
707
+ * property: () => (getComputedStyle(panel).position === "absolute" ? "translate" : "flex-basis"),
708
+ * onDismiss: () => setOpen(false),
709
+ * });
710
+ * ```
711
+ */
712
+ type UseSwipeToDismissOptions = {
713
+ /**
714
+ * Called once when a released drag crosses the threshold or ends in a
715
+ * flick. The caller hides the target; the hook moves nothing after the
716
+ * release.
717
+ */
718
+ onDismiss: () => void;
719
+ /**
720
+ * The element the drag moves and measures. Defaults to the handle itself.
721
+ * Pass the panel when a header row is the handle.
722
+ */
723
+ target?: RefObject<HTMLElement | null>;
724
+ /**
725
+ * The edge the target slides off. A drag the other way meets rubber-band
726
+ * resistance and never dismisses.
727
+ *
728
+ * @default "right"
729
+ */
730
+ direction?: SwipeDirection;
731
+ /**
732
+ * The CSS property the drag writes on the target. A function runs at
733
+ * pointer down, for a target that slides in one layout and collapses in
734
+ * another.
735
+ *
736
+ * @default "translate"
737
+ */
738
+ property?: SwipeProperty | (() => SwipeProperty);
739
+ /**
740
+ * Whether a drag can start. A function runs at pointer down, for a
741
+ * condition CSS owns.
742
+ *
743
+ * @default true
744
+ */
745
+ active?: boolean | (() => boolean);
746
+ /**
747
+ * The share of the target's size along the direction a drag must cross to
748
+ * dismiss, between `0` and `1`.
749
+ *
750
+ * @default 0.25
751
+ */
752
+ threshold?: number;
753
+ /**
754
+ * The speed toward the edge, in CSS pixels per millisecond, that dismisses
755
+ * a shorter drag as a flick. A pointer that rests for 100ms before the
756
+ * release has no speed.
757
+ *
758
+ * @default 0.4
759
+ */
760
+ flickVelocity?: number;
761
+ };
762
+ /**
763
+ * Makes the element `handle` points at a swipe handle that drags `target`
764
+ * toward one edge and calls `onDismiss` when the drag crosses `threshold` of
765
+ * the target's size or ends in a flick. A shorter drag springs back, and a
766
+ * drag the wrong way meets rubber-band resistance. The target's own
767
+ * transition on the property animates both the spring back and the slide the
768
+ * caller runs after `onDismiss`, so a `motion-reduce:` rule on the target
769
+ * turns them into cuts.
770
+ *
771
+ * The target follows the pointer one to one: while the pointer is down the
772
+ * hook writes the property and `transition: none` on the target's inline
773
+ * style, and clears both on release. `translate` slides the target;
774
+ * `flex-basis` shrinks a flex item from its size toward nothing, the way a
775
+ * lane collapses. A tap on a control inside the handle stays a tap: the drag
776
+ * starts after 8px of travel along the direction, a gesture that travels
777
+ * further across it never starts, and a release after a drag swallows the
778
+ * click that follows it. Give the handle `touch-action: pan-y`
779
+ * (`touch-pan-y`) for a horizontal swipe, or `pan-x` for a vertical one, so
780
+ * the other axis still scrolls.
781
+ *
782
+ * Only the primary pointer with its main button drags, and only one drag runs
783
+ * at a time. The handle must be mounted when the hook runs; it reads the ref
784
+ * once per mount.
785
+ *
786
+ * @see https://mantle.ngrok.com/hooks#useswipetodismiss
787
+ *
788
+ * @example
789
+ * ```tsx
790
+ * function FloatingPanel({ open, setOpen, children }: FloatingPanelProps) {
791
+ * const panelRef = useRef<HTMLElement>(null);
792
+ * const headerRef = useRef<HTMLDivElement>(null);
793
+ * useSwipeToDismiss(headerRef, {
794
+ * target: panelRef,
795
+ * onDismiss: () => setOpen(false),
796
+ * });
797
+ *
798
+ * return (
799
+ * <aside
800
+ * ref={panelRef}
801
+ * aria-label="Assistant"
802
+ * data-state={open ? "open" : "closed"}
803
+ * className="transition-[translate] duration-200 ease-out-strong motion-reduce:transition-none data-state-closed:translate-x-full"
804
+ * >
805
+ * <div ref={headerRef} className="touch-pan-y">
806
+ * Assistant
807
+ * </div>
808
+ * {children}
809
+ * </aside>
810
+ * );
811
+ * }
812
+ * ```
813
+ */
814
+ declare function useSwipeToDismiss(handle: RefObject<HTMLElement | null>, options: UseSwipeToDismissOptions): void;
815
+ //#endregion
566
816
  //#region src/hooks/use-in-view.d.ts
567
817
  /**
568
818
  * Options for the `useInView` hook.
@@ -715,4 +965,4 @@ type UseUndoRedoReturn<T> = {
715
965
  */
716
966
  declare function useUndoRedo<T extends NonNullable<unknown>>(): UseUndoRedoReturn<T>;
717
967
  //#endregion
718
- export { type Breakpoint, type TailwindBreakpoint, type UseInViewOptions, type UseUndoRedoReturn, breakpoints, useBreakpoint, useCallbackRef, useComposedRefs, useCopyToClipboard, useDebounce, useDebouncedCallback, useInView, useIsBelowBreakpoint, useIsHydrated, useIsHydratedAfterPaint, useLocalStorage, useSessionStorage, useUndoRedo };
968
+ export { type Breakpoint, type SwipeDirection, type SwipeProperty, type TailwindBreakpoint, type UseFocusTrapOptions, type UseInViewOptions, type UseInertSiblingsOptions, type UseSwipeToDismissOptions, type UseUndoRedoReturn, breakpoints, useBreakpoint, useCallbackRef, useComposedRefs, useCopyToClipboard, useDebounce, useDebouncedCallback, useFocusTrap, useInView, useInertSiblings, useIsBelowBreakpoint, useIsHydrated, useIsHydratedAfterPaint, useLocalStorage, useSessionStorage, useSwipeToDismiss, 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-sFdxsL7k.js";import{t as n}from"./use-is-hydrated-DDCqXmju.js";import{t as r}from"./use-copy-to-clipboard-ByLT8veV.js";import{t as i}from"./use-callback-ref-BvVyI5K1.js";import{t as a}from"./use-matches-media-query-m860lols.js";import{n as o,t as s}from"./use-prefers-reduced-motion-Cj9tJ181.js";import{i as c,n as l,r as u,t as d}from"./use-is-hydrated-after-paint-Drj0lNi4.js";import{t as f}from"./in-view-T_AAYaaF.js";import{c as p}from"react/compiler-runtime";import{useEffect as m,useRef as h,useState as g,useSyncExternalStore as _}from"react";function v(e,t){let n=p(4),[r,i]=g(e),a,o;return n[0]!==t.waitMs||n[1]!==e?(a=()=>{let n=window.setTimeout(()=>{i(e)},t.waitMs);return()=>{window.clearTimeout(n)}},o=[e,t.waitMs],n[0]=t.waitMs,n[1]=e,n[2]=a,n[3]=o):(a=n[2],o=n[3]),m(a,o),r}function y(e,t){let n=p(5),r=i(e),a=h(0),o,s;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>()=>window.clearTimeout(a.current),s=[],n[0]=o,n[1]=s):(o=n[0],s=n[1]),m(o,s);let c;return n[2]!==t.waitMs||n[3]!==r?(c=(...e)=>{let n=e;window.clearTimeout(a.current),a.current=window.setTimeout(()=>r(...n),t.waitMs)},n[2]=t.waitMs,n[3]=r,n[4]=c):c=n[4],c}const b=new Map;function x(e){if(e.key==null){b.clear();return}b.has(e.key)&&(e.newValue==null?b.delete(e.key):b.set(e.key,e.newValue))}function S(){try{return window.localStorage}catch{return null}}function C(e){return function(t){function n(n){let r=n.storageArea==null||n.storageArea===S(),i=n.key==null||n.key===e;r&&i&&(x(n),t())}return window.addEventListener(`storage`,n),()=>{window.removeEventListener(`storage`,n)}}}function w(){return null}function T(e){let t=b.get(e);if(t!=null)return t;try{return window.localStorage.getItem(e)}catch{return null}}function E(e,t){try{window.localStorage.setItem(e,t),b.delete(e)}catch{b.set(e,t)}}function D(e,t){try{let n=JSON.parse(e);return typeof n==`string`?n:t}catch{return t}}function O(e,t){let n=p(12),r;n[0]===e?r=n[1]:(r=C(e),n[0]=e,n[1]=r);let i=r,a;n[2]===e?a=n[3]:(a=()=>T(e),n[2]=e,n[3]=a);let o=_(i,a,w),s;n[4]!==t||n[5]!==o?(s=o==null?t:D(o,t),n[4]=t,n[5]=o,n[6]=s):s=n[6];let c=s,l;n[7]===e?l=n[8]:(l=t=>{let n=JSON.stringify(t);E(e,n),window.dispatchEvent(new StorageEvent(`storage`,{key:e,newValue:n,storageArea:S()}))},n[7]=e,n[8]=l);let u=l,d;return n[9]!==u||n[10]!==c?(d=[c,u],n[9]=u,n[10]=c,n[11]=d):d=n[11],d}const k=new Map;function A(e){if(e.key==null){k.clear();return}k.has(e.key)&&(e.newValue==null?k.delete(e.key):k.set(e.key,e.newValue))}function j(){try{return window.sessionStorage}catch{return null}}function M(e){return function(t){function n(n){let r=n.storageArea==null||n.storageArea===j(),i=n.key==null||n.key===e;r&&i&&(A(n),t())}return window.addEventListener(`storage`,n),()=>{window.removeEventListener(`storage`,n)}}}function N(){return null}function P(e){let t=k.get(e);if(t!=null)return t;try{return window.sessionStorage.getItem(e)}catch{return null}}function F(e,t){try{window.sessionStorage.setItem(e,t),k.delete(e)}catch{k.set(e,t)}}function I(e,t){try{let n=JSON.parse(e);return typeof n==`string`?n:t}catch{return t}}function L(e,t){let n=p(12),r;n[0]===e?r=n[1]:(r=M(e),n[0]=e,n[1]=r);let i=r,a;n[2]===e?a=n[3]:(a=()=>P(e),n[2]=e,n[3]=a);let o=_(i,a,N),s;n[4]!==t||n[5]!==o?(s=o==null?t:I(o,t),n[4]=t,n[5]=o,n[6]=s):s=n[6];let c=s,l;n[7]===e?l=n[8]:(l=t=>{let n=JSON.stringify(t);F(e,n),window.dispatchEvent(new StorageEvent(`storage`,{key:e,newValue:n,storageArea:j()}))},n[7]=e,n[8]=l);let u=l,d;return n[9]!==u||n[10]!==c?(d=[c,u],n[9]=u,n[10]=c,n[11]=d):d=n[11],d}function R(){return o()?`auto`:`smooth`}function z(e,t){let n=p(14),r;n[0]===t?r=n[1]:(r=t===void 0?{}:t,n[0]=t,n[1]=r);let{root:i,margin:a,amount:o,once:s,initial:c}=r,l=s!==void 0&&s,u=c!==void 0&&c,[d,_]=g(u),v=h(u),y;n[2]!==o||n[3]!==a||n[4]!==l||n[5]!==e||n[6]!==i?.current?(y=()=>{let t=e.current;if(t==null||l&&v.current)return;let n=function(){if(v.current=!0,_(!0),!l)return()=>{v.current=!1,_(!1)}},r={root:i?.current??void 0,margin:a,amount:o};return f(t,n,r)},n[2]=o,n[3]=a,n[4]=l,n[5]=e,n[6]=i?.current,n[7]=y):y=n[7];let b;return n[8]!==o||n[9]!==a||n[10]!==l||n[11]!==e||n[12]!==i?(b=[i,e,a,l,o],n[8]=o,n[9]=a,n[10]=l,n[11]=e,n[12]=i,n[13]=b):b=n[13],m(y,b),d}function B(){let e=p(9),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let n=h(t),r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],e[1]=r):r=e[1];let i=h(r),a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a={undo:0,redo:0},e[2]=a):a=e[2];let[o,s]=g(a),c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>{n.current.push(e),i.current=[],s({undo:n.current.length,redo:0})},e[3]=c):c=e[3];let l=c,u;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(u=e=>{let t=n.current[n.current.length-1];if(t!==void 0)return n.current.pop(),i.current.push(e),s({undo:n.current.length,redo:i.current.length}),t},e[4]=u):u=e[4];let d=u,f;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>{let t=i.current[i.current.length-1];if(t!==void 0)return i.current.pop(),n.current.push(e),s({undo:n.current.length,redo:i.current.length}),t},e[5]=f):f=e[5];let m=f,_=o.undo>0,v=o.redo>0,y;return e[6]!==v||e[7]!==_?(y={canUndo:_,canRedo:v,push:l,undo:d,redo:m},e[6]=v,e[7]=_,e[8]=y):y=e[8],y}export{l as breakpoints,s as getPrefersReducedMotion,u as useBreakpoint,i as useCallbackRef,t as useComposedRefs,r as useCopyToClipboard,v as useDebounce,y as useDebouncedCallback,z as useInView,c as useIsBelowBreakpoint,n as useIsHydrated,d as useIsHydratedAfterPaint,e as useIsomorphicLayoutEffect,O as useLocalStorage,a as useMatchesMediaQuery,o as usePrefersReducedMotion,R as useScrollBehavior,L as useSessionStorage,B as useUndoRedo};
1
+ import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{n as t}from"./compose-refs-sFdxsL7k.js";import{n,r,t as i}from"./use-swipe-to-dismiss-Cj-AayFd.js";import{t as a}from"./use-is-hydrated-after-paint-r9Cl2mGp.js";import{t as o}from"./use-matches-media-query-m860lols.js";import{t as s}from"./use-is-hydrated-DDCqXmju.js";import{t as c}from"./use-copy-to-clipboard-ByLT8veV.js";import{t as l}from"./use-callback-ref-BvVyI5K1.js";import{n as u,t as d}from"./use-prefers-reduced-motion-DimzRx-M.js";import{n as f,r as p,t as m}from"./use-breakpoint--mo7kr9d.js";import{t as h}from"./in-view-Dxv_GrUU.js";import{c as g}from"react/compiler-runtime";import{useEffect as _,useRef as v,useState as y,useSyncExternalStore as b}from"react";function x(e,t){let n=g(4),[r,i]=y(e),a,o;return n[0]!==t.waitMs||n[1]!==e?(a=()=>{let n=window.setTimeout(()=>{i(e)},t.waitMs);return()=>{window.clearTimeout(n)}},o=[e,t.waitMs],n[0]=t.waitMs,n[1]=e,n[2]=a,n[3]=o):(a=n[2],o=n[3]),_(a,o),r}function S(e,t){let n=g(5),r=l(e),i=v(0),a,o;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>()=>window.clearTimeout(i.current),o=[],n[0]=a,n[1]=o):(a=n[0],o=n[1]),_(a,o);let s;return n[2]!==t.waitMs||n[3]!==r?(s=(...e)=>{let n=e;window.clearTimeout(i.current),i.current=window.setTimeout(()=>r(...n),t.waitMs)},n[2]=t.waitMs,n[3]=r,n[4]=s):s=n[4],s}const C=/* @__PURE__ */ new Map;function w(e){e.key==null?C.clear():C.has(e.key)&&(e.newValue==null?C.delete(e.key):C.set(e.key,e.newValue))}function T(){try{return window.localStorage}catch{return null}}function E(e){return function(t){function n(n){let r=n.storageArea==null||n.storageArea===T(),i=n.key==null||n.key===e;r&&i&&(w(n),t())}return window.addEventListener(`storage`,n),()=>{window.removeEventListener(`storage`,n)}}}function D(){return null}function O(e){let t=C.get(e);if(t!=null)return t;try{return window.localStorage.getItem(e)}catch{return null}}function k(e,t){try{window.localStorage.setItem(e,t),C.delete(e)}catch{C.set(e,t)}}function A(e,t){try{let n=JSON.parse(e);return typeof n==`string`?n:t}catch{return t}}function j(e,t){let n=g(12),r;n[0]===e?r=n[1]:(r=E(e),n[0]=e,n[1]=r);let i=r,a;n[2]===e?a=n[3]:(a=()=>O(e),n[2]=e,n[3]=a);let o=b(i,a,D),s;n[4]!==t||n[5]!==o?(s=o==null?t:A(o,t),n[4]=t,n[5]=o,n[6]=s):s=n[6];let c=s,l;n[7]===e?l=n[8]:(l=t=>{let n=JSON.stringify(t);k(e,n),window.dispatchEvent(new StorageEvent(`storage`,{key:e,newValue:n,storageArea:T()}))},n[7]=e,n[8]=l);let u=l,d;return n[9]!==u||n[10]!==c?(d=[c,u],n[9]=u,n[10]=c,n[11]=d):d=n[11],d}const M=/* @__PURE__ */ new Map;function N(e){e.key==null?M.clear():M.has(e.key)&&(e.newValue==null?M.delete(e.key):M.set(e.key,e.newValue))}function P(){try{return window.sessionStorage}catch{return null}}function F(e){return function(t){function n(n){let r=n.storageArea==null||n.storageArea===P(),i=n.key==null||n.key===e;r&&i&&(N(n),t())}return window.addEventListener(`storage`,n),()=>{window.removeEventListener(`storage`,n)}}}function I(){return null}function L(e){let t=M.get(e);if(t!=null)return t;try{return window.sessionStorage.getItem(e)}catch{return null}}function R(e,t){try{window.sessionStorage.setItem(e,t),M.delete(e)}catch{M.set(e,t)}}function z(e,t){try{let n=JSON.parse(e);return typeof n==`string`?n:t}catch{return t}}function B(e,t){let n=g(12),r;n[0]===e?r=n[1]:(r=F(e),n[0]=e,n[1]=r);let i=r,a;n[2]===e?a=n[3]:(a=()=>L(e),n[2]=e,n[3]=a);let o=b(i,a,I),s;n[4]!==t||n[5]!==o?(s=o==null?t:z(o,t),n[4]=t,n[5]=o,n[6]=s):s=n[6];let c=s,l;n[7]===e?l=n[8]:(l=t=>{let n=JSON.stringify(t);R(e,n),window.dispatchEvent(new StorageEvent(`storage`,{key:e,newValue:n,storageArea:P()}))},n[7]=e,n[8]=l);let u=l,d;return n[9]!==u||n[10]!==c?(d=[c,u],n[9]=u,n[10]=c,n[11]=d):d=n[11],d}function V(){return u()?`auto`:`smooth`}function H(e,t){let n=g(14),r;n[0]===t?r=n[1]:(r=t===void 0?{}:t,n[0]=t,n[1]=r);let{root:i,margin:a,amount:o,once:s,initial:c}=r,l=s!==void 0&&s,u=c!==void 0&&c,[d,f]=y(u),p=v(u),m;n[2]!==o||n[3]!==a||n[4]!==l||n[5]!==e||n[6]!==i?.current?(m=()=>{let t=e.current;if(t==null||l&&p.current)return;let n=function(){if(p.current=!0,f(!0),!l)return()=>{p.current=!1,f(!1)}},r={root:i?.current??void 0,margin:a,amount:o};return h(t,n,r)},n[2]=o,n[3]=a,n[4]=l,n[5]=e,n[6]=i?.current,n[7]=m):m=n[7];let b;return n[8]!==o||n[9]!==a||n[10]!==l||n[11]!==e||n[12]!==i?(b=[i,e,a,l,o],n[8]=o,n[9]=a,n[10]=l,n[11]=e,n[12]=i,n[13]=b):b=n[13],_(m,b),d}function U(){let e=g(9),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let n=v(t),r;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],e[1]=r):r=e[1];let i=v(r),a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a={undo:0,redo:0},e[2]=a):a=e[2];let[o,s]=y(a),c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=e=>{n.current.push(e),i.current=[],s({undo:n.current.length,redo:0})},e[3]=c):c=e[3];let l=c,u;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(u=e=>{let t=n.current[n.current.length-1];if(t!==void 0)return n.current.pop(),i.current.push(e),s({undo:n.current.length,redo:i.current.length}),t},e[4]=u):u=e[4];let d=u,f;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>{let t=i.current[i.current.length-1];if(t!==void 0)return i.current.pop(),n.current.push(e),s({undo:n.current.length,redo:i.current.length}),t},e[5]=f):f=e[5];let p=f,m=o.undo>0,h=o.redo>0,_;return e[6]!==h||e[7]!==m?(_={canUndo:m,canRedo:h,push:l,undo:d,redo:p},e[6]=h,e[7]=m,e[8]=_):_=e[8],_}export{m as breakpoints,d as getPrefersReducedMotion,f as useBreakpoint,l as useCallbackRef,t as useComposedRefs,c as useCopyToClipboard,x as useDebounce,S as useDebouncedCallback,r as useFocusTrap,H as useInView,n as useInertSiblings,p as useIsBelowBreakpoint,s as useIsHydrated,a as useIsHydratedAfterPaint,e as useIsomorphicLayoutEffect,j as useLocalStorage,o as useMatchesMediaQuery,u as usePrefersReducedMotion,V as useScrollBehavior,B as useSessionStorage,i as useSwipeToDismiss,U as useUndoRedo};
@@ -1,3 +1,4 @@
1
+ import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
1
2
  import { ComponentProps } from "react";
2
3
  import { Arrow, Content, Portal, Root, Trigger } from "@radix-ui/react-hover-card";
3
4
  //#region src/components/hover-card/hover-card.d.ts
@@ -48,7 +49,7 @@ declare const Root$1: ({ closeDelay, openDelay, ...props }: ComponentProps<typeo
48
49
  * </HoverCard.Root>
49
50
  * ```
50
51
  */
51
- declare const Trigger$1: (props: ComponentProps<typeof Trigger>) => import("react").JSX.Element;
52
+ declare const Trigger$1: ({ "data-slot": dataSlot, ...props }: ComponentProps<typeof Trigger> & WithDataSlot) => import("react").JSX.Element;
52
53
  /**
53
54
  * The portal container for rendering hover card content outside the normal DOM tree.
54
55
  * `HoverCard.Content` already renders inside this portal internally, so you typically
@@ -108,8 +109,8 @@ declare const Portal$1: ({ container, ...props }: ComponentProps<typeof Portal>)
108
109
  * </HoverCard.Root>
109
110
  * ```
110
111
  */
111
- declare const Content$1: ({ className, onClick, align, sideOffset, ...props }: ComponentProps<typeof Content>) => import("react").JSX.Element;
112
- type HoverCardArrowProps = Omit<ComponentProps<typeof Arrow>, "asChild" | "children">;
112
+ declare const Content$1: ({ "data-slot": dataSlot, className, onClick, align, sideOffset, ...props }: ComponentProps<typeof Content> & WithDataSlot) => import("react").JSX.Element;
113
+ type HoverCardArrowProps = Omit<ComponentProps<typeof Arrow>, "asChild" | "children"> & WithDataSlot;
113
114
  /**
114
115
  * An optional tip that points from `HoverCard.Content` at its trigger. Render it
115
116
  * as a child of `HoverCard.Content`. Radix positions it with floating-ui's arrow
@@ -133,7 +134,7 @@ type HoverCardArrowProps = Omit<ComponentProps<typeof Arrow>, "asChild" | "child
133
134
  * </HoverCard.Root>
134
135
  * ```
135
136
  */
136
- declare const Arrow$1: ({ className, height, width, ...props }: HoverCardArrowProps) => import("react").JSX.Element;
137
+ declare const Arrow$1: ({ "data-slot": dataSlot, className, height, width, ...props }: HoverCardArrowProps) => import("react").JSX.Element;
137
138
  /**
138
139
  * A floating card that appears when a user hovers over a trigger element.
139
140
  *
@@ -1 +1 @@
1
- import{t as e}from"./cx-0HCjnNv1.js";import{n as t,r as n}from"./layer-container-R7aux3n8.js";import{c as r}from"react/compiler-runtime";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{Arrow as o,Content as s,Portal as c,Root as l,Trigger as u}from"@radix-ui/react-hover-card";const d=e=>{let t=r(8),n,a,o;t[0]===e?(n=t[1],a=t[2],o=t[3]):({closeDelay:a,openDelay:o,...n}=e,t[0]=e,t[1]=n,t[2]=a,t[3]=o);let s=a===void 0?300:a,c=o===void 0?100:o,u;return t[4]!==s||t[5]!==c||t[6]!==n?(u=i(l,{closeDelay:s,openDelay:c,...n}),t[4]=s,t[5]=c,t[6]=n,t[7]=u):u=t[7],u},f=e=>{let t=r(2),n;return t[0]===e?n=t[1]:(n=i(u,{"data-slot":`hover-card-trigger`,...e}),t[0]=e,t[1]=n),n},p=e=>{let a=r(9),o,s;a[0]===e?(o=a[1],s=a[2]):({container:o,...s}=e,a[0]=e,a[1]=o,a[2]=s);let l=n(),u=o??l,d;a[3]!==s||a[4]!==u?(d=i(c,{container:u,...s}),a[3]=s,a[4]=u,a[5]=d):d=a[5];let f;return a[6]!==u||a[7]!==d?(f=i(t.Provider,{value:u,children:d}),a[6]=u,a[7]=d,a[8]=f):f=a[8],f},m={Root:d,Arrow:t=>{let n=r(16),s,c,l,u;n[0]===t?(s=n[1],c=n[2],l=n[3],u=n[4]):({className:s,height:l,width:u,...c}=t,n[0]=t,n[1]=s,n[2]=c,n[3]=l,n[4]=u);let d=l===void 0?7:l,f=u===void 0?14:u,p;n[5]===s?p=n[6]:(p=e(`fill-[var(--background-color-popover)]`,`[clip-path:inset(0_-200%_-200%_-200%)]`,`[filter:drop-shadow(0_0_4px_color-mix(in_oklab,var(--shadow-color)_var(--shadow-first-opacity),transparent))]`,s),n[5]=s,n[6]=p);let m,h;n[7]===Symbol.for(`react.memo_cache_sentinel`)?(m=i(`polygon`,{points:`0,0 30,0 15,10`}),h=i(`polyline`,{className:`stroke-[color:var(--border-color-popover)]`,fill:`none`,points:`0,0 15,10 30,0`,strokeWidth:1.5,vectorEffect:`non-scaling-stroke`}),n[7]=m,n[8]=h):(m=n[7],h=n[8]);let g;n[9]===p?g=n[10]:(g=a(`svg`,{className:p,children:[m,h]}),n[9]=p,n[10]=g);let _;return n[11]!==d||n[12]!==c||n[13]!==g||n[14]!==f?(_=i(o,{"aria-hidden":`true`,asChild:!0,"data-slot":`hover-card-arrow`,height:d,width:f,...c,children:g}),n[11]=d,n[12]=c,n[13]=g,n[14]=f,n[15]=_):_=n[15],_},Content:t=>{let n=r(16),a,o,c,l,u;n[0]===t?(a=n[1],o=n[2],c=n[3],l=n[4],u=n[5]):({className:a,onClick:o,align:l,sideOffset:u,...c}=t,n[0]=t,n[1]=a,n[2]=o,n[3]=c,n[4]=l,n[5]=u);let d=l===void 0?`center`:l,f=u===void 0?4:u,m;n[6]===a?m=n[7]:(m=e(`relative`,`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`,a),n[6]=a,n[7]=m);let h;n[8]===o?h=n[9]:(h=e=>{e.stopPropagation(),o?.(e)},n[8]=o,n[9]=h);let g;return n[10]!==d||n[11]!==c||n[12]!==f||n[13]!==m||n[14]!==h?(g=i(p,{children:i(s,{"data-slot":`hover-card-content`,align:d,sideOffset:f,className:m,onClick:h,...c})}),n[10]=d,n[11]=c,n[12]=f,n[13]=m,n[14]=h,n[15]=g):g=n[15],g},Portal:p,Trigger:f};export{m as HoverCard};
1
+ import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{n,r}from"./layer-container-DLf-6eBz.js";import{c as i}from"react/compiler-runtime";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{Arrow as s,Content as c,Portal as l,Root as u,Trigger as d}from"@radix-ui/react-hover-card";const f=e=>{let t=i(8),n,r,o;t[0]===e?(n=t[1],r=t[2],o=t[3]):({closeDelay:r,openDelay:o,...n}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=o);let s=r===void 0?300:r,c=o===void 0?100:o,l;return t[4]!==s||t[5]!==c||t[6]!==n?(l=/* @__PURE__ */ a(u,{closeDelay:s,openDelay:c,...n}),t[4]=s,t[5]=c,t[6]=n,t[7]=l):l=t[7],l},p=e=>{let n=i(8),r,o;n[0]===e?(r=n[1],o=n[2]):({"data-slot":r,...o}=e,n[0]=e,n[1]=r,n[2]=o);let s;n[3]===r?s=n[4]:(s=t(r,`hover-card-trigger`),n[3]=r,n[4]=s);let c;return n[5]!==o||n[6]!==s?(c=/* @__PURE__ */ a(d,{"data-slot":s,...o}),n[5]=o,n[6]=s,n[7]=c):c=n[7],c},m=e=>{let t=i(9),o,s;t[0]===e?(o=t[1],s=t[2]):({container:o,...s}=e,t[0]=e,t[1]=o,t[2]=s);let c=r(),u=o??c,d;t[3]!==s||t[4]!==u?(d=/* @__PURE__ */ a(l,{container:u,...s}),t[3]=s,t[4]=u,t[5]=d):d=t[5];let f;return t[6]!==u||t[7]!==d?(f=/* @__PURE__ */ a(n.Provider,{value:u,children:d}),t[6]=u,t[7]=d,t[8]=f):f=t[8],f},h={Root:f,Arrow:n=>{let r=i(20),c,l,u,d,f;r[0]===n?(c=r[1],l=r[2],u=r[3],d=r[4],f=r[5]):({"data-slot":l,className:c,height:d,width:f,...u}=n,r[0]=n,r[1]=c,r[2]=l,r[3]=u,r[4]=d,r[5]=f);let p=d===void 0?7:d,m=f===void 0?14:f,h;r[6]===l?h=r[7]:(h=t(l,`hover-card-arrow`),r[6]=l,r[7]=h);let g;r[8]===c?g=r[9]:(g=e(`fill-[var(--background-color-popover)]`,`[clip-path:inset(0_-200%_-200%_-200%)]`,`[filter:drop-shadow(0_0_4px_color-mix(in_oklab,var(--shadow-color)_var(--shadow-first-opacity),transparent))]`,c),r[8]=c,r[9]=g);let _,v;r[10]===Symbol.for(`react.memo_cache_sentinel`)?(_=/* @__PURE__ */ a(`polygon`,{points:`0,0 30,0 15,10`}),v=/* @__PURE__ */ a(`polyline`,{className:`stroke-[color:var(--border-color-popover)]`,fill:`none`,points:`0,0 15,10 30,0`,strokeWidth:1.5,vectorEffect:`non-scaling-stroke`}),r[10]=_,r[11]=v):(_=r[10],v=r[11]);let y;r[12]===g?y=r[13]:(y=/* @__PURE__ */ o(`svg`,{className:g,children:[_,v]}),r[12]=g,r[13]=y);let b;return r[14]!==p||r[15]!==u||r[16]!==h||r[17]!==y||r[18]!==m?(b=/* @__PURE__ */ a(s,{"aria-hidden":`true`,asChild:!0,"data-slot":h,height:p,width:m,...u,children:y}),r[14]=p,r[15]=u,r[16]=h,r[17]=y,r[18]=m,r[19]=b):b=r[19],b},Content:n=>{let r=i(20),o,s,l,u,d,f;r[0]===n?(o=r[1],s=r[2],l=r[3],u=r[4],d=r[5],f=r[6]):({"data-slot":s,className:o,onClick:l,align:d,sideOffset:f,...u}=n,r[0]=n,r[1]=o,r[2]=s,r[3]=l,r[4]=u,r[5]=d,r[6]=f);let p=d===void 0?`center`:d,h=f===void 0?4:f,g;r[7]===s?g=r[8]:(g=t(s,`hover-card-content`),r[7]=s,r[8]=g);let _;r[9]===o?_=r[10]:(_=e(`relative`,`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`,o),r[9]=o,r[10]=_);let v;r[11]===l?v=r[12]:(v=e=>{e.stopPropagation(),l?.(e)},r[11]=l,r[12]=v);let y;return r[13]!==p||r[14]!==u||r[15]!==h||r[16]!==g||r[17]!==_||r[18]!==v?(y=/* @__PURE__ */ a(m,{children:/* @__PURE__ */ a(c,{"data-slot":g,align:p,sideOffset:h,className:_,onClick:v,...u})}),r[13]=p,r[14]=u,r[15]=h,r[16]=g,r[17]=_,r[18]=v,r[19]=y):y=r[19],y},Portal:m,Trigger:p};export{h as HoverCard};
@@ -0,0 +1 @@
1
+ import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{Children as n,cloneElement as r,isValidElement as i}from"react";import a from"tiny-invariant";const o=e=>e!=null&&n.toArray(e).some(e=>i(e)&&e.type===`title`),s=e=>e[`aria-label`]!=null||e[`aria-labelledby`]!=null||e[`aria-hidden`]!=null||e.role!=null||e.alt!=null||o(e.children),c=({"data-slot":o,className:c,style:l,svg:u,ref:d,...f})=>{a(i(u)&&n.only(u),`SvgOnly must be passed a single SVG icon as a JSX tag.`);let p=!s(f)&&!s(u.props);return r(u,{"data-slot":t(o,`svg-only`),...p&&{"aria-hidden":!0},...f,className:e(`shrink-0`,c,u.props.className),style:{...l,...u.props.style},ref:d})};export{c as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./icon-BudQMD2S.js";import{c as r}from"react/compiler-runtime";import{jsx as i}from"react/jsx-runtime";const a=a=>{let o=r(18),s,c,l,u,d,f;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5],f=o[6]):({"data-slot":c,className:s,style:d,svg:f,ref:u,...l}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d,o[6]=f);let p;o[7]===c?p=o[8]:(p=t(c,`icon`),o[7]=c,o[8]=p);let m;o[9]===s?m=o[10]:(m=e(`size-5`,s),o[9]=s,o[10]=m);let h;return o[11]!==l||o[12]!==u||o[13]!==d||o[14]!==f||o[15]!==p||o[16]!==m?(h=/* @__PURE__ */ i(n,{ref:u,"data-slot":p,className:m,style:d,svg:f,...l}),o[11]=l,o[12]=u,o[13]=d,o[14]=f,o[15]=p,o[16]=m,o[17]=h):h=o[17],h};export{a as t};
@@ -1,3 +1,4 @@
1
+ import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
1
2
  import { t as SvgAttributes } from "./icon-D1RY5Tcj.js";
2
3
  import { ReactNode } from "react";
3
4
  //#region src/components/icon/svg-only.d.ts
@@ -6,7 +7,7 @@ type SvgOnlyProps = Omit<SvgAttributes, "children"> & {
6
7
  * A single SVG icon element.
7
8
  */
8
9
  svg: ReactNode;
9
- };
10
+ } & WithDataSlot;
10
11
  type NamedSvgProps = SvgAttributes & {
11
12
  /**
12
13
  * Phosphor's `alt` prop. `IconBase` renders it as a `<title>` child, so it
@@ -37,6 +38,6 @@ type NamedSvgProps = SvgAttributes & {
37
38
  * <SvgOnly svg={<ShrimpIcon />} role="img" aria-label="Shrimp" />
38
39
  * ```
39
40
  */
40
- declare const SvgOnly: ({ className, style, svg, ref, ...props }: SvgOnlyProps) => import("react").ReactElement<NamedSvgProps, string | import("react").JSXElementConstructor<any>>;
41
+ declare const SvgOnly: ({ "data-slot": dataSlot, className, style, svg, ref, ...props }: SvgOnlyProps) => import("react").ReactElement<NamedSvgProps, string | import("react").JSXElementConstructor<any>>;
41
42
  //#endregion
42
43
  export { SvgOnlyProps as n, SvgOnly as t };
@@ -1,3 +1,4 @@
1
+ import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
1
2
  import { t as SvgAttributes } from "./icon-D1RY5Tcj.js";
2
3
  import { ReactNode } from "react";
3
4
  //#region src/components/icon/icon.d.ts
@@ -6,7 +7,7 @@ type IconProps = Omit<SvgAttributes, "children"> & {
6
7
  * A single SVG icon element.
7
8
  */
8
9
  svg: ReactNode;
9
- };
10
+ } & WithDataSlot;
10
11
  /**
11
12
  * Decorates an svg icon with automatic sizing styles and a `shrink-0` class.
12
13
  *
@@ -29,6 +30,6 @@ type IconProps = Omit<SvgAttributes, "children"> & {
29
30
  * <Icon svg={<ShrimpIcon />} role="img" aria-label="Shrimp" />
30
31
  * ```
31
32
  */
32
- declare const Icon: ({ className, style, svg, ref, ...props }: IconProps) => import("react").JSX.Element;
33
+ declare const Icon: ({ "data-slot": dataSlot, className, style, svg, ref, ...props }: IconProps) => import("react").JSX.Element;
33
34
  //#endregion
34
35
  export { IconProps as n, Icon as t };
package/dist/icon.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import { t as SvgAttributes } from "./icon-D1RY5Tcj.js";
2
- import { n as IconProps, t as Icon } from "./icon-BmJ57Tgh.js";
3
- import { n as SvgOnlyProps, t as SvgOnly } from "./icon-w0HUe7tr.js";
2
+ import { n as IconProps, t as Icon } from "./icon-ucVgZeXn.js";
3
+ import { n as SvgOnlyProps, t as SvgOnly } from "./icon-r2NvfTWW.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"./icon-U24NfYv7.js";import{t}from"./icon-BT8FnkkJ.js";export{t as Icon,e as SvgOnly};
1
+ import{t as e}from"./icon-BudQMD2S.js";import{t}from"./icon-kK0c-POG.js";export{t as Icon,e as SvgOnly};
@@ -0,0 +1 @@
1
+ import{s as e}from"./theme-6Q65C1Rx.js";import{c as t}from"react/compiler-runtime";import{jsx as n}from"react/jsx-runtime";import{DesktopIcon as r}from"@phosphor-icons/react/Desktop";import{MoonIcon as i}from"@phosphor-icons/react/Moon";import{SunIcon as a}from"@phosphor-icons/react/Sun";function o(r){let i=t(3),a=e(),o;return i[0]!==a||i[1]!==r?(o=/* @__PURE__ */ n(s,{theme:a,...r}),i[0]=a,i[1]=r,i[2]=o):o=i[2],o}function s(e){let o=t(13),s,c;switch(o[0]===e?(s=o[1],c=o[2]):({theme:c,...s}=e,o[0]=e,o[1]=s,o[2]=c),c){case`system`:{let e;return o[3]===s?e=o[4]:(e=/* @__PURE__ */ n(r,{...s}),o[3]=s,o[4]=e),e}case`light`:{let e;return o[5]===s?e=o[6]:(e=/* @__PURE__ */ n(a,{...s}),o[5]=s,o[6]=e),e}case`dark`:{let e;return o[7]===s?e=o[8]:(e=/* @__PURE__ */ n(i,{...s}),o[7]=s,o[8]=e),e}case`light-high-contrast`:{let e;return o[9]===s?e=o[10]:(e=/* @__PURE__ */ n(a,{...s,weight:`fill`}),o[9]=s,o[10]=e),e}case`dark-high-contrast`:{let e;return o[11]===s?e=o[12]:(e=/* @__PURE__ */ n(i,{...s,weight:`fill`}),o[11]=s,o[12]=e),e}}}export{s as n,o as t};
@@ -1 +1 @@
1
- import{i as e}from"./direction-Wa9W2F61.js";import{c as t}from"react/compiler-runtime";import{jsx as n}from"react/jsx-runtime";import{SortAscendingIcon as r}from"@phosphor-icons/react/SortAscending";import{SortDescendingIcon as i}from"@phosphor-icons/react/SortDescending";const a=a=>{let o=t(12),s,c,l;switch(o[0]===a?(s=o[1],c=o[2],l=o[3]):({mode:c,direction:s,...l}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l),c){case`alphanumeric`:switch(s){case`asc`:{let e;return o[4]===l?e=o[5]:(e=n(r,{...l}),o[4]=l,o[5]=e),e}case`desc`:{let e;return o[6]===l?e=o[7]:(e=n(i,{...l}),o[6]=l,o[7]=e),e}default:throw Error(`Invalid alphanumeric sorting direction given: "${s}"`)}case`time`:switch(e(s)){case`oldest-to-newest`:{let e;return o[8]===l?e=o[9]:(e=n(i,{...l}),o[8]=l,o[9]=e),e}case`newest-to-oldest`:{let e;return o[10]===l?e=o[11]:(e=n(r,{...l}),o[10]=l,o[11]=e),e}default:throw Error(`Invalid time sorting direction given: "${s}"`)}}};export{a as t};
1
+ import{i as e}from"./direction-Wa9W2F61.js";import{c as t}from"react/compiler-runtime";import{jsx as n}from"react/jsx-runtime";import{SortAscendingIcon as r}from"@phosphor-icons/react/SortAscending";import{SortDescendingIcon as i}from"@phosphor-icons/react/SortDescending";const a=a=>{let o=t(12),s,c,l;switch(o[0]===a?(s=o[1],c=o[2],l=o[3]):({mode:c,direction:s,...l}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l),c){case`alphanumeric`:switch(s){case`asc`:{let e;return o[4]===l?e=o[5]:(e=/* @__PURE__ */ n(r,{...l}),o[4]=l,o[5]=e),e}case`desc`:{let e;return o[6]===l?e=o[7]:(e=/* @__PURE__ */ n(i,{...l}),o[6]=l,o[7]=e),e}default:throw Error(`Invalid alphanumeric sorting direction given: "${s}"`)}case`time`:switch(e(s)){case`oldest-to-newest`:{let e;return o[8]===l?e=o[9]:(e=/* @__PURE__ */ n(i,{...l}),o[8]=l,o[9]=e),e}case`newest-to-oldest`:{let e;return o[10]===l?e=o[11]:(e=/* @__PURE__ */ n(r,{...l}),o[10]=l,o[11]=e),e}default:throw Error(`Invalid time sorting direction given: "${s}"`)}}};export{a as t};
@@ -0,0 +1 @@
1
+ import{c as e}from"react/compiler-runtime";import{jsx as t,jsxs as n}from"react/jsx-runtime";function r(r){let i=e(5),a,o,s;i[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=/* @__PURE__ */ t(`path`,{fill:`none`,d:`M0 0h256v256H0z`}),o=/* @__PURE__ */ t(`path`,{d:`m213.7 82.3-56-56c-1.5-1.5-3.5-2.3-5.7-2.3H56c-8.8 0-16 7.2-16 16v88c0 4.4 3.6 8 8 8s8-3.6 8-8V40h88v48c0 4.4 3.6 8 8 8h48v120h-40c-4.4 0-8 3.6-8 8s3.6 8 8 8h40c8.8 0 16-7.2 16-16V88c0-2.1-.8-4.2-2.3-5.7zm-53.7-31L188.7 80H160V51.3z`}),s=/* @__PURE__ */ t(`path`,{d:`M124.6 194.5h-6.8v-27.3h6.8c1.9 0 3.4-1.5 3.4-3.4s-1.5-3.4-3.4-3.4h-6.8v-10.2c0-3.8-3.1-6.8-6.8-6.8H63.3c-3.8 0-6.8 3.1-6.8 6.8v10.2h-6.8c-1.9 0-3.4 1.5-3.4 3.4s1.5 3.4 3.4 3.4h6.8v27.3h-6.8c-1.9 0-3.4 1.5-3.4 3.4s1.5 3.4 3.4 3.4h6.8v23.9c0 3.8 3.1 6.8 6.8 6.8H111c3.8 0 6.8-3.1 6.8-6.8v-23.9h6.8c1.9 0 3.4-1.5 3.4-3.4s-1.5-3.4-3.4-3.4zm-37.5-11.9c-6.6 0-11.9-5.3-11.9-11.9s5.3-11.9 11.9-11.9S99 164.1 99 170.7s-5.3 11.9-11.9 11.9zm0 10.2c6.6 0 11.9 5.3 11.9 11.9s-5.3 11.9-11.9 11.9-11.9-5.3-11.9-11.9 5.3-11.9 11.9-11.9z`}),i[0]=a,i[1]=o,i[2]=s):(a=i[0],o=i[1],s=i[2]);let c;return i[3]===r?c=i[4]:(c=/* @__PURE__ */ n(`svg`,{fill:`currentColor`,height:`1em`,viewBox:`0 0 256 256`,width:`1em`,...r,children:[a,o,s]}),i[3]=r,i[4]=c),c}export{r as t};
package/dist/icons.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./icons-C3rVfpx9.js";import{t}from"./icons-Bu-2boul.js";import{n,t as r}from"./icons-BQRcOU6J.js";import{c as i}from"react/compiler-runtime";import{jsx as a}from"react/jsx-runtime";function o(e){let t=i(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=a(`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`}),t[0]=n):n=t[0];let r;return t[1]===e?r=t[2]:(r=a(`svg`,{fill:`currentColor`,height:`1em`,viewBox:`0 0 94 36`,width:`2.61em`,...e,children:n}),t[1]=e,t[2]=r),r}function s(e){let t=i(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=a(`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`}),t[0]=n):n=t[0];let r;return t[1]===e?r=t[2]:(r=a(`svg`,{fill:`currentColor`,height:`1em`,viewBox:`0 0 32 32`,width:`1em`,...e,children:n}),t[1]=e,t[2]=r),r}export{r as AutoThemeIcon,s as NgrokLettermarkIcon,o as NgrokWordmarkIcon,t as SortIcon,n as ThemeIcon,e as TrafficPolicyFileIcon};
1
+ import{t as e}from"./icons-CSwTVV2m.js";import{t}from"./icons-CH3tD_wq.js";import{n,t as r}from"./icons-CAtjMNti.js";import{c as i}from"react/compiler-runtime";import{jsx as a}from"react/jsx-runtime";function o(e){let t=i(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=/* @__PURE__ */ a(`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`}),t[0]=n):n=t[0];let r;return t[1]===e?r=t[2]:(r=/* @__PURE__ */ a(`svg`,{fill:`currentColor`,height:`1em`,viewBox:`0 0 94 36`,width:`2.61em`,...e,children:n}),t[1]=e,t[2]=r),r}function s(e){let t=i(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=/* @__PURE__ */ a(`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`}),t[0]=n):n=t[0];let r;return t[1]===e?r=t[2]:(r=/* @__PURE__ */ a(`svg`,{fill:`currentColor`,height:`1em`,viewBox:`0 0 32 32`,width:`1em`,...e,children:n}),t[1]=e,t[2]=r),r}export{r as AutoThemeIcon,s as NgrokLettermarkIcon,o as NgrokWordmarkIcon,t as SortIcon,n as ThemeIcon,e as TrafficPolicyFileIcon};
@@ -0,0 +1 @@
1
+ const e={some:0,all:1};function t(t,n,{root:r,margin:i,amount:a=`some`}={}){let o=/* @__PURE__ */ new WeakMap,s=new IntersectionObserver(e=>{e.forEach(e=>{let t=o.get(e.target);if(e.isIntersecting!==!!t){if(e.isIntersecting){let t=n(e.target,e);typeof t==`function`?o.set(e.target,t):s.unobserve(e.target)}else typeof t==`function`&&(t(e),o.delete(e.target))}})},{root:r,rootMargin:i,threshold:typeof a==`number`?a:e[a]});return s.observe(t),()=>{s.unobserve(t),s.disconnect()}}export{t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./compose-refs-sFdxsL7k.js";import{t}from"./cx-CK7o_rVv.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{t as r}from"./icon-kK0c-POG.js";import{t as i}from"./booleanish-BfvnW6vy.js";import{t as a}from"./clsx-DUGZgXfJ.js";import{a as o,r as s}from"./field-Bpptk_9t.js";import{c}from"react/compiler-runtime";import{createContext as l,useContext as u,useRef as d}from"react";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{CheckCircleIcon as m}from"@phosphor-icons/react/CheckCircle";import{WarningIcon as h}from"@phosphor-icons/react/Warning";import{WarningDiamondIcon as g}from"@phosphor-icons/react/WarningDiamond";const _=e=>{let t=c(17),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({children:n,className:r,ref:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=!!n,s=d(null);if(o){let e;return t[5]!==n||t[6]!==r||t[7]!==i||t[8]!==a?(e=/* @__PURE__ */ f(b,{className:r,forwardedRef:a,innerRef:s,...i,children:n}),t[5]=n,t[6]=r,t[7]=i,t[8]=a,t[9]=e):e=t[9],e}let l;t[10]===i?l=t[11]:(l=/* @__PURE__ */ f(v,{...i}),t[10]=i,t[11]=l);let u;return t[12]!==r||t[13]!==i||t[14]!==a||t[15]!==l?(u=/* @__PURE__ */ f(b,{...i,className:r,forwardedRef:a,innerRef:s,children:l}),t[12]=r,t[13]=i,t[14]=a,t[15]=l,t[16]=u):u=t[16],u},v=r=>{let i=c(31),a,l,d,p,m,h;i[0]===r?(a=i[1],l=i[2],d=i[3],p=i[4],m=i[5],h=i[6]):({"aria-invalid":a,"data-slot":p,className:d,ref:m,validation:l,...h}=r,i[0]=r,i[1]=a,i[2]=l,i[3]=d,i[4]=p,i[5]=m,i[6]=h);let g=u(y),_,v,b,x,S;i[7]===g?(_=i[8],v=i[9],b=i[10],x=i[11],S=i[12]):({"aria-invalid":v,forwardedRef:b,innerRef:x,validation:S,..._}=g,i[7]=g,i[8]=_,i[9]=v,i[10]=b,i[11]=x,i[12]=S);let C=o(),w=v??a,T=S??l??C,E;i[13]!==w||i[14]!==T?(E=s({"aria-invalid":w,validation:T}),i[13]=w,i[14]=T,i[15]=E):E=i[15];let{ariaInvalid:D,validation:O}=E,k=h.type??_.type??`text`,A;i[16]!==_||i[17]!==h||i[18]!==k?(A={..._,...h,type:k},i[16]=_,i[17]=h,i[18]=k,i[19]=A):A=i[19];let j=A,M=e(m,b,x),N;i[20]===p?N=i[21]:(N=n(p,`input-capture`),i[20]=p,i[21]=N);let P;i[22]===d?P=i[23]:(P=t(`placeholder:text-placeholder min-w-0 flex-1 bg-transparent text-left autofill:shadow-[inset_0_0_0px_1000px_var(--color-blue-50)] focus:outline-hidden`,d),i[22]=d,i[23]=P);let F;return i[24]!==D||i[25]!==M||i[26]!==j||i[27]!==N||i[28]!==P||i[29]!==O?(F=/* @__PURE__ */ f(`input`,{"aria-invalid":D,"data-slot":N,"data-validation":O,className:P,ref:M,...j}),i[24]=D,i[25]=M,i[26]=j,i[27]=N,i[28]=P,i[29]=O,i[30]=F):F=i[30],F},y=l({validation:void 0,innerRef:{current:null}}),b=e=>{let r=c(51),a,l,u,d,m,h,g,_,v,b,S,C;r[0]===e?(a=r[1],l=r[2],u=r[3],d=r[4],m=r[5],h=r[6],g=r[7],_=r[8],v=r[9],b=r[10],S=r[11],C=r[12]):({"aria-invalid":l,"aria-disabled":a,"data-slot":h,children:d,className:m,disabled:g,forwardedRef:_,innerRef:v,style:S,type:C,validation:u,...b}=e,r[0]=e,r[1]=a,r[2]=l,r[3]=u,r[4]=d,r[5]=m,r[6]=h,r[7]=g,r[8]=_,r[9]=v,r[10]=b,r[11]=S,r[12]=C);let w=o(),T=u??w,E;r[13]!==l||r[14]!==T?(E=s({"aria-invalid":l,validation:T}),r[13]=l,r[14]=T,r[15]=E):E=r[15];let{validation:D}=E,O;r[16]!==a||r[17]!==l||r[18]!==u||r[19]!==g||r[20]!==_||r[21]!==v||r[22]!==b||r[23]!==C?(O={"aria-invalid":l,"aria-disabled":a,disabled:g,type:C,validation:u,...b,forwardedRef:_,innerRef:v},r[16]=a,r[17]=l,r[18]=u,r[19]=g,r[20]=_,r[21]=v,r[22]=b,r[23]=C,r[24]=O):O=r[24];let k=O,A;r[25]===h?A=r[26]:(A=n(h,`input`),r[25]=h,r[26]=A);let j;r[27]!==a||r[28]!==g?(j=i(g??a)||void 0,r[27]=a,r[28]=g,r[29]=j):j=r[29];let M=D||void 0,N;r[30]===m?N=r[31]:(N=t(`pointer-coarse:text-base h-9 text-sm`,`bg-form relative flex w-full items-center gap-1.5 rounded-md border px-3 py-2 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-within:outline-hidden focus-within:ring-4`,`data-disabled:opacity-50`,`has-[input:not(:first-child)]:ps-2.5 has-[input:not(:last-child)]:pe-2.5 [&>:not(input)]:shrink-0 [&_svg]:size-5`,`border-form text-strong focus-within:border-accent-600 focus-within:ring-focus-accent`,`data-validation-success:border-success-600 focus-within:data-validation-success:border-success-600 focus-within:data-validation-success:ring-focus-success`,`data-validation-warning:border-warning-600 focus-within:data-validation-warning:border-warning-600 focus-within:data-validation-warning:ring-focus-warning`,`data-validation-error:border-danger-600 focus-within:data-validation-error:border-danger-600 focus-within:data-validation-error:ring-focus-danger`,`autofill:shadow-[inset_0_0_0px_1000px_var(--color-blue-50)] has-autofill:bg-blue-50 has-autofill:[-webkit-text-fill-color:var(--text-color-strong)]`,m),r[30]=m,r[31]=N);let P,F;r[32]===v?(P=r[33],F=r[34]):(P=e=>{e.target!==v?.current&&e.preventDefault()},F=e=>{let t=v.current;t!=null&&e.detail!==0&&t.focus()},r[32]=v,r[33]=P,r[34]=F);let I;r[35]!==b.name||r[36]!==D?(I=/* @__PURE__ */ f(x,{name:b.name,validation:D}),r[35]=b.name,r[36]=D,r[37]=I):I=r[37];let L;r[38]!==d||r[39]!==S||r[40]!==I||r[41]!==A||r[42]!==j||r[43]!==M||r[44]!==N||r[45]!==P||r[46]!==F?(L=/* @__PURE__ */ p(`div`,{role:`none`,"data-slot":A,"data-disabled":j,"data-validation":M,className:N,onMouseDown:P,onClick:F,style:S,children:[d,I]}),r[38]=d,r[39]=S,r[40]=I,r[41]=A,r[42]=j,r[43]=M,r[44]=N,r[45]=P,r[46]=F,r[47]=L):L=r[47];let R;return r[48]!==k||r[49]!==L?(R=/* @__PURE__ */ f(y.Provider,{value:k,children:L}),r[48]=k,r[49]=L,r[50]=R):R=r[50],R},x=e=>{let t=c(9),{name:n,validation:i}=e;switch(i){case`error`:{let e;t[0]===n?e=t[1]:(e=a(`The value entered for the`,n,`input has failed validation.`),t[0]=n,t[1]=e);let i;t[2]===e?i=t[3]:(i=/* @__PURE__ */ f(`span`,{className:`sr-only`,children:e}),t[2]=e,t[3]=i);let o;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(o=/* @__PURE__ */ f(r,{svg:/* @__PURE__ */ f(h,{"aria-hidden":!0,weight:`fill`})}),t[4]=o):o=t[4];let s;return t[5]===i?s=t[6]:(s=/* @__PURE__ */ p(`div`,{className:`text-danger-600 order-last select-none`,children:[i,o]}),t[5]=i,t[6]=s),s}case`success`:{let e;return t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=/* @__PURE__ */ f(`div`,{className:`text-success-600 order-last select-none`,children:/* @__PURE__ */ f(r,{svg:/* @__PURE__ */ f(m,{weight:`fill`})})}),t[7]=e):e=t[7],e}case`warning`:{let e;return t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=/* @__PURE__ */ f(`div`,{className:`text-warning-600 order-last select-none`,children:/* @__PURE__ */ f(r,{svg:/* @__PURE__ */ f(g,{weight:`fill`})})}),t[8]=e):e=t[8],e}default:return null}};export{v as n,_ as t};
@@ -1,3 +1,4 @@
1
+ import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
1
2
  import { o as WithValidation } from "./field-7QeiTFwl.js";
2
3
  import { ComponentProps, PropsWithChildren } from "react";
3
4
  //#region src/components/input/types.d.ts
@@ -68,7 +69,7 @@ type InputProps = Omit<ComponentProps<"input">, "autoComplete" | "type"> & BaseP
68
69
  * ```
69
70
  */
70
71
  declare const Input: ({ children, className, ref, ...props }: InputProps) => import("react").JSX.Element;
71
- type InputCaptureProps = Omit<ComponentProps<"input">, "autoComplete" | "type"> & BaseProps;
72
+ type InputCaptureProps = Omit<ComponentProps<"input">, "autoComplete" | "type"> & BaseProps & WithDataSlot;
72
73
  /**
73
74
  * The actual <input /> element that captures user input.
74
75
  * Used internally by Input component or when you need direct control over the input element.
@@ -83,6 +84,6 @@ type InputCaptureProps = Omit<ComponentProps<"input">, "autoComplete" | "type">
83
84
  * </Input>
84
85
  * ```
85
86
  */
86
- declare const InputCapture: ({ "aria-invalid": _ariaInvalid, className, ref, validation: _validation, ...restProps }: InputCaptureProps) => import("react").JSX.Element;
87
+ declare const InputCapture: ({ "aria-invalid": _ariaInvalid, "data-slot": dataSlot, className, ref, validation: _validation, ...restProps }: InputCaptureProps) => import("react").JSX.Element;
87
88
  //#endregion
88
89
  export { AutoComplete as a, WithInputType as c, InputProps as i, InputCapture as n, InputType as o, InputCaptureProps as r, WithAutoComplete as s, Input as t };
package/dist/input.d.ts CHANGED
@@ -1,5 +1,6 @@
1
+ import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
1
2
  import { o as WithValidation, r as Validation } from "./field-7QeiTFwl.js";
2
- import { a as AutoComplete, c as WithInputType, i as InputProps, n as InputCapture, o as InputType, r as InputCaptureProps, s as WithAutoComplete, t as Input } from "./input-DpnC3Xgj.js";
3
+ import { a as AutoComplete, c as WithInputType, i as InputProps, n as InputCapture, o as InputType, r as InputCaptureProps, s as WithAutoComplete, t as Input } from "./input-bbB1tC0h.js";
3
4
  import { ComponentProps } from "react";
4
5
  //#region src/components/input/password-input.d.ts
5
6
  /**
@@ -17,7 +18,7 @@ type PasswordInputProps = Omit<ComponentProps<"input">, "autoComplete" | "type">
17
18
  * next value. When omitted, the toggle owns the visibility and starts hidden.
18
19
  */
19
20
  showValue?: boolean;
20
- };
21
+ } & WithDataSlot;
21
22
  /**
22
23
  * An input optimized for password and other sensitive-value entry. Renders a
23
24
  * native `<input type="password">` with a built-in trailing button that
@@ -51,7 +52,7 @@ type PasswordInputProps = Omit<ComponentProps<"input">, "autoComplete" | "type">
51
52
  *
52
53
  * | Data Attribute | Value | Description |
53
54
  * | --- | --- | --- |
54
- * | `data-slot` | `"password-input"` | The chrome around the input. |
55
+ * | `data-slot` | `"password-input input"` | The chrome around the input, joined ahead of `Input`'s own slot. |
55
56
  * | `data-slot` | `"input-capture"` | The `<input>` element. |
56
57
  * | `data-slot` | `"password-input-toggle"` | The visibility toggle button. |
57
58
  * | `data-disabled` | present when disabled | On the chrome. Style with `data-disabled:`. |
@@ -90,7 +91,7 @@ type PasswordInputProps = Omit<ComponentProps<"input">, "autoComplete" | "type">
90
91
  * }
91
92
  * ```
92
93
  */
93
- declare const PasswordInput: ({ disabled, id: idProp, onValueVisibilityChange, ref, showValue, ...props }: PasswordInputProps) => import("react").JSX.Element;
94
+ declare const PasswordInput: ({ "data-slot": dataSlot, disabled, id: idProp, onValueVisibilityChange, ref, showValue, ...props }: PasswordInputProps) => import("react").JSX.Element;
94
95
  //#endregion
95
96
  //#region src/components/input/is-input.d.ts
96
97
  /**
package/dist/input.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{t}from"./icon-BT8FnkkJ.js";import{n,t as r}from"./input-yq0jLE4e.js";import{t as i}from"./use-prefers-reduced-motion-Cj9tJ181.js";import{t as a}from"./input-DQyN6gN0.js";import{c as o}from"react/compiler-runtime";import{useId as s,useRef as c,useState as l}from"react";import{jsx as u,jsxs as d}from"react/jsx-runtime";import{EyeIcon as f}from"@phosphor-icons/react/Eye";import{EyeClosedIcon as p}from"@phosphor-icons/react/EyeClosed";const m=a=>{let m=o(30),h,g,_,v,y,b;m[0]===a?(h=m[1],g=m[2],_=m[3],v=m[4],y=m[5],b=m[6]):({disabled:h,id:g,onValueVisibilityChange:_,ref:y,showValue:b,...v}=a,m[0]=a,m[1]=h,m[2]=g,m[3]=_,m[4]=v,m[5]=y,m[6]=b);let x=s(),S=g??x,C=b!=null,[w,T]=l(!1),E=C?b:w,D=E?`text`:`password`,O=E?f:p,k=c(null),A=c(E),j,M;m[7]===E?(j=m[8],M=m[9]):(j=()=>{if(A.current===E)return;A.current=E;let e=k.current;e==null||i()||e.animate([{transform:`scaleY(0)`},{transform:`scaleY(1)`}],{duration:200,easing:`ease-out`})},M=[E],m[7]=E,m[8]=j,m[9]=M),e(j,M);let N;m[10]===Symbol.for(`react.memo_cache_sentinel`)?(N=u(n,{}),m[10]=N):N=m[10];let P;m[11]!==C||m[12]!==_||m[13]!==E?(P=()=>{let e=!E;C||T(e),_?.(e)},m[11]=C,m[12]=_,m[13]=E,m[14]=P):P=m[14];let F;m[15]===O?F=m[16]:(F=u(t,{ref:k,svg:u(O,{"aria-hidden":!0})}),m[15]=O,m[16]=F);let I;m[17]!==h||m[18]!==S||m[19]!==E||m[20]!==P||m[21]!==F?(I=u(`button`,{type:`button`,disabled:h,"data-slot":`password-input-toggle`,"aria-label":`Show value`,"aria-pressed":E,"aria-controls":S,className:`text-body hover:text-strong focus-visible:ring-focus-accent ml-1 cursor-pointer rounded-xs bg-inherit p-0 focus-visible:ring-2 focus-visible:outline-hidden`,onClick:P,children:F}),m[17]=h,m[18]=S,m[19]=E,m[20]=P,m[21]=F,m[22]=I):I=m[22];let L;return m[23]!==h||m[24]!==S||m[25]!==v||m[26]!==y||m[27]!==I||m[28]!==D?(L=d(r,{"data-slot":`password-input`,disabled:h,id:S,type:D,ref:y,...v,children:[N,I]}),m[23]=h,m[24]=S,m[25]=v,m[26]=y,m[27]=I,m[28]=D,m[29]=L):L=m[29],L};export{r as Input,n as InputCapture,m as PasswordInput,a as isInput};
1
+ import{t as e}from"./use-isomorphic-layout-effect-DdTRtMY-.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./icon-kK0c-POG.js";import{n as r,t as i}from"./input-D_DjD9lT.js";import{t as a}from"./use-prefers-reduced-motion-DimzRx-M.js";import{t as o}from"./input-DQyN6gN0.js";import{c as s}from"react/compiler-runtime";import{useId as c,useRef as l,useState as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{EyeIcon as p}from"@phosphor-icons/react/Eye";import{EyeClosedIcon as m}from"@phosphor-icons/react/EyeClosed";const h=o=>{let h=s(34),g,_,v,y,b,x,S;h[0]===o?(g=h[1],_=h[2],v=h[3],y=h[4],b=h[5],x=h[6],S=h[7]):({"data-slot":g,disabled:_,id:v,onValueVisibilityChange:y,ref:x,showValue:S,...b}=o,h[0]=o,h[1]=g,h[2]=_,h[3]=v,h[4]=y,h[5]=b,h[6]=x,h[7]=S);let C=c(),w=v??C,T=S!=null,[E,D]=u(!1),O=T?S:E,k=O?`text`:`password`,A=O?p:m,j=l(null),M=l(O),N,P;h[8]===O?(N=h[9],P=h[10]):(N=()=>{if(M.current===O)return;M.current=O;let e=j.current;e==null||a()||e.animate([{transform:`scaleY(0)`},{transform:`scaleY(1)`}],{duration:200,easing:`ease-out`})},P=[O],h[8]=O,h[9]=N,h[10]=P),e(N,P);let F;h[11]===g?F=h[12]:(F=t(g,`password-input`),h[11]=g,h[12]=F);let I;h[13]===Symbol.for(`react.memo_cache_sentinel`)?(I=/* @__PURE__ */ d(r,{}),h[13]=I):I=h[13];let L;h[14]!==T||h[15]!==y||h[16]!==O?(L=()=>{let e=!O;T||D(e),y?.(e)},h[14]=T,h[15]=y,h[16]=O,h[17]=L):L=h[17];let R;h[18]===A?R=h[19]:(R=/* @__PURE__ */ d(n,{ref:j,svg:/* @__PURE__ */ d(A,{"aria-hidden":!0})}),h[18]=A,h[19]=R);let z;h[20]!==_||h[21]!==w||h[22]!==O||h[23]!==L||h[24]!==R?(z=/* @__PURE__ */ d(`button`,{type:`button`,disabled:_,"data-slot":`password-input-toggle`,"aria-label":`Show value`,"aria-pressed":O,"aria-controls":w,className:`text-body hover:text-strong focus-visible:ring-focus-accent ml-1 cursor-pointer rounded-xs bg-inherit p-0 focus-visible:ring-2 focus-visible:outline-hidden`,onClick:L,children:R}),h[20]=_,h[21]=w,h[22]=O,h[23]=L,h[24]=R,h[25]=z):z=h[25];let B;return h[26]!==_||h[27]!==w||h[28]!==b||h[29]!==x||h[30]!==F||h[31]!==z||h[32]!==k?(B=/* @__PURE__ */ f(i,{"data-slot":F,disabled:_,id:w,type:k,ref:x,...b,children:[I,z]}),h[26]=_,h[27]=w,h[28]=b,h[29]=x,h[30]=F,h[31]=z,h[32]=k,h[33]=B):B=h[33],B};export{i as Input,r as InputCapture,h as PasswordInput,o as isInput};
@@ -0,0 +1 @@
1
+ import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{c as n}from"react/compiler-runtime";import{jsx as r}from"react/jsx-runtime";function i(i){let a=n(14),o,s,c,l;a[0]===i?(o=a[1],s=a[2],c=a[3],l=a[4]):({"data-slot":c,children:o,className:s,...l}=i,a[0]=i,a[1]=o,a[2]=s,a[3]=c,a[4]=l);let u;a[5]===c?u=a[6]:(u=t(c,`kbd`),a[5]=c,a[6]=u);let d;a[7]===s?d=a[8]:(d=e(`[font-kerning:normal] [font-variant-ligatures:common-ligatures_contextual]`,`appearance-none tabular-nums inline-grid place-items-center size-5 bg-neutral-500/15 px-1 rounded text-mono leading-none font-mono`,s),a[7]=s,a[8]=d);let f;return a[9]!==o||a[10]!==l||a[11]!==u||a[12]!==d?(f=/* @__PURE__ */ r(`kbd`,{"data-slot":u,className:d,...l,translate:`no`,children:o}),a[9]=o,a[10]=l,a[11]=u,a[12]=d,a[13]=f):f=a[13],f}export{i as t};
package/dist/kbd.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
1
2
  import { ComponentProps } from "react";
2
3
  //#region src/components/kbd/kbd.d.ts
3
4
  /**
@@ -54,6 +55,6 @@ import { ComponentProps } from "react";
54
55
  * </span>
55
56
  * ```
56
57
  */
57
- declare function Kbd({ children, className, ...props }: Omit<ComponentProps<"kbd">, "translate">): import("react").JSX.Element;
58
+ declare function Kbd({ "data-slot": dataSlot, children, className, ...props }: Omit<ComponentProps<"kbd">, "translate"> & WithDataSlot): import("react").JSX.Element;
58
59
  //#endregion
59
60
  export { Kbd };
package/dist/kbd.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./kbd-CJ8hNZfS.js";export{e as Kbd};
1
+ export{t as Kbd}from"./kbd-CLHsJ99p.js";
@@ -0,0 +1 @@
1
+ import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./booleanish-BfvnW6vy.js";import{c as r}from"react/compiler-runtime";import{jsx as i}from"react/jsx-runtime";const a=a=>{let o=r(26),s,c,l,u,d,f,p,m;o[0]===a?(s=o[1],c=o[2],l=o[3],u=o[4],d=o[5],f=o[6],p=o[7],m=o[8]):({"data-slot":u,"aria-disabled":s,children:c,className:l,disabled:d,onMouseDown:f,ref:m,...p}=a,o[0]=a,o[1]=s,o[2]=c,o[3]=l,o[4]=u,o[5]=d,o[6]=f,o[7]=p,o[8]=m);let h;o[9]!==s||o[10]!==d?(h=n(d??s)||void 0,o[9]=s,o[10]=d,o[11]=h):h=o[11];let g;o[12]===u?g=o[13]:(g=t(u,`label`),o[12]=u,o[13]=g);let _;o[14]===l?_=o[15]:(_=e(`text-strong cursor-pointer text-sm peer-disabled:cursor-default has-disabled:cursor-default data-disabled:cursor-default font-sans`,`[:where(&:not(:has(input,textarea,select,button,[contenteditable])))]:font-medium`,l),o[14]=l,o[15]=_);let v;o[16]===f?v=o[17]:(v=e=>{e.target.closest(`button, input, select, textarea`)||(f?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault())},o[16]=f,o[17]=v);let y;return o[18]!==c||o[19]!==p||o[20]!==m||o[21]!==h||o[22]!==g||o[23]!==_||o[24]!==v?(y=/* @__PURE__ */ i(`label`,{"data-disabled":h,"data-slot":g,className:_,onMouseDown:v,ref:m,...p,children:c}),o[18]=c,o[19]=p,o[20]=m,o[21]=h,o[22]=g,o[23]=_,o[24]=v,o[25]=y):y=o[25],y};export{a as t};