@ngrok/mantle 0.70.2 → 0.71.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/alert-dialog.d.ts +337 -90
- package/dist/alert-dialog.js.map +1 -1
- package/dist/alert.js.map +1 -1
- package/dist/anchor-2stEauOz.js.map +1 -1
- package/dist/anchor.d.ts +45 -4
- package/dist/badge.d.ts +32 -3
- package/dist/badge.js.map +1 -1
- package/dist/{button-BMgAxAwM.d.ts → button-Bq0x5Pv4.d.ts} +4 -4
- package/dist/button.d.ts +1 -1
- package/dist/checkbox.d.ts +1 -1
- package/dist/code-block.d.ts +1 -1
- package/dist/code-block_highlight-utils.d.ts +1 -1
- package/dist/code.d.ts +22 -1
- package/dist/code.js.map +1 -1
- package/dist/combobox.d.ts +10 -0
- package/dist/combobox.js.map +1 -1
- package/dist/command.js.map +1 -1
- package/dist/copy-to-clipboard-DjOD_Mwb.js.map +1 -1
- package/dist/data-table.d.ts +303 -22
- package/dist/data-table.js.map +1 -1
- package/dist/dialog-BHzl9eye.js.map +1 -1
- package/dist/dialog.d.ts +6 -1
- package/dist/flag.d.ts +33 -4
- package/dist/flag.js.map +1 -1
- package/dist/hooks.d.ts +299 -74
- package/dist/hooks.js.map +1 -1
- package/dist/hover-card.d.ts +15 -10
- package/dist/hover-card.js.map +1 -1
- package/dist/icons.js.map +1 -1
- package/dist/{index-DMAkXvFI.d.ts → index-C91lxoX9.d.ts} +55 -12
- package/dist/input.d.ts +1 -1
- package/dist/input.js.map +1 -1
- package/dist/kbd-CAVUiqBT.js.map +1 -1
- package/dist/kbd.d.ts +37 -8
- package/dist/label.d.ts +40 -9
- package/dist/label.js.map +1 -1
- package/dist/media-object.d.ts +26 -10
- package/dist/media-object.js.map +1 -1
- package/dist/multi-select.d.ts +185 -34
- package/dist/multi-select.js.map +1 -1
- package/dist/otp-input.d.ts +167 -0
- package/dist/otp-input.js +2 -0
- package/dist/otp-input.js.map +1 -0
- package/dist/pagination.d.ts +1 -1
- package/dist/pagination.js.map +1 -1
- package/dist/popover.d.ts +7 -5
- package/dist/popover.js.map +1 -1
- package/dist/primitive-tXm_8n_t.js.map +1 -1
- package/dist/progress.js.map +1 -1
- package/dist/resolve-pre-rendered-props-C-kiaLHj.js.map +1 -1
- package/dist/{resolve-pre-rendered-props-x-52gvQ1.d.ts → resolve-pre-rendered-props-CNUnH1fU.d.ts} +2 -2
- package/dist/select-DOgdZO0Q.js.map +1 -1
- package/dist/{select-BjpP51vO.d.ts → select-DZutJxyr.d.ts} +9 -1
- package/dist/select.d.ts +1 -1
- package/dist/separator-DSOIrnhj.js.map +1 -1
- package/dist/sheet.d.ts +5 -1
- package/dist/sheet.js.map +1 -1
- package/dist/skeleton.d.ts +32 -5
- package/dist/skeleton.js.map +1 -1
- package/dist/sort-DzCsa6Qj.js.map +1 -1
- package/dist/split-button.d.ts +1 -1
- package/dist/{table--DsTqaWO.d.ts → table-BsNJBKiq.d.ts} +7 -3
- package/dist/table-Cl4nlRMR.js.map +1 -1
- package/dist/table.d.ts +1 -1
- package/dist/theme-provider-BFcnjeME.js.map +1 -1
- package/dist/theme.d.ts +1 -1
- package/dist/theme.js.map +1 -1
- package/dist/tooltip.d.ts +31 -14
- package/dist/tooltip.js.map +1 -1
- package/dist/use-copy-to-clipboard-C7vsjJe-.js.map +1 -1
- package/dist/use-matches-media-query-CojcYxlA.js.map +1 -1
- package/dist/use-prefers-reduced-motion-aXfsyo-k.js.map +1 -1
- package/package.json +12 -7
package/dist/tooltip.d.ts
CHANGED
|
@@ -5,15 +5,26 @@ import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
|
5
5
|
|
|
6
6
|
//#region src/components/tooltip/tooltip.d.ts
|
|
7
7
|
/**
|
|
8
|
-
* Wraps your app to provide global
|
|
9
|
-
*
|
|
8
|
+
* Wraps your app to provide shared global behavior for your tooltips, such
|
|
9
|
+
* as consistent delay and hover settings. Mount one instance at the root of
|
|
10
|
+
* your app when you want app-wide tooltip defaults. Children render
|
|
11
|
+
* `Tooltip.Root` / `Tooltip.Trigger` / `Tooltip.Content` trees as usual.
|
|
10
12
|
*
|
|
11
13
|
* @see https://mantle.ngrok.com/components/tooltip#tooltipprovider
|
|
12
14
|
*
|
|
13
15
|
* @example
|
|
14
16
|
* ```tsx
|
|
15
17
|
* <TooltipProvider>
|
|
16
|
-
* <
|
|
18
|
+
* <Tooltip.Root>
|
|
19
|
+
* <Tooltip.Trigger asChild>
|
|
20
|
+
* <Button type="button" appearance="outlined">
|
|
21
|
+
* Hover me
|
|
22
|
+
* </Button>
|
|
23
|
+
* </Tooltip.Trigger>
|
|
24
|
+
* <Tooltip.Content>
|
|
25
|
+
* This is a tooltip
|
|
26
|
+
* </Tooltip.Content>
|
|
27
|
+
* </Tooltip.Root>
|
|
17
28
|
* </TooltipProvider>
|
|
18
29
|
* ```
|
|
19
30
|
*/
|
|
@@ -26,8 +37,9 @@ declare const TooltipProvider: {
|
|
|
26
37
|
};
|
|
27
38
|
/**
|
|
28
39
|
* A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.
|
|
29
|
-
* This is the root, stateful component that manages the open/closed state of
|
|
30
|
-
*
|
|
40
|
+
* This is the root, stateful component that manages the open/closed state of
|
|
41
|
+
* the tooltip. Wrap your app in `TooltipProvider` when you want shared
|
|
42
|
+
* app-wide delay and hover settings.
|
|
31
43
|
*
|
|
32
44
|
* @see https://mantle.ngrok.com/components/tooltip#tooltiproot
|
|
33
45
|
*
|
|
@@ -74,14 +86,18 @@ declare namespace Trigger {
|
|
|
74
86
|
}
|
|
75
87
|
/**
|
|
76
88
|
* A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.
|
|
77
|
-
* Wrapping your app in a `TooltipProvider` is recommended to share global tooltip behavior (delay, hover settings) across your application.
|
|
78
89
|
*
|
|
79
|
-
* Use
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
90
|
+
* Use `Tooltip` to show a short, non-essential label or hint when the user
|
|
91
|
+
* hovers or focuses an element — e.g., the meaning of an icon button, a
|
|
92
|
+
* keyboard shortcut, or a brief explanation. Tooltips are NON-INTERACTIVE:
|
|
93
|
+
* do not put buttons, links, or form controls inside one. Per the WAI-ARIA
|
|
94
|
+
* tooltip pattern, tooltips never receive focus, so interactive content
|
|
95
|
+
* inside them is unreachable for keyboard users. For interactive overlay
|
|
96
|
+
* content (forms, settings, color pickers), use `Popover`. For non-essential
|
|
97
|
+
* preview cards (user/repo previews, link previews), use `HoverCard`.
|
|
98
|
+
*
|
|
99
|
+
* Mount a `<TooltipProvider>` once at the app root when you want shared
|
|
100
|
+
* tooltip behavior such as consistent delay and hover settings.
|
|
85
101
|
*
|
|
86
102
|
* @see https://mantle.ngrok.com/components/tooltip
|
|
87
103
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/
|
|
@@ -111,8 +127,9 @@ declare namespace Trigger {
|
|
|
111
127
|
declare const Tooltip: {
|
|
112
128
|
/**
|
|
113
129
|
* A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.
|
|
114
|
-
* This is the root, stateful component that manages the open/closed state of
|
|
115
|
-
*
|
|
130
|
+
* This is the root, stateful component that manages the open/closed state of
|
|
131
|
+
* the tooltip. Wrap your app in `TooltipProvider` when you want shared
|
|
132
|
+
* app-wide delay and hover settings.
|
|
116
133
|
*
|
|
117
134
|
* @see https://mantle.ngrok.com/components/tooltip#tooltiproot
|
|
118
135
|
*
|
package/dist/tooltip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","names":[],"sources":["../src/components/tooltip/tooltip.tsx"],"sourcesContent":["import * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { forwardRef } from \"react\";\nimport type { ComponentProps, ComponentPropsWithoutRef, ComponentRef } from \"react\";\nimport { cx } from \"../../utils/cx/cx.js\";\n\n/**\n * Wraps your app to provide global
|
|
1
|
+
{"version":3,"file":"tooltip.js","names":[],"sources":["../src/components/tooltip/tooltip.tsx"],"sourcesContent":["import * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport { forwardRef } from \"react\";\nimport type { ComponentProps, ComponentPropsWithoutRef, ComponentRef } from \"react\";\nimport { cx } from \"../../utils/cx/cx.js\";\n\n/**\n * Wraps your app to provide shared global behavior for your tooltips, such\n * as consistent delay and hover settings. Mount one instance at the root of\n * your app when you want app-wide tooltip defaults. Children render\n * `Tooltip.Root` / `Tooltip.Trigger` / `Tooltip.Content` trees as usual.\n *\n * @see https://mantle.ngrok.com/components/tooltip#tooltipprovider\n *\n * @example\n * ```tsx\n * <TooltipProvider>\n * <Tooltip.Root>\n * <Tooltip.Trigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Hover me\n * </Button>\n * </Tooltip.Trigger>\n * <Tooltip.Content>\n * This is a tooltip\n * </Tooltip.Content>\n * </Tooltip.Root>\n * </TooltipProvider>\n * ```\n */\nconst TooltipProvider = ({\n\tdelayDuration = 0,\n\t...props\n}: ComponentPropsWithoutRef<typeof TooltipPrimitive.Provider>) => (\n\t<TooltipPrimitive.Provider\n\t\tdata-slot=\"tooltip-provider\"\n\t\tdelayDuration={delayDuration ?? 0}\n\t\t{...props}\n\t/>\n);\nTooltipProvider.displayName = \"Tooltip.Provider\";\n\n/**\n * A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.\n * This is the root, stateful component that manages the open/closed state of\n * the tooltip. Wrap your app in `TooltipProvider` when you want shared\n * app-wide delay and hover settings.\n *\n * @see https://mantle.ngrok.com/components/tooltip#tooltiproot\n *\n * @example\n * ```tsx\n * <Tooltip.Root>\n * <Tooltip.Trigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Hover me\n * </Button>\n * </Tooltip.Trigger>\n * <Tooltip.Content>\n * This is a tooltip\n * </Tooltip.Content>\n * </Tooltip.Root>\n * ```\n */\nfunction Root(props: ComponentProps<typeof TooltipPrimitive.Root>) {\n\treturn <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />;\n}\nRoot.displayName = \"Tooltip.Root\";\n\n/**\n * The trigger button that opens the tooltip.\n *\n * @see https://mantle.ngrok.com/components/tooltip#tooltiptrigger\n *\n * @example\n * ```tsx\n * <Tooltip.Root>\n * <Tooltip.Trigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Hover me\n * </Button>\n * </Tooltip.Trigger>\n * <Tooltip.Content>\n * This is a tooltip\n * </Tooltip.Content>\n * </Tooltip.Root>\n * ```\n */\nfunction Trigger(props: ComponentProps<typeof TooltipPrimitive.Trigger>) {\n\treturn <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />;\n}\nTrigger.displayName = \"Tooltip.Trigger\";\n\n/**\n * The content to render inside the tooltip.\n *\n * @see https://mantle.ngrok.com/components/tooltip#tooltipcontent\n *\n * @example\n * ```tsx\n * <Tooltip.Root>\n * <Tooltip.Trigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Hover me\n * </Button>\n * </Tooltip.Trigger>\n * <Tooltip.Content>\n * This is a tooltip\n * </Tooltip.Content>\n * </Tooltip.Root>\n * ```\n */\nconst Content = forwardRef<\n\tComponentRef<typeof TooltipPrimitive.Content>,\n\tComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ children, className, sideOffset = 4, ...props }, ref) => (\n\t<TooltipPrimitive.Portal>\n\t\t<TooltipPrimitive.Content\n\t\t\tclassName={cx(\n\t\t\t\t\"bg-tooltip text-tooltip animate-in fade-in-0 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 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 z-50 max-w-72 overflow-visible wrap-break-word rounded-md px-3 py-1.5 text-sm font-sans shadow\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tdata-slot=\"tooltip-content\"\n\t\t\tref={ref}\n\t\t\tsideOffset={sideOffset}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t\t<TooltipPrimitive.Arrow asChild>\n\t\t\t\t<div className=\"bg-tooltip z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-xs\" />\n\t\t\t</TooltipPrimitive.Arrow>\n\t\t</TooltipPrimitive.Content>\n\t</TooltipPrimitive.Portal>\n));\nContent.displayName = \"Tooltip.Content\";\n\n/**\n * A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.\n *\n * Use `Tooltip` to show a short, non-essential label or hint when the user\n * hovers or focuses an element — e.g., the meaning of an icon button, a\n * keyboard shortcut, or a brief explanation. Tooltips are NON-INTERACTIVE:\n * do not put buttons, links, or form controls inside one. Per the WAI-ARIA\n * tooltip pattern, tooltips never receive focus, so interactive content\n * inside them is unreachable for keyboard users. For interactive overlay\n * content (forms, settings, color pickers), use `Popover`. For non-essential\n * preview cards (user/repo previews, link previews), use `HoverCard`.\n *\n * Mount a `<TooltipProvider>` once at the app root when you want shared\n * tooltip behavior such as consistent delay and hover settings.\n *\n * @see https://mantle.ngrok.com/components/tooltip\n * @see https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/\n *\n * @example\n * Composition:\n * ```\n * Tooltip.Root\n * ├── Tooltip.Trigger\n * └── Tooltip.Content\n * ```\n *\n * @example\n * ```tsx\n * <Tooltip.Root>\n * <Tooltip.Trigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Hover me\n * </Button>\n * </Tooltip.Trigger>\n * <Tooltip.Content>\n * This is a tooltip\n * </Tooltip.Content>\n * </Tooltip.Root>\n * ```\n */\nconst Tooltip = {\n\t/**\n\t * A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.\n\t * This is the root, stateful component that manages the open/closed state of\n\t * the tooltip. Wrap your app in `TooltipProvider` when you want shared\n\t * app-wide delay and hover settings.\n\t *\n\t * @see https://mantle.ngrok.com/components/tooltip#tooltiproot\n\t *\n\t * @example\n\t * ```tsx\n\t * <Tooltip.Root>\n\t * <Tooltip.Trigger asChild>\n\t * <Button type=\"button\" appearance=\"outlined\">\n\t * Hover me\n\t * </Button>\n\t * </Tooltip.Trigger>\n\t * <Tooltip.Content>\n\t * This is a tooltip\n\t * </Tooltip.Content>\n\t * </Tooltip.Root>\n\t * ```\n\t */\n\tRoot,\n\t/**\n\t * The content to render inside the tooltip.\n\t *\n\t * @see https://mantle.ngrok.com/components/tooltip#tooltipcontent\n\t *\n\t * @example\n\t * ```tsx\n\t * <Tooltip.Root>\n\t * <Tooltip.Trigger asChild>\n\t * <Button type=\"button\" appearance=\"outlined\">\n\t * Hover me\n\t * </Button>\n\t * </Tooltip.Trigger>\n\t * <Tooltip.Content>\n\t * This is a tooltip\n\t * </Tooltip.Content>\n\t * </Tooltip.Root>\n\t * ```\n\t */\n\tContent,\n\t/**\n\t * The trigger button that opens the tooltip.\n\t *\n\t * @see https://mantle.ngrok.com/components/tooltip#tooltiptrigger\n\t *\n\t * @example\n\t * ```tsx\n\t * <Tooltip.Root>\n\t * <Tooltip.Trigger asChild>\n\t * <Button type=\"button\" appearance=\"outlined\">\n\t * Hover me\n\t * </Button>\n\t * </Tooltip.Trigger>\n\t * <Tooltip.Content>\n\t * This is a tooltip\n\t * </Tooltip.Content>\n\t * </Tooltip.Root>\n\t * ```\n\t */\n\tTrigger,\n} as const;\n\nexport {\n\t//,\n\tTooltip,\n\tTooltipProvider,\n};\n"],"mappings":"oKA6BA,MAAM,GAAmB,CACxB,gBAAgB,EAChB,GAAG,KAEH,EAAC,EAAiB,SAAlB,CACC,YAAU,mBACV,cAAe,GAAiB,EAChC,GAAI,EACH,CAAA,CAEH,EAAgB,YAAc,mBAwB9B,SAAS,EAAK,EAAqD,CAClE,OAAO,EAAC,EAAiB,KAAlB,CAAuB,YAAU,UAAU,GAAI,EAAS,CAAA,CAEhE,EAAK,YAAc,eAqBnB,SAAS,EAAQ,EAAwD,CACxE,OAAO,EAAC,EAAiB,QAAlB,CAA0B,YAAU,kBAAkB,GAAI,EAAS,CAAA,CAE3E,EAAQ,YAAc,kBAqBtB,MAAM,EAAU,GAGb,CAAE,WAAU,YAAW,aAAa,EAAG,GAAG,GAAS,IACrD,EAAC,EAAiB,OAAlB,CAAA,SACC,EAAC,EAAiB,QAAlB,CACC,UAAW,EACV,sYACA,EACA,CACD,YAAU,kBACL,MACO,aACZ,GAAI,WARL,CAUE,EACD,EAAC,EAAiB,MAAlB,CAAwB,QAAA,YACvB,EAAC,MAAD,CAAK,UAAU,6EAA+E,CAAA,CACtE,CAAA,CACC,GACF,CAAA,CACzB,CACF,EAAQ,YAAc,kBA0CtB,MAAM,EAAU,CAuBf,OAoBA,UAoBA,UACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-copy-to-clipboard-C7vsjJe-.js","names":[],"sources":["../src/hooks/use-copy-to-clipboard.tsx"],"sourcesContent":["import { copyToClipboard } from \"../utils/copy-to-clipboard.js\";\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"use-copy-to-clipboard-C7vsjJe-.js","names":[],"sources":["../src/hooks/use-copy-to-clipboard.tsx"],"sourcesContent":["import { copyToClipboard } from \"../utils/copy-to-clipboard.js\";\n\n/**\n * React hook that returns a stable async function for copying a string to\n * the system clipboard.\n *\n * The returned function uses the Clipboard API when available and falls back\n * to a `document.execCommand(\"copy\")` polyfill for older browsers. `await`\n * the call (or attach a `.then()` / `.catch()`) to observe whether the copy\n * succeeded — the function throws when both the Clipboard API and the\n * polyfill fail, or when called outside of a DOM environment.\n *\n * Inspired by: https://usehooks.com/usecopytoclipboard\n *\n * @returns An async function `(value: string) => Promise<void>` that writes\n * `value` to the clipboard and rejects on failure.\n *\n * @example\n * // Copy a token on click and surface a toast on success/failure\n * const copy = useCopyToClipboard();\n *\n * async function handleCopy() {\n * try {\n * await copy(token);\n * toast.success(\"Copied!\");\n * } catch {\n * toast.error(\"Could not copy to clipboard\");\n * }\n * }\n *\n * return <button onClick={handleCopy}>Copy token</button>;\n */\nfunction useCopyToClipboard() {\n\treturn copyToClipboard;\n}\n\nexport { useCopyToClipboard };\n"],"mappings":"oDAgCA,SAAS,GAAqB,CAC7B,OAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-matches-media-query-CojcYxlA.js","names":[],"sources":["../src/hooks/use-matches-media-query.tsx"],"sourcesContent":["import { useCallback, useSyncExternalStore } from \"react\";\n\n/**\n * React hook that subscribes to and returns
|
|
1
|
+
{"version":3,"file":"use-matches-media-query-CojcYxlA.js","names":[],"sources":["../src/hooks/use-matches-media-query.tsx"],"sourcesContent":["import { useCallback, useSyncExternalStore } from \"react\";\n\n/**\n * React hook that subscribes to a CSS media query and returns whether it\n * currently matches, re-rendering whenever the result changes.\n *\n * Uses `window.matchMedia` under the hood and `useSyncExternalStore` for\n * compatibility with React's concurrent rendering model. Returns `false`\n * on the server; during hydration React uses that server snapshot before\n * updating to the client media-query value.\n *\n * For common viewport breakpoint checks, prefer the more specific\n * {@link useBreakpoint} or {@link useIsBelowBreakpoint} hooks.\n *\n * @param query - A valid CSS media query string\n * (e.g. `\"(max-width: 768px)\"`, `\"(prefers-color-scheme: dark)\"`).\n * @returns `true` if the media query currently matches, otherwise `false`.\n *\n * @example\n * // Detect if the user prefers a dark color scheme\n * const prefersDark = useMatchesMediaQuery(\"(prefers-color-scheme: dark)\");\n *\n * return <div className={prefersDark ? \"dark\" : \"light\"}>Hello</div>;\n *\n * @example\n * // Show a different layout on portrait orientation\n * const isPortrait = useMatchesMediaQuery(\"(orientation: portrait)\");\n *\n * return isPortrait ? <PortraitLayout /> : <LandscapeLayout />;\n */\nexport function useMatchesMediaQuery(query: string) {\n\tconst subscribe = useCallback(\n\t\t(callback: () => void) => {\n\t\t\tconst matchMedia = window.matchMedia(query);\n\n\t\t\tmatchMedia.addEventListener(\"change\", callback);\n\t\t\treturn () => {\n\t\t\t\tmatchMedia.removeEventListener(\"change\", callback);\n\t\t\t};\n\t\t},\n\t\t[query],\n\t);\n\n\treturn useSyncExternalStore(\n\t\tsubscribe,\n\t\t() => {\n\t\t\treturn window.matchMedia(query).matches;\n\t\t},\n\t\t() => false,\n\t);\n}\n"],"mappings":"8DA8BA,SAAgB,EAAqB,EAAe,CAanD,OAAO,EAZW,EAChB,GAAyB,CACzB,IAAM,EAAa,OAAO,WAAW,EAAM,CAG3C,OADA,EAAW,iBAAiB,SAAU,EAAS,KAClC,CACZ,EAAW,oBAAoB,SAAU,EAAS,GAGpD,CAAC,EAAM,CAIE,KAED,OAAO,WAAW,EAAM,CAAC,YAE3B,GACN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-prefers-reduced-motion-aXfsyo-k.js","names":[],"sources":["../src/hooks/use-prefers-reduced-motion.tsx"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport { canUseDOM } from \"../components/browser-only/browser-only.js\";\n\n/**\n * no-preference is the default value for the prefers-reduced-motion media query.\n * Users who have never fiddled with their a11y settings will still see animations\n * (no explicit opt-in required from a user's perspective)\n */\nconst query = \"(prefers-reduced-motion: no-preference)\";\n\n/**\n * Imperatively reads the current `prefers-reduced-motion` preference.\n * Useful in event handlers
|
|
1
|
+
{"version":3,"file":"use-prefers-reduced-motion-aXfsyo-k.js","names":[],"sources":["../src/hooks/use-prefers-reduced-motion.tsx"],"sourcesContent":["import { useEffect, useState } from \"react\";\nimport { canUseDOM } from \"../components/browser-only/browser-only.js\";\n\n/**\n * no-preference is the default value for the prefers-reduced-motion media query.\n * Users who have never fiddled with their a11y settings will still see animations\n * (no explicit opt-in required from a user's perspective)\n */\nconst query = \"(prefers-reduced-motion: no-preference)\";\n\n/**\n * Imperatively reads the current `prefers-reduced-motion` preference once at\n * the time of the call.\n *\n * Useful in event handlers, animation entrypoints, or plain functions where\n * a React hook cannot be called. Prefer {@link usePrefersReducedMotion}\n * inside components — it subscribes to live changes.\n *\n * @returns `true` when the user has opted out of animations or when called\n * outside a browser environment (SSR), `false` when motion is allowed.\n *\n * @remarks\n * The conservative SSR default of `true` matches\n * {@link usePrefersReducedMotion}: animations stay off until we can verify\n * the user's preference on the client.\n *\n * @example\n * // Skip a one-off entrance animation in a click handler\n * function onOpen() {\n * if (getPrefersReducedMotion()) {\n * element.style.opacity = \"1\";\n * return;\n * }\n * element.animate([{ opacity: 0 }, { opacity: 1 }], { duration: 200 });\n * }\n */\nexport function getPrefersReducedMotion(): boolean {\n\tif (!canUseDOM()) {\n\t\treturn true;\n\t}\n\treturn !window.matchMedia(query).matches;\n}\n\n/**\n * React hook that subscribes to the user's `prefers-reduced-motion` media\n * query and re-renders when it changes.\n *\n * Defaults to `true` (reduce motion) on the server and during the first\n * client render to avoid animating before hydration. The initial client\n * effect reads the *real* preference and updates state. The underlying\n * media query used is `(prefers-reduced-motion: no-preference)` inverted —\n * \"if the system hasn't opted out, animations are allowed.\"\n *\n * @returns `true` when the user prefers reduced motion (animations should be\n * shortened or skipped), `false` when full motion is acceptable.\n *\n * @remarks\n * If you need to support very old browsers that lack\n * `MediaQueryList.addEventListener`, consider falling back to\n * `addListener` / `removeListener`.\n *\n * @example\n * // Conditionally shorten or skip transitions\n * const prefersReducedMotion = usePrefersReducedMotion();\n * const duration = prefersReducedMotion ? 0 : 200;\n *\n * return <Modal transitionDuration={duration} />;\n *\n * @example\n * // Disable an autoplaying carousel when motion is reduced\n * const prefersReducedMotion = usePrefersReducedMotion();\n *\n * return <Carousel autoplay={!prefersReducedMotion} />;\n */\nexport function usePrefersReducedMotion(): boolean {\n\t// Default to no animations on SSR/first paint; update on mount with the real value.\n\tconst [prefersReducedMotion, setPrefersReducedMotion] = useState(true);\n\n\tuseEffect(() => {\n\t\tconst mediaQueryList = window.matchMedia(query);\n\n\t\t// set the _real_ initial value now that we're on the client\n\t\tsetPrefersReducedMotion(getPrefersReducedMotion());\n\n\t\t// register for updates\n\t\tfunction listener(event: MediaQueryListEvent) {\n\t\t\tsetPrefersReducedMotion(!event.matches);\n\t\t}\n\n\t\tmediaQueryList.addEventListener(\"change\", listener);\n\n\t\treturn () => {\n\t\t\tmediaQueryList.removeEventListener(\"change\", listener);\n\t\t};\n\t}, []);\n\n\treturn prefersReducedMotion;\n}\n"],"mappings":"+FAQA,MAAM,EAAQ,0CA4Bd,SAAgB,GAAmC,CAIlD,OAHK,GAAW,CAGT,CAAC,OAAO,WAAW,EAAM,CAAC,QAFzB,GAoCT,SAAgB,GAAmC,CAElD,GAAM,CAAC,EAAsB,GAA2B,EAAS,GAAK,CAoBtE,OAlBA,MAAgB,CACf,IAAM,EAAiB,OAAO,WAAW,EAAM,CAG/C,EAAwB,GAAyB,CAAC,CAGlD,SAAS,EAAS,EAA4B,CAC7C,EAAwB,CAAC,EAAM,QAAQ,CAKxC,OAFA,EAAe,iBAAiB,SAAU,EAAS,KAEtC,CACZ,EAAe,oBAAoB,SAAU,EAAS,GAErD,EAAE,CAAC,CAEC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngrok/mantle",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.71.0",
|
|
4
4
|
"description": "mantle is ngrok's UI library and design system.",
|
|
5
5
|
"homepage": "https://mantle.ngrok.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -138,7 +138,6 @@
|
|
|
138
138
|
"types": "./dist/data-table.d.ts",
|
|
139
139
|
"import": "./dist/data-table.js"
|
|
140
140
|
},
|
|
141
|
-
"./date-picker": {},
|
|
142
141
|
"./description-list": {
|
|
143
142
|
"@ngrok/src-live-types": "./src/components/description-list/index.ts",
|
|
144
143
|
"types": "./dist/description-list.d.ts",
|
|
@@ -214,6 +213,11 @@
|
|
|
214
213
|
"types": "./dist/multi-select.d.ts",
|
|
215
214
|
"import": "./dist/multi-select.js"
|
|
216
215
|
},
|
|
216
|
+
"./otp-input": {
|
|
217
|
+
"@ngrok/src-live-types": "./src/components/otp-input/index.ts",
|
|
218
|
+
"types": "./dist/otp-input.d.ts",
|
|
219
|
+
"import": "./dist/otp-input.js"
|
|
220
|
+
},
|
|
217
221
|
"./pagination": {
|
|
218
222
|
"@ngrok/src-live-types": "./src/components/pagination/index.ts",
|
|
219
223
|
"types": "./dist/pagination.d.ts",
|
|
@@ -345,6 +349,7 @@
|
|
|
345
349
|
"class-variance-authority": "0.7.1",
|
|
346
350
|
"clsx": "2.1.1",
|
|
347
351
|
"cmdk": "1.1.1",
|
|
352
|
+
"input-otp": "1.4.2",
|
|
348
353
|
"react-day-picker": "9.14.0",
|
|
349
354
|
"sonner": "2.0.7",
|
|
350
355
|
"tailwind-merge": "3.5.0",
|
|
@@ -357,18 +362,18 @@
|
|
|
357
362
|
"@testing-library/jest-dom": "6.9.1",
|
|
358
363
|
"@testing-library/react": "16.3.2",
|
|
359
364
|
"@testing-library/user-event": "14.6.1",
|
|
360
|
-
"@tsdown/css": "0.21.
|
|
365
|
+
"@tsdown/css": "0.21.10",
|
|
361
366
|
"@types/react": "19.2.14",
|
|
362
367
|
"@types/react-dom": "19.2.3",
|
|
363
|
-
"@vitest/browser-playwright": "4.1.
|
|
368
|
+
"@vitest/browser-playwright": "4.1.5",
|
|
364
369
|
"browserslist": "4.28.2",
|
|
365
370
|
"date-fns": "4.1.0",
|
|
366
371
|
"happy-dom": "20.9.0",
|
|
367
372
|
"playwright": "1.59.1",
|
|
368
373
|
"react": "19.2.5",
|
|
369
374
|
"react-dom": "19.2.5",
|
|
370
|
-
"tailwindcss": "4.2.
|
|
371
|
-
"tsdown": "0.21.
|
|
375
|
+
"tailwindcss": "4.2.4",
|
|
376
|
+
"tsdown": "0.21.10",
|
|
372
377
|
"typescript": "6.0.3",
|
|
373
378
|
"@cfg/tsconfig": "1.0.0"
|
|
374
379
|
},
|
|
@@ -377,7 +382,7 @@
|
|
|
377
382
|
"date-fns": "^4.1.0",
|
|
378
383
|
"react": "^18 || ^19",
|
|
379
384
|
"react-dom": "^18 || ^19",
|
|
380
|
-
"tailwindcss": "^4.2.
|
|
385
|
+
"tailwindcss": "^4.2.4"
|
|
381
386
|
},
|
|
382
387
|
"browserslist": [
|
|
383
388
|
"last 2 years, not dead, > 0.2%"
|