@ngrok/mantle 0.32.3 → 0.40.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 +72 -61
- package/dist/accordion.js +1 -1
- package/dist/accordion.js.map +1 -1
- package/dist/alert-dialog.d.ts +311 -462
- package/dist/alert-dialog.js +1 -1
- package/dist/alert-dialog.js.map +1 -1
- package/dist/alert.d.ts +113 -92
- package/dist/alert.js +1 -1
- package/dist/alert.js.map +1 -1
- package/dist/card.d.ts +112 -112
- package/dist/card.js +1 -1
- package/dist/card.js.map +1 -1
- package/dist/{chunk-IVXZIYX4.js → chunk-2ID2TLYD.js} +1 -1
- package/dist/chunk-2ID2TLYD.js.map +1 -0
- package/dist/{chunk-3X4AKTRA.js → chunk-4GGDPFNZ.js} +2 -2
- package/dist/chunk-4GGDPFNZ.js.map +1 -0
- package/dist/{chunk-ERBZR6SY.js → chunk-EYZYDUS2.js} +1 -1
- package/dist/chunk-EYZYDUS2.js.map +1 -0
- package/dist/chunk-F4N3P7B7.js +2 -0
- package/dist/chunk-F4N3P7B7.js.map +1 -0
- package/dist/{chunk-CGUSOD4E.js → chunk-HSTG2BTX.js} +1 -1
- package/dist/chunk-HSTG2BTX.js.map +1 -0
- package/dist/chunk-UUXOG7WW.js +2 -0
- package/dist/chunk-UUXOG7WW.js.map +1 -0
- package/dist/code-block.d.ts +188 -178
- package/dist/code-block.js +3 -3
- package/dist/code-block.js.map +1 -1
- package/dist/combobox.d.ts +178 -141
- package/dist/combobox.js +1 -1
- package/dist/combobox.js.map +1 -1
- package/dist/data-table.d.ts +191 -30
- package/dist/data-table.js +1 -1
- package/dist/data-table.js.map +1 -1
- package/dist/dialog.d.ts +374 -264
- package/dist/dialog.js +1 -1
- package/dist/dialog.js.map +1 -1
- package/dist/dropdown-menu.d.ts +304 -102
- package/dist/dropdown-menu.js +1 -1
- package/dist/dropdown-menu.js.map +1 -1
- package/dist/hover-card.d.ts +94 -58
- package/dist/hover-card.js +1 -1
- package/dist/hover-card.js.map +1 -1
- package/dist/icons.js +1 -1
- package/dist/input.d.ts +11 -0
- package/dist/input.js +1 -1
- package/dist/media-object.d.ts +75 -46
- package/dist/media-object.js +1 -1
- package/dist/media-object.js.map +1 -1
- package/dist/pagination.d.ts +124 -62
- package/dist/pagination.js +1 -1
- package/dist/pagination.js.map +1 -1
- package/dist/popover.d.ts +124 -102
- package/dist/popover.js +1 -1
- package/dist/popover.js.map +1 -1
- package/dist/progress.d.ts +112 -35
- package/dist/progress.js +1 -1
- package/dist/progress.js.map +1 -1
- package/dist/radio-group.d.ts +234 -105
- package/dist/radio-group.js +1 -1
- package/dist/radio-group.js.map +1 -1
- package/dist/select.d.ts +242 -212
- package/dist/select.js +1 -1
- package/dist/sheet.d.ts +343 -575
- package/dist/sheet.js +1 -1
- package/dist/sheet.js.map +1 -1
- package/dist/table.d.ts +384 -425
- package/dist/table.js +1 -1
- package/dist/tabs.d.ts +105 -95
- package/dist/tabs.js +1 -1
- package/dist/tabs.js.map +1 -1
- package/dist/theme-provider.js +1 -1
- package/dist/toast.d.ts +77 -61
- package/dist/toast.js +1 -1
- package/dist/tooltip.d.ts +72 -49
- package/dist/tooltip.js +1 -1
- package/dist/tooltip.js.map +1 -1
- package/package.json +4 -5
- package/dist/chunk-3X4AKTRA.js.map +0 -1
- package/dist/chunk-CGUSOD4E.js.map +0 -1
- package/dist/chunk-ERBZR6SY.js.map +0 -1
- package/dist/chunk-IDCDPWR4.js +0 -2
- package/dist/chunk-IDCDPWR4.js.map +0 -1
- package/dist/chunk-IVXZIYX4.js.map +0 -1
- package/dist/chunk-JIRNFNH5.js +0 -2
- package/dist/chunk-JIRNFNH5.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/dropdown-menu/dropdown-menu.tsx"],"sourcesContent":["import { CaretRightIcon } from \"@phosphor-icons/react/CaretRight\";\nimport { CheckIcon } from \"@phosphor-icons/react/Check\";\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport type { ComponentPropsWithoutRef, ComponentRef } from \"react\";\nimport { forwardRef } from \"react\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { Icon } from \"../icon/icon.js\";\nimport { Separator } from \"../separator/separator.js\";\n\n/**\n * A menu of options or actions, triggered by a button.\n * This is the root, stateful component that manages the open/closed state of the dropdown menu.\n *\n * @see https://mantle.ngrok.com/components/dropdown-menu#api-dropdown-menu\n *\n * @example\n * ```tsx\n * <DropdownMenu>\n * <DropdownMenuTrigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Open Menu\n * </Button>\n * </DropdownMenuTrigger>\n * <DropdownMenuContent>\n * <DropdownMenuItem>Item 1</DropdownMenuItem>\n * <DropdownMenuItem>Item 2</DropdownMenuItem>\n * </DropdownMenuContent>\n * </DropdownMenu>\n * ```\n */\nconst DropdownMenu = DropdownMenuPrimitive.Root;\nDropdownMenu.displayName = \"DropdownMenu\";\n\n/**\n * The trigger button that opens the dropdown menu.\n *\n * @see https://mantle.ngrok.com/components/dropdown-menu#api-dropdown-menu-trigger\n *\n * @example\n * ```tsx\n * <DropdownMenu>\n * <DropdownMenuTrigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Open Menu\n * </Button>\n * </DropdownMenuTrigger>\n * <DropdownMenuContent>\n * <DropdownMenuItem>Item 1</DropdownMenuItem>\n * </DropdownMenuContent>\n * </DropdownMenu>\n * ```\n */\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\nDropdownMenuTrigger.displayName = \"DropdownMenuTrigger\";\n\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\nDropdownMenuGroup.displayName = \"DropdownMenuGroup\";\n\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\nDropdownMenuPortal.displayName = \"DropdownMenuPortal\";\n\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\nDropdownMenuSub.displayName = \"DropdownMenuSub\";\n\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\nDropdownMenuRadioGroup.displayName = \"DropdownMenuRadioGroup\";\n\nconst DropdownMenuSubTrigger = forwardRef<\n\tComponentRef<typeof DropdownMenuPrimitive.SubTrigger>,\n\tComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n\t\tinset?: boolean;\n\t}\n>(({ className, inset, children, ...props }, ref) => (\n\t<DropdownMenuPrimitive.SubTrigger\n\t\tclassName={cx(\n\t\t\t\"focus:bg-accent data-state-open:bg-accent relative flex cursor-pointer select-none items-center rounded py-1.5 pl-2 pr-9 text-sm outline-none\",\n\t\t\t\"data-highlighted:bg-popover-hover data-state-open:bg-popover-hover\",\n\t\t\t\"[&>svg]:size-5 [&_svg]:shrink-0\",\n\t\t\tinset && \"pl-8\",\n\t\t\tclassName,\n\t\t)}\n\t\tref={ref}\n\t\t{...props}\n\t>\n\t\t{children}\n\t\t<span className=\"absolute right-2 flex items-center\">\n\t\t\t<Icon svg={<CaretRightIcon weight=\"bold\" />} className=\"size-4\" />\n\t\t</span>\n\t</DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName = \"DropdownMenuSubTrigger\";\n\nconst DropdownMenuSubContent = forwardRef<\n\tComponentRef<typeof DropdownMenuPrimitive.SubContent>,\n\tComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, loop = true, ...props }, ref) => (\n\t<DropdownMenuPortal>\n\t\t<DropdownMenuPrimitive.SubContent\n\t\t\tclassName={cx(\n\t\t\t\t\"scrollbar\",\n\t\t\t\t\"text-popover-foreground border-popover bg-popover p-1.25 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-md border shadow-xl\",\n\t\t\t\t\"my-2 max-h-[calc(var(--radix-dropdown-menu-content-available-height)_-_16px)] overflow-auto\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tloop={loop}\n\t\t\tref={ref}\n\t\t\t{...props}\n\t\t/>\n\t</DropdownMenuPortal>\n));\nDropdownMenuSubContent.displayName = \"DropdownMenuSubContent\";\n\ntype DropdownMenuContentProps = ComponentPropsWithoutRef<\n\ttypeof DropdownMenuPrimitive.Content\n> & {\n\t/**\n\t * Whether the DropdownMenuContent should match the width of the trigger or use the intrinsic content width.\n\t */\n\twidth?: \"trigger\" | \"content\";\n};\n\n/**\n * The container for the dropdown menu content.\n *\n * @see https://mantle.ngrok.com/components/dropdown-menu#api-dropdown-menu-content\n *\n * @example\n * ```tsx\n * <DropdownMenu>\n * <DropdownMenuTrigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Open Menu\n * </Button>\n * </DropdownMenuTrigger>\n * <DropdownMenuContent>\n * <DropdownMenuItem>Item 1</DropdownMenuItem>\n * <DropdownMenuItem>Item 2</DropdownMenuItem>\n * </DropdownMenuContent>\n * </DropdownMenu>\n * ```\n */\nconst DropdownMenuContent = forwardRef<\n\tComponentRef<typeof DropdownMenuPrimitive.Content>,\n\tDropdownMenuContentProps\n>(({ className, onClick, loop = true, width, ...props }, ref) => (\n\t<DropdownMenuPortal>\n\t\t<DropdownMenuPrimitive.Content\n\t\t\tref={ref}\n\t\t\tclassName={cx(\n\t\t\t\t\"scrollbar\",\n\t\t\t\t\"text-popover-foreground border-popover bg-popover p-1.25 z-50 min-w-[8rem] overflow-hidden rounded-md border shadow-xl outline-none\",\n\t\t\t\t\"data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95\",\n\t\t\t\t\"my-2 max-h-[calc(var(--radix-dropdown-menu-content-available-height)_-_16px)] overflow-auto\",\n\t\t\t\twidth === \"trigger\" && \"w-[var(--radix-dropdown-menu-trigger-width)]\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tloop={loop}\n\t\t\tonClick={(event) => {\n\t\t\t\t/**\n\t\t\t\t * Prevent the click event from propagating up to parent/containing elements\n\t\t\t\t * of the DropdownMenu\n\t\t\t\t */\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tonClick?.(event);\n\t\t\t}}\n\t\t\t{...props}\n\t\t/>\n\t</DropdownMenuPortal>\n));\nDropdownMenuContent.displayName = \"DropdownMenuContent\";\n\n/**\n * An item in the dropdown menu.\n *\n * @see https://mantle.ngrok.com/components/dropdown-menu#api-dropdown-menu-item\n *\n * @example\n * ```tsx\n * <DropdownMenu>\n * <DropdownMenuTrigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Open Menu\n * </Button>\n * </DropdownMenuTrigger>\n * <DropdownMenuContent>\n * <DropdownMenuItem>Item 1</DropdownMenuItem>\n * <DropdownMenuItem>Item 2</DropdownMenuItem>\n * </DropdownMenuContent>\n * </DropdownMenu>\n * ```\n */\nconst DropdownMenuItem = forwardRef<\n\tComponentRef<typeof DropdownMenuPrimitive.Item>,\n\tComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n\t\tinset?: boolean;\n\t}\n>(({ className, inset, ...props }, ref) => (\n\t<DropdownMenuPrimitive.Item\n\t\tref={ref}\n\t\tclassName={cx(\n\t\t\t\"focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-popover-hover data-active-item:dark:bg-popover-hover relative flex cursor-pointer select-none items-center rounded px-2 py-1.5 text-sm font-normal outline-none transition-colors\",\n\t\t\t\"[&>svg]:size-5 [&_svg]:shrink-0\",\n\t\t\tinset && \"pl-8\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nDropdownMenuItem.displayName = \"DropdownMenuItem\";\n\nconst DropdownMenuCheckboxItem = forwardRef<\n\tComponentRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n\tComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n\t<DropdownMenuPrimitive.CheckboxItem\n\t\tref={ref}\n\t\tclassName={cx(\n\t\t\t\"text-strong data-disabled:pointer-events-none data-disabled:opacity-50 relative flex cursor-pointer select-none items-center gap-2 rounded py-1.5 pl-2 pr-9 text-sm font-normal outline-none\",\n\t\t\t\"data-highlighted:bg-popover-hover data-highlighted:dark:bg-popover-hover\",\n\t\t\t\"aria-checked:!bg-filled-accent aria-checked:text-on-filled aria-checked:font-medium\",\n\t\t\t\"[&>svg]:size-5 [&_svg]:shrink-0\",\n\t\t\tclassName,\n\t\t)}\n\t\tchecked={checked}\n\t\t{...props}\n\t>\n\t\t<span className=\"absolute right-2 flex items-center\">\n\t\t\t<DropdownMenuPrimitive.ItemIndicator>\n\t\t\t\t<Icon svg={<CheckIcon weight=\"bold\" />} className=\"size-4\" />\n\t\t\t</DropdownMenuPrimitive.ItemIndicator>\n\t\t</span>\n\t\t{children}\n\t</DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName = \"DropdownMenuCheckboxItem\";\n\ntype DropdownMenuRadioItemProps = ComponentPropsWithoutRef<\n\ttypeof DropdownMenuPrimitive.RadioItem\n> & {\n\tname?: string;\n\tid?: string;\n};\n\nconst DropdownMenuRadioItem = forwardRef<\n\tComponentRef<\"input\">,\n\tDropdownMenuRadioItemProps\n>(({ className, children, ...props }, ref) => (\n\t<DropdownMenuPrimitive.RadioItem\n\t\tclassName={cx(\n\t\t\t\"group/dropdown-menu-radio-item\",\n\t\t\t\"text-strong data-disabled:pointer-events-none data-disabled:opacity-50 relative flex cursor-pointer select-none items-center gap-2 rounded py-1.5 px-2 text-sm font-normal outline-none\",\n\t\t\t\"data-highlighted:bg-popover-hover data-highlighted:dark:bg-popover-hover\",\n\t\t\t\"aria-checked:!bg-filled-accent aria-checked:text-on-filled aria-checked:font-medium aria-checked:pr-9\",\n\t\t\t\"[&>svg]:size-5 [&_svg]:shrink-0\",\n\t\t\tclassName,\n\t\t)}\n\t\tref={ref}\n\t\t{...props}\n\t>\n\t\t<span className=\"absolute right-2 items-center hidden group-aria-checked/dropdown-menu-radio-item:flex\">\n\t\t\t<DropdownMenuPrimitive.ItemIndicator>\n\t\t\t\t<Icon svg={<CheckIcon weight=\"bold\" />} className=\"size-4\" />\n\t\t\t</DropdownMenuPrimitive.ItemIndicator>\n\t\t</span>\n\t\t{children}\n\t</DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = \"DropdownMenuRadioItem\";\n\nconst DropdownMenuLabel = forwardRef<\n\tComponentRef<typeof DropdownMenuPrimitive.Label>,\n\tComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n\t\tinset?: boolean;\n\t}\n>(({ className, inset, ...props }, ref) => (\n\t<DropdownMenuPrimitive.Label\n\t\tref={ref}\n\t\tclassName={cx(\n\t\t\t\"px-2 py-1.5 text-sm font-semibold\",\n\t\t\tinset && \"pl-8\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nDropdownMenuLabel.displayName = \"DropdownMenuLabel\";\n\nconst DropdownMenuSeparator = forwardRef<\n\tComponentRef<typeof Separator>,\n\tComponentPropsWithoutRef<typeof Separator>\n>(({ className, ...props }, ref) => (\n\t<Separator\n\t\tref={ref}\n\t\tclassName={cx(\"-mx-1.25 my-1 w-auto\", className)}\n\t\t{...props}\n\t/>\n));\nDropdownMenuSeparator.displayName = \"DropdownMenuSeparator\";\n\nconst DropdownMenuShortcut = ({\n\tclassName,\n\t...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n\treturn (\n\t\t<span\n\t\t\tclassName={cx(\"ml-auto text-xs tracking-widest opacity-60\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n};\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\";\n\nexport {\n\tDropdownMenu,\n\tDropdownMenuCheckboxItem,\n\tDropdownMenuContent,\n\tDropdownMenuGroup,\n\tDropdownMenuItem,\n\tDropdownMenuLabel,\n\tDropdownMenuPortal,\n\tDropdownMenuRadioGroup,\n\tDropdownMenuRadioItem,\n\tDropdownMenuSeparator,\n\tDropdownMenuShortcut,\n\tDropdownMenuSub,\n\tDropdownMenuSubContent,\n\tDropdownMenuSubTrigger,\n\tDropdownMenuTrigger,\n};\n"],"mappings":"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","names":["CaretRightIcon","CheckIcon","DropdownMenuPrimitive","forwardRef","jsx","jsxs","DropdownMenu","DropdownMenuTrigger","DropdownMenuGroup","DropdownMenuPortal","DropdownMenuSub","DropdownMenuRadioGroup","DropdownMenuSubTrigger","forwardRef","className","inset","children","props","ref","cx","Icon","CaretRightIcon","DropdownMenuSubContent","loop","DropdownMenuContent","onClick","width","event","DropdownMenuItem","DropdownMenuCheckboxItem","checked","CheckIcon","DropdownMenuRadioItem","DropdownMenuLabel","DropdownMenuSeparator","Separator","DropdownMenuShortcut"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/dropdown-menu/dropdown-menu.tsx"],"sourcesContent":["import { CaretRightIcon } from \"@phosphor-icons/react/CaretRight\";\nimport { CheckIcon } from \"@phosphor-icons/react/Check\";\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport type { ComponentPropsWithoutRef, ComponentRef } from \"react\";\nimport { forwardRef } from \"react\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { Icon } from \"../icon/icon.js\";\nimport { Separator } from \"../separator/separator.js\";\n\n/**\n * A menu of options or actions, triggered by a button.\n * This is the root, stateful component that manages the open/closed state of the dropdown menu.\n *\n * @see https://mantle.ngrok.com/components/dropdown-menu#api-dropdown-menu\n *\n * @example\n * ```tsx\n * <DropdownMenu.Root>\n * <DropdownMenu.Trigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Open Menu\n * </Button>\n * </DropdownMenu.Trigger>\n * <DropdownMenu.Content>\n * <DropdownMenu.Item>Item 1</DropdownMenu.Item>\n * <DropdownMenu.Item>Item 2</DropdownMenu.Item>\n * </DropdownMenu.Content>\n * </DropdownMenu.Root>\n * ```\n */\nconst Root = DropdownMenuPrimitive.Root;\nRoot.displayName = \"DropdownMenu\";\n\n/**\n * The trigger button that opens the dropdown menu.\n *\n * @see https://mantle.ngrok.com/components/dropdown-menu#api-dropdown-menu-trigger\n *\n * @example\n * ```tsx\n * <DropdownMenu.Root>\n * <DropdownMenu.Trigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Open Menu\n * </Button>\n * </DropdownMenu.Trigger>\n * <DropdownMenu.Content>\n * <DropdownMenu.Item>Item 1</DropdownMenu.Item>\n * </DropdownMenu.Content>\n * </DropdownMenu.Root>\n * ```\n */\nconst Trigger = DropdownMenuPrimitive.Trigger;\nTrigger.displayName = \"DropdownMenuTrigger\";\n\nconst Group = DropdownMenuPrimitive.Group;\nGroup.displayName = \"DropdownMenuGroup\";\n\n/**\n * The portal container for rendering dropdown content outside the normal DOM tree.\n */\nconst Portal = DropdownMenuPrimitive.Portal;\nPortal.displayName = \"DropdownMenuPortal\";\n\nconst Sub = DropdownMenuPrimitive.Sub;\nSub.displayName = \"DropdownMenuSub\";\n\nconst RadioGroup = DropdownMenuPrimitive.RadioGroup;\nRadioGroup.displayName = \"DropdownMenuRadioGroup\";\n\n/**\n * A trigger for a dropdown menu sub-menu.\n *\n * @see https://mantle.ngrok.com/components/dropdown-menu#api-dropdown-menu-sub-trigger\n */\nconst SubTrigger = forwardRef<\n\tComponentRef<typeof DropdownMenuPrimitive.SubTrigger>,\n\tComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n\t\tinset?: boolean;\n\t}\n>(({ className, inset, children, ...props }, ref) => (\n\t<DropdownMenuPrimitive.SubTrigger\n\t\tclassName={cx(\n\t\t\t\"focus:bg-accent data-state-open:bg-accent relative flex cursor-pointer select-none items-center rounded py-1.5 pl-2 pr-9 text-sm outline-none\",\n\t\t\t\"data-highlighted:bg-popover-hover data-state-open:bg-popover-hover\",\n\t\t\t\"[&>svg]:size-5 [&_svg]:shrink-0\",\n\t\t\tinset && \"pl-8\",\n\t\t\tclassName,\n\t\t)}\n\t\tref={ref}\n\t\t{...props}\n\t>\n\t\t{children}\n\t\t<span className=\"absolute right-2 flex items-center\">\n\t\t\t<Icon svg={<CaretRightIcon weight=\"bold\" />} className=\"size-4\" />\n\t\t</span>\n\t</DropdownMenuPrimitive.SubTrigger>\n));\nSubTrigger.displayName = \"DropdownMenuSubTrigger\";\n\n/**\n * The content container for a dropdown menu sub-menu.\n *\n * @see https://mantle.ngrok.com/components/dropdown-menu#api-dropdown-menu-sub-content\n */\nconst SubContent = forwardRef<\n\tComponentRef<typeof DropdownMenuPrimitive.SubContent>,\n\tComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, loop = true, ...props }, ref) => (\n\t<Portal>\n\t\t<DropdownMenuPrimitive.SubContent\n\t\t\tclassName={cx(\n\t\t\t\t\"scrollbar\",\n\t\t\t\t\"text-popover-foreground border-popover bg-popover p-1.25 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-md border shadow-xl\",\n\t\t\t\t\"my-2 max-h-[calc(var(--radix-dropdown-menu-content-available-height)_-_16px)] overflow-auto\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tloop={loop}\n\t\t\tref={ref}\n\t\t\t{...props}\n\t\t/>\n\t</Portal>\n));\nSubContent.displayName = \"DropdownMenuSubContent\";\n\ntype DropdownMenuContentProps = ComponentPropsWithoutRef<\n\ttypeof DropdownMenuPrimitive.Content\n> & {\n\t/**\n\t * Whether the DropdownMenuContent should match the width of the trigger or use the intrinsic content width.\n\t */\n\twidth?: \"trigger\" | \"content\";\n};\n\n/**\n * The container for the dropdown menu content.\n *\n * @see https://mantle.ngrok.com/components/dropdown-menu#api-dropdown-menu-content\n *\n * @example\n * ```tsx\n * <DropdownMenu.Root>\n * <DropdownMenu.Trigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Open Menu\n * </Button>\n * </DropdownMenu.Trigger>\n * <DropdownMenu.Content>\n * <DropdownMenu.Item>Item 1</DropdownMenu.Item>\n * <DropdownMenu.Item>Item 2</DropdownMenu.Item>\n * </DropdownMenu.Content>\n * </DropdownMenu.Root>\n * ```\n */\nconst Content = forwardRef<\n\tComponentRef<typeof DropdownMenuPrimitive.Content>,\n\tDropdownMenuContentProps\n>(({ className, onClick, loop = true, width, ...props }, ref) => (\n\t<Portal>\n\t\t<DropdownMenuPrimitive.Content\n\t\t\tref={ref}\n\t\t\tclassName={cx(\n\t\t\t\t\"scrollbar\",\n\t\t\t\t\"text-popover-foreground border-popover bg-popover p-1.25 z-50 min-w-[8rem] overflow-hidden rounded-md border shadow-xl outline-none\",\n\t\t\t\t\"data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95\",\n\t\t\t\t\"my-2 max-h-[calc(var(--radix-dropdown-menu-content-available-height)_-_16px)] overflow-auto\",\n\t\t\t\twidth === \"trigger\" && \"w-[var(--radix-dropdown-menu-trigger-width)]\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tloop={loop}\n\t\t\tonClick={(event) => {\n\t\t\t\t/**\n\t\t\t\t * Prevent the click event from propagating up to parent/containing elements\n\t\t\t\t * of the DropdownMenu\n\t\t\t\t */\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tonClick?.(event);\n\t\t\t}}\n\t\t\t{...props}\n\t\t/>\n\t</Portal>\n));\nContent.displayName = \"DropdownMenuContent\";\n\n/**\n * An item in the dropdown menu.\n *\n * @see https://mantle.ngrok.com/components/dropdown-menu#api-dropdown-menu-item\n *\n * @example\n * ```tsx\n * <DropdownMenu.Root>\n * <DropdownMenu.Trigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Open Menu\n * </Button>\n * </DropdownMenu.Trigger>\n * <DropdownMenu.Content>\n * <DropdownMenu.Item>Item 1</DropdownMenu.Item>\n * <DropdownMenu.Item>Item 2</DropdownMenu.Item>\n * </DropdownMenu.Content>\n * </DropdownMenu.Root>\n * ```\n */\nconst Item = forwardRef<\n\tComponentRef<typeof DropdownMenuPrimitive.Item>,\n\tComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n\t\tinset?: boolean;\n\t}\n>(({ className, inset, ...props }, ref) => (\n\t<DropdownMenuPrimitive.Item\n\t\tref={ref}\n\t\tclassName={cx(\n\t\t\t\"focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-popover-hover data-active-item:dark:bg-popover-hover relative flex cursor-pointer select-none items-center rounded px-2 py-1.5 text-sm font-normal outline-none transition-colors\",\n\t\t\t\"[&>svg]:size-5 [&_svg]:shrink-0\",\n\t\t\tinset && \"pl-8\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nItem.displayName = \"DropdownMenuItem\";\n\n/**\n * A menu item with a checkbox that can be controlled or uncontrolled.\n *\n * @see https://mantle.ngrok.com/components/dropdown-menu#api-dropdown-menu-checkbox-item\n */\nconst CheckboxItem = forwardRef<\n\tComponentRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n\tComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n\t<DropdownMenuPrimitive.CheckboxItem\n\t\tref={ref}\n\t\tclassName={cx(\n\t\t\t\"text-strong data-disabled:pointer-events-none data-disabled:opacity-50 relative flex cursor-pointer select-none items-center gap-2 rounded py-1.5 pl-2 pr-9 text-sm font-normal outline-none\",\n\t\t\t\"data-highlighted:bg-popover-hover data-highlighted:dark:bg-popover-hover\",\n\t\t\t\"aria-checked:!bg-filled-accent aria-checked:text-on-filled aria-checked:font-medium\",\n\t\t\t\"[&>svg]:size-5 [&_svg]:shrink-0\",\n\t\t\tclassName,\n\t\t)}\n\t\tchecked={checked}\n\t\t{...props}\n\t>\n\t\t<span className=\"absolute right-2 flex items-center\">\n\t\t\t<DropdownMenuPrimitive.ItemIndicator>\n\t\t\t\t<Icon svg={<CheckIcon weight=\"bold\" />} className=\"size-4\" />\n\t\t\t</DropdownMenuPrimitive.ItemIndicator>\n\t\t</span>\n\t\t{children}\n\t</DropdownMenuPrimitive.CheckboxItem>\n));\nCheckboxItem.displayName = \"DropdownMenuCheckboxItem\";\n\ntype DropdownMenuRadioItemProps = ComponentPropsWithoutRef<\n\ttypeof DropdownMenuPrimitive.RadioItem\n> & {\n\tname?: string;\n\tid?: string;\n};\n\n/**\n * A menu item with a radio button that can be controlled or uncontrolled.\n * Used within a RadioGroup to create a set of mutually exclusive options.\n *\n * @see https://mantle.ngrok.com/components/dropdown-menu#api-dropdown-menu-radio-item\n */\nconst RadioItem = forwardRef<ComponentRef<\"input\">, DropdownMenuRadioItemProps>(\n\t({ className, children, ...props }, ref) => (\n\t\t<DropdownMenuPrimitive.RadioItem\n\t\t\tclassName={cx(\n\t\t\t\t\"group/dropdown-menu-radio-item\",\n\t\t\t\t\"text-strong data-disabled:pointer-events-none data-disabled:opacity-50 relative flex cursor-pointer select-none items-center gap-2 rounded py-1.5 px-2 text-sm font-normal outline-none\",\n\t\t\t\t\"data-highlighted:bg-popover-hover data-highlighted:dark:bg-popover-hover\",\n\t\t\t\t\"aria-checked:!bg-filled-accent aria-checked:text-on-filled aria-checked:font-medium aria-checked:pr-9\",\n\t\t\t\t\"[&>svg]:size-5 [&_svg]:shrink-0\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tref={ref}\n\t\t\t{...props}\n\t\t>\n\t\t\t<span className=\"absolute right-2 items-center hidden group-aria-checked/dropdown-menu-radio-item:flex\">\n\t\t\t\t<DropdownMenuPrimitive.ItemIndicator>\n\t\t\t\t\t<Icon svg={<CheckIcon weight=\"bold\" />} className=\"size-4\" />\n\t\t\t\t</DropdownMenuPrimitive.ItemIndicator>\n\t\t\t</span>\n\t\t\t{children}\n\t\t</DropdownMenuPrimitive.RadioItem>\n\t),\n);\nRadioItem.displayName = \"DropdownMenuRadioItem\";\n\n/**\n * A label for a group of dropdown menu items.\n *\n * @see https://mantle.ngrok.com/components/dropdown-menu#api-dropdown-menu-label\n */\nconst Label = forwardRef<\n\tComponentRef<typeof DropdownMenuPrimitive.Label>,\n\tComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n\t\tinset?: boolean;\n\t}\n>(({ className, inset, ...props }, ref) => (\n\t<DropdownMenuPrimitive.Label\n\t\tref={ref}\n\t\tclassName={cx(\n\t\t\t\"px-2 py-1.5 text-sm font-semibold\",\n\t\t\tinset && \"pl-8\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nLabel.displayName = \"DropdownMenuLabel\";\n\n/**\n * A visual separator between dropdown menu items or groups.\n *\n * @see https://mantle.ngrok.com/components/dropdown-menu#api-dropdown-menu-separator\n */\nconst DropdownSeparator = forwardRef<\n\tComponentRef<typeof Separator>,\n\tComponentPropsWithoutRef<typeof Separator>\n>(({ className, ...props }, ref) => (\n\t<Separator\n\t\tref={ref}\n\t\tclassName={cx(\"-mx-1.25 my-1 w-auto\", className)}\n\t\t{...props}\n\t/>\n));\nDropdownSeparator.displayName = \"DropdownMenuSeparator\";\n\nconst Shortcut = ({\n\tclassName,\n\t...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n\treturn (\n\t\t<span\n\t\t\tclassName={cx(\"ml-auto text-xs tracking-widest opacity-60\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n};\nShortcut.displayName = \"DropdownMenuShortcut\";\n\n/**\n * A menu of options or actions, triggered by a button.\n *\n * @see https://mantle.ngrok.com/components/dropdown-menu\n *\n * @example\n * ```tsx\n * <DropdownMenu.Root>\n * <DropdownMenu.Trigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Open Menu\n * </Button>\n * </DropdownMenu.Trigger>\n * <DropdownMenu.Content>\n * <DropdownMenu.Item>Item 1</DropdownMenu.Item>\n * <DropdownMenu.Item>Item 2</DropdownMenu.Item>\n * </DropdownMenu.Content>\n * </DropdownMenu.Root>\n * ```\n */\nconst DropdownMenu = {\n\t/**\n\t * The root, stateful component that manages the open/closed state of the dropdown menu.\n\t *\n\t * @see https://mantle.ngrok.com/components/dropdown-menu#api-dropdown-menu\n\t *\n\t * @example\n\t * ```tsx\n\t * <DropdownMenu.Root>\n\t * <DropdownMenu.Trigger asChild>\n\t * <Button>Open Menu</Button>\n\t * </DropdownMenu.Trigger>\n\t * <DropdownMenu.Content>\n\t * <DropdownMenu.Item>Item 1</DropdownMenu.Item>\n\t * </DropdownMenu.Content>\n\t * </DropdownMenu.Root>\n\t * ```\n\t */\n\tRoot,\n\t/**\n\t * A checkbox item in the dropdown menu that can be toggled on and off.\n\t *\n\t * @see https://mantle.ngrok.com/components/dropdown-menu#api-dropdown-menu-checkbox-item\n\t *\n\t * @example\n\t * ```tsx\n\t * <DropdownMenu.Root>\n\t * <DropdownMenu.Trigger>Open</DropdownMenu.Trigger>\n\t * <DropdownMenu.Content>\n\t * <DropdownMenu.CheckboxItem checked={true} onCheckedChange={setChecked}>\n\t * Show notifications\n\t * </DropdownMenu.CheckboxItem>\n\t * </DropdownMenu.Content>\n\t * </DropdownMenu.Root>\n\t * ```\n\t */\n\tCheckboxItem,\n\t/**\n\t * The container for the dropdown menu content. Appears in a portal with scrolling and animations.\n\t *\n\t * @see https://mantle.ngrok.com/components/dropdown-menu#api-dropdown-menu-content\n\t *\n\t * @example\n\t * ```tsx\n\t * <DropdownMenu.Root>\n\t * <DropdownMenu.Trigger>Open</DropdownMenu.Trigger>\n\t * <DropdownMenu.Content width=\"trigger\">\n\t * <DropdownMenu.Item>Edit</DropdownMenu.Item>\n\t * <DropdownMenu.Item>Delete</DropdownMenu.Item>\n\t * </DropdownMenu.Content>\n\t * </DropdownMenu.Root>\n\t * ```\n\t */\n\tContent,\n\t/**\n\t * A group container for organizing related dropdown menu items.\n\t *\n\t * @see https://mantle.ngrok.com/components/dropdown-menu#api-dropdown-menu-group\n\t *\n\t * @example\n\t * ```tsx\n\t * <DropdownMenu.Root>\n\t * <DropdownMenu.Trigger>Open</DropdownMenu.Trigger>\n\t * <DropdownMenu.Content>\n\t * <DropdownMenu.Group>\n\t * <DropdownMenu.Label>Account</DropdownMenu.Label>\n\t * <DropdownMenu.Item>Profile</DropdownMenu.Item>\n\t * <DropdownMenu.Item>Settings</DropdownMenu.Item>\n\t * </DropdownMenu.Group>\n\t * </DropdownMenu.Content>\n\t * </DropdownMenu.Root>\n\t * ```\n\t */\n\tGroup,\n\t/**\n\t * A standard item in the dropdown menu that can be selected or activated.\n\t *\n\t * @see https://mantle.ngrok.com/components/dropdown-menu#api-dropdown-menu-item\n\t *\n\t * @example\n\t * ```tsx\n\t * <DropdownMenu.Root>\n\t * <DropdownMenu.Trigger>Open</DropdownMenu.Trigger>\n\t * <DropdownMenu.Content>\n\t * <DropdownMenu.Item onSelect={() => handleEdit()}>\n\t * Edit\n\t * </DropdownMenu.Item>\n\t * <DropdownMenu.Item disabled>\n\t * Delete\n\t * </DropdownMenu.Item>\n\t * </DropdownMenu.Content>\n\t * </DropdownMenu.Root>\n\t * ```\n\t */\n\tItem,\n\t/**\n\t * A label for grouping and describing sections within the dropdown menu.\n\t *\n\t * @see https://mantle.ngrok.com/components/dropdown-menu#api-dropdown-menu-label\n\t *\n\t * @example\n\t * ```tsx\n\t * <DropdownMenu.Root>\n\t * <DropdownMenu.Trigger>Open</DropdownMenu.Trigger>\n\t * <DropdownMenu.Content>\n\t * <DropdownMenu.Label>My Account</DropdownMenu.Label>\n\t * <DropdownMenu.Item>Profile</DropdownMenu.Item>\n\t * <DropdownMenu.Item>Settings</DropdownMenu.Item>\n\t * </DropdownMenu.Content>\n\t * </DropdownMenu.Root>\n\t * ```\n\t */\n\tLabel,\n\t/**\n\t * A radio group container for exclusive selection within the dropdown menu.\n\t *\n\t * @see https://mantle.ngrok.com/components/dropdown-menu#api-dropdown-menu-radio-group\n\t *\n\t * @example\n\t * ```tsx\n\t * <DropdownMenu.Root>\n\t * <DropdownMenu.Trigger>Open</DropdownMenu.Trigger>\n\t * <DropdownMenu.Content>\n\t * <DropdownMenu.RadioGroup value={value} onValueChange={setValue}>\n\t * <DropdownMenu.RadioItem value=\"option1\">Option 1</DropdownMenu.RadioItem>\n\t * <DropdownMenu.RadioItem value=\"option2\">Option 2</DropdownMenu.RadioItem>\n\t * </DropdownMenu.RadioGroup>\n\t * </DropdownMenu.Content>\n\t * </DropdownMenu.Root>\n\t * ```\n\t */\n\tRadioGroup,\n\t/**\n\t * A radio item in the dropdown menu where only one item in the group can be selected.\n\t *\n\t * @see https://mantle.ngrok.com/components/dropdown-menu#api-dropdown-menu-radio-item\n\t *\n\t * @example\n\t * ```tsx\n\t * <DropdownMenu.Root>\n\t * <DropdownMenu.Trigger>Open</DropdownMenu.Trigger>\n\t * <DropdownMenu.Content>\n\t * <DropdownMenu.RadioGroup value=\"small\" onValueChange={setSize}>\n\t * <DropdownMenu.RadioItem value=\"small\">Small</DropdownMenu.RadioItem>\n\t * <DropdownMenu.RadioItem value=\"medium\">Medium</DropdownMenu.RadioItem>\n\t * <DropdownMenu.RadioItem value=\"large\">Large</DropdownMenu.RadioItem>\n\t * </DropdownMenu.RadioGroup>\n\t * </DropdownMenu.Content>\n\t * </DropdownMenu.Root>\n\t * ```\n\t */\n\tRadioItem,\n\t/**\n\t * A visual separator for dividing sections within the dropdown menu.\n\t *\n\t * @see https://mantle.ngrok.com/components/dropdown-menu#api-dropdown-menu-separator\n\t *\n\t * @example\n\t * ```tsx\n\t * <DropdownMenu.Root>\n\t * <DropdownMenu.Trigger>Open</DropdownMenu.Trigger>\n\t * <DropdownMenu.Content>\n\t * <DropdownMenu.Item>Edit</DropdownMenu.Item>\n\t * <DropdownMenu.Item>Copy</DropdownMenu.Item>\n\t * <DropdownMenu.Separator />\n\t * <DropdownMenu.Item>Delete</DropdownMenu.Item>\n\t * </DropdownMenu.Content>\n\t * </DropdownMenu.Root>\n\t * ```\n\t */\n\tSeparator: DropdownSeparator,\n\t/**\n\t * A keyboard shortcut indicator for dropdown menu items.\n\t *\n\t * @see https://mantle.ngrok.com/components/dropdown-menu#api-dropdown-menu-shortcut\n\t *\n\t * @example\n\t * ```tsx\n\t * <DropdownMenu.Root>\n\t * <DropdownMenu.Trigger>Open</DropdownMenu.Trigger>\n\t * <DropdownMenu.Content>\n\t * <DropdownMenu.Item>\n\t * Save\n\t * <DropdownMenu.Shortcut>⌘S</DropdownMenu.Shortcut>\n\t * </DropdownMenu.Item>\n\t * </DropdownMenu.Content>\n\t * </DropdownMenu.Root>\n\t * ```\n\t */\n\tShortcut,\n\t/**\n\t * A submenu container for creating nested dropdown menus.\n\t *\n\t * @see https://mantle.ngrok.com/components/dropdown-menu#api-dropdown-menu-sub\n\t *\n\t * @example\n\t * ```tsx\n\t * <DropdownMenu.Root>\n\t * <DropdownMenu.Trigger>Open</DropdownMenu.Trigger>\n\t * <DropdownMenu.Content>\n\t * <DropdownMenu.Sub>\n\t * <DropdownMenu.SubTrigger>More options</DropdownMenu.SubTrigger>\n\t * <DropdownMenu.SubContent>\n\t * <DropdownMenu.Item>Sub item 1</DropdownMenu.Item>\n\t * <DropdownMenu.Item>Sub item 2</DropdownMenu.Item>\n\t * </DropdownMenu.SubContent>\n\t * </DropdownMenu.Sub>\n\t * </DropdownMenu.Content>\n\t * </DropdownMenu.Root>\n\t * ```\n\t */\n\tSub,\n\t/**\n\t * The content container for submenu items.\n\t *\n\t * @see https://mantle.ngrok.com/components/dropdown-menu#api-dropdown-menu-sub-content\n\t *\n\t * @example\n\t * ```tsx\n\t * <DropdownMenu.Root>\n\t * <DropdownMenu.Trigger>Open</DropdownMenu.Trigger>\n\t * <DropdownMenu.Content>\n\t * <DropdownMenu.Sub>\n\t * <DropdownMenu.SubTrigger>Export</DropdownMenu.SubTrigger>\n\t * <DropdownMenu.SubContent>\n\t * <DropdownMenu.Item>Export as PDF</DropdownMenu.Item>\n\t * <DropdownMenu.Item>Export as CSV</DropdownMenu.Item>\n\t * </DropdownMenu.SubContent>\n\t * </DropdownMenu.Sub>\n\t * </DropdownMenu.Content>\n\t * </DropdownMenu.Root>\n\t * ```\n\t */\n\tSubContent,\n\t/**\n\t * The trigger item that opens a submenu when hovered or focused.\n\t *\n\t * @see https://mantle.ngrok.com/components/dropdown-menu#api-dropdown-menu-sub-trigger\n\t *\n\t * @example\n\t * ```tsx\n\t * <DropdownMenu.Root>\n\t * <DropdownMenu.Trigger>Open</DropdownMenu.Trigger>\n\t * <DropdownMenu.Content>\n\t * <DropdownMenu.Sub>\n\t * <DropdownMenu.SubTrigger>Share</DropdownMenu.SubTrigger>\n\t * <DropdownMenu.SubContent>\n\t * <DropdownMenu.Item>Email</DropdownMenu.Item>\n\t * <DropdownMenu.Item>Copy link</DropdownMenu.Item>\n\t * </DropdownMenu.SubContent>\n\t * </DropdownMenu.Sub>\n\t * </DropdownMenu.Content>\n\t * </DropdownMenu.Root>\n\t * ```\n\t */\n\tSubTrigger,\n\t/**\n\t * The trigger button that opens the dropdown menu.\n\t *\n\t * @see https://mantle.ngrok.com/components/dropdown-menu#api-dropdown-menu-trigger\n\t *\n\t * @example\n\t * ```tsx\n\t * <DropdownMenu.Root>\n\t * <DropdownMenu.Trigger asChild>\n\t * <Button type=\"button\" appearance=\"outlined\">\n\t * Open Menu\n\t * </Button>\n\t * </DropdownMenu.Trigger>\n\t * <DropdownMenu.Content>\n\t * <DropdownMenu.Item>Item 1</DropdownMenu.Item>\n\t * </DropdownMenu.Content>\n\t * </DropdownMenu.Root>\n\t * ```\n\t */\n\tTrigger,\n} as const;\n\nexport {\n\t//,\n\tDropdownMenu,\n};\n"],"mappings":"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","names":["CaretRightIcon","CheckIcon","DropdownMenuPrimitive","forwardRef","jsx","jsxs","Root","Trigger","Group","Portal","Sub","RadioGroup","SubTrigger","forwardRef","className","inset","children","props","ref","cx","Icon","CaretRightIcon","SubContent","loop","Content","onClick","width","event","Item","CheckboxItem","checked","CheckIcon","RadioItem","Label","DropdownSeparator","Separator","Shortcut","DropdownMenu"]}
|
package/dist/hover-card.d.ts
CHANGED
|
@@ -5,74 +5,110 @@ import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
|
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* A floating card that appears when a user hovers over a trigger element.
|
|
8
|
-
* This is the root, stateful component that manages the open/closed state of the hover card.
|
|
9
8
|
*
|
|
10
|
-
* @see https://mantle.ngrok.com/components/hover-card
|
|
9
|
+
* @see https://mantle.ngrok.com/components/hover-card
|
|
11
10
|
*
|
|
12
11
|
* @example
|
|
13
12
|
* ```tsx
|
|
14
|
-
* <HoverCard>
|
|
15
|
-
* <
|
|
13
|
+
* <HoverCard.Root>
|
|
14
|
+
* <HoverCard.Trigger asChild>
|
|
16
15
|
* <Button type="button" appearance="outlined">
|
|
17
16
|
* Hover me
|
|
18
17
|
* </Button>
|
|
19
|
-
* </
|
|
20
|
-
* <
|
|
18
|
+
* </HoverCard.Trigger>
|
|
19
|
+
* <HoverCard.Content>
|
|
21
20
|
* <p>This is the hover card content.</p>
|
|
22
|
-
* </
|
|
23
|
-
* </HoverCard>
|
|
21
|
+
* </HoverCard.Content>
|
|
22
|
+
* </HoverCard.Root>
|
|
24
23
|
* ```
|
|
25
24
|
*/
|
|
26
25
|
declare const HoverCard: {
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
/**
|
|
27
|
+
* The root, stateful component that manages the open/closed state of the hover card.
|
|
28
|
+
*
|
|
29
|
+
* @see https://mantle.ngrok.com/components/hover-card#api-hover-card
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* <HoverCard.Root>
|
|
34
|
+
* <HoverCard.Trigger asChild>
|
|
35
|
+
* <Button>Hover me</Button>
|
|
36
|
+
* </HoverCard.Trigger>
|
|
37
|
+
* <HoverCard.Content>
|
|
38
|
+
* <p>This is the hover card content.</p>
|
|
39
|
+
* </HoverCard.Content>
|
|
40
|
+
* </HoverCard.Root>
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
readonly Root: {
|
|
44
|
+
({ closeDelay, openDelay, ...props }: ComponentPropsWithoutRef<typeof HoverCardPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
45
|
+
displayName: string;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* The content to render inside the hover card. Appears in a portal with rich styling and animations.
|
|
49
|
+
*
|
|
50
|
+
* @see https://mantle.ngrok.com/components/hover-card#api-hover-card-content
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```tsx
|
|
54
|
+
* <HoverCard.Root>
|
|
55
|
+
* <HoverCard.Trigger asChild>
|
|
56
|
+
* <Button type="button" variant="link">@username</Button>
|
|
57
|
+
* </HoverCard.Trigger>
|
|
58
|
+
* <HoverCard.Content side="top">
|
|
59
|
+
* <div className="space-y-2">
|
|
60
|
+
* <Text weight="strong">User Profile</Text>
|
|
61
|
+
* <Text>Additional information about the user.</Text>
|
|
62
|
+
* <Button type="button" size="sm">Follow</Button>
|
|
63
|
+
* </div>
|
|
64
|
+
* </HoverCard.Content>
|
|
65
|
+
* </HoverCard.Root>
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
readonly Content: react.ForwardRefExoticComponent<Omit<HoverCardPrimitive.HoverCardContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
69
|
+
/**
|
|
70
|
+
* The portal container for rendering hover card content outside the normal DOM tree.
|
|
71
|
+
*
|
|
72
|
+
* @see https://mantle.ngrok.com/components/hover-card#api-hover-card-portal
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```tsx
|
|
76
|
+
* <HoverCard.Root>
|
|
77
|
+
* <HoverCard.Trigger asChild>
|
|
78
|
+
* <Text>Hover over me</Text>
|
|
79
|
+
* </HoverCard.Trigger>
|
|
80
|
+
* <HoverCard.Portal>
|
|
81
|
+
* <HoverCard.Content>
|
|
82
|
+
* <Text>This content is rendered in a portal.</Text>
|
|
83
|
+
* </HoverCard.Content>
|
|
84
|
+
* </HoverCard.Portal>
|
|
85
|
+
* </HoverCard.Root>
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
readonly Portal: react.FC<HoverCardPrimitive.HoverCardPortalProps>;
|
|
89
|
+
/**
|
|
90
|
+
* The trigger element that opens the hover card when hovered.
|
|
91
|
+
*
|
|
92
|
+
* @see https://mantle.ngrok.com/components/hover-card#api-hover-card-trigger
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```tsx
|
|
96
|
+
* <HoverCard.Root>
|
|
97
|
+
* <HoverCard.Trigger asChild>
|
|
98
|
+
* <Button type="button" variant="ghost">
|
|
99
|
+
* Hover for details
|
|
100
|
+
* </Button>
|
|
101
|
+
* </HoverCard.Trigger>
|
|
102
|
+
* <HoverCard.Content>
|
|
103
|
+
* <div className="space-y-1">
|
|
104
|
+
* <Text weight="strong">Quick Info</Text>
|
|
105
|
+
* <Text>This appears when you hover over the trigger.</Text>
|
|
106
|
+
* </div>
|
|
107
|
+
* </HoverCard.Content>
|
|
108
|
+
* </HoverCard.Root>
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
readonly Trigger: react.ForwardRefExoticComponent<HoverCardPrimitive.HoverCardTriggerProps & react.RefAttributes<HTMLAnchorElement>>;
|
|
29
112
|
};
|
|
30
|
-
/**
|
|
31
|
-
* The trigger element that opens the hover card when hovered.
|
|
32
|
-
*
|
|
33
|
-
* @see https://mantle.ngrok.com/components/hover-card#api-hover-card-trigger
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* ```tsx
|
|
37
|
-
* <HoverCard>
|
|
38
|
-
* <HoverCardTrigger asChild>
|
|
39
|
-
* <Button type="button" appearance="outlined">
|
|
40
|
-
* Hover me
|
|
41
|
-
* </Button>
|
|
42
|
-
* </HoverCardTrigger>
|
|
43
|
-
* <HoverCardContent>
|
|
44
|
-
* <p>This is the hover card content.</p>
|
|
45
|
-
* </HoverCardContent>
|
|
46
|
-
* </HoverCard>
|
|
47
|
-
* ```
|
|
48
|
-
*/
|
|
49
|
-
declare const HoverCardTrigger: react.ForwardRefExoticComponent<HoverCardPrimitive.HoverCardTriggerProps & react.RefAttributes<HTMLAnchorElement>>;
|
|
50
|
-
/**
|
|
51
|
-
* The portal for a HoverCard. Should be rendered as a child of the `HoverCard` component.
|
|
52
|
-
* Renders a portal that the `HoverCardContent` is rendered into.
|
|
53
|
-
*
|
|
54
|
-
* You likely don't need to use this component directly, as it is used internally by the `HoverCardContent` component.
|
|
55
|
-
*/
|
|
56
|
-
declare const HoverCardPortal: react.FC<HoverCardPrimitive.HoverCardPortalProps>;
|
|
57
|
-
/**
|
|
58
|
-
* The content to render inside the hover card.
|
|
59
|
-
*
|
|
60
|
-
* @see https://mantle.ngrok.com/components/hover-card#api-hover-card-content
|
|
61
|
-
*
|
|
62
|
-
* @example
|
|
63
|
-
* ```tsx
|
|
64
|
-
* <HoverCard>
|
|
65
|
-
* <HoverCardTrigger asChild>
|
|
66
|
-
* <Button type="button" appearance="outlined">
|
|
67
|
-
* Hover me
|
|
68
|
-
* </Button>
|
|
69
|
-
* </HoverCardTrigger>
|
|
70
|
-
* <HoverCardContent>
|
|
71
|
-
* <p>This is the hover card content.</p>
|
|
72
|
-
* </HoverCardContent>
|
|
73
|
-
* </HoverCard>
|
|
74
|
-
* ```
|
|
75
|
-
*/
|
|
76
|
-
declare const HoverCardContent: react.ForwardRefExoticComponent<Omit<HoverCardPrimitive.HoverCardContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
77
113
|
|
|
78
|
-
export { HoverCard
|
|
114
|
+
export { HoverCard };
|
package/dist/hover-card.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as n}from"./chunk-AZ56JGNY.js";import*as o from"@radix-ui/react-hover-card";import{forwardRef as
|
|
1
|
+
import{a as n}from"./chunk-AZ56JGNY.js";import*as o from"@radix-ui/react-hover-card";import{forwardRef as v}from"react";import{jsx as a}from"react/jsx-runtime";var m=({closeDelay:e=300,openDelay:t=100,...r})=>a(o.Root,{closeDelay:e,openDelay:t,...r});m.displayName="HoverCard";var s=o.Trigger;s.displayName="HoverCardTrigger";var i=o.Portal;i.displayName="HoverCardPortal";var p=v(({className:e,onClick:t,align:r="center",sideOffset:f=4,...l},C)=>a(i,{children:a(o.Content,{ref:C,align:r,sideOffset:f,className:n("bg-popover border-popover z-50 w-64 rounded-md border p-4 shadow-md outline-none","data-state-open:animate-in data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:fade-in-0 data-state-closed:zoom-out-95 data-state-open:zoom-in-95 data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2",e),onClick:d=>{d.stopPropagation(),t?.(d)},...l})}));p.displayName=o.Content.displayName;var P={Root:m,Content:p,Portal:i,Trigger:s};export{P as HoverCard};
|
|
2
2
|
//# sourceMappingURL=hover-card.js.map
|
package/dist/hover-card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/hover-card/hover-card.tsx"],"sourcesContent":["\"use client\";\n\nimport * as HoverCardPrimitive from \"@radix-ui/react-hover-card\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ComponentRef } from \"react\";\nimport { cx } from \"../../utils/cx/cx.js\";\n\n/**\n * A floating card that appears when a user hovers over a trigger element.\n * This is the root, stateful component that manages the open/closed state of the hover card.\n *\n * @see https://mantle.ngrok.com/components/hover-card#api-hover-card\n *\n * @example\n * ```tsx\n * <HoverCard>\n * <
|
|
1
|
+
{"version":3,"sources":["../src/components/hover-card/hover-card.tsx"],"sourcesContent":["\"use client\";\n\nimport * as HoverCardPrimitive from \"@radix-ui/react-hover-card\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ComponentRef } from \"react\";\nimport { cx } from \"../../utils/cx/cx.js\";\n\n/**\n * A floating card that appears when a user hovers over a trigger element.\n * This is the root, stateful component that manages the open/closed state of the hover card.\n *\n * @see https://mantle.ngrok.com/components/hover-card#api-hover-card\n *\n * @example\n * ```tsx\n * <HoverCard.Root>\n * <HoverCard.Trigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Hover me\n * </Button>\n * </HoverCard.Trigger>\n * <HoverCard.Content>\n * <p>This is the hover card content.</p>\n * </HoverCard.Content>\n * </HoverCard.Root>\n * ```\n */\nconst Root = ({\n\tcloseDelay = 300,\n\topenDelay = 100,\n\t...props\n}: ComponentPropsWithoutRef<typeof HoverCardPrimitive.Root>) => (\n\t<HoverCardPrimitive.Root\n\t\tcloseDelay={closeDelay}\n\t\topenDelay={openDelay}\n\t\t{...props}\n\t/>\n);\nRoot.displayName = \"HoverCard\";\n\n/**\n * The trigger element that opens the hover card when hovered.\n *\n * @see https://mantle.ngrok.com/components/hover-card#api-hover-card-trigger\n *\n * @example\n * ```tsx\n * <HoverCard.Root>\n * <HoverCard.Trigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Hover me\n * </Button>\n * </HoverCard.Trigger>\n * <HoverCard.Content>\n * <p>This is the hover card content.</p>\n * </HoverCard.Content>\n * </HoverCard.Root>\n * ```\n */\nconst Trigger = HoverCardPrimitive.Trigger;\nTrigger.displayName = \"HoverCardTrigger\";\n\n/**\n * The portal for a HoverCard. Should be rendered as a child of the `HoverCard` component.\n * Renders a portal that the `HoverCard.Content` is rendered into.\n *\n * You likely don't need to use this component directly, as it is used internally by the `HoverCard.Content` component.\n */\nconst Portal = HoverCardPrimitive.Portal;\nPortal.displayName = \"HoverCardPortal\";\n\n/**\n * The content to render inside the hover card.\n *\n * @see https://mantle.ngrok.com/components/hover-card#api-hover-card-content\n *\n * @example\n * ```tsx\n * <HoverCard.Root>\n * <HoverCard.Trigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Hover me\n * </Button>\n * </HoverCard.Trigger>\n * <HoverCard.Content>\n * <p>This is the hover card content.</p>\n * </HoverCard.Content>\n * </HoverCard.Root>\n * ```\n */\nconst Content = forwardRef<\n\tComponentRef<typeof HoverCardPrimitive.Content>,\n\tComponentPropsWithoutRef<typeof HoverCardPrimitive.Content>\n>(({ className, onClick, align = \"center\", sideOffset = 4, ...props }, ref) => (\n\t<Portal>\n\t\t<HoverCardPrimitive.Content\n\t\t\tref={ref}\n\t\t\talign={align}\n\t\t\tsideOffset={sideOffset}\n\t\t\tclassName={cx(\n\t\t\t\t\"bg-popover border-popover z-50 w-64 rounded-md border p-4 shadow-md outline-none\",\n\t\t\t\t\"data-state-open:animate-in data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:fade-in-0 data-state-closed:zoom-out-95 data-state-open:zoom-in-95 data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tonClick={(event) => {\n\t\t\t\t/**\n\t\t\t\t * Prevent the click event from propagating up to parent/containing elements\n\t\t\t\t */\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tonClick?.(event);\n\t\t\t}}\n\t\t\t{...props}\n\t\t/>\n\t</Portal>\n));\nContent.displayName = HoverCardPrimitive.Content.displayName;\n\n/**\n * A floating card that appears when a user hovers over a trigger element.\n *\n * @see https://mantle.ngrok.com/components/hover-card\n *\n * @example\n * ```tsx\n * <HoverCard.Root>\n * <HoverCard.Trigger asChild>\n * <Button type=\"button\" appearance=\"outlined\">\n * Hover me\n * </Button>\n * </HoverCard.Trigger>\n * <HoverCard.Content>\n * <p>This is the hover card content.</p>\n * </HoverCard.Content>\n * </HoverCard.Root>\n * ```\n */\nconst HoverCard = {\n\t/**\n\t * The root, stateful component that manages the open/closed state of the hover card.\n\t *\n\t * @see https://mantle.ngrok.com/components/hover-card#api-hover-card\n\t *\n\t * @example\n\t * ```tsx\n\t * <HoverCard.Root>\n\t * <HoverCard.Trigger asChild>\n\t * <Button>Hover me</Button>\n\t * </HoverCard.Trigger>\n\t * <HoverCard.Content>\n\t * <p>This is the hover card content.</p>\n\t * </HoverCard.Content>\n\t * </HoverCard.Root>\n\t * ```\n\t */\n\tRoot,\n\t/**\n\t * The content to render inside the hover card. Appears in a portal with rich styling and animations.\n\t *\n\t * @see https://mantle.ngrok.com/components/hover-card#api-hover-card-content\n\t *\n\t * @example\n\t * ```tsx\n\t * <HoverCard.Root>\n\t * <HoverCard.Trigger asChild>\n\t * <Button type=\"button\" variant=\"link\">@username</Button>\n\t * </HoverCard.Trigger>\n\t * <HoverCard.Content side=\"top\">\n\t * <div className=\"space-y-2\">\n\t * <Text weight=\"strong\">User Profile</Text>\n\t * <Text>Additional information about the user.</Text>\n\t * <Button type=\"button\" size=\"sm\">Follow</Button>\n\t * </div>\n\t * </HoverCard.Content>\n\t * </HoverCard.Root>\n\t * ```\n\t */\n\tContent,\n\t/**\n\t * The portal container for rendering hover card content outside the normal DOM tree.\n\t *\n\t * @see https://mantle.ngrok.com/components/hover-card#api-hover-card-portal\n\t *\n\t * @example\n\t * ```tsx\n\t * <HoverCard.Root>\n\t * <HoverCard.Trigger asChild>\n\t * <Text>Hover over me</Text>\n\t * </HoverCard.Trigger>\n\t * <HoverCard.Portal>\n\t * <HoverCard.Content>\n\t * <Text>This content is rendered in a portal.</Text>\n\t * </HoverCard.Content>\n\t * </HoverCard.Portal>\n\t * </HoverCard.Root>\n\t * ```\n\t */\n\tPortal,\n\t/**\n\t * The trigger element that opens the hover card when hovered.\n\t *\n\t * @see https://mantle.ngrok.com/components/hover-card#api-hover-card-trigger\n\t *\n\t * @example\n\t * ```tsx\n\t * <HoverCard.Root>\n\t * <HoverCard.Trigger asChild>\n\t * <Button type=\"button\" variant=\"ghost\">\n\t * Hover for details\n\t * </Button>\n\t * </HoverCard.Trigger>\n\t * <HoverCard.Content>\n\t * <div className=\"space-y-1\">\n\t * <Text weight=\"strong\">Quick Info</Text>\n\t * <Text>This appears when you hover over the trigger.</Text>\n\t * </div>\n\t * </HoverCard.Content>\n\t * </HoverCard.Root>\n\t * ```\n\t */\n\tTrigger,\n} as const;\n\nexport {\n\t//,\n\tHoverCard,\n};\n"],"mappings":"wCAEA,UAAYA,MAAwB,6BACpC,OAAS,cAAAC,MAAkB,QA6B1B,cAAAC,MAAA,oBALD,IAAMC,EAAO,CAAC,CACb,WAAAC,EAAa,IACb,UAAAC,EAAY,IACZ,GAAGC,CACJ,IACCJ,EAAoB,OAAnB,CACA,WAAYE,EACZ,UAAWC,EACV,GAAGC,EACL,EAEDH,EAAK,YAAc,YAqBnB,IAAMI,EAA6B,UACnCA,EAAQ,YAAc,mBAQtB,IAAMC,EAA4B,SAClCA,EAAO,YAAc,kBAqBrB,IAAMC,EAAUC,EAGd,CAAC,CAAE,UAAAC,EAAW,QAAAC,EAAS,MAAAC,EAAQ,SAAU,WAAAC,EAAa,EAAG,GAAGR,CAAM,EAAGS,IACtEb,EAACM,EAAA,CACA,SAAAN,EAAoB,UAAnB,CACA,IAAKa,EACL,MAAOF,EACP,WAAYC,EACZ,UAAWE,EACV,mFACA,+TACAL,CACD,EACA,QAAUM,GAAU,CAInBA,EAAM,gBAAgB,EACtBL,IAAUK,CAAK,CAChB,EACC,GAAGX,EACL,EACD,CACA,EACDG,EAAQ,YAAiC,UAAQ,YAqBjD,IAAMS,EAAY,CAkBjB,KAAAf,EAsBA,QAAAM,EAoBA,OAAAD,EAuBA,QAAAD,CACD","names":["HoverCardPrimitive","forwardRef","jsx","Root","closeDelay","openDelay","props","Trigger","Portal","Content","forwardRef","className","onClick","align","sideOffset","ref","cx","event","HoverCard"]}
|
package/dist/icons.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as h}from"./chunk-W2YQRWR5.js";import{a as s}from"./chunk-2PHWBRBD.js";import"./chunk-GYPSB3OK.js";import{l as m}from"./chunk-
|
|
1
|
+
import{a as h}from"./chunk-W2YQRWR5.js";import{a as s}from"./chunk-2PHWBRBD.js";import"./chunk-GYPSB3OK.js";import{l as m}from"./chunk-HSTG2BTX.js";import"./chunk-D3XF6J5A.js";import{DesktopIcon as u}from"@phosphor-icons/react/Desktop";import{MoonIcon as n}from"@phosphor-icons/react/Moon";import{SunIcon as c}from"@phosphor-icons/react/Sun";import{jsx as t}from"react/jsx-runtime";function i(o){let e=m();return t(r,{theme:e,...o})}i.displayName="AutoThemeIcon";function r({theme:o,...e}){switch(o){case"system":return t(u,{...e});case"light":return t(c,{...e});case"dark":return t(n,{...e});case"light-high-contrast":return t(c,{...e,weight:"fill"});case"dark-high-contrast":return t(n,{...e,weight:"fill"})}}r.displayName="ThemeIcon";export{i as AutoThemeIcon,s as SortIcon,r as ThemeIcon,h as TrafficPolicyFileIcon};
|
|
2
2
|
//# sourceMappingURL=icons.js.map
|
package/dist/input.d.ts
CHANGED
|
@@ -83,6 +83,17 @@ declare const PasswordInput: react.ForwardRefExoticComponent<Omit<InputHTMLAttri
|
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
85
|
* Type guard for an HTMLInputElement.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```tsx
|
|
89
|
+
* function handleElement(element: HTMLElement) {
|
|
90
|
+
* if (isInput(element)) {
|
|
91
|
+
* // TypeScript now knows element is HTMLInputElement
|
|
92
|
+
* element.value = "new value";
|
|
93
|
+
* element.focus();
|
|
94
|
+
* }
|
|
95
|
+
* }
|
|
96
|
+
* ```
|
|
86
97
|
*/
|
|
87
98
|
declare function isInput(value: unknown): value is HTMLInputElement;
|
|
88
99
|
|
package/dist/input.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as H}from"./chunk-
|
|
1
|
+
import{a as H}from"./chunk-EYZYDUS2.js";import{a as C}from"./chunk-MF2QITTY.js";import{a as d}from"./chunk-I6T6YV2L.js";import"./chunk-NPTDRQT5.js";import{a as b}from"./chunk-AZ56JGNY.js";import{CheckCircleIcon as L}from"@phosphor-icons/react/CheckCircle";import{WarningIcon as E}from"@phosphor-icons/react/Warning";import{WarningDiamondIcon as W}from"@phosphor-icons/react/WarningDiamond";import A from"clsx";import{createContext as N,forwardRef as g,useContext as V,useRef as k}from"react";import{jsx as t,jsxs as M}from"react/jsx-runtime";var m=g(({children:e,className:n,...r},a)=>{let o=!!e,i=k(null);return o?t(y,{className:n,forwardedRef:a,innerRef:i,...r,children:e}):t(y,{...r,className:n,forwardedRef:a,innerRef:i,children:t(f,{...r})})});m.displayName="Input";var f=g(({"aria-invalid":e,className:n,validation:r,...a},o)=>{let{"aria-invalid":i,forwardedRef:s,innerRef:c,validation:I,...l}=V(P),p=I??r,x=(typeof p=="function"?p():p)||void 0,u=i??e??p==="error",v={...l,...a,type:a.type??l.type??"text"};return t("input",{"aria-invalid":u,"data-validation":x,className:b("placeholder:text-placeholder min-w-0 flex-1 bg-transparent text-left autofill:shadow-[inset_0_0_0px_1000px_hsl(var(--blue-50))] focus:outline-none",n),ref:C(o,s,c),...v})});f.displayName="InputCapture";var P=N({validation:void 0,innerRef:{current:null}}),y=({"aria-invalid":e,"aria-disabled":n,children:r,className:a,disabled:o,forwardedRef:i,innerRef:s,style:c,type:I,validation:l,...p})=>{let u=e!=null&&e!=="false"?"error":typeof l=="function"?l():l,v=e??u==="error";return t(P.Provider,{value:{"aria-invalid":e,"aria-disabled":n,disabled:o,type:I,validation:u,...p,forwardedRef:i,innerRef:s},children:M("div",{"aria-invalid":v,"aria-disabled":o??n,"data-validation":u||void 0,className:b("pointer-coarse:text-base h-9 text-sm","bg-form relative flex w-full items-center gap-1.5 rounded-md border px-3 py-2 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-within:outline-none focus-within:ring-4 focus-visible:outline-none focus-visible:ring-4","aria-disabled:opacity-50","has-[input:not(:first-child)]:ps-2.5 has-[input:not(:last-child)]:pe-2.5 [&>:not(input)]:shrink-0 [&_svg]:size-5","border-form text-strong has-[:focus-visible]:border-accent-600 has-[:focus-visible]:ring-focus-accent","data-validation-success:border-success-600 has-[:focus-visible]:data-validation-success:border-success-600 has-[:focus-visible]:data-validation-success:ring-focus-success","data-validation-warning:border-warning-600 has-[:focus-visible]:data-validation-warning:border-warning-600 has-[:focus-visible]:data-validation-warning:ring-focus-warning","data-validation-error:border-danger-600 has-[:focus-visible]:data-validation-error:border-danger-600 has-[:focus-visible]:data-validation-error:ring-focus-danger","autofill:shadow-[inset_0_0_0px_1000px_hsl(var(--blue-50))] has-[:autofill]:bg-blue-50 has-[:autofill]:[-webkit-text-fill-color:hsl(var(--text-strong))]",a),onClick:()=>{s?.current?.focus()},onKeyDown:()=>{s?.current!==document.activeElement&&s?.current?.focus()},style:c,children:[r,t(T,{name:p.name,validation:u})]})})};y.displayName="InputContainer";var T=({name:e,validation:n})=>{switch(n){case"error":return M("div",{className:"text-danger-600 pointer-events-none order-last select-none",children:[t("span",{className:"sr-only",children:A("The value entered for the",e,"input has failed validation.")}),t(d,{svg:t(E,{"aria-hidden":!0,weight:"fill"})})]});case"success":return t("div",{className:"text-success-600 pointer-events-none order-last select-none",children:t(d,{svg:t(L,{weight:"fill"})})});case"warning":return t("div",{className:"text-warning-600 pointer-events-none order-last select-none",children:t(d,{svg:t(W,{weight:"fill"})})});default:return null}};T.displayName="ValidationFeedback";import{EyeIcon as O}from"@phosphor-icons/react/Eye";import{EyeClosedIcon as j}from"@phosphor-icons/react/EyeClosed";import{forwardRef as B,useEffect as F,useState as _}from"react";import{jsx as h,jsxs as w}from"react/jsx-runtime";var R=B(({onValueVisibilityChange:e,showValue:n=!1,...r},a)=>{let[o,i]=_(n),s=o?"text":"password",c=o?O:j;return F(()=>{i(n)},[n]),w(m,{type:s,ref:a,...r,children:[h(f,{}),w("button",{type:"button",tabIndex:-1,className:"text-body hover:text-strong ml-1 cursor-pointer bg-inherit p-0",onClick:()=>{i(!o),e?.(!o)},children:[w("span",{className:"sr-only",children:["Turn password visibility ",o?"off":"on"]}),h(d,{svg:h(c,{"aria-hidden":!0})})]})]})});R.displayName="PasswordInput";export{m as Input,f as InputCapture,R as PasswordInput,H as isInput};
|
|
2
2
|
//# sourceMappingURL=input.js.map
|
package/dist/media-object.d.ts
CHANGED
|
@@ -13,59 +13,88 @@ type Props = ComponentProps<"div"> & WithAsChild;
|
|
|
13
13
|
*
|
|
14
14
|
* Use flexbox utilities to change the alignment of the media and content.
|
|
15
15
|
*
|
|
16
|
-
* Compose the media object with the `
|
|
16
|
+
* Compose the media object with the `MediaObject.Media` and `MediaObject.Content`
|
|
17
17
|
* components as direct children.
|
|
18
18
|
*
|
|
19
|
-
* @see https://mantle.ngrok.com/components/media-object
|
|
19
|
+
* @see https://mantle.ngrok.com/components/media-object
|
|
20
20
|
*
|
|
21
21
|
* @example
|
|
22
22
|
* ```tsx
|
|
23
|
-
* <MediaObject>
|
|
24
|
-
* <
|
|
23
|
+
* <MediaObject.Root>
|
|
24
|
+
* <MediaObject.Media>
|
|
25
25
|
* <ExampleMedia />
|
|
26
|
-
* </
|
|
27
|
-
* <
|
|
26
|
+
* </MediaObject.Media>
|
|
27
|
+
* <MediaObject.Content>
|
|
28
28
|
* <p>Ea culpa id id ea minim labore.</p>
|
|
29
|
-
* </
|
|
30
|
-
* </MediaObject>
|
|
29
|
+
* </MediaObject.Content>
|
|
30
|
+
* </MediaObject.Root>
|
|
31
31
|
* ```
|
|
32
32
|
*/
|
|
33
|
-
declare const MediaObject:
|
|
34
|
-
/**
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
33
|
+
declare const MediaObject: {
|
|
34
|
+
/**
|
|
35
|
+
* The media object is an image/icon (media) to the left, with descriptive
|
|
36
|
+
* content (title and subtitle/description) to the right. This is the root
|
|
37
|
+
* component of the media object.
|
|
38
|
+
*
|
|
39
|
+
* Change the spacing between the media and content by passing a `gap-*` class.
|
|
40
|
+
* The default gap is `gap-4`.
|
|
41
|
+
*
|
|
42
|
+
* Use flexbox utilities to change the alignment of the media and content.
|
|
43
|
+
*
|
|
44
|
+
* Compose the media object with the `MediaObject.Media` and `MediaObject.Content`
|
|
45
|
+
* components as direct children.
|
|
46
|
+
*
|
|
47
|
+
* @see https://mantle.ngrok.com/components/media-object#api-media-object-root
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```tsx
|
|
51
|
+
* <MediaObject.Root>
|
|
52
|
+
* <MediaObject.Media>
|
|
53
|
+
* <ExampleMedia />
|
|
54
|
+
* </MediaObject.Media>
|
|
55
|
+
* <MediaObject.Content>
|
|
56
|
+
* <p>Ea culpa id id ea minim labore.</p>
|
|
57
|
+
* </MediaObject.Content>
|
|
58
|
+
* </MediaObject.Root>
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
readonly Root: react.ForwardRefExoticComponent<Omit<Props, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
62
|
+
/**
|
|
63
|
+
* The container for an image or icon to display in the media slot of the media object.
|
|
64
|
+
*
|
|
65
|
+
* @see https://mantle.ngrok.com/components/media-object#api-media-object-media
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```tsx
|
|
69
|
+
* <MediaObject.Root>
|
|
70
|
+
* <MediaObject.Media>
|
|
71
|
+
* <ExampleMedia />
|
|
72
|
+
* </MediaObject.Media>
|
|
73
|
+
* <MediaObject.Content>
|
|
74
|
+
* <p>Ea culpa id id ea minim labore.</p>
|
|
75
|
+
* </MediaObject.Content>
|
|
76
|
+
* </MediaObject.Root>
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
readonly Media: react.ForwardRefExoticComponent<Omit<Props, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
80
|
+
/**
|
|
81
|
+
* The container for the content slot of a media object.
|
|
82
|
+
*
|
|
83
|
+
* @see https://mantle.ngrok.com/components/media-object#api-media-object-content
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```tsx
|
|
87
|
+
* <MediaObject.Root>
|
|
88
|
+
* <MediaObject.Media>
|
|
89
|
+
* <ExampleMedia />
|
|
90
|
+
* </MediaObject.Media>
|
|
91
|
+
* <MediaObject.Content>
|
|
92
|
+
* <p>Ea culpa id id ea minim labore.</p>
|
|
93
|
+
* </MediaObject.Content>
|
|
94
|
+
* </MediaObject.Root>
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
readonly Content: react.ForwardRefExoticComponent<Omit<Props, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
98
|
+
};
|
|
70
99
|
|
|
71
|
-
export { MediaObject
|
|
100
|
+
export { MediaObject };
|
package/dist/media-object.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as p}from"./chunk-AZ56JGNY.js";import{Slot as
|
|
1
|
+
import{a as p}from"./chunk-AZ56JGNY.js";import{Slot as m}from"@radix-ui/react-slot";import{forwardRef as r}from"react";import{jsx as i}from"react/jsx-runtime";var l=r(({asChild:e=!1,className:o,children:t,style:n},s)=>i(e?m:"div",{ref:s,className:p("flex gap-4",o),style:n,children:t}));l.displayName="MediaObject";var d=r(({asChild:e=!1,className:o,children:t,style:n},s)=>i(e?m:"div",{ref:s,className:p("shrink-0 leading-none",o),style:n,children:t}));d.displayName="MediaObjectMedia";var c=r(({asChild:e=!1,className:o,children:t,style:n},s)=>i(e?m:"div",{ref:s,className:p("min-w-0 flex-1",o),style:n,children:t}));c.displayName="MediaObject.Content";var f={Root:l,Media:d,Content:c};export{f as MediaObject};
|
|
2
2
|
//# sourceMappingURL=media-object.js.map
|
package/dist/media-object.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/media-object/media-object.tsx"],"sourcesContent":["import { Slot } from \"@radix-ui/react-slot\";\nimport type { ComponentProps } from \"react\";\nimport { forwardRef } from \"react\";\nimport type { WithAsChild } from \"../../types/as-child.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\n\ntype Props = ComponentProps<\"div\"> & WithAsChild;\n\n/**\n * The media object is an image/icon (media) to the left, with descriptive\n * content (title and subtitle/description) to the right. This is the root\n * component of the media object.\n
|
|
1
|
+
{"version":3,"sources":["../src/components/media-object/media-object.tsx"],"sourcesContent":["import { Slot } from \"@radix-ui/react-slot\";\nimport type { ComponentProps } from \"react\";\nimport { forwardRef } from \"react\";\nimport type { WithAsChild } from \"../../types/as-child.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\n\ntype Props = ComponentProps<\"div\"> & WithAsChild;\n\n/**\n * The media object is an image/icon (media) to the left, with descriptive\n * content (title and subtitle/description) to the right. This is the root\n * component of the media object.\n */\nconst Root = forwardRef<HTMLDivElement, Props>(\n\t({ asChild = false, className, children, style }, 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(\"flex gap-4\", className)}\n\t\t\t\tstyle={style}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Component>\n\t\t);\n\t},\n);\nRoot.displayName = \"MediaObject\";\n\n/**\n * The container for an image or icon to display in the media slot of the media object.\n */\nconst Media = forwardRef<HTMLDivElement, Props>(\n\t({ asChild = false, className, children, style }, 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(\"shrink-0 leading-none\", className)}\n\t\t\t\tstyle={style}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Component>\n\t\t);\n\t},\n);\nMedia.displayName = \"MediaObjectMedia\";\n\n/**\n * The container for the content slot of a media object.\n */\nconst Content = forwardRef<HTMLDivElement, Props>(\n\t({ asChild = false, className, children, style }, 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(\"min-w-0 flex-1\", className)}\n\t\t\t\tstyle={style}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Component>\n\t\t);\n\t},\n);\nContent.displayName = \"MediaObject.Content\";\n\n/**\n * The media object is an image/icon (media) to the left, with descriptive\n * content (title and subtitle/description) to the right. This is the root\n * component of the media object.\n *\n * Change the spacing between the media and content by passing a `gap-*` class.\n * The default gap is `gap-4`.\n *\n * Use flexbox utilities to change the alignment of the media and content.\n *\n * Compose the media object with the `MediaObject.Media` and `MediaObject.Content`\n * components as direct children.\n *\n * @see https://mantle.ngrok.com/components/media-object\n *\n * @example\n * ```tsx\n * <MediaObject.Root>\n * <MediaObject.Media>\n * <ExampleMedia />\n * </MediaObject.Media>\n * <MediaObject.Content>\n * <p>Ea culpa id id ea minim labore.</p>\n * </MediaObject.Content>\n * </MediaObject.Root>\n * ```\n */\nconst MediaObject = {\n\t/**\n\t * The media object is an image/icon (media) to the left, with descriptive\n\t * content (title and subtitle/description) to the right. This is the root\n\t * component of the media object.\n\t *\n\t * Change the spacing between the media and content by passing a `gap-*` class.\n\t * The default gap is `gap-4`.\n\t *\n\t * Use flexbox utilities to change the alignment of the media and content.\n\t *\n\t * Compose the media object with the `MediaObject.Media` and `MediaObject.Content`\n\t * components as direct children.\n\t *\n\t * @see https://mantle.ngrok.com/components/media-object#api-media-object-root\n\t *\n\t * @example\n\t * ```tsx\n\t * <MediaObject.Root>\n\t * <MediaObject.Media>\n\t * <ExampleMedia />\n\t * </MediaObject.Media>\n\t * <MediaObject.Content>\n\t * <p>Ea culpa id id ea minim labore.</p>\n\t * </MediaObject.Content>\n\t * </MediaObject.Root>\n\t * ```\n\t */\n\tRoot,\n\t/**\n\t * The container for an image or icon to display in the media slot of the media object.\n\t *\n\t * @see https://mantle.ngrok.com/components/media-object#api-media-object-media\n\t *\n\t * @example\n\t * ```tsx\n\t * <MediaObject.Root>\n\t * <MediaObject.Media>\n\t * <ExampleMedia />\n\t * </MediaObject.Media>\n\t * <MediaObject.Content>\n\t * <p>Ea culpa id id ea minim labore.</p>\n\t * </MediaObject.Content>\n\t * </MediaObject.Root>\n\t * ```\n\t */\n\tMedia,\n\t/**\n\t * The container for the content slot of a media object.\n\t *\n\t * @see https://mantle.ngrok.com/components/media-object#api-media-object-content\n\t *\n\t * @example\n\t * ```tsx\n\t * <MediaObject.Root>\n\t * <MediaObject.Media>\n\t * <ExampleMedia />\n\t * </MediaObject.Media>\n\t * <MediaObject.Content>\n\t * <p>Ea culpa id id ea minim labore.</p>\n\t * </MediaObject.Content>\n\t * </MediaObject.Root>\n\t * ```\n\t */\n\tContent,\n} as const;\n\nexport {\n\t//,\n\tMediaObject,\n};\n"],"mappings":"wCAAA,OAAS,QAAAA,MAAY,uBAErB,OAAS,cAAAC,MAAkB,QAgBxB,cAAAC,MAAA,oBALH,IAAMC,EAAOC,EACZ,CAAC,CAAE,QAAAC,EAAU,GAAO,UAAAC,EAAW,SAAAC,EAAU,MAAAC,CAAM,EAAGC,IAIhDP,EAHiBG,EAAUK,EAAO,MAGjC,CACA,IAAKD,EACL,UAAWE,EAAG,aAAcL,CAAS,EACrC,MAAOE,EAEN,SAAAD,EACF,CAGH,EACAJ,EAAK,YAAc,cAKnB,IAAMS,EAAQR,EACb,CAAC,CAAE,QAAAC,EAAU,GAAO,UAAAC,EAAW,SAAAC,EAAU,MAAAC,CAAM,EAAGC,IAIhDP,EAHiBG,EAAUK,EAAO,MAGjC,CACA,IAAKD,EACL,UAAWE,EAAG,wBAAyBL,CAAS,EAChD,MAAOE,EAEN,SAAAD,EACF,CAGH,EACAK,EAAM,YAAc,mBAKpB,IAAMC,EAAUT,EACf,CAAC,CAAE,QAAAC,EAAU,GAAO,UAAAC,EAAW,SAAAC,EAAU,MAAAC,CAAM,EAAGC,IAIhDP,EAHiBG,EAAUK,EAAO,MAGjC,CACA,IAAKD,EACL,UAAWE,EAAG,iBAAkBL,CAAS,EACzC,MAAOE,EAEN,SAAAD,EACF,CAGH,EACAM,EAAQ,YAAc,sBA6BtB,IAAMC,EAAc,CA4BnB,KAAAX,EAkBA,MAAAS,EAkBA,QAAAC,CACD","names":["Slot","forwardRef","jsx","Root","forwardRef","asChild","className","children","style","ref","Slot","cx","Media","Content","MediaObject"]}
|