@tryghost/shade 0.1.0-alpha.34 → 0.1.0-alpha.36
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/es/assets/images/index.js +2 -2
- package/es/components/patterns/page-header.js +2 -1
- package/es/components/patterns/page-header.js.map +1 -1
- package/es/components/patterns/share-modal.js +2 -2
- package/es/components/patterns/share-modal.js.map +1 -1
- package/es/components/ui/alert-dialog.js +2 -2
- package/es/components/ui/alert-dialog.js.map +1 -1
- package/es/components/ui/code-editor-view.js +1 -1
- package/es/components/ui/code-editor-view.js.map +1 -1
- package/es/components/ui/dialog.js +1 -1
- package/es/components/ui/dialog.js.map +1 -1
- package/es/components/ui/floating-sidebar.js +1 -1
- package/es/components/ui/floating-sidebar.js.map +1 -1
- package/es/components/ui/sticky-footer.js +59 -22
- package/es/components/ui/sticky-footer.js.map +1 -1
- package/es/components.js +2 -2
- package/es/{images-CUcakpOD.js → images-DtbFINdz.js} +3 -23
- package/es/images-DtbFINdz.js.map +1 -0
- package/es/index.js +2 -2
- package/package.json +1 -1
- package/types/assets/images/index.d.ts +0 -1
- package/types/assets/images/index.d.ts.map +1 -1
- package/types/components/patterns/page-header.d.ts +8 -0
- package/types/components/patterns/page-header.d.ts.map +1 -1
- package/types/components/patterns/share-modal.d.ts.map +1 -1
- package/types/components/ui/alert-dialog.d.ts.map +1 -1
- package/types/components/ui/floating-sidebar.d.ts +3 -2
- package/types/components/ui/floating-sidebar.d.ts.map +1 -1
- package/types/components/ui/sticky-footer.d.ts +9 -2
- package/types/components/ui/sticky-footer.d.ts.map +1 -1
- package/types/components.d.ts +1 -1
- package/types/components.d.ts.map +1 -1
- package/es/images-CUcakpOD.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { FacebookLogo, GhostLogo, GhostOrb, GoogleLogo,
|
|
1
|
+
import { a as XLogo, i as GoogleLogo, n as GhostLogo, r as GhostOrb, t as FacebookLogo } from "../../images-DtbFINdz.js";
|
|
2
|
+
export { FacebookLogo, GhostLogo, GhostOrb, GoogleLogo, XLogo };
|
|
@@ -84,10 +84,11 @@ var PageHeaderSelectTrigger = React.forwardRef(({ label, tooltip = true, classNa
|
|
|
84
84
|
}) : trigger;
|
|
85
85
|
});
|
|
86
86
|
PageHeaderSelectTrigger.displayName = "PageHeaderSelectTrigger";
|
|
87
|
+
var breadcrumbFitClassName = "min-w-0 [&_nav]:min-w-0 [&_ol]:flex-nowrap [&_li]:shrink-0 [&_li>*]:block [&_li>*]:truncate [&_li:not(:last-child)>*]:max-w-40 [&_li:last-child]:min-w-0 [&_li:last-child]:shrink";
|
|
87
88
|
function PageHeaderBreadcrumb({ className, children }) {
|
|
88
89
|
return /* @__PURE__ */ jsx(Inline, {
|
|
89
90
|
align: "center",
|
|
90
|
-
className: cn("pt-1 text-sm text-muted-foreground", className),
|
|
91
|
+
className: cn("pt-1 text-sm text-muted-foreground", breadcrumbFitClassName, className),
|
|
91
92
|
"data-page-header": "breadcrumb",
|
|
92
93
|
gap: "sm",
|
|
93
94
|
children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-header.js","names":[],"sources":["../../../src/components/patterns/page-header.tsx"],"sourcesContent":["import { HeaderTooltipProvider } from '@/providers/header-tooltip-provider';\nimport { useShade } from '@/providers/shade-context';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu';\nimport { Button, type ButtonProps } from '@/components/ui/button';\nimport { SelectTrigger } from '@/components/ui/select';\nimport { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';\nimport { Kbd } from '@/components/ui/kbd';\nimport { H1 } from '@/components/layout/heading';\nimport { Inline, Stack, Text } from '@/components/primitives';\nimport { cn } from '@/lib/utils';\n\nimport React from 'react';\nimport { createPortal } from 'react-dom';\nimport { ListFilter } from 'lucide-react';\nimport { PageHeaderLargeTitleContext } from './page-header-large-title';\n\ntype PropsWithChildrenAndClassName = React.PropsWithChildren & {\n className?: string;\n};\n\ntype PageHeaderProps = PropsWithChildrenAndClassName & {\n sticky?: boolean;\n blurredBackground?: boolean;\n};\n\n/**\n * Header tooltips never belong on primary actions. A tooltip without a label\n * shows only the shortcut, for a control whose text already names it.\n */\nfunction PageHeaderTooltip({\n children,\n label,\n shortcut,\n}: React.PropsWithChildren<{ label?: string; shortcut?: string }>) {\n return (\n <Tooltip>\n {children}\n <TooltipContent side=\"bottom\" variant=\"white\">\n <Inline align=\"center\" gap=\"sm\">\n {label}\n {shortcut && <Kbd>{shortcut}</Kbd>}\n </Inline>\n </TooltipContent>\n </Tooltip>\n );\n}\n\nconst PrimaryActionContext = React.createContext(false);\n\ntype PageHeaderActionProps = ButtonProps & {\n label: string;\n iconOnly?: boolean;\n primary?: boolean;\n shortcut?: string;\n /** Show an explanation for a changing value; static labels need no tooltip. */\n tooltip?: boolean;\n};\n\nconst PageHeaderAction = React.forwardRef<HTMLButtonElement, PageHeaderActionProps>(\n (\n {\n label,\n iconOnly = false,\n primary: primaryProp,\n shortcut,\n tooltip = iconOnly || Boolean(shortcut),\n className,\n ...props\n },\n ref,\n ) => {\n const primaryContext = React.useContext(PrimaryActionContext);\n const primary = primaryProp ?? primaryContext;\n const button = (\n <Button\n ref={ref}\n aria-keyshortcuts={shortcut}\n aria-label={label}\n className={cn('[&_svg]:stroke-2!', className)}\n size={iconOnly ? 'icon' : undefined}\n variant={primary ? 'default' : 'ghost'}\n {...props}\n />\n );\n // A labelled action already shows its name, so its shortcut tooltip shows the keys alone.\n const tooltipLabel = iconOnly || !shortcut ? label : undefined;\n return primary || !tooltip ? (\n button\n ) : (\n <PageHeaderTooltip label={tooltipLabel} shortcut={shortcut}>\n <TooltipTrigger asChild>{button}</TooltipTrigger>\n </PageHeaderTooltip>\n );\n },\n);\nPageHeaderAction.displayName = 'PageHeaderAction';\n\nconst PageHeaderFilterTrigger = React.forwardRef<\n HTMLButtonElement,\n Omit<PageHeaderActionProps, 'label'>\n>((props, ref) => (\n <PageHeaderAction\n ref={ref}\n data-slot=\"filters-add\"\n label=\"Filter\"\n shortcut=\"F\"\n type=\"button\"\n {...props}\n >\n <ListFilter className=\"size-4\" />\n Filter\n </PageHeaderAction>\n));\nPageHeaderFilterTrigger.displayName = 'PageHeaderFilterTrigger';\n\nconst PageHeaderSelectTrigger = React.forwardRef<\n React.ElementRef<typeof SelectTrigger>,\n React.ComponentPropsWithoutRef<typeof SelectTrigger> & { label: string; tooltip?: boolean }\n>(({ label, tooltip = true, className, ...props }, ref) => {\n const { controlShape } = useShade();\n const trigger = (\n <SelectTrigger\n ref={ref}\n aria-label={label}\n className={cn(\n 'w-auto gap-1.5 font-medium [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-2! [&>svg]:mr-0',\n className,\n )}\n shape={controlShape}\n showChevron={false}\n variant=\"ghost\"\n {...props}\n />\n );\n return tooltip ? (\n <PageHeaderTooltip label={label}>\n <TooltipTrigger asChild>{trigger}</TooltipTrigger>\n </PageHeaderTooltip>\n ) : (\n trigger\n );\n});\nPageHeaderSelectTrigger.displayName = 'PageHeaderSelectTrigger';\n\n// ---------------------------------------------------------------------------\n// Title-block primitives\n// ---------------------------------------------------------------------------\n\nfunction PageHeaderBreadcrumb({ className, children }: PropsWithChildrenAndClassName) {\n return (\n <Inline\n align=\"center\"\n className={cn('pt-1 text-sm text-muted-foreground', className)}\n data-page-header=\"breadcrumb\"\n gap=\"sm\"\n >\n {children}\n </Inline>\n );\n}\n\nfunction PageHeaderCount({ className, children }: PropsWithChildrenAndClassName) {\n return (\n <Text\n as=\"span\"\n className={cn('ml-1 text-base tabular-nums', className)}\n data-page-header=\"count\"\n tone=\"secondary\"\n weight=\"regular\"\n >\n {children}\n </Text>\n );\n}\n\nfunction PageHeaderDescription({ className, children }: PropsWithChildrenAndClassName) {\n return (\n <Text as=\"p\" className={className} data-page-header=\"description\" size=\"sm\" tone=\"secondary\">\n {children}\n </Text>\n );\n}\n\nfunction PageHeaderMeta({ className, children }: PropsWithChildrenAndClassName) {\n return (\n <Text\n as=\"p\"\n className={cn('mt-0.5', className)}\n data-page-header=\"meta\"\n size=\"sm\"\n tone=\"secondary\"\n >\n {children}\n </Text>\n );\n}\n\n/**\n * `Title` accepts heading text plus optional `Count`, `Description`, and `Meta`\n * children. `Count` flows inline inside the H1; `Description` and `Meta` stack\n * below the heading.\n */\nfunction PageHeaderTitle({ className, children }: PropsWithChildrenAndClassName) {\n const largeTitle = React.useContext(PageHeaderLargeTitleContext);\n const registerLargeTitle = largeTitle?.registerTitle;\n React.useLayoutEffect(() => registerLargeTitle?.(), [registerLargeTitle]);\n\n const headingChildren: React.ReactNode[] = [];\n const subTextChildren: React.ReactNode[] = [];\n\n React.Children.forEach(children, (child) => {\n if (!React.isValidElement(child)) {\n headingChildren.push(child);\n return;\n }\n\n switch (child.type) {\n case PageHeaderDescription:\n case PageHeaderMeta:\n subTextChildren.push(child);\n break;\n default:\n headingChildren.push(child);\n }\n });\n\n // Shown large above the page's header, the title is that heading; the one\n // in the header is a stand-in, fading in as the header takes over\n if (largeTitle) {\n return (\n <>\n <H1\n aria-hidden=\"true\"\n className={cn(\n 'large-title-header-title text-lg font-semibold tracking-[0.1px] whitespace-nowrap',\n className,\n )}\n data-page-header=\"title\"\n >\n {headingChildren}\n </H1>\n {largeTitle.slot &&\n createPortal(\n <Stack data-page-header=\"large-title\" gap=\"none\">\n <H1\n className=\"flex items-baseline gap-3 font-medium tracking-[-0.03em] whitespace-nowrap [&_[data-page-header=count]]:tracking-normal\"\n data-large-title=\"\"\n // Inline, over Text's own line height\n style={{ fontSize: 'var(--large-title-size)', lineHeight: 1.15 }}\n >\n {headingChildren}\n </H1>\n {subTextChildren}\n </Stack>,\n largeTitle.slot,\n )}\n </>\n );\n }\n\n const heading = (\n <H1\n className={cn('text-lg font-semibold tracking-[0.1px] whitespace-nowrap', className)}\n data-page-header=\"title\"\n >\n {headingChildren}\n </H1>\n );\n\n if (subTextChildren.length > 0) {\n return (\n <Stack data-page-header=\"title-body\" gap=\"none\">\n {heading}\n {subTextChildren}\n </Stack>\n );\n }\n\n return heading;\n}\n\n// ---------------------------------------------------------------------------\n// Main row — Left (stack: Breadcrumb + Title) + Actions\n// ---------------------------------------------------------------------------\n\nfunction PageHeaderLeft({ className, children }: PropsWithChildrenAndClassName) {\n return (\n <Stack\n className={cn('h-full min-h-(--control-height) min-w-0', className)}\n data-page-header=\"left\"\n gap=\"xs\"\n justify=\"center\"\n >\n {children}\n </Stack>\n );\n}\n\ntype PageHeaderActionGroupPrimaryProps = PropsWithChildrenAndClassName;\nfunction PageHeaderActionGroupPrimary({ children, className }: PageHeaderActionGroupPrimaryProps) {\n if (React.Children.toArray(children).length === 0) {\n return null;\n }\n return (\n <PrimaryActionContext.Provider value={true}>\n <Inline\n className={cn('ms-3 shrink-0 first:ms-0', className)}\n data-page-header=\"primary\"\n gap=\"none\"\n >\n {children}\n </Inline>\n </PrimaryActionContext.Provider>\n );\n}\n\ntype PageHeaderActionGroupMobileMenuProps = React.PropsWithChildren;\nfunction PageHeaderActionGroupMobileMenu({ children }: PageHeaderActionGroupMobileMenuProps) {\n return <DropdownMenu>{children}</DropdownMenu>;\n}\n\ntype PageHeaderActionGroupMobileMenuTriggerProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuTrigger\n>;\nfunction PageHeaderActionGroupMobileMenuTrigger({\n children,\n ...props\n}: PageHeaderActionGroupMobileMenuTriggerProps) {\n return (\n <DropdownMenuTrigger asChild {...props}>\n {children}\n </DropdownMenuTrigger>\n );\n}\n\ntype PageHeaderActionGroupMobileMenuContentProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuContent\n>;\nfunction PageHeaderActionGroupMobileMenuContent({\n children,\n ...props\n}: PageHeaderActionGroupMobileMenuContentProps) {\n return (\n <DropdownMenuContent align=\"end\" sideOffset={8} {...props}>\n {children}\n </DropdownMenuContent>\n );\n}\n\nconst DEFAULT_MOBILE_MENU_BREAKPOINT = 640;\n\nconst isBelowBreakpoint = (breakpoint: number) => {\n if (typeof window === 'undefined') {\n return false;\n }\n\n return window.innerWidth < breakpoint;\n};\n\nconst useShouldCollapseActionGroup = (breakpoint: number) => {\n const [shouldCollapse, setShouldCollapse] = React.useState(() => isBelowBreakpoint(breakpoint));\n\n React.useEffect(() => {\n const onResize = () => {\n setShouldCollapse(isBelowBreakpoint(breakpoint));\n };\n\n onResize();\n window.addEventListener('resize', onResize);\n\n return () => {\n window.removeEventListener('resize', onResize);\n };\n }, [breakpoint]);\n\n return shouldCollapse;\n};\n\ntype PageHeaderActionGroupProps = PropsWithChildrenAndClassName & {\n mobileMenuBreakpoint?: number;\n};\ntype PageHeaderActionGroupComponent = React.FC<PageHeaderActionGroupProps> & {\n Primary: React.FC<PageHeaderActionGroupPrimaryProps>;\n MobileMenu: React.FC<PageHeaderActionGroupMobileMenuProps>;\n MobileMenuTrigger: React.FC<PageHeaderActionGroupMobileMenuTriggerProps>;\n MobileMenuContent: React.FC<PageHeaderActionGroupMobileMenuContentProps>;\n};\n\nconst PageHeaderActionGroup: PageHeaderActionGroupComponent = Object.assign(\n function PageHeaderActionGroup({\n className,\n children,\n mobileMenuBreakpoint = DEFAULT_MOBILE_MENU_BREAKPOINT,\n }: PageHeaderActionGroupProps) {\n const gap = 'sm';\n const childNodes = React.Children.toArray(children);\n const desktopChildren: React.ReactNode[] = [];\n let mobileMenu: React.ReactElement | null = null;\n let primaryAction: React.ReactNode = null;\n const shouldCollapse = useShouldCollapseActionGroup(mobileMenuBreakpoint);\n\n childNodes.forEach((child) => {\n if (!React.isValidElement(child)) {\n desktopChildren.push(child);\n return;\n }\n\n const childElement = child as React.ReactElement<{ children?: React.ReactNode }>;\n\n if (childElement.type === PageHeaderActionGroupMobileMenu) {\n mobileMenu = childElement;\n return;\n }\n\n if (childElement.type === PageHeaderActionGroupPrimary) {\n primaryAction = childElement;\n desktopChildren.push(childElement);\n return;\n }\n\n desktopChildren.push(childElement);\n });\n\n if (!mobileMenu) {\n return (\n <HeaderTooltipProvider>\n <Inline\n align=\"center\"\n className={className}\n data-page-header=\"action-group\"\n gap={gap}\n justify=\"end\"\n >\n {children}\n </Inline>\n </HeaderTooltipProvider>\n );\n }\n\n if (!shouldCollapse) {\n return (\n <HeaderTooltipProvider>\n <Inline\n align=\"center\"\n className={className}\n data-page-header=\"action-group\"\n gap={gap}\n justify=\"end\"\n >\n <Inline align=\"center\" data-page-header=\"action-group-desktop\" gap={gap} justify=\"end\">\n {desktopChildren}\n </Inline>\n </Inline>\n </HeaderTooltipProvider>\n );\n }\n\n return (\n <HeaderTooltipProvider>\n <Inline\n align=\"center\"\n className={className}\n data-page-header=\"action-group\"\n gap={gap}\n justify=\"end\"\n >\n <Inline\n align=\"center\"\n className=\"ml-auto\"\n data-page-header=\"action-group-mobile\"\n gap={gap}\n >\n {mobileMenu}\n {primaryAction}\n </Inline>\n </Inline>\n </HeaderTooltipProvider>\n );\n },\n {\n Primary: PageHeaderActionGroupPrimary,\n MobileMenu: PageHeaderActionGroupMobileMenu,\n MobileMenuTrigger: PageHeaderActionGroupMobileMenuTrigger,\n MobileMenuContent: PageHeaderActionGroupMobileMenuContent,\n },\n);\n\nfunction PageHeaderActions({ className, children }: PropsWithChildrenAndClassName) {\n return (\n <HeaderTooltipProvider>\n <Inline\n align=\"center\"\n className={cn('min-h-(--control-height) shrink-0', className)}\n data-page-header=\"actions\"\n gap=\"lg\"\n >\n {children}\n </Inline>\n </HeaderTooltipProvider>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Root\n// ---------------------------------------------------------------------------\n\ntype PageHeaderComponent = React.FC<PageHeaderProps> & {\n Left: React.FC<PropsWithChildrenAndClassName>;\n Breadcrumb: React.FC<PropsWithChildrenAndClassName>;\n Title: React.FC<PropsWithChildrenAndClassName>;\n Count: React.FC<PropsWithChildrenAndClassName>;\n Description: React.FC<PropsWithChildrenAndClassName>;\n Meta: React.FC<PropsWithChildrenAndClassName>;\n Actions: React.FC<PropsWithChildrenAndClassName>;\n ActionGroup: PageHeaderActionGroupComponent;\n Action: typeof PageHeaderAction;\n FilterTrigger: typeof PageHeaderFilterTrigger;\n SelectTrigger: typeof PageHeaderSelectTrigger;\n Tooltip: typeof PageHeaderTooltip;\n TooltipTrigger: typeof TooltipTrigger;\n};\n\n/**\n * PageHeader is the canonical page-chrome component for Ghost Admin pages.\n *\n * The main row contains `Left` (Breadcrumb + Title) and `Actions`.\n * Compose optional ViewBar and FilterBar rows beside it in ListPage.Header.\n * `Title` accepts an inline `Count` and stacked `Description`/`Meta` children.\n * See the design contract for the action ordering and interaction rules:\n * https://shade.ghost.org/docs/components/patterns/page-header.md (generated from page-header.mdx).\n */\nconst PageHeader: PageHeaderComponent = Object.assign(\n function PageHeader({\n className,\n children,\n sticky = true,\n blurredBackground = true,\n }: PageHeaderProps) {\n return (\n <header\n className={cn(\n 'flex flex-col',\n sticky && 'sticky top-0 z-50',\n blurredBackground &&\n 'bg-gradient-to-b from-background via-background/70 to-background/70 backdrop-blur-md',\n className,\n )}\n data-page-header=\"page-header\"\n >\n <Inline align=\"start\" className=\"w-full\" data-page-header=\"main\" gap=\"lg\" justify=\"between\">\n {children}\n </Inline>\n </header>\n );\n },\n {\n Left: PageHeaderLeft,\n Breadcrumb: PageHeaderBreadcrumb,\n Title: PageHeaderTitle,\n Count: PageHeaderCount,\n Description: PageHeaderDescription,\n Meta: PageHeaderMeta,\n Actions: PageHeaderActions,\n ActionGroup: PageHeaderActionGroup,\n Action: PageHeaderAction,\n FilterTrigger: PageHeaderFilterTrigger,\n SelectTrigger: PageHeaderSelectTrigger,\n Tooltip: PageHeaderTooltip,\n TooltipTrigger,\n },\n);\n\nexport {\n PageHeader,\n PageHeaderLeft,\n PageHeaderBreadcrumb,\n PageHeaderTitle,\n PageHeaderCount,\n PageHeaderDescription,\n PageHeaderMeta,\n PageHeaderActions,\n PageHeaderActionGroup,\n PageHeaderActionGroupPrimary,\n PageHeaderActionGroupMobileMenu,\n PageHeaderActionGroupMobileMen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P,aAAa;CACb,MAAM;CACN,SAAS;CACT,aAAa;CACb,QAAQ;CACR,eAAe;CACf,eAAe;CACf,SAAS;CACT;AACF,CACF"}
|
|
1
|
+
{"version":3,"file":"page-header.js","names":[],"sources":["../../../src/components/patterns/page-header.tsx"],"sourcesContent":["import { HeaderTooltipProvider } from '@/providers/header-tooltip-provider';\nimport { useShade } from '@/providers/shade-context';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuTrigger,\n} from '@/components/ui/dropdown-menu';\nimport { Button, type ButtonProps } from '@/components/ui/button';\nimport { SelectTrigger } from '@/components/ui/select';\nimport { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';\nimport { Kbd } from '@/components/ui/kbd';\nimport { H1 } from '@/components/layout/heading';\nimport { Inline, Stack, Text } from '@/components/primitives';\nimport { cn } from '@/lib/utils';\n\nimport React from 'react';\nimport { createPortal } from 'react-dom';\nimport { ListFilter } from 'lucide-react';\nimport { PageHeaderLargeTitleContext } from './page-header-large-title';\n\ntype PropsWithChildrenAndClassName = React.PropsWithChildren & {\n className?: string;\n};\n\ntype PageHeaderProps = PropsWithChildrenAndClassName & {\n sticky?: boolean;\n blurredBackground?: boolean;\n};\n\n/**\n * Header tooltips never belong on primary actions. A tooltip without a label\n * shows only the shortcut, for a control whose text already names it.\n */\nfunction PageHeaderTooltip({\n children,\n label,\n shortcut,\n}: React.PropsWithChildren<{ label?: string; shortcut?: string }>) {\n return (\n <Tooltip>\n {children}\n <TooltipContent side=\"bottom\" variant=\"white\">\n <Inline align=\"center\" gap=\"sm\">\n {label}\n {shortcut && <Kbd>{shortcut}</Kbd>}\n </Inline>\n </TooltipContent>\n </Tooltip>\n );\n}\n\nconst PrimaryActionContext = React.createContext(false);\n\ntype PageHeaderActionProps = ButtonProps & {\n label: string;\n iconOnly?: boolean;\n primary?: boolean;\n /**\n * A key the screen binds for this action. It shows in the tooltip and sets\n * `aria-keyshortcuts`, so pass it only when the screen handles the key.\n */\n shortcut?: string;\n /** Show an explanation for a changing value; static labels need no tooltip. */\n tooltip?: boolean;\n};\n\nconst PageHeaderAction = React.forwardRef<HTMLButtonElement, PageHeaderActionProps>(\n (\n {\n label,\n iconOnly = false,\n primary: primaryProp,\n shortcut,\n tooltip = iconOnly || Boolean(shortcut),\n className,\n ...props\n },\n ref,\n ) => {\n const primaryContext = React.useContext(PrimaryActionContext);\n const primary = primaryProp ?? primaryContext;\n const button = (\n <Button\n ref={ref}\n aria-keyshortcuts={shortcut}\n aria-label={label}\n className={cn('[&_svg]:stroke-2!', className)}\n size={iconOnly ? 'icon' : undefined}\n variant={primary ? 'default' : 'ghost'}\n {...props}\n />\n );\n // A labelled action already shows its name, so its shortcut tooltip shows the keys alone.\n const tooltipLabel = iconOnly || !shortcut ? label : undefined;\n return primary || !tooltip ? (\n button\n ) : (\n <PageHeaderTooltip label={tooltipLabel} shortcut={shortcut}>\n <TooltipTrigger asChild>{button}</TooltipTrigger>\n </PageHeaderTooltip>\n );\n },\n);\nPageHeaderAction.displayName = 'PageHeaderAction';\n\nconst PageHeaderFilterTrigger = React.forwardRef<\n HTMLButtonElement,\n Omit<PageHeaderActionProps, 'label'>\n>((props, ref) => (\n <PageHeaderAction\n ref={ref}\n data-slot=\"filters-add\"\n label=\"Filter\"\n shortcut=\"F\"\n type=\"button\"\n {...props}\n >\n <ListFilter className=\"size-4\" />\n Filter\n </PageHeaderAction>\n));\nPageHeaderFilterTrigger.displayName = 'PageHeaderFilterTrigger';\n\nconst PageHeaderSelectTrigger = React.forwardRef<\n React.ElementRef<typeof SelectTrigger>,\n React.ComponentPropsWithoutRef<typeof SelectTrigger> & { label: string; tooltip?: boolean }\n>(({ label, tooltip = true, className, ...props }, ref) => {\n const { controlShape } = useShade();\n const trigger = (\n <SelectTrigger\n ref={ref}\n aria-label={label}\n className={cn(\n 'w-auto gap-1.5 font-medium [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:stroke-2! [&>svg]:mr-0',\n className,\n )}\n shape={controlShape}\n showChevron={false}\n variant=\"ghost\"\n {...props}\n />\n );\n return tooltip ? (\n <PageHeaderTooltip label={label}>\n <TooltipTrigger asChild>{trigger}</TooltipTrigger>\n </PageHeaderTooltip>\n ) : (\n trigger\n );\n});\nPageHeaderSelectTrigger.displayName = 'PageHeaderSelectTrigger';\n\n// ---------------------------------------------------------------------------\n// Title-block primitives\n// ---------------------------------------------------------------------------\n\n// Crumbs truncate rather than wrapping under the title or running under the\n// actions. They render as blocks, since a flex link can't show an ellipsis.\n// Earlier crumbs keep their width up to a cap, so a long one can't crowd out\n// the current page, which shrinks to fit the rest.\nconst breadcrumbFitClassName =\n 'min-w-0 [&_nav]:min-w-0 [&_ol]:flex-nowrap [&_li]:shrink-0 [&_li>*]:block [&_li>*]:truncate [&_li:not(:last-child)>*]:max-w-40 [&_li:last-child]:min-w-0 [&_li:last-child]:shrink';\n\nfunction PageHeaderBreadcrumb({ className, children }: PropsWithChildrenAndClassName) {\n return (\n <Inline\n align=\"center\"\n className={cn('pt-1 text-sm text-muted-foreground', breadcrumbFitClassName, className)}\n data-page-header=\"breadcrumb\"\n gap=\"sm\"\n >\n {children}\n </Inline>\n );\n}\n\nfunction PageHeaderCount({ className, children }: PropsWithChildrenAndClassName) {\n return (\n <Text\n as=\"span\"\n className={cn('ml-1 text-base tabular-nums', className)}\n data-page-header=\"count\"\n tone=\"secondary\"\n weight=\"regular\"\n >\n {children}\n </Text>\n );\n}\n\nfunction PageHeaderDescription({ className, children }: PropsWithChildrenAndClassName) {\n return (\n <Text as=\"p\" className={className} data-page-header=\"description\" size=\"sm\" tone=\"secondary\">\n {children}\n </Text>\n );\n}\n\nfunction PageHeaderMeta({ className, children }: PropsWithChildrenAndClassName) {\n return (\n <Text\n as=\"p\"\n className={cn('mt-0.5', className)}\n data-page-header=\"meta\"\n size=\"sm\"\n tone=\"secondary\"\n >\n {children}\n </Text>\n );\n}\n\n/**\n * `Title` accepts heading text plus optional `Count`, `Description`, and `Meta`\n * children. `Count` flows inline inside the H1; `Description` and `Meta` stack\n * below the heading.\n */\nfunction PageHeaderTitle({ className, children }: PropsWithChildrenAndClassName) {\n const largeTitle = React.useContext(PageHeaderLargeTitleContext);\n const registerLargeTitle = largeTitle?.registerTitle;\n React.useLayoutEffect(() => registerLargeTitle?.(), [registerLargeTitle]);\n\n const headingChildren: React.ReactNode[] = [];\n const subTextChildren: React.ReactNode[] = [];\n\n React.Children.forEach(children, (child) => {\n if (!React.isValidElement(child)) {\n headingChildren.push(child);\n return;\n }\n\n switch (child.type) {\n case PageHeaderDescription:\n case PageHeaderMeta:\n subTextChildren.push(child);\n break;\n default:\n headingChildren.push(child);\n }\n });\n\n // Shown large above the page's header, the title is that heading; the one\n // in the header is a stand-in, fading in as the header takes over\n if (largeTitle) {\n return (\n <>\n <H1\n aria-hidden=\"true\"\n className={cn(\n 'large-title-header-title text-lg font-semibold tracking-[0.1px] whitespace-nowrap',\n className,\n )}\n data-page-header=\"title\"\n >\n {headingChildren}\n </H1>\n {largeTitle.slot &&\n createPortal(\n <Stack data-page-header=\"large-title\" gap=\"none\">\n <H1\n className=\"flex items-baseline gap-3 font-medium tracking-[-0.03em] whitespace-nowrap [&_[data-page-header=count]]:tracking-normal\"\n data-large-title=\"\"\n // Inline, over Text's own line height\n style={{ fontSize: 'var(--large-title-size)', lineHeight: 1.15 }}\n >\n {headingChildren}\n </H1>\n {subTextChildren}\n </Stack>,\n largeTitle.slot,\n )}\n </>\n );\n }\n\n const heading = (\n <H1\n className={cn('text-lg font-semibold tracking-[0.1px] whitespace-nowrap', className)}\n data-page-header=\"title\"\n >\n {headingChildren}\n </H1>\n );\n\n if (subTextChildren.length > 0) {\n return (\n <Stack data-page-header=\"title-body\" gap=\"none\">\n {heading}\n {subTextChildren}\n </Stack>\n );\n }\n\n return heading;\n}\n\n// ---------------------------------------------------------------------------\n// Main row — Left (stack: Breadcrumb + Title) + Actions\n// ---------------------------------------------------------------------------\n\nfunction PageHeaderLeft({ className, children }: PropsWithChildrenAndClassName) {\n return (\n <Stack\n className={cn('h-full min-h-(--control-height) min-w-0', className)}\n data-page-header=\"left\"\n gap=\"xs\"\n justify=\"center\"\n >\n {children}\n </Stack>\n );\n}\n\ntype PageHeaderActionGroupPrimaryProps = PropsWithChildrenAndClassName;\nfunction PageHeaderActionGroupPrimary({ children, className }: PageHeaderActionGroupPrimaryProps) {\n if (React.Children.toArray(children).length === 0) {\n return null;\n }\n return (\n <PrimaryActionContext.Provider value={true}>\n <Inline\n className={cn('ms-3 shrink-0 first:ms-0', className)}\n data-page-header=\"primary\"\n gap=\"none\"\n >\n {children}\n </Inline>\n </PrimaryActionContext.Provider>\n );\n}\n\ntype PageHeaderActionGroupMobileMenuProps = React.PropsWithChildren;\nfunction PageHeaderActionGroupMobileMenu({ children }: PageHeaderActionGroupMobileMenuProps) {\n return <DropdownMenu>{children}</DropdownMenu>;\n}\n\ntype PageHeaderActionGroupMobileMenuTriggerProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuTrigger\n>;\nfunction PageHeaderActionGroupMobileMenuTrigger({\n children,\n ...props\n}: PageHeaderActionGroupMobileMenuTriggerProps) {\n return (\n <DropdownMenuTrigger asChild {...props}>\n {children}\n </DropdownMenuTrigger>\n );\n}\n\ntype PageHeaderActionGroupMobileMenuContentProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuContent\n>;\nfunction PageHeaderActionGroupMobileMenuContent({\n children,\n ...props\n}: PageHeaderActionGroupMobileMenuContentProps) {\n return (\n <DropdownMenuContent align=\"end\" sideOffset={8} {...props}>\n {children}\n </DropdownMenuContent>\n );\n}\n\nconst DEFAULT_MOBILE_MENU_BREAKPOINT = 640;\n\nconst isBelowBreakpoint = (breakpoint: number) => {\n if (typeof window === 'undefined') {\n return false;\n }\n\n return window.innerWidth < breakpoint;\n};\n\nconst useShouldCollapseActionGroup = (breakpoint: number) => {\n const [shouldCollapse, setShouldCollapse] = React.useState(() => isBelowBreakpoint(breakpoint));\n\n React.useEffect(() => {\n const onResize = () => {\n setShouldCollapse(isBelowBreakpoint(breakpoint));\n };\n\n onResize();\n window.addEventListener('resize', onResize);\n\n return () => {\n window.removeEventListener('resize', onResize);\n };\n }, [breakpoint]);\n\n return shouldCollapse;\n};\n\ntype PageHeaderActionGroupProps = PropsWithChildrenAndClassName & {\n mobileMenuBreakpoint?: number;\n};\ntype PageHeaderActionGroupComponent = React.FC<PageHeaderActionGroupProps> & {\n Primary: React.FC<PageHeaderActionGroupPrimaryProps>;\n MobileMenu: React.FC<PageHeaderActionGroupMobileMenuProps>;\n MobileMenuTrigger: React.FC<PageHeaderActionGroupMobileMenuTriggerProps>;\n MobileMenuContent: React.FC<PageHeaderActionGroupMobileMenuContentProps>;\n};\n\nconst PageHeaderActionGroup: PageHeaderActionGroupComponent = Object.assign(\n function PageHeaderActionGroup({\n className,\n children,\n mobileMenuBreakpoint = DEFAULT_MOBILE_MENU_BREAKPOINT,\n }: PageHeaderActionGroupProps) {\n const gap = 'sm';\n const childNodes = React.Children.toArray(children);\n const desktopChildren: React.ReactNode[] = [];\n let mobileMenu: React.ReactElement | null = null;\n let primaryAction: React.ReactNode = null;\n const shouldCollapse = useShouldCollapseActionGroup(mobileMenuBreakpoint);\n\n childNodes.forEach((child) => {\n if (!React.isValidElement(child)) {\n desktopChildren.push(child);\n return;\n }\n\n const childElement = child as React.ReactElement<{ children?: React.ReactNode }>;\n\n if (childElement.type === PageHeaderActionGroupMobileMenu) {\n mobileMenu = childElement;\n return;\n }\n\n if (childElement.type === PageHeaderActionGroupPrimary) {\n primaryAction = childElement;\n desktopChildren.push(childElement);\n return;\n }\n\n desktopChildren.push(childElement);\n });\n\n if (!mobileMenu) {\n return (\n <HeaderTooltipProvider>\n <Inline\n align=\"center\"\n className={className}\n data-page-header=\"action-group\"\n gap={gap}\n justify=\"end\"\n >\n {children}\n </Inline>\n </HeaderTooltipProvider>\n );\n }\n\n if (!shouldCollapse) {\n return (\n <HeaderTooltipProvider>\n <Inline\n align=\"center\"\n className={className}\n data-page-header=\"action-group\"\n gap={gap}\n justify=\"end\"\n >\n <Inline align=\"center\" data-page-header=\"action-group-desktop\" gap={gap} justify=\"end\">\n {desktopChildren}\n </Inline>\n </Inline>\n </HeaderTooltipProvider>\n );\n }\n\n return (\n <HeaderTooltipProvider>\n <Inline\n align=\"center\"\n className={className}\n data-page-header=\"action-group\"\n gap={gap}\n justify=\"end\"\n >\n <Inline\n align=\"center\"\n className=\"ml-auto\"\n data-page-header=\"action-group-mobile\"\n gap={gap}\n >\n {mobileMenu}\n {primaryAction}\n </Inline>\n </Inline>\n </HeaderTooltipProvider>\n );\n },\n {\n Primary: PageHeaderActionGroupPrimary,\n MobileMenu: PageHeaderActionGroupMobileMenu,\n MobileMenuTrigger: PageHeaderActionGroupMobileMenuTrigger,\n MobileMenuContent: PageHeaderActionGroupMobileMenuContent,\n },\n);\n\nfunction PageHeaderActions({ className, children }: PropsWithChildrenAndClassName) {\n return (\n <HeaderTooltipProvider>\n <Inline\n align=\"center\"\n className={cn('min-h-(--control-height) shrink-0', className)}\n data-page-header=\"actions\"\n gap=\"lg\"\n >\n {children}\n </Inline>\n </HeaderTooltipProvider>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Root\n// ---------------------------------------------------------------------------\n\ntype PageHeaderComponent = React.FC<PageHeaderProps> & {\n Left: React.FC<PropsWithChildrenAndClassName>;\n Breadcrumb: React.FC<PropsWithChildrenAndClassName>;\n Title: React.FC<PropsWithChildrenAndClassName>;\n Count: React.FC<PropsWithChildrenAndClassName>;\n Description: React.FC<PropsWithChildrenAndClassName>;\n Meta: React.FC<PropsWithChildrenAndClassName>;\n Actions: React.FC<PropsWithChildrenAndClassName>;\n ActionGroup: PageHeaderActionGroupComponent;\n Action: typeof PageHeaderAction;\n FilterTrigger: typeof PageHeaderFilterTrigger;\n SelectTrigger: typeof PageHeaderSelectTrigger;\n Tooltip: typeof PageHeaderTooltip;\n TooltipTrigger: typeof TooltipTrigger;\n};\n\n/**\n * PageHeader is the canonical page-chrome component for Ghost Admin pages.\n *\n * The main row contains `Left` (Breadcrumb + Title) and `Actions`.\n * Compose optional ViewBar and FilterBar rows beside it in ListPage.Header.\n * `Title` accepts an inline `Count` and stacked `Description`/`Meta` children.\n * See the design contract for the action ordering and interaction rules:\n * https://shade.ghost.org/docs/components/patterns/page-header.md (generated from page-header.mdx).\n */\nconst PageHeader: PageHeaderComponent = Object.assign(\n function PageHeader({\n className,\n children,\n sticky = true,\n blurredBackground = true,\n }: PageHeaderProps) {\n return (\n <header\n className={cn(\n 'flex flex-col',\n sticky && 'sticky top-0 z-50',\n blurredBackground &&\n 'bg-gradient-to-b from-background via-background/70 to-background/70 backdrop-blur-md',\n className,\n )}\n data-page-header=\"page-header\"\n >\n <Inline align=\"start\" className=\"w-full\" data-page-header=\"main\" gap=\"lg\" justify=\"between\">\n {children}\n </Inline>\n </header>\n );\n },\n {\n Left: PageHeaderLeft,\n Breadcrumb: PageHeaderBreadcrumb,\n Title: PageHeaderTitle,\n Count: PageHeaderCount,\n Description: PageHeaderDescription,\n Meta: PageHeaderMeta,\n Actions: PageHeaderActions,\n ActionGroup: PageHeaderActionGroup,\n Action: PageHeaderAction,\n FilterTrigger: PageHeaderFilterTrigger,\n SelectTrigger: PageHeaderSelectTrigger,\n Tooltip: PageHeaderTooltip,\n TooltipTrigger,\n },\n);\n\nexport {\n PageHeader,\n PageHeaderLeft,\n PageHeaderBreadcrumb,\n PageHeaderTitle,\n PageHeaderCount,\n PageHeaderDescription,\n PageHeaderMeta,\n PageHeaderActions,\n PageHeaderActionGroup,\n PageHeaderActionGroupPrimary,\n PageHeaderActionGroupMobileMenu,\n PageHeaderActionGroupMobileMenuTrigger,\n PageHeaderActionGroupMobileMenuContent,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiCA,SAAS,kBAAkB,EACzB,UACA,OACA,YACiE;CACjE,OACE,qBAAC,SAAD,EAAA,UAAA,CACG,UACD,oBAAC,gBAAD;EAAgB,MAAK;EAAS,SAAQ;YACpC,qBAAC,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AAI,CAAC,gBACH,OACE,oBAAC,uBAAD,EAAA,UACE,oBAAC,QAAD;EACE,OAAM;EACK;EACX,oBAAiB;EACZ;EACL,SAAQ;YAER,oBAAC,QAAD;GAAQ,OAAM;GAAS,oBAAiB;GAA4B;GAAK,SAAQ;aAC9E;EACK,CAAA;CACF,CAAA,EACa,CAAA;CAI3B,OACE,oBAAC,uBAAD,EAAA,UACE,oBAAC,QAAD;EACE,OAAM;EACK;EACX,oBAAiB;EACZ;EACL,SAAQ;YAER,qBAAC,QAAD;GACE,OAAM;GACN,WAAU;GACV,oBAAiB;GACZ;aAJP,CAMG,YACA,aACK;;CACF,CAAA,EACa,CAAA;AAE3B,GACA;CACE,SAAS;CACT,YAAY;CACZ,mBAAmB;CACnB,mBAAmB;AACrB,CACF;AAEA,SAAS,kBAAkB,EAAE,WAAW,YAA2C;CACjF,OACE,oBAAC,uBAAD,EAAA,UACE,oBAAC,QAAD;EACE,OAAM;EACN,WAAW,GAAG,qCAAqC,SAAS;EAC5D,oBAAiB;EACjB,KAAI;EAEH;CACK,CAAA,EACa,CAAA;AAE3B;;;;;;;;;;AA+BA,IAAM,aAAkC,OAAO,OAC7C,SAAS,WAAW,EAClB,WACA,UACA,SAAS,MACT,oBAAoB,QACF;CAClB,OACE,oBAAC,UAAD;EACE,WAAW,GACT,iBACA,UAAU,qBACV,qBACE,wFACF,SACF;EACA,oBAAiB;YAEjB,oBAAC,QAAD;GAAQ,OAAM;GAAQ,WAAU;GAAS,oBAAiB;GAAO,KAAI;GAAK,SAAQ;GAC/E;EACK,CAAA;CACF,CAAA;AAEZ,GACA;CACE,MAAM;CACN,YAAY;CACZ,OAAO;CACP,OAAO;CACP,aAAa;CACb,MAAM;CACN,SAAS;CACT,aAAa;CACb,QAAQ;CACR,eAAe;CACf,eAAe;CACf,SAAS;CACT;AACF,CACF"}
|
|
@@ -33,7 +33,7 @@ var Trigger = React.forwardRef(({ asChild = true, className, ...props }, ref) =>
|
|
|
33
33
|
Trigger.displayName = "ShareModal.Trigger";
|
|
34
34
|
var Content = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DialogContent, {
|
|
35
35
|
ref,
|
|
36
|
-
className: cn("max-h-[calc(100vh-16vmin)] max-w-[540px] overflow-y-auto p-8", className),
|
|
36
|
+
className: cn("max-h-[calc(100vh-16vmin)] max-w-[540px] grid-cols-[minmax(0,1fr)] overflow-y-auto p-8", className),
|
|
37
37
|
...props
|
|
38
38
|
}));
|
|
39
39
|
Content.displayName = "ShareModal.Content";
|
|
@@ -221,7 +221,7 @@ function CopyURLBox({ children, className, copyURL, ...props }) {
|
|
|
221
221
|
className: cn("flex items-center gap-2 rounded-md border bg-muted p-2", className),
|
|
222
222
|
...props,
|
|
223
223
|
children: [/* @__PURE__ */ jsx("span", {
|
|
224
|
-
className: "min-w-0 flex-1 truncate px-2 text-
|
|
224
|
+
className: "min-w-0 flex-1 truncate px-2 text-(length:--text-field)",
|
|
225
225
|
children: copyURL
|
|
226
226
|
}), children]
|
|
227
227
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"share-modal.js","names":[],"sources":["../../../src/components/patterns/share-modal.tsx"],"sourcesContent":["import * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { Check, Copy, Link, X } from 'lucide-react';\nimport React, { useState } from 'react';\nimport { Button, type ButtonProps } from '@/components/ui/button';\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n} from '@/components/ui/dialog';\nimport { cn } from '@/lib/utils';\n\ntype ShareService = 'x' | 'threads' | 'facebook' | 'linkedin' | 'bluesky';\n\nexport type ShareModalSocialLink = {\n href: string;\n id?: string;\n label: string;\n service: ShareService;\n title?: string;\n};\n\nexport type ShareModalPreviewProps = {\n href: string;\n} & React.AnchorHTMLAttributes<HTMLAnchorElement>;\n\nasync function copyTextToClipboard(text: string) {\n if (navigator.clipboard?.writeText) {\n try {\n await navigator.clipboard.writeText(text);\n return;\n } catch {\n // Fall back for browser contexts where the async clipboard API is blocked.\n }\n }\n\n const textarea = document.createElement('textarea');\n textarea.value = text;\n textarea.setAttribute('readonly', '');\n textarea.style.position = 'fixed';\n textarea.style.left = '-9999px';\n textarea.style.top = '0';\n document.body.appendChild(textarea);\n textarea.select();\n document.execCommand('copy');\n document.body.removeChild(textarea);\n}\n\nfunction Root(props: React.ComponentPropsWithoutRef<typeof DialogPrimitive.Root>) {\n return <Dialog {...props} />;\n}\n\nconst Trigger = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Trigger>\n>(({ asChild = true, className, ...props }, ref) => (\n <DialogTrigger\n ref={ref}\n asChild={asChild}\n className={cn('cursor-pointer', className)}\n {...props}\n />\n));\nTrigger.displayName = 'ShareModal.Trigger';\n\nconst Content = React.forwardRef<\n React.ElementRef<typeof DialogContent>,\n React.ComponentPropsWithoutRef<typeof DialogContent>\n>(({ className, ...props }, ref) => (\n <DialogContent\n ref={ref}\n className={cn('max-h-[calc(100vh-16vmin)] max-w-[540px] overflow-y-auto p-8', className)}\n {...props}\n />\n));\nContent.displayName = 'ShareModal.Content';\n\nfunction Header({ className, ...props }: React.ComponentPropsWithoutRef<typeof DialogHeader>) {\n return <DialogHeader className={className} {...props} />;\n}\n\nfunction Title({ className, ...props }: React.ComponentPropsWithoutRef<typeof DialogTitle>) {\n return <DialogTitle className={className} {...props} />;\n}\n\nfunction Description({\n className,\n ...props\n}: React.ComponentPropsWithoutRef<typeof DialogDescription>) {\n return <DialogDescription className={className} {...props} />;\n}\n\ntype CloseButtonProps = ButtonProps;\n\nconst CloseButton = React.forwardRef<HTMLButtonElement, CloseButtonProps>(\n ({ children, className, size = 'lg', title = 'Close', variant = 'link', ...props }, ref) => (\n <Button\n ref={ref}\n className={cn(\n 'aspect-square cursor-pointer p-2 text-muted-foreground hover:text-foreground [&_svg]:size-6!',\n className,\n )}\n size={size}\n title={title}\n variant={variant}\n {...props}\n >\n {children || (\n <>\n <X size={24} strokeWidth={1} />\n <span className=\"sr-only\">Close</span>\n </>\n )}\n </Button>\n ),\n);\nCloseButton.displayName = 'ShareModal.CloseButton';\n\nconst Preview = React.forwardRef<HTMLAnchorElement, ShareModalPreviewProps>(\n ({ className, href, rel = 'noopener noreferrer', target = '_blank', ...props }, ref) => {\n return (\n <a\n ref={ref}\n className={cn(\n 'flex flex-col items-stretch overflow-hidden rounded-xl border transition-all hover:border-muted-foreground/40',\n className,\n )}\n href={href}\n rel={rel}\n target={target}\n {...props}\n />\n );\n },\n);\nPreview.displayName = 'ShareModal.Preview';\n\nfunction SocialIcon({ service }: { service: ShareService }) {\n if (service === 'threads') {\n return (\n <svg fill=\"none\" viewBox=\"0 0 18 18\">\n <g clipPath=\"url(#social-threads_svg__clip0_351_18008)\">\n <path\n d=\"M13.033 8.38a5.924 5.924 0 00-.223-.102c-.13-2.418-1.452-3.802-3.67-3.816h-.03c-1.327 0-2.43.566-3.11 1.597l1.22.837c.507-.77 1.304-.934 1.89-.934h.02c.73.004 1.282.217 1.639.63.26.302.433.72.519 1.245a9.334 9.334 0 00-2.097-.101c-2.109.121-3.465 1.351-3.374 3.06.047.868.478 1.614 1.216 2.1.624.413 1.428.614 2.263.568 1.103-.06 1.969-.48 2.572-1.25.459-.585.749-1.342.877-2.296.526.317.915.735 1.13 1.236.366.854.387 2.255-.756 3.398-1.003 1.002-2.207 1.435-4.028 1.448-2.02-.015-3.547-.663-4.54-1.925-.93-1.182-1.41-2.89-1.428-5.075.018-2.185.498-3.893 1.428-5.075.993-1.262 2.52-1.91 4.54-1.925 2.034.015 3.588.666 4.62 1.934.505.622.886 1.405 1.137 2.317l1.43-.382c-.305-1.122-.784-2.09-1.436-2.892C13.52 1.35 11.587.517 9.096.5h-.01C6.6.517 4.689 1.354 3.404 2.986 2.262 4.44 1.672 6.46 1.652 8.994v.012c.02 2.534.61 4.555 1.752 6.008C4.69 16.646 6.6 17.483 9.086 17.5h.01c2.21-.015 3.768-.594 5.051-1.876 1.68-1.678 1.629-3.78 1.075-5.07-.397-.927-1.154-1.678-2.189-2.175zm-3.816 3.587c-.924.052-1.884-.363-1.932-1.252-.035-.659.47-1.394 1.99-1.482a8.9 8.9 0 01.512-.014c.552 0 1.068.053 1.538.156-.175 2.187-1.203 2.542-2.108 2.592z\"\n fill=\"currentColor\"\n ></path>\n </g>\n <defs>\n <clipPath id=\"social-threads_svg__clip0_351_18008\">\n <path d=\"M0 0h17v17H0z\" fill=\"#fff\" transform=\"translate(.5 .5)\"></path>\n </clipPath>\n </defs>\n </svg>\n );\n }\n\n if (service === 'facebook') {\n return (\n <svg fill=\"none\" viewBox=\"0 0 40 40\">\n <path\n d=\"M20 40.004c11.046 0 20-8.955 20-20 0-11.046-8.954-20-20-20s-20 8.954-20 20c0 11.045 8.954 20 20 20z\"\n fill=\"#1977f3\"\n ></path>\n <path\n d=\"M27.785 25.785l.886-5.782h-5.546V16.25c0-1.58.773-3.125 3.26-3.125h2.522V8.204s-2.29-.39-4.477-.39c-4.568 0-7.555 2.767-7.555 7.781v4.408h-5.08v5.782h5.08v13.976a20.08 20.08 0 003.125.242c1.063 0 2.107-.085 3.125-.242V25.785h4.66z\"\n fill=\"#fff\"\n ></path>\n </svg>\n );\n }\n\n if (service === 'linkedin') {\n return (\n <svg fill=\"none\" viewBox=\"0 0 16 16\">\n <g clipPath=\"url(#social-linkedin_svg__clip0_537_833)\">\n <path\n clipRule=\"evenodd\"\n d=\"M1.778 16h12.444c.982 0 1.778-.796 1.778-1.778V1.778C16 .796 15.204 0 14.222 0H1.778C.796 0 0 .796 0 1.778v12.444C0 15.204.796 16 1.778 16z\"\n fill=\"#007ebb\"\n fillRule=\"evenodd\"\n ></path>\n <path\n clipRule=\"evenodd\"\n d=\"M13.778 13.778h-2.374V9.734c0-1.109-.421-1.729-1.299-1.729-.955 0-1.453.645-1.453 1.729v4.044H6.363V6.074h2.289v1.038s.688-1.273 2.322-1.273c1.634 0 2.804.997 2.804 3.061v4.878zM3.634 5.065c-.78 0-1.411-.636-1.411-1.421s.631-1.422 1.41-1.422c.78 0 1.411.637 1.411 1.422 0 .785-.631 1.421-1.41 1.421zm-1.182 8.713h2.386V6.074H2.452v7.704z\"\n fill=\"#fff\"\n fillRule=\"evenodd\"\n ></path>\n </g>\n <defs>\n <clipPath id=\"social-linkedin_svg__clip0_537_833\">\n <path d=\"M0 0h16v16H0z\" fill=\"#fff\"></path>\n </clipPath>\n </defs>\n </svg>\n );\n }\n\n if (service === 'bluesky') {\n return (\n <svg fill=\"none\" viewBox=\"0 -33.5 568 568\">\n <path\n d=\"M123.121 33.664C188.241 82.553 258.281 181.681 284 234.873c25.719-53.192 95.759-152.32 160.879-201.209C491.866-1.612 568-28.906 568 57.946c0 17.346-9.945 145.713-15.778 166.555-20.275 72.453-94.155 90.933-159.875 79.748 114.875 19.551 144.097 84.311 80.986 149.071-119.86 122.992-172.272-30.859-185.702-70.281-2.462-7.227-3.614-10.608-3.631-7.733-.017-2.875-1.169.506-3.631 7.733-13.43 39.422-65.842 193.273-185.702 70.281-63.111-64.76-33.889-129.52 80.986-149.071-65.72 11.185-139.6-7.295-159.875-79.748C9.945 203.659 0 75.292 0 57.946 0-28.906 76.135-1.612 123.121 33.664z\"\n fill=\"#0085ff\"\n ></path>\n </svg>\n );\n }\n\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\">\n <path\n d=\"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z\"\n fill=\"currentColor\"\n ></path>\n </svg>\n );\n}\n\ninterface SocialLinksProps extends React.HTMLAttributes<HTMLDivElement> {\n layout?: 'footer' | 'stacked';\n links: ShareModalSocialLink[];\n shape?: ButtonProps['shape'];\n variant?: ButtonProps['variant'];\n}\n\nfunction SocialLinks({\n className,\n layout = 'footer',\n links,\n shape,\n variant,\n ...props\n}: SocialLinksProps) {\n if (layout === 'stacked') {\n return (\n <div className={cn('flex gap-2', className)} {...props}>\n {links.map((link) => (\n <Button\n key={link.id ?? link.href}\n className=\"flex-1\"\n id={link.id}\n shape={shape}\n variant={variant ?? 'outline'}\n asChild\n >\n <a\n aria-label={link.label}\n href={link.href}\n rel=\"noreferrer\"\n target=\"_blank\"\n title={link.title || link.label}\n >\n <SocialIcon service={link.service} />\n <span className=\"sr-only\">{link.label}</span>\n </a>\n </Button>\n ))}\n </div>\n );\n }\n\n return (\n <div className={cn('flex items-center gap-2', className)} {...props}>\n {links.map((link) => (\n <Button\n key={link.id ?? link.href}\n className=\"w-12 flex-none px-3\"\n shape={shape}\n variant={variant ?? 'ghost'}\n asChild\n >\n <a\n aria-label={link.label}\n href={link.href}\n id={link.id}\n rel=\"noopener noreferrer\"\n target=\"_blank\"\n title={link.title || link.label}\n >\n <SocialIcon service={link.service} />\n </a>\n </Button>\n ))}\n </div>\n );\n}\n\ninterface CopyButtonProps extends ButtonProps {\n copyURL: string;\n icon?: 'copy' | 'link';\n label?: string;\n successLabel?: string;\n}\n\nfunction CopyButton({\n children,\n copyURL,\n disabled,\n icon = 'link',\n label = 'Copy link',\n onClick,\n successLabel = 'Copied!',\n ...props\n}: CopyButtonProps) {\n const [isCopied, setIsCopied] = useState(false);\n\n const handleCopyLink = async (event: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n\n if (event.defaultPrevented) {\n return;\n }\n\n await copyTextToClipboard(copyURL);\n setIsCopied(true);\n setTimeout(() => setIsCopied(false), 2000);\n };\n\n const Icon = icon === 'copy' ? Copy : Link;\n\n return (\n <Button\n disabled={disabled || !copyURL}\n type=\"button\"\n onClick={(event) => {\n void handleCopyLink(event);\n }}\n {...props}\n >\n {children || (\n <>\n {isCopied ? <Check /> : <Icon />}\n {isCopied ? successLabel : label}\n </>\n )}\n </Button>\n );\n}\n\ninterface CopyURLBoxProps extends React.HTMLAttributes<HTMLDivElement> {\n copyURL: string;\n}\n\nfunction CopyURLBox({ children, className, copyURL, ...props }: CopyURLBoxProps) {\n return (\n <div\n className={cn('flex items-center gap-2 rounded-md border bg-muted p-2', className)}\n {...props}\n >\n <span className=\"min-w-0 flex-1 truncate px-2 text-sm\">{copyURL}</span>\n {children}\n </div>\n );\n}\n\nfunction Footer({ className, ...props }: React.ComponentPropsWithoutRef<typeof DialogFooter>) {\n return <DialogFooter className={cn('justify-between gap-8 sm:gap-8', className)} {...props} />;\n}\n\nconst ShareModal = {\n CloseButton,\n Content,\n CopyButton,\n CopyURLBox,\n Description,\n Footer,\n Header,\n Preview,\n Root,\n SocialLinks,\n Title,\n Trigger,\n};\n\nexport default ShareModal;\n"],"mappings":";;;;;;;AA6BA,eAAe,oBAAoB,MAAc;CAC/C,IAAI,UAAU,WAAW,WACvB,IAAI;EACF,MAAM,UAAU,UAAU,UAAU,IAAI;EACxC;CACF,QAAQ,CAER;CAGF,MAAM,WAAW,SAAS,cAAc,UAAU;CAClD,SAAS,QAAQ;CACjB,SAAS,aAAa,YAAY,EAAE;CACpC,SAAS,MAAM,WAAW;CAC1B,SAAS,MAAM,OAAO;CACtB,SAAS,MAAM,MAAM;CACrB,SAAS,KAAK,YAAY,QAAQ;CAClC,SAAS,OAAO;CAChB,SAAS,YAAY,MAAM;CAC3B,SAAS,KAAK,YAAY,QAAQ;AACpC;AAEA,SAAS,KAAK,OAAoE;CAChF,OAAO,oBAAC,QAAD,EAAQ,GAAI,MAAQ,CAAA;AAC7B;AAEA,IAAM,UAAU,MAAM,YAGnB,EAAE,UAAU,MAAM,WAAW,GAAG,SAAS,QAC1C,oBAAC,eAAD;CACO;CACI;CACT,WAAW,GAAG,kBAAkB,SAAS;CACzC,GAAI;AACL,CAAA,CACF;AACD,QAAQ,cAAc;AAEtB,IAAM,UAAU,MAAM,YAGnB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,eAAD;CACO;CACL,WAAW,GAAG,gEAAgE,SAAS;CACvF,GAAI;AAC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S,GAAG,SAA0B;CAC/E,OACE,qBAAC,OAAD;EACE,WAAW,GAAG,0DAA0D,SAAS;EACjF,GAAI;YAFN,CAIE,oBAAC,QAAD;GAAM,WAAU;aAAwC;EAAc,CAAA,GACrE,QACE;;AAET;AAEA,SAAS,OAAO,EAAE,WAAW,GAAG,SAA8D;CAC5F,OAAO,oBAAC,cAAD;EAAc,WAAW,GAAG,kCAAkC,SAAS;EAAG,GAAI;CAAQ,CAAA;AAC/F;AAEA,IAAM,aAAa;CACjB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
|
|
1
|
+
{"version":3,"file":"share-modal.js","names":[],"sources":["../../../src/components/patterns/share-modal.tsx"],"sourcesContent":["import * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { Check, Copy, Link, X } from 'lucide-react';\nimport React, { useState } from 'react';\nimport { Button, type ButtonProps } from '@/components/ui/button';\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n} from '@/components/ui/dialog';\nimport { cn } from '@/lib/utils';\n\ntype ShareService = 'x' | 'threads' | 'facebook' | 'linkedin' | 'bluesky';\n\nexport type ShareModalSocialLink = {\n href: string;\n id?: string;\n label: string;\n service: ShareService;\n title?: string;\n};\n\nexport type ShareModalPreviewProps = {\n href: string;\n} & React.AnchorHTMLAttributes<HTMLAnchorElement>;\n\nasync function copyTextToClipboard(text: string) {\n if (navigator.clipboard?.writeText) {\n try {\n await navigator.clipboard.writeText(text);\n return;\n } catch {\n // Fall back for browser contexts where the async clipboard API is blocked.\n }\n }\n\n const textarea = document.createElement('textarea');\n textarea.value = text;\n textarea.setAttribute('readonly', '');\n textarea.style.position = 'fixed';\n textarea.style.left = '-9999px';\n textarea.style.top = '0';\n document.body.appendChild(textarea);\n textarea.select();\n document.execCommand('copy');\n document.body.removeChild(textarea);\n}\n\nfunction Root(props: React.ComponentPropsWithoutRef<typeof DialogPrimitive.Root>) {\n return <Dialog {...props} />;\n}\n\nconst Trigger = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Trigger>\n>(({ asChild = true, className, ...props }, ref) => (\n <DialogTrigger\n ref={ref}\n asChild={asChild}\n className={cn('cursor-pointer', className)}\n {...props}\n />\n));\nTrigger.displayName = 'ShareModal.Trigger';\n\nconst Content = React.forwardRef<\n React.ElementRef<typeof DialogContent>,\n React.ComponentPropsWithoutRef<typeof DialogContent>\n>(({ className, ...props }, ref) => (\n <DialogContent\n ref={ref}\n className={cn(\n 'max-h-[calc(100vh-16vmin)] max-w-[540px] grid-cols-[minmax(0,1fr)] overflow-y-auto p-8',\n className,\n )}\n {...props}\n />\n));\nContent.displayName = 'ShareModal.Content';\n\nfunction Header({ className, ...props }: React.ComponentPropsWithoutRef<typeof DialogHeader>) {\n return <DialogHeader className={className} {...props} />;\n}\n\nfunction Title({ className, ...props }: React.ComponentPropsWithoutRef<typeof DialogTitle>) {\n return <DialogTitle className={className} {...props} />;\n}\n\nfunction Description({\n className,\n ...props\n}: React.ComponentPropsWithoutRef<typeof DialogDescription>) {\n return <DialogDescription className={className} {...props} />;\n}\n\ntype CloseButtonProps = ButtonProps;\n\nconst CloseButton = React.forwardRef<HTMLButtonElement, CloseButtonProps>(\n ({ children, className, size = 'lg', title = 'Close', variant = 'link', ...props }, ref) => (\n <Button\n ref={ref}\n className={cn(\n 'aspect-square cursor-pointer p-2 text-muted-foreground hover:text-foreground [&_svg]:size-6!',\n className,\n )}\n size={size}\n title={title}\n variant={variant}\n {...props}\n >\n {children || (\n <>\n <X size={24} strokeWidth={1} />\n <span className=\"sr-only\">Close</span>\n </>\n )}\n </Button>\n ),\n);\nCloseButton.displayName = 'ShareModal.CloseButton';\n\nconst Preview = React.forwardRef<HTMLAnchorElement, ShareModalPreviewProps>(\n ({ className, href, rel = 'noopener noreferrer', target = '_blank', ...props }, ref) => {\n return (\n <a\n ref={ref}\n className={cn(\n 'flex flex-col items-stretch overflow-hidden rounded-xl border transition-all hover:border-muted-foreground/40',\n className,\n )}\n href={href}\n rel={rel}\n target={target}\n {...props}\n />\n );\n },\n);\nPreview.displayName = 'ShareModal.Preview';\n\nfunction SocialIcon({ service }: { service: ShareService }) {\n if (service === 'threads') {\n return (\n <svg fill=\"none\" viewBox=\"0 0 18 18\">\n <g clipPath=\"url(#social-threads_svg__clip0_351_18008)\">\n <path\n d=\"M13.033 8.38a5.924 5.924 0 00-.223-.102c-.13-2.418-1.452-3.802-3.67-3.816h-.03c-1.327 0-2.43.566-3.11 1.597l1.22.837c.507-.77 1.304-.934 1.89-.934h.02c.73.004 1.282.217 1.639.63.26.302.433.72.519 1.245a9.334 9.334 0 00-2.097-.101c-2.109.121-3.465 1.351-3.374 3.06.047.868.478 1.614 1.216 2.1.624.413 1.428.614 2.263.568 1.103-.06 1.969-.48 2.572-1.25.459-.585.749-1.342.877-2.296.526.317.915.735 1.13 1.236.366.854.387 2.255-.756 3.398-1.003 1.002-2.207 1.435-4.028 1.448-2.02-.015-3.547-.663-4.54-1.925-.93-1.182-1.41-2.89-1.428-5.075.018-2.185.498-3.893 1.428-5.075.993-1.262 2.52-1.91 4.54-1.925 2.034.015 3.588.666 4.62 1.934.505.622.886 1.405 1.137 2.317l1.43-.382c-.305-1.122-.784-2.09-1.436-2.892C13.52 1.35 11.587.517 9.096.5h-.01C6.6.517 4.689 1.354 3.404 2.986 2.262 4.44 1.672 6.46 1.652 8.994v.012c.02 2.534.61 4.555 1.752 6.008C4.69 16.646 6.6 17.483 9.086 17.5h.01c2.21-.015 3.768-.594 5.051-1.876 1.68-1.678 1.629-3.78 1.075-5.07-.397-.927-1.154-1.678-2.189-2.175zm-3.816 3.587c-.924.052-1.884-.363-1.932-1.252-.035-.659.47-1.394 1.99-1.482a8.9 8.9 0 01.512-.014c.552 0 1.068.053 1.538.156-.175 2.187-1.203 2.542-2.108 2.592z\"\n fill=\"currentColor\"\n ></path>\n </g>\n <defs>\n <clipPath id=\"social-threads_svg__clip0_351_18008\">\n <path d=\"M0 0h17v17H0z\" fill=\"#fff\" transform=\"translate(.5 .5)\"></path>\n </clipPath>\n </defs>\n </svg>\n );\n }\n\n if (service === 'facebook') {\n return (\n <svg fill=\"none\" viewBox=\"0 0 40 40\">\n <path\n d=\"M20 40.004c11.046 0 20-8.955 20-20 0-11.046-8.954-20-20-20s-20 8.954-20 20c0 11.045 8.954 20 20 20z\"\n fill=\"#1977f3\"\n ></path>\n <path\n d=\"M27.785 25.785l.886-5.782h-5.546V16.25c0-1.58.773-3.125 3.26-3.125h2.522V8.204s-2.29-.39-4.477-.39c-4.568 0-7.555 2.767-7.555 7.781v4.408h-5.08v5.782h5.08v13.976a20.08 20.08 0 003.125.242c1.063 0 2.107-.085 3.125-.242V25.785h4.66z\"\n fill=\"#fff\"\n ></path>\n </svg>\n );\n }\n\n if (service === 'linkedin') {\n return (\n <svg fill=\"none\" viewBox=\"0 0 16 16\">\n <g clipPath=\"url(#social-linkedin_svg__clip0_537_833)\">\n <path\n clipRule=\"evenodd\"\n d=\"M1.778 16h12.444c.982 0 1.778-.796 1.778-1.778V1.778C16 .796 15.204 0 14.222 0H1.778C.796 0 0 .796 0 1.778v12.444C0 15.204.796 16 1.778 16z\"\n fill=\"#007ebb\"\n fillRule=\"evenodd\"\n ></path>\n <path\n clipRule=\"evenodd\"\n d=\"M13.778 13.778h-2.374V9.734c0-1.109-.421-1.729-1.299-1.729-.955 0-1.453.645-1.453 1.729v4.044H6.363V6.074h2.289v1.038s.688-1.273 2.322-1.273c1.634 0 2.804.997 2.804 3.061v4.878zM3.634 5.065c-.78 0-1.411-.636-1.411-1.421s.631-1.422 1.41-1.422c.78 0 1.411.637 1.411 1.422 0 .785-.631 1.421-1.41 1.421zm-1.182 8.713h2.386V6.074H2.452v7.704z\"\n fill=\"#fff\"\n fillRule=\"evenodd\"\n ></path>\n </g>\n <defs>\n <clipPath id=\"social-linkedin_svg__clip0_537_833\">\n <path d=\"M0 0h16v16H0z\" fill=\"#fff\"></path>\n </clipPath>\n </defs>\n </svg>\n );\n }\n\n if (service === 'bluesky') {\n return (\n <svg fill=\"none\" viewBox=\"0 -33.5 568 568\">\n <path\n d=\"M123.121 33.664C188.241 82.553 258.281 181.681 284 234.873c25.719-53.192 95.759-152.32 160.879-201.209C491.866-1.612 568-28.906 568 57.946c0 17.346-9.945 145.713-15.778 166.555-20.275 72.453-94.155 90.933-159.875 79.748 114.875 19.551 144.097 84.311 80.986 149.071-119.86 122.992-172.272-30.859-185.702-70.281-2.462-7.227-3.614-10.608-3.631-7.733-.017-2.875-1.169.506-3.631 7.733-13.43 39.422-65.842 193.273-185.702 70.281-63.111-64.76-33.889-129.52 80.986-149.071-65.72 11.185-139.6-7.295-159.875-79.748C9.945 203.659 0 75.292 0 57.946 0-28.906 76.135-1.612 123.121 33.664z\"\n fill=\"#0085ff\"\n ></path>\n </svg>\n );\n }\n\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\">\n <path\n d=\"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z\"\n fill=\"currentColor\"\n ></path>\n </svg>\n );\n}\n\ninterface SocialLinksProps extends React.HTMLAttributes<HTMLDivElement> {\n layout?: 'footer' | 'stacked';\n links: ShareModalSocialLink[];\n shape?: ButtonProps['shape'];\n variant?: ButtonProps['variant'];\n}\n\nfunction SocialLinks({\n className,\n layout = 'footer',\n links,\n shape,\n variant,\n ...props\n}: SocialLinksProps) {\n if (layout === 'stacked') {\n return (\n <div className={cn('flex gap-2', className)} {...props}>\n {links.map((link) => (\n <Button\n key={link.id ?? link.href}\n className=\"flex-1\"\n id={link.id}\n shape={shape}\n variant={variant ?? 'outline'}\n asChild\n >\n <a\n aria-label={link.label}\n href={link.href}\n rel=\"noreferrer\"\n target=\"_blank\"\n title={link.title || link.label}\n >\n <SocialIcon service={link.service} />\n <span className=\"sr-only\">{link.label}</span>\n </a>\n </Button>\n ))}\n </div>\n );\n }\n\n return (\n <div className={cn('flex items-center gap-2', className)} {...props}>\n {links.map((link) => (\n <Button\n key={link.id ?? link.href}\n className=\"w-12 flex-none px-3\"\n shape={shape}\n variant={variant ?? 'ghost'}\n asChild\n >\n <a\n aria-label={link.label}\n href={link.href}\n id={link.id}\n rel=\"noopener noreferrer\"\n target=\"_blank\"\n title={link.title || link.label}\n >\n <SocialIcon service={link.service} />\n </a>\n </Button>\n ))}\n </div>\n );\n}\n\ninterface CopyButtonProps extends ButtonProps {\n copyURL: string;\n icon?: 'copy' | 'link';\n label?: string;\n successLabel?: string;\n}\n\nfunction CopyButton({\n children,\n copyURL,\n disabled,\n icon = 'link',\n label = 'Copy link',\n onClick,\n successLabel = 'Copied!',\n ...props\n}: CopyButtonProps) {\n const [isCopied, setIsCopied] = useState(false);\n\n const handleCopyLink = async (event: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(event);\n\n if (event.defaultPrevented) {\n return;\n }\n\n await copyTextToClipboard(copyURL);\n setIsCopied(true);\n setTimeout(() => setIsCopied(false), 2000);\n };\n\n const Icon = icon === 'copy' ? Copy : Link;\n\n return (\n <Button\n disabled={disabled || !copyURL}\n type=\"button\"\n onClick={(event) => {\n void handleCopyLink(event);\n }}\n {...props}\n >\n {children || (\n <>\n {isCopied ? <Check /> : <Icon />}\n {isCopied ? successLabel : label}\n </>\n )}\n </Button>\n );\n}\n\ninterface CopyURLBoxProps extends React.HTMLAttributes<HTMLDivElement> {\n copyURL: string;\n}\n\nfunction CopyURLBox({ children, className, copyURL, ...props }: CopyURLBoxProps) {\n return (\n <div\n className={cn('flex items-center gap-2 rounded-md border bg-muted p-2', className)}\n {...props}\n >\n <span className=\"min-w-0 flex-1 truncate px-2 text-(length:--text-field)\">{copyURL}</span>\n {children}\n </div>\n );\n}\n\nfunction Footer({ className, ...props }: React.ComponentPropsWithoutRef<typeof DialogFooter>) {\n return <DialogFooter className={cn('justify-between gap-8 sm:gap-8', className)} {...props} />;\n}\n\nconst ShareModal = {\n CloseButton,\n Content,\n CopyButton,\n CopyURLBox,\n Description,\n Footer,\n Header,\n Preview,\n Root,\n SocialLinks,\n Title,\n Trigger,\n};\n\nexport default ShareModal;\n"],"mappings":";;;;;;;AA6BA,eAAe,oBAAoB,MAAc;CAC/C,IAAI,UAAU,WAAW,WACvB,IAAI;EACF,MAAM,UAAU,UAAU,UAAU,IAAI;EACxC;CACF,QAAQ,CAER;CAGF,MAAM,WAAW,SAAS,cAAc,UAAU;CAClD,SAAS,QAAQ;CACjB,SAAS,aAAa,YAAY,EAAE;CACpC,SAAS,MAAM,WAAW;CAC1B,SAAS,MAAM,OAAO;CACtB,SAAS,MAAM,MAAM;CACrB,SAAS,KAAK,YAAY,QAAQ;CAClC,SAAS,OAAO;CAChB,SAAS,YAAY,MAAM;CAC3B,SAAS,KAAK,YAAY,QAAQ;AACpC;AAEA,SAAS,KAAK,OAAoE;CAChF,OAAO,oBAAC,QAAD,EAAQ,GAAI,MAAQ,CAAA;AAC7B;AAEA,IAAM,UAAU,MAAM,YAGnB,EAAE,UAAU,MAAM,WAAW,GAAG,SAAS,QAC1C,oBAAC,eAAD;CACO;CACI;CACT,WAAW,GAAG,kBAAkB,SAAS;CACzC,GAAI;AACL,CAAA,CACF;AACD,QAAQ,cAAc;AAEtB,IAAM,UAAU,MAAM,YAGnB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,eAAD;CACO;CACL,WAAW,GACT,0FACA,SACF;CACA,GAAI;AACL,CAAA,CACF;AACD,QAAQ,cAAc;AAEtB,SAAS,OAAO,EAAE,WAAW,GAAG,SAA8D;CAC5F,OAAO,oBAAC,cAAD;EAAyB;EAAW,GAAI;CAAQ,CAAA;AACzD;AAEA,SAAS,MAAM,EAAE,WAAW,GAAG,SAA6D;CAC1F,OAAO,oBAAC,aAAD;EAAwB;EAAW,GAAI;CAAQ,CAAA;AACx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CAAkC,SAAS;EAAG,GAAI;CAAQ,CAAA;AAC/F;AAEA,IAAM,aAAa;CACjB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
|
|
@@ -10,7 +10,7 @@ var AlertDialog = AlertDialogPrimitive.Root;
|
|
|
10
10
|
var AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
11
11
|
var AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
12
12
|
var AlertDialogOverlay = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(AlertDialogPrimitive.Overlay, {
|
|
13
|
-
className: cn("fixed inset-0 z-
|
|
13
|
+
className: cn("fixed inset-0 z-[1100] transform-gpu bg-black/30 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0 dark:bg-black/60", className),
|
|
14
14
|
...props,
|
|
15
15
|
ref
|
|
16
16
|
}));
|
|
@@ -20,7 +20,7 @@ var AlertDialogContent = React$1.forwardRef(({ className, overlayClassName, ...p
|
|
|
20
20
|
onClick: (e) => e.stopPropagation()
|
|
21
21
|
}), /* @__PURE__ */ jsx(AlertDialogPrimitive.Content, {
|
|
22
22
|
ref,
|
|
23
|
-
className: cn("fixed top-[20%] left-[50%] z-
|
|
23
|
+
className: cn("fixed top-[20%] left-[50%] z-[1100] grid w-full max-w-lg translate-x-[-50%] translate-y-[-20%] gap-6 bg-surface-elevated-2 p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:slide-out-to-top-[18%] data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:slide-in-from-top-[18%] sm:rounded-lg", className),
|
|
24
24
|
...props
|
|
25
25
|
})] }) }));
|
|
26
26
|
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-dialog.js","names":[],"sources":["../../../src/components/ui/alert-dialog.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';\n\nimport { cn } from '@/lib/utils';\nimport type { ButtonProps } from '@/components/ui/button';\nimport { buttonVariants } from '@/components/ui/button-variants';\nimport { useShade } from '@/providers/shade-context';\nimport { ShadeScope } from '@/shade-scope';\n\nconst AlertDialog = AlertDialogPrimitive.Root;\n\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger;\n\nconst AlertDialogPortal = AlertDialogPrimitive.Portal;\n\nconst AlertDialogOverlay = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Overlay\n className={cn(\n 'fixed inset-0 z-
|
|
1
|
+
{"version":3,"file":"alert-dialog.js","names":[],"sources":["../../../src/components/ui/alert-dialog.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';\n\nimport { cn } from '@/lib/utils';\nimport type { ButtonProps } from '@/components/ui/button';\nimport { buttonVariants } from '@/components/ui/button-variants';\nimport { useShade } from '@/providers/shade-context';\nimport { ShadeScope } from '@/shade-scope';\n\nconst AlertDialog = AlertDialogPrimitive.Root;\n\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger;\n\nconst AlertDialogPortal = AlertDialogPrimitive.Portal;\n\n// Above SettingsModal (z-[1000]), so an alert opened from a settings modal shows in front of it.\nconst AlertDialogOverlay = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Overlay\n className={cn(\n 'fixed inset-0 z-[1100] transform-gpu bg-black/30 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0 dark:bg-black/60',\n className,\n )}\n {...props}\n ref={ref}\n />\n));\nAlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;\n\ntype AlertDialogContentProps = React.ComponentPropsWithoutRef<\n typeof AlertDialogPrimitive.Content\n> & {\n overlayClassName?: string;\n};\n\nconst AlertDialogContent = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Content>,\n AlertDialogContentProps\n>(({ className, overlayClassName, ...props }, ref) => (\n <AlertDialogPortal>\n <ShadeScope>\n <AlertDialogOverlay className={overlayClassName} onClick={(e) => e.stopPropagation()} />\n <AlertDialogPrimitive.Content\n ref={ref}\n className={cn(\n 'fixed top-[20%] left-[50%] z-[1100] grid w-full max-w-lg translate-x-[-50%] translate-y-[-20%] gap-6 bg-surface-elevated-2 p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:slide-out-to-top-[18%] data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:slide-in-from-top-[18%] sm:rounded-lg',\n className,\n )}\n {...props}\n />\n </ShadeScope>\n </AlertDialogPortal>\n));\nAlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;\n\nconst AlertDialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col gap-y-2 text-center sm:text-left', className)} {...props} />\n);\nAlertDialogHeader.displayName = 'AlertDialogHeader';\n\nconst AlertDialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-2', className)}\n {...props}\n />\n);\nAlertDialogFooter.displayName = 'AlertDialogFooter';\n\nconst AlertDialogTitle = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Title\n ref={ref}\n className={cn('text-xl font-semibold in-data-[admin7-design=true]:font-title', className)}\n {...props}\n />\n));\nAlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;\n\nconst AlertDialogDescription = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Description ref={ref} className={cn('text-base', className)} {...props} />\n));\nAlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;\n\nconst AlertDialogAction = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Action>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action> & Pick<ButtonProps, 'variant'>\n>(({ className, variant, ...props }, ref) => {\n const { controlShape } = useShade();\n\n return (\n <AlertDialogPrimitive.Action\n ref={ref}\n className={cn(buttonVariants({ shape: controlShape, variant }), className)}\n {...props}\n data-control-shape={controlShape}\n />\n );\n});\nAlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;\n\nconst AlertDialogCancel = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Cancel>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>\n>(({ className, ...props }, ref) => {\n const { controlShape } = useShade();\n\n return (\n <AlertDialogPrimitive.Cancel\n ref={ref}\n className={cn(\n buttonVariants({ shape: controlShape, variant: 'outline' }),\n 'mt-2 sm:mt-0',\n className,\n )}\n {...props}\n data-control-shape={controlShape}\n />\n );\n});\nAlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;\n\nexport {\n AlertDialog,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogTrigger,\n AlertDialogContent,\n AlertDialogHeader,\n AlertDialogFooter,\n AlertDialogTitle,\n AlertDialogDescription,\n AlertDialogAction,\n AlertDialogCancel,\n};\n"],"mappings":";;;;;;;;AASA,IAAM,cAAc,qBAAqB;AAEzC,IAAM,qBAAqB,q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AAM,oBAAoB,QAAM,YAG7B,EAAE,WAAW,SAAS,GAAG,SAAS,QAAQ;CAC3C,MAAM,EAAE,iBAAiB,SAAS;CAElC,OACE,oBAAC,qBAAqB,QAAtB;EACO;EACL,WAAW,GAAG,eAAe;GAAE,OAAO;GAAc;EAAQ,CAAC,GAAG,SAAS;EACzE,GAAI;EACJ,sBAAoB;CACrB,CAAA;AAEL,CAAC;AACD,kBAAkB,cAAc,qBAAqB,OAAO;AAE5D,IAAM,oBAAoB,QAAM,YAG7B,EAAE,WAAW,GAAG,SAAS,QAAQ;CAClC,MAAM,EAAE,iBAAiB,SAAS;CAElC,OACE,oBAAC,qBAAqB,QAAtB;EACO;EACL,WAAW,GACT,eAAe;GAAE,OAAO;GAAc,SAAS;EAAU,CAAC,GAC1D,gBACA,SACF;EACA,GAAI;EACJ,sBAAoB;CACrB,CAAA;AAEL,CAAC;AACD,kBAAkB,cAAc,qBAAqB,OAAO"}
|
|
@@ -107,7 +107,7 @@ var CodeEditorView = forwardRef(function CodeEditorView({ title, value, height =
|
|
|
107
107
|
resizeObserver.observe(sizeRef.current);
|
|
108
108
|
return () => resizeObserver.disconnect();
|
|
109
109
|
}, []);
|
|
110
|
-
const styles = cn(inputSurface("within"), "peer
|
|
110
|
+
const styles = cn(inputSurface("within"), "peer w-full max-w-full overflow-hidden", clearBg && "bg-transparent", height === "full" && "h-full", !editable && "cursor-not-allowed opacity-50", codeMirrorClasses, className);
|
|
111
111
|
return /* @__PURE__ */ jsxs("div", {
|
|
112
112
|
className: cn("w-full", height === "full" && "h-full"),
|
|
113
113
|
children: [/* @__PURE__ */ jsx("div", { ref: sizeRef }), /* @__PURE__ */ jsxs(Stack, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-editor-view.js","names":[],"sources":["../../../src/components/ui/code-editor-view.tsx"],"sourcesContent":["import CodeMirror, {\n EditorView,\n tooltips,\n type BasicSetupOptions,\n type ReactCodeMirrorProps,\n type ReactCodeMirrorRef,\n} from '@uiw/react-codemirror';\nimport React, {\n type FocusEventHandler,\n forwardRef,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { FieldDescription, FieldLabel } from '@/components/ui/field';\nimport { inputSurface } from '@/components/ui/input-surface';\nimport { Stack } from '@/components/primitives/stack';\nimport { cn } from '@/lib/utils';\nimport { useFocusContext } from '@/providers/shade-context';\nimport type { Extension } from '@codemirror/state';\n\nexport interface CodeEditorProps extends Omit<\n ReactCodeMirrorProps,\n 'value' | 'onChange' | 'extensions' | 'title'\n> {\n title?: React.ReactNode;\n value?: string;\n height?: string;\n error?: boolean;\n hint?: React.ReactNode;\n clearBg?: boolean;\n extensions: Array<Extension | Promise<Extension> | (() => Extension | Promise<Extension>)>;\n ariaLabel?: string;\n onChange?: (value: string) => void;\n}\n\nconst codeMirrorClasses = [\n '[&_.cm-editor]:bg-transparent',\n '[&_.cm-editor]:border-transparent',\n '[&_.cm-scroller]:font-mono',\n '[&_.cm-scroller]:border-transparent',\n '[&_.cm-activeLine]:bg-transparent',\n '[&_.cm-activeLineGutter]:bg-transparent',\n '[&_.cm-gutters]:bg-muted',\n '[&_.cm-gutters]:text-muted-foreground',\n '[&_.cm-gutters]:border-border',\n '[&_.cm-cursor]:border-foreground',\n].join(' ');\n\n// Imported asynchronously by CodeEditor so CodeMirror stays out of the main bundle.\nconst CodeEditorView = forwardRef<ReactCodeMirrorRef, CodeEditorProps>(function CodeEditorView(\n {\n title,\n value,\n height = '200px',\n error,\n hint,\n clearBg = true,\n extensions,\n ariaLabel,\n editable = true,\n onChange,\n onFocus,\n onBlur,\n className,\n ...props\n },\n ref,\n) {\n const id = useId();\n const labelId = `${id}-label`;\n const hintId = `${id}-description`;\n const hasTitle = Boolean(title);\n const sizeRef = useRef<HTMLDivElement>(null);\n const { darkMode, setFocusState } = useFocusContext();\n const focusedRef = useRef(false);\n const setFocusStateRef = useRef(setFocusState);\n const [width, setWidth] = useState(100);\n const [resolvedExtensions, setResolvedExtensions] = useState<Extension[]>([]);\n\n setFocusStateRef.current = setFocusState;\n\n // Keep autocomplete outside the editor and accordion overflow boundaries.\n // CodeMirror can switch fixed tooltips to absolute after its first layout\n // measurement. A viewport-sized body host gives both positioning modes the\n // same coordinate space, preventing the visible first-frame jump.\n const [tooltipParent] = useState(() => document.createElement('div'));\n\n useEffect(() => {\n tooltipParent.className = 'shade cm-tooltip-parent pointer-events-none fixed inset-0 z-[60]';\n document.body.appendChild(tooltipParent);\n\n return () => {\n tooltipParent.remove();\n };\n }, [tooltipParent]);\n\n const basicSetup = useMemo<BasicSetupOptions>(\n () => ({\n crosshairCursor: false,\n searchKeymap: false,\n }),\n [],\n );\n\n const editorExtensions = useMemo(() => {\n const contentAttributes: Record<string, string> = { id };\n\n if (hasTitle) {\n contentAttributes['aria-labelledby'] = labelId;\n } else if (ariaLabel) {\n contentAttributes['aria-label'] = ariaLabel;\n }\n if (error) {\n contentAttributes['aria-invalid'] = 'true';\n }\n if (hint) {\n contentAttributes['aria-describedby'] = hintId;\n }\n if (!editable) {\n contentAttributes['aria-disabled'] = 'true';\n }\n\n return [\n ...resolvedExtensions,\n tooltips({ position: 'fixed', parent: tooltipParent }),\n EditorView.contentAttributes.of(contentAttributes),\n ];\n }, [\n ariaLabel,\n editable,\n error,\n hasTitle,\n hint,\n hintId,\n id,\n labelId,\n resolvedExtensions,\n tooltipParent,\n ]);\n\n const handleFocus: FocusEventHandler<HTMLDivElement> = (event) => {\n onFocus?.(event);\n focusedRef.current = true;\n setFocusState(true);\n };\n\n const handleBlur: FocusEventHandler<HTMLDivElement> = (event) => {\n onBlur?.(event);\n focusedRef.current = false;\n setFocusState(false);\n };\n\n const handleLabelClick = () => {\n if (editable) {\n document.getElementById(id)?.focus();\n }\n };\n\n useEffect(() => {\n return () => {\n if (focusedRef.current) {\n setFocusStateRef.current(false);\n }\n };\n }, []);\n\n useEffect(() => {\n let cancelled = false;\n\n const pendingExtensions = extensions.map((extension) =>\n typeof extension === 'function' ? extension() : extension,\n );\n\n Promise.all(pendingExtensions).then(\n (nextExtensions) => {\n if (!cancelled) {\n setResolvedExtensions(nextExtensions);\n }\n },\n () => {\n if (!cancelled) {\n setResolvedExtensions([]);\n }\n },\n );\n\n return () => {\n cancelled = true;\n };\n }, [extensions]);\n\n useEffect(() => {\n const resizeObserver = new ResizeObserver(([entry]) => {\n setWidth(entry.contentRect.width);\n });\n\n resizeObserver.observe(sizeRef.current!);\n\n return () => resizeObserver.disconnect();\n }, []);\n\n const styles = cn(\n inputSurface('within'),\n 'peer
|
|
1
|
+
{"version":3,"file":"code-editor-view.js","names":[],"sources":["../../../src/components/ui/code-editor-view.tsx"],"sourcesContent":["import CodeMirror, {\n EditorView,\n tooltips,\n type BasicSetupOptions,\n type ReactCodeMirrorProps,\n type ReactCodeMirrorRef,\n} from '@uiw/react-codemirror';\nimport React, {\n type FocusEventHandler,\n forwardRef,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { FieldDescription, FieldLabel } from '@/components/ui/field';\nimport { inputSurface } from '@/components/ui/input-surface';\nimport { Stack } from '@/components/primitives/stack';\nimport { cn } from '@/lib/utils';\nimport { useFocusContext } from '@/providers/shade-context';\nimport type { Extension } from '@codemirror/state';\n\nexport interface CodeEditorProps extends Omit<\n ReactCodeMirrorProps,\n 'value' | 'onChange' | 'extensions' | 'title'\n> {\n title?: React.ReactNode;\n value?: string;\n height?: string;\n error?: boolean;\n hint?: React.ReactNode;\n clearBg?: boolean;\n extensions: Array<Extension | Promise<Extension> | (() => Extension | Promise<Extension>)>;\n ariaLabel?: string;\n onChange?: (value: string) => void;\n}\n\nconst codeMirrorClasses = [\n '[&_.cm-editor]:bg-transparent',\n '[&_.cm-editor]:border-transparent',\n '[&_.cm-scroller]:font-mono',\n '[&_.cm-scroller]:border-transparent',\n '[&_.cm-activeLine]:bg-transparent',\n '[&_.cm-activeLineGutter]:bg-transparent',\n '[&_.cm-gutters]:bg-muted',\n '[&_.cm-gutters]:text-muted-foreground',\n '[&_.cm-gutters]:border-border',\n '[&_.cm-cursor]:border-foreground',\n].join(' ');\n\n// Imported asynchronously by CodeEditor so CodeMirror stays out of the main bundle.\nconst CodeEditorView = forwardRef<ReactCodeMirrorRef, CodeEditorProps>(function CodeEditorView(\n {\n title,\n value,\n height = '200px',\n error,\n hint,\n clearBg = true,\n extensions,\n ariaLabel,\n editable = true,\n onChange,\n onFocus,\n onBlur,\n className,\n ...props\n },\n ref,\n) {\n const id = useId();\n const labelId = `${id}-label`;\n const hintId = `${id}-description`;\n const hasTitle = Boolean(title);\n const sizeRef = useRef<HTMLDivElement>(null);\n const { darkMode, setFocusState } = useFocusContext();\n const focusedRef = useRef(false);\n const setFocusStateRef = useRef(setFocusState);\n const [width, setWidth] = useState(100);\n const [resolvedExtensions, setResolvedExtensions] = useState<Extension[]>([]);\n\n setFocusStateRef.current = setFocusState;\n\n // Keep autocomplete outside the editor and accordion overflow boundaries.\n // CodeMirror can switch fixed tooltips to absolute after its first layout\n // measurement. A viewport-sized body host gives both positioning modes the\n // same coordinate space, preventing the visible first-frame jump.\n const [tooltipParent] = useState(() => document.createElement('div'));\n\n useEffect(() => {\n tooltipParent.className = 'shade cm-tooltip-parent pointer-events-none fixed inset-0 z-[60]';\n document.body.appendChild(tooltipParent);\n\n return () => {\n tooltipParent.remove();\n };\n }, [tooltipParent]);\n\n const basicSetup = useMemo<BasicSetupOptions>(\n () => ({\n crosshairCursor: false,\n searchKeymap: false,\n }),\n [],\n );\n\n const editorExtensions = useMemo(() => {\n const contentAttributes: Record<string, string> = { id };\n\n if (hasTitle) {\n contentAttributes['aria-labelledby'] = labelId;\n } else if (ariaLabel) {\n contentAttributes['aria-label'] = ariaLabel;\n }\n if (error) {\n contentAttributes['aria-invalid'] = 'true';\n }\n if (hint) {\n contentAttributes['aria-describedby'] = hintId;\n }\n if (!editable) {\n contentAttributes['aria-disabled'] = 'true';\n }\n\n return [\n ...resolvedExtensions,\n tooltips({ position: 'fixed', parent: tooltipParent }),\n EditorView.contentAttributes.of(contentAttributes),\n ];\n }, [\n ariaLabel,\n editable,\n error,\n hasTitle,\n hint,\n hintId,\n id,\n labelId,\n resolvedExtensions,\n tooltipParent,\n ]);\n\n const handleFocus: FocusEventHandler<HTMLDivElement> = (event) => {\n onFocus?.(event);\n focusedRef.current = true;\n setFocusState(true);\n };\n\n const handleBlur: FocusEventHandler<HTMLDivElement> = (event) => {\n onBlur?.(event);\n focusedRef.current = false;\n setFocusState(false);\n };\n\n const handleLabelClick = () => {\n if (editable) {\n document.getElementById(id)?.focus();\n }\n };\n\n useEffect(() => {\n return () => {\n if (focusedRef.current) {\n setFocusStateRef.current(false);\n }\n };\n }, []);\n\n useEffect(() => {\n let cancelled = false;\n\n const pendingExtensions = extensions.map((extension) =>\n typeof extension === 'function' ? extension() : extension,\n );\n\n Promise.all(pendingExtensions).then(\n (nextExtensions) => {\n if (!cancelled) {\n setResolvedExtensions(nextExtensions);\n }\n },\n () => {\n if (!cancelled) {\n setResolvedExtensions([]);\n }\n },\n );\n\n return () => {\n cancelled = true;\n };\n }, [extensions]);\n\n useEffect(() => {\n const resizeObserver = new ResizeObserver(([entry]) => {\n setWidth(entry.contentRect.width);\n });\n\n resizeObserver.observe(sizeRef.current!);\n\n return () => resizeObserver.disconnect();\n }, []);\n\n const styles = cn(\n inputSurface('within'),\n 'peer w-full max-w-full overflow-hidden',\n clearBg && 'bg-transparent',\n height === 'full' && 'h-full',\n !editable && 'cursor-not-allowed opacity-50',\n codeMirrorClasses,\n className,\n );\n\n return (\n <div className={cn('w-full', height === 'full' && 'h-full')}>\n <div ref={sizeRef} />\n <Stack className={height === 'full' ? 'h-full' : ''} gap=\"xs\" style={{ width }}>\n {title && (\n <FieldLabel id={labelId} onClick={handleLabelClick}>\n {title}\n </FieldLabel>\n )}\n <CodeMirror\n ref={ref}\n basicSetup={basicSetup}\n className={styles}\n editable={editable}\n extensions={editorExtensions}\n height={height === 'full' ? '100%' : height}\n theme={darkMode ? 'dark' : 'light'}\n value={value}\n onBlur={handleBlur}\n onChange={onChange}\n onFocus={handleFocus}\n {...props}\n />\n {hint && (\n <FieldDescription className={cn(error && 'text-destructive')} id={hintId}>\n {hint}\n </FieldDescription>\n )}\n </Stack>\n </div>\n );\n});\n\nCodeEditorView.displayName = 'CodeEditorView';\n\nexport default CodeEditorView;\n"],"mappings":";;;;;;;;;AAuCA,IAAM,oBAAoB;CACxB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC,CAAC,KAAK,GAAG;AAGV,IAAM,iBAAiB,WAAgD,SAAS,eAC9E,EACE,OACA,OACA,SAAS,SACT,OACA,MACA,UAAU,MACV,YACA,WACA,WAAW,MACX,UACA,SACA,QACA,WACA,GAAG,SAEL,KACA;CACA,MAAM,KAAK,MAAM;CACjB,MAAM,UAAU,GAAG,GAAG;CACtB,MAAM,SAAS,GAAG,GAAG;CACrB,MAAM,WAAW,QAAQ,KAAK;CAC9B,MAAM,UAAU,OAAuB,IAAI;CAC3C,MAAM,EAAE,UAAU,kBAAkB,gBAAgB;CACpD,MAAM,aAAa,OAAO,KAAK;CAC/B,MAAM,mBAAmB,OAAO,aAAa;CAC7C,MAAM,CAAC,OAAO,YAAY,SAAS,GAAG;CACtC,MAAM,CAAC,oBAAoB,yBAAyB,SAAsB,CAAC,CAAC;CAE5E,iBAAiB,UAAU;CAM3B,MAAM,CAAC,iBAAiB,eAAe,SAAS,cAAc,KAAK,CAAC;CAEpE,gBAAgB;EACd,cAAc,YAAY;EAC1B,SAAS,KAAK,YAAY,aAAa;EAEvC,aAAa;GACX,cAAc,OAAO;EACvB;CACF,GAAG,CAAC,aAAa,CAAC;CAElB,MAAM,aAAa,eACV;EACL,iBAAiB;EACjB,cAAc;CAChB,IACA,CAAC,CACH;CAEA,MAAM,mBAAmB,cAAc;EACrC,MAAM,oBAA4C,EAAE,GAAG;EAEvD,IAAI,UACF,kBAAkB,qBAAqB;OAClC,IAAI,WACT,kBAAkB,gBAAgB;EAEpC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iCACb,mBACA,SACF;CAEA,OACE,qBAAC,OAAD;EAAK,WAAW,GAAG,UAAU,WAAW,UAAU,QAAQ;YAA1D,CACE,oBAAC,OAAD,EAAK,KAAK,QAAU,CAAA,GACpB,qBAAC,OAAD;GAAO,WAAW,WAAW,SAAS,WAAW;GAAI,KAAI;GAAK,OAAO,EAAE,MAAM;aAA7E;IACG,SACC,oBAAC,YAAD;KAAY,IAAI;KAAS,SAAS;eAC/B;IACS,CAAA;IAEd,oBAAC,YAAD;KACO;KACO;KACZ,WAAW;KACD;KACV,YAAY;KACZ,QAAQ,WAAW,SAAS,SAAS;KACrC,OAAO,WAAW,SAAS;KACpB;KACP,QAAQ;KACE;KACV,SAAS;KACT,GAAI;IACL,CAAA;IACA,QACC,oBAAC,kBAAD;KAAkB,WAAW,GAAG,SAAS,kBAAkB;KAAG,IAAI;eAC/D;IACe,CAAA;GAEf;IACJ;;AAET,CAAC;AAED,eAAe,cAAc"}
|
|
@@ -22,7 +22,7 @@ var DialogOverlay = React$1.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
22
22
|
...props
|
|
23
23
|
}));
|
|
24
24
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
25
|
-
var dialogPanelClassName = "z-50 grid w-full max-w-lg transform-gpu gap-6 bg-surface-elevated-2 p-6 shadow-lg outline-hidden duration-200 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";
|
|
25
|
+
var dialogPanelClassName = "z-50 grid w-full max-w-lg transform-gpu gap-6 bg-surface-elevated-2 p-6 shadow-lg [--sticky-footer-background:var(--surface-elevated-2)] outline-hidden duration-200 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";
|
|
26
26
|
var DialogContent = React$1.forwardRef(({ className, children, scroll = "fixed", ...props }, ref) => {
|
|
27
27
|
const modal = React$1.useContext(DialogModalContext);
|
|
28
28
|
const panel = /* @__PURE__ */ jsx(DialogPrimitive.Content, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","names":[],"sources":["../../../src/components/ui/dialog.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\n\nimport { cn } from '@/lib/utils';\nimport { ShadeScope } from '@/shade-scope';\n\n// Radix keeps whether a dialog is modal to itself, and the overlay scroll layout needs to know.\nconst DialogModalContext = React.createContext(true);\n\nconst Dialog = ({ modal = true, ...props }: React.ComponentProps<typeof DialogPrimitive.Root>) => (\n <DialogModalContext.Provider value={modal}>\n <DialogPrimitive.Root modal={modal} {...props} />\n </DialogModalContext.Provider>\n);\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = DialogPrimitive.Portal;\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'fixed inset-0 z-50 transform-gpu bg-black/30 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0 dark:bg-black/60',\n className,\n )}\n data-slot=\"dialog-overlay\"\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\n// The panel itself, shared by both ways a dialog can sit on the page.\nconst dialogPanelClassName =\n 'z-50 grid w-full max-w-lg transform-gpu gap-6 bg-surface-elevated-2 p-6 shadow-lg outline-hidden duration-200 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\nexport interface DialogContentProps extends React.ComponentPropsWithoutRef<\n typeof DialogPrimitive.Content\n> {\n /**\n * How a dialog taller than the window scrolls. `fixed` (the default) pins the dialog near\n * the top of the window, so it needs its own height limit and inner scroll. `overlay` makes\n * the backdrop the scroll container instead: the whole dialog scrolls as one piece, the way\n * a page does.\n */\n scroll?: 'fixed' | 'overlay';\n}\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n DialogContentProps\n>(({ className, children, scroll = 'fixed', ...props }, ref) => {\n const modal = React.useContext(DialogModalContext);\n\n const panel = (\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n scroll === 'overlay'\n ? 'pointer-events-auto relative rounded-lg'\n : 'fixed top-[8vmin] left-[50%] translate-x-[-50%] sm:rounded-lg',\n dialogPanelClassName,\n className,\n )}\n {...props}\n >\n {children}\n </DialogPrimitive.Content>\n );\n\n // The space around the dialog is padding on this wrapper, not on the scroll container:\n // browsers leave a scroll container's own bottom padding out of what it scrolls, which\n // would leave the dialog flush with the bottom of the window.\n const scrollingPanel = (\n <div className=\"flex min-h-full items-start justify-center px-4 py-[8vmin]\">{panel}</div>\n );\n\n return (\n <DialogPortal>\n <ShadeScope>\n {scroll === 'overlay' ? (\n modal ? (\n // The dialog sits inside the backdrop here, so the backdrop animates as long as the\n // dialog does; otherwise closing unmounts the dialog part-way through its animation.\n <DialogOverlay className=\"overflow-y-auto duration-200\">{scrollingPanel}</DialogOverlay>\n ) : (\n // Radix renders no backdrop for a non-modal dialog, and the page behind stays\n // usable, so this scroll container lets presses beside the dialog through.\n <div\n className=\"pointer-events-none fixed inset-0 z-50 overflow-y-auto\"\n data-slot=\"dialog-scroller\"\n >\n {scrollingPanel}\n </div>\n )\n ) : (\n <>\n <DialogOverlay />\n {panel}\n </>\n )}\n </ShadeScope>\n </DialogPortal>\n );\n});\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col gap-y-1.5 text-center sm:text-left', className)} {...props} />\n);\nDialogHeader.displayName = 'DialogHeader';\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col-reverse sm:flex-row sm:items-end sm:justify-end sm:gap-2',\n className,\n )}\n {...props}\n />\n);\nDialogFooter.displayName = 'DialogFooter';\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\n 'text-xl leading-none font-semibold tracking-tight in-data-[admin7-design=true]:font-title',\n className,\n )}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-muted-foreground', className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogTrigger,\n DialogClose,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n};\n"],"mappings":";;;;;;AAOA,IAAM,qBAAqB,QAAM,cAAc,IAAI;AAEnD,IAAM,UAAU,EAAE,QAAQ,MAAM,GAAG,YACjC,oBAAC,mBAAmB,UAApB;CAA6B,OAAO;WAClC,oBAAC,gBAAgB,MAAjB;EAA6B;EAAO,GAAI;CAAQ,CAAA;AACrB,CAAA;AAG/B,IAAM,gBAAgB,gBAAgB;AAEtC,IAAM,eAAe,gBAAgB;AAErC,IAAM,cAAc,gBAAgB;AAEpC,IAAM,gBAAgB,QAAM,YAGzB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,SAAjB;CACO;CACL,WAAW,GACT,yLACA,SACF;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,QAC1B,oBAAC,gBAAgB,aAAjB;CACO;CACL,WAAW,GAAG,yBAAyB,SAAS;CAChD,GAAI;AACL,CAAA,CACF;AACD,kBAAkB,cAAc,gBAAgB,YAAY"}
|
|
1
|
+
{"version":3,"file":"dialog.js","names":[],"sources":["../../../src/components/ui/dialog.tsx"],"sourcesContent":["import * as React from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\n\nimport { cn } from '@/lib/utils';\nimport { ShadeScope } from '@/shade-scope';\n\n// Radix keeps whether a dialog is modal to itself, and the overlay scroll layout needs to know.\nconst DialogModalContext = React.createContext(true);\n\nconst Dialog = ({ modal = true, ...props }: React.ComponentProps<typeof DialogPrimitive.Root>) => (\n <DialogModalContext.Provider value={modal}>\n <DialogPrimitive.Root modal={modal} {...props} />\n </DialogModalContext.Provider>\n);\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = DialogPrimitive.Portal;\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'fixed inset-0 z-50 transform-gpu bg-black/30 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0 dark:bg-black/60',\n className,\n )}\n data-slot=\"dialog-overlay\"\n {...props}\n />\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\n// The panel itself, shared by both ways a dialog can sit on the page.\nconst dialogPanelClassName =\n 'z-50 grid w-full max-w-lg transform-gpu gap-6 bg-surface-elevated-2 p-6 shadow-lg [--sticky-footer-background:var(--surface-elevated-2)] outline-hidden duration-200 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\nexport interface DialogContentProps extends React.ComponentPropsWithoutRef<\n typeof DialogPrimitive.Content\n> {\n /**\n * How a dialog taller than the window scrolls. `fixed` (the default) pins the dialog near\n * the top of the window, so it needs its own height limit and inner scroll. `overlay` makes\n * the backdrop the scroll container instead: the whole dialog scrolls as one piece, the way\n * a page does.\n */\n scroll?: 'fixed' | 'overlay';\n}\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n DialogContentProps\n>(({ className, children, scroll = 'fixed', ...props }, ref) => {\n const modal = React.useContext(DialogModalContext);\n\n const panel = (\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n scroll === 'overlay'\n ? 'pointer-events-auto relative rounded-lg'\n : 'fixed top-[8vmin] left-[50%] translate-x-[-50%] sm:rounded-lg',\n dialogPanelClassName,\n className,\n )}\n {...props}\n >\n {children}\n </DialogPrimitive.Content>\n );\n\n // The space around the dialog is padding on this wrapper, not on the scroll container:\n // browsers leave a scroll container's own bottom padding out of what it scrolls, which\n // would leave the dialog flush with the bottom of the window.\n const scrollingPanel = (\n <div className=\"flex min-h-full items-start justify-center px-4 py-[8vmin]\">{panel}</div>\n );\n\n return (\n <DialogPortal>\n <ShadeScope>\n {scroll === 'overlay' ? (\n modal ? (\n // The dialog sits inside the backdrop here, so the backdrop animates as long as the\n // dialog does; otherwise closing unmounts the dialog part-way through its animation.\n <DialogOverlay className=\"overflow-y-auto duration-200\">{scrollingPanel}</DialogOverlay>\n ) : (\n // Radix renders no backdrop for a non-modal dialog, and the page behind stays\n // usable, so this scroll container lets presses beside the dialog through.\n <div\n className=\"pointer-events-none fixed inset-0 z-50 overflow-y-auto\"\n data-slot=\"dialog-scroller\"\n >\n {scrollingPanel}\n </div>\n )\n ) : (\n <>\n <DialogOverlay />\n {panel}\n </>\n )}\n </ShadeScope>\n </DialogPortal>\n );\n});\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col gap-y-1.5 text-center sm:text-left', className)} {...props} />\n);\nDialogHeader.displayName = 'DialogHeader';\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n 'flex flex-col-reverse sm:flex-row sm:items-end sm:justify-end sm:gap-2',\n className,\n )}\n {...props}\n />\n);\nDialogFooter.displayName = 'DialogFooter';\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\n 'text-xl leading-none font-semibold tracking-tight in-data-[admin7-design=true]:font-title',\n className,\n )}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-muted-foreground', className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogTrigger,\n DialogClose,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n};\n"],"mappings":";;;;;;AAOA,IAAM,qBAAqB,QAAM,cAAc,IAAI;AAEnD,IAAM,UAAU,EAAE,QAAQ,MAAM,GAAG,YACjC,oBAAC,mBAAmB,UAApB;CAA6B,OAAO;WAClC,oBAAC,gBAAgB,MAAjB;EAA6B;EAAO,GAAI;CAAQ,CAAA;AACrB,CAAA;AAG/B,IAAM,gBAAgB,gBAAgB;AAEtC,IAAM,eAAe,gBAAgB;AAErC,IAAM,cAAc,gBAAgB;AAEpC,IAAM,gBAAgB,QAAM,YAGzB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,SAA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AAM,YAG7B,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,aAAjB;CACO;CACL,WAAW,GAAG,yBAAyB,SAAS;CAChD,GAAI;AACL,CAAA,CACF;AACD,kBAAkB,cAAc,gBAAgB,YAAY"}
|
|
@@ -158,7 +158,7 @@ var FloatingSidebar = React$1.forwardRef(({ pinned, onPinnedChange, pinLocked =
|
|
|
158
158
|
if (disabled) hide();
|
|
159
159
|
}, [disabled, hide]);
|
|
160
160
|
React$1.useEffect(() => {
|
|
161
|
-
cancel();
|
|
161
|
+
if (wrapperRef.current?.matches(":hover")) cancel();
|
|
162
162
|
}, [resetKey, cancel]);
|
|
163
163
|
const hover = React$1.useRef({
|
|
164
164
|
capsule: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floating-sidebar.js","names":[],"sources":["../../../src/components/ui/floating-sidebar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Pin } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\nimport { useShade } from '@/providers/shade-context';\nimport {\n FLOATING_SIDEBAR_CLOSED_SIZE,\n FLOATING_SIDEBAR_INSET,\n FLOATING_SIDEBAR_OPEN_WIDTH,\n FLOATING_SIDEBAR_SPRING,\n getFloatingSidebarGapWidth,\n getFloatingSidebarTiming,\n type FloatingSidebarMorphStyle,\n} from '@/components/ui/floating-sidebar-metrics';\n\n/*\n * A floating \"liquid glass\" sidebar: one capsule that morphs between three\n * states.\n *\n * - closed: a circle around an icon (e.g. the site icon)\n * - open: hovering the circle or the hot zone beneath it, focusing or clicking it\n * grows the circle into a panel floating over the content, the header\n * fading in beside the icon and the body unfurling beneath it\n * - pinned: the panel is docked at full height and a gap beside it offsets\n * the content\n *\n * The icon is one element throughout: filling the circle while closed, it\n * shrinks and glides into its place in the header row as the circle opens.\n *\n * Use it inside a SidebarProvider in place of `Sidebar`, with the usual menu\n * primitives (SidebarGroup, SidebarMenu…) in the body. It is a desktop\n * component; render the `Sidebar` sheet on mobile.\n *\n * It only moves itself and its gap, which changes width at once as it pins and\n * unpins. Content that should glide to its new place, or keep clear of the\n * closed circle, does so itself with the metrics and timing exported from\n * floating-sidebar-metrics (`FLOATING_SIDEBAR_INSET`, `getFloatingSidebarGapWidth`,\n * `getFloatingSidebarTiming`…), driven by the same `pinned` it passes in.\n */\n\nconst UNFURL_DURATION = '450ms';\n// Forgiving, so a pointer drifting off the panel doesn't close it.\nconst CLOSE_DELAY = 400;\n// How long the pointer stays still to count as at rest (see `armHoverOnRest`).\nconst REST_DELAY = 100;\n// After the morph's duration, when it's taken as finished though no\n// transitionend came (e.g. a height that didn't change)\nconst MORPH_END_GRACE = 100;\nconst INSET = FLOATING_SIDEBAR_INSET;\nconst CLOSED_SIZE = FLOATING_SIDEBAR_CLOSED_SIZE;\nconst OPEN_RADIUS = 6;\n// Below this width the open header row tightens to match smaller page titles.\nconst NARROW_QUERY = '(max-width: 1379px)';\n/**\n * The closed circle is `CLOSED_SIZE` across: its visible diameter inside a 1px\n * border (a light outline that all but disappears on a light page).\n *\n * - circleIcon: the icon centred in it, cropped round, a little larger than\n * the header row's icon\n * - icon: the icon in the open and pinned header row, which is `padding`\n * around it, as tall as it is from the panel's top and left\n * - gap: between the header row's icon and the header beside it\n */\nconst SIZES = {\n regular: { circleIcon: 32, icon: 28, gap: 10 },\n narrow: { circleIcon: 32, icon: 24, gap: 8 },\n};\n// Around the header row's icon, and the body's side padding, so the search\n// field and nav rows line up with the icon.\nconst PADDING = 20;\n// With the body's own top padding, matches the side padding above a collapsed header.\nconst COLLAPSED_HEADER_HEIGHT = 12;\nconst PIN_BUTTON_SIZE = 32;\n// Puts the pin glyph PADDING from the panel's right edge.\nconst PIN_BUTTON_RIGHT = 12;\n/*\n * The capsule floats within the viewport, less any chrome framing the page\n * around it: `--floating-sidebar-offset-top`, `-left` and `-bottom` (0 unless\n * set on an ancestor) move its corner and shorten its panel by that much.\n */\nconst OFFSET_TOP = 'var(--floating-sidebar-offset-top, 0px)';\nconst OFFSET_LEFT = 'var(--floating-sidebar-offset-left, 0px)';\nconst OFFSET_BOTTOM = 'var(--floating-sidebar-offset-bottom, 0px)';\n// Pinned, and the most it grows to open.\nconst PANEL_HEIGHT = `calc(100vh - ${OFFSET_TOP} - ${OFFSET_BOTTOM} - ${INSET * 2}px)`;\n\n/** Frosted body: a faint tint so the capsule reads as a surface, a light-catching outline and a backdrop blur. */\nconst GLASS = 'border border-border-glass bg-surface-glass backdrop-blur-md backdrop-saturate-150';\n\n/** Floating: inset highlights, a hairline outline and a layered drop shadow. */\nconst SHADOW_FLOAT = 'var(--shadow-glass-floating)';\n\n/** Pinned: only a 1px outline; the other layers fade out so the panel reads as anchored. */\nconst SHADOW_PINNED = 'var(--shadow-glass-docked)';\n\n// Popups opened from the panel render in portals: the panel stays open under\n// them, and the hot zone ignores the pointer over them.\nconst POPUP_TRIGGER_SELECTOR = '[aria-haspopup][aria-expanded=true]';\nconst OVERLAY_SELECTOR =\n '[role=dialog], [role=alertdialog], [role=menu], [role=listbox], [data-radix-popper-content-wrapper]';\n\n/**\n * Whether a point is in the hot zone: the strip beneath the closed circle, as\n * wide as its footprint, from the screen's left edge down to the bottom. With\n * the circle, it's what opens the panel; nothing beside the circle does.\n */\nfunction inHotZone(wrapper: HTMLElement | null, x: number, y: number): boolean {\n if (!wrapper) {\n return false;\n }\n // The capsule's corner, wherever its offsets put it\n const { top, left } = wrapper.getBoundingClientRect();\n return x < left + CLOSED_SIZE + INSET && y >= top + CLOSED_SIZE + INSET;\n}\n\nfunction useMediaQuery(query: string): boolean {\n const [matches, setMatches] = React.useState(\n () => typeof window !== 'undefined' && (window.matchMedia?.(query).matches ?? false),\n );\n\n React.useEffect(() => {\n const mql = window.matchMedia?.(query);\n if (!mql) {\n return;\n }\n const onChange = () => setMatches(mql.matches);\n onChange();\n mql.addEventListener('change', onChange);\n return () => mql.removeEventListener('change', onChange);\n }, [query]);\n\n return matches;\n}\n\n/**\n * Reads the capsule's height just before React applies a pin change to the\n * DOM, which by the time layout effects run is gone. Renders nothing.\n */\nclass BeforePinCommit extends React.Component<{ pinned: boolean; onBeforeCommit: () => void }> {\n getSnapshotBeforeUpdate(previous: Readonly<{ pinned: boolean }>) {\n if (previous.pinned !== this.props.pinned) {\n this.props.onBeforeCommit();\n }\n return null;\n }\n\n // React requires it alongside getSnapshotBeforeUpdate\n componentDidUpdate() {}\n\n render() {\n return null;\n }\n}\n\n/** Specular sheen: a top-edge highlight that fades quickly so the body stays translucent. */\nfunction GlassHighlight() {\n return (\n <div\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-0\"\n style={{ borderRadius: 'inherit', background: 'var(--surface-glass-highlight)' }}\n />\n );\n}\n\ninterface FloatingSidebarProps extends Omit<React.ComponentProps<'div'>, 'children'> {\n /** Docked beside the content, rather than a circle that opens over it. */\n pinned: boolean;\n /** Shows the pin button when provided. */\n onPinnedChange?: (pinned: boolean) => void;\n /**\n * Pinned by the screen rather than by the user (e.g. a screen whose\n * navigation lives in the sidebar): the pin button fades out, keeping its\n * place so the header doesn't reflow.\n */\n pinLocked?: boolean;\n /**\n * How the capsule morphs: `bump` (the default) grows a touch past size and\n * settles back; `ease` moves on a plain ease-out, without overshoot (e.g.\n * for a pin the screen makes, sequenced with other motion). It applies to\n * the transitions that start while it's set, so keep it until\n * `onPinnedMorphEnd`. Content moving in step takes the same timing from\n * `getFloatingSidebarTiming`.\n */\n morphStyle?: FloatingSidebarMorphStyle;\n /**\n * Called with the new `pinned` state once the capsule has finished morphing\n * to it (at once without transitions); not if `pinned` changes again first.\n */\n onPinnedMorphEnd?: (pinned: boolean) => void;\n /** Centred in the closed circle, and kept in place as it grows (e.g. the site icon). */\n icon: React.ReactNode;\n /** The circle's accessible name (e.g. the site title). */\n label: string;\n /** Beside the icon in the open and pinned panel's header row (e.g. the site title); hidden while closed. */\n header: React.ReactNode;\n /**\n * Collapses the header row, icon included, giving its room to the body (e.g.\n * a screen whose navigation has its own top row). It applies while pinned\n * with `pinLocked`, as otherwise the pin button needs the row.\n */\n headerHidden?: boolean;\n /** Unfurls beneath the header when open or pinned. */\n children: React.ReactNode;\n bodyClassName?: string;\n /** With Admin 7, let descendant effects paint outside the open panel. The caller must own content scrolling. */\n overflow?: 'clip' | 'visible';\n /** The open and pinned panel's width. */\n openWidth?: number;\n /** Stops the panel opening (and closes it), e.g. while the page is locked. */\n disabled?: boolean;\n /**\n * Enables transitions. Leave it false until the pinned state has loaded, so\n * a stored state lands without morphing. Transitions also wait a frame after\n * mounting.\n */\n animate?: boolean;\n /** Opens the panel when the pointer enters the strip beneath the closed circle. */\n hotZone?: boolean;\n /**\n * Hovering doesn't open the panel until the pointer first comes to rest,\n * for a sidebar that reappears under a pointer on its way somewhere (e.g.\n * back from a full-screen screen); resting over it then opens it. Read as\n * it mounts.\n */\n armHoverOnRest?: boolean;\n /**\n * Changing it (e.g. to the route's path) cancels a pending close: a layout\n * shift inside the panel can fire a mouseleave though the pointer never left.\n */\n resetKey?: unknown;\n pinLabel?: string;\n unpinLabel?: string;\n}\n\n/**\n * The outer element (forwarded ref) holds the gap that offsets the content\n * while pinned; `className` and other props land on the fixed wrapper around\n * the capsule, like Shade's `Sidebar`.\n */\nconst FloatingSidebar = React.forwardRef<HTMLDivElement, FloatingSidebarProps>(\n (\n {\n pinned,\n onPinnedChange,\n pinLocked = false,\n morphStyle = 'bump',\n onPinnedMorphEnd,\n icon,\n label,\n header,\n headerHidden = false,\n children,\n bodyClassName,\n overflow = 'clip',\n openWidth = FLOATING_SIDEBAR_OPEN_WIDTH,\n disabled = false,\n animate = true,\n hotZone = true,\n armHoverOnRest = false,\n resetKey,\n pinLabel = 'Pin sidebar',\n unpinLabel = 'Unpin sidebar',\n className,\n style,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n onBlur,\n ...props\n },\n ref,\n ) => {\n const narrow = useMediaQuery(NARROW_QUERY);\n const reducedMotion = useMediaQuery('(prefers-reduced-motion: reduce)');\n const { admin7Design } = useShade();\n const responsiveSizes = narrow ? SIZES.narrow : SIZES.regular;\n const sizes = admin7Design\n ? { ...responsiveSizes, icon: responsiveSizes.circleIcon }\n : responsiveSizes;\n const headerHeight = PADDING + sizes.icon + PADDING;\n // Moves the icon from its place in the header row to the circle's centre\n const closedIconOffset = (CLOSED_SIZE - 2 - sizes.circleIcon) / 2 - PADDING;\n\n const wrapperRef = React.useRef<HTMLDivElement>(null);\n const capsuleRef = React.useRef<HTMLDivElement>(null);\n const triggerRef = React.useRef<HTMLButtonElement>(null);\n const headerRef = React.useRef<HTMLDivElement>(null);\n const bodyRef = React.useRef<HTMLDivElement>(null);\n const pinButtonRef = React.useRef<HTMLButtonElement>(null);\n\n // Hover intent: opens at once, closes after a delay so the pointer can\n // travel between the hot zone and the panel.\n const [open, setOpen] = React.useState(false);\n const closeTimer = React.useRef<number | undefined>(undefined);\n const cancel = React.useCallback(() => {\n window.clearTimeout(closeTimer.current);\n closeTimer.current = undefined;\n }, []);\n const show = React.useCallback(() => {\n cancel();\n if (!disabled) {\n setOpen(true);\n }\n }, [cancel, disabled]);\n const hide = React.useCallback(() => {\n cancel();\n setOpen(false);\n }, [cancel]);\n const scheduleClose = React.useCallback(() => {\n cancel();\n const tryClose = () => {\n const wrapper = wrapperRef.current;\n if (wrapper?.querySelector(POPUP_TRIGGER_SELECTOR)) {\n closeTimer.current = window.setTimeout(tryClose, CLOSE_DELAY);\n return;\n }\n closeTimer.current = undefined;\n // Still over the capsule, though its mouseleave said otherwise (e.g.\n // it morphed under the pointer): it closes once the pointer leaves it.\n if (wrapper?.matches(':hover')) {\n hover.current.capsule = true;\n hover.current.any = true;\n return;\n }\n // Keyboard users close it by tabbing out or with Escape.\n const active = document.activeElement;\n if (active && wrapper?.contains(active) && active.matches(':focus-visible')) {\n return;\n }\n setOpen(false);\n };\n closeTimer.current = window.setTimeout(tryClose, CLOSE_DELAY);\n }, [cancel]);\n\n React.useEffect(() => cancel, [cancel]);\n React.useEffect(() => {\n if (disabled) {\n hide();\n }\n }, [disabled, hide]);\n React.useEffect(() => {\n cancel();\n }, [resetKey, cancel]);\n\n // The capsule and the hot zone act as one hover target. It only arms once\n // the pointer has been outside it: the sidebar can appear under a resting\n // pointer (e.g. back from the editor, whose close button sits where the\n // circle is), and that shouldn't open it.\n const hover = React.useRef({ capsule: false, zone: false, any: false });\n const hoverArmed = React.useRef(false);\n // With `armHoverOnRest`, the pointer passes over it freely until it stops\n const [waitsForRest] = React.useState(armHoverOnRest);\n const waitingForRest = React.useRef(waitsForRest);\n const restTimer = React.useRef<number | undefined>(undefined);\n const updateHover = React.useCallback(\n (parts: Partial<Record<'capsule' | 'zone', boolean>>) => {\n const state = hover.current;\n Object.assign(state, parts);\n const any = state.capsule || state.zone;\n if (waitingForRest.current) {\n return;\n }\n if (!hoverArmed.current) {\n hoverArmed.current = !any;\n return;\n }\n if (any === state.any) {\n return;\n }\n state.any = any;\n if (any) {\n show();\n } else {\n scheduleClose();\n }\n },\n [scheduleClose, show],\n );\n\n // The hot zone tracks the pointer rather than covering the page, so the\n // content beneath it still scrolls and responds to the pointer. The\n // pointer's moves also keep the capsule's hover true to where it is: its\n // mouseenter and mouseleave can be missed or misfire as it morphs under a\n // pointer (e.g. landing open from pinned), and the panel mustn't close\n // while the pointer is over it.\n React.useEffect(() => {\n if (disabled) {\n return;\n }\n const onPointerMove = (event: PointerEvent) => {\n if (event.pointerType === 'touch') {\n return;\n }\n const target = event.target instanceof Element ? event.target : null;\n // Popups opened from the panel (in portals) keep the capsule's hover as it was\n const overOverlay = Boolean(target?.closest(OVERLAY_SELECTOR));\n const parts: Partial<Record<'capsule' | 'zone', boolean>> = {};\n if (!overOverlay && target) {\n parts.capsule = Boolean(wrapperRef.current?.contains(target));\n }\n if (hotZone) {\n parts.zone = !overOverlay && inHotZone(wrapperRef.current, event.clientX, event.clientY);\n }\n updateHover(parts);\n if (waitingForRest.current) {\n window.clearTimeout(restTimer.current);\n restTimer.current = window.setTimeout(() => {\n waitingForRest.current = false;\n hoverArmed.current = true;\n const state = hover.current;\n state.any = state.capsule || state.zone;\n if (state.any) {\n show();\n }\n }, REST_DELAY);\n }\n };\n const onPointerLeave = () => updateHover({ capsule: false, zone: false });\n document.addEventListener('pointermove', onPointerMove);\n document.documentElement.addEventListener('pointerleave', onPointerLeave);\n return () => {\n document.removeEventListener('pointermove', onPointerMove);\n document.documentElement.removeEventListener('pointerleave', onPointerLeave);\n window.clearTimeout(restTimer.current);\n hover.current.zone = false;\n };\n }, [disabled, hotZone, show, updateHover]);\n\n // Escape closes the floating panel, returning focus to the circle.\n const restoringFocus = React.useRef(false);\n React.useEffect(() => {\n if (!open || pinned) {\n return;\n }\n const onKeyDown = (event: KeyboardEvent) => {\n const wrapper = wrapperRef.current;\n if (\n event.key !== 'Escape' ||\n event.defaultPrevented ||\n wrapper?.querySelector(POPUP_TRIGGER_SELECTOR)\n ) {\n return;\n }\n const focusWasWithin = Boolean(wrapper?.contains(document.activeElement));\n hide();\n if (focusWasWithin) {\n restoringFocus.current = true;\n triggerRef.current?.focus();\n restoringFocus.current = false;\n }\n };\n document.addEventListener('keydown', onKeyDown);\n return () => document.removeEventListener('keydown', onKeyDown);\n }, [hide, open, pinned]);\n\n // Pinned, the panel is always open; `open` alone shows the pin button.\n const expanded = open || pinned;\n const headerCollapsed = headerHidden && pinLocked && pinned;\n\n // The header, pin button and body are clipped away while closed, so they\n // must not be reachable; the circle itself takes focus. A locked pin\n // button is hidden in every state, as is a collapsed header.\n React.useLayoutEffect(() => {\n if (headerRef.current) {\n headerRef.current.inert = !expanded || headerCollapsed;\n }\n if (bodyRef.current) {\n bodyRef.current.inert = !expanded;\n }\n if (pinButtonRef.current) {\n pinButtonRef.current.inert = !expanded || pinLocked;\n }\n }, [expanded, headerCollapsed, pinLocked]);\n\n // The gap changes width at once, never through a transition: that would\n // lay the content out again on every frame. Content that should glide to\n // its new place slides itself, in step with the morph (see\n // `getFloatingSidebarTiming`).\n const gapWidth = getFloatingSidebarGapWidth(pinned, openWidth);\n\n // Transitions start a frame after mounting (and after `animate`), so the\n // first paint and a stored pinned state never morph.\n const [ready, setReady] = React.useState(false);\n React.useEffect(() => {\n if (!animate) {\n setReady(false);\n return;\n }\n const frame = requestAnimationFrame(() => setReady(true));\n return () => cancelAnimationFrame(frame);\n }, [animate]);\n const morph = ready && !reducedMotion;\n // The capsule's shape, and what moves with it (its height, the icon)\n const {\n duration: morphDuration,\n easing: glideEasing,\n shapeEasing,\n } = getFloatingSidebarTiming(morphStyle);\n // The capsule's transitions: its height glides rather than bumps, as the\n // body it holds unfurls without overshoot (a bump on a panel this tall\n // would overshoot by tens of pixels)\n const capsuleTransitions: Array<[property: string, easing: string]> = morph\n ? [\n ['width', shapeEasing],\n ['height', glideEasing],\n ['border-radius', shapeEasing],\n ['box-shadow', shapeEasing],\n ]\n : [];\n\n // Reports the end of the morph a pin change starts: the capsule's height\n // transition ending, or its duration passing without one.\n const onPinnedMorphEndRef = React.useRef(onPinnedMorphEnd);\n React.useLayoutEffect(() => {\n onPinnedMorphEndRef.current = onPinnedMorphEnd;\n });\n const pendingMorph = React.useRef<{ pinned: boolean; timer: number } | null>(null);\n // Pinning can mark the body unfurled before the capsule reaches its full\n // width. Release paint clipping on this same morph-completion signal.\n const [pinTransition, setPinTransition] = React.useState({ pinned, active: false });\n if (pinTransition.pinned !== pinned || (!morph && pinTransition.active)) {\n setPinTransition({ pinned, active: morph });\n }\n const finishMorph = React.useCallback(() => {\n const pending = pendingMorph.current;\n if (!pending) {\n return;\n }\n window.clearTimeout(pending.timer);\n pendingMorph.current = null;\n setPinTransition({ pinned: pending.pinned, active: false });\n onPinnedMorphEndRef.current?.(pending.pinned);\n }, []);\n const previousPinned = React.useRef(pinned);\n React.useLayoutEffect(() => {\n if (previousPinned.current === pinned) {\n return;\n }\n previousPinned.current = pinned;\n window.clearTimeout(pendingMorph.current?.timer);\n pendingMorph.current = null;\n if (!morph) {\n onPinnedMorphEndRef.current?.(pinned);\n return;\n }\n const timer = window.setTimeout(finishMorph, morphDuration + MORPH_END_GRACE);\n pendingMorph.current = { pinned, timer };\n }, [finishMorph, morph, morphDuration, pinned]);\n React.useEffect(() => () => window.clearTimeout(pendingMorph.current?.timer), []);\n\n // Floating open, the body scrolls once it has unfurled (a panel taller\n // than the viewport); while unfurling it's clipped.\n const [unfurled, setUnfurled] = React.useState(expanded);\n React.useEffect(() => {\n if (pinned || !expanded || !morph) {\n setUnfurled(expanded);\n }\n }, [expanded, morph, pinned]);\n // The open sidebar is a paint surface, not a scrollport: banners can glow\n // beyond it. Keep clipping for the closed/unfurling animation, and let the\n // navigation and Banner's own content own their separate scroll boundaries.\n const paintOutside =\n admin7Design && overflow === 'visible' && expanded && unfurled && !pinTransition.active;\n\n // The floating open capsule's height (`auto`) on screen before the pin change\n const heightBefore = React.useRef<number | null>(null);\n const measureBeforePin = React.useCallback(() => {\n const capsule = capsuleRef.current;\n heightBefore.current =\n capsule?.style.height === 'auto' ? capsule.getBoundingClientRect().height : null;\n }, []);\n\n // Pinning the floating open panel, its height transitions from `auto`,\n // which interpolate-size resolves anew on every frame: should the body's\n // content grow meanwhile (e.g. another navigation rendered into it), the\n // start would leap past the pinned height and the capsule jump to it. It\n // starts from the height it had on screen instead.\n const capsuleTransitionsRef = React.useRef(capsuleTransitions);\n React.useLayoutEffect(() => {\n capsuleTransitionsRef.current = capsuleTransitions;\n });\n React.useLayoutEffect(() => {\n const from = heightBefore.current;\n heightBefore.current = null;\n const capsule = capsuleRef.current;\n const transitions = capsuleTransitionsRef.current;\n if (from === null || !capsule || !transitions.length) {\n return;\n }\n const { height, transitionProperty, transitionTimingFunction } = capsule.style;\n const others = transitions.filter(([property]) => property !== 'height');\n capsule.style.transitionProperty = others.map(([property]) => property).join(', ');\n capsule.style.transitionTimingFunction = others.map(([, easing]) => easing).join(', ');\n capsule.style.height = `${from}px`;\n // Lands the start height without a transition, the others starting theirs\n void getComputedStyle(capsule).height;\n capsule.style.transitionProperty = transitionProperty;\n capsule.style.transitionTimingFunction = transitionTimingFunction;\n capsule.style.height = height;\n }, [pinned]);\n\n // The body fills the pinned capsule, and keeps filling it while it shrinks\n // after unpinning, so the footer rides its bottom edge rather than jumping\n // up; by the end the capsule hugs the body, so letting go doesn't show.\n const [filled, setFilled] = React.useState(pinned);\n React.useEffect(() => {\n if (pinned || !morph) {\n setFilled(pinned);\n return;\n }\n const timer = window.setTimeout(() => setFilled(false), morphDuration);\n return () => window.clearTimeout(timer);\n }, [morph, morphDuration, pinned]);\n\n const state = pinned ? 'pinned' : open ? 'open' : 'closed';\n // Descendant secondary actions share the pin's hover intent and keyboard\n // state instead of retaining mouse-click focus through :focus-within.\n const controlsVisible = open && !pinLocked;\n\n return (\n <div ref={ref} className=\"shrink-0 text-foreground\" data-state={state} role=\"navigation\">\n {/* Offsets the content while pinned */}\n <div aria-hidden=\"true\" className=\"h-full\" data-sidebar=\"gap\" style={{ width: gapWidth }} />\n <BeforePinCommit pinned={pinned} onBeforeCommit={measureBeforePin} />\n {/* The capsule plus, while floating open, a hover buffer to its right */}\n <div\n ref={wrapperRef}\n className={cn('fixed z-40 flex items-stretch', className)}\n style={{\n top: `calc(${OFFSET_TOP} + ${INSET}px)`,\n left: `calc(${OFFSET_LEFT} + ${INSET}px)`,\n ...style,\n }}\n onBlur={(event) => {\n onBlur?.(event);\n const next = event.relatedTarget;\n if (\n open &&\n next instanceof Node &&\n !event.currentTarget.contains(next) &&\n !wrapperRef.current?.querySelector(POPUP_TRIGGER_SELECTOR)\n ) {\n hide();\n }\n }}\n onFocus={(event) => {\n onFocus?.(event);\n if (!restoringFocus.current && event.target.matches(':focus-visible')) {\n show();\n }\n }}\n onMouseEnter={(event) => {\n onMouseEnter?.(event);\n updateHover({ capsule: true });\n }}\n onMouseLeave={(event) => {\n onMouseLeave?.(event);\n updateHover({ capsule: false });\n }}\n {...props}\n >\n <div\n ref={capsuleRef}\n className={cn(\n 'relative flex shrink-0 flex-col [interpolate-size:allow-keywords]',\n paintOutside ? 'overflow-visible' : 'overflow-hidden',\n GLASS,\n )}\n data-controls-visible={controlsVisible}\n data-sidebar=\"sidebar\"\n data-slot=\"floating-sidebar\"\n data-state={state}\n style={{\n width: expanded ? openWidth : CLOSED_SIZE,\n // Open, `auto` (not undefined) so interpolate-size can transition it\n height: pinned ? PANEL_HEIGHT : expanded ? 'auto' : CLOSED_SIZE,\n maxHeight: PANEL_HEIGHT,\n // The width's bump dips a little below the circle as it closes;\n // it mustn't squeeze it, clipping the icon\n minWidth: CLOSED_SIZE,\n borderRadius: expanded ? OPEN_RADIUS : CLOSED_SIZE / 2,\n boxShadow: pinned ? SHADOW_PINNED : SHADOW_FLOAT,\n transitionProperty: morph\n ? capsuleTransitions.map(([property]) => property).join(', ')\n : 'none',\n transitionDuration: `${morphDuration}ms`,\n transitionTimingFunction: capsuleTransitions.map(([, easing]) => easing).join(', '),\n }}\n onTransitionEnd={(event) => {\n if (event.target === event.currentTarget && event.propertyName === 'height') {\n finishMorph();\n }\n }}\n >\n <GlassHighlight />\n\n {/* Laid out open in every state (the closed capsule clips it), so\n the morph never reflows it */}\n <div\n className=\"flex shrink-0 items-center\"\n data-slot=\"floating-sidebar-header\"\n style={{\n width: openWidth - 2,\n height: headerCollapsed ? COLLAPSED_HEADER_HEIGHT : headerHeight,\n opacity: headerCollapsed ? 0 : 1,\n pointerEvents: headerCollapsed ? 'none' : undefined,\n gap: sizes.gap,\n paddingLeft: PADDING,\n paddingRight: onPinnedChange\n ? PIN_BUTTON_RIGHT + PIN_BUTTON_SIZE + sizes.gap\n : PADDING,\n transitionProperty: morph ? 'height, opacity' : 'none',\n transitionDuration: `${morphDuration}ms`,\n transitionTimingFunction: glideEasing,\n }}\n >\n {/* The circle's focus target: focusing or clicking it opens the\n panel. Pinned, it's only the icon. It holds the icon's place\n in the row. */}\n <button\n ref={triggerRef}\n aria-expanded={pinned ? undefined : open}\n aria-hidden={pinned || undefined}\n aria-label={label}\n className={cn(\n 'group relative shrink-0 outline-none',\n admin7Design && 'size-8',\n pinned ? 'cursor-default' : 'cursor-pointer',\n )}\n data-slot=\"floating-sidebar-trigger\"\n style={admin7Design ? undefined : { width: sizes.icon, height: sizes.icon }}\n tabIndex={pinned ? -1 : 0}\n type=\"button\"\n onClick={show}\n >\n {/* The icon at its closed size (crisp where it rests longest),\n scaled down into the row while open; closed, moved to the\n circle's centre and cropped round */}\n <span\n className=\"absolute top-0 left-0 overflow-hidden group-focus-visible:outline-2 group-focus-visible:outline-offset-2 group-focus-visible:outline-focus-ring group-focus-visible:outline-solid [&>*]:size-full [&>*]:object-cover\"\n data-slot=\"floating-sidebar-icon\"\n style={{\n width: sizes.circleIcon,\n height: sizes.circleIcon,\n transformOrigin: '0 0',\n // From the row's icon place to the circle's centre, in the\n // header row's coordinates (it starts inside the border)\n transform: expanded\n ? `translate(0px, 0px) scale(${sizes.icon / sizes.circleIcon})`\n : `translate(${closedIconOffset}px, ${closedIconOffset}px) scale(1)`,\n borderRadius: expanded ? '22%' : '50%',\n transitionProperty: morph ? 'transform, border-radius' : 'none',\n transitionDuration: `${morphDuration}ms`,\n transitionTimingFunction: glideEasing,\n }}\n >\n {icon}\n </span>\n </button>\n {/* Fades and slides in as the capsule grows, out as it shrinks */}\n <div\n ref={headerRef}\n className=\"flex min-w-0 flex-1 items-center gap-2\"\n style={{\n opacity: expanded ? 1 : 0,\n transform: expanded ? 'none' : 'translateX(-8px)',\n transitionProperty: morph ? 'opacity, transform' : 'none',\n transitionDuration: expanded ? '320ms' : '160ms',\n transitionDelay: expanded ? '90ms' : '0ms',\n transitionTimingFunction: FLOATING_SIDEBAR_SPRING,\n }}\n >\n {header}\n </div>\n </div>\n\n {/* Anchored to the capsule, so it tracks the right edge as the width animates */}\n {onPinnedChange && (\n <button\n ref={pinButtonRef}\n aria-hidden={pinLocked || undefined}\n aria-label={pinned ? unpinLabel : pinLabel}\n className={cn(\n 'absolute z-10 flex size-8 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-[opacity,color,background-color] duration-200 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:pointer-events-auto focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:outline-hidden',\n // Follows the hover state, not pinning, so it hides when the\n // pointer leaves a pinned panel too\n controlsVisible\n ? 'pointer-events-auto opacity-100 delay-75'\n : 'pointer-events-none opacity-0',\n )}\n data-slot=\"floating-sidebar-pin\"\n style={{ top: (headerHeight - PIN_BUTTON_SIZE) / 2, right: PIN_BUTTON_RIGHT }}\n type=\"button\"\n onClick={() => onPinnedChange(!pinned)}\n >\n <Pin\n className=\"size-4\"\n strokeWidth={1.75}\n style={{\n transform: pinned ? 'rotate(45deg)' : 'rotate(0deg)',\n transitionProperty: reducedMotion ? 'none' : 'transform',\n transitionDuration: '300ms',\n transitionTimingFunction: FLOATING_SIDEBAR_SPRING,\n }}\n />\n </button>\n )}\n\n {/* Unfurls through grid rows 0fr → 1fr, whatever the body's\n height. One structure in every state, so pinning and unpinning\n animate it rather than swap its layout. */}\n <div\n ref={bodyRef}\n className={cn('grid min-h-0', (filled || paintOutside) && 'flex-1')}\n data-slot=\"floating-sidebar-body\"\n style={{\n gridTemplateRows: expanded ? '1fr' : '0fr',\n transitionProperty: morph ? 'grid-template-rows' : 'none',\n transitionDuration: UNFURL_DURATION,\n transitionTimingFunction: FLOATING_SIDEBAR_SPRING,\n }}\n onTransitionEnd={(event) => {\n if (\n event.target === event.currentTarget &&\n event.propertyName === 'grid-template-rows'\n ) {\n setUnfurled(expanded);\n }\n }}\n >\n {/* Filling the capsule, the body scrolls within itself (e.g. a\n scrolling SidebarContent above a footer) */}\n <div\n className={cn(\n 'min-h-0',\n paintOutside\n ? 'flex min-h-0 flex-1 flex-col overflow-visible'\n : filled\n ? 'flex flex-col overflow-hidden'\n : unfurled\n ? 'overflow-y-auto overscroll-contain'\n : 'overflow-hidden',\n )}\n >\n {/* The open width, so the content doesn't reflow as the capsule grows */}\n <div\n className={cn(\n 'flex flex-col pt-2 pb-4 transition-opacity duration-200',\n (filled || paintOutside) && 'min-h-0 flex-1',\n expanded ? 'opacity-100 delay-75' : 'opacity-0',\n bodyClassName,\n )}\n style={{ width: openWidth - 2, paddingLeft: PADDING, paddingRight: PADDING }}\n >\n {children}\n </div>\n </div>\n </div>\n </div>\n {expanded && !pinned && <div aria-hidden=\"true\" className=\"w-12 shrink-0\" />}\n </div>\n </div>\n );\n },\n);\nFloatingSidebar.displayName = 'FloatingSidebar';\n\nexport { FloatingSidebar };\nexport type { FloatingSidebarProps };\n"],"mappings":";;;;;;;AAwCA,IAAM,kBAAkB;AAExB,IAAM,cAAc;AAEpB,IAAM,aAAa;AAGnB,IAAM,kBAAkB;AACxB,IAAM,QAAA;AACN,IAAM,cAAA;AACN,IAAM,cAAc;AAEpB,IAAM,eAAe;;;;;;;;;;;AAWrB,IAAM,QAAQ;CACZ,SAAS;EAAE,YAAY;EAAI,MAAM;EAAI,KAAK;CAAG;CAC7C,QAAQ;EAAE,YAAY;EAAI,MAAM;EAAI,KAAK;CAAE;AAC7C;AAGA,IAAM,UAAU;AAEhB,IAAM,0BAA0B;AAChC,IAAM,kBAAkB;AAExB,IAAM,mBAAmB;AAMzB,IAAM,aAAa;AACnB,IAAM,cAAc;AAGpB,IAAM,eAAe,gBAAgB,WAAW,kDAAwB,QAAQ,EAAE;;AAGlF,IAAM,QAAQ;;AAGd,IAAM,eAAe;;AAGrB,IAAM,gBAAgB;AAItB,IAAM,yBAAyB;AAC/B,IAAM,mBACJ;;;;;;AAOF,SAAS,UAAU,SAA6B,GAAW,GAAoB;CAC7E,IAAI,CAAC,SACH,OAAO;CAGT,MAAM,EAAE,KAAK,SAAS,QAAQ,sBAAsB;CACpD,OAAO,IAAI,OAAO,cAAc,SAAS,KAAK,MAAM,cAAc;AACpE;AAEA,SAAS,cAAc,OAAwB;CAC7C,MAAM,CAAC,SAAS,cAAc,QAAM,eAC5B,OAAO,WAAW,gBAAgB,OAAO,aAAa,KAAK,CAAC,CAAC,WAAW,MAChF;CAEA,QAAM,gBAAgB;EACpB,MAAM,MAAM,OAAO,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AAW,GACT,WACA,eACI,kDACA,SACE,kCACA,WACE,uCACA,iBACV;kBAGA,oBAAC,OAAD;SACE,WAAW,GACT,4DACC,UAAU,iBAAiB,kBAC5B,WAAW,yBAAyB,aACpC,aACF;SACA,OAAO;UAAE,OAAO,YAAY;UAAG,aAAa;UAAS,cAAc;SAAQ;SAE1E;QACE,CAAA;OACF,CAAA;MACF,CAAA;KACF;QACJ,YAAY,CAAC,UAAU,oBAAC,OAAD;KAAK,eAAY;KAAO,WAAU;IAAiB,CAAA,CACxE;;EACF;;AAET,CACF;AACA,gBAAgB,cAAc"}
|
|
1
|
+
{"version":3,"file":"floating-sidebar.js","names":[],"sources":["../../../src/components/ui/floating-sidebar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Pin } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\nimport { useShade } from '@/providers/shade-context';\nimport {\n FLOATING_SIDEBAR_CLOSED_SIZE,\n FLOATING_SIDEBAR_INSET,\n FLOATING_SIDEBAR_OPEN_WIDTH,\n FLOATING_SIDEBAR_SPRING,\n getFloatingSidebarGapWidth,\n getFloatingSidebarTiming,\n type FloatingSidebarMorphStyle,\n} from '@/components/ui/floating-sidebar-metrics';\n\n/*\n * A floating \"liquid glass\" sidebar: one capsule that morphs between three\n * states.\n *\n * - closed: a circle around an icon (e.g. the site icon)\n * - open: hovering the circle or the hot zone beneath it, focusing or clicking it\n * grows the circle into a panel floating over the content, the header\n * fading in beside the icon and the body unfurling beneath it\n * - pinned: the panel is docked at full height and a gap beside it offsets\n * the content\n *\n * The icon is one element throughout: filling the circle while closed, it\n * shrinks and glides into its place in the header row as the circle opens.\n *\n * Use it inside a SidebarProvider in place of `Sidebar`, with the usual menu\n * primitives (SidebarGroup, SidebarMenu…) in the body. It is a desktop\n * component; render the `Sidebar` sheet on mobile.\n *\n * It only moves itself and its gap, which changes width at once as it pins and\n * unpins. Content that should glide to its new place, or keep clear of the\n * closed circle, does so itself with the metrics and timing exported from\n * floating-sidebar-metrics (`FLOATING_SIDEBAR_INSET`, `getFloatingSidebarGapWidth`,\n * `getFloatingSidebarTiming`…), driven by the same `pinned` it passes in.\n */\n\nconst UNFURL_DURATION = '450ms';\n// Forgiving, so a pointer drifting off the panel doesn't close it.\nconst CLOSE_DELAY = 400;\n// How long the pointer stays still to count as at rest (see `armHoverOnRest`).\nconst REST_DELAY = 100;\n// After the morph's duration, when it's taken as finished though no\n// transitionend came (e.g. a height that didn't change)\nconst MORPH_END_GRACE = 100;\nconst INSET = FLOATING_SIDEBAR_INSET;\nconst CLOSED_SIZE = FLOATING_SIDEBAR_CLOSED_SIZE;\nconst OPEN_RADIUS = 6;\n// Below this width the open header row tightens to match smaller page titles.\nconst NARROW_QUERY = '(max-width: 1379px)';\n/**\n * The closed circle is `CLOSED_SIZE` across: its visible diameter inside a 1px\n * border (a light outline that all but disappears on a light page).\n *\n * - circleIcon: the icon centred in it, cropped round, a little larger than\n * the header row's icon\n * - icon: the icon in the open and pinned header row, which is `padding`\n * around it, as tall as it is from the panel's top and left\n * - gap: between the header row's icon and the header beside it\n */\nconst SIZES = {\n regular: { circleIcon: 32, icon: 28, gap: 10 },\n narrow: { circleIcon: 32, icon: 24, gap: 8 },\n};\n// Around the header row's icon, and the body's side padding, so the search\n// field and nav rows line up with the icon.\nconst PADDING = 20;\n// With the body's own top padding, matches the side padding above a collapsed header.\nconst COLLAPSED_HEADER_HEIGHT = 12;\nconst PIN_BUTTON_SIZE = 32;\n// Puts the pin glyph PADDING from the panel's right edge.\nconst PIN_BUTTON_RIGHT = 12;\n/*\n * The capsule floats within the viewport, less any chrome framing the page\n * around it: `--floating-sidebar-offset-top`, `-left` and `-bottom` (0 unless\n * set on an ancestor) move its corner and shorten its panel by that much.\n */\nconst OFFSET_TOP = 'var(--floating-sidebar-offset-top, 0px)';\nconst OFFSET_LEFT = 'var(--floating-sidebar-offset-left, 0px)';\nconst OFFSET_BOTTOM = 'var(--floating-sidebar-offset-bottom, 0px)';\n// Pinned, and the most it grows to open.\nconst PANEL_HEIGHT = `calc(100vh - ${OFFSET_TOP} - ${OFFSET_BOTTOM} - ${INSET * 2}px)`;\n\n/** Frosted body: a faint tint so the capsule reads as a surface, a light-catching outline and a backdrop blur. */\nconst GLASS = 'border border-border-glass bg-surface-glass backdrop-blur-md backdrop-saturate-150';\n\n/** Floating: inset highlights, a hairline outline and a layered drop shadow. */\nconst SHADOW_FLOAT = 'var(--shadow-glass-floating)';\n\n/** Pinned: only a 1px outline; the other layers fade out so the panel reads as anchored. */\nconst SHADOW_PINNED = 'var(--shadow-glass-docked)';\n\n// Popups opened from the panel render in portals: the panel stays open under\n// them, and the hot zone ignores the pointer over them.\nconst POPUP_TRIGGER_SELECTOR = '[aria-haspopup][aria-expanded=true]';\nconst OVERLAY_SELECTOR =\n '[role=dialog], [role=alertdialog], [role=menu], [role=listbox], [data-radix-popper-content-wrapper]';\n\n/**\n * Whether a point is in the hot zone: the strip beneath the closed circle, as\n * wide as its footprint, from the screen's left edge down to the bottom. With\n * the circle, it's what opens the panel; nothing beside the circle does.\n */\nfunction inHotZone(wrapper: HTMLElement | null, x: number, y: number): boolean {\n if (!wrapper) {\n return false;\n }\n // The capsule's corner, wherever its offsets put it\n const { top, left } = wrapper.getBoundingClientRect();\n return x < left + CLOSED_SIZE + INSET && y >= top + CLOSED_SIZE + INSET;\n}\n\nfunction useMediaQuery(query: string): boolean {\n const [matches, setMatches] = React.useState(\n () => typeof window !== 'undefined' && (window.matchMedia?.(query).matches ?? false),\n );\n\n React.useEffect(() => {\n const mql = window.matchMedia?.(query);\n if (!mql) {\n return;\n }\n const onChange = () => setMatches(mql.matches);\n onChange();\n mql.addEventListener('change', onChange);\n return () => mql.removeEventListener('change', onChange);\n }, [query]);\n\n return matches;\n}\n\n/**\n * Reads the capsule's height just before React applies a pin change to the\n * DOM, which by the time layout effects run is gone. Renders nothing.\n */\nclass BeforePinCommit extends React.Component<{ pinned: boolean; onBeforeCommit: () => void }> {\n getSnapshotBeforeUpdate(previous: Readonly<{ pinned: boolean }>) {\n if (previous.pinned !== this.props.pinned) {\n this.props.onBeforeCommit();\n }\n return null;\n }\n\n // React requires it alongside getSnapshotBeforeUpdate\n componentDidUpdate() {}\n\n render() {\n return null;\n }\n}\n\n/** Specular sheen: a top-edge highlight that fades quickly so the body stays translucent. */\nfunction GlassHighlight() {\n return (\n <div\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-0\"\n style={{ borderRadius: 'inherit', background: 'var(--surface-glass-highlight)' }}\n />\n );\n}\n\ninterface FloatingSidebarProps extends Omit<React.ComponentProps<'div'>, 'children'> {\n /** Docked beside the content, rather than a circle that opens over it. */\n pinned: boolean;\n /** Shows the pin button when provided. */\n onPinnedChange?: (pinned: boolean) => void;\n /**\n * Pinned by the screen rather than by the user (e.g. a screen whose\n * navigation lives in the sidebar): the pin button fades out, keeping its\n * place so the header doesn't reflow.\n */\n pinLocked?: boolean;\n /**\n * How the capsule morphs: `bump` (the default) grows a touch past size and\n * settles back; `ease` moves on a plain ease-out, without overshoot (e.g.\n * for a pin the screen makes, sequenced with other motion). It applies to\n * the transitions that start while it's set, so keep it until\n * `onPinnedMorphEnd`. Content moving in step takes the same timing from\n * `getFloatingSidebarTiming`.\n */\n morphStyle?: FloatingSidebarMorphStyle;\n /**\n * Called with the new `pinned` state once the capsule has finished morphing\n * to it (at once without transitions); not if `pinned` changes again first.\n */\n onPinnedMorphEnd?: (pinned: boolean) => void;\n /** Centred in the closed circle, and kept in place as it grows (e.g. the site icon). */\n icon: React.ReactNode;\n /** The circle's accessible name (e.g. the site title). */\n label: string;\n /** Beside the icon in the open and pinned panel's header row (e.g. the site title); hidden while closed. */\n header: React.ReactNode;\n /**\n * Collapses the header row, icon included, giving its room to the body (e.g.\n * a screen whose navigation has its own top row). It applies while pinned\n * with `pinLocked`, as otherwise the pin button needs the row.\n */\n headerHidden?: boolean;\n /** Unfurls beneath the header when open or pinned. */\n children: React.ReactNode;\n bodyClassName?: string;\n /** With Admin 7, let descendant effects paint outside the open panel. The caller must own content scrolling. */\n overflow?: 'clip' | 'visible';\n /** The open and pinned panel's width. */\n openWidth?: number;\n /** Stops the panel opening (and closes it), e.g. while the page is locked. */\n disabled?: boolean;\n /**\n * Enables transitions. Leave it false until the pinned state has loaded, so\n * a stored state lands without morphing. Transitions also wait a frame after\n * mounting.\n */\n animate?: boolean;\n /** Opens the panel when the pointer enters the strip beneath the closed circle. */\n hotZone?: boolean;\n /**\n * Hovering doesn't open the panel until the pointer first comes to rest,\n * for a sidebar that reappears under a pointer on its way somewhere (e.g.\n * back from a full-screen screen); resting over it then opens it. Read as\n * it mounts.\n */\n armHoverOnRest?: boolean;\n /**\n * Changing it (e.g. to the route's path) cancels a pending close while the\n * pointer is over the panel: a layout shift inside the panel can fire a\n * mouseleave though the pointer never left.\n */\n resetKey?: unknown;\n pinLabel?: string;\n unpinLabel?: string;\n}\n\n/**\n * The outer element (forwarded ref) holds the gap that offsets the content\n * while pinned; `className` and other props land on the fixed wrapper around\n * the capsule, like Shade's `Sidebar`.\n */\nconst FloatingSidebar = React.forwardRef<HTMLDivElement, FloatingSidebarProps>(\n (\n {\n pinned,\n onPinnedChange,\n pinLocked = false,\n morphStyle = 'bump',\n onPinnedMorphEnd,\n icon,\n label,\n header,\n headerHidden = false,\n children,\n bodyClassName,\n overflow = 'clip',\n openWidth = FLOATING_SIDEBAR_OPEN_WIDTH,\n disabled = false,\n animate = true,\n hotZone = true,\n armHoverOnRest = false,\n resetKey,\n pinLabel = 'Pin sidebar',\n unpinLabel = 'Unpin sidebar',\n className,\n style,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n onBlur,\n ...props\n },\n ref,\n ) => {\n const narrow = useMediaQuery(NARROW_QUERY);\n const reducedMotion = useMediaQuery('(prefers-reduced-motion: reduce)');\n const { admin7Design } = useShade();\n const responsiveSizes = narrow ? SIZES.narrow : SIZES.regular;\n const sizes = admin7Design\n ? { ...responsiveSizes, icon: responsiveSizes.circleIcon }\n : responsiveSizes;\n const headerHeight = PADDING + sizes.icon + PADDING;\n // Moves the icon from its place in the header row to the circle's centre\n const closedIconOffset = (CLOSED_SIZE - 2 - sizes.circleIcon) / 2 - PADDING;\n\n const wrapperRef = React.useRef<HTMLDivElement>(null);\n const capsuleRef = React.useRef<HTMLDivElement>(null);\n const triggerRef = React.useRef<HTMLButtonElement>(null);\n const headerRef = React.useRef<HTMLDivElement>(null);\n const bodyRef = React.useRef<HTMLDivElement>(null);\n const pinButtonRef = React.useRef<HTMLButtonElement>(null);\n\n // Hover intent: opens at once, closes after a delay so the pointer can\n // travel between the hot zone and the panel.\n const [open, setOpen] = React.useState(false);\n const closeTimer = React.useRef<number | undefined>(undefined);\n const cancel = React.useCallback(() => {\n window.clearTimeout(closeTimer.current);\n closeTimer.current = undefined;\n }, []);\n const show = React.useCallback(() => {\n cancel();\n if (!disabled) {\n setOpen(true);\n }\n }, [cancel, disabled]);\n const hide = React.useCallback(() => {\n cancel();\n setOpen(false);\n }, [cancel]);\n const scheduleClose = React.useCallback(() => {\n cancel();\n const tryClose = () => {\n const wrapper = wrapperRef.current;\n if (wrapper?.querySelector(POPUP_TRIGGER_SELECTOR)) {\n closeTimer.current = window.setTimeout(tryClose, CLOSE_DELAY);\n return;\n }\n closeTimer.current = undefined;\n // Still over the capsule, though its mouseleave said otherwise (e.g.\n // it morphed under the pointer): it closes once the pointer leaves it.\n if (wrapper?.matches(':hover')) {\n hover.current.capsule = true;\n hover.current.any = true;\n return;\n }\n // Keyboard users close it by tabbing out or with Escape.\n const active = document.activeElement;\n if (active && wrapper?.contains(active) && active.matches(':focus-visible')) {\n return;\n }\n setOpen(false);\n };\n closeTimer.current = window.setTimeout(tryClose, CLOSE_DELAY);\n }, [cancel]);\n\n React.useEffect(() => cancel, [cancel]);\n React.useEffect(() => {\n if (disabled) {\n hide();\n }\n }, [disabled, hide]);\n // A pointer that really left closes the panel, though the change it\n // started renders after (e.g. moving off as Back to app navigates)\n React.useEffect(() => {\n if (wrapperRef.current?.matches(':hover')) {\n cancel();\n }\n }, [resetKey, cancel]);\n\n // The capsule and the hot zone act as one hover target. It only arms once\n // the pointer has been outside it: the sidebar can appear under a resting\n // pointer (e.g. back from the editor, whose close button sits where the\n // circle is), and that shouldn't open it.\n const hover = React.useRef({ capsule: false, zone: false, any: false });\n const hoverArmed = React.useRef(false);\n // With `armHoverOnRest`, the pointer passes over it freely until it stops\n const [waitsForRest] = React.useState(armHoverOnRest);\n const waitingForRest = React.useRef(waitsForRest);\n const restTimer = React.useRef<number | undefined>(undefined);\n const updateHover = React.useCallback(\n (parts: Partial<Record<'capsule' | 'zone', boolean>>) => {\n const state = hover.current;\n Object.assign(state, parts);\n const any = state.capsule || state.zone;\n if (waitingForRest.current) {\n return;\n }\n if (!hoverArmed.current) {\n hoverArmed.current = !any;\n return;\n }\n if (any === state.any) {\n return;\n }\n state.any = any;\n if (any) {\n show();\n } else {\n scheduleClose();\n }\n },\n [scheduleClose, show],\n );\n\n // The hot zone tracks the pointer rather than covering the page, so the\n // content beneath it still scrolls and responds to the pointer. The\n // pointer's moves also keep the capsule's hover true to where it is: its\n // mouseenter and mouseleave can be missed or misfire as it morphs under a\n // pointer (e.g. landing open from pinned), and the panel mustn't close\n // while the pointer is over it.\n React.useEffect(() => {\n if (disabled) {\n return;\n }\n const onPointerMove = (event: PointerEvent) => {\n if (event.pointerType === 'touch') {\n return;\n }\n const target = event.target instanceof Element ? event.target : null;\n // Popups opened from the panel (in portals) keep the capsule's hover as it was\n const overOverlay = Boolean(target?.closest(OVERLAY_SELECTOR));\n const parts: Partial<Record<'capsule' | 'zone', boolean>> = {};\n if (!overOverlay && target) {\n parts.capsule = Boolean(wrapperRef.current?.contains(target));\n }\n if (hotZone) {\n parts.zone = !overOverlay && inHotZone(wrapperRef.current, event.clientX, event.clientY);\n }\n updateHover(parts);\n if (waitingForRest.current) {\n window.clearTimeout(restTimer.current);\n restTimer.current = window.setTimeout(() => {\n waitingForRest.current = false;\n hoverArmed.current = true;\n const state = hover.current;\n state.any = state.capsule || state.zone;\n if (state.any) {\n show();\n }\n }, REST_DELAY);\n }\n };\n const onPointerLeave = () => updateHover({ capsule: false, zone: false });\n document.addEventListener('pointermove', onPointerMove);\n document.documentElement.addEventListener('pointerleave', onPointerLeave);\n return () => {\n document.removeEventListener('pointermove', onPointerMove);\n document.documentElement.removeEventListener('pointerleave', onPointerLeave);\n window.clearTimeout(restTimer.current);\n hover.current.zone = false;\n };\n }, [disabled, hotZone, show, updateHover]);\n\n // Escape closes the floating panel, returning focus to the circle.\n const restoringFocus = React.useRef(false);\n React.useEffect(() => {\n if (!open || pinned) {\n return;\n }\n const onKeyDown = (event: KeyboardEvent) => {\n const wrapper = wrapperRef.current;\n if (\n event.key !== 'Escape' ||\n event.defaultPrevented ||\n wrapper?.querySelector(POPUP_TRIGGER_SELECTOR)\n ) {\n return;\n }\n const focusWasWithin = Boolean(wrapper?.contains(document.activeElement));\n hide();\n if (focusWasWithin) {\n restoringFocus.current = true;\n triggerRef.current?.focus();\n restoringFocus.current = false;\n }\n };\n document.addEventListener('keydown', onKeyDown);\n return () => document.removeEventListener('keydown', onKeyDown);\n }, [hide, open, pinned]);\n\n // Pinned, the panel is always open; `open` alone shows the pin button.\n const expanded = open || pinned;\n const headerCollapsed = headerHidden && pinLocked && pinned;\n\n // The header, pin button and body are clipped away while closed, so they\n // must not be reachable; the circle itself takes focus. A locked pin\n // button is hidden in every state, as is a collapsed header.\n React.useLayoutEffect(() => {\n if (headerRef.current) {\n headerRef.current.inert = !expanded || headerCollapsed;\n }\n if (bodyRef.current) {\n bodyRef.current.inert = !expanded;\n }\n if (pinButtonRef.current) {\n pinButtonRef.current.inert = !expanded || pinLocked;\n }\n }, [expanded, headerCollapsed, pinLocked]);\n\n // The gap changes width at once, never through a transition: that would\n // lay the content out again on every frame. Content that should glide to\n // its new place slides itself, in step with the morph (see\n // `getFloatingSidebarTiming`).\n const gapWidth = getFloatingSidebarGapWidth(pinned, openWidth);\n\n // Transitions start a frame after mounting (and after `animate`), so the\n // first paint and a stored pinned state never morph.\n const [ready, setReady] = React.useState(false);\n React.useEffect(() => {\n if (!animate) {\n setReady(false);\n return;\n }\n const frame = requestAnimationFrame(() => setReady(true));\n return () => cancelAnimationFrame(frame);\n }, [animate]);\n const morph = ready && !reducedMotion;\n // The capsule's shape, and what moves with it (its height, the icon)\n const {\n duration: morphDuration,\n easing: glideEasing,\n shapeEasing,\n } = getFloatingSidebarTiming(morphStyle);\n // The capsule's transitions: its height glides rather than bumps, as the\n // body it holds unfurls without overshoot (a bump on a panel this tall\n // would overshoot by tens of pixels)\n const capsuleTransitions: Array<[property: string, easing: string]> = morph\n ? [\n ['width', shapeEasing],\n ['height', glideEasing],\n ['border-radius', shapeEasing],\n ['box-shadow', shapeEasing],\n ]\n : [];\n\n // Reports the end of the morph a pin change starts: the capsule's height\n // transition ending, or its duration passing without one.\n const onPinnedMorphEndRef = React.useRef(onPinnedMorphEnd);\n React.useLayoutEffect(() => {\n onPinnedMorphEndRef.current = onPinnedMorphEnd;\n });\n const pendingMorph = React.useRef<{ pinned: boolean; timer: number } | null>(null);\n // Pinning can mark the body unfurled before the capsule reaches its full\n // width. Release paint clipping on this same morph-completion signal.\n const [pinTransition, setPinTransition] = React.useState({ pinned, active: false });\n if (pinTransition.pinned !== pinned || (!morph && pinTransition.active)) {\n setPinTransition({ pinned, active: morph });\n }\n const finishMorph = React.useCallback(() => {\n const pending = pendingMorph.current;\n if (!pending) {\n return;\n }\n window.clearTimeout(pending.timer);\n pendingMorph.current = null;\n setPinTransition({ pinned: pending.pinned, active: false });\n onPinnedMorphEndRef.current?.(pending.pinned);\n }, []);\n const previousPinned = React.useRef(pinned);\n React.useLayoutEffect(() => {\n if (previousPinned.current === pinned) {\n return;\n }\n previousPinned.current = pinned;\n window.clearTimeout(pendingMorph.current?.timer);\n pendingMorph.current = null;\n if (!morph) {\n onPinnedMorphEndRef.current?.(pinned);\n return;\n }\n const timer = window.setTimeout(finishMorph, morphDuration + MORPH_END_GRACE);\n pendingMorph.current = { pinned, timer };\n }, [finishMorph, morph, morphDuration, pinned]);\n React.useEffect(() => () => window.clearTimeout(pendingMorph.current?.timer), []);\n\n // Floating open, the body scrolls once it has unfurled (a panel taller\n // than the viewport); while unfurling it's clipped.\n const [unfurled, setUnfurled] = React.useState(expanded);\n React.useEffect(() => {\n if (pinned || !expanded || !morph) {\n setUnfurled(expanded);\n }\n }, [expanded, morph, pinned]);\n // The open sidebar is a paint surface, not a scrollport: banners can glow\n // beyond it. Keep clipping for the closed/unfurling animation, and let the\n // navigation and Banner's own content own their separate scroll boundaries.\n const paintOutside =\n admin7Design && overflow === 'visible' && expanded && unfurled && !pinTransition.active;\n\n // The floating open capsule's height (`auto`) on screen before the pin change\n const heightBefore = React.useRef<number | null>(null);\n const measureBeforePin = React.useCallback(() => {\n const capsule = capsuleRef.current;\n heightBefore.current =\n capsule?.style.height === 'auto' ? capsule.getBoundingClientRect().height : null;\n }, []);\n\n // Pinning the floating open panel, its height transitions from `auto`,\n // which interpolate-size resolves anew on every frame: should the body's\n // content grow meanwhile (e.g. another navigation rendered into it), the\n // start would leap past the pinned height and the capsule jump to it. It\n // starts from the height it had on screen instead.\n const capsuleTransitionsRef = React.useRef(capsuleTransitions);\n React.useLayoutEffect(() => {\n capsuleTransitionsRef.current = capsuleTransitions;\n });\n React.useLayoutEffect(() => {\n const from = heightBefore.current;\n heightBefore.current = null;\n const capsule = capsuleRef.current;\n const transitions = capsuleTransitionsRef.current;\n if (from === null || !capsule || !transitions.length) {\n return;\n }\n const { height, transitionProperty, transitionTimingFunction } = capsule.style;\n const others = transitions.filter(([property]) => property !== 'height');\n capsule.style.transitionProperty = others.map(([property]) => property).join(', ');\n capsule.style.transitionTimingFunction = others.map(([, easing]) => easing).join(', ');\n capsule.style.height = `${from}px`;\n // Lands the start height without a transition, the others starting theirs\n void getComputedStyle(capsule).height;\n capsule.style.transitionProperty = transitionProperty;\n capsule.style.transitionTimingFunction = transitionTimingFunction;\n capsule.style.height = height;\n }, [pinned]);\n\n // The body fills the pinned capsule, and keeps filling it while it shrinks\n // after unpinning, so the footer rides its bottom edge rather than jumping\n // up; by the end the capsule hugs the body, so letting go doesn't show.\n const [filled, setFilled] = React.useState(pinned);\n React.useEffect(() => {\n if (pinned || !morph) {\n setFilled(pinned);\n return;\n }\n const timer = window.setTimeout(() => setFilled(false), morphDuration);\n return () => window.clearTimeout(timer);\n }, [morph, morphDuration, pinned]);\n\n const state = pinned ? 'pinned' : open ? 'open' : 'closed';\n // Descendant secondary actions share the pin's hover intent and keyboard\n // state instead of retaining mouse-click focus through :focus-within.\n const controlsVisible = open && !pinLocked;\n\n return (\n <div ref={ref} className=\"shrink-0 text-foreground\" data-state={state} role=\"navigation\">\n {/* Offsets the content while pinned */}\n <div aria-hidden=\"true\" className=\"h-full\" data-sidebar=\"gap\" style={{ width: gapWidth }} />\n <BeforePinCommit pinned={pinned} onBeforeCommit={measureBeforePin} />\n {/* The capsule plus, while floating open, a hover buffer to its right */}\n <div\n ref={wrapperRef}\n className={cn('fixed z-40 flex items-stretch', className)}\n style={{\n top: `calc(${OFFSET_TOP} + ${INSET}px)`,\n left: `calc(${OFFSET_LEFT} + ${INSET}px)`,\n ...style,\n }}\n onBlur={(event) => {\n onBlur?.(event);\n const next = event.relatedTarget;\n if (\n open &&\n next instanceof Node &&\n !event.currentTarget.contains(next) &&\n !wrapperRef.current?.querySelector(POPUP_TRIGGER_SELECTOR)\n ) {\n hide();\n }\n }}\n onFocus={(event) => {\n onFocus?.(event);\n if (!restoringFocus.current && event.target.matches(':focus-visible')) {\n show();\n }\n }}\n onMouseEnter={(event) => {\n onMouseEnter?.(event);\n updateHover({ capsule: true });\n }}\n onMouseLeave={(event) => {\n onMouseLeave?.(event);\n updateHover({ capsule: false });\n }}\n {...props}\n >\n <div\n ref={capsuleRef}\n className={cn(\n 'relative flex shrink-0 flex-col [interpolate-size:allow-keywords]',\n paintOutside ? 'overflow-visible' : 'overflow-hidden',\n GLASS,\n )}\n data-controls-visible={controlsVisible}\n data-sidebar=\"sidebar\"\n data-slot=\"floating-sidebar\"\n data-state={state}\n style={{\n width: expanded ? openWidth : CLOSED_SIZE,\n // Open, `auto` (not undefined) so interpolate-size can transition it\n height: pinned ? PANEL_HEIGHT : expanded ? 'auto' : CLOSED_SIZE,\n maxHeight: PANEL_HEIGHT,\n // The width's bump dips a little below the circle as it closes;\n // it mustn't squeeze it, clipping the icon\n minWidth: CLOSED_SIZE,\n borderRadius: expanded ? OPEN_RADIUS : CLOSED_SIZE / 2,\n boxShadow: pinned ? SHADOW_PINNED : SHADOW_FLOAT,\n transitionProperty: morph\n ? capsuleTransitions.map(([property]) => property).join(', ')\n : 'none',\n transitionDuration: `${morphDuration}ms`,\n transitionTimingFunction: capsuleTransitions.map(([, easing]) => easing).join(', '),\n }}\n onTransitionEnd={(event) => {\n if (event.target === event.currentTarget && event.propertyName === 'height') {\n finishMorph();\n }\n }}\n >\n <GlassHighlight />\n\n {/* Laid out open in every state (the closed capsule clips it), so\n the morph never reflows it */}\n <div\n className=\"flex shrink-0 items-center\"\n data-slot=\"floating-sidebar-header\"\n style={{\n width: openWidth - 2,\n height: headerCollapsed ? COLLAPSED_HEADER_HEIGHT : headerHeight,\n opacity: headerCollapsed ? 0 : 1,\n pointerEvents: headerCollapsed ? 'none' : undefined,\n gap: sizes.gap,\n paddingLeft: PADDING,\n paddingRight: onPinnedChange\n ? PIN_BUTTON_RIGHT + PIN_BUTTON_SIZE + sizes.gap\n : PADDING,\n transitionProperty: morph ? 'height, opacity' : 'none',\n transitionDuration: `${morphDuration}ms`,\n transitionTimingFunction: glideEasing,\n }}\n >\n {/* The circle's focus target: focusing or clicking it opens the\n panel. Pinned, it's only the icon. It holds the icon's place\n in the row. */}\n <button\n ref={triggerRef}\n aria-expanded={pinned ? undefined : open}\n aria-hidden={pinned || undefined}\n aria-label={label}\n className={cn(\n 'group relative shrink-0 outline-none',\n admin7Design && 'size-8',\n pinned ? 'cursor-default' : 'cursor-pointer',\n )}\n data-slot=\"floating-sidebar-trigger\"\n style={admin7Design ? undefined : { width: sizes.icon, height: sizes.icon }}\n tabIndex={pinned ? -1 : 0}\n type=\"button\"\n onClick={show}\n >\n {/* The icon at its closed size (crisp where it rests longest),\n scaled down into the row while open; closed, moved to the\n circle's centre and cropped round */}\n <span\n className=\"absolute top-0 left-0 overflow-hidden group-focus-visible:outline-2 group-focus-visible:outline-offset-2 group-focus-visible:outline-focus-ring group-focus-visible:outline-solid [&>*]:size-full [&>*]:object-cover\"\n data-slot=\"floating-sidebar-icon\"\n style={{\n width: sizes.circleIcon,\n height: sizes.circleIcon,\n transformOrigin: '0 0',\n // From the row's icon place to the circle's centre, in the\n // header row's coordinates (it starts inside the border)\n transform: expanded\n ? `translate(0px, 0px) scale(${sizes.icon / sizes.circleIcon})`\n : `translate(${closedIconOffset}px, ${closedIconOffset}px) scale(1)`,\n borderRadius: expanded ? '22%' : '50%',\n transitionProperty: morph ? 'transform, border-radius' : 'none',\n transitionDuration: `${morphDuration}ms`,\n transitionTimingFunction: glideEasing,\n }}\n >\n {icon}\n </span>\n </button>\n {/* Fades and slides in as the capsule grows, out as it shrinks */}\n <div\n ref={headerRef}\n className=\"flex min-w-0 flex-1 items-center gap-2\"\n style={{\n opacity: expanded ? 1 : 0,\n transform: expanded ? 'none' : 'translateX(-8px)',\n transitionProperty: morph ? 'opacity, transform' : 'none',\n transitionDuration: expanded ? '320ms' : '160ms',\n transitionDelay: expanded ? '90ms' : '0ms',\n transitionTimingFunction: FLOATING_SIDEBAR_SPRING,\n }}\n >\n {header}\n </div>\n </div>\n\n {/* Anchored to the capsule, so it tracks the right edge as the width animates */}\n {onPinnedChange && (\n <button\n ref={pinButtonRef}\n aria-hidden={pinLocked || undefined}\n aria-label={pinned ? unpinLabel : pinLabel}\n className={cn(\n 'absolute z-10 flex size-8 cursor-pointer items-center justify-center rounded-full text-muted-foreground transition-[opacity,color,background-color] duration-200 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:pointer-events-auto focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:outline-hidden',\n // Follows the hover state, not pinning, so it hides when the\n // pointer leaves a pinned panel too\n controlsVisible\n ? 'pointer-events-auto opacity-100 delay-75'\n : 'pointer-events-none opacity-0',\n )}\n data-slot=\"floating-sidebar-pin\"\n style={{ top: (headerHeight - PIN_BUTTON_SIZE) / 2, right: PIN_BUTTON_RIGHT }}\n type=\"button\"\n onClick={() => onPinnedChange(!pinned)}\n >\n <Pin\n className=\"size-4\"\n strokeWidth={1.75}\n style={{\n transform: pinned ? 'rotate(45deg)' : 'rotate(0deg)',\n transitionProperty: reducedMotion ? 'none' : 'transform',\n transitionDuration: '300ms',\n transitionTimingFunction: FLOATING_SIDEBAR_SPRING,\n }}\n />\n </button>\n )}\n\n {/* Unfurls through grid rows 0fr → 1fr, whatever the body's\n height. One structure in every state, so pinning and unpinning\n animate it rather than swap its layout. */}\n <div\n ref={bodyRef}\n className={cn('grid min-h-0', (filled || paintOutside) && 'flex-1')}\n data-slot=\"floating-sidebar-body\"\n style={{\n gridTemplateRows: expanded ? '1fr' : '0fr',\n transitionProperty: morph ? 'grid-template-rows' : 'none',\n transitionDuration: UNFURL_DURATION,\n transitionTimingFunction: FLOATING_SIDEBAR_SPRING,\n }}\n onTransitionEnd={(event) => {\n if (\n event.target === event.currentTarget &&\n event.propertyName === 'grid-template-rows'\n ) {\n setUnfurled(expanded);\n }\n }}\n >\n {/* Filling the capsule, the body scrolls within itself (e.g. a\n scrolling SidebarContent above a footer) */}\n <div\n className={cn(\n 'min-h-0',\n paintOutside\n ? 'flex min-h-0 flex-1 flex-col overflow-visible'\n : filled\n ? 'flex flex-col overflow-hidden'\n : unfurled\n ? 'overflow-y-auto overscroll-contain'\n : 'overflow-hidden',\n )}\n >\n {/* The open width, so the content doesn't reflow as the capsule grows */}\n <div\n className={cn(\n 'flex flex-col pt-2 pb-4 transition-opacity duration-200',\n (filled || paintOutside) && 'min-h-0 flex-1',\n expanded ? 'opacity-100 delay-75' : 'opacity-0',\n bodyClassName,\n )}\n style={{ width: openWidth - 2, paddingLeft: PADDING, paddingRight: PADDING }}\n >\n {children}\n </div>\n </div>\n </div>\n </div>\n {expanded && !pinned && <div aria-hidden=\"true\" className=\"w-12 shrink-0\" />}\n </div>\n </div>\n );\n },\n);\nFloatingSidebar.displayName = 'FloatingSidebar';\n\nexport { FloatingSidebar };\nexport type { FloatingSidebarProps };\n"],"mappings":";;;;;;;AAwCA,IAAM,kBAAkB;AAExB,IAAM,cAAc;AAEpB,IAAM,aAAa;AAGnB,IAAM,kBAAkB;AACxB,IAAM,QAAA;AACN,IAAM,cAAA;AACN,IAAM,cAAc;AAEpB,IAAM,eAAe;;;;;;;;;;;AAWrB,IAAM,QAAQ;CACZ,SAAS;EAAE,YAAY;EAAI,MAAM;EAAI,KAAK;CAAG;CAC7C,QAAQ;EAAE,YAAY;EAAI,MAAM;EAAI,KAAK;CAAE;AAC7C;AAGA,IAAM,UAAU;AAEhB,IAAM,0BAA0B;AAChC,IAAM,kBAAkB;AAExB,IAAM,mBAAmB;AAMzB,IAAM,aAAa;AACnB,IAAM,cAAc;AAGpB,IAAM,eAAe,gBAAgB,WAAW,kDAAwB,QAAQ,EAAE;;AAGlF,IAAM,QAAQ;;AAGd,IAAM,eAAe;;AAGrB,IAAM,gBAAgB;AAItB,IAAM,yBAAyB;AAC/B,IAAM,mBACJ;;;;;;AAOF,SAAS,UAAU,SAA6B,GAAW,GAAoB;CAC7E,IAAI,CAAC,SACH,OAAO;CAGT,MAAM,EAAE,KAAK,SAAS,QAAQ,sBAAsB;CACpD,OAAO,IAAI,OAAO,cAAc,SAAS,KAAK,MAAM,cAAc;AACpE;AAEA,SAAS,cAAc,OAAwB;CAC7C,MAAM,CAAC,SAAS,cAAc,QAAM,eAC5B,OAAO,WAAW,gBAAgB,OAAO,aAAa,KAAK,CAAC,CAAC,WAAW,MAChF;CAEA,QAAM,gBAAgB;EACpB,MAAM,MAAM,OAAO,aAAa,KAAK;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B;iBAIA,oBAAC,OAAD;QACE,WAAW,GACT,WACA,eACI,kDACA,SACE,kCACA,WACE,uCACA,iBACV;kBAGA,oBAAC,OAAD;SACE,WAAW,GACT,4DACC,UAAU,iBAAiB,kBAC5B,WAAW,yBAAyB,aACpC,aACF;SACA,OAAO;UAAE,OAAO,YAAY;UAAG,aAAa;UAAS,cAAc;SAAQ;SAE1E;QACE,CAAA;OACF,CAAA;MACF,CAAA;KACF;QACJ,YAAY,CAAC,UAAU,oBAAC,OAAD;KAAK,eAAY;KAAO,WAAU;IAAiB,CAAA,CACxE;;EACF;;AAET,CACF;AACA,gBAAgB,cAAc"}
|
|
@@ -1,28 +1,65 @@
|
|
|
1
1
|
import { cn } from "../../lib/ds-utils.js";
|
|
2
|
+
import { useLayoutEffect, useRef } from "react";
|
|
2
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
4
|
//#region src/components/ui/sticky-footer.tsx
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
5
|
+
var isScrollContainer = (element) => {
|
|
6
|
+
const { overflowY } = getComputedStyle(element);
|
|
7
|
+
return overflowY === "auto" || overflowY === "scroll" || overflowY === "hidden";
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Keeps actions visible at the bottom of a scrolling surface.
|
|
11
|
+
*
|
|
12
|
+
* The footer takes its background from `--sticky-footer-background`, which
|
|
13
|
+
* Shade's Dialog sets to its own surface; anywhere else it falls back to
|
|
14
|
+
* `--background`. When the scroll container has bottom padding, the footer
|
|
15
|
+
* fills it so content doesn't show beneath the footer.
|
|
16
|
+
*/
|
|
17
|
+
var StickyFooter = ({ shiftY, height = 96, children, className, contentClassName, style, ...props }) => {
|
|
18
|
+
const ref = useRef(null);
|
|
19
|
+
useLayoutEffect(() => {
|
|
20
|
+
const footer = ref.current;
|
|
21
|
+
let container = footer?.parentElement ?? null;
|
|
22
|
+
while (container && !isScrollContainer(container)) container = container.parentElement;
|
|
23
|
+
if (!footer || !container) return;
|
|
24
|
+
const scrollContainer = container;
|
|
25
|
+
const update = () => {
|
|
26
|
+
footer.style.setProperty("--sticky-footer-inset", getComputedStyle(scrollContainer).paddingBottom);
|
|
27
|
+
};
|
|
28
|
+
update();
|
|
29
|
+
window.addEventListener("resize", update);
|
|
30
|
+
const observer = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(update);
|
|
31
|
+
observer?.observe(scrollContainer);
|
|
32
|
+
return () => {
|
|
33
|
+
window.removeEventListener("resize", update);
|
|
34
|
+
observer?.disconnect();
|
|
35
|
+
};
|
|
36
|
+
}, []);
|
|
37
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
38
|
+
ref,
|
|
39
|
+
className: cn("sticky z-[297] m-0 box-border w-full p-0 [--sticky-footer-bg:var(--sticky-footer-background,var(--background))]", className),
|
|
40
|
+
style: {
|
|
41
|
+
bottom: shiftY ? `calc(${shiftY} - 24px)` : "-24px",
|
|
42
|
+
height: `${height + 24}px`,
|
|
43
|
+
...style
|
|
44
|
+
},
|
|
45
|
+
...props,
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ jsx("div", { className: "sticky bottom-0 z-[298] block h-6 bg-(--sticky-footer-bg)" }),
|
|
48
|
+
/* @__PURE__ */ jsxs("div", {
|
|
49
|
+
className: cn("sticky bottom-0 z-[299] -mb-6 flex items-center justify-between bg-(--sticky-footer-bg)", contentClassName),
|
|
50
|
+
style: { height },
|
|
51
|
+
children: [children, /* @__PURE__ */ jsx("div", {
|
|
52
|
+
"aria-hidden": "true",
|
|
53
|
+
className: "pointer-events-none absolute inset-x-0 top-full h-[var(--sticky-footer-inset,0px)] bg-(--sticky-footer-bg)"
|
|
54
|
+
})]
|
|
55
|
+
}),
|
|
56
|
+
/* @__PURE__ */ jsx("div", {
|
|
57
|
+
className: "sticky mx-2 block h-6 rounded-full shadow-[0_0_0_1px_color-mix(in_oklab,var(--border)_25%,transparent),0_-8px_16px_-3px_color-mix(in_oklab,var(--foreground)_8%,transparent)]",
|
|
58
|
+
style: { bottom: shiftY ? `calc(${shiftY} + ${height - 24}px)` : `${height - 24}px` }
|
|
59
|
+
})
|
|
60
|
+
]
|
|
61
|
+
});
|
|
62
|
+
};
|
|
26
63
|
//#endregion
|
|
27
64
|
export { StickyFooter };
|
|
28
65
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sticky-footer.js","names":[],"sources":["../../../src/components/ui/sticky-footer.tsx"],"sourcesContent":["import type
|
|
1
|
+
{"version":3,"file":"sticky-footer.js","names":[],"sources":["../../../src/components/ui/sticky-footer.tsx"],"sourcesContent":["import { useLayoutEffect, useRef, type HTMLAttributes, type ReactNode } from 'react';\nimport { cn } from '@/lib/utils';\n\nexport interface StickyFooterProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {\n shiftY?: string;\n height?: number;\n children?: ReactNode;\n contentClassName?: string;\n}\n\n// The element sticky positioning measures against. `hidden` makes one too;\n// `clip` doesn't.\nconst isScrollContainer = (element: HTMLElement) => {\n const { overflowY } = getComputedStyle(element);\n return overflowY === 'auto' || overflowY === 'scroll' || overflowY === 'hidden';\n};\n\n/**\n * Keeps actions visible at the bottom of a scrolling surface.\n *\n * The footer takes its background from `--sticky-footer-background`, which\n * Shade's Dialog sets to its own surface; anywhere else it falls back to\n * `--background`. When the scroll container has bottom padding, the footer\n * fills it so content doesn't show beneath the footer.\n */\nexport const StickyFooter = ({\n shiftY,\n height = 96,\n children,\n className,\n contentClassName,\n style,\n ...props\n}: StickyFooterProps) => {\n const ref = useRef<HTMLDivElement>(null);\n\n useLayoutEffect(() => {\n const footer = ref.current;\n let container = footer?.parentElement ?? null;\n while (container && !isScrollContainer(container)) {\n container = container.parentElement;\n }\n if (!footer || !container) {\n return;\n }\n\n const scrollContainer = container;\n const update = () => {\n footer.style.setProperty(\n '--sticky-footer-inset',\n getComputedStyle(scrollContainer).paddingBottom,\n );\n };\n update();\n\n // Responsive padding follows the window or the container's size, and a\n // breakpoint can change the padding without resizing the content box.\n window.addEventListener('resize', update);\n const observer = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(update);\n observer?.observe(scrollContainer);\n\n return () => {\n window.removeEventListener('resize', update);\n observer?.disconnect();\n };\n }, []);\n\n return (\n <div\n ref={ref}\n className={cn(\n 'sticky z-[297] m-0 box-border w-full p-0 [--sticky-footer-bg:var(--sticky-footer-background,var(--background))]',\n className,\n )}\n style={{\n bottom: shiftY ? `calc(${shiftY} - 24px)` : '-24px',\n height: `${height + 24}px`,\n ...style,\n }}\n {...props}\n >\n <div className=\"sticky bottom-0 z-[298] block h-6 bg-(--sticky-footer-bg)\" />\n <div\n className={cn(\n 'sticky bottom-0 z-[299] -mb-6 flex items-center justify-between bg-(--sticky-footer-bg)',\n contentClassName,\n )}\n style={{ height }}\n >\n {children}\n {/* Fills the scroll container's bottom padding below the footer. */}\n <div\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute inset-x-0 top-full h-[var(--sticky-footer-inset,0px)] bg-(--sticky-footer-bg)\"\n />\n </div>\n <div\n className=\"sticky mx-2 block h-6 rounded-full shadow-[0_0_0_1px_color-mix(in_oklab,var(--border)_25%,transparent),0_-8px_16px_-3px_color-mix(in_oklab,var(--foreground)_8%,transparent)]\"\n style={{ bottom: shiftY ? `calc(${shiftY} + ${height - 24}px)` : `${height - 24}px` }}\n />\n </div>\n );\n};\n"],"mappings":";;;;AAYA,IAAM,qBAAqB,YAAyB;CAClD,MAAM,EAAE,cAAc,iBAAiB,OAAO;CAC9C,OAAO,cAAc,UAAU,cAAc,YAAY,cAAc;AACzE;;;;;;;;;AAUA,IAAa,gBAAgB,EAC3B,QACA,SAAS,IACT,UACA,WACA,kBACA,OACA,GAAG,YACoB;CACvB,MAAM,MAAM,OAAuB,IAAI;CAEvC,sBAAsB;EACpB,MAAM,SAAS,IAAI;EACnB,IAAI,YAAY,QAAQ,iBAAiB;EACzC,OAAO,aAAa,CAAC,kBAAkB,SAAS,GAC9C,YAAY,UAAU;EAExB,IAAI,CAAC,UAAU,CAAC,WACd;EAGF,MAAM,kBAAkB;EACxB,MAAM,eAAe;GACnB,OAAO,MAAM,YACX,yBACA,iBAAiB,eAAe,CAAC,CAAC,aACpC;EACF;EACA,OAAO;EAIP,OAAO,iBAAiB,UAAU,MAAM;EACxC,MAAM,WAAW,OAAO,mBAAmB,cAAc,OAAO,IAAI,eAAe,MAAM;EACzF,UAAU,QAAQ,eAAe;EAEjC,aAAa;GACX,OAAO,oBAAoB,UAAU,MAAM;GAC3C,UAAU,WAAW;EACvB;CACF,GAAG,CAAC,CAAC;CAEL,OACE,qBAAC,OAAD;EACO;EACL,WAAW,GACT,mHACA,SACF;EACA,OAAO;GACL,QAAQ,SAAS,QAAQ,OAAO,YAAY;GAC5C,QAAQ,GAAG,SAAS,GAAG;GACvB,GAAG;EACL;EACA,GAAI;YAXN;GAaE,oBAAC,OAAD,EAAK,WAAU,4DAA6D,CAAA;GAC5E,qBAAC,OAAD;IACE,WAAW,GACT,2FACA,gBACF;IACA,OAAO,EAAE,OAAO;cALlB,CAOG,UAED,oBAAC,OAAD;KACE,eAAY;KACZ,WAAU;IACX,CAAA,CACE;;GACL,oBAAC,OAAD;IACE,WAAU;IACV,OAAO,EAAE,QAAQ,SAAS,QAAQ,OAAO,KAAK,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,IAAI;GACrF,CAAA;EACE;;AAET"}
|
package/es/components.js
CHANGED
|
@@ -73,8 +73,8 @@ import { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, Tabl
|
|
|
73
73
|
import { Textarea } from "./components/ui/textarea.js";
|
|
74
74
|
import { toast } from "./components/ui/toast.js";
|
|
75
75
|
import { ToggleGroup, ToggleGroupItem } from "./components/ui/toggle-group.js";
|
|
76
|
-
import { a as
|
|
76
|
+
import { a as XLogo, i as GoogleLogo, n as GhostLogo, r as GhostOrb, t as FacebookLogo } from "./images-DtbFINdz.js";
|
|
77
77
|
import { TimePicker } from "./components/ui/time-picker.js";
|
|
78
78
|
import { tokenFieldClasses } from "./components/ui/token-field.js";
|
|
79
79
|
import { defaultFilter as commandDefaultFilter } from "cmdk";
|
|
80
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActionList, ActionListItem, ActionListItemActions, ActionListItemContent, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlignedAxisTick, AnimatedNumber, Avatar, AvatarFallback, AvatarImage, Badge, Banner, BarChartLoadingIndicator, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, CodeEditor, Combobox, ComboboxContent, ComboboxTrigger, ComboboxValue, Command, CommandCheck, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyField, CopyFieldActions, CopyFieldContent, CopyFieldCopyButton, CopyFieldLabel, CopyFieldValue, DataList, DataListBar, DataListBody, DataListHead, DataListHeader, DataListItemContent, DataListItemValue, DataListItemValueAbs, DataListItemValuePerc, DataListRow, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DragIndicator, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Dropzone, EmptyBadge, EmptyCard, EmptyIndicator, FLOATING_SIDEBAR_BUMP, FLOATING_SIDEBAR_CLOSED_FOOTPRINT, FLOATING_SIDEBAR_CLOSED_SIZE, FLOATING_SIDEBAR_DURATION, FLOATING_SIDEBAR_EASE, FLOATING_SIDEBAR_EASE_DURATION, FLOATING_SIDEBAR_INSET, FLOATING_SIDEBAR_OPEN_WIDTH, FLOATING_SIDEBAR_SPRING, FacebookLogo, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Flag, FloatingSidebar, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, GhostLogo, GhostOrb, GoogleLogo, HoverCard, HoverCardContent, HoverCardTrigger, IconComponents as Icon, Indicator, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, Kbd, KbdGroup, Label, Link, LoadingIndicator, MultiSelectCombobox, Navbar, NavbarActions, NavbarNavigation, NoValueLabel, NoValueLabelIcon, PageMenu, PageMenuItem, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, PreviewChrome, RadioGroup, RadioGroupItem, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SimplePagination, SimplePaginationNavigation, SimplePaginationNextButton, SimplePaginationPages, SimplePaginationPreviousButton, Skeleton, SkeletonTable, SortableList, StickyFooter, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeadButton, TableHeader, TableRow, Tabs, TabsContent, TabsDropdownTrigger, TabsList, TabsTrigger, TabsTriggerCount, Textarea, TimePicker, Toaster, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger,
|
|
80
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActionList, ActionListItem, ActionListItemActions, ActionListItemContent, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlignedAxisTick, AnimatedNumber, Avatar, AvatarFallback, AvatarImage, Badge, Banner, BarChartLoadingIndicator, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, CodeEditor, Combobox, ComboboxContent, ComboboxTrigger, ComboboxValue, Command, CommandCheck, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyField, CopyFieldActions, CopyFieldContent, CopyFieldCopyButton, CopyFieldLabel, CopyFieldValue, DataList, DataListBar, DataListBody, DataListHead, DataListHeader, DataListItemContent, DataListItemValue, DataListItemValueAbs, DataListItemValuePerc, DataListRow, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DragIndicator, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Dropzone, EmptyBadge, EmptyCard, EmptyIndicator, FLOATING_SIDEBAR_BUMP, FLOATING_SIDEBAR_CLOSED_FOOTPRINT, FLOATING_SIDEBAR_CLOSED_SIZE, FLOATING_SIDEBAR_DURATION, FLOATING_SIDEBAR_EASE, FLOATING_SIDEBAR_EASE_DURATION, FLOATING_SIDEBAR_INSET, FLOATING_SIDEBAR_OPEN_WIDTH, FLOATING_SIDEBAR_SPRING, FacebookLogo, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Flag, FloatingSidebar, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, GhostLogo, GhostOrb, GoogleLogo, HoverCard, HoverCardContent, HoverCardTrigger, IconComponents as Icon, Indicator, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, Kbd, KbdGroup, Label, Link, LoadingIndicator, MultiSelectCombobox, Navbar, NavbarActions, NavbarNavigation, NoValueLabel, NoValueLabelIcon, PageMenu, PageMenuItem, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, PreviewChrome, RadioGroup, RadioGroupItem, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SimplePagination, SimplePaginationNavigation, SimplePaginationNextButton, SimplePaginationPages, SimplePaginationPreviousButton, Skeleton, SkeletonTable, SortableList, StickyFooter, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeadButton, TableHeader, TableRow, Tabs, TabsContent, TabsDropdownTrigger, TabsList, TabsTrigger, TabsTriggerCount, Textarea, TimePicker, Toaster, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, XLogo, badgeVariants, bannerVariants, buttonVariants, cardVariants, commandDefaultFilter, dropzoneVariants, getFloatingSidebarGapWidth, getFloatingSidebarTiming, imageOverlayButton, imageOverlayButtonClasses, indicatorVariants, inputGroupVariants, inputSurface, inputSurfaceClasses, previewChromeVariants, radioGroupItemVariants, selectTriggerVariants, tabSurfaceVariants, tabsVariants, toast, tokenFieldClasses, useFormField, useSidebar };
|
|
@@ -3,6 +3,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
//#region src/assets/images/facebook-logo.svg?react
|
|
4
4
|
var SvgFacebookLogo = (props) => /* @__PURE__ */ jsxs("svg", {
|
|
5
5
|
fill: "none",
|
|
6
|
+
viewBox: "0 0 40 40",
|
|
6
7
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7
8
|
...props,
|
|
8
9
|
children: [
|
|
@@ -80,26 +81,6 @@ var SvgGoogleLogo = (props) => /* @__PURE__ */ jsxs("svg", {
|
|
|
80
81
|
]
|
|
81
82
|
});
|
|
82
83
|
//#endregion
|
|
83
|
-
//#region src/assets/images/twitter-logo.svg?react
|
|
84
|
-
var SvgTwitterLogo = (props) => /* @__PURE__ */ jsxs("svg", {
|
|
85
|
-
fill: "none",
|
|
86
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
87
|
-
...props,
|
|
88
|
-
children: [
|
|
89
|
-
/* @__PURE__ */ jsx("title", { children: "social-twitter" }),
|
|
90
|
-
/* @__PURE__ */ jsx("circle", {
|
|
91
|
-
cx: 20,
|
|
92
|
-
cy: 20,
|
|
93
|
-
r: 20,
|
|
94
|
-
fill: "#51B1EF"
|
|
95
|
-
}),
|
|
96
|
-
/* @__PURE__ */ jsx("path", {
|
|
97
|
-
d: "M30.905 14.268a8.63 8.63 0 0 1-2.49.686 4.36 4.36 0 0 0 1.902-2.403 8.602 8.602 0 0 1-2.753 1.054c-3.512-3.488-8.463.13-7.396 3.969a12.284 12.284 0 0 1-8.942-4.543c-1.228 2.093-.428 4.667 1.343 5.798a4.31 4.31 0 0 1-1.965-.544v.055a4.35 4.35 0 0 0 3.48 4.263 4.569 4.569 0 0 1-1.964.074 4.367 4.367 0 0 0 4.053 3.023c-1.918 1.46-4.146 2.062-6.42 1.798 9.793 5.767 19.029-1.783 18.998-10.417 0-.187-.004-.374-.012-.561a9 9 0 0 0 2.166-2.248",
|
|
98
|
-
fill: "#fff"
|
|
99
|
-
})
|
|
100
|
-
]
|
|
101
|
-
});
|
|
102
|
-
//#endregion
|
|
103
84
|
//#region src/assets/images/x-logo.svg?react
|
|
104
85
|
var SvgXLogo = (props) => /* @__PURE__ */ jsx("svg", {
|
|
105
86
|
viewBox: "0 0 24 24",
|
|
@@ -116,9 +97,8 @@ var FacebookLogo = SvgFacebookLogo;
|
|
|
116
97
|
var GhostLogo = SvgGhostLogo;
|
|
117
98
|
var GhostOrb = SvgGhostOrb;
|
|
118
99
|
var GoogleLogo = SvgGoogleLogo;
|
|
119
|
-
var TwitterLogo = SvgTwitterLogo;
|
|
120
100
|
var XLogo = SvgXLogo;
|
|
121
101
|
//#endregion
|
|
122
|
-
export {
|
|
102
|
+
export { XLogo as a, GoogleLogo as i, GhostLogo as n, GhostOrb as r, FacebookLogo as t };
|
|
123
103
|
|
|
124
|
-
//# sourceMappingURL=images-
|
|
104
|
+
//# sourceMappingURL=images-DtbFINdz.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"images-DtbFINdz.js","names":[],"sources":["../src/assets/images/facebook-logo.svg?react","../src/assets/images/ghost-logo.svg?react","../src/assets/images/ghost-orb.svg?react","../src/assets/images/google-logo.svg?react","../src/assets/images/x-logo.svg?react","../src/assets/images/index.ts"],"sourcesContent":["import * as React from \"react\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst SvgFacebookLogo = (props) => /* @__PURE__ */ _jsxs(\"svg\", {\n\tfill: \"none\",\n\tviewBox: \"0 0 40 40\",\n\txmlns: \"http://www.w3.org/2000/svg\",\n\t...props,\n\tchildren: [\n\t\t/* @__PURE__ */ _jsx(\"title\", { children: \"social-facebook\" }),\n\t\t/* @__PURE__ */ _jsx(\"path\", {\n\t\t\td: \"M20 40.004c11.046 0 20-8.955 20-20 0-11.046-8.954-20-20-20s-20 8.954-20 20c0 11.045 8.954 20 20 20z\",\n\t\t\tfill: \"#1977F3\"\n\t\t}),\n\t\t/* @__PURE__ */ _jsx(\"path\", {\n\t\t\td: \"m27.785 25.785.886-5.782h-5.546V16.25c0-1.58.773-3.125 3.26-3.125h2.522V8.204s-2.29-.39-4.477-.39c-4.568 0-7.555 2.767-7.555 7.781v4.408h-5.08v5.782h5.08v13.976a20.08 20.08 0 0 0 3.125.242c1.063 0 2.107-.085 3.125-.242V25.785h4.66z\",\n\t\t\tfill: \"#fff\"\n\t\t})\n\t]\n});\nexport default SvgFacebookLogo;\n","import * as React from \"react\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst SvgGhostLogo = (props) => /* @__PURE__ */ _jsx(\"svg\", {\n\tviewBox: \"0 0 770 294\",\n\tstyle: {\n\t\tbackgroundSize: \"100% 100%\",\n\t\tbackgroundRepeat: \"no-repeat\",\n\t\tbackgroundImage: \"url(https://assets.ghost.io/admin/1597/assets/img/logos/ghost-logo-black-1-fb561a374422b405ec90fa586b05ebdf.png)\"\n\t},\n\talt: \"Ghost\",\n\t...props\n});\nexport default SvgGhostLogo;\n","import * as React from \"react\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst SvgGhostOrb = (props) => /* @__PURE__ */ _jsx(\"svg\", {\n\tfill: \"none\",\n\theight: 24,\n\tviewBox: \"0 0 24 24\",\n\twidth: 24,\n\txmlns: \"http://www.w3.org/2000/svg\",\n\t...props,\n\tchildren: /* @__PURE__ */ _jsx(\"path\", {\n\t\tclipRule: \"evenodd\",\n\t\td: \"M24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12ZM11.8326 2.33879C6.37785 2.95189 3.95901 5.20797 3.41126 9.74699C3.34896 10.2632 3.22642 10.7805 3.10443 11.2954C2.93277 12.02 2.76221 12.74 2.76221 13.4458C2.76221 17.9885 6.5856 21.556 11.1283 21.556C12.8959 21.556 14.4433 20.8144 15.8756 20.048C19.0536 18.3478 22.0328 16.2597 22.0328 12.5411C22.0328 9.91512 20.1051 7.56932 18.466 5.5747C18.3834 5.47416 18.3015 5.37451 18.2206 5.27577C17.3866 4.25742 14.4333 2.04643 11.8326 2.33879Z\",\n\t\tfill: \"currentColor\",\n\t\tfillRule: \"evenodd\"\n\t})\n});\nexport default SvgGhostOrb;\n","import * as React from \"react\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst SvgGoogleLogo = (props) => /* @__PURE__ */ _jsxs(\"svg\", {\n\tfill: \"none\",\n\tviewBox: \"0 0 92 31\",\n\t...props,\n\tchildren: [\n\t\t/* @__PURE__ */ _jsx(\"title\", { children: \"google\" }),\n\t\t/* @__PURE__ */ _jsx(\"path\", {\n\t\t\td: \"M39.15 15.898c0 4.303-3.378 7.473-7.525 7.473s-7.526-3.17-7.526-7.473c0-4.334 3.38-7.474 7.526-7.474 4.147 0 7.526 3.14 7.526 7.474zm-3.294 0c0-2.69-1.958-4.529-4.231-4.529-2.273 0-4.231 1.84-4.231 4.529 0 2.662 1.958 4.528 4.231 4.528 2.273 0 4.231-1.87 4.231-4.528z\",\n\t\t\tfill: \"#EA4335\"\n\t\t}),\n\t\t/* @__PURE__ */ _jsx(\"path\", {\n\t\t\td: \"M55.386 15.898c0 4.303-3.379 7.473-7.526 7.473-4.146 0-7.526-3.17-7.526-7.473 0-4.33 3.38-7.474 7.526-7.474 4.147 0 7.526 3.14 7.526 7.474zm-3.294 0c0-2.69-1.959-4.529-4.232-4.529s-4.231 1.84-4.231 4.529c0 2.662 1.958 4.528 4.231 4.528 2.273 0 4.232-1.87 4.232-4.528z\",\n\t\t\tfill: \"#FBBC05\"\n\t\t}),\n\t\t/* @__PURE__ */ _jsx(\"path\", {\n\t\t\td: \"M70.945 8.875v13.418c0 5.52-3.267 7.774-7.13 7.774-3.636 0-5.825-2.423-6.65-4.404l2.868-1.19c.511 1.217 1.763 2.652 3.779 2.652 2.472 0 4.004-1.52 4.004-4.38V21.67h-.115c-.737.906-2.158 1.698-3.95 1.698-3.751 0-7.188-3.255-7.188-7.443 0-4.22 3.437-7.501 7.188-7.501 1.789 0 3.21.792 3.95 1.671h.115V8.88h3.129v-.004zm-2.895 7.05c0-2.632-1.763-4.556-4.005-4.556-2.273 0-4.177 1.924-4.177 4.556 0 2.604 1.904 4.501 4.177 4.501 2.242 0 4.005-1.897 4.005-4.501z\",\n\t\t\tfill: \"#4285F4\"\n\t\t}),\n\t\t/* @__PURE__ */ _jsx(\"path\", {\n\t\t\td: \"M76.103 1.01v21.903H72.89V1.011h3.213z\",\n\t\t\tfill: \"#34A853\"\n\t\t}),\n\t\t/* @__PURE__ */ _jsx(\"path\", {\n\t\t\td: \"M88.624 18.357l2.558 1.699c-.826 1.216-2.815 3.312-6.251 3.312-4.262 0-7.445-3.282-7.445-7.474 0-4.444 3.21-7.473 7.076-7.473 3.893 0 5.798 3.086 6.42 4.754l.341.85-10.028 4.137c.768 1.5 1.962 2.264 3.636 2.264 1.678 0 2.841-.822 3.693-2.069zm-7.87-2.688l6.703-2.774c-.368-.933-1.478-1.583-2.783-1.583-1.674 0-4.005 1.472-3.92 4.357z\",\n\t\t\tfill: \"#EA4335\"\n\t\t}),\n\t\t/* @__PURE__ */ _jsx(\"path\", {\n\t\t\td: \"M11.936 13.953v-3.17h10.726c.105.552.159 1.206.159 1.914 0 2.378-.653 5.32-2.757 7.416-2.046 2.123-4.66 3.255-8.124 3.255-6.42 0-11.818-5.21-11.818-11.605C.122 5.368 5.52.158 11.94.158c3.551 0 6.081 1.389 7.982 3.198l-2.246 2.237c-1.363-1.273-3.21-2.264-5.74-2.264-4.688 0-8.354 3.764-8.354 8.434s3.666 8.434 8.354 8.434c3.041 0 4.773-1.216 5.882-2.322.9-.896 1.492-2.176 1.725-3.925l-7.607.003z\",\n\t\t\tfill: \"#4285F4\"\n\t\t})\n\t]\n});\nexport default SvgGoogleLogo;\n","import * as React from \"react\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst SvgXLogo = (props) => /* @__PURE__ */ _jsx(\"svg\", {\n\tviewBox: \"0 0 24 24\",\n\t\"aria-hidden\": \"true\",\n\t...props,\n\tchildren: /* @__PURE__ */ _jsx(\"g\", { children: /* @__PURE__ */ _jsx(\"path\", {\n\t\td: \"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z\",\n\t\tfill: \"currentColor\"\n\t}) })\n});\nexport default SvgXLogo;\n","import type { FunctionComponent, SVGProps } from 'react';\nimport FacebookLogoSvg from './facebook-logo.svg?react';\nimport GhostLogoSvg from './ghost-logo.svg?react';\nimport GhostOrbSvg from './ghost-orb.svg?react';\nimport GoogleLogoSvg from './google-logo.svg?react';\nimport XLogoSvg from './x-logo.svg?react';\n\n// Explicit types keep the `?react` asset imports out of the published\n// declarations, where consumers can't resolve them.\ntype Logo = FunctionComponent<SVGProps<SVGSVGElement>>;\n\nexport const FacebookLogo: Logo = FacebookLogoSvg;\nexport const GhostLogo: Logo = GhostLogoSvg;\nexport const GhostOrb: Logo = GhostOrbSvg;\nexport const GoogleLogo: Logo = GoogleLogoSvg;\nexport const XLogo: Logo = XLogoSvg;\n"],"mappings":";;;AAEA,IAAM,mBAAmB,UAA0B,qBAAM,OAAO;CAC/D,MAAM;CACN,SAAS;CACT,OAAO;CACP,GAAG;CACH,UAAU;EACO,oBAAK,SAAS,EAAE,UAAU,kBAAkB,CAAC;EAC7C,oBAAK,QAAQ;GAC5B,GAAG;GACH,MAAM;EACP,CAAC;EACe,oBAAK,QAAQ;GAC5B,GAAG;GACH,MAAM;EACP,CAAC;CACF;AACD,CAAC;;;AChBD,IAAM,gBAAgB,UAA0B,oBAAK,OAAO;CAC3D,SAAS;CACT,OAAO;EACN,gBAAgB;EAChB,kBAAkB;EAClB,iBAAiB;CAClB;CACA,KAAK;CACL,GAAG;AACJ,CAAC;;;ACTD,IAAM,eAAe,UAA0B,oBAAK,OAAO;CAC1D,MAAM;CACN,QAAQ;CACR,SAAS;CACT,OAAO;CACP,OAAO;CACP,GAAG;CACH,UAA0B,oBAAK,QAAQ;EACtC,UAAU;EACV,GAAG;EACH,MAAM;EACN,UAAU;CACX,CAAC;AACF,CAAC;;;ACbD,IAAM,iBAAiB,UAA0B,qBAAM,OAAO;CAC7D,MAAM;CACN,SAAS;CACT,GAAG;CACH,UAAU;EACO,oBAAK,SAAS,EAAE,UAAU,SAAS,CAAC;EACpC,oBAAK,QAAQ;GAC5B,GAAG;GACH,MAAM;EACP,CAAC;EACe,oBAAK,QAAQ;GAC5B,GAAG;GACH,MAAM;EACP,CAAC;EACe,oBAAK,QAAQ;GAC5B,GAAG;GACH,MAAM;EACP,CAAC;EACe,oBAAK,QAAQ;GAC5B,GAAG;GACH,MAAM;EACP,CAAC;EACe,oBAAK,QAAQ;GAC5B,GAAG;GACH,MAAM;EACP,CAAC;EACe,oBAAK,QAAQ;GAC5B,GAAG;GACH,MAAM;EACP,CAAC;CACF;AACD,CAAC;;;AC/BD,IAAM,YAAY,UAA0B,oBAAK,OAAO;CACvD,SAAS;CACT,eAAe;CACf,GAAG;CACH,UAA0B,oBAAK,KAAK,EAAE,UAA0B,oBAAK,QAAQ;EAC5E,GAAG;EACH,MAAM;CACP,CAAC,EAAE,CAAC;AACL,CAAC;;;ACCD,IAAa,eAAqB;AAClC,IAAa,YAAkB;AAC/B,IAAa,WAAiB;AAC9B,IAAa,aAAmB;AAChC,IAAa,QAAc"}
|
package/es/index.js
CHANGED
|
@@ -107,8 +107,8 @@ import { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, Tabl
|
|
|
107
107
|
import { Textarea } from "./components/ui/textarea.js";
|
|
108
108
|
import { toast } from "./components/ui/toast.js";
|
|
109
109
|
import { ToggleGroup, ToggleGroupItem } from "./components/ui/toggle-group.js";
|
|
110
|
-
import { a as
|
|
110
|
+
import { a as XLogo, i as GoogleLogo, n as GhostLogo, r as GhostOrb, t as FacebookLogo } from "./images-DtbFINdz.js";
|
|
111
111
|
import { TimePicker } from "./components/ui/time-picker.js";
|
|
112
112
|
import { tokenFieldClasses } from "./components/ui/token-field.js";
|
|
113
113
|
import { commandDefaultFilter } from "./components.js";
|
|
114
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActionList, ActionListItem, ActionListItemActions, ActionListItemContent, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlignedAxisTick, AnimatedNumber, Avatar, AvatarFallback, AvatarImage, Badge, Banner, BarChartLoadingIndicator, Box, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, CodeEditor, ColorPicker, ColorPickerTrigger, ColorSwatch, ColorSwatchRow, Combobox, ComboboxContent, ComboboxTrigger, ComboboxValue, Command, CommandCheck, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Container, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyField, CopyFieldActions, CopyFieldContent, CopyFieldCopyButton, CopyFieldLabel, CopyFieldValue, DEFAULT_I18N, DEFAULT_OPERATORS, DataList, DataListBar, DataListBody, DataListHead, DataListHeader, DataListItemContent, DataListItemValue, DataListItemValueAbs, DataListItemValuePerc, DataListRow, DetailPage, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DirtyConfirmDialog, DragIndicator, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Dropzone, EmptyBadge, EmptyCard, EmptyIndicator, ErrorPage, FLOATING_SIDEBAR_BUMP, FLOATING_SIDEBAR_CLOSED_FOOTPRINT, FLOATING_SIDEBAR_CLOSED_SIZE, FLOATING_SIDEBAR_DURATION, FLOATING_SIDEBAR_EASE, FLOATING_SIDEBAR_EASE_DURATION, FLOATING_SIDEBAR_INSET, FLOATING_SIDEBAR_OPEN_WIDTH, FLOATING_SIDEBAR_SPRING, FacebookLogo, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, FilterBar, FilterDatePicker, FilterSegmentInput, FilterSegmentMultiSelect, FilterSegmentSelect, Filters, FiltersContent, Flag, FloatingSidebar, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, GhAreaChart, GhCustomTooltipContent, GhostLogo, GhostOrb, GoogleLogo, Grid, H1, H2, H3, H4, HTable, HoverCard, HoverCardContent, HoverCardTrigger, IconComponents as Icon, ImageUpload, ImageUploadAction, ImageUploadActions, ImageUploadDropzone, ImageUploadImage, ImageUploadPreview, Indicator, Inline, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, Kbd, KbdGroup, KpiCardHeader, KpiCardHeaderLabel, KpiCardHeaderValue, KpiDropdownButton, KpiTabTrigger, KpiTabValue, Label, Link, ListPage, ListPageBody, ListPageHeader, LoadingIndicator, ModalPage, ModalPageTitle, MultiSelectCombobox, Navbar, NavbarActions, NavbarNavigation, NoValueLabel, NoValueLabelIcon, PageChromeProvider, PageHeader, PageHeaderActionGroup, PageHeaderActionGroupMobileMenu, PageHeaderActionGroupMobileMenuContent, PageHeaderActionGroupMobileMenuTrigger, PageHeaderActionGroupPrimary, PageHeaderActions, PageHeaderBreadcrumb, PageHeaderCount, PageHeaderDescription, PageHeaderLeft, PageHeaderMeta, PageHeaderTitle, PageMenu, PageMenuItem, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, PreviewChrome, RadioGroup, RadioGroupItem, SHADE_TOKEN_NAMES, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SettingGroup, SettingGroupActions, SettingGroupContent, SettingGroupDescription, SettingGroupDetails, SettingGroupHeader, SettingGroupTitle, SettingGroupValue, SettingGroupValueContent, SettingGroupValueTitle, SettingsModal, ShareModal, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SimplePagination, SimplePaginationNavigation, SimplePaginationNextButton, SimplePaginationPages, SimplePaginationPreviousButton, Skeleton, SkeletonTable, SortableList, Stack, StickyFooter, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeadButton, TableHeader, TableRow, Tabs, TabsContent, TabsDropdownTrigger, TabsList, TabsTrigger, TabsTriggerCount, Text, Textarea, TimePicker, Toaster, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger,
|
|
114
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActionList, ActionListItem, ActionListItemActions, ActionListItemContent, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlignedAxisTick, AnimatedNumber, Avatar, AvatarFallback, AvatarImage, Badge, Banner, BarChartLoadingIndicator, Box, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, CodeEditor, ColorPicker, ColorPickerTrigger, ColorSwatch, ColorSwatchRow, Combobox, ComboboxContent, ComboboxTrigger, ComboboxValue, Command, CommandCheck, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Container, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyField, CopyFieldActions, CopyFieldContent, CopyFieldCopyButton, CopyFieldLabel, CopyFieldValue, DEFAULT_I18N, DEFAULT_OPERATORS, DataList, DataListBar, DataListBody, DataListHead, DataListHeader, DataListItemContent, DataListItemValue, DataListItemValueAbs, DataListItemValuePerc, DataListRow, DetailPage, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DirtyConfirmDialog, DragIndicator, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Dropzone, EmptyBadge, EmptyCard, EmptyIndicator, ErrorPage, FLOATING_SIDEBAR_BUMP, FLOATING_SIDEBAR_CLOSED_FOOTPRINT, FLOATING_SIDEBAR_CLOSED_SIZE, FLOATING_SIDEBAR_DURATION, FLOATING_SIDEBAR_EASE, FLOATING_SIDEBAR_EASE_DURATION, FLOATING_SIDEBAR_INSET, FLOATING_SIDEBAR_OPEN_WIDTH, FLOATING_SIDEBAR_SPRING, FacebookLogo, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, FilterBar, FilterDatePicker, FilterSegmentInput, FilterSegmentMultiSelect, FilterSegmentSelect, Filters, FiltersContent, Flag, FloatingSidebar, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, GhAreaChart, GhCustomTooltipContent, GhostLogo, GhostOrb, GoogleLogo, Grid, H1, H2, H3, H4, HTable, HoverCard, HoverCardContent, HoverCardTrigger, IconComponents as Icon, ImageUpload, ImageUploadAction, ImageUploadActions, ImageUploadDropzone, ImageUploadImage, ImageUploadPreview, Indicator, Inline, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, Kbd, KbdGroup, KpiCardHeader, KpiCardHeaderLabel, KpiCardHeaderValue, KpiDropdownButton, KpiTabTrigger, KpiTabValue, Label, Link, ListPage, ListPageBody, ListPageHeader, LoadingIndicator, ModalPage, ModalPageTitle, MultiSelectCombobox, Navbar, NavbarActions, NavbarNavigation, NoValueLabel, NoValueLabelIcon, PageChromeProvider, PageHeader, PageHeaderActionGroup, PageHeaderActionGroupMobileMenu, PageHeaderActionGroupMobileMenuContent, PageHeaderActionGroupMobileMenuTrigger, PageHeaderActionGroupPrimary, PageHeaderActions, PageHeaderBreadcrumb, PageHeaderCount, PageHeaderDescription, PageHeaderLeft, PageHeaderMeta, PageHeaderTitle, PageMenu, PageMenuItem, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, PreviewChrome, RadioGroup, RadioGroupItem, SHADE_TOKEN_NAMES, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SettingGroup, SettingGroupActions, SettingGroupContent, SettingGroupDescription, SettingGroupDetails, SettingGroupHeader, SettingGroupTitle, SettingGroupValue, SettingGroupValueContent, SettingGroupValueTitle, SettingsModal, ShareModal, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, SimplePagination, SimplePaginationNavigation, SimplePaginationNextButton, SimplePaginationPages, SimplePaginationPreviousButton, Skeleton, SkeletonTable, SortableList, Stack, StickyFooter, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeadButton, TableHeader, TableRow, Tabs, TabsContent, TabsDropdownTrigger, TabsList, TabsTrigger, TabsTriggerCount, Text, Textarea, TimePicker, Toaster, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, ViewBar, ViewBarActions, ViewBarNav, XLogo, badgeVariants, bannerVariants, buttonVariants, cardVariants, commandDefaultFilter, createFilter, createFilterGroup, dropzoneVariants, getFloatingSidebarGapWidth, getFloatingSidebarTiming, imageOverlayButton, imageOverlayButtonClasses, imageUploadPreviewVariants, indicatorVariants, inputGroupVariants, inputSurface, inputSurfaceClasses, previewChromeVariants, radioGroupItemVariants, selectTriggerVariants, settingGroupVariants, settingsModalVariants, shadeToken, tabSurfaceVariants, tabsVariants, toast, tokenFieldClasses, useDirtyConfirmation, useFormField, usePageChrome, useSidebar };
|
package/package.json
CHANGED
|
@@ -4,7 +4,6 @@ export declare const FacebookLogo: Logo;
|
|
|
4
4
|
export declare const GhostLogo: Logo;
|
|
5
5
|
export declare const GhostOrb: Logo;
|
|
6
6
|
export declare const GoogleLogo: Logo;
|
|
7
|
-
export declare const TwitterLogo: Logo;
|
|
8
7
|
export declare const XLogo: Logo;
|
|
9
8
|
export {};
|
|
10
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/assets/images/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/assets/images/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AASzD,KAAK,IAAI,GAAG,iBAAiB,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;AAEvD,eAAO,MAAM,YAAY,EAAE,IAAsB,CAAC;AAClD,eAAO,MAAM,SAAS,EAAE,IAAmB,CAAC;AAC5C,eAAO,MAAM,QAAQ,EAAE,IAAkB,CAAC;AAC1C,eAAO,MAAM,UAAU,EAAE,IAAoB,CAAC;AAC9C,eAAO,MAAM,KAAK,EAAE,IAAe,CAAC"}
|
|
@@ -21,6 +21,10 @@ type PageHeaderActionProps = ButtonProps & {
|
|
|
21
21
|
label: string;
|
|
22
22
|
iconOnly?: boolean;
|
|
23
23
|
primary?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* A key the screen binds for this action. It shows in the tooltip and sets
|
|
26
|
+
* `aria-keyshortcuts`, so pass it only when the screen handles the key.
|
|
27
|
+
*/
|
|
24
28
|
shortcut?: string;
|
|
25
29
|
/** Show an explanation for a changing value; static labels need no tooltip. */
|
|
26
30
|
tooltip?: boolean;
|
|
@@ -29,6 +33,10 @@ declare const PageHeaderAction: React.ForwardRefExoticComponent<ButtonProps & {
|
|
|
29
33
|
label: string;
|
|
30
34
|
iconOnly?: boolean;
|
|
31
35
|
primary?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* A key the screen binds for this action. It shows in the tooltip and sets
|
|
38
|
+
* `aria-keyshortcuts`, so pass it only when the screen handles the key.
|
|
39
|
+
*/
|
|
32
40
|
shortcut?: string;
|
|
33
41
|
/** Show an explanation for a changing value; static labels need no tooltip. */
|
|
34
42
|
tooltip?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-header.d.ts","sourceRoot":"","sources":["../../../src/components/patterns/page-header.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,EAA2B,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAMlF,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,KAAK,6BAA6B,GAAG,KAAK,CAAC,iBAAiB,GAAG;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,KAAK,eAAe,GAAG,6BAA6B,GAAG;IACrD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF;;;GAGG;AACH,iBAAS,iBAAiB,CAAC,EACzB,QAAQ,EACR,KAAK,EACL,QAAQ,GACT,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,qBAYhE;AAID,KAAK,qBAAqB,GAAG,WAAW,GAAG;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+EAA+E;IAC/E,OAAO,CAAC,EAA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AM,UAAU,EAAE,mBAuCjB,CAAC;AAEF,OAAO,EACL,UAAU,EACV,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,4BAA4B,EAC5B,+BAA+B,EAC/B,sCAAsC,EACtC,sCAAsC,GACvC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"share-modal.d.ts","sourceRoot":"","sources":["../../../src/components/patterns/share-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAE1D,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAGL,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,EAEZ,MAAM,wBAAwB,CAAC;AAGhC,KAAK,YAAY,GAAG,GAAG,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;AAE1E,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,YAAY,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAwBlD,iBAAS,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,wBAAwB,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,qBAE/E;
|
|
1
|
+
{"version":3,"file":"share-modal.d.ts","sourceRoot":"","sources":["../../../src/components/patterns/share-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAE1D,OA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A,MAAM,WAAW,iDAA4B,CAAC;AAE9C,QAAA,MAAM,kBAAkB,wHAA+B,CAAC;AAExD,QAAA,MAAM,iBAAiB,uDAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"alert-dialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/alert-dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAC;AAGrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAK1D,QAAA,MAAM,WAAW,iDAA4B,CAAC;AAE9C,QAAA,MAAM,kBAAkB,wHAA+B,CAAC;AAExD,QAAA,MAAM,iBAAiB,uDAA8B,CAAC;AAGtD,QAAA,MAAM,kBAAkB,wKAYtB,CAAC;AASH,QAAA,MAAM,kBAAkB;uBAHH,MAAM;wCAoBzB,CAAC;mCAGwB,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;;;;mCAK7D,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;;;;AAQxF,QAAA,MAAM,gBAAgB,8KASpB,CAAC;AAGH,QAAA,MAAM,sBAAsB,wLAK1B,CAAC;AAGH,QAAA,MAAM,iBAAiB,4MAcrB,CAAC;AAGH,QAAA,MAAM,iBAAiB,6KAkBrB,CAAC;AAGH,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,GAClB,CAAC"}
|
|
@@ -62,8 +62,9 @@ interface FloatingSidebarProps extends Omit<React.ComponentProps<'div'>, 'childr
|
|
|
62
62
|
*/
|
|
63
63
|
armHoverOnRest?: boolean;
|
|
64
64
|
/**
|
|
65
|
-
* Changing it (e.g. to the route's path) cancels a pending close
|
|
66
|
-
*
|
|
65
|
+
* Changing it (e.g. to the route's path) cancels a pending close while the
|
|
66
|
+
* pointer is over the panel: a layout shift inside the panel can fire a
|
|
67
|
+
* mouseleave though the pointer never left.
|
|
67
68
|
*/
|
|
68
69
|
resetKey?: unknown;
|
|
69
70
|
pinLabel?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floating-sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/ui/floating-sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAOL,KAAK,yBAAyB,EAC/B,MAAM,0CAA0C,CAAC;AAwJlD,UAAU,oBAAqB,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IAClF,0EAA0E;IAC1E,MAAM,EAAE,OAAO,CAAC;IAChB,0CAA0C;IAC1C,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,yBAAyB,CAAC;IACvC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,wFAAwF;IACxF,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,4GAA4G;IAC5G,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,sDAAsD;IACtD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gHAAgH;IAChH,QAAQ,CAAC,EAAE,MAAM,GAAG,SAA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AAM,GAAG,SAAS,CAAC;IAC9B,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mFAAmF;IACnF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,QAAA,MAAM,eAAe,0GAqnBpB,CAAC;AAGF,OAAO,EAAE,eAAe,EAAE,CAAC;AAC3B,YAAY,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
2
|
export interface StickyFooterProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
3
3
|
shiftY?: string;
|
|
4
4
|
height?: number;
|
|
5
5
|
children?: ReactNode;
|
|
6
6
|
contentClassName?: string;
|
|
7
7
|
}
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* Keeps actions visible at the bottom of a scrolling surface.
|
|
10
|
+
*
|
|
11
|
+
* The footer takes its background from `--sticky-footer-background`, which
|
|
12
|
+
* Shade's Dialog sets to its own surface; anywhere else it falls back to
|
|
13
|
+
* `--background`. When the scroll container has bottom padding, the footer
|
|
14
|
+
* fills it so content doesn't show beneath the footer.
|
|
15
|
+
*/
|
|
9
16
|
export declare const StickyFooter: ({ shiftY, height, children, className, contentClassName, style, ...props }: StickyFooterProps) => import("react").JSX.Element;
|
|
10
17
|
//# sourceMappingURL=sticky-footer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sticky-footer.d.ts","sourceRoot":"","sources":["../../../src/components/ui/sticky-footer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"sticky-footer.d.ts","sourceRoot":"","sources":["../../../src/components/ui/sticky-footer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGrF,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IACzF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AASD;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,+EAQtB,iBAAiB,gCAqEnB,CAAC"}
|
package/types/components.d.ts
CHANGED
|
@@ -76,7 +76,7 @@ export * from './components/ui/tooltip';
|
|
|
76
76
|
export type { DropdownMenuCheckboxItemProps as DropdownMenuCheckboxItemProps } from '@radix-ui/react-dropdown-menu';
|
|
77
77
|
export type { ContextMenuCheckboxItemProps as ContextMenuCheckboxItemProps } from '@radix-ui/react-context-menu';
|
|
78
78
|
export { IconComponents as Icon } from './components/ui/icon';
|
|
79
|
-
export { FacebookLogo, GhostLogo, GhostOrb, GoogleLogo,
|
|
79
|
+
export { FacebookLogo, GhostLogo, GhostOrb, GoogleLogo, XLogo } from './assets/images';
|
|
80
80
|
export { TimePicker, type TimePickerProps } from './components/ui/time-picker';
|
|
81
81
|
export { tokenFieldClasses } from './components/ui/token-field';
|
|
82
82
|
//# sourceMappingURL=components.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AACA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,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
|
|
1
|
-
{"version":3,"file":"images-CUcakpOD.js","names":[],"sources":["../src/assets/images/facebook-logo.svg?react","../src/assets/images/ghost-logo.svg?react","../src/assets/images/ghost-orb.svg?react","../src/assets/images/google-logo.svg?react","../src/assets/images/twitter-logo.svg?react","../src/assets/images/x-logo.svg?react","../src/assets/images/index.ts"],"sourcesContent":["import * as React from \"react\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst SvgFacebookLogo = (props) => /* @__PURE__ */ _jsxs(\"svg\", {\n\tfill: \"none\",\n\txmlns: \"http://www.w3.org/2000/svg\",\n\t...props,\n\tchildren: [\n\t\t/* @__PURE__ */ _jsx(\"title\", { children: \"social-facebook\" }),\n\t\t/* @__PURE__ */ _jsx(\"path\", {\n\t\t\td: \"M20 40.004c11.046 0 20-8.955 20-20 0-11.046-8.954-20-20-20s-20 8.954-20 20c0 11.045 8.954 20 20 20z\",\n\t\t\tfill: \"#1977F3\"\n\t\t}),\n\t\t/* @__PURE__ */ _jsx(\"path\", {\n\t\t\td: \"m27.785 25.785.886-5.782h-5.546V16.25c0-1.58.773-3.125 3.26-3.125h2.522V8.204s-2.29-.39-4.477-.39c-4.568 0-7.555 2.767-7.555 7.781v4.408h-5.08v5.782h5.08v13.976a20.08 20.08 0 0 0 3.125.242c1.063 0 2.107-.085 3.125-.242V25.785h4.66z\",\n\t\t\tfill: \"#fff\"\n\t\t})\n\t]\n});\nexport default SvgFacebookLogo;\n","import * as React from \"react\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst SvgGhostLogo = (props) => /* @__PURE__ */ _jsx(\"svg\", {\n\tviewBox: \"0 0 770 294\",\n\tstyle: {\n\t\tbackgroundSize: \"100% 100%\",\n\t\tbackgroundRepeat: \"no-repeat\",\n\t\tbackgroundImage: \"url(https://assets.ghost.io/admin/1597/assets/img/logos/ghost-logo-black-1-fb561a374422b405ec90fa586b05ebdf.png)\"\n\t},\n\talt: \"Ghost\",\n\t...props\n});\nexport default SvgGhostLogo;\n","import * as React from \"react\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst SvgGhostOrb = (props) => /* @__PURE__ */ _jsx(\"svg\", {\n\tfill: \"none\",\n\theight: 24,\n\tviewBox: \"0 0 24 24\",\n\twidth: 24,\n\txmlns: \"http://www.w3.org/2000/svg\",\n\t...props,\n\tchildren: /* @__PURE__ */ _jsx(\"path\", {\n\t\tclipRule: \"evenodd\",\n\t\td: \"M24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12ZM11.8326 2.33879C6.37785 2.95189 3.95901 5.20797 3.41126 9.74699C3.34896 10.2632 3.22642 10.7805 3.10443 11.2954C2.93277 12.02 2.76221 12.74 2.76221 13.4458C2.76221 17.9885 6.5856 21.556 11.1283 21.556C12.8959 21.556 14.4433 20.8144 15.8756 20.048C19.0536 18.3478 22.0328 16.2597 22.0328 12.5411C22.0328 9.91512 20.1051 7.56932 18.466 5.5747C18.3834 5.47416 18.3015 5.37451 18.2206 5.27577C17.3866 4.25742 14.4333 2.04643 11.8326 2.33879Z\",\n\t\tfill: \"currentColor\",\n\t\tfillRule: \"evenodd\"\n\t})\n});\nexport default SvgGhostOrb;\n","import * as React from \"react\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst SvgGoogleLogo = (props) => /* @__PURE__ */ _jsxs(\"svg\", {\n\tfill: \"none\",\n\tviewBox: \"0 0 92 31\",\n\t...props,\n\tchildren: [\n\t\t/* @__PURE__ */ _jsx(\"title\", { children: \"google\" }),\n\t\t/* @__PURE__ */ _jsx(\"path\", {\n\t\t\td: \"M39.15 15.898c0 4.303-3.378 7.473-7.525 7.473s-7.526-3.17-7.526-7.473c0-4.334 3.38-7.474 7.526-7.474 4.147 0 7.526 3.14 7.526 7.474zm-3.294 0c0-2.69-1.958-4.529-4.231-4.529-2.273 0-4.231 1.84-4.231 4.529 0 2.662 1.958 4.528 4.231 4.528 2.273 0 4.231-1.87 4.231-4.528z\",\n\t\t\tfill: \"#EA4335\"\n\t\t}),\n\t\t/* @__PURE__ */ _jsx(\"path\", {\n\t\t\td: \"M55.386 15.898c0 4.303-3.379 7.473-7.526 7.473-4.146 0-7.526-3.17-7.526-7.473 0-4.33 3.38-7.474 7.526-7.474 4.147 0 7.526 3.14 7.526 7.474zm-3.294 0c0-2.69-1.959-4.529-4.232-4.529s-4.231 1.84-4.231 4.529c0 2.662 1.958 4.528 4.231 4.528 2.273 0 4.232-1.87 4.232-4.528z\",\n\t\t\tfill: \"#FBBC05\"\n\t\t}),\n\t\t/* @__PURE__ */ _jsx(\"path\", {\n\t\t\td: \"M70.945 8.875v13.418c0 5.52-3.267 7.774-7.13 7.774-3.636 0-5.825-2.423-6.65-4.404l2.868-1.19c.511 1.217 1.763 2.652 3.779 2.652 2.472 0 4.004-1.52 4.004-4.38V21.67h-.115c-.737.906-2.158 1.698-3.95 1.698-3.751 0-7.188-3.255-7.188-7.443 0-4.22 3.437-7.501 7.188-7.501 1.789 0 3.21.792 3.95 1.671h.115V8.88h3.129v-.004zm-2.895 7.05c0-2.632-1.763-4.556-4.005-4.556-2.273 0-4.177 1.924-4.177 4.556 0 2.604 1.904 4.501 4.177 4.501 2.242 0 4.005-1.897 4.005-4.501z\",\n\t\t\tfill: \"#4285F4\"\n\t\t}),\n\t\t/* @__PURE__ */ _jsx(\"path\", {\n\t\t\td: \"M76.103 1.01v21.903H72.89V1.011h3.213z\",\n\t\t\tfill: \"#34A853\"\n\t\t}),\n\t\t/* @__PURE__ */ _jsx(\"path\", {\n\t\t\td: \"M88.624 18.357l2.558 1.699c-.826 1.216-2.815 3.312-6.251 3.312-4.262 0-7.445-3.282-7.445-7.474 0-4.444 3.21-7.473 7.076-7.473 3.893 0 5.798 3.086 6.42 4.754l.341.85-10.028 4.137c.768 1.5 1.962 2.264 3.636 2.264 1.678 0 2.841-.822 3.693-2.069zm-7.87-2.688l6.703-2.774c-.368-.933-1.478-1.583-2.783-1.583-1.674 0-4.005 1.472-3.92 4.357z\",\n\t\t\tfill: \"#EA4335\"\n\t\t}),\n\t\t/* @__PURE__ */ _jsx(\"path\", {\n\t\t\td: \"M11.936 13.953v-3.17h10.726c.105.552.159 1.206.159 1.914 0 2.378-.653 5.32-2.757 7.416-2.046 2.123-4.66 3.255-8.124 3.255-6.42 0-11.818-5.21-11.818-11.605C.122 5.368 5.52.158 11.94.158c3.551 0 6.081 1.389 7.982 3.198l-2.246 2.237c-1.363-1.273-3.21-2.264-5.74-2.264-4.688 0-8.354 3.764-8.354 8.434s3.666 8.434 8.354 8.434c3.041 0 4.773-1.216 5.882-2.322.9-.896 1.492-2.176 1.725-3.925l-7.607.003z\",\n\t\t\tfill: \"#4285F4\"\n\t\t})\n\t]\n});\nexport default SvgGoogleLogo;\n","import * as React from \"react\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst SvgTwitterLogo = (props) => /* @__PURE__ */ _jsxs(\"svg\", {\n\tfill: \"none\",\n\txmlns: \"http://www.w3.org/2000/svg\",\n\t...props,\n\tchildren: [\n\t\t/* @__PURE__ */ _jsx(\"title\", { children: \"social-twitter\" }),\n\t\t/* @__PURE__ */ _jsx(\"circle\", {\n\t\t\tcx: 20,\n\t\t\tcy: 20,\n\t\t\tr: 20,\n\t\t\tfill: \"#51B1EF\"\n\t\t}),\n\t\t/* @__PURE__ */ _jsx(\"path\", {\n\t\t\td: \"M30.905 14.268a8.63 8.63 0 0 1-2.49.686 4.36 4.36 0 0 0 1.902-2.403 8.602 8.602 0 0 1-2.753 1.054c-3.512-3.488-8.463.13-7.396 3.969a12.284 12.284 0 0 1-8.942-4.543c-1.228 2.093-.428 4.667 1.343 5.798a4.31 4.31 0 0 1-1.965-.544v.055a4.35 4.35 0 0 0 3.48 4.263 4.569 4.569 0 0 1-1.964.074 4.367 4.367 0 0 0 4.053 3.023c-1.918 1.46-4.146 2.062-6.42 1.798 9.793 5.767 19.029-1.783 18.998-10.417 0-.187-.004-.374-.012-.561a9 9 0 0 0 2.166-2.248\",\n\t\t\tfill: \"#fff\"\n\t\t})\n\t]\n});\nexport default SvgTwitterLogo;\n","import * as React from \"react\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst SvgXLogo = (props) => /* @__PURE__ */ _jsx(\"svg\", {\n\tviewBox: \"0 0 24 24\",\n\t\"aria-hidden\": \"true\",\n\t...props,\n\tchildren: /* @__PURE__ */ _jsx(\"g\", { children: /* @__PURE__ */ _jsx(\"path\", {\n\t\td: \"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z\",\n\t\tfill: \"currentColor\"\n\t}) })\n});\nexport default SvgXLogo;\n","import type { FunctionComponent, SVGProps } from 'react';\nimport FacebookLogoSvg from './facebook-logo.svg?react';\nimport GhostLogoSvg from './ghost-logo.svg?react';\nimport GhostOrbSvg from './ghost-orb.svg?react';\nimport GoogleLogoSvg from './google-logo.svg?react';\nimport TwitterLogoSvg from './twitter-logo.svg?react';\nimport XLogoSvg from './x-logo.svg?react';\n\n// Explicit types keep the `?react` asset imports out of the published\n// declarations, where consumers can't resolve them.\ntype Logo = FunctionComponent<SVGProps<SVGSVGElement>>;\n\nexport const FacebookLogo: Logo = FacebookLogoSvg;\nexport const GhostLogo: Logo = GhostLogoSvg;\nexport const GhostOrb: Logo = GhostOrbSvg;\nexport const GoogleLogo: Logo = GoogleLogoSvg;\nexport const TwitterLogo: Logo = TwitterLogoSvg;\nexport const XLogo: Logo = XLogoSvg;\n"],"mappings":";;;AAEA,IAAM,mBAAmB,UAA0B,qBAAM,OAAO;CAC/D,MAAM;CACN,OAAO;CACP,GAAG;CACH,UAAU;EACO,oBAAK,SAAS,EAAE,UAAU,kBAAkB,CAAC;EAC7C,oBAAK,QAAQ;GAC5B,GAAG;GACH,MAAM;EACP,CAAC;EAC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