@ngrok/mantle 0.63.2 → 0.64.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion.d.ts +1 -1
- package/dist/accordion.js +1 -1
- package/dist/accordion.js.map +1 -1
- package/dist/alert-dialog.d.ts +13 -13
- package/dist/alert-dialog.js +1 -1
- package/dist/alert-dialog.js.map +1 -1
- package/dist/alert.d.ts +7 -7
- package/dist/alert.js +1 -1
- package/dist/alert.js.map +1 -1
- package/dist/anchor.d.ts +1 -1
- package/dist/anchor.js +1 -1
- package/dist/anchor.js.map +1 -1
- package/dist/badge.d.ts +1 -1
- package/dist/badge.js +1 -1
- package/dist/badge.js.map +1 -1
- package/dist/{button-DQcrsUyD.d.ts → button-DLUUf_c-.d.ts} +1 -1
- package/dist/button.d.ts +2 -2
- package/dist/button.js +1 -1
- package/dist/calendar.js +1 -1
- package/dist/card.d.ts +5 -5
- package/dist/card.js +1 -1
- package/dist/card.js.map +1 -1
- package/dist/checkbox.d.ts +1 -1
- package/dist/checkbox.js.map +1 -1
- package/dist/chunk-ADF5DAYG.js +2 -0
- package/dist/chunk-ADF5DAYG.js.map +1 -0
- package/dist/{chunk-U32WN4A7.js → chunk-CBRSMQ26.js} +2 -2
- package/dist/{chunk-U32WN4A7.js.map → chunk-CBRSMQ26.js.map} +1 -1
- package/dist/{chunk-TS7XNZ62.js → chunk-EIEPGCIG.js} +2 -2
- package/dist/chunk-EIEPGCIG.js.map +1 -0
- package/dist/{chunk-NQZYWYVH.js → chunk-ELZLLG6G.js} +2 -2
- package/dist/chunk-HF3KJHO3.js +2 -0
- package/dist/chunk-HF3KJHO3.js.map +1 -0
- package/dist/{chunk-SBVSECWW.js → chunk-IVQ626TU.js} +2 -2
- package/dist/chunk-IVQ626TU.js.map +1 -0
- package/dist/{chunk-73DPYKW5.js → chunk-KCF3KPUB.js} +2 -2
- package/dist/chunk-KCF3KPUB.js.map +1 -0
- package/dist/{chunk-LURP5WQR.js → chunk-MLXONRJD.js} +2 -2
- package/dist/chunk-MLXONRJD.js.map +1 -0
- package/dist/{chunk-GLSHD37P.js → chunk-PNL7JOXI.js} +2 -2
- package/dist/chunk-PNL7JOXI.js.map +1 -0
- package/dist/{chunk-3ESTDWHQ.js → chunk-QK3NV2Q3.js} +2 -2
- package/dist/chunk-QK3NV2Q3.js.map +1 -0
- package/dist/{chunk-5M264XXH.js → chunk-RED6SFAV.js} +1 -1
- package/dist/chunk-RED6SFAV.js.map +1 -0
- package/dist/{chunk-NZ6DRFAL.js → chunk-SBQHQ2SJ.js} +1 -1
- package/dist/chunk-SBQHQ2SJ.js.map +1 -0
- package/dist/{chunk-QWZXK2IF.js → chunk-W5A5HSFE.js} +2 -2
- package/dist/{chunk-QWZXK2IF.js.map → chunk-W5A5HSFE.js.map} +1 -1
- package/dist/{chunk-KVXXQCAI.js → chunk-ZS2HEB67.js} +2 -2
- package/dist/chunk-ZS2HEB67.js.map +1 -0
- package/dist/code-block.d.ts +9 -9
- package/dist/code-block.js +2 -2
- package/dist/code-block.js.map +1 -1
- package/dist/code.d.ts +1 -1
- package/dist/code.js.map +1 -1
- package/dist/combobox.d.ts +8 -8
- package/dist/combobox.js +1 -1
- package/dist/combobox.js.map +1 -1
- package/dist/command.d.ts +18 -21
- package/dist/command.js +1 -1
- package/dist/command.js.map +1 -1
- package/dist/data-table.d.ts +13 -13
- package/dist/data-table.js +1 -1
- package/dist/data-table.js.map +1 -1
- package/dist/description-list.d.ts +4 -4
- package/dist/description-list.js +1 -1
- package/dist/description-list.js.map +1 -1
- package/dist/dialog.d.ts +13 -13
- package/dist/dialog.js +1 -1
- package/dist/dropdown-menu.d.ts +14 -14
- package/dist/dropdown-menu.js +1 -1
- package/dist/flag.d.ts +1 -1
- package/dist/flag.js.map +1 -1
- package/dist/hooks.d.ts +2 -2
- package/dist/hooks.js +1 -1
- package/dist/hooks.js.map +1 -1
- package/dist/hover-card.d.ts +4 -4
- package/dist/hover-card.js.map +1 -1
- package/dist/{icon-CkvpQ4BK.d.ts → icon-DXTMiV1L.d.ts} +1 -1
- package/dist/{icon-button-D4BTvC7F.d.ts → icon-button-CT71Ti9V.d.ts} +1 -1
- package/dist/icon.d.ts +2 -2
- package/dist/icon.js +1 -1
- package/dist/icons.d.ts +20 -2
- package/dist/icons.js +1 -1
- package/dist/icons.js.map +1 -1
- package/dist/input.d.ts +3 -3
- package/dist/input.js +1 -1
- package/dist/input.js.map +1 -1
- package/dist/label.d.ts +1 -1
- package/dist/label.js.map +1 -1
- package/dist/mantle.css +15 -15
- package/dist/media-object.d.ts +3 -3
- package/dist/media-object.js +1 -1
- package/dist/media-object.js.map +1 -1
- package/dist/pagination.d.ts +6 -6
- package/dist/pagination.js +1 -1
- package/dist/pagination.js.map +1 -1
- package/dist/popover.d.ts +5 -5
- package/dist/popover.js.map +1 -1
- package/dist/radio-group.d.ts +11 -11
- package/dist/radio-group.js +1 -1
- package/dist/radio-group.js.map +1 -1
- package/dist/sandboxed-on-click.d.ts +2 -2
- package/dist/sandboxed-on-click.js +1 -1
- package/dist/sandboxed-on-click.js.map +1 -1
- package/dist/select.d.ts +8 -8
- package/dist/select.js +1 -1
- package/dist/separator.d.ts +2 -2
- package/dist/separator.js +1 -1
- package/dist/sheet.d.ts +13 -13
- package/dist/sheet.js +1 -1
- package/dist/sheet.js.map +1 -1
- package/dist/skeleton.d.ts +1 -1
- package/dist/skeleton.js +1 -1
- package/dist/skeleton.js.map +1 -1
- package/dist/slider.d.ts +75 -0
- package/dist/slider.js +2 -0
- package/dist/slider.js.map +1 -0
- package/dist/slot.d.ts +1 -1
- package/dist/slot.js +1 -1
- package/dist/split-button.d.ts +8 -8
- package/dist/split-button.js +1 -1
- package/dist/split-button.js.map +1 -1
- package/dist/{svg-only-Bj2yffO4.d.ts → svg-only-Cp8Mu_sh.d.ts} +1 -1
- package/dist/switch.d.ts +1 -1
- package/dist/switch.js.map +1 -1
- package/dist/table.d.ts +9 -9
- package/dist/table.js +1 -1
- package/dist/tabs.d.ts +5 -5
- package/dist/tabs.js.map +1 -1
- package/dist/text-area.d.ts +1 -1
- package/dist/text-area.js.map +1 -1
- package/dist/theme.d.ts +28 -2
- package/dist/theme.js +1 -1
- package/dist/toast.d.ts +7 -7
- package/dist/toast.js +1 -1
- package/dist/tooltip.d.ts +6 -6
- package/dist/tooltip.js.map +1 -1
- package/package.json +13 -14
- package/dist/auto-scroll-to-hash.d.ts +0 -70
- package/dist/auto-scroll-to-hash.js +0 -2
- package/dist/auto-scroll-to-hash.js.map +0 -1
- package/dist/chunk-3ESTDWHQ.js.map +0 -1
- package/dist/chunk-5M264XXH.js.map +0 -1
- package/dist/chunk-73DPYKW5.js.map +0 -1
- package/dist/chunk-GLSHD37P.js.map +0 -1
- package/dist/chunk-KVXXQCAI.js.map +0 -1
- package/dist/chunk-LURP5WQR.js.map +0 -1
- package/dist/chunk-NZ6DRFAL.js.map +0 -1
- package/dist/chunk-ODDNPNLN.js +0 -2
- package/dist/chunk-ODDNPNLN.js.map +0 -1
- package/dist/chunk-SBVSECWW.js.map +0 -1
- package/dist/chunk-SMYI7SUP.js +0 -2
- package/dist/chunk-SMYI7SUP.js.map +0 -1
- package/dist/chunk-TS7XNZ62.js.map +0 -1
- package/dist/chunk-ZYMZVPDT.js +0 -2
- package/dist/chunk-ZYMZVPDT.js.map +0 -1
- /package/dist/{chunk-NQZYWYVH.js.map → chunk-ELZLLG6G.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/description-list/description-list.tsx"],"sourcesContent":["import type { ComponentProps, ComponentRef } from \"react\";\nimport { forwardRef } from \"react\";\nimport type { WithAsChild } from \"../../types/index.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { Slot } from \"../slot/index.js\";\n\ntype DescriptionListProps = ComponentProps<\"dl\"> & WithAsChild;\n\n/**\n * A semantically correct description list built on the HTML `<dl>` element.\n * Renders a list of label/value pairs with alternating row backgrounds,\n * commonly used in detail views to display metadata about a resource.\n *\n * @see https://mantle.ngrok.com/components/description-list#
|
|
1
|
+
{"version":3,"sources":["../src/components/description-list/description-list.tsx"],"sourcesContent":["import type { ComponentProps, ComponentRef } from \"react\";\nimport { forwardRef } from \"react\";\nimport type { WithAsChild } from \"../../types/index.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { Slot } from \"../slot/index.js\";\n\ntype DescriptionListProps = ComponentProps<\"dl\"> & WithAsChild;\n\n/**\n * A semantically correct description list built on the HTML `<dl>` element.\n * Renders a list of label/value pairs with alternating row backgrounds,\n * commonly used in detail views to display metadata about a resource.\n *\n * @see https://mantle.ngrok.com/components/description-list#descriptionlistroot\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dl\n *\n * @example\n * ```tsx\n * <DescriptionList.Root>\n * <DescriptionList.Item>\n * <DescriptionList.Label>Name</DescriptionList.Label>\n * <DescriptionList.Value>my-api-key</DescriptionList.Value>\n * </DescriptionList.Item>\n * </DescriptionList.Root>\n * ```\n */\nconst Root = forwardRef<ComponentRef<\"dl\">, DescriptionListProps>(\n\t({ asChild = false, className, children, ...rest }, ref) => {\n\t\tconst Component = asChild ? Slot : \"dl\";\n\n\t\treturn (\n\t\t\t<Component\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"relative scrollbar overflow-x-auto overscroll-x-none rounded-lg border border-card grid grid-cols-[auto_1fr] gap-x-4 [&>*:nth-child(odd)]:bg-base p-1\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...rest}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Component>\n\t\t);\n\t},\n);\nRoot.displayName = \"DescriptionList\";\n\ntype DescriptionListItemProps = ComponentProps<\"div\"> & WithAsChild;\n\n/**\n * A wrapper that groups a `DescriptionList.Label` and `DescriptionList.Value`\n * pair. Renders as a `<div>` inside the `<dl>` with a subgrid layout that\n * inherits column tracks from the root.\n *\n * @see https://mantle.ngrok.com/components/description-list#descriptionlistitem\n *\n * @example\n * ```tsx\n * <DescriptionList.Item>\n * <DescriptionList.Label>ID</DescriptionList.Label>\n * <DescriptionList.Value>aigk_2fKm9x8Hn3...</DescriptionList.Value>\n * </DescriptionList.Item>\n * ```\n */\nconst Item = forwardRef<ComponentRef<\"div\">, DescriptionListItemProps>(\n\t({ asChild = false, className, children, ...rest }, ref) => {\n\t\tconst Component = asChild ? Slot : \"div\";\n\n\t\treturn (\n\t\t\t<Component\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cx(\"rounded-xs col-span-full grid grid-cols-subgrid items-center\", className)}\n\t\t\t\t{...rest}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Component>\n\t\t);\n\t},\n);\nItem.displayName = \"DescriptionListItem\";\n\ntype DescriptionListLabelProps = ComponentProps<\"dt\"> & WithAsChild;\n\n/**\n * The label for a description list item. Renders as a `<dt>` element.\n *\n * @see https://mantle.ngrok.com/components/description-list#descriptionlistlabel\n *\n * @example\n * ```tsx\n * <DescriptionList.Label>Name</DescriptionList.Label>\n * ```\n */\nconst Label = forwardRef<ComponentRef<\"dt\">, DescriptionListLabelProps>(\n\t({ asChild = false, className, children, ...rest }, ref) => {\n\t\tconst Component = asChild ? Slot : \"dt\";\n\n\t\treturn (\n\t\t\t<Component\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cx(\"text-muted text-sm font-sans font-semibold min-w-36 p-3\", className)}\n\t\t\t\t{...rest}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Component>\n\t\t);\n\t},\n);\nLabel.displayName = \"DescriptionListLabel\";\n\ntype DescriptionListValueProps = ComponentProps<\"dd\"> & WithAsChild;\n\n/**\n * The value for a description list item. Renders as a `<dd>` element.\n * Compose any content inside — the component is intentionally \"dumb\" and\n * imposes no layout on its children.\n *\n * @see https://mantle.ngrok.com/components/description-list#descriptionlistvalue\n *\n * @example\n * ```tsx\n * <DescriptionList.Value>\n * aigk_2fKm9x8Hn3QpYT7zKlR0vW5\n * </DescriptionList.Value>\n * ```\n */\nconst Value = forwardRef<ComponentRef<\"dd\">, DescriptionListValueProps>(\n\t({ asChild = false, className, children, ...rest }, ref) => {\n\t\tconst Component = asChild ? Slot : \"dd\";\n\n\t\treturn (\n\t\t\t<Component ref={ref} className={cx(\"text-body font-mono text-mono p-3\", className)} {...rest}>\n\t\t\t\t{children}\n\t\t\t</Component>\n\t\t);\n\t},\n);\nValue.displayName = \"DescriptionListValue\";\n\n/**\n * A semantically correct description list built on the HTML `<dl>` element.\n * Renders a list of label/value pairs with alternating row backgrounds,\n * commonly used in detail views to display metadata about a resource\n * (e.g., API keys, secrets, domains).\n *\n * Compose with `DescriptionList.Item`, `DescriptionList.Label`, and\n * `DescriptionList.Value` as direct children.\n *\n * @see https://mantle.ngrok.com/components/description-list\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dl\n *\n * @example\n * ```tsx\n * <DescriptionList.Root>\n * <DescriptionList.Item>\n * <DescriptionList.Label>Name</DescriptionList.Label>\n * <DescriptionList.Value>my-api-key</DescriptionList.Value>\n * </DescriptionList.Item>\n * <DescriptionList.Item>\n * <DescriptionList.Label>ID</DescriptionList.Label>\n * <DescriptionList.Value>\n * aigk_2fKm9x8Hn3QpYT7zKlR0vW5\n * </DescriptionList.Value>\n * </DescriptionList.Item>\n * </DescriptionList.Root>\n * ```\n */\nconst DescriptionList = {\n\t/**\n\t * The root container for a description list. Renders a `<dl>` element.\n\t *\n\t * @see https://mantle.ngrok.com/components/description-list#descriptionlistroot\n\t *\n\t * @example\n\t * ```tsx\n\t * <DescriptionList.Root>\n\t * <DescriptionList.Item>\n\t * <DescriptionList.Label>Name</DescriptionList.Label>\n\t * <DescriptionList.Value>my-api-key</DescriptionList.Value>\n\t * </DescriptionList.Item>\n\t * </DescriptionList.Root>\n\t * ```\n\t */\n\tRoot,\n\t/**\n\t * A wrapper that groups a label/value pair. Renders a `<div>` with a default\n\t * subgrid layout.\n\t *\n\t * @see https://mantle.ngrok.com/components/description-list#descriptionlistitem\n\t *\n\t * @example\n\t * ```tsx\n\t * <DescriptionList.Item>\n\t * <DescriptionList.Label>ID</DescriptionList.Label>\n\t * <DescriptionList.Value>aigk_2fKm9x8Hn3...</DescriptionList.Value>\n\t * </DescriptionList.Item>\n\t * ```\n\t */\n\tItem,\n\t/**\n\t * The label for a description list item. Renders a `<dt>` element.\n\t *\n\t * @see https://mantle.ngrok.com/components/description-list#descriptionlistlabel\n\t *\n\t * @example\n\t * ```tsx\n\t * <DescriptionList.Label>Name</DescriptionList.Label>\n\t * ```\n\t */\n\tLabel,\n\t/**\n\t * The value for a description list item. Renders a `<dd>` element.\n\t *\n\t * @see https://mantle.ngrok.com/components/description-list#descriptionlistvalue\n\t *\n\t * @example\n\t * ```tsx\n\t * <DescriptionList.Value>\n\t * aigk_2fKm9x8Hn3QpYT7zKlR0vW5\n\t * </DescriptionList.Value>\n\t * ```\n\t */\n\tValue,\n} as const;\n\nexport {\n\t//,\n\tDescriptionList,\n};\n\nexport type {\n\t//,\n\tDescriptionListProps,\n};\n"],"mappings":"gFACA,OAAS,cAAAA,MAAkB,QA8BxB,cAAAC,MAAA,oBALH,IAAMC,EAAOC,EACZ,CAAC,CAAE,QAAAC,EAAU,GAAO,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAK,EAAGC,IAIlDP,EAHiBG,EAAUK,EAAO,KAGjC,CACA,IAAKD,EACL,UAAWE,EACV,wJACAL,CACD,EACC,GAAGE,EAEH,SAAAD,EACF,CAGH,EACAJ,EAAK,YAAc,kBAmBnB,IAAMS,EAAOR,EACZ,CAAC,CAAE,QAAAC,EAAU,GAAO,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAK,EAAGC,IAIlDP,EAHiBG,EAAUK,EAAO,MAGjC,CACA,IAAKD,EACL,UAAWE,EAAG,+DAAgEL,CAAS,EACtF,GAAGE,EAEH,SAAAD,EACF,CAGH,EACAK,EAAK,YAAc,sBAcnB,IAAMC,EAAQT,EACb,CAAC,CAAE,QAAAC,EAAU,GAAO,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAK,EAAGC,IAIlDP,EAHiBG,EAAUK,EAAO,KAGjC,CACA,IAAKD,EACL,UAAWE,EAAG,0DAA2DL,CAAS,EACjF,GAAGE,EAEH,SAAAD,EACF,CAGH,EACAM,EAAM,YAAc,uBAkBpB,IAAMC,EAAQV,EACb,CAAC,CAAE,QAAAC,EAAU,GAAO,UAAAC,EAAW,SAAAC,EAAU,GAAGC,CAAK,EAAGC,IAIlDP,EAHiBG,EAAUK,EAAO,KAGjC,CAAU,IAAKD,EAAK,UAAWE,EAAG,oCAAqCL,CAAS,EAAI,GAAGE,EACtF,SAAAD,EACF,CAGH,EACAO,EAAM,YAAc,uBA8BpB,IAAMC,EAAkB,CAgBvB,KAAAZ,EAeA,KAAAS,EAWA,MAAAC,EAaA,MAAAC,CACD","names":["forwardRef","jsx","Root","forwardRef","asChild","className","children","rest","ref","Slot","cx","Item","Label","Value","DescriptionList"]}
|
package/dist/dialog.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as react from 'react';
|
|
|
2
2
|
import { ComponentProps } from 'react';
|
|
3
3
|
import * as _radix_ui_react_dialog from '@radix-ui/react-dialog';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
-
import { a as IconButtonProps } from './icon-button-
|
|
5
|
+
import { a as IconButtonProps } from './icon-button-CT71Ti9V.js';
|
|
6
6
|
import { R as Root } from './primitive-CBR_XmVa.js';
|
|
7
7
|
export { i as isDialogOverlayTarget } from './primitive-CBR_XmVa.js';
|
|
8
8
|
import 'class-variance-authority/types';
|
|
@@ -50,7 +50,7 @@ declare const Dialog: {
|
|
|
50
50
|
* A window overlaid on either the primary window or another dialog window.
|
|
51
51
|
* The root stateful component for the Dialog.
|
|
52
52
|
*
|
|
53
|
-
* @see https://mantle.ngrok.com/components/dialog#
|
|
53
|
+
* @see https://mantle.ngrok.com/components/dialog#dialogroot
|
|
54
54
|
*
|
|
55
55
|
* @example
|
|
56
56
|
* ```tsx
|
|
@@ -84,7 +84,7 @@ declare const Dialog: {
|
|
|
84
84
|
/**
|
|
85
85
|
* Contains the main content of the dialog.
|
|
86
86
|
*
|
|
87
|
-
* @see https://mantle.ngrok.com/components/dialog#
|
|
87
|
+
* @see https://mantle.ngrok.com/components/dialog#dialogbody
|
|
88
88
|
*
|
|
89
89
|
* @example
|
|
90
90
|
* ```tsx
|
|
@@ -112,7 +112,7 @@ declare const Dialog: {
|
|
|
112
112
|
/**
|
|
113
113
|
* A button that closes the dialog when clicked.
|
|
114
114
|
*
|
|
115
|
-
* @see https://mantle.ngrok.com/components/dialog#
|
|
115
|
+
* @see https://mantle.ngrok.com/components/dialog#dialogclose
|
|
116
116
|
*
|
|
117
117
|
* @example
|
|
118
118
|
* ```tsx
|
|
@@ -141,7 +141,7 @@ declare const Dialog: {
|
|
|
141
141
|
/**
|
|
142
142
|
* An icon button that closes the dialog when clicked.
|
|
143
143
|
*
|
|
144
|
-
* @see https://mantle.ngrok.com/components/dialog#
|
|
144
|
+
* @see https://mantle.ngrok.com/components/dialog#dialogcloseiconbutton
|
|
145
145
|
*
|
|
146
146
|
* @example
|
|
147
147
|
* ```tsx
|
|
@@ -171,7 +171,7 @@ declare const Dialog: {
|
|
|
171
171
|
* The container for the dialog content.
|
|
172
172
|
* Renders on top of the overlay and is centered in the viewport.
|
|
173
173
|
*
|
|
174
|
-
* @see https://mantle.ngrok.com/components/dialog#
|
|
174
|
+
* @see https://mantle.ngrok.com/components/dialog#dialogcontent
|
|
175
175
|
*
|
|
176
176
|
* @example
|
|
177
177
|
* ```tsx
|
|
@@ -215,7 +215,7 @@ declare const Dialog: {
|
|
|
215
215
|
/**
|
|
216
216
|
* An accessible description to be announced when the dialog is opened.
|
|
217
217
|
*
|
|
218
|
-
* @see https://mantle.ngrok.com/components/dialog#
|
|
218
|
+
* @see https://mantle.ngrok.com/components/dialog#dialogdescription
|
|
219
219
|
*
|
|
220
220
|
* @example
|
|
221
221
|
* ```tsx
|
|
@@ -243,7 +243,7 @@ declare const Dialog: {
|
|
|
243
243
|
/**
|
|
244
244
|
* Contains the footer content of the dialog, including action buttons.
|
|
245
245
|
*
|
|
246
|
-
* @see https://mantle.ngrok.com/components/dialog#
|
|
246
|
+
* @see https://mantle.ngrok.com/components/dialog#dialogfooter
|
|
247
247
|
*
|
|
248
248
|
* @example
|
|
249
249
|
* ```tsx
|
|
@@ -279,7 +279,7 @@ declare const Dialog: {
|
|
|
279
279
|
/**
|
|
280
280
|
* Contains the header content of the dialog, including the title and close button.
|
|
281
281
|
*
|
|
282
|
-
* @see https://mantle.ngrok.com/components/dialog#
|
|
282
|
+
* @see https://mantle.ngrok.com/components/dialog#dialogheader
|
|
283
283
|
*
|
|
284
284
|
* @example
|
|
285
285
|
* ```tsx
|
|
@@ -308,7 +308,7 @@ declare const Dialog: {
|
|
|
308
308
|
/**
|
|
309
309
|
* The overlay backdrop for the dialog.
|
|
310
310
|
*
|
|
311
|
-
* @see https://mantle.ngrok.com/components/dialog#api-
|
|
311
|
+
* @see https://mantle.ngrok.com/components/dialog#api-reference
|
|
312
312
|
*
|
|
313
313
|
* @example
|
|
314
314
|
* ```tsx
|
|
@@ -331,7 +331,7 @@ declare const Dialog: {
|
|
|
331
331
|
/**
|
|
332
332
|
* The portal container for the dialog.
|
|
333
333
|
*
|
|
334
|
-
* @see https://mantle.ngrok.com/components/dialog#api-
|
|
334
|
+
* @see https://mantle.ngrok.com/components/dialog#api-reference
|
|
335
335
|
*
|
|
336
336
|
* @example
|
|
337
337
|
* ```tsx
|
|
@@ -357,7 +357,7 @@ declare const Dialog: {
|
|
|
357
357
|
/**
|
|
358
358
|
* An accessible name to be announced when the dialog is opened.
|
|
359
359
|
*
|
|
360
|
-
* @see https://mantle.ngrok.com/components/dialog#
|
|
360
|
+
* @see https://mantle.ngrok.com/components/dialog#dialogtitle
|
|
361
361
|
*
|
|
362
362
|
* @example
|
|
363
363
|
* ```tsx
|
|
@@ -383,7 +383,7 @@ declare const Dialog: {
|
|
|
383
383
|
/**
|
|
384
384
|
* A button that opens the dialog.
|
|
385
385
|
*
|
|
386
|
-
* @see https://mantle.ngrok.com/components/dialog#
|
|
386
|
+
* @see https://mantle.ngrok.com/components/dialog#dialogtrigger
|
|
387
387
|
*
|
|
388
388
|
* @example
|
|
389
389
|
* ```tsx
|
package/dist/dialog.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as r}from"./chunk-
|
|
1
|
+
import{a as r}from"./chunk-KCF3KPUB.js";import{i as o}from"./chunk-ELZLLG6G.js";import"./chunk-EIEPGCIG.js";import"./chunk-HF3KJHO3.js";import"./chunk-6J7D73WA.js";import"./chunk-NJNFZ2EG.js";import"./chunk-KMNACVH6.js";import"./chunk-CBRSMQ26.js";import"./chunk-63ZAW25Z.js";import"./chunk-72TJUKMV.js";import"./chunk-OP6JMBKJ.js";import"./chunk-IVQ626TU.js";import"./chunk-ADF5DAYG.js";import"./chunk-SBQHQ2SJ.js";import"./chunk-PFXFESEN.js";export{r as Dialog,o as isDialogOverlayTarget};
|
|
2
2
|
//# sourceMappingURL=dialog.js.map
|
package/dist/dropdown-menu.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ declare const DropdownMenu: {
|
|
|
28
28
|
/**
|
|
29
29
|
* The root, stateful component that manages the open/closed state of the dropdown menu.
|
|
30
30
|
*
|
|
31
|
-
* @see https://mantle.ngrok.com/components/dropdown-menu#
|
|
31
|
+
* @see https://mantle.ngrok.com/components/dropdown-menu#dropdownmenuroot
|
|
32
32
|
*
|
|
33
33
|
* @example
|
|
34
34
|
* ```tsx
|
|
@@ -46,7 +46,7 @@ declare const DropdownMenu: {
|
|
|
46
46
|
/**
|
|
47
47
|
* A checkbox item in the dropdown menu that can be toggled on and off.
|
|
48
48
|
*
|
|
49
|
-
* @see https://mantle.ngrok.com/components/dropdown-menu#
|
|
49
|
+
* @see https://mantle.ngrok.com/components/dropdown-menu#dropdownmenucheckboxitem
|
|
50
50
|
*
|
|
51
51
|
* @example
|
|
52
52
|
* ```tsx
|
|
@@ -64,7 +64,7 @@ declare const DropdownMenu: {
|
|
|
64
64
|
/**
|
|
65
65
|
* The container for the dropdown menu content. Appears in a portal with scrolling and animations.
|
|
66
66
|
*
|
|
67
|
-
* @see https://mantle.ngrok.com/components/dropdown-menu#
|
|
67
|
+
* @see https://mantle.ngrok.com/components/dropdown-menu#dropdownmenucontent
|
|
68
68
|
*
|
|
69
69
|
* @example
|
|
70
70
|
* ```tsx
|
|
@@ -86,7 +86,7 @@ declare const DropdownMenu: {
|
|
|
86
86
|
/**
|
|
87
87
|
* A group container for organizing related dropdown menu items.
|
|
88
88
|
*
|
|
89
|
-
* @see https://mantle.ngrok.com/components/dropdown-menu#
|
|
89
|
+
* @see https://mantle.ngrok.com/components/dropdown-menu#dropdownmenugroup
|
|
90
90
|
*
|
|
91
91
|
* @example
|
|
92
92
|
* ```tsx
|
|
@@ -106,7 +106,7 @@ declare const DropdownMenu: {
|
|
|
106
106
|
/**
|
|
107
107
|
* A standard item in the dropdown menu that can be selected or activated.
|
|
108
108
|
*
|
|
109
|
-
* @see https://mantle.ngrok.com/components/dropdown-menu#
|
|
109
|
+
* @see https://mantle.ngrok.com/components/dropdown-menu#dropdownmenuitem
|
|
110
110
|
*
|
|
111
111
|
* @example
|
|
112
112
|
* ```tsx
|
|
@@ -129,7 +129,7 @@ declare const DropdownMenu: {
|
|
|
129
129
|
/**
|
|
130
130
|
* A label for grouping and describing sections within the dropdown menu.
|
|
131
131
|
*
|
|
132
|
-
* @see https://mantle.ngrok.com/components/dropdown-menu#
|
|
132
|
+
* @see https://mantle.ngrok.com/components/dropdown-menu#dropdownmenulabel
|
|
133
133
|
*
|
|
134
134
|
* @example
|
|
135
135
|
* ```tsx
|
|
@@ -149,7 +149,7 @@ declare const DropdownMenu: {
|
|
|
149
149
|
/**
|
|
150
150
|
* A radio group container for exclusive selection within the dropdown menu.
|
|
151
151
|
*
|
|
152
|
-
* @see https://mantle.ngrok.com/components/dropdown-menu#
|
|
152
|
+
* @see https://mantle.ngrok.com/components/dropdown-menu#dropdownmenuradiogroup
|
|
153
153
|
*
|
|
154
154
|
* @example
|
|
155
155
|
* ```tsx
|
|
@@ -168,7 +168,7 @@ declare const DropdownMenu: {
|
|
|
168
168
|
/**
|
|
169
169
|
* A radio item in the dropdown menu where only one item in the group can be selected.
|
|
170
170
|
*
|
|
171
|
-
* @see https://mantle.ngrok.com/components/dropdown-menu#
|
|
171
|
+
* @see https://mantle.ngrok.com/components/dropdown-menu#dropdownmenuradioitem
|
|
172
172
|
*
|
|
173
173
|
* @example
|
|
174
174
|
* ```tsx
|
|
@@ -191,7 +191,7 @@ declare const DropdownMenu: {
|
|
|
191
191
|
/**
|
|
192
192
|
* A visual separator for dividing sections within the dropdown menu.
|
|
193
193
|
*
|
|
194
|
-
* @see https://mantle.ngrok.com/components/dropdown-menu#
|
|
194
|
+
* @see https://mantle.ngrok.com/components/dropdown-menu#dropdownmenuseparator
|
|
195
195
|
*
|
|
196
196
|
* @example
|
|
197
197
|
* ```tsx
|
|
@@ -213,7 +213,7 @@ declare const DropdownMenu: {
|
|
|
213
213
|
/**
|
|
214
214
|
* A keyboard shortcut indicator for dropdown menu items.
|
|
215
215
|
*
|
|
216
|
-
* @see https://mantle.ngrok.com/components/dropdown-menu#
|
|
216
|
+
* @see https://mantle.ngrok.com/components/dropdown-menu#dropdownmenushortcut
|
|
217
217
|
*
|
|
218
218
|
* @example
|
|
219
219
|
* ```tsx
|
|
@@ -235,7 +235,7 @@ declare const DropdownMenu: {
|
|
|
235
235
|
/**
|
|
236
236
|
* A submenu container for creating nested dropdown menus.
|
|
237
237
|
*
|
|
238
|
-
* @see https://mantle.ngrok.com/components/dropdown-menu#
|
|
238
|
+
* @see https://mantle.ngrok.com/components/dropdown-menu#dropdownmenusub
|
|
239
239
|
*
|
|
240
240
|
* @example
|
|
241
241
|
* ```tsx
|
|
@@ -257,7 +257,7 @@ declare const DropdownMenu: {
|
|
|
257
257
|
/**
|
|
258
258
|
* The content container for submenu items.
|
|
259
259
|
*
|
|
260
|
-
* @see https://mantle.ngrok.com/components/dropdown-menu#
|
|
260
|
+
* @see https://mantle.ngrok.com/components/dropdown-menu#dropdownmenusubcontent
|
|
261
261
|
*
|
|
262
262
|
* @example
|
|
263
263
|
* ```tsx
|
|
@@ -279,7 +279,7 @@ declare const DropdownMenu: {
|
|
|
279
279
|
/**
|
|
280
280
|
* The trigger item that opens a submenu when hovered or focused.
|
|
281
281
|
*
|
|
282
|
-
* @see https://mantle.ngrok.com/components/dropdown-menu#
|
|
282
|
+
* @see https://mantle.ngrok.com/components/dropdown-menu#dropdownmenusubtrigger
|
|
283
283
|
*
|
|
284
284
|
* @example
|
|
285
285
|
* ```tsx
|
|
@@ -303,7 +303,7 @@ declare const DropdownMenu: {
|
|
|
303
303
|
/**
|
|
304
304
|
* The trigger button that opens the dropdown menu.
|
|
305
305
|
*
|
|
306
|
-
* @see https://mantle.ngrok.com/components/dropdown-menu#
|
|
306
|
+
* @see https://mantle.ngrok.com/components/dropdown-menu#dropdownmenutrigger
|
|
307
307
|
*
|
|
308
308
|
* @example
|
|
309
309
|
* ```tsx
|
package/dist/dropdown-menu.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
1
|
+
import{a as o}from"./chunk-QK3NV2Q3.js";import"./chunk-MLXONRJD.js";import"./chunk-IVQ626TU.js";import"./chunk-ADF5DAYG.js";import"./chunk-SBQHQ2SJ.js";import"./chunk-PFXFESEN.js";export{o as DropdownMenu};
|
|
2
2
|
//# sourceMappingURL=dropdown-menu.js.map
|
package/dist/flag.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ type Props = Omit<ComponentProps<"div">, "children"> & {
|
|
|
35
35
|
* A flag component that displays a flag based on the provided country code.
|
|
36
36
|
* Inspired by [react-flagpack](https://flagpack.xyz/docs/development/react).
|
|
37
37
|
*
|
|
38
|
-
* @see https://mantle.ngrok.com/components/flag#
|
|
38
|
+
* @see https://mantle.ngrok.com/components/flag#flag
|
|
39
39
|
*
|
|
40
40
|
* @example
|
|
41
41
|
* ```tsx
|
package/dist/flag.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/flag/flag.tsx","../src/components/flag/country-code.ts"],"sourcesContent":["import { cva } from \"class-variance-authority\";\nimport type { ComponentProps } from \"react\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport type { CountryCode } from \"./country-code.js\";\n\nconst cdnOrigin = \"https://assets.ngrok.com\";\n\nconst sizes = [\"s\", \"m\", \"l\"] as const;\ntype Size = (typeof sizes)[number];\n\ntype Props = Omit<ComponentProps<\"div\">, \"children\"> & {\n\t/**\n\t * The country code for the flag to display\n\t * @example \"US\"\n\t */\n\tcode: CountryCode;\n\t/**\n\t * The size of flag to render, \"s\", \"m\", or \"l\"\n\t * @default \"l\"\n\t */\n\tsize?: Size;\n\t/**\n\t * A string providing a hint to the user agent as to how to best schedule the loading of the image to optimize page performance.\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/loading\n\t * @default \"lazy\"\n\t */\n\tloading?: ComponentProps<\"img\">[\"loading\"];\n};\n\nconst borderRadiusVariants = cva(\"\", {\n\tvariants: {\n\t\tsize: {\n\t\t\ts: \"rounded-[0.0625rem]\",\n\t\t\tm: \"rounded-[0.09375rem]\",\n\t\t\tl: \"rounded-xs\",\n\t\t} as const satisfies Record<Size, string>,\n\t},\n});\n\nconst sizingVariants = cva(\"\", {\n\tvariants: {\n\t\tsize: {\n\t\t\ts: \"w-4 h-3\",\n\t\t\tm: \"w-5 h-3.75\",\n\t\t\tl: \"w-8 h-6\",\n\t\t} as const satisfies Record<Size, string>,\n\t},\n});\n\n/**\n * A flag component that displays a flag based on the provided country code.\n * Inspired by [react-flagpack](https://flagpack.xyz/docs/development/react).\n *\n * @see https://mantle.ngrok.com/components/flag#api-flag\n *\n * @example\n * ```tsx\n * <Flag code=\"US\" />\n * <Flag code=\"JP\" size=\"m\" loading=\"eager\" />\n * <Flag code=\"CA\" size=\"s\" loading=\"lazy\" />\n * <Flag code=\"GB\" size=\"l\" />\n * ```\n */\nfunction Flag({\n\t//,\n\tclassName,\n\tcode,\n\tsize = \"l\",\n\tloading = \"lazy\",\n\t...props\n}: Props) {\n\tconst borderRadius = borderRadiusVariants({ size });\n\tconst sizing = sizingVariants({ size });\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cx(\"flag relative overflow-hidden\", borderRadius, sizing, className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<div aria-hidden className={cx(\"absolute inset-0 border border-[#000]/10\", borderRadius)} />\n\t\t\t<img\n\t\t\t\tclassName=\"h-full w-full block object-cover\"\n\t\t\t\tsrc={`${cdnOrigin}/flags/${size}/${code}.svg`}\n\t\t\t\talt={`flag for ${code}`}\n\t\t\t\tloading={loading}\n\t\t\t/>\n\t\t</div>\n\t);\n}\nFlag.displayName = \"Flag\";\n\nexport {\n\t//,\n\tFlag,\n};\n\nexport type {\n\t//,\n\tProps as FlagProps,\n};\n","/** All valid values for a flag\n * @see https://www.flagpack.xyz/docs/flag-index\n */\nconst countryCodes = [\n\t\"004\",\n\t\"008\",\n\t\"010\",\n\t\"016\",\n\t\"016\",\n\t\"020\",\n\t\"024\",\n\t\"028\",\n\t\"031\",\n\t\"032\",\n\t\"040\",\n\t\"044\",\n\t\"048\",\n\t\"050\",\n\t\"051\",\n\t\"052\",\n\t\"056\",\n\t\"060\",\n\t\"064\",\n\t\"068\",\n\t\"070\",\n\t\"072\",\n\t\"074\",\n\t\"076\",\n\t\"084\",\n\t\"086\",\n\t\"090\",\n\t\"092\",\n\t\"096\",\n\t\"100\",\n\t\"104\",\n\t\"108\",\n\t\"112\",\n\t\"116\",\n\t\"120\",\n\t\"124\",\n\t\"132\",\n\t\"136\",\n\t\"140\",\n\t\"144\",\n\t\"148\",\n\t\"152\",\n\t\"156\",\n\t\"158\",\n\t\"162\",\n\t\"166\",\n\t\"170\",\n\t\"174\",\n\t\"178\",\n\t\"180\",\n\t\"184\",\n\t\"188\",\n\t\"191\",\n\t\"192\",\n\t\"196\",\n\t\"203\",\n\t\"204\",\n\t\"208\",\n\t\"212\",\n\t\"214\",\n\t\"218\",\n\t\"222\",\n\t\"226\",\n\t\"231\",\n\t\"232\",\n\t\"233\",\n\t\"234\",\n\t\"238\",\n\t\"239\",\n\t\"242\",\n\t\"246\",\n\t\"248\",\n\t\"250\",\n\t\"254\",\n\t\"258\",\n\t\"260\",\n\t\"262\",\n\t\"266\",\n\t\"268\",\n\t\"270\",\n\t\"275\",\n\t\"276\",\n\t\"288\",\n\t\"292\",\n\t\"296\",\n\t\"300\",\n\t\"304\",\n\t\"308\",\n\t\"312\",\n\t\"316\",\n\t\"320\",\n\t\"324\",\n\t\"328\",\n\t\"332\",\n\t\"334\",\n\t\"336\",\n\t\"340\",\n\t\"344\",\n\t\"348\",\n\t\"352\",\n\t\"356\",\n\t\"360\",\n\t\"364\",\n\t\"368\",\n\t\"372\",\n\t\"376\",\n\t\"380\",\n\t\"384\",\n\t\"388\",\n\t\"392\",\n\t\"398\",\n\t\"400\",\n\t\"404\",\n\t\"408\",\n\t\"410\",\n\t\"414\",\n\t\"417\",\n\t\"418\",\n\t\"422\",\n\t\"426\",\n\t\"428\",\n\t\"430\",\n\t\"434\",\n\t\"438\",\n\t\"440\",\n\t\"442\",\n\t\"446\",\n\t\"450\",\n\t\"454\",\n\t\"458\",\n\t\"462\",\n\t\"466\",\n\t\"470\",\n\t\"474\",\n\t\"478\",\n\t\"480\",\n\t\"484\",\n\t\"492\",\n\t\"496\",\n\t\"498\",\n\t\"499\",\n\t\"500\",\n\t\"504\",\n\t\"508\",\n\t\"512\",\n\t\"516\",\n\t\"520\",\n\t\"524\",\n\t\"528\",\n\t\"531\",\n\t\"533\",\n\t\"534\",\n\t\"540\",\n\t\"548\",\n\t\"554\",\n\t\"558\",\n\t\"562\",\n\t\"566\",\n\t\"570\",\n\t\"574\",\n\t\"578\",\n\t\"580\",\n\t\"581\",\n\t\"583\",\n\t\"584\",\n\t\"585\",\n\t\"586\",\n\t\"591\",\n\t\"598\",\n\t\"600\",\n\t\"604\",\n\t\"608\",\n\t\"612\",\n\t\"616\",\n\t\"620\",\n\t\"624\",\n\t\"626\",\n\t\"630\",\n\t\"634\",\n\t\"638\",\n\t\"642\",\n\t\"643\",\n\t\"646\",\n\t\"652\",\n\t\"654\",\n\t\"659\",\n\t\"660\",\n\t\"662\",\n\t\"663\",\n\t\"666\",\n\t\"670\",\n\t\"674\",\n\t\"678\",\n\t\"682\",\n\t\"686\",\n\t\"688\",\n\t\"690\",\n\t\"694\",\n\t\"702\",\n\t\"703\",\n\t\"704\",\n\t\"705\",\n\t\"706\",\n\t\"710\",\n\t\"716\",\n\t\"724\",\n\t\"728\",\n\t\"729\",\n\t\"732\",\n\t\"740\",\n\t\"744\",\n\t\"748\",\n\t\"752\",\n\t\"756\",\n\t\"760\",\n\t\"762\",\n\t\"764\",\n\t\"768\",\n\t\"772\",\n\t\"776\",\n\t\"780\",\n\t\"784\",\n\t\"788\",\n\t\"792\",\n\t\"795\",\n\t\"796\",\n\t\"798\",\n\t\"800\",\n\t\"804\",\n\t\"807\",\n\t\"818\",\n\t\"831\",\n\t\"832\",\n\t\"833\",\n\t\"834\",\n\t\"836\",\n\t\"840\",\n\t\"850\",\n\t\"854\",\n\t\"858\",\n\t\"860\",\n\t\"862\",\n\t\"876\",\n\t\"882\",\n\t\"887\",\n\t\"894\",\n\t\"ABW\",\n\t\"AD\",\n\t\"AE\",\n\t\"AF\",\n\t\"AFG\",\n\t\"AFRUN\",\n\t\"AG\",\n\t\"AGO\",\n\t\"AI\",\n\t\"AIA\",\n\t\"AL\",\n\t\"ALA\",\n\t\"ALB\",\n\t\"AM\",\n\t\"AMS\",\n\t\"AND\",\n\t\"AO\",\n\t\"AQ\",\n\t\"AR\",\n\t\"ARE\",\n\t\"ARG\",\n\t\"ARM\",\n\t\"AS\",\n\t\"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",\n\t\"SLV\",\n\t\"SM\",\n\t\"SMR\",\n\t\"SN\",\n\t\"SO\",\n\t\"SOM\",\n\t\"SPM\",\n\t\"SR\",\n\t\"SRB\",\n\t\"SS\",\n\t\"SSD\",\n\t\"ST\",\n\t\"STP\",\n\t\"SUR\",\n\t\"SV\",\n\t\"SVK\",\n\t\"SVN\",\n\t\"SWE\",\n\t\"SWZ\",\n\t\"SX\",\n\t\"SXM\",\n\t\"SY\",\n\t\"SYC\",\n\t\"SYR\",\n\t\"SZ\",\n\t\"TC\",\n\t\"TCA\",\n\t\"TCD\",\n\t\"TD\",\n\t\"TF\",\n\t\"TG\",\n\t\"TGO\",\n\t\"TH\",\n\t\"THA\",\n\t\"TJ\",\n\t\"TJK\",\n\t\"TK\",\n\t\"TKL\",\n\t\"TKM\",\n\t\"TL\",\n\t\"TLS\",\n\t\"TM\",\n\t\"TN\",\n\t\"TO\",\n\t\"TON\",\n\t\"TR\",\n\t\"TT\",\n\t\"TTO\",\n\t\"TUN\",\n\t\"TUR\",\n\t\"TUV\",\n\t\"TV\",\n\t\"TW\",\n\t\"TWN\",\n\t\"TZ\",\n\t\"TZA\",\n\t\"UA\",\n\t\"UG\",\n\t\"UGA\",\n\t\"UKR\",\n\t\"UM\",\n\t\"UMI\",\n\t\"UNASUR\",\n\t\"URY\",\n\t\"US\",\n\t\"USA\",\n\t\"UY\",\n\t\"UZ\",\n\t\"UZB\",\n\t\"VA\",\n\t\"VAT\",\n\t\"VC\",\n\t\"VCT\",\n\t\"VE\",\n\t\"VEN\",\n\t\"VG\",\n\t\"VGB\",\n\t\"VI\",\n\t\"VIR\",\n\t\"VN\",\n\t\"VNM\",\n\t\"VU\",\n\t\"VUT\",\n\t\"WF\",\n\t\"WLF\",\n\t\"WS\",\n\t\"WSM\",\n\t\"YE\",\n\t\"YEM\",\n\t\"ZA\",\n\t\"ZAF\",\n\t\"ZM\",\n\t\"ZMB\",\n\t\"ZW\",\n\t\"ZWE\",\n] as const;\ntype CountryCode = (typeof countryCodes)[number];\n\n/**\n * Type Predicate: check if the given value is a valid country code\n */\nfunction isCountryCode(value: unknown): value is CountryCode {\n\treturn countryCodes.includes(value as CountryCode);\n}\n\nexport {\n\t//,\n\tisCountryCode,\n\tcountryCodes,\n};\n\nexport type {\n\t//,\n\tCountryCode,\n};\n"],"mappings":"wCAAA,OAAS,OAAAA,MAAW,2BA2ElB,OAIC,OAAAC,EAJD,QAAAC,MAAA,oBAtEF,IAAMC,EAAY,2BAwBlB,IAAMC,EAAuBC,EAAI,GAAI,CACpC,SAAU,CACT,KAAM,CACL,EAAG,sBACH,EAAG,uBACH,EAAG,YACJ,CACD,CACD,CAAC,EAEKC,EAAiBD,EAAI,GAAI,CAC9B,SAAU,CACT,KAAM,CACL,EAAG,UACH,EAAG,aACH,EAAG,SACJ,CACD,CACD,CAAC,EAgBD,SAASE,EAAK,CAEb,UAAAC,EACA,KAAAC,EACA,KAAAC,EAAO,IACP,QAAAC,EAAU,OACV,GAAGC,CACJ,EAAU,CACT,IAAMC,EAAeT,EAAqB,CAAE,KAAAM,CAAK,CAAC,EAC5CI,EAASR,EAAe,CAAE,KAAAI,CAAK,CAAC,EAEtC,OACCK,EAAC,OACA,UAAWC,EAAG,gCAAiCH,EAAcC,EAAQN,CAAS,EAC7E,GAAGI,EAEJ,UAAAK,EAAC,OAAI,cAAW,GAAC,UAAWD,EAAG,2CAA4CH,CAAY,EAAG,EAC1FI,EAAC,OACA,UAAU,mCACV,IAAK,GAAGC,CAAS,UAAUR,CAAI,IAAID,CAAI,OACvC,IAAK,YAAYA,CAAI,GACrB,QAASE,EACV,GACD,CAEF,CACAJ,EAAK,YAAc,OCtFnB,IAAMY,EAAe,CACpB,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,KACA,KACA,KACA,MACA,QACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,MACA,KACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,MACA,MACA,MACA,KACA,MACA,MACA,KACA,KACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,MACA,QACA,QACA,QACA,KACA,MACA,MACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,MACA,KACA,MACA,KACA,KACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,KACA,MACA,MACA,MACA,MACA,MACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,SACA,SACA,SACA,SACA,SACA,KACA,MACA,KACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,KACA,KACA,MACA,MACA,MACA,KACA,KACA,MACA,KACA,MACA,MACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,QACA,MACA,MACA,KACA,KACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,KACA,MACA,KACA,KACA,MACA,MACA,KACA,MACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,UACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,MACA,MACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,KACA,MACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,KACA,MACA,MACA,MACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,MACA,KACA,MACA,SACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACD,EAMA,SAASC,EAAcC,EAAsC,CAC5D,OAAOF,EAAa,SAASE,CAAoB,CAClD","names":["cva","jsx","jsxs","cdnOrigin","borderRadiusVariants","cva","sizingVariants","Flag","className","code","size","loading","props","borderRadius","sizing","jsxs","cx","jsx","cdnOrigin","countryCodes","isCountryCode","value"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/flag/flag.tsx","../src/components/flag/country-code.ts"],"sourcesContent":["import { cva } from \"class-variance-authority\";\nimport type { ComponentProps } from \"react\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport type { CountryCode } from \"./country-code.js\";\n\nconst cdnOrigin = \"https://assets.ngrok.com\";\n\nconst sizes = [\"s\", \"m\", \"l\"] as const;\ntype Size = (typeof sizes)[number];\n\ntype Props = Omit<ComponentProps<\"div\">, \"children\"> & {\n\t/**\n\t * The country code for the flag to display\n\t * @example \"US\"\n\t */\n\tcode: CountryCode;\n\t/**\n\t * The size of flag to render, \"s\", \"m\", or \"l\"\n\t * @default \"l\"\n\t */\n\tsize?: Size;\n\t/**\n\t * A string providing a hint to the user agent as to how to best schedule the loading of the image to optimize page performance.\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/loading\n\t * @default \"lazy\"\n\t */\n\tloading?: ComponentProps<\"img\">[\"loading\"];\n};\n\nconst borderRadiusVariants = cva(\"\", {\n\tvariants: {\n\t\tsize: {\n\t\t\ts: \"rounded-[0.0625rem]\",\n\t\t\tm: \"rounded-[0.09375rem]\",\n\t\t\tl: \"rounded-xs\",\n\t\t} as const satisfies Record<Size, string>,\n\t},\n});\n\nconst sizingVariants = cva(\"\", {\n\tvariants: {\n\t\tsize: {\n\t\t\ts: \"w-4 h-3\",\n\t\t\tm: \"w-5 h-3.75\",\n\t\t\tl: \"w-8 h-6\",\n\t\t} as const satisfies Record<Size, string>,\n\t},\n});\n\n/**\n * A flag component that displays a flag based on the provided country code.\n * Inspired by [react-flagpack](https://flagpack.xyz/docs/development/react).\n *\n * @see https://mantle.ngrok.com/components/flag#flag\n *\n * @example\n * ```tsx\n * <Flag code=\"US\" />\n * <Flag code=\"JP\" size=\"m\" loading=\"eager\" />\n * <Flag code=\"CA\" size=\"s\" loading=\"lazy\" />\n * <Flag code=\"GB\" size=\"l\" />\n * ```\n */\nfunction Flag({\n\t//,\n\tclassName,\n\tcode,\n\tsize = \"l\",\n\tloading = \"lazy\",\n\t...props\n}: Props) {\n\tconst borderRadius = borderRadiusVariants({ size });\n\tconst sizing = sizingVariants({ size });\n\n\treturn (\n\t\t<div\n\t\t\tclassName={cx(\"flag relative overflow-hidden\", borderRadius, sizing, className)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<div aria-hidden className={cx(\"absolute inset-0 border border-[#000]/10\", borderRadius)} />\n\t\t\t<img\n\t\t\t\tclassName=\"h-full w-full block object-cover\"\n\t\t\t\tsrc={`${cdnOrigin}/flags/${size}/${code}.svg`}\n\t\t\t\talt={`flag for ${code}`}\n\t\t\t\tloading={loading}\n\t\t\t/>\n\t\t</div>\n\t);\n}\nFlag.displayName = \"Flag\";\n\nexport {\n\t//,\n\tFlag,\n};\n\nexport type {\n\t//,\n\tProps as FlagProps,\n};\n","/** All valid values for a flag\n * @see https://www.flagpack.xyz/docs/flag-index\n */\nconst countryCodes = [\n\t\"004\",\n\t\"008\",\n\t\"010\",\n\t\"016\",\n\t\"016\",\n\t\"020\",\n\t\"024\",\n\t\"028\",\n\t\"031\",\n\t\"032\",\n\t\"040\",\n\t\"044\",\n\t\"048\",\n\t\"050\",\n\t\"051\",\n\t\"052\",\n\t\"056\",\n\t\"060\",\n\t\"064\",\n\t\"068\",\n\t\"070\",\n\t\"072\",\n\t\"074\",\n\t\"076\",\n\t\"084\",\n\t\"086\",\n\t\"090\",\n\t\"092\",\n\t\"096\",\n\t\"100\",\n\t\"104\",\n\t\"108\",\n\t\"112\",\n\t\"116\",\n\t\"120\",\n\t\"124\",\n\t\"132\",\n\t\"136\",\n\t\"140\",\n\t\"144\",\n\t\"148\",\n\t\"152\",\n\t\"156\",\n\t\"158\",\n\t\"162\",\n\t\"166\",\n\t\"170\",\n\t\"174\",\n\t\"178\",\n\t\"180\",\n\t\"184\",\n\t\"188\",\n\t\"191\",\n\t\"192\",\n\t\"196\",\n\t\"203\",\n\t\"204\",\n\t\"208\",\n\t\"212\",\n\t\"214\",\n\t\"218\",\n\t\"222\",\n\t\"226\",\n\t\"231\",\n\t\"232\",\n\t\"233\",\n\t\"234\",\n\t\"238\",\n\t\"239\",\n\t\"242\",\n\t\"246\",\n\t\"248\",\n\t\"250\",\n\t\"254\",\n\t\"258\",\n\t\"260\",\n\t\"262\",\n\t\"266\",\n\t\"268\",\n\t\"270\",\n\t\"275\",\n\t\"276\",\n\t\"288\",\n\t\"292\",\n\t\"296\",\n\t\"300\",\n\t\"304\",\n\t\"308\",\n\t\"312\",\n\t\"316\",\n\t\"320\",\n\t\"324\",\n\t\"328\",\n\t\"332\",\n\t\"334\",\n\t\"336\",\n\t\"340\",\n\t\"344\",\n\t\"348\",\n\t\"352\",\n\t\"356\",\n\t\"360\",\n\t\"364\",\n\t\"368\",\n\t\"372\",\n\t\"376\",\n\t\"380\",\n\t\"384\",\n\t\"388\",\n\t\"392\",\n\t\"398\",\n\t\"400\",\n\t\"404\",\n\t\"408\",\n\t\"410\",\n\t\"414\",\n\t\"417\",\n\t\"418\",\n\t\"422\",\n\t\"426\",\n\t\"428\",\n\t\"430\",\n\t\"434\",\n\t\"438\",\n\t\"440\",\n\t\"442\",\n\t\"446\",\n\t\"450\",\n\t\"454\",\n\t\"458\",\n\t\"462\",\n\t\"466\",\n\t\"470\",\n\t\"474\",\n\t\"478\",\n\t\"480\",\n\t\"484\",\n\t\"492\",\n\t\"496\",\n\t\"498\",\n\t\"499\",\n\t\"500\",\n\t\"504\",\n\t\"508\",\n\t\"512\",\n\t\"516\",\n\t\"520\",\n\t\"524\",\n\t\"528\",\n\t\"531\",\n\t\"533\",\n\t\"534\",\n\t\"540\",\n\t\"548\",\n\t\"554\",\n\t\"558\",\n\t\"562\",\n\t\"566\",\n\t\"570\",\n\t\"574\",\n\t\"578\",\n\t\"580\",\n\t\"581\",\n\t\"583\",\n\t\"584\",\n\t\"585\",\n\t\"586\",\n\t\"591\",\n\t\"598\",\n\t\"600\",\n\t\"604\",\n\t\"608\",\n\t\"612\",\n\t\"616\",\n\t\"620\",\n\t\"624\",\n\t\"626\",\n\t\"630\",\n\t\"634\",\n\t\"638\",\n\t\"642\",\n\t\"643\",\n\t\"646\",\n\t\"652\",\n\t\"654\",\n\t\"659\",\n\t\"660\",\n\t\"662\",\n\t\"663\",\n\t\"666\",\n\t\"670\",\n\t\"674\",\n\t\"678\",\n\t\"682\",\n\t\"686\",\n\t\"688\",\n\t\"690\",\n\t\"694\",\n\t\"702\",\n\t\"703\",\n\t\"704\",\n\t\"705\",\n\t\"706\",\n\t\"710\",\n\t\"716\",\n\t\"724\",\n\t\"728\",\n\t\"729\",\n\t\"732\",\n\t\"740\",\n\t\"744\",\n\t\"748\",\n\t\"752\",\n\t\"756\",\n\t\"760\",\n\t\"762\",\n\t\"764\",\n\t\"768\",\n\t\"772\",\n\t\"776\",\n\t\"780\",\n\t\"784\",\n\t\"788\",\n\t\"792\",\n\t\"795\",\n\t\"796\",\n\t\"798\",\n\t\"800\",\n\t\"804\",\n\t\"807\",\n\t\"818\",\n\t\"831\",\n\t\"832\",\n\t\"833\",\n\t\"834\",\n\t\"836\",\n\t\"840\",\n\t\"850\",\n\t\"854\",\n\t\"858\",\n\t\"860\",\n\t\"862\",\n\t\"876\",\n\t\"882\",\n\t\"887\",\n\t\"894\",\n\t\"ABW\",\n\t\"AD\",\n\t\"AE\",\n\t\"AF\",\n\t\"AFG\",\n\t\"AFRUN\",\n\t\"AG\",\n\t\"AGO\",\n\t\"AI\",\n\t\"AIA\",\n\t\"AL\",\n\t\"ALA\",\n\t\"ALB\",\n\t\"AM\",\n\t\"AMS\",\n\t\"AND\",\n\t\"AO\",\n\t\"AQ\",\n\t\"AR\",\n\t\"ARE\",\n\t\"ARG\",\n\t\"ARM\",\n\t\"AS\",\n\t\"ASM\",\n\t\"AT\",\n\t\"ATA\",\n\t\"ATF\",\n\t\"ATG\",\n\t\"AU\",\n\t\"AUS\",\n\t\"AUT\",\n\t\"AW\",\n\t\"AX\",\n\t\"AZ\",\n\t\"AZE\",\n\t\"BA\",\n\t\"BB\",\n\t\"BD\",\n\t\"BDI\",\n\t\"BE\",\n\t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VN\",\n\t\"SWE\",\n\t\"SWZ\",\n\t\"SX\",\n\t\"SXM\",\n\t\"SY\",\n\t\"SYC\",\n\t\"SYR\",\n\t\"SZ\",\n\t\"TC\",\n\t\"TCA\",\n\t\"TCD\",\n\t\"TD\",\n\t\"TF\",\n\t\"TG\",\n\t\"TGO\",\n\t\"TH\",\n\t\"THA\",\n\t\"TJ\",\n\t\"TJK\",\n\t\"TK\",\n\t\"TKL\",\n\t\"TKM\",\n\t\"TL\",\n\t\"TLS\",\n\t\"TM\",\n\t\"TN\",\n\t\"TO\",\n\t\"TON\",\n\t\"TR\",\n\t\"TT\",\n\t\"TTO\",\n\t\"TUN\",\n\t\"TUR\",\n\t\"TUV\",\n\t\"TV\",\n\t\"TW\",\n\t\"TWN\",\n\t\"TZ\",\n\t\"TZA\",\n\t\"UA\",\n\t\"UG\",\n\t\"UGA\",\n\t\"UKR\",\n\t\"UM\",\n\t\"UMI\",\n\t\"UNASUR\",\n\t\"URY\",\n\t\"US\",\n\t\"USA\",\n\t\"UY\",\n\t\"UZ\",\n\t\"UZB\",\n\t\"VA\",\n\t\"VAT\",\n\t\"VC\",\n\t\"VCT\",\n\t\"VE\",\n\t\"VEN\",\n\t\"VG\",\n\t\"VGB\",\n\t\"VI\",\n\t\"VIR\",\n\t\"VN\",\n\t\"VNM\",\n\t\"VU\",\n\t\"VUT\",\n\t\"WF\",\n\t\"WLF\",\n\t\"WS\",\n\t\"WSM\",\n\t\"YE\",\n\t\"YEM\",\n\t\"ZA\",\n\t\"ZAF\",\n\t\"ZM\",\n\t\"ZMB\",\n\t\"ZW\",\n\t\"ZWE\",\n] as const;\ntype CountryCode = (typeof countryCodes)[number];\n\n/**\n * Type Predicate: check if the given value is a valid country code\n */\nfunction isCountryCode(value: unknown): value is CountryCode {\n\treturn countryCodes.includes(value as CountryCode);\n}\n\nexport {\n\t//,\n\tisCountryCode,\n\tcountryCodes,\n};\n\nexport type {\n\t//,\n\tCountryCode,\n};\n"],"mappings":"wCAAA,OAAS,OAAAA,MAAW,2BA2ElB,OAIC,OAAAC,EAJD,QAAAC,MAAA,oBAtEF,IAAMC,EAAY,2BAwBlB,IAAMC,EAAuBC,EAAI,GAAI,CACpC,SAAU,CACT,KAAM,CACL,EAAG,sBACH,EAAG,uBACH,EAAG,YACJ,CACD,CACD,CAAC,EAEKC,EAAiBD,EAAI,GAAI,CAC9B,SAAU,CACT,KAAM,CACL,EAAG,UACH,EAAG,aACH,EAAG,SACJ,CACD,CACD,CAAC,EAgBD,SAASE,EAAK,CAEb,UAAAC,EACA,KAAAC,EACA,KAAAC,EAAO,IACP,QAAAC,EAAU,OACV,GAAGC,CACJ,EAAU,CACT,IAAMC,EAAeT,EAAqB,CAAE,KAAAM,CAAK,CAAC,EAC5CI,EAASR,EAAe,CAAE,KAAAI,CAAK,CAAC,EAEtC,OACCK,EAAC,OACA,UAAWC,EAAG,gCAAiCH,EAAcC,EAAQN,CAAS,EAC7E,GAAGI,EAEJ,UAAAK,EAAC,OAAI,cAAW,GAAC,UAAWD,EAAG,2CAA4CH,CAAY,EAAG,EAC1FI,EAAC,OACA,UAAU,mCACV,IAAK,GAAGC,CAAS,UAAUR,CAAI,IAAID,CAAI,OACvC,IAAK,YAAYA,CAAI,GACrB,QAASE,EACV,GACD,CAEF,CACAJ,EAAK,YAAc,OCtFnB,IAAMY,EAAe,CACpB,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,KACA,KACA,KACA,MACA,QACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,MACA,KACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,MACA,MACA,MACA,KACA,MACA,MACA,KACA,KACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,MACA,QACA,QACA,QACA,KACA,MACA,MACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,MACA,KACA,MACA,KACA,KACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,KACA,MACA,MACA,MACA,MACA,MACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,SACA,SACA,SACA,SACA,SACA,KACA,MACA,KACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,KACA,KACA,MACA,MACA,MACA,KACA,KACA,MACA,KACA,MACA,MACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,QACA,MACA,MACA,KACA,KACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,KACA,MACA,KACA,KACA,MACA,MACA,KACA,MACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,UACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,KACA,MACA,MACA,MACA,KACA,MACA,KACA,KACA,MACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,MACA,MACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,KACA,MACA,MACA,KACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,MACA,KACA,MACA,KACA,KACA,KACA,MACA,KACA,KACA,MACA,MACA,MACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,KACA,MACA,MACA,KACA,MACA,SACA,MACA,KACA,MACA,KACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,MACA,KACA,KACD,EAMA,SAASC,EAAcC,EAAsC,CAC5D,OAAOF,EAAa,SAASE,CAAoB,CAClD","names":["cva","jsx","jsxs","cdnOrigin","borderRadiusVariants","cva","sizingVariants","Flag","className","code","size","loading","props","borderRadius","sizing","jsxs","cx","jsx","cdnOrigin","countryCodes","isCountryCode","value"]}
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Tailwind CSS breakpoints in descending order (largest → smallest).
|
|
@@ -166,7 +166,7 @@ declare function useIsHydrated(): boolean;
|
|
|
166
166
|
/**
|
|
167
167
|
* useIsomorphicLayoutEffect is a hook that uses useLayoutEffect on the client and useEffect on the server.
|
|
168
168
|
*/
|
|
169
|
-
declare const useIsomorphicLayoutEffect: typeof
|
|
169
|
+
declare const useIsomorphicLayoutEffect: typeof useEffect;
|
|
170
170
|
|
|
171
171
|
/**
|
|
172
172
|
* React hook that subscribes to and returns the result of a CSS media query.
|
package/dist/hooks.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as L}from"./chunk-PNL7JOXI.js";import{a as T}from"./chunk-6J7D73WA.js";import{a as v}from"./chunk-KMNACVH6.js";import{useSyncExternalStore as B}from"react";var b=["2xl","xl","lg","md","sm","xs","2xs"],Q=["default",...b];function R(){return B(C,E,()=>"default")}function S(e){return B(q(e),I(e),()=>!1)}var i={"2xl":"(min-width: 96rem)",xl:"(min-width: 80rem)",lg:"(min-width: 64rem)",md:"(min-width: 48rem)",sm:"(min-width: 40rem)",xs:"(min-width: 30rem)","2xs":"(min-width: 22.5rem)"},a={"2xl":"(max-width: 95.99rem)",xl:"(max-width: 79.99rem)",lg:"(max-width: 63.99rem)",md:"(max-width: 47.99rem)",sm:"(max-width: 39.99rem)",xs:"(max-width: 29.99rem)","2xs":"(max-width: 22.49rem)"},c=null,m=null;function f(){return c||(c={"2xl":window.matchMedia(i["2xl"]),xl:window.matchMedia(i.xl),lg:window.matchMedia(i.lg),md:window.matchMedia(i.md),sm:window.matchMedia(i.sm),xs:window.matchMedia(i.xs),"2xs":window.matchMedia(i["2xs"])}),c}function y(e){return m||(m={"2xl":window.matchMedia(a["2xl"]),xl:window.matchMedia(a.xl),lg:window.matchMedia(a.lg),md:window.matchMedia(a.md),sm:window.matchMedia(a.sm),xs:window.matchMedia(a.xs),"2xs":window.matchMedia(a["2xs"])}),m[e]}var u="default",d=new Set,s=!1;function g(){let e=f();for(let t of b)if(e[t].matches)return t;return"default"}var l=!1;function x(){l||(l=!0,requestAnimationFrame(()=>{l=!1;let e=g();if(e!==u){u=e;for(let t of d)t()}}))}function C(e){if(d.add(e),!s){s=!0;let t=f();u=g();for(let n of Object.values(t))n.addEventListener("change",x)}return e(),()=>{if(d.delete(e),d.size===0&&s){s=!1;let t=f();for(let n of Object.values(t))n.removeEventListener("change",x)}}}function E(){return u}var k=new Map;function q(e){let t=k.get(e);return t||(t=n=>{let o=y(e),r=!1,h=()=>{r||(r=!0,requestAnimationFrame(()=>{r=!1,n()}))};return o.addEventListener("change",h),()=>{o.removeEventListener("change",h)}},k.set(e,t),t)}var M=new Map;function I(e){let t=M.get(e);return t||(t=()=>y(e).matches,M.set(e,t),t)}import{useEffect as W,useMemo as P,useRef as j}from"react";function p(e){let t=j(e);return W(()=>{t.current=e}),P(()=>((...n)=>t.current?.(...n)),[])}import{useCallback as O,useEffect as A,useRef as F}from"react";function D(e,t){let n=p(e),o=F(0);return A(()=>()=>window.clearTimeout(o.current),[]),O((...r)=>{window.clearTimeout(o.current),o.current=window.setTimeout(()=>n(...r),t.waitMs)},[n,t.waitMs])}import{useEffect as _,useLayoutEffect as $}from"react";var z=typeof window<"u"?$:_;import{useEffect as G,useState as H}from"react";var U="(prefers-reduced-motion: no-preference)";function w(){let[e,t]=H(!0);return G(()=>{let n=window.matchMedia(U);t(!n.matches);function o(r){t(!r.matches)}return n.addEventListener("change",o),()=>{n.removeEventListener("change",o)}},[]),e}import{useMemo as V}from"react";var J=(e="mantle")=>V(()=>K(e),[e]);function K(e="mantle"){return[e.trim()||"mantle",N()].join("-")}function N(){return Math.random().toString(36).substring(2,9)}import{useMemo as X}from"react";function Y(){let e=w();return X(()=>e?"auto":"smooth",[e])}export{Q as breakpoints,R as useBreakpoint,p as useCallbackRef,L as useCopyToClipboard,D as useDebouncedCallback,S as useIsBelowBreakpoint,v as useIsHydrated,z as useIsomorphicLayoutEffect,T as useMatchesMediaQuery,w as usePrefersReducedMotion,J as useRandomStableId,Y as useScrollBehavior};
|
|
2
2
|
//# sourceMappingURL=hooks.js.map
|
package/dist/hooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/hooks/use-breakpoint.tsx","../src/hooks/use-callback-ref.tsx","../src/hooks/use-debounced-callback.tsx","../src/hooks/use-random-stable-id.tsx"],"sourcesContent":["import { useSyncExternalStore } from \"react\";\n\n/**\n * Tailwind CSS breakpoints in descending order (largest → smallest).\n *\n * These correspond to Tailwind’s default `theme.screens` config and are used\n * to determine the current viewport size.\n *\n * @see https://tailwindcss.com/docs/screens\n *\n * @example\n * \"2xl\" // ≥96rem (1536px)\n * \"xl\" // ≥80rem (1280px)\n * \"lg\" // ≥64rem (1024px)\n * \"md\" // ≥48rem (768px)\n * \"sm\" // ≥40rem (640px)\n * \"xs\" // ≥30rem (480px)\n * \"2xs\" // ≥22.5rem (360px)\n */\nconst tailwindBreakpoints = [\"2xl\", \"xl\", \"lg\", \"md\", \"sm\", \"xs\", \"2xs\"] as const;\n\n/**\n * A valid Tailwind CSS breakpoint identifier.\n *\n * @example\n * const bp: TailwindBreakpoint = \"md\"; // ≥48rem (768px)\n *\n * @example\n * \"2xl\" // ≥96rem (1536px)\n * \"xl\" // ≥80rem (1280px)\n * \"lg\" // ≥64rem (1024px)\n * \"md\" // ≥48rem (768px)\n * \"sm\" // ≥40rem (640px)\n * \"xs\" // ≥30rem (480px)\n * \"2xs\" // ≥22.5rem (360px)\n */\ntype TailwindBreakpoint = (typeof tailwindBreakpoints)[number];\n\n/**\n * Mantle’s breakpoint set, extending Tailwind’s with `\"default\"`.\n *\n * `\"default\"` represents the base (0px and up) viewport,\n * useful for defining fallbacks or mobile-first styles.\n *\n * @example\n * \"default\" // ≥0rem (0px)\n * \"2xs\" // ≥22.5rem (360px)\n * \"xs\" // ≥30rem (480px)\n * \"sm\" // ≥40rem (640px)\n * \"md\" // ≥48rem (768px)\n * \"lg\" // ≥64rem (1024px)\n * \"xl\" // ≥80rem (1280px)\n * \"2xl\" // ≥96rem (1536px)\n */\nconst breakpoints = [\"default\", ...tailwindBreakpoints] as const;\n\n/**\n * A valid Mantle breakpoint identifier.\n *\n * Includes Tailwind’s standard breakpoints plus `\"default\"` for 0px+.\n *\n * @example\n * const bp: Breakpoint = \"default\"; // ≥0px\n *\n * @example\n * \"default\" // ≥0rem (0px)\n * \"2xs\" // ≥22.5rem (360px)\n * \"xs\" // ≥30rem (480px)\n * \"sm\" // ≥40rem (640px)\n * \"md\" // ≥48rem (768px)\n * \"lg\" // ≥64rem (1024px)\n * \"xl\" // ≥80rem (1280px)\n * \"2xl\" // ≥96rem (1536px)\n */\ntype Breakpoint = (typeof breakpoints)[number];\n\n/**\n * React hook that returns the current breakpoint based on the viewport width.\n *\n * Uses a singleton subscription to a set of min-width media queries and returns\n * the largest matching breakpoint. Designed for React 18+ with\n * `useSyncExternalStore`.\n *\n * @returns {Breakpoint} The current breakpoint that matches the viewport width.\n *\n * @example\n * const breakpoint = useBreakpoint();\n * if (breakpoint === \"lg\") {\n * // Do something for large screens and above\n * }\n */\nfunction useBreakpoint(): Breakpoint {\n\treturn useSyncExternalStore(\n\t\tsubscribeToBreakpointChanges,\n\t\tgetCurrentBreakpointSnapshot,\n\t\t() => \"default\", // SSR fallback\n\t);\n}\n\n/**\n * React hook that returns true if the current viewport width is below the specified breakpoint.\n *\n * This hook uses `window.matchMedia` with a max-width media query and leverages\n * `useSyncExternalStore` to stay compliant with React's concurrent rendering model.\n *\n * @param {TailwindBreakpoint} breakpoint - The breakpoint to check against (e.g., \"md\", \"lg\").\n *\n * @returns {boolean} `true` if the viewport width is below the breakpoint, otherwise `false`.\n *\n * @example\n * // Check if viewport is below medium (768px)\n * const isBelowMd = useIsBelowBreakpoint(\"md\");\n */\nfunction useIsBelowBreakpoint(breakpoint: TailwindBreakpoint): boolean {\n\treturn useSyncExternalStore(\n\t\tcreateBelowBreakpointSubscribe(breakpoint),\n\t\tcreateBelowBreakpointGetSnapshot(breakpoint),\n\t\t() => false, // SSR fallback - assume desktop\n\t);\n}\n\nexport {\n\t//,\n\tbreakpoints,\n\tuseBreakpoint,\n\tuseIsBelowBreakpoint,\n};\n\nexport type {\n\t//,\n\tBreakpoint,\n\tTailwindBreakpoint,\n};\n\n/**\n * A CSS media query string representing a minimum width in `rem` units.\n *\n * @example\n * const query: MinWidthQuery = \"(min-width: 48rem)\";\n *\n * @private\n */\ntype MinWidthQuery = `(min-width: ${number}rem)`;\n\n/**\n * A CSS media query string representing a maximum width in `rem` units.\n *\n * @example\n * const query: MaxWidthQuery = \"(max-width: 47.99rem)\";\n *\n * @private\n */\ntype MaxWidthQuery = `(max-width: ${number}rem)`;\n\n/**\n * Precomputed min-width media query strings for each Tailwind breakpoint.\n *\n * Using constants avoids template string work in hot paths and ensures type\n * safety against the `MinWidthQuery` template literal type.\n *\n * @remarks\n * These are expressed in `rem`. If your CSS breakpoints are in `px`, consider\n * aligning units to avoid JS/CSS drift when `html{font-size}` changes.\n *\n * @private\n */\nconst breakpointQueries = {\n\t\"2xl\": \"(min-width: 96rem)\" as const,\n\txl: \"(min-width: 80rem)\" as const,\n\tlg: \"(min-width: 64rem)\" as const,\n\tmd: \"(min-width: 48rem)\" as const,\n\tsm: \"(min-width: 40rem)\" as const,\n\txs: \"(min-width: 30rem)\" as const,\n\t\"2xs\": \"(min-width: 22.5rem)\" as const,\n} as const satisfies Record<TailwindBreakpoint, MinWidthQuery>;\n\n/**\n * Precomputed max-width media query strings used by `useIsBelowBreakpoint`.\n *\n * The `-0.01rem` offset avoids overlap at exact boundaries.\n *\n * @private\n */\nconst belowBreakpointQueries = {\n\t\"2xl\": \"(max-width: 95.99rem)\" as const, // 96 - 0.01\n\txl: \"(max-width: 79.99rem)\" as const, // 80 - 0.01\n\tlg: \"(max-width: 63.99rem)\" as const, // 64 - 0.01\n\tmd: \"(max-width: 47.99rem)\" as const, // 48 - 0.01\n\tsm: \"(max-width: 39.99rem)\" as const, // 40 - 0.01\n\txs: \"(max-width: 29.99rem)\" as const, // 30 - 0.01\n\t\"2xs\": \"(max-width: 22.49rem)\" as const, // 22.5 - 0.01\n} as const satisfies Record<TailwindBreakpoint, MaxWidthQuery>;\n\n/**\n * Lazily-initialized cache of `MediaQueryList` objects for min-width queries.\n *\n * Initialized on first access to remain SSR-safe (no `window` at import time).\n *\n * @private\n */\nlet minWidthMQLs: Record<TailwindBreakpoint, MediaQueryList> | null = null;\n\n/**\n * Lazily-initialized cache of `MediaQueryList` objects for max-width queries.\n *\n * Used by `useIsBelowBreakpoint`. Also SSR-safe by lazy access.\n *\n * @private\n */\nlet maxWidthMQLs: Record<TailwindBreakpoint, MediaQueryList> | null = null;\n\n/**\n * Get (and lazily create) the cached `MediaQueryList` objects for min-width queries.\n *\n * @returns A record of `MediaQueryList` keyed by Tailwind breakpoint.\n * @private\n */\nfunction getMinWidthMQLs(): Record<TailwindBreakpoint, MediaQueryList> {\n\tif (!minWidthMQLs) {\n\t\tminWidthMQLs = {\n\t\t\t\"2xl\": window.matchMedia(breakpointQueries[\"2xl\"]),\n\t\t\txl: window.matchMedia(breakpointQueries.xl),\n\t\t\tlg: window.matchMedia(breakpointQueries.lg),\n\t\t\tmd: window.matchMedia(breakpointQueries.md),\n\t\t\tsm: window.matchMedia(breakpointQueries.sm),\n\t\t\txs: window.matchMedia(breakpointQueries.xs),\n\t\t\t\"2xs\": window.matchMedia(breakpointQueries[\"2xs\"]),\n\t\t};\n\t}\n\treturn minWidthMQLs;\n}\n\n/**\n * Get (and lazily create) the cached `MediaQueryList` for a specific max-width breakpoint.\n *\n * @param breakpoint - Tailwind breakpoint identifier (e.g., \"md\").\n * @returns The corresponding `MediaQueryList`.\n * @private\n */\nfunction getMaxWidthMQL(breakpoint: TailwindBreakpoint): MediaQueryList {\n\tif (!maxWidthMQLs) {\n\t\tmaxWidthMQLs = {\n\t\t\t\"2xl\": window.matchMedia(belowBreakpointQueries[\"2xl\"]),\n\t\t\txl: window.matchMedia(belowBreakpointQueries.xl),\n\t\t\tlg: window.matchMedia(belowBreakpointQueries.lg),\n\t\t\tmd: window.matchMedia(belowBreakpointQueries.md),\n\t\t\tsm: window.matchMedia(belowBreakpointQueries.sm),\n\t\t\txs: window.matchMedia(belowBreakpointQueries.xs),\n\t\t\t\"2xs\": window.matchMedia(belowBreakpointQueries[\"2xs\"]),\n\t\t};\n\t}\n\treturn maxWidthMQLs[breakpoint];\n}\n\n/**\n * Current breakpoint value used by the singleton store backing `useBreakpoint`.\n *\n * Initialized to `\"default\"` and updated on media-query change events.\n *\n * @private\n */\nlet currentBreakpointValue: Breakpoint = \"default\";\n\n/**\n * Set of component listeners subscribed to the singleton breakpoint store.\n *\n * Each listener is invoked when the current breakpoint value changes.\n *\n * @private\n */\nconst breakpointListeners = new Set<() => void>();\n\n/**\n * Flag indicating whether global media-query listeners are currently attached.\n *\n * Prevents duplicate registrations and enables full teardown when unused.\n *\n * @private\n */\nlet breakpointSubscriptionActive = false;\n\n/**\n * Compute the current breakpoint by checking cached min-width MQLs\n * from largest to smallest.\n *\n * @returns {Breakpoint} The largest matching breakpoint, or `\"default\"`.\n * @private\n */\nfunction getCurrentBreakpoint(): Breakpoint {\n\tconst mqls = getMinWidthMQLs();\n\tfor (const breakpoint of tailwindBreakpoints) {\n\t\tif (mqls[breakpoint].matches) {\n\t\t\treturn breakpoint;\n\t\t}\n\t}\n\treturn \"default\";\n}\n\n/**\n * Update the current breakpoint value and notify all listeners.\n *\n * Uses `requestAnimationFrame` to coalesce rapid resize events and minimize\n * re-renders during active window resizing.\n *\n * @private\n */\nlet breakpointUpdatePending = false;\nfunction updateCurrentBreakpoint() {\n\tif (!breakpointUpdatePending) {\n\t\tbreakpointUpdatePending = true;\n\t\trequestAnimationFrame(() => {\n\t\t\tbreakpointUpdatePending = false;\n\t\t\tconst newBreakpoint = getCurrentBreakpoint();\n\t\t\tif (newBreakpoint !== currentBreakpointValue) {\n\t\t\t\tcurrentBreakpointValue = newBreakpoint;\n\t\t\t\tfor (const listener of breakpointListeners) {\n\t\t\t\t\tlistener();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}\n\n/**\n * Subscribe a component to breakpoint changes (singleton pattern).\n *\n * Ensures only one set of MQL listeners exists app-wide. Also reconciles the\n * `useSyncExternalStore` initial snapshot/subscribe race by invoking the\n * subscriber once on mount.\n *\n * @param callback - Listener invoked when the breakpoint value may have changed.\n * @returns Cleanup function to unsubscribe the listener.\n * @private\n */\nfunction subscribeToBreakpointChanges(callback: () => void) {\n\tbreakpointListeners.add(callback);\n\n\t// Attach global listeners once\n\tif (!breakpointSubscriptionActive) {\n\t\tbreakpointSubscriptionActive = true;\n\t\tconst mqls = getMinWidthMQLs();\n\n\t\t// Initialize current value synchronously\n\t\tcurrentBreakpointValue = getCurrentBreakpoint();\n\n\t\t// Attach listeners to all breakpoint MQLs\n\t\tfor (const mql of Object.values(mqls)) {\n\t\t\tmql.addEventListener(\"change\", updateCurrentBreakpoint);\n\t\t}\n\t}\n\n\t// Reconcile initial getSnapshot vs subscribe ordering\n\tcallback();\n\n\t// Cleanup\n\treturn () => {\n\t\tbreakpointListeners.delete(callback);\n\n\t\t// Tear down global listeners when no one is listening\n\t\tif (breakpointListeners.size === 0 && breakpointSubscriptionActive) {\n\t\t\tbreakpointSubscriptionActive = false;\n\t\t\tconst mqls = getMinWidthMQLs();\n\t\t\tfor (const mql of Object.values(mqls)) {\n\t\t\t\tmql.removeEventListener(\"change\", updateCurrentBreakpoint);\n\t\t\t}\n\t\t}\n\t};\n}\n\n/**\n * Return the current breakpoint value from the singleton store.\n *\n * Used as the `getSnapshot` for `useSyncExternalStore`.\n *\n * @returns {Breakpoint} The latest computed breakpoint.\n * @private\n */\nfunction getCurrentBreakpointSnapshot(): Breakpoint {\n\treturn currentBreakpointValue;\n}\n\n/**\n * Cached `subscribe` functions keyed by breakpoint.\n *\n * Without caching, `useSyncExternalStore` receives a new function reference on\n * every render, causing it to tear down and re-attach the MQL listener each\n * time — the primary source of resize sluggishness.\n *\n * @private\n */\nconst belowBreakpointSubscribeCache = new Map<\n\tTailwindBreakpoint,\n\t(callback: () => void) => () => void\n>();\n\n/**\n * Get (or create and cache) a `subscribe` function for a specific \"below\" breakpoint.\n *\n * Uses a cached `MediaQueryList` and rAF-throttled change handler to avoid\n * bursty updates during resize.\n *\n * @param breakpoint - Tailwind breakpoint identifier (e.g., \"lg\").\n * @returns A stable `subscribe` function suitable for `useSyncExternalStore`.\n * @private\n */\nfunction createBelowBreakpointSubscribe(breakpoint: TailwindBreakpoint) {\n\tlet cached = belowBreakpointSubscribeCache.get(breakpoint);\n\tif (cached) {\n\t\treturn cached;\n\t}\n\n\tcached = (callback: () => void) => {\n\t\tconst mediaQuery = getMaxWidthMQL(breakpoint);\n\n\t\t// rAF throttle the change callback during active resize\n\t\tlet pending = false;\n\t\tconst onChange = () => {\n\t\t\tif (!pending) {\n\t\t\t\tpending = true;\n\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\tpending = false;\n\t\t\t\t\tcallback();\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\tmediaQuery.addEventListener(\"change\", onChange);\n\t\treturn () => {\n\t\t\tmediaQuery.removeEventListener(\"change\", onChange);\n\t\t};\n\t};\n\n\tbelowBreakpointSubscribeCache.set(breakpoint, cached);\n\treturn cached;\n}\n\n/**\n * Cached `getSnapshot` functions keyed by breakpoint.\n *\n * Ensures `useSyncExternalStore` receives a referentially stable function,\n * preventing unnecessary subscription churn.\n *\n * @private\n */\nconst belowBreakpointSnapshotCache = new Map<TailwindBreakpoint, () => boolean>();\n\n/**\n * Get (or create and cache) a `getSnapshot` function for a specific \"below\" breakpoint.\n *\n * Uses the cached `MediaQueryList` for the target breakpoint.\n *\n * @param breakpoint - Tailwind breakpoint identifier (e.g., \"lg\").\n * @returns A stable function that returns `true` when the viewport is below the breakpoint.\n * @private\n */\nfunction createBelowBreakpointGetSnapshot(breakpoint: TailwindBreakpoint) {\n\tlet cached = belowBreakpointSnapshotCache.get(breakpoint);\n\tif (cached) {\n\t\treturn cached;\n\t}\n\n\tcached = () => {\n\t\tconst mediaQuery = getMaxWidthMQL(breakpoint);\n\t\treturn mediaQuery.matches;\n\t};\n\n\tbelowBreakpointSnapshotCache.set(breakpoint, cached);\n\treturn cached;\n}\n","import { useEffect, useMemo, useRef } from \"react\";\n\n/**\n * Returns a memoized callback that will always refer to the latest callback\n * passed to the hook.\n *\n * This is useful when you want to pass a callback which may or may not be\n * memoized (have a stable identity) to a child component that will be updated\n * without causing the child component to re-render.\n */\nfunction useCallbackRef<T extends (...args: unknown[]) => unknown>(callback: T | undefined): T {\n\tconst callbackRef = useRef(callback);\n\n\tuseEffect(() => {\n\t\tcallbackRef.current = callback;\n\t});\n\n\treturn useMemo(() => ((...args) => callbackRef.current?.(...args)) as T, []);\n}\n\nexport {\n\t//,\n\tuseCallbackRef,\n};\n","import { useCallback, useEffect, useRef } from \"react\";\nimport { useCallbackRef } from \"./use-callback-ref.js\";\n\ntype Options = {\n\t/**\n\t * The delay in milliseconds to wait before calling the callback.\n\t */\n\twaitMs: number;\n};\n\n/**\n * Create a debounced version of a callback function.\n *\n * It allows you to delay the execution of a function until a certain period of\n * inactivity has passed (the `options.waitMs`), which can be useful for limiting rapid\n * invocations of a function (like in search inputs or button clicks)\n *\n * Note: The debounced callback will always refer to the latest callback passed\n * even without memoization, so it's stable and safe to use in dependency arrays.\n */\nfunction useDebouncedCallback<T extends (...args: unknown[]) => unknown>(\n\tcallbackFn: T,\n\toptions: Options,\n) {\n\tconst stableCallbackFn = useCallbackRef(callbackFn);\n\tconst debounceTimerRef = useRef(0);\n\tuseEffect(() => () => window.clearTimeout(debounceTimerRef.current), []);\n\n\treturn useCallback(\n\t\t(...args: Parameters<T>) => {\n\t\t\twindow.clearTimeout(debounceTimerRef.current);\n\t\t\tdebounceTimerRef.current = window.setTimeout(() => stableCallbackFn(...args), options.waitMs);\n\t\t},\n\t\t[stableCallbackFn, options.waitMs],\n\t);\n}\n\nexport {\n\t//,\n\tuseDebouncedCallback,\n};\n","import { useMemo } from \"react\";\n\n/**\n * Hook to generate a random, stable id.\n * This is similar to `useId`, but generates a stable id client side which can also\n * be used for css selectors and element ids.\n */\nconst useRandomStableId = (prefix = \"mantle\") => useMemo(() => randomStableId(prefix), [prefix]);\n\nexport {\n\t//,\n\tuseRandomStableId,\n};\n\nfunction randomStableId(prefix = \"mantle\") {\n\tconst _prefix = prefix.trim() || \"mantle\";\n\treturn [_prefix, randomPostfix()].join(\"-\");\n}\n\nfunction randomPostfix() {\n\treturn Math.random().toString(36).substring(2, 9);\n}\n"],"mappings":"8KAAA,OAAS,wBAAAA,MAA4B,QAmBrC,IAAMC,EAAsB,CAAC,MAAO,KAAM,KAAM,KAAM,KAAM,KAAM,KAAK,EAmCjEC,EAAc,CAAC,UAAW,GAAGD,CAAmB,EAqCtD,SAASE,GAA4B,CACpC,OAAOH,EACNI,EACAC,EACA,IAAM,SACP,CACD,CAgBA,SAASC,EAAqBC,EAAyC,CACtE,OAAOP,EACNQ,EAA+BD,CAAU,EACzCE,EAAiCF,CAAU,EAC3C,IAAM,EACP,CACD,CA+CA,IAAMG,EAAoB,CACzB,MAAO,qBACP,GAAI,qBACJ,GAAI,qBACJ,GAAI,qBACJ,GAAI,qBACJ,GAAI,qBACJ,MAAO,sBACR,EASMC,EAAyB,CAC9B,MAAO,wBACP,GAAI,wBACJ,GAAI,wBACJ,GAAI,wBACJ,GAAI,wBACJ,GAAI,wBACJ,MAAO,uBACR,EASIC,EAAkE,KASlEC,EAAkE,KAQtE,SAASC,GAA8D,CACtE,OAAKF,IACJA,EAAe,CACd,MAAO,OAAO,WAAWF,EAAkB,KAAK,CAAC,EACjD,GAAI,OAAO,WAAWA,EAAkB,EAAE,EAC1C,GAAI,OAAO,WAAWA,EAAkB,EAAE,EAC1C,GAAI,OAAO,WAAWA,EAAkB,EAAE,EAC1C,GAAI,OAAO,WAAWA,EAAkB,EAAE,EAC1C,GAAI,OAAO,WAAWA,EAAkB,EAAE,EAC1C,MAAO,OAAO,WAAWA,EAAkB,KAAK,CAAC,CAClD,GAEME,CACR,CASA,SAASG,EAAeC,EAAgD,CACvE,OAAKH,IACJA,EAAe,CACd,MAAO,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EAAiB,GAAGM,CAAI,EAAGP,EAAQ,MAAM,CAC7F,EACA,CAACC,EAAkBD,EAAQ,MAAM,CAClC,CACD,CCnCA,OAAS,WAAAQ,MAAe,QAOxB,IAAMC,EAAoB,CAACC,EAAS,WAAaF,EAAQ,IAAMG,EAAeD,CAAM,EAAG,CAACA,CAAM,CAAC,EAO/F,SAASE,EAAeC,EAAS,SAAU,CAE1C,MAAO,CADSA,EAAO,KAAK,GAAK,SAChBC,EAAc,CAAC,EAAE,KAAK,GAAG,CAC3C,CAEA,SAASA,GAAgB,CACxB,OAAO,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,UAAU,EAAG,CAAC,CACjD","names":["useSyncExternalStore","tailwindBreakpoints","breakpoints","useBreakpoint","subscribeToBreakpointChanges","getCurrentBreakpointSnapshot","useIsBelowBreakpoint","breakpoint","createBelowBreakpointSubscribe","createBelowBreakpointGetSnapshot","breakpointQueries","belowBreakpointQueries","minWidthMQLs","maxWidthMQLs","getMinWidthMQLs","getMaxWidthMQL","breakpoint","currentBreakpointValue","breakpointListeners","breakpointSubscriptionActive","getCurrentBreakpoint","mqls","tailwindBreakpoints","breakpointUpdatePending","updateCurrentBreakpoint","newBreakpoint","listener","subscribeToBreakpointChanges","callback","mql","getCurrentBreakpointSnapshot","belowBreakpointSubscribeCache","createBelowBreakpointSubscribe","cached","mediaQuery","pending","onChange","belowBreakpointSnapshotCache","createBelowBreakpointGetSnapshot","useEffect","useMemo","useRef","useCallbackRef","callback","callbackRef","args","useCallback","useEffect","useRef","useDebouncedCallback","callbackFn","options","stableCallbackFn","useCallbackRef","debounceTimerRef","useRef","useEffect","useCallback","args","useMemo","useRandomStableId","prefix","randomStableId","randomStableId","prefix","randomPostfix"]}
|
|
1
|
+
{"version":3,"sources":["../src/hooks/use-breakpoint.tsx","../src/hooks/use-callback-ref.tsx","../src/hooks/use-debounced-callback.tsx","../src/hooks/use-isomorphic-layout-effect.tsx","../src/hooks/use-prefers-reduced-motion.tsx","../src/hooks/use-random-stable-id.tsx","../src/hooks/use-scroll-behavior.tsx"],"sourcesContent":["import { useSyncExternalStore } from \"react\";\n\n/**\n * Tailwind CSS breakpoints in descending order (largest → smallest).\n *\n * These correspond to Tailwind’s default `theme.screens` config and are used\n * to determine the current viewport size.\n *\n * @see https://tailwindcss.com/docs/screens\n *\n * @example\n * \"2xl\" // ≥96rem (1536px)\n * \"xl\" // ≥80rem (1280px)\n * \"lg\" // ≥64rem (1024px)\n * \"md\" // ≥48rem (768px)\n * \"sm\" // ≥40rem (640px)\n * \"xs\" // ≥30rem (480px)\n * \"2xs\" // ≥22.5rem (360px)\n */\nconst tailwindBreakpoints = [\"2xl\", \"xl\", \"lg\", \"md\", \"sm\", \"xs\", \"2xs\"] as const;\n\n/**\n * A valid Tailwind CSS breakpoint identifier.\n *\n * @example\n * const bp: TailwindBreakpoint = \"md\"; // ≥48rem (768px)\n *\n * @example\n * \"2xl\" // ≥96rem (1536px)\n * \"xl\" // ≥80rem (1280px)\n * \"lg\" // ≥64rem (1024px)\n * \"md\" // ≥48rem (768px)\n * \"sm\" // ≥40rem (640px)\n * \"xs\" // ≥30rem (480px)\n * \"2xs\" // ≥22.5rem (360px)\n */\ntype TailwindBreakpoint = (typeof tailwindBreakpoints)[number];\n\n/**\n * Mantle’s breakpoint set, extending Tailwind’s with `\"default\"`.\n *\n * `\"default\"` represents the base (0px and up) viewport,\n * useful for defining fallbacks or mobile-first styles.\n *\n * @example\n * \"default\" // ≥0rem (0px)\n * \"2xs\" // ≥22.5rem (360px)\n * \"xs\" // ≥30rem (480px)\n * \"sm\" // ≥40rem (640px)\n * \"md\" // ≥48rem (768px)\n * \"lg\" // ≥64rem (1024px)\n * \"xl\" // ≥80rem (1280px)\n * \"2xl\" // ≥96rem (1536px)\n */\nconst breakpoints = [\"default\", ...tailwindBreakpoints] as const;\n\n/**\n * A valid Mantle breakpoint identifier.\n *\n * Includes Tailwind’s standard breakpoints plus `\"default\"` for 0px+.\n *\n * @example\n * const bp: Breakpoint = \"default\"; // ≥0px\n *\n * @example\n * \"default\" // ≥0rem (0px)\n * \"2xs\" // ≥22.5rem (360px)\n * \"xs\" // ≥30rem (480px)\n * \"sm\" // ≥40rem (640px)\n * \"md\" // ≥48rem (768px)\n * \"lg\" // ≥64rem (1024px)\n * \"xl\" // ≥80rem (1280px)\n * \"2xl\" // ≥96rem (1536px)\n */\ntype Breakpoint = (typeof breakpoints)[number];\n\n/**\n * React hook that returns the current breakpoint based on the viewport width.\n *\n * Uses a singleton subscription to a set of min-width media queries and returns\n * the largest matching breakpoint. Designed for React 18+ with\n * `useSyncExternalStore`.\n *\n * @returns {Breakpoint} The current breakpoint that matches the viewport width.\n *\n * @example\n * const breakpoint = useBreakpoint();\n * if (breakpoint === \"lg\") {\n * // Do something for large screens and above\n * }\n */\nfunction useBreakpoint(): Breakpoint {\n\treturn useSyncExternalStore(\n\t\tsubscribeToBreakpointChanges,\n\t\tgetCurrentBreakpointSnapshot,\n\t\t() => \"default\", // SSR fallback\n\t);\n}\n\n/**\n * React hook that returns true if the current viewport width is below the specified breakpoint.\n *\n * This hook uses `window.matchMedia` with a max-width media query and leverages\n * `useSyncExternalStore` to stay compliant with React's concurrent rendering model.\n *\n * @param {TailwindBreakpoint} breakpoint - The breakpoint to check against (e.g., \"md\", \"lg\").\n *\n * @returns {boolean} `true` if the viewport width is below the breakpoint, otherwise `false`.\n *\n * @example\n * // Check if viewport is below medium (768px)\n * const isBelowMd = useIsBelowBreakpoint(\"md\");\n */\nfunction useIsBelowBreakpoint(breakpoint: TailwindBreakpoint): boolean {\n\treturn useSyncExternalStore(\n\t\tcreateBelowBreakpointSubscribe(breakpoint),\n\t\tcreateBelowBreakpointGetSnapshot(breakpoint),\n\t\t() => false, // SSR fallback - assume desktop\n\t);\n}\n\nexport {\n\t//,\n\tbreakpoints,\n\tuseBreakpoint,\n\tuseIsBelowBreakpoint,\n};\n\nexport type {\n\t//,\n\tBreakpoint,\n\tTailwindBreakpoint,\n};\n\n/**\n * A CSS media query string representing a minimum width in `rem` units.\n *\n * @example\n * const query: MinWidthQuery = \"(min-width: 48rem)\";\n *\n * @private\n */\ntype MinWidthQuery = `(min-width: ${number}rem)`;\n\n/**\n * A CSS media query string representing a maximum width in `rem` units.\n *\n * @example\n * const query: MaxWidthQuery = \"(max-width: 47.99rem)\";\n *\n * @private\n */\ntype MaxWidthQuery = `(max-width: ${number}rem)`;\n\n/**\n * Precomputed min-width media query strings for each Tailwind breakpoint.\n *\n * Using constants avoids template string work in hot paths and ensures type\n * safety against the `MinWidthQuery` template literal type.\n *\n * @remarks\n * These are expressed in `rem`. If your CSS breakpoints are in `px`, consider\n * aligning units to avoid JS/CSS drift when `html{font-size}` changes.\n *\n * @private\n */\nconst breakpointQueries = {\n\t\"2xl\": \"(min-width: 96rem)\" as const,\n\txl: \"(min-width: 80rem)\" as const,\n\tlg: \"(min-width: 64rem)\" as const,\n\tmd: \"(min-width: 48rem)\" as const,\n\tsm: \"(min-width: 40rem)\" as const,\n\txs: \"(min-width: 30rem)\" as const,\n\t\"2xs\": \"(min-width: 22.5rem)\" as const,\n} as const satisfies Record<TailwindBreakpoint, MinWidthQuery>;\n\n/**\n * Precomputed max-width media query strings used by `useIsBelowBreakpoint`.\n *\n * The `-0.01rem` offset avoids overlap at exact boundaries.\n *\n * @private\n */\nconst belowBreakpointQueries = {\n\t\"2xl\": \"(max-width: 95.99rem)\" as const, // 96 - 0.01\n\txl: \"(max-width: 79.99rem)\" as const, // 80 - 0.01\n\tlg: \"(max-width: 63.99rem)\" as const, // 64 - 0.01\n\tmd: \"(max-width: 47.99rem)\" as const, // 48 - 0.01\n\tsm: \"(max-width: 39.99rem)\" as const, // 40 - 0.01\n\txs: \"(max-width: 29.99rem)\" as const, // 30 - 0.01\n\t\"2xs\": \"(max-width: 22.49rem)\" as const, // 22.5 - 0.01\n} as const satisfies Record<TailwindBreakpoint, MaxWidthQuery>;\n\n/**\n * Lazily-initialized cache of `MediaQueryList` objects for min-width queries.\n *\n * Initialized on first access to remain SSR-safe (no `window` at import time).\n *\n * @private\n */\nlet minWidthMQLs: Record<TailwindBreakpoint, MediaQueryList> | null = null;\n\n/**\n * Lazily-initialized cache of `MediaQueryList` objects for max-width queries.\n *\n * Used by `useIsBelowBreakpoint`. Also SSR-safe by lazy access.\n *\n * @private\n */\nlet maxWidthMQLs: Record<TailwindBreakpoint, MediaQueryList> | null = null;\n\n/**\n * Get (and lazily create) the cached `MediaQueryList` objects for min-width queries.\n *\n * @returns A record of `MediaQueryList` keyed by Tailwind breakpoint.\n * @private\n */\nfunction getMinWidthMQLs(): Record<TailwindBreakpoint, MediaQueryList> {\n\tif (!minWidthMQLs) {\n\t\tminWidthMQLs = {\n\t\t\t\"2xl\": window.matchMedia(breakpointQueries[\"2xl\"]),\n\t\t\txl: window.matchMedia(breakpointQueries.xl),\n\t\t\tlg: window.matchMedia(breakpointQueries.lg),\n\t\t\tmd: window.matchMedia(breakpointQueries.md),\n\t\t\tsm: window.matchMedia(breakpointQueries.sm),\n\t\t\txs: window.matchMedia(breakpointQueries.xs),\n\t\t\t\"2xs\": window.matchMedia(breakpointQueries[\"2xs\"]),\n\t\t};\n\t}\n\treturn minWidthMQLs;\n}\n\n/**\n * Get (and lazily create) the cached `MediaQueryList` for a specific max-width breakpoint.\n *\n * @param breakpoint - Tailwind breakpoint identifier (e.g., \"md\").\n * @returns The corresponding `MediaQueryList`.\n * @private\n */\nfunction getMaxWidthMQL(breakpoint: TailwindBreakpoint): MediaQueryList {\n\tif (!maxWidthMQLs) {\n\t\tmaxWidthMQLs = {\n\t\t\t\"2xl\": window.matchMedia(belowBreakpointQueries[\"2xl\"]),\n\t\t\txl: window.matchMedia(belowBreakpointQueries.xl),\n\t\t\tlg: window.matchMedia(belowBreakpointQueries.lg),\n\t\t\tmd: window.matchMedia(belowBreakpointQueries.md),\n\t\t\tsm: window.matchMedia(belowBreakpointQueries.sm),\n\t\t\txs: window.matchMedia(belowBreakpointQueries.xs),\n\t\t\t\"2xs\": window.matchMedia(belowBreakpointQueries[\"2xs\"]),\n\t\t};\n\t}\n\treturn maxWidthMQLs[breakpoint];\n}\n\n/**\n * Current breakpoint value used by the singleton store backing `useBreakpoint`.\n *\n * Initialized to `\"default\"` and updated on media-query change events.\n *\n * @private\n */\nlet currentBreakpointValue: Breakpoint = \"default\";\n\n/**\n * Set of component listeners subscribed to the singleton breakpoint store.\n *\n * Each listener is invoked when the current breakpoint value changes.\n *\n * @private\n */\nconst breakpointListeners = new Set<() => void>();\n\n/**\n * Flag indicating whether global media-query listeners are currently attached.\n *\n * Prevents duplicate registrations and enables full teardown when unused.\n *\n * @private\n */\nlet breakpointSubscriptionActive = false;\n\n/**\n * Compute the current breakpoint by checking cached min-width MQLs\n * from largest to smallest.\n *\n * @returns {Breakpoint} The largest matching breakpoint, or `\"default\"`.\n * @private\n */\nfunction getCurrentBreakpoint(): Breakpoint {\n\tconst mqls = getMinWidthMQLs();\n\tfor (const breakpoint of tailwindBreakpoints) {\n\t\tif (mqls[breakpoint].matches) {\n\t\t\treturn breakpoint;\n\t\t}\n\t}\n\treturn \"default\";\n}\n\n/**\n * Update the current breakpoint value and notify all listeners.\n *\n * Uses `requestAnimationFrame` to coalesce rapid resize events and minimize\n * re-renders during active window resizing.\n *\n * @private\n */\nlet breakpointUpdatePending = false;\nfunction updateCurrentBreakpoint() {\n\tif (!breakpointUpdatePending) {\n\t\tbreakpointUpdatePending = true;\n\t\trequestAnimationFrame(() => {\n\t\t\tbreakpointUpdatePending = false;\n\t\t\tconst newBreakpoint = getCurrentBreakpoint();\n\t\t\tif (newBreakpoint !== currentBreakpointValue) {\n\t\t\t\tcurrentBreakpointValue = newBreakpoint;\n\t\t\t\tfor (const listener of breakpointListeners) {\n\t\t\t\t\tlistener();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}\n\n/**\n * Subscribe a component to breakpoint changes (singleton pattern).\n *\n * Ensures only one set of MQL listeners exists app-wide. Also reconciles the\n * `useSyncExternalStore` initial snapshot/subscribe race by invoking the\n * subscriber once on mount.\n *\n * @param callback - Listener invoked when the breakpoint value may have changed.\n * @returns Cleanup function to unsubscribe the listener.\n * @private\n */\nfunction subscribeToBreakpointChanges(callback: () => void) {\n\tbreakpointListeners.add(callback);\n\n\t// Attach global listeners once\n\tif (!breakpointSubscriptionActive) {\n\t\tbreakpointSubscriptionActive = true;\n\t\tconst mqls = getMinWidthMQLs();\n\n\t\t// Initialize current value synchronously\n\t\tcurrentBreakpointValue = getCurrentBreakpoint();\n\n\t\t// Attach listeners to all breakpoint MQLs\n\t\tfor (const mql of Object.values(mqls)) {\n\t\t\tmql.addEventListener(\"change\", updateCurrentBreakpoint);\n\t\t}\n\t}\n\n\t// Reconcile initial getSnapshot vs subscribe ordering\n\tcallback();\n\n\t// Cleanup\n\treturn () => {\n\t\tbreakpointListeners.delete(callback);\n\n\t\t// Tear down global listeners when no one is listening\n\t\tif (breakpointListeners.size === 0 && breakpointSubscriptionActive) {\n\t\t\tbreakpointSubscriptionActive = false;\n\t\t\tconst mqls = getMinWidthMQLs();\n\t\t\tfor (const mql of Object.values(mqls)) {\n\t\t\t\tmql.removeEventListener(\"change\", updateCurrentBreakpoint);\n\t\t\t}\n\t\t}\n\t};\n}\n\n/**\n * Return the current breakpoint value from the singleton store.\n *\n * Used as the `getSnapshot` for `useSyncExternalStore`.\n *\n * @returns {Breakpoint} The latest computed breakpoint.\n * @private\n */\nfunction getCurrentBreakpointSnapshot(): Breakpoint {\n\treturn currentBreakpointValue;\n}\n\n/**\n * Cached `subscribe` functions keyed by breakpoint.\n *\n * Without caching, `useSyncExternalStore` receives a new function reference on\n * every render, causing it to tear down and re-attach the MQL listener each\n * time — the primary source of resize sluggishness.\n *\n * @private\n */\nconst belowBreakpointSubscribeCache = new Map<\n\tTailwindBreakpoint,\n\t(callback: () => void) => () => void\n>();\n\n/**\n * Get (or create and cache) a `subscribe` function for a specific \"below\" breakpoint.\n *\n * Uses a cached `MediaQueryList` and rAF-throttled change handler to avoid\n * bursty updates during resize.\n *\n * @param breakpoint - Tailwind breakpoint identifier (e.g., \"lg\").\n * @returns A stable `subscribe` function suitable for `useSyncExternalStore`.\n * @private\n */\nfunction createBelowBreakpointSubscribe(breakpoint: TailwindBreakpoint) {\n\tlet cached = belowBreakpointSubscribeCache.get(breakpoint);\n\tif (cached) {\n\t\treturn cached;\n\t}\n\n\tcached = (callback: () => void) => {\n\t\tconst mediaQuery = getMaxWidthMQL(breakpoint);\n\n\t\t// rAF throttle the change callback during active resize\n\t\tlet pending = false;\n\t\tconst onChange = () => {\n\t\t\tif (!pending) {\n\t\t\t\tpending = true;\n\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\tpending = false;\n\t\t\t\t\tcallback();\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\tmediaQuery.addEventListener(\"change\", onChange);\n\t\treturn () => {\n\t\t\tmediaQuery.removeEventListener(\"change\", onChange);\n\t\t};\n\t};\n\n\tbelowBreakpointSubscribeCache.set(breakpoint, cached);\n\treturn cached;\n}\n\n/**\n * Cached `getSnapshot` functions keyed by breakpoint.\n *\n * Ensures `useSyncExternalStore` receives a referentially stable function,\n * preventing unnecessary subscription churn.\n *\n * @private\n */\nconst belowBreakpointSnapshotCache = new Map<TailwindBreakpoint, () => boolean>();\n\n/**\n * Get (or create and cache) a `getSnapshot` function for a specific \"below\" breakpoint.\n *\n * Uses the cached `MediaQueryList` for the target breakpoint.\n *\n * @param breakpoint - Tailwind breakpoint identifier (e.g., \"lg\").\n * @returns A stable function that returns `true` when the viewport is below the breakpoint.\n * @private\n */\nfunction createBelowBreakpointGetSnapshot(breakpoint: TailwindBreakpoint) {\n\tlet cached = belowBreakpointSnapshotCache.get(breakpoint);\n\tif (cached) {\n\t\treturn cached;\n\t}\n\n\tcached = () => {\n\t\tconst mediaQuery = getMaxWidthMQL(breakpoint);\n\t\treturn mediaQuery.matches;\n\t};\n\n\tbelowBreakpointSnapshotCache.set(breakpoint, cached);\n\treturn cached;\n}\n","import { useEffect, useMemo, useRef } from \"react\";\n\n/**\n * Returns a memoized callback that will always refer to the latest callback\n * passed to the hook.\n *\n * This is useful when you want to pass a callback which may or may not be\n * memoized (have a stable identity) to a child component that will be updated\n * without causing the child component to re-render.\n */\nfunction useCallbackRef<T extends (...args: unknown[]) => unknown>(callback: T | undefined): T {\n\tconst callbackRef = useRef(callback);\n\n\tuseEffect(() => {\n\t\tcallbackRef.current = callback;\n\t});\n\n\treturn useMemo(() => ((...args) => callbackRef.current?.(...args)) as T, []);\n}\n\nexport {\n\t//,\n\tuseCallbackRef,\n};\n","import { useCallback, useEffect, useRef } from \"react\";\nimport { useCallbackRef } from \"./use-callback-ref.js\";\n\ntype Options = {\n\t/**\n\t * The delay in milliseconds to wait before calling the callback.\n\t */\n\twaitMs: number;\n};\n\n/**\n * Create a debounced version of a callback function.\n *\n * It allows you to delay the execution of a function until a certain period of\n * inactivity has passed (the `options.waitMs`), which can be useful for limiting rapid\n * invocations of a function (like in search inputs or button clicks)\n *\n * Note: The debounced callback will always refer to the latest callback passed\n * even without memoization, so it's stable and safe to use in dependency arrays.\n */\nfunction useDebouncedCallback<T extends (...args: unknown[]) => unknown>(\n\tcallbackFn: T,\n\toptions: Options,\n) {\n\tconst stableCallbackFn = useCallbackRef(callbackFn);\n\tconst debounceTimerRef = useRef(0);\n\tuseEffect(() => () => window.clearTimeout(debounceTimerRef.current), []);\n\n\treturn useCallback(\n\t\t(...args: Parameters<T>) => {\n\t\t\twindow.clearTimeout(debounceTimerRef.current);\n\t\t\tdebounceTimerRef.current = window.setTimeout(() => stableCallbackFn(...args), options.waitMs);\n\t\t},\n\t\t[stableCallbackFn, options.waitMs],\n\t);\n}\n\nexport {\n\t//,\n\tuseDebouncedCallback,\n};\n","import { useEffect, useLayoutEffect } from \"react\";\n\n/**\n * useIsomorphicLayoutEffect is a hook that uses useLayoutEffect on the client and useEffect on the server.\n */\nexport const useIsomorphicLayoutEffect =\n\ttypeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n","import { useEffect, useState } from \"react\";\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 * Returns `true` when the user has opted out of animations (i.e., prefers reduced motion).\n *\n * Implementation notes:\n * - Uses the `(prefers-reduced-motion: no-preference)` media query and inverts it.\n * This keeps the “default” mental model explicit: if the system hasn’t opted out,\n * animations are allowed.\n * - Defaults to `true` on the server to avoid animating before hydration. The initial\n * client effect reads the *real* preference and updates state.\n *\n * @example\n * // Conditionally shorten or skip transitions\n * const reduce = usePrefersReducedMotion();\n * const duration = reduce ? 0 : 200;\n *\n * @remarks\n * If you need to support very old browsers that lack `MediaQueryList.addEventListener`,\n * consider falling back to `addListener/removeListener`.\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(!mediaQueryList.matches);\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","import { useMemo } from \"react\";\n\n/**\n * Hook to generate a random, stable id.\n * This is similar to `useId`, but generates a stable id client side which can also\n * be used for css selectors and element ids.\n */\nconst useRandomStableId = (prefix = \"mantle\") => useMemo(() => randomStableId(prefix), [prefix]);\n\nexport {\n\t//,\n\tuseRandomStableId,\n};\n\nfunction randomStableId(prefix = \"mantle\") {\n\tconst _prefix = prefix.trim() || \"mantle\";\n\treturn [_prefix, randomPostfix()].join(\"-\");\n}\n\nfunction randomPostfix() {\n\treturn Math.random().toString(36).substring(2, 9);\n}\n","import { useMemo } from \"react\";\nimport { usePrefersReducedMotion } from \"./use-prefers-reduced-motion.js\";\n\n/**\n * `scroll-behavior` values:\n *\n * - `\"auto\"` — scrolling happens instantly (no animation).\n * - `\"smooth\"` — scrolling animates smoothly using a user-agent–defined easing and duration.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-behavior#values\n */\ntype ScrollBehavior = \"auto\" | \"smooth\";\n\n/**\n * Returns a `ScrollBehavior` that respects the user's motion preference via `usePrefersReducedMotion`.\n *\n * - When `usePrefersReducedMotion()` is `true`, returns `\"auto\"` (no animated scroll).\n * - Otherwise returns `\"smooth\"`.\n *\n * Use this with `window.scrollTo`, `Element.scrollIntoView`, etc. It prevents\n * smooth-scrolling for users who opt out of motion and avoids SSR “first paint”\n * animations thanks to the hook’s conservative server default.\n *\n * @example\n * // Scroll to top\n * const behavior = useScrollBehavior();\n * window.scrollTo({ top: 0, behavior });\n *\n * @example\n * // Bring a section into view\n * const behavior = useScrollBehavior();\n * sectionRef.current?.scrollIntoView({ behavior, block: \"start\" });\n *\n * @see {@link usePrefersReducedMotion}\n * @see CSS `scroll-behavior` property (values: `\"auto\"`, `\"smooth\"`).\n */\nexport function useScrollBehavior(): ScrollBehavior {\n\tconst prefersReducedMotion = usePrefersReducedMotion();\n\n\treturn useMemo(() => (prefersReducedMotion ? \"auto\" : \"smooth\"), [prefersReducedMotion]);\n}\n"],"mappings":"wHAAA,OAAS,wBAAAA,MAA4B,QAmBrC,IAAMC,EAAsB,CAAC,MAAO,KAAM,KAAM,KAAM,KAAM,KAAM,KAAK,EAmCjEC,EAAc,CAAC,UAAW,GAAGD,CAAmB,EAqCtD,SAASE,GAA4B,CACpC,OAAOH,EACNI,EACAC,EACA,IAAM,SACP,CACD,CAgBA,SAASC,EAAqBC,EAAyC,CACtE,OAAOP,EACNQ,EAA+BD,CAAU,EACzCE,EAAiCF,CAAU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CACZD,EAAe,oBAAoB,SAAUC,CAAQ,CACtD,CACD,EAAG,CAAC,CAAC,EAEEH,CACR,CCnDA,OAAS,WAAAK,MAAe,QAOxB,IAAMC,EAAoB,CAACC,EAAS,WAAaF,EAAQ,IAAMG,EAAeD,CAAM,EAAG,CAACA,CAAM,CAAC,EAO/F,SAASE,EAAeC,EAAS,SAAU,CAE1C,MAAO,CADSA,EAAO,KAAK,GAAK,SAChBC,EAAc,CAAC,EAAE,KAAK,GAAG,CAC3C,CAEA,SAASA,GAAgB,CACxB,OAAO,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,UAAU,EAAG,CAAC,CACjD,CCrBA,OAAS,WAAAC,MAAe,QAoCjB,SAASC,GAAoC,CACnD,IAAMC,EAAuBC,EAAwB,EAErD,OAAOC,EAAQ,IAAOF,EAAuB,OAAS,SAAW,CAACA,CAAoB,CAAC,CACxF","names":["useSyncExternalStore","tailwindBreakpoints","breakpoints","useBreakpoint","subscribeToBreakpointChanges","getCurrentBreakpointSnapshot","useIsBelowBreakpoint","breakpoint","createBelowBreakpointSubscribe","createBelowBreakpointGetSnapshot","breakpointQueries","belowBreakpointQueries","minWidthMQLs","maxWidthMQLs","getMinWidthMQLs","getMaxWidthMQL","breakpoint","currentBreakpointValue","breakpointListeners","breakpointSubscriptionActive","getCurrentBreakpoint","mqls","tailwindBreakpoints","breakpointUpdatePending","updateCurrentBreakpoint","newBreakpoint","listener","subscribeToBreakpointChanges","callback","mql","getCurrentBreakpointSnapshot","belowBreakpointSubscribeCache","createBelowBreakpointSubscribe","cached","mediaQuery","pending","onChange","belowBreakpointSnapshotCache","createBelowBreakpointGetSnapshot","useEffect","useMemo","useRef","useCallbackRef","callback","callbackRef","args","useCallback","useEffect","useRef","useDebouncedCallback","callbackFn","options","stableCallbackFn","useCallbackRef","debounceTimerRef","useRef","useEffect","useCallback","args","useEffect","useLayoutEffect","useIsomorphicLayoutEffect","useEffect","useState","query","usePrefersReducedMotion","prefersReducedMotion","setPrefersReducedMotion","mediaQueryList","listener","event","useMemo","useRandomStableId","prefix","randomStableId","randomStableId","prefix","randomPostfix","useMemo","useScrollBehavior","prefersReducedMotion","usePrefersReducedMotion","useMemo"]}
|