@fanvue/ui 3.37.1 → 3.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/ChatEmbed/ChatEmbed.cjs +315 -0
- package/dist/cjs/components/ChatEmbed/ChatEmbed.cjs.map +1 -0
- package/dist/cjs/components/DropdownMenu/DropdownMenuItem.cjs +24 -25
- package/dist/cjs/components/DropdownMenu/DropdownMenuItem.cjs.map +1 -1
- package/dist/cjs/components/DropdownMenu/DropdownMenuRoot.cjs +7 -8
- package/dist/cjs/components/DropdownMenu/DropdownMenuRoot.cjs.map +1 -1
- package/dist/cjs/components/LiveStatus/LiveStatus.cjs +51 -0
- package/dist/cjs/components/LiveStatus/LiveStatus.cjs.map +1 -0
- package/dist/cjs/components/SwitchField/SwitchField.cjs +12 -1
- package/dist/cjs/components/SwitchField/SwitchField.cjs.map +1 -1
- package/dist/cjs/index.cjs +6 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/components/ChatEmbed/ChatEmbed.mjs +298 -0
- package/dist/components/ChatEmbed/ChatEmbed.mjs.map +1 -0
- package/dist/components/DropdownMenu/DropdownMenuItem.mjs +24 -25
- package/dist/components/DropdownMenu/DropdownMenuItem.mjs.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenuRoot.mjs +7 -8
- package/dist/components/DropdownMenu/DropdownMenuRoot.mjs.map +1 -1
- package/dist/components/LiveStatus/LiveStatus.mjs +34 -0
- package/dist/components/LiveStatus/LiveStatus.mjs.map +1 -0
- package/dist/components/SwitchField/SwitchField.mjs +12 -1
- package/dist/components/SwitchField/SwitchField.mjs.map +1 -1
- package/dist/index.d.ts +178 -5
- package/dist/index.mjs +6 -0
- package/dist/index.mjs.map +1 -1
- package/dist/styles/theme.css +21 -2
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenuRoot.cjs","sources":["../../../../src/components/DropdownMenu/DropdownMenuRoot.tsx"],"sourcesContent":["import * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { FLOATING_CONTENT_COLLISION_PADDING } from \"../../utils/floatingContentCollisionPadding\";\nimport { Drawer, DrawerContent, DrawerTrigger } from \"../Drawer/Drawer\";\nimport { type DropdownMenuVariant, DropdownMenuVariantContext, ToggleOpenContext } from \"./context\";\n\n// Movement, in CSS px, above which a touch press-and-release counts as a drag.\nconst TAP_MOVEMENT_THRESHOLD_PX = 10;\n\n// Radix menus swallow Tab (a menu has no tab stops, only items), which strands\n// any non-item control rendered inside one — header actions, a search input,\n// reorder handles. Containers of such controls carry this attribute and\n// `DropdownMenuContent` cycles Tab through the focusable elements inside them.\nconst TAB_STOPS_ATTRIBUTE = \"data-dropdown-menu-tab-stops\";\nconst FOCUSABLE_SELECTOR = \"a[href], button, input, select, textarea, [tabindex]\";\n\nfunction getMenuTabStops(content: HTMLElement): HTMLElement[] {\n const stops: HTMLElement[] = [];\n for (const container of content.querySelectorAll<HTMLElement>(`[${TAB_STOPS_ATTRIBUTE}]`)) {\n for (const element of container.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR)) {\n if (element.tabIndex < 0 || element.matches(\":disabled\") || element.hidden) continue;\n stops.push(element);\n }\n }\n return stops;\n}\n\n// Cycles focus through the menu's tab stops on Tab / Shift+Tab, skipping menu\n// items (which keep their arrow-key navigation). Returns without acting when\n// the key isn't a plain Tab, came from a nested menu, or there is nothing to\n// cycle through — Radix then swallows the key as it always has.\nfunction cycleMenuTabStops(event: React.KeyboardEvent<HTMLElement>): void {\n if (event.key !== \"Tab\" || event.altKey || event.ctrlKey || event.metaKey) return;\n // A nested menu's keydowns bubble here through React's portal tree; they are\n // the nested menu's to handle.\n const target = event.target as HTMLElement;\n if (target.closest(\"[data-radix-menu-content]\") !== event.currentTarget) return;\n const stops = getMenuTabStops(event.currentTarget);\n if (stops.length === 0) return;\n // Prevented here so Radix's own handler (which would swallow the key) is\n // skipped — Radix composes it after ours and checks `defaultPrevented`.\n event.preventDefault();\n const index = stops.indexOf(target);\n const last = stops.length - 1;\n const next = event.shiftKey\n ? stops[index <= 0 ? last : index - 1]\n : stops[index === -1 || index === last ? 0 : index + 1];\n // Radix's FocusScope also sees this Tab (after us, ignoring\n // `defaultPrevented`), but a menu's scope is trapped without `loop`, so it\n // only prevents the default — it never moves focus itself.\n next?.focus({ preventScroll: true });\n}\n\ntype ActiveTap = {\n pointerId: number;\n x: number;\n y: number;\n movedPastThreshold: boolean;\n};\n\n/** Props for the {@link DropdownMenu} root component. */\nexport interface DropdownMenuProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Root> {\n /** How the menu presents its content. @default \"menu\" */\n variant?: DropdownMenuVariant;\n}\n\n/** Root component that manages open/close state for a dropdown menu. */\nexport function DropdownMenu({\n open: openProp,\n defaultOpen,\n onOpenChange,\n variant = \"menu\",\n children,\n ...props\n}: DropdownMenuProps) {\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n });\n\n if (variant === \"sheet\") {\n return (\n <DropdownMenuVariantContext.Provider value=\"sheet\">\n <ToggleOpenContext.Provider value={setOpen}>\n <Drawer open={open} onOpenChange={setOpen}>\n {children}\n </Drawer>\n </ToggleOpenContext.Provider>\n </DropdownMenuVariantContext.Provider>\n );\n }\n\n return (\n <DropdownMenuVariantContext.Provider value=\"menu\">\n <ToggleOpenContext.Provider value={setOpen}>\n <DropdownMenuPrimitive.Root open={open} onOpenChange={setOpen} {...props}>\n {children}\n </DropdownMenuPrimitive.Root>\n </ToggleOpenContext.Provider>\n </DropdownMenuVariantContext.Provider>\n );\n}\n\n/** Props for the {@link DropdownMenuTrigger} component. */\nexport type DropdownMenuTriggerProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Trigger\n>;\n\n/**\n * The element that toggles the dropdown menu when clicked.\n *\n * On touch devices, the menu only opens if the press-and-release stays within\n * a small movement threshold. A drag that incidentally ends over the trigger\n * (common when scrolling a feed on Android Chrome) is ignored. Mouse and\n * keyboard interactions are unchanged.\n */\nexport const DropdownMenuTrigger = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Trigger>,\n DropdownMenuTriggerProps\n>((props, ref) => {\n const variant = React.useContext(DropdownMenuVariantContext);\n const toggleOpen = React.useContext(ToggleOpenContext);\n const tapRef = React.useRef<ActiveTap | null>(null);\n\n // The sheet variant opens a Drawer (Dialog), which already suppresses\n // scroll-drag-end synthetic clicks itself — no need for the touch-tap gating below.\n if (variant === \"sheet\") {\n return <DrawerTrigger {...props} ref={ref} />;\n }\n\n // Used outside our DropdownMenu wrapper — fall through to Radix defaults.\n if (toggleOpen === null) {\n return <DropdownMenuPrimitive.Trigger {...props} ref={ref} />;\n }\n\n return (\n <DropdownMenuPrimitive.Trigger\n {...props}\n ref={ref}\n onPointerDown={(event) => {\n props.onPointerDown?.(event);\n if (event.pointerType === \"mouse\" || props.disabled) return;\n // Keep pointerup / pointercancel on this element if the finger drifts off.\n // Optional because jsdom (used in tests) doesn't implement it.\n event.currentTarget.setPointerCapture?.(event.pointerId);\n tapRef.current = {\n pointerId: event.pointerId,\n x: event.clientX,\n y: event.clientY,\n movedPastThreshold: false,\n };\n // preventDefault stops Radix's pointerdown open path via composeEventHandlers.\n event.preventDefault();\n }}\n onPointerMove={(event) => {\n props.onPointerMove?.(event);\n const tap = tapRef.current;\n if (tap === null || event.pointerId !== tap.pointerId || tap.movedPastThreshold) {\n return;\n }\n const dx = event.clientX - tap.x;\n const dy = event.clientY - tap.y;\n if (Math.hypot(dx, dy) > TAP_MOVEMENT_THRESHOLD_PX) {\n tap.movedPastThreshold = true;\n }\n }}\n onPointerUp={(event) => {\n props.onPointerUp?.(event);\n const tap = tapRef.current;\n if (tap === null || event.pointerId !== tap.pointerId) return;\n const wasDrag = tap.movedPastThreshold;\n tapRef.current = null;\n if (!wasDrag && !props.disabled) {\n toggleOpen((prev) => !prev);\n }\n }}\n onPointerCancel={(event) => {\n props.onPointerCancel?.(event);\n const tap = tapRef.current;\n if (tap !== null && event.pointerId === tap.pointerId) {\n tapRef.current = null;\n }\n }}\n />\n );\n});\nDropdownMenuTrigger.displayName = \"DropdownMenuTrigger\";\n\n/** Props for the {@link DropdownMenuContent} component. */\nexport interface DropdownMenuContentProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content> {}\n\n/**\n * The positioned content panel rendered inside a portal.\n *\n * Override the portal z-index per-instance via `style={{ zIndex: 1500 }}` or\n * globally with the `--fanvue-ui-portal-z-index` CSS custom property.\n *\n * @example\n * ```tsx\n * <DropdownMenu>\n * <DropdownMenuTrigger asChild>\n * <Button>Open</Button>\n * </DropdownMenuTrigger>\n * <DropdownMenuContent>\n * <DropdownMenuItem>Option 1</DropdownMenuItem>\n * <DropdownMenuItem>Option 2</DropdownMenuItem>\n * </DropdownMenuContent>\n * </DropdownMenu>\n * ```\n */\nexport const DropdownMenuContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Content>,\n DropdownMenuContentProps\n>(\n (\n {\n className,\n style,\n sideOffset = 4,\n // Radix defaults `avoidCollisions` to true, so passing `collisionPadding`\n // is enough to keep the menu flipping/shifting to stay on screen — no\n // hand-rolled reposition logic needed.\n collisionPadding = FLOATING_CONTENT_COLLISION_PADDING,\n onPointerDownOutside,\n onCloseAutoFocus,\n onKeyDown,\n children,\n ...props\n },\n ref,\n ) => {\n const variant = React.useContext(DropdownMenuVariantContext);\n // Radix returns focus to the trigger when the menu closes. That is right for\n // the keyboard, but Chrome's :focus-visible heuristic also paints the ring on\n // that programmatic refocus, so dismissing with a click left a focus ring\n // sitting on the trigger. Track pointer dismissals and skip the restore for\n // them only — Escape and Tab still hand focus back with the ring.\n const dismissedByPointer = React.useRef(false);\n\n if (variant === \"sheet\") {\n return (\n <DrawerContent\n ref={ref}\n position=\"bottom\"\n // `\"sheet\"` sits flush to the bottom edge at full width; the design draws\n // this panel inset from all three sides and rounded on every corner, which\n // is `\"menu\"`. Both carry the same modal surface.\n variant=\"menu\"\n // The design's `blur + shadow/menu` effect is a background blur, and the\n // panel's own fill is opaque — so the blur has to go on the overlay to be\n // visible at all. Scoped here rather than on DrawerOverlay so only menus\n // shown this way blur the page behind them.\n overlayProps={{ className: \"backdrop-blur-[8px]\" }}\n // `pb-4` gives the design's 16px below the last row. The rows inset\n // themselves horizontally (see the item's `mx-3`) rather than the panel\n // padding doing it, so the header and its rule can still run full width.\n className={cn(\"flex flex-col gap-1 p-1 pb-4\", className)}\n style={style}\n // Both are destructured above for the popper branch's focus-ring\n // handling, which takes them out of `props` — so the sheet branch has\n // to re-attach them or they are silently dropped. `DrawerContent`\n // forwards them to its `DialogPrimitive.Content`, which supports both.\n // Consumers stack sheets on these (a nested sheet's `onCloseAutoFocus`\n // is the only point at which the parent knows the child has finished\n // animating out), so dropping them breaks the flow with no error.\n onPointerDownOutside={onPointerDownOutside}\n onCloseAutoFocus={onCloseAutoFocus}\n onKeyDown={onKeyDown}\n {...props}\n >\n {children}\n </DrawerContent>\n );\n }\n\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n onPointerDownOutside={(event) => {\n dismissedByPointer.current = true;\n onPointerDownOutside?.(event);\n }}\n onCloseAutoFocus={(event) => {\n if (dismissedByPointer.current) event.preventDefault();\n dismissedByPointer.current = false;\n onCloseAutoFocus?.(event);\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (!event.defaultPrevented) cycleMenuTabStops(event);\n }}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n className={cn(\n // Panel tokens come from `V2 Menu Dropdown` (product file node\n // `7393:62008`): `rounded-lg` (24px) over `Background/Secondary`, a\n // `Border/Strong` stroke, and 8px of padding. The 12px `rounded-sm` is\n // the row radius, not the panel's — the two were transposed here.\n //\n // `backdrop-blur-[4px]` is the CSS equivalent of that node's\n // `blur + shadow/menu` BACKGROUND_BLUR radius 8, which Figma halves on\n // export. It is not a 4-against-8 mismatch.\n \"w-max min-w-(--radix-dropdown-menu-trigger-width) max-w-(--radix-dropdown-menu-content-available-width) overflow-y-auto rounded-lg border border-border-strong bg-background-secondary p-2 text-content-primary shadow-blur-menu backdrop-blur-[4px]\",\n \"data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:animate-in\",\n \"data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:animate-out\",\n \"data-[side=top]:slide-in-from-bottom-2 data-[side=bottom]:slide-in-from-top-2\",\n \"data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2\",\n className,\n )}\n style={{\n zIndex: \"var(--fanvue-ui-portal-z-index, 50)\",\n maxHeight: \"var(--radix-dropdown-menu-content-available-height)\",\n ...style,\n }}\n {...props}\n >\n {children}\n </DropdownMenuPrimitive.Content>\n </DropdownMenuPrimitive.Portal>\n );\n },\n);\nDropdownMenuContent.displayName = \"DropdownMenuContent\";\n\n/** Props for the {@link DropdownMenuGroup} component. */\nexport type DropdownMenuGroupProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Group\n>;\n\n/**\n * Groups related menu items. Accepts an optional `DropdownMenuLabel`.\n *\n * Requires Radix menu context — not supported inside a `variant=\"sheet\"` menu.\n */\nexport const DropdownMenuGroup = DropdownMenuPrimitive.Group;\nDropdownMenuGroup.displayName = \"DropdownMenuGroup\";\n"],"names":["useControllableState","DropdownMenuVariantContext","ToggleOpenContext","Drawer","jsx","DropdownMenuPrimitive","React","DrawerTrigger","FLOATING_CONTENT_COLLISION_PADDING","DrawerContent","cn"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,MAAM,4BAA4B;AAMlC,MAAM,sBAAsB;AAC5B,MAAM,qBAAqB;AAE3B,SAAS,gBAAgB,SAAqC;AAC5D,QAAM,QAAuB,CAAA;AAC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;AAAAA,MAACC,iCAAsB;AAAA,MAAtB;AAAA,QACC;AAAA,QACA,sBAAsB,CAAC,UAAU;AAC/B,6BAAmB,UAAU;AAC7B,iCAAuB,KAAK;AAAA,QAC9B;AAAA,QACA,kBAAkB,CAAC,UAAU;AAC3B,cAAI,mBAAmB,QAAS,OAAM,eAAA;AACtC,6BAAmB,UAAU;AAC7B,6BAAmB,KAAK;AAAA,QAC1B;AAAA,QACA,WAAW,CAAC,UAAU;AACpB,sBAAY,KAAK;AACjB,cAAI,CAAC,MAAM,iBAAkB,mBAAkB,KAAK;AAAA,QACtD;AAAA,QACA;AAAA,QACA;AAAA,QACA,WAAWK,GAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,UAST;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QAAA;AAAA,QAEF,OAAO;AAAA,UACL,QAAQ;AAAA,UACR,WAAW;AAAA,UACX,GAAG;AAAA,QAAA;AAAA,QAEJ,GAAG;AAAA,QAEH;AAAA,MAAA;AAAA,IAAA,GAEL;AAAA,EAEJ;AACF;AACA,oBAAoB,cAAc;AAY3B,MAAM,oBAAoBL,iCAAsB;AACvD,kBAAkB,cAAc;;;;;"}
|
|
1
|
+
{"version":3,"file":"DropdownMenuRoot.cjs","sources":["../../../../src/components/DropdownMenu/DropdownMenuRoot.tsx"],"sourcesContent":["import * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { FLOATING_CONTENT_COLLISION_PADDING } from \"../../utils/floatingContentCollisionPadding\";\nimport { Drawer, DrawerContent, DrawerTrigger } from \"../Drawer/Drawer\";\nimport { type DropdownMenuVariant, DropdownMenuVariantContext, ToggleOpenContext } from \"./context\";\n\n// Movement, in CSS px, above which a touch press-and-release counts as a drag.\nconst TAP_MOVEMENT_THRESHOLD_PX = 10;\n\n// Radix menus swallow Tab (a menu has no tab stops, only items), which strands\n// any non-item control rendered inside one — header actions, a search input,\n// reorder handles. Containers of such controls carry this attribute and\n// `DropdownMenuContent` cycles Tab through the focusable elements inside them.\nconst TAB_STOPS_ATTRIBUTE = \"data-dropdown-menu-tab-stops\";\nconst FOCUSABLE_SELECTOR = \"a[href], button, input, select, textarea, [tabindex]\";\n\nfunction getMenuTabStops(content: HTMLElement): HTMLElement[] {\n const stops: HTMLElement[] = [];\n for (const container of content.querySelectorAll<HTMLElement>(`[${TAB_STOPS_ATTRIBUTE}]`)) {\n for (const element of container.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR)) {\n if (element.tabIndex < 0 || element.matches(\":disabled\") || element.hidden) continue;\n stops.push(element);\n }\n }\n return stops;\n}\n\n// Cycles focus through the menu's tab stops on Tab / Shift+Tab, skipping menu\n// items (which keep their arrow-key navigation). Returns without acting when\n// the key isn't a plain Tab, came from a nested menu, or there is nothing to\n// cycle through — Radix then swallows the key as it always has.\nfunction cycleMenuTabStops(event: React.KeyboardEvent<HTMLElement>): void {\n if (event.key !== \"Tab\" || event.altKey || event.ctrlKey || event.metaKey) return;\n // A nested menu's keydowns bubble here through React's portal tree; they are\n // the nested menu's to handle.\n const target = event.target as HTMLElement;\n if (target.closest(\"[data-radix-menu-content]\") !== event.currentTarget) return;\n const stops = getMenuTabStops(event.currentTarget);\n if (stops.length === 0) return;\n // Prevented here so Radix's own handler (which would swallow the key) is\n // skipped — Radix composes it after ours and checks `defaultPrevented`.\n event.preventDefault();\n const index = stops.indexOf(target);\n const last = stops.length - 1;\n const next = event.shiftKey\n ? stops[index <= 0 ? last : index - 1]\n : stops[index === -1 || index === last ? 0 : index + 1];\n // Radix's FocusScope also sees this Tab (after us, ignoring\n // `defaultPrevented`), but a menu's scope is trapped without `loop`, so it\n // only prevents the default — it never moves focus itself.\n next?.focus({ preventScroll: true });\n}\n\ntype ActiveTap = {\n pointerId: number;\n x: number;\n y: number;\n movedPastThreshold: boolean;\n};\n\n/** Props for the {@link DropdownMenu} root component. */\nexport interface DropdownMenuProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Root> {\n /** How the menu presents its content. @default \"menu\" */\n variant?: DropdownMenuVariant;\n}\n\n/** Root component that manages open/close state for a dropdown menu. */\nexport function DropdownMenu({\n open: openProp,\n defaultOpen,\n onOpenChange,\n variant = \"menu\",\n children,\n ...props\n}: DropdownMenuProps) {\n const [open = false, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n });\n\n if (variant === \"sheet\") {\n return (\n <DropdownMenuVariantContext.Provider value=\"sheet\">\n <ToggleOpenContext.Provider value={setOpen}>\n <Drawer open={open} onOpenChange={setOpen}>\n {children}\n </Drawer>\n </ToggleOpenContext.Provider>\n </DropdownMenuVariantContext.Provider>\n );\n }\n\n return (\n <DropdownMenuVariantContext.Provider value=\"menu\">\n <ToggleOpenContext.Provider value={setOpen}>\n <DropdownMenuPrimitive.Root open={open} onOpenChange={setOpen} {...props}>\n {children}\n </DropdownMenuPrimitive.Root>\n </ToggleOpenContext.Provider>\n </DropdownMenuVariantContext.Provider>\n );\n}\n\n/** Props for the {@link DropdownMenuTrigger} component. */\nexport type DropdownMenuTriggerProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Trigger\n>;\n\n/**\n * The element that toggles the dropdown menu when clicked.\n *\n * On touch devices, the menu only opens if the press-and-release stays within\n * a small movement threshold. A drag that incidentally ends over the trigger\n * (common when scrolling a feed on Android Chrome) is ignored. Mouse and\n * keyboard interactions are unchanged.\n */\nexport const DropdownMenuTrigger = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Trigger>,\n DropdownMenuTriggerProps\n>((props, ref) => {\n const variant = React.useContext(DropdownMenuVariantContext);\n const toggleOpen = React.useContext(ToggleOpenContext);\n const tapRef = React.useRef<ActiveTap | null>(null);\n\n // The sheet variant opens a Drawer (Dialog), which already suppresses\n // scroll-drag-end synthetic clicks itself — no need for the touch-tap gating below.\n if (variant === \"sheet\") {\n return <DrawerTrigger {...props} ref={ref} />;\n }\n\n // Used outside our DropdownMenu wrapper — fall through to Radix defaults.\n if (toggleOpen === null) {\n return <DropdownMenuPrimitive.Trigger {...props} ref={ref} />;\n }\n\n return (\n <DropdownMenuPrimitive.Trigger\n {...props}\n ref={ref}\n onPointerDown={(event) => {\n props.onPointerDown?.(event);\n if (event.pointerType === \"mouse\" || props.disabled) return;\n // Keep pointerup / pointercancel on this element if the finger drifts off.\n // Optional because jsdom (used in tests) doesn't implement it.\n event.currentTarget.setPointerCapture?.(event.pointerId);\n tapRef.current = {\n pointerId: event.pointerId,\n x: event.clientX,\n y: event.clientY,\n movedPastThreshold: false,\n };\n // preventDefault stops Radix's pointerdown open path via composeEventHandlers.\n event.preventDefault();\n }}\n onPointerMove={(event) => {\n props.onPointerMove?.(event);\n const tap = tapRef.current;\n if (tap === null || event.pointerId !== tap.pointerId || tap.movedPastThreshold) {\n return;\n }\n const dx = event.clientX - tap.x;\n const dy = event.clientY - tap.y;\n if (Math.hypot(dx, dy) > TAP_MOVEMENT_THRESHOLD_PX) {\n tap.movedPastThreshold = true;\n }\n }}\n onPointerUp={(event) => {\n props.onPointerUp?.(event);\n const tap = tapRef.current;\n if (tap === null || event.pointerId !== tap.pointerId) return;\n const wasDrag = tap.movedPastThreshold;\n tapRef.current = null;\n if (!wasDrag && !props.disabled) {\n toggleOpen((prev) => !prev);\n }\n }}\n onPointerCancel={(event) => {\n props.onPointerCancel?.(event);\n const tap = tapRef.current;\n if (tap !== null && event.pointerId === tap.pointerId) {\n tapRef.current = null;\n }\n }}\n />\n );\n});\nDropdownMenuTrigger.displayName = \"DropdownMenuTrigger\";\n\n/** Props for the {@link DropdownMenuContent} component. */\nexport interface DropdownMenuContentProps\n extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content> {}\n\n/**\n * The positioned content panel rendered inside a portal.\n *\n * Override the portal z-index per-instance via `style={{ zIndex: 1500 }}` or\n * globally with the `--fanvue-ui-portal-z-index` CSS custom property.\n *\n * @example\n * ```tsx\n * <DropdownMenu>\n * <DropdownMenuTrigger asChild>\n * <Button>Open</Button>\n * </DropdownMenuTrigger>\n * <DropdownMenuContent>\n * <DropdownMenuItem>Option 1</DropdownMenuItem>\n * <DropdownMenuItem>Option 2</DropdownMenuItem>\n * </DropdownMenuContent>\n * </DropdownMenu>\n * ```\n */\nexport const DropdownMenuContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Content>,\n DropdownMenuContentProps\n>(\n (\n {\n className,\n style,\n sideOffset = 4,\n // Radix defaults `avoidCollisions` to true, so passing `collisionPadding`\n // is enough to keep the menu flipping/shifting to stay on screen — no\n // hand-rolled reposition logic needed.\n collisionPadding = FLOATING_CONTENT_COLLISION_PADDING,\n onPointerDownOutside,\n onCloseAutoFocus,\n onKeyDown,\n children,\n ...props\n },\n ref,\n ) => {\n const variant = React.useContext(DropdownMenuVariantContext);\n // Radix returns focus to the trigger when the menu closes. That is right for\n // the keyboard, but Chrome's :focus-visible heuristic also paints the ring on\n // that programmatic refocus, so dismissing with a click left a focus ring\n // sitting on the trigger. Track pointer dismissals and skip the restore for\n // them only — Escape and Tab still hand focus back with the ring.\n const dismissedByPointer = React.useRef(false);\n\n if (variant === \"sheet\") {\n return (\n <DrawerContent\n ref={ref}\n position=\"bottom\"\n // `\"sheet\"` sits flush to the bottom edge at full width; the design draws\n // this panel inset from all three sides and rounded on every corner, which\n // is `\"menu\"`. Both carry the same modal surface.\n variant=\"menu\"\n // The design's `blur + shadow/menu` effect is a background blur, and the\n // panel's own fill is opaque — so the blur has to go on the overlay to be\n // visible at all. Scoped here rather than on DrawerOverlay so only menus\n // shown this way blur the page behind them.\n overlayProps={{ className: \"backdrop-blur-[8px]\" }}\n // `pb-4` gives the design's 16px below the last row. The rows inset\n // themselves horizontally (see the item's `mx-3`) rather than the panel\n // padding doing it, so the header and its rule can still run full width.\n className={cn(\"flex flex-col gap-1 p-1 pb-4\", className)}\n style={style}\n // Both are destructured above for the popper branch's focus-ring\n // handling, which takes them out of `props` — so the sheet branch has\n // to re-attach them or they are silently dropped. `DrawerContent`\n // forwards them to its `DialogPrimitive.Content`, which supports both.\n // Consumers stack sheets on these (a nested sheet's `onCloseAutoFocus`\n // is the only point at which the parent knows the child has finished\n // animating out), so dropping them breaks the flow with no error.\n onPointerDownOutside={onPointerDownOutside}\n onCloseAutoFocus={onCloseAutoFocus}\n onKeyDown={onKeyDown}\n {...props}\n >\n {children}\n </DrawerContent>\n );\n }\n\n return (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n onPointerDownOutside={(event) => {\n dismissedByPointer.current = true;\n onPointerDownOutside?.(event);\n }}\n onCloseAutoFocus={(event) => {\n if (dismissedByPointer.current) event.preventDefault();\n dismissedByPointer.current = false;\n onCloseAutoFocus?.(event);\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n if (!event.defaultPrevented) cycleMenuTabStops(event);\n }}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n className={cn(\n // Panel tokens come from `V2 Menu Dropdown`: `rounded-sm` (12px) over\n // `Surface/Primary`, a `Border/Primary` stroke, 4px of padding, and the\n // `blur + shadow/floating` effect.\n //\n // `backdrop-blur-[4px]` is the CSS equivalent of that effect's\n // BACKGROUND_BLUR radius 8, which Figma halves on export. It is not a\n // 4-against-8 mismatch.\n \"w-max min-w-(--radix-dropdown-menu-trigger-width) max-w-(--radix-dropdown-menu-content-available-width) overflow-y-auto rounded-sm border border-border-primary bg-surface-primary p-1 text-content-primary shadow-blur-floating backdrop-blur-[4px]\",\n \"data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:animate-in\",\n \"data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:animate-out\",\n \"data-[side=top]:slide-in-from-bottom-2 data-[side=bottom]:slide-in-from-top-2\",\n \"data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2\",\n className,\n )}\n style={{\n zIndex: \"var(--fanvue-ui-portal-z-index, 50)\",\n maxHeight: \"var(--radix-dropdown-menu-content-available-height)\",\n ...style,\n }}\n {...props}\n >\n {children}\n </DropdownMenuPrimitive.Content>\n </DropdownMenuPrimitive.Portal>\n );\n },\n);\nDropdownMenuContent.displayName = \"DropdownMenuContent\";\n\n/** Props for the {@link DropdownMenuGroup} component. */\nexport type DropdownMenuGroupProps = React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Group\n>;\n\n/**\n * Groups related menu items. Accepts an optional `DropdownMenuLabel`.\n *\n * Requires Radix menu context — not supported inside a `variant=\"sheet\"` menu.\n */\nexport const DropdownMenuGroup = DropdownMenuPrimitive.Group;\nDropdownMenuGroup.displayName = \"DropdownMenuGroup\";\n"],"names":["useControllableState","DropdownMenuVariantContext","ToggleOpenContext","Drawer","jsx","DropdownMenuPrimitive","React","DrawerTrigger","FLOATING_CONTENT_COLLISION_PADDING","DrawerContent","cn"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,MAAM,4BAA4B;AAMlC,MAAM,sBAAsB;AAC5B,MAAM,qBAAqB;AAE3B,SAAS,gBAAgB,SAAqC;AAC5D,QAAM,QAAuB,CAAA;AAC7B,aAAW,aAAa,QAAQ,iBAA8B,IAAI,mBAAmB,GAAG,GAAG;AACzF,eAAW,WAAW,UAAU,iBAA8B,kBAAkB,GAAG;AACjF,UAAI,QAAQ,WAAW,KAAK,QAAQ,QAAQ,WAAW,KAAK,QAAQ,OAAQ;AAC5E,YAAM,KAAK,OAAO;AAAA,IACpB;AAAA,EACF;AACA,SAAO;AACT;AAMA,SAAS,kBAAkB,OAA+C;AACxE,MAAI,MAAM,QAAQ,SAAS,MAAM,UAAU,MAAM,WAAW,MAAM,QAAS;AAG3E,QAAM,SAAS,MAAM;AACrB,MAAI,OAAO,QAAQ,2BAA2B,MAAM,MAA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WK,GAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA,UAQT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QAAA;AAAA,QAEF,OAAO;AAAA,UACL,QAAQ;AAAA,UACR,WAAW;AAAA,UACX,GAAG;AAAA,QAAA;AAAA,QAEJ,GAAG;AAAA,QAEH;AAAA,MAAA;AAAA,IAAA,GAEL;AAAA,EAEJ;AACF;AACA,oBAAoB,cAAc;AAY3B,MAAM,oBAAoBL,iCAAsB;AACvD,kBAAkB,cAAc;;;;;"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
+
const React = require("react");
|
|
6
|
+
const cn = require("../../utils/cn.cjs");
|
|
7
|
+
function _interopNamespaceDefault(e) {
|
|
8
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
9
|
+
if (e) {
|
|
10
|
+
for (const k in e) {
|
|
11
|
+
if (k !== "default") {
|
|
12
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
13
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: () => e[k]
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
n.default = e;
|
|
21
|
+
return Object.freeze(n);
|
|
22
|
+
}
|
|
23
|
+
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
24
|
+
const DEFAULT_LABELS = {
|
|
25
|
+
live: "LIVE",
|
|
26
|
+
ended: "LIVE ended"
|
|
27
|
+
};
|
|
28
|
+
const LiveStatus = React__namespace.forwardRef(
|
|
29
|
+
({ variant = "live", className, children, ...props }, ref) => {
|
|
30
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
31
|
+
"span",
|
|
32
|
+
{
|
|
33
|
+
ref,
|
|
34
|
+
className: cn.cn(
|
|
35
|
+
"typography-description-12px-semibold inline-flex shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-xs px-2 py-1",
|
|
36
|
+
variant === "live" && "bg-[linear-gradient(205deg,var(--color-live-gradient-start)_-70%,var(--color-live-gradient-end)_81%)] text-content-always-white shadow-live-glow",
|
|
37
|
+
variant === "ended" && "bg-live-ended-background text-live-ended-content",
|
|
38
|
+
className
|
|
39
|
+
),
|
|
40
|
+
...props,
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", className: "flex pl-0.5", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "size-1 rounded-full bg-current" }) }),
|
|
43
|
+
children ?? DEFAULT_LABELS[variant]
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
LiveStatus.displayName = "LiveStatus";
|
|
50
|
+
exports.LiveStatus = LiveStatus;
|
|
51
|
+
//# sourceMappingURL=LiveStatus.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LiveStatus.cjs","sources":["../../../../src/components/LiveStatus/LiveStatus.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\n\n/** State shown by the live status badge. */\nexport type LiveStatusVariant = \"live\" | \"ended\";\n\nexport interface LiveStatusProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** State shown by the badge. @default \"live\" */\n variant?: LiveStatusVariant;\n}\n\nconst DEFAULT_LABELS: Record<LiveStatusVariant, string> = {\n live: \"LIVE\",\n ended: \"LIVE ended\",\n};\n\n/**\n * Live state badge for experience embeds, typically passed to the `badge` slot of\n * {@link ChatEmbed}. `live` uses the live gradient and glow, `ended` a flat\n * surface. The label defaults per variant; pass `children` to localise it.\n *\n * @example\n * ```tsx\n * <LiveStatus variant=\"live\" />\n * ```\n */\nexport const LiveStatus = React.forwardRef<HTMLSpanElement, LiveStatusProps>(\n ({ variant = \"live\", className, children, ...props }, ref) => {\n return (\n <span\n ref={ref}\n className={cn(\n \"typography-description-12px-semibold inline-flex shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-xs px-2 py-1\",\n variant === \"live\" &&\n \"bg-[linear-gradient(205deg,var(--color-live-gradient-start)_-70%,var(--color-live-gradient-end)_81%)] text-content-always-white shadow-live-glow\",\n variant === \"ended\" && \"bg-live-ended-background text-live-ended-content\",\n className,\n )}\n {...props}\n >\n <span aria-hidden=\"true\" className=\"flex pl-0.5\">\n <span className=\"size-1 rounded-full bg-current\" />\n </span>\n {children ?? DEFAULT_LABELS[variant]}\n </span>\n );\n },\n);\n\nLiveStatus.displayName = \"LiveStatus\";\n"],"names":["React","jsxs","cn","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAWA,MAAM,iBAAoD;AAAA,EACxD,MAAM;AAAA,EACN,OAAO;AACT;AAYO,MAAM,aAAaA,iBAAM;AAAA,EAC9B,CAAC,EAAE,UAAU,QAAQ,WAAW,UAAU,GAAG,MAAA,GAAS,QAAQ;AAC5D,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAWC,GAAAA;AAAAA,UACT;AAAA,UACA,YAAY,UACV;AAAA,UACF,YAAY,WAAW;AAAA,UACvB;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,QAEJ,UAAA;AAAA,UAAAC,2BAAAA,IAAC,QAAA,EAAK,eAAY,QAAO,WAAU,eACjC,UAAAA,2BAAAA,IAAC,QAAA,EAAK,WAAU,iCAAA,CAAiC,EAAA,CACnD;AAAA,UACC,YAAY,eAAe,OAAO;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGzC;AACF;AAEA,WAAW,cAAc;;"}
|
|
@@ -24,12 +24,23 @@ function _interopNamespaceDefault(e) {
|
|
|
24
24
|
return Object.freeze(n);
|
|
25
25
|
}
|
|
26
26
|
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
27
|
+
const LABEL_TYPOGRAPHY = {
|
|
28
|
+
default: {
|
|
29
|
+
semibold: "typography-body-default-16px-semibold",
|
|
30
|
+
regular: "typography-body-default-16px-regular"
|
|
31
|
+
},
|
|
32
|
+
small: {
|
|
33
|
+
semibold: "typography-body-small-14px-semibold",
|
|
34
|
+
regular: "typography-body-small-14px-regular"
|
|
35
|
+
}
|
|
36
|
+
};
|
|
27
37
|
const SwitchField = React__namespace.forwardRef(
|
|
28
38
|
({
|
|
29
39
|
className,
|
|
30
40
|
orientation = "right",
|
|
31
41
|
size = "default",
|
|
32
42
|
label,
|
|
43
|
+
labelWeight = "semibold",
|
|
33
44
|
helperText,
|
|
34
45
|
infoText,
|
|
35
46
|
infoLabel = "More information",
|
|
@@ -67,7 +78,7 @@ const SwitchField = React__namespace.forwardRef(
|
|
|
67
78
|
className: cn.cn(
|
|
68
79
|
"cursor-pointer select-none text-content-primary",
|
|
69
80
|
disabled && "cursor-not-allowed text-content-tertiary",
|
|
70
|
-
size
|
|
81
|
+
LABEL_TYPOGRAPHY[size][labelWeight]
|
|
71
82
|
),
|
|
72
83
|
children: label
|
|
73
84
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwitchField.cjs","sources":["../../../../src/components/SwitchField/SwitchField.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { InfoCircleIcon } from \"../Icons/InfoCircleIcon\";\nimport { Switch, type SwitchSize } from \"../Switch/Switch\";\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from \"../Tooltip/Tooltip\";\n\n/** Side on which the switch toggle is positioned relative to the label. */\nexport type SwitchFieldOrientation = \"right\" | \"left\";\n\nexport interface SwitchFieldProps\n extends Omit<React.ComponentPropsWithoutRef<typeof Switch>, \"size\" | \"className\"> {\n /** Side on which the switch is placed relative to the label. @default \"right\" */\n orientation?: SwitchFieldOrientation;\n /** Size variant of the switch and accompanying text. @default \"default\" */\n size?: SwitchSize;\n /** Label text displayed next to the switch. */\n label?: string;\n /** Descriptive text displayed below the label. */\n helperText?: string;\n /** Tooltip text shown when hovering the info icon next to the label. */\n infoText?: string;\n /** Accessible label for the info tooltip trigger button. Override for i18n.\n * @default \"More information\"\n */\n infoLabel?: string;\n /** Additional CSS class name for the outer wrapper. */\n className?: string;\n}\n\n/**\n * A labelled switch field with optional helper text and info tooltip. Composes\n * the {@link Switch} component with a `<label>` and description.\n *\n * @example\n * ```tsx\n * <SwitchField\n * label=\"Notifications\"\n * helperText=\"Receive push notifications\"\n * checked={enabled}\n * onCheckedChange={setEnabled}\n * />\n * ```\n */\nexport const SwitchField = React.forwardRef<React.ComponentRef<typeof Switch>, SwitchFieldProps>(\n (\n {\n className,\n orientation = \"right\",\n size = \"default\",\n label,\n helperText,\n infoText,\n infoLabel = \"More information\",\n disabled,\n id: propId,\n ...props\n },\n ref,\n ) => {\n const generatedId = React.useId();\n const id = propId ?? generatedId;\n const helperTextId = helperText ? `${id}-helper` : undefined;\n\n const switchElement = (\n <Switch\n ref={ref}\n id={id}\n size={size}\n disabled={disabled}\n aria-describedby={helperTextId}\n {...props}\n />\n );\n\n const labelContent = (label || helperText) && (\n <div\n className={cn(\n \"flex min-w-0 flex-1 flex-col items-start\",\n size === \"default\" ? \"gap-1\" : \"gap-0.5\",\n )}\n >\n {label && (\n <div className=\"flex items-center gap-1\">\n <label\n htmlFor={id}\n className={cn(\n \"cursor-pointer select-none text-content-primary\",\n disabled && \"cursor-not-allowed text-content-tertiary\",\n size
|
|
1
|
+
{"version":3,"file":"SwitchField.cjs","sources":["../../../../src/components/SwitchField/SwitchField.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { InfoCircleIcon } from \"../Icons/InfoCircleIcon\";\nimport { Switch, type SwitchSize } from \"../Switch/Switch\";\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from \"../Tooltip/Tooltip\";\n\n/** Side on which the switch toggle is positioned relative to the label. */\nexport type SwitchFieldOrientation = \"right\" | \"left\";\n\n/** Font weight of the {@link SwitchField} label. */\nexport type SwitchFieldLabelWeight = \"semibold\" | \"regular\";\n\nconst LABEL_TYPOGRAPHY: Record<SwitchSize, Record<SwitchFieldLabelWeight, string>> = {\n default: {\n semibold: \"typography-body-default-16px-semibold\",\n regular: \"typography-body-default-16px-regular\",\n },\n small: {\n semibold: \"typography-body-small-14px-semibold\",\n regular: \"typography-body-small-14px-regular\",\n },\n};\n\nexport interface SwitchFieldProps\n extends Omit<React.ComponentPropsWithoutRef<typeof Switch>, \"size\" | \"className\"> {\n /** Side on which the switch is placed relative to the label. @default \"right\" */\n orientation?: SwitchFieldOrientation;\n /** Size variant of the switch and accompanying text. @default \"default\" */\n size?: SwitchSize;\n /** Label text displayed next to the switch. */\n label?: string;\n /** Font weight of the label. Settings rows use `\"regular\"`. @default \"semibold\" */\n labelWeight?: SwitchFieldLabelWeight;\n /** Descriptive text displayed below the label. */\n helperText?: string;\n /** Tooltip text shown when hovering the info icon next to the label. */\n infoText?: string;\n /** Accessible label for the info tooltip trigger button. Override for i18n.\n * @default \"More information\"\n */\n infoLabel?: string;\n /** Additional CSS class name for the outer wrapper. */\n className?: string;\n}\n\n/**\n * A labelled switch field with optional helper text and info tooltip. Composes\n * the {@link Switch} component with a `<label>` and description.\n *\n * @example\n * ```tsx\n * <SwitchField\n * label=\"Notifications\"\n * helperText=\"Receive push notifications\"\n * checked={enabled}\n * onCheckedChange={setEnabled}\n * />\n * ```\n */\nexport const SwitchField = React.forwardRef<React.ComponentRef<typeof Switch>, SwitchFieldProps>(\n (\n {\n className,\n orientation = \"right\",\n size = \"default\",\n label,\n labelWeight = \"semibold\",\n helperText,\n infoText,\n infoLabel = \"More information\",\n disabled,\n id: propId,\n ...props\n },\n ref,\n ) => {\n const generatedId = React.useId();\n const id = propId ?? generatedId;\n const helperTextId = helperText ? `${id}-helper` : undefined;\n\n const switchElement = (\n <Switch\n ref={ref}\n id={id}\n size={size}\n disabled={disabled}\n aria-describedby={helperTextId}\n {...props}\n />\n );\n\n const labelContent = (label || helperText) && (\n <div\n className={cn(\n \"flex min-w-0 flex-1 flex-col items-start\",\n size === \"default\" ? \"gap-1\" : \"gap-0.5\",\n )}\n >\n {label && (\n <div className=\"flex items-center gap-1\">\n <label\n htmlFor={id}\n className={cn(\n \"cursor-pointer select-none text-content-primary\",\n disabled && \"cursor-not-allowed text-content-tertiary\",\n LABEL_TYPOGRAPHY[size][labelWeight],\n )}\n >\n {label}\n </label>\n {infoText && (\n <TooltipProvider>\n <Tooltip>\n <TooltipTrigger asChild>\n <button type=\"button\" aria-label={infoLabel} className=\"flex shrink-0 pt-0.5\">\n <InfoCircleIcon\n aria-hidden=\"true\"\n className=\"size-5 text-content-secondary\"\n />\n </button>\n </TooltipTrigger>\n <TooltipContent side=\"bottom\">{infoText}</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n )}\n </div>\n )}\n {helperText && (\n <span\n id={helperTextId}\n className={cn(\n \"text-content-secondary\",\n disabled && \"text-content-tertiary\",\n size === \"default\"\n ? \"typography-body-small-14px-regular\"\n : \"typography-description-12px-regular\",\n )}\n >\n {helperText}\n </span>\n )}\n </div>\n );\n\n return (\n <div className={cn(\"flex items-start gap-2\", disabled && \"cursor-not-allowed\", className)}>\n {orientation === \"left\" && switchElement}\n {labelContent}\n {orientation === \"right\" && switchElement}\n </div>\n );\n },\n);\n\nSwitchField.displayName = \"SwitchField\";\n"],"names":["React","jsx","Switch","jsxs","cn","TooltipProvider","Tooltip","TooltipTrigger","InfoCircleIcon","TooltipContent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,MAAM,mBAA+E;AAAA,EACnF,SAAS;AAAA,IACP,UAAU;AAAA,IACV,SAAS;AAAA,EAAA;AAAA,EAEX,OAAO;AAAA,IACL,UAAU;A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,gBAAA;AAAA,kBACC,eAAY;AAAA,kBACZ,WAAU;AAAA,gBAAA;AAAA,cAAA,GAEd,EAAA,CACF;AAAA,cACAP,2BAAAA,IAACQ,QAAAA,gBAAA,EAAe,MAAK,UAAU,UAAA,SAAA,CAAS;AAAA,YAAA,EAAA,CAC1C,EAAA,CACF;AAAA,UAAA,GAEJ;AAAA,UAED,cACCR,2BAAAA;AAAAA,YAAC;AAAA,YAAA;AAAA,cACC,IAAI;AAAA,cACJ,WAAWG,GAAAA;AAAAA,gBACT;AAAA,gBACA,YAAY;AAAA,gBACZ,SAAS,YACL,uCACA;AAAA,cAAA;AAAA,cAGL,UAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAAA;AAKN,WACED,gCAAC,SAAI,WAAWC,GAAAA,GAAG,0BAA0B,YAAY,sBAAsB,SAAS,GACrF,UAAA;AAAA,MAAA,gBAAgB,UAAU;AAAA,MAC1B;AAAA,MACA,gBAAgB,WAAW;AAAA,IAAA,GAC9B;AAAA,EAEJ;AACF;AAEA,YAAY,cAAc;;"}
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -26,6 +26,7 @@ const Button = require("./components/Button/Button.cjs");
|
|
|
26
26
|
const ButtonIconGroup = require("./components/ButtonIconGroup/ButtonIconGroup.cjs");
|
|
27
27
|
const ButtonStack = require("./components/ButtonStack/ButtonStack.cjs");
|
|
28
28
|
const Card = require("./components/Card/Card.cjs");
|
|
29
|
+
const ChatEmbed = require("./components/ChatEmbed/ChatEmbed.cjs");
|
|
29
30
|
const ChatInput = require("./components/ChatInput/ChatInput.cjs");
|
|
30
31
|
const ChatMessage = require("./components/ChatMessage/ChatMessage.cjs");
|
|
31
32
|
const Checkbox = require("./components/Checkbox/Checkbox.cjs");
|
|
@@ -221,6 +222,7 @@ const WrenchIcon = require("./components/Icons/WrenchIcon.cjs");
|
|
|
221
222
|
const InfoBox = require("./components/InfoBox/InfoBox.cjs");
|
|
222
223
|
const InlineEdit = require("./components/InlineEdit/InlineEdit.cjs");
|
|
223
224
|
const Link = require("./components/Link/Link.cjs");
|
|
225
|
+
const LiveStatus = require("./components/LiveStatus/LiveStatus.cjs");
|
|
224
226
|
const Loader = require("./components/Loader/Loader.cjs");
|
|
225
227
|
const Logo = require("./components/Logo/Logo.cjs");
|
|
226
228
|
const MediaStatusIndicator = require("./components/MediaStatusIndicator/MediaStatusIndicator.cjs");
|
|
@@ -326,6 +328,9 @@ exports.CardDescription = Card.CardDescription;
|
|
|
326
328
|
exports.CardFooter = Card.CardFooter;
|
|
327
329
|
exports.CardHeader = Card.CardHeader;
|
|
328
330
|
exports.CardTitle = Card.CardTitle;
|
|
331
|
+
exports.ChatEmbed = ChatEmbed.ChatEmbed;
|
|
332
|
+
exports.ChatEmbedSkeleton = ChatEmbed.ChatEmbedSkeleton;
|
|
333
|
+
exports.ChatEmbedUnavailable = ChatEmbed.ChatEmbedUnavailable;
|
|
329
334
|
exports.ChatInput = ChatInput.ChatInput;
|
|
330
335
|
exports.ChatMessage = ChatMessage.ChatMessage;
|
|
331
336
|
exports.Checkbox = Checkbox.Checkbox;
|
|
@@ -540,6 +545,7 @@ exports.InfoBoxContent = InfoBox.InfoBoxContent;
|
|
|
540
545
|
exports.InfoBoxTrigger = InfoBox.InfoBoxTrigger;
|
|
541
546
|
exports.InlineEdit = InlineEdit.InlineEdit;
|
|
542
547
|
exports.Link = Link.Link;
|
|
548
|
+
exports.LiveStatus = LiveStatus.LiveStatus;
|
|
543
549
|
exports.Loader = Loader.Loader;
|
|
544
550
|
exports.Logo = Logo.Logo;
|
|
545
551
|
exports.MediaStatusIndicator = MediaStatusIndicator.MediaStatusIndicator;
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../../utils/cn.mjs";
|
|
5
|
+
import { AiDisclosureBadge } from "../AiDisclosureBadge/AiDisclosureBadge.mjs";
|
|
6
|
+
import { Avatar } from "../Avatar/Avatar.mjs";
|
|
7
|
+
import { Skeleton } from "../Skeleton/Skeleton.mjs";
|
|
8
|
+
import { UserDisplayName } from "../UserDisplayName/UserDisplayName.mjs";
|
|
9
|
+
const FRAME = "relative isolate flex w-full max-w-100 flex-col overflow-hidden rounded-sm after:pointer-events-none after:absolute after:inset-0 after:z-10 after:rounded-[inherit] after:border after:border-neutral-alphas-100";
|
|
10
|
+
const HEIGHT = {
|
|
11
|
+
creator: "h-40",
|
|
12
|
+
experience: "h-[239px]"
|
|
13
|
+
};
|
|
14
|
+
const SCRIM_FADE = "bg-linear-to-b from-transparent via-40% via-[color-mix(in_srgb,var(--color-content-always-black)_40%,transparent)] to-[color-mix(in_srgb,var(--color-content-always-black)_88%,transparent)]";
|
|
15
|
+
const SCRIM_SOFT = "bg-linear-to-b from-transparent via-40% via-[color-mix(in_srgb,var(--color-content-always-black)_24%,transparent)] to-[color-mix(in_srgb,var(--color-content-always-black)_40%,transparent)]";
|
|
16
|
+
const PROGRESSIVE_BLUR = [
|
|
17
|
+
"backdrop-blur-[4px] [mask-image:linear-gradient(to_bottom,transparent_13%,black_42%)]",
|
|
18
|
+
"backdrop-blur-[8px] [mask-image:linear-gradient(to_bottom,transparent_42%,black_71%)]",
|
|
19
|
+
"backdrop-blur-[12px] [mask-image:linear-gradient(to_bottom,transparent_71%,black)]"
|
|
20
|
+
];
|
|
21
|
+
const MEDIA_FILL = "*:size-full [&>img]:object-cover [&>video]:object-cover";
|
|
22
|
+
const OVERLAY = "absolute inset-0 z-[1] cursor-pointer rounded-[inherit] focus-visible:shadow-focus-ring focus-visible:outline-none";
|
|
23
|
+
const DEFAULT_UNAVAILABLE = {
|
|
24
|
+
creator: "This profile is no longer available",
|
|
25
|
+
experience: "This experience is no longer available"
|
|
26
|
+
};
|
|
27
|
+
function SocialProof({ avatars, name, label }) {
|
|
28
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
29
|
+
/* @__PURE__ */ jsx("div", { className: "flex shrink-0", children: avatars.map((avatar, index) => /* @__PURE__ */ jsx(
|
|
30
|
+
"span",
|
|
31
|
+
{
|
|
32
|
+
className: cn(
|
|
33
|
+
"flex",
|
|
34
|
+
index < avatars.length - 1 && "-mr-2",
|
|
35
|
+
index > 0 && "[mask-image:radial-gradient(circle_at_-4px_50%,transparent_14px,black_14.5px)]"
|
|
36
|
+
),
|
|
37
|
+
children: /* @__PURE__ */ jsx(Avatar, { size: 24, ...avatar })
|
|
38
|
+
},
|
|
39
|
+
index
|
|
40
|
+
)) }),
|
|
41
|
+
/* @__PURE__ */ jsxs("p", { className: "m-0 flex min-w-0 items-center gap-1 whitespace-nowrap text-content-always-white", children: [
|
|
42
|
+
name && /* @__PURE__ */ jsx("span", { className: "typography-body-small-14px-semibold max-w-30 truncate", children: name }),
|
|
43
|
+
/* @__PURE__ */ jsx("span", { className: "typography-body-small-14px-regular shrink-0", children: label })
|
|
44
|
+
] })
|
|
45
|
+
] });
|
|
46
|
+
}
|
|
47
|
+
function Media({
|
|
48
|
+
media,
|
|
49
|
+
backdrop,
|
|
50
|
+
vertical,
|
|
51
|
+
greyscale
|
|
52
|
+
}) {
|
|
53
|
+
if (!media) return null;
|
|
54
|
+
return /* @__PURE__ */ jsxs("div", { className: "pointer-events-none absolute inset-0 select-none", children: [
|
|
55
|
+
vertical ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
56
|
+
/* @__PURE__ */ jsx(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
"aria-hidden": "true",
|
|
60
|
+
className: cn(
|
|
61
|
+
"-translate-1/2 absolute top-1/2 left-1/2 h-[709px] w-[475px] blur-[20px]",
|
|
62
|
+
MEDIA_FILL
|
|
63
|
+
),
|
|
64
|
+
children: backdrop
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
/* @__PURE__ */ jsx(
|
|
68
|
+
"div",
|
|
69
|
+
{
|
|
70
|
+
className: cn(
|
|
71
|
+
"absolute inset-y-0 left-1/2 aspect-9/16 -translate-x-1/2 shadow-md",
|
|
72
|
+
MEDIA_FILL
|
|
73
|
+
),
|
|
74
|
+
children: media
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
] }) : /* @__PURE__ */ jsx("div", { className: cn("absolute inset-0", MEDIA_FILL), children: media }),
|
|
78
|
+
greyscale && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-content-always-black mix-blend-saturation" })
|
|
79
|
+
] });
|
|
80
|
+
}
|
|
81
|
+
function Scrim({ experience }) {
|
|
82
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
83
|
+
PROGRESSIVE_BLUR.map((step) => /* @__PURE__ */ jsx("div", { "aria-hidden": "true", className: cn("absolute inset-0", step) }, step)),
|
|
84
|
+
/* @__PURE__ */ jsx("div", { "aria-hidden": "true", className: cn("absolute inset-0 mix-blend-luminosity", SCRIM_FADE) }),
|
|
85
|
+
experience && /* @__PURE__ */ jsx("div", { "aria-hidden": "true", className: cn("absolute inset-0 mix-blend-multiply", SCRIM_SOFT) })
|
|
86
|
+
] });
|
|
87
|
+
}
|
|
88
|
+
function CreatorName({
|
|
89
|
+
verified,
|
|
90
|
+
verifiedLabel,
|
|
91
|
+
aiDisclosure,
|
|
92
|
+
aiDisclosureLabel,
|
|
93
|
+
nameId,
|
|
94
|
+
className,
|
|
95
|
+
children
|
|
96
|
+
}) {
|
|
97
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-1", children: [
|
|
98
|
+
/* @__PURE__ */ jsx(
|
|
99
|
+
UserDisplayName,
|
|
100
|
+
{
|
|
101
|
+
component: "p",
|
|
102
|
+
verified,
|
|
103
|
+
verifiedLabel,
|
|
104
|
+
className: cn("m-0 [&>[role=img]]:ml-1 [&>span:empty+[role=img]]:ml-0", className),
|
|
105
|
+
children: children && /* @__PURE__ */ jsx("span", { id: nameId, children })
|
|
106
|
+
}
|
|
107
|
+
),
|
|
108
|
+
aiDisclosure && /* @__PURE__ */ jsx(
|
|
109
|
+
AiDisclosureBadge,
|
|
110
|
+
{
|
|
111
|
+
tone: "light",
|
|
112
|
+
role: "img",
|
|
113
|
+
"aria-hidden": false,
|
|
114
|
+
"aria-label": aiDisclosureLabel,
|
|
115
|
+
className: "shrink-0"
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
] });
|
|
119
|
+
}
|
|
120
|
+
function TopRow({
|
|
121
|
+
badge,
|
|
122
|
+
category,
|
|
123
|
+
meta
|
|
124
|
+
}) {
|
|
125
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative flex items-center justify-between gap-2 px-3 pt-3", children: [
|
|
126
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-1", children: [
|
|
127
|
+
badge,
|
|
128
|
+
category && /* @__PURE__ */ jsx("span", { className: "typography-description-12px-semibold whitespace-nowrap rounded-xs bg-buttons-always-white-default px-2 py-1 text-content-always-black", children: category })
|
|
129
|
+
] }),
|
|
130
|
+
meta && /* @__PURE__ */ jsx("span", { className: "typography-description-12px-semibold whitespace-nowrap rounded-full bg-background-overlay-default px-2 py-1 text-center text-content-always-white backdrop-blur-[10px]", children: meta })
|
|
131
|
+
] });
|
|
132
|
+
}
|
|
133
|
+
function OpenOverlay({
|
|
134
|
+
href,
|
|
135
|
+
target,
|
|
136
|
+
onOpen,
|
|
137
|
+
labelledBy
|
|
138
|
+
}) {
|
|
139
|
+
if (href) {
|
|
140
|
+
return (
|
|
141
|
+
// biome-ignore lint/a11y/useAnchorContent: Named by the visible title via aria-labelledby
|
|
142
|
+
/* @__PURE__ */ jsx(
|
|
143
|
+
"a",
|
|
144
|
+
{
|
|
145
|
+
href,
|
|
146
|
+
target,
|
|
147
|
+
rel: target === "_blank" ? "noopener noreferrer" : void 0,
|
|
148
|
+
"aria-labelledby": labelledBy,
|
|
149
|
+
className: OVERLAY
|
|
150
|
+
}
|
|
151
|
+
)
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
if (!onOpen) return null;
|
|
155
|
+
return /* @__PURE__ */ jsx("button", { type: "button", onClick: onOpen, "aria-labelledby": labelledBy, className: OVERLAY });
|
|
156
|
+
}
|
|
157
|
+
const ChatEmbed = React.forwardRef(
|
|
158
|
+
({
|
|
159
|
+
variant = "creator",
|
|
160
|
+
media,
|
|
161
|
+
mediaBackdrop,
|
|
162
|
+
verticalMedia = false,
|
|
163
|
+
avatar,
|
|
164
|
+
title,
|
|
165
|
+
subtitle,
|
|
166
|
+
verified = false,
|
|
167
|
+
verifiedLabel = "Verified",
|
|
168
|
+
aiDisclosure = false,
|
|
169
|
+
aiDisclosureLabel = "AI creator",
|
|
170
|
+
action,
|
|
171
|
+
badge,
|
|
172
|
+
category,
|
|
173
|
+
meta,
|
|
174
|
+
inactive = false,
|
|
175
|
+
href,
|
|
176
|
+
target,
|
|
177
|
+
onOpen,
|
|
178
|
+
socialProof,
|
|
179
|
+
className,
|
|
180
|
+
...props
|
|
181
|
+
}, ref) => {
|
|
182
|
+
const titleId = React.useId();
|
|
183
|
+
const isExperience = variant === "experience";
|
|
184
|
+
const hasTopRow = Boolean(badge || category || meta);
|
|
185
|
+
const badges = { verified, verifiedLabel, aiDisclosure, aiDisclosureLabel };
|
|
186
|
+
return /* @__PURE__ */ jsxs(
|
|
187
|
+
"div",
|
|
188
|
+
{
|
|
189
|
+
ref,
|
|
190
|
+
className: cn(
|
|
191
|
+
FRAME,
|
|
192
|
+
HEIGHT[variant],
|
|
193
|
+
"bg-content-always-black",
|
|
194
|
+
hasTopRow ? "justify-between" : "justify-end",
|
|
195
|
+
className
|
|
196
|
+
),
|
|
197
|
+
...props,
|
|
198
|
+
children: [
|
|
199
|
+
/* @__PURE__ */ jsx(
|
|
200
|
+
Media,
|
|
201
|
+
{
|
|
202
|
+
media,
|
|
203
|
+
backdrop: mediaBackdrop,
|
|
204
|
+
vertical: verticalMedia,
|
|
205
|
+
greyscale: inactive
|
|
206
|
+
}
|
|
207
|
+
),
|
|
208
|
+
/* @__PURE__ */ jsx(OpenOverlay, { href, target, onOpen, labelledBy: titleId }),
|
|
209
|
+
hasTopRow && /* @__PURE__ */ jsx(TopRow, { badge, category, meta }),
|
|
210
|
+
/* @__PURE__ */ jsxs(
|
|
211
|
+
"div",
|
|
212
|
+
{
|
|
213
|
+
className: cn("relative flex flex-col gap-2 px-3 pb-3", isExperience ? "pt-6" : "pt-3"),
|
|
214
|
+
children: [
|
|
215
|
+
/* @__PURE__ */ jsx(Scrim, { experience: isExperience }),
|
|
216
|
+
isExperience && socialProof && /* @__PURE__ */ jsx("div", { className: "relative", children: /* @__PURE__ */ jsx(SocialProof, { ...socialProof }) }),
|
|
217
|
+
/* @__PURE__ */ jsxs("div", { className: cn("relative flex items-center", isExperience ? "gap-6" : "gap-2"), children: [
|
|
218
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
|
|
219
|
+
avatar && /* @__PURE__ */ jsx(Avatar, { size: 40, ...avatar }),
|
|
220
|
+
/* @__PURE__ */ jsx("div", { className: "flex min-w-0 flex-col justify-center text-content-always-white", children: isExperience ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
221
|
+
/* @__PURE__ */ jsx("p", { id: titleId, className: "typography-body-default-16px-semibold m-0 truncate", children: title }),
|
|
222
|
+
(subtitle || verified || aiDisclosure) && /* @__PURE__ */ jsx(CreatorName, { ...badges, className: "typography-body-small-14px-regular", children: subtitle })
|
|
223
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
224
|
+
/* @__PURE__ */ jsx(
|
|
225
|
+
CreatorName,
|
|
226
|
+
{
|
|
227
|
+
...badges,
|
|
228
|
+
nameId: titleId,
|
|
229
|
+
className: "typography-body-default-16px-semibold",
|
|
230
|
+
children: title
|
|
231
|
+
}
|
|
232
|
+
),
|
|
233
|
+
subtitle && /* @__PURE__ */ jsx("p", { className: "typography-body-small-14px-regular m-0 truncate", children: subtitle })
|
|
234
|
+
] }) })
|
|
235
|
+
] }),
|
|
236
|
+
action && /* @__PURE__ */ jsx("div", { className: "relative z-[2] shrink-0", children: action })
|
|
237
|
+
] })
|
|
238
|
+
]
|
|
239
|
+
}
|
|
240
|
+
)
|
|
241
|
+
]
|
|
242
|
+
}
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
);
|
|
246
|
+
ChatEmbed.displayName = "ChatEmbed";
|
|
247
|
+
const ChatEmbedSkeleton = React.forwardRef(
|
|
248
|
+
({ variant = "creator", label = "Loading", className, ...props }, ref) => {
|
|
249
|
+
return /* @__PURE__ */ jsxs(
|
|
250
|
+
"div",
|
|
251
|
+
{
|
|
252
|
+
ref,
|
|
253
|
+
"aria-busy": "true",
|
|
254
|
+
className: cn(FRAME, HEIGHT[variant], "justify-end bg-surface-secondary", className),
|
|
255
|
+
...props,
|
|
256
|
+
children: [
|
|
257
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: label }),
|
|
258
|
+
/* @__PURE__ */ jsxs("div", { className: "relative flex items-center gap-3 p-3", children: [
|
|
259
|
+
/* @__PURE__ */ jsx(Skeleton, { variant: "circular", width: 40, height: 40, className: "shrink-0" }),
|
|
260
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
261
|
+
/* @__PURE__ */ jsx(Skeleton, { width: "50%", height: 16 }),
|
|
262
|
+
/* @__PURE__ */ jsx(Skeleton, { width: "30%", height: 14 })
|
|
263
|
+
] })
|
|
264
|
+
] })
|
|
265
|
+
]
|
|
266
|
+
}
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
);
|
|
270
|
+
ChatEmbedSkeleton.displayName = "ChatEmbedSkeleton";
|
|
271
|
+
const ChatEmbedUnavailable = React.forwardRef(
|
|
272
|
+
({ variant = "creator", icon, className, children, ...props }, ref) => {
|
|
273
|
+
return /* @__PURE__ */ jsxs(
|
|
274
|
+
"div",
|
|
275
|
+
{
|
|
276
|
+
ref,
|
|
277
|
+
className: cn(
|
|
278
|
+
FRAME,
|
|
279
|
+
HEIGHT[variant],
|
|
280
|
+
"items-center justify-center gap-2 bg-surface-secondary px-6 text-center text-content-secondary",
|
|
281
|
+
className
|
|
282
|
+
),
|
|
283
|
+
...props,
|
|
284
|
+
children: [
|
|
285
|
+
icon && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "flex", children: icon }),
|
|
286
|
+
/* @__PURE__ */ jsx("p", { className: "typography-body-small-14px-regular m-0", children: children ?? DEFAULT_UNAVAILABLE[variant] })
|
|
287
|
+
]
|
|
288
|
+
}
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
);
|
|
292
|
+
ChatEmbedUnavailable.displayName = "ChatEmbedUnavailable";
|
|
293
|
+
export {
|
|
294
|
+
ChatEmbed,
|
|
295
|
+
ChatEmbedSkeleton,
|
|
296
|
+
ChatEmbedUnavailable
|
|
297
|
+
};
|
|
298
|
+
//# sourceMappingURL=ChatEmbed.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatEmbed.mjs","sources":["../../../src/components/ChatEmbed/ChatEmbed.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { AiDisclosureBadge } from \"../AiDisclosureBadge/AiDisclosureBadge\";\nimport { Avatar, type AvatarProps } from \"../Avatar/Avatar\";\nimport { Skeleton } from \"../Skeleton/Skeleton\";\nimport { UserDisplayName } from \"../UserDisplayName/UserDisplayName\";\n\n/** Layout of the embed: a creator profile card or a fan experience card. */\nexport type ChatEmbedVariant = \"creator\" | \"experience\";\n\n/** Overlapping avatars and copy showing who else is taking part. */\nexport interface ChatEmbedSocialProof {\n /** Avatars shown in the overlapping stack, left to right. */\n avatars: AvatarProps[];\n /** Name shown in bold before the label, truncated at 120px. */\n name?: React.ReactNode;\n /** Copy shown after the name, e.g. \"+2 watching\". */\n label: React.ReactNode;\n}\n\ninterface ChatEmbedBaseProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"title\" | \"onClick\"> {\n /** Media filling the card, typically an `img` or `video`, over a dark surface. */\n media?: React.ReactNode;\n /** Still image blurred behind `verticalMedia`, e.g. the same image or a video's poster frame. */\n mediaBackdrop?: React.ReactNode;\n /** Frame portrait media in a centred 9:16 column over `mediaBackdrop`. @default false */\n verticalMedia?: boolean;\n /** Avatar shown at the start of the profile row. */\n avatar?: AvatarProps;\n /** Primary line of the profile row: a display name or an experience title. */\n title: React.ReactNode;\n /** Secondary line under the title, e.g. a handle or \"Made by @jane_doe\". */\n subtitle?: React.ReactNode;\n /** Show the verified badge on the creator line. @default false */\n verified?: boolean;\n /** Accessible label for the verified badge. @default \"Verified\" */\n verifiedLabel?: string;\n /** Show the EU AI-disclosure badge on the creator line. @default false */\n aiDisclosure?: boolean;\n /** Accessible label for the AI-disclosure badge. @default \"AI creator\" */\n aiDisclosureLabel?: string;\n /** Action at the end of the profile row, typically a `Button` with `variant=\"white\"` and `size=\"32\"`. */\n action?: React.ReactNode;\n /** Badge in the top-left corner, typically a {@link LiveStatus}. */\n badge?: React.ReactNode;\n /** Short category label shown as a tag after the badge, e.g. \"Game\" or \"Audio\". */\n category?: React.ReactNode;\n /** Short copy in a translucent pill in the top-right corner, e.g. \"2 hours ago\". */\n meta?: React.ReactNode;\n /** Renders the media in greyscale, e.g. once a live has ended. @default false */\n inactive?: boolean;\n}\n\ninterface ChatEmbedLinkProps {\n /** Makes the whole card a link to this URL, named by the title. */\n href: string;\n /** Where to open `href`; `\"_blank\"` adds `rel=\"noopener noreferrer\"`. */\n target?: React.HTMLAttributeAnchorTarget;\n /** Not available with `href`. */\n onOpen?: never;\n}\n\ninterface ChatEmbedButtonProps {\n /** Not available with `onOpen`. */\n href?: never;\n /** Not available with `onOpen`. */\n target?: never;\n /** Makes the whole card a button named by the title, e.g. to open a dialog. */\n onOpen?: () => void;\n}\n\ninterface ChatEmbedCreatorProps extends ChatEmbedBaseProps {\n /** Layout of the embed. @default \"creator\" */\n variant?: \"creator\";\n /** Only available on the `experience` variant. */\n socialProof?: never;\n}\n\ninterface ChatEmbedExperienceProps extends ChatEmbedBaseProps {\n /** Layout of the embed. */\n variant: \"experience\";\n /** Social proof row shown above the profile row. */\n socialProof?: ChatEmbedSocialProof;\n}\n\n/** Props for {@link ChatEmbed}. `socialProof` is only accepted on `experience`, and `href` and `onOpen` are exclusive. */\nexport type ChatEmbedProps = (ChatEmbedCreatorProps | ChatEmbedExperienceProps) &\n (ChatEmbedLinkProps | ChatEmbedButtonProps);\n\nexport interface ChatEmbedSkeletonProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Layout to match while the embed loads. @default \"creator\" */\n variant?: ChatEmbedVariant;\n /** Visually hidden text read by screen readers in place of the placeholder. @default \"Loading\" */\n label?: string;\n}\n\nexport interface ChatEmbedUnavailableProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Layout to match the embed it replaces. @default \"creator\" */\n variant?: ChatEmbedVariant;\n /** Icon shown above the message. */\n icon?: React.ReactNode;\n}\n\nconst FRAME =\n \"relative isolate flex w-full max-w-100 flex-col overflow-hidden rounded-sm after:pointer-events-none after:absolute after:inset-0 after:z-10 after:rounded-[inherit] after:border after:border-neutral-alphas-100\";\n\nconst HEIGHT: Record<ChatEmbedVariant, string> = {\n creator: \"h-40\",\n experience: \"h-[239px]\",\n};\n\nconst SCRIM_FADE =\n \"bg-linear-to-b from-transparent via-40% via-[color-mix(in_srgb,var(--color-content-always-black)_40%,transparent)] to-[color-mix(in_srgb,var(--color-content-always-black)_88%,transparent)]\";\n\nconst SCRIM_SOFT =\n \"bg-linear-to-b from-transparent via-40% via-[color-mix(in_srgb,var(--color-content-always-black)_24%,transparent)] to-[color-mix(in_srgb,var(--color-content-always-black)_40%,transparent)]\";\n\nconst PROGRESSIVE_BLUR = [\n \"backdrop-blur-[4px] [mask-image:linear-gradient(to_bottom,transparent_13%,black_42%)]\",\n \"backdrop-blur-[8px] [mask-image:linear-gradient(to_bottom,transparent_42%,black_71%)]\",\n \"backdrop-blur-[12px] [mask-image:linear-gradient(to_bottom,transparent_71%,black)]\",\n];\n\nconst MEDIA_FILL = \"*:size-full [&>img]:object-cover [&>video]:object-cover\";\n\nconst OVERLAY =\n \"absolute inset-0 z-[1] cursor-pointer rounded-[inherit] focus-visible:shadow-focus-ring focus-visible:outline-none\";\n\nconst DEFAULT_UNAVAILABLE: Record<ChatEmbedVariant, string> = {\n creator: \"This profile is no longer available\",\n experience: \"This experience is no longer available\",\n};\n\nfunction SocialProof({ avatars, name, label }: ChatEmbedSocialProof) {\n return (\n <div className=\"flex min-w-0 items-center gap-2\">\n <div className=\"flex shrink-0\">\n {avatars.map((avatar, index) => (\n <span\n // biome-ignore lint/suspicious/noArrayIndexKey: avatars can share a src and the stack never reorders\n key={index}\n className={cn(\n \"flex\",\n index < avatars.length - 1 && \"-mr-2\",\n index > 0 &&\n \"[mask-image:radial-gradient(circle_at_-4px_50%,transparent_14px,black_14.5px)]\",\n )}\n >\n <Avatar size={24} {...avatar} />\n </span>\n ))}\n </div>\n <p className=\"m-0 flex min-w-0 items-center gap-1 whitespace-nowrap text-content-always-white\">\n {name && (\n <span className=\"typography-body-small-14px-semibold max-w-30 truncate\">{name}</span>\n )}\n <span className=\"typography-body-small-14px-regular shrink-0\">{label}</span>\n </p>\n </div>\n );\n}\n\nfunction Media({\n media,\n backdrop,\n vertical,\n greyscale,\n}: {\n media?: React.ReactNode;\n backdrop?: React.ReactNode;\n vertical: boolean;\n greyscale: boolean;\n}) {\n if (!media) return null;\n\n return (\n <div className=\"pointer-events-none absolute inset-0 select-none\">\n {vertical ? (\n <>\n <div\n aria-hidden=\"true\"\n className={cn(\n \"-translate-1/2 absolute top-1/2 left-1/2 h-[709px] w-[475px] blur-[20px]\",\n MEDIA_FILL,\n )}\n >\n {backdrop}\n </div>\n <div\n className={cn(\n \"absolute inset-y-0 left-1/2 aspect-9/16 -translate-x-1/2 shadow-md\",\n MEDIA_FILL,\n )}\n >\n {media}\n </div>\n </>\n ) : (\n <div className={cn(\"absolute inset-0\", MEDIA_FILL)}>{media}</div>\n )}\n {greyscale && (\n <div className=\"absolute inset-0 bg-content-always-black mix-blend-saturation\" />\n )}\n </div>\n );\n}\n\nfunction Scrim({ experience }: { experience: boolean }) {\n return (\n <>\n {PROGRESSIVE_BLUR.map((step) => (\n <div key={step} aria-hidden=\"true\" className={cn(\"absolute inset-0\", step)} />\n ))}\n <div aria-hidden=\"true\" className={cn(\"absolute inset-0 mix-blend-luminosity\", SCRIM_FADE)} />\n {experience && (\n <div aria-hidden=\"true\" className={cn(\"absolute inset-0 mix-blend-multiply\", SCRIM_SOFT)} />\n )}\n </>\n );\n}\n\nfunction CreatorName({\n verified,\n verifiedLabel,\n aiDisclosure,\n aiDisclosureLabel,\n nameId,\n className,\n children,\n}: {\n verified: boolean;\n verifiedLabel: string;\n aiDisclosure: boolean;\n aiDisclosureLabel: string;\n nameId?: string;\n className: string;\n children?: React.ReactNode;\n}) {\n return (\n <div className=\"flex min-w-0 items-center gap-1\">\n <UserDisplayName\n component=\"p\"\n verified={verified}\n verifiedLabel={verifiedLabel}\n className={cn(\"m-0 [&>[role=img]]:ml-1 [&>span:empty+[role=img]]:ml-0\", className)}\n >\n {children && <span id={nameId}>{children}</span>}\n </UserDisplayName>\n {aiDisclosure && (\n <AiDisclosureBadge\n tone=\"light\"\n role=\"img\"\n aria-hidden={false}\n aria-label={aiDisclosureLabel}\n className=\"shrink-0\"\n />\n )}\n </div>\n );\n}\n\nfunction TopRow({\n badge,\n category,\n meta,\n}: Pick<ChatEmbedBaseProps, \"badge\" | \"category\" | \"meta\">) {\n return (\n <div className=\"relative flex items-center justify-between gap-2 px-3 pt-3\">\n <div className=\"flex min-w-0 items-center gap-1\">\n {badge}\n {category && (\n <span className=\"typography-description-12px-semibold whitespace-nowrap rounded-xs bg-buttons-always-white-default px-2 py-1 text-content-always-black\">\n {category}\n </span>\n )}\n </div>\n {meta && (\n <span className=\"typography-description-12px-semibold whitespace-nowrap rounded-full bg-background-overlay-default px-2 py-1 text-center text-content-always-white backdrop-blur-[10px]\">\n {meta}\n </span>\n )}\n </div>\n );\n}\n\nfunction OpenOverlay({\n href,\n target,\n onOpen,\n labelledBy,\n}: {\n href?: string;\n target?: React.HTMLAttributeAnchorTarget;\n onOpen?: () => void;\n labelledBy: string;\n}) {\n if (href) {\n return (\n // biome-ignore lint/a11y/useAnchorContent: Named by the visible title via aria-labelledby\n <a\n href={href}\n target={target}\n rel={target === \"_blank\" ? \"noopener noreferrer\" : undefined}\n aria-labelledby={labelledBy}\n className={OVERLAY}\n />\n );\n }\n if (!onOpen) return null;\n return <button type=\"button\" onClick={onOpen} aria-labelledby={labelledBy} className={OVERLAY} />;\n}\n\n/**\n * A card embedded in a chat thread that links out to a creator profile or a fan\n * experience such as a live stream or game. Media fills the card and the profile\n * row sits on a blurred scrim along the bottom edge.\n *\n * The `creator` variant is 160px tall and the `experience` variant 239px; both\n * fill their container up to 400px wide. Pass `href` (or `onOpen`) to make the\n * whole card clickable; the `action` stays separately clickable above it. Use\n * {@link ChatEmbedSkeleton} while the embed's data loads and\n * {@link ChatEmbedUnavailable} when the shared item no longer exists.\n *\n * Give `media` meaningful alt text when it conveys content, or `alt=\"\"` when the\n * title already describes it. When `media` is a video with `verticalMedia`, pass\n * its poster frame as `mediaBackdrop` so the video is not decoded twice.\n * `socialProof` is shown to everyone in the chat, so prefer a count over naming\n * other fans.\n *\n * @example\n * ```tsx\n * <ChatEmbed\n * variant=\"experience\"\n * href=\"https://www.fanvue.com\"\n * badge={<LiveStatus variant=\"live\" />}\n * category=\"Audio\"\n * media={<img src=\"/stream.jpg\" alt=\"\" />}\n * avatar={{ src: \"/avatar.jpg\", fallback: \"JD\" }}\n * title=\"Friday night Q&A\"\n * subtitle=\"@jane_doe\"\n * action={<Button variant=\"white\" size=\"32\">Join</Button>}\n * />\n * ```\n */\nexport const ChatEmbed = React.forwardRef<HTMLDivElement, ChatEmbedProps>(\n (\n {\n variant = \"creator\",\n media,\n mediaBackdrop,\n verticalMedia = false,\n avatar,\n title,\n subtitle,\n verified = false,\n verifiedLabel = \"Verified\",\n aiDisclosure = false,\n aiDisclosureLabel = \"AI creator\",\n action,\n badge,\n category,\n meta,\n inactive = false,\n href,\n target,\n onOpen,\n socialProof,\n className,\n ...props\n },\n ref,\n ) => {\n const titleId = React.useId();\n const isExperience = variant === \"experience\";\n const hasTopRow = Boolean(badge || category || meta);\n const badges = { verified, verifiedLabel, aiDisclosure, aiDisclosureLabel };\n\n return (\n <div\n ref={ref}\n className={cn(\n FRAME,\n HEIGHT[variant],\n \"bg-content-always-black\",\n hasTopRow ? \"justify-between\" : \"justify-end\",\n className,\n )}\n {...props}\n >\n <Media\n media={media}\n backdrop={mediaBackdrop}\n vertical={verticalMedia}\n greyscale={inactive}\n />\n <OpenOverlay href={href} target={target} onOpen={onOpen} labelledBy={titleId} />\n\n {hasTopRow && <TopRow badge={badge} category={category} meta={meta} />}\n\n <div\n className={cn(\"relative flex flex-col gap-2 px-3 pb-3\", isExperience ? \"pt-6\" : \"pt-3\")}\n >\n <Scrim experience={isExperience} />\n\n {isExperience && socialProof && (\n <div className=\"relative\">\n <SocialProof {...socialProof} />\n </div>\n )}\n\n <div className={cn(\"relative flex items-center\", isExperience ? \"gap-6\" : \"gap-2\")}>\n <div className=\"flex min-w-0 flex-1 items-center gap-3\">\n {avatar && <Avatar size={40} {...avatar} />}\n <div className=\"flex min-w-0 flex-col justify-center text-content-always-white\">\n {isExperience ? (\n <>\n <p id={titleId} className=\"typography-body-default-16px-semibold m-0 truncate\">\n {title}\n </p>\n {(subtitle || verified || aiDisclosure) && (\n <CreatorName {...badges} className=\"typography-body-small-14px-regular\">\n {subtitle}\n </CreatorName>\n )}\n </>\n ) : (\n <>\n <CreatorName\n {...badges}\n nameId={titleId}\n className=\"typography-body-default-16px-semibold\"\n >\n {title}\n </CreatorName>\n {subtitle && (\n <p className=\"typography-body-small-14px-regular m-0 truncate\">{subtitle}</p>\n )}\n </>\n )}\n </div>\n </div>\n {action && <div className=\"relative z-[2] shrink-0\">{action}</div>}\n </div>\n </div>\n </div>\n );\n },\n);\n\nChatEmbed.displayName = \"ChatEmbed\";\n\n/**\n * Loading placeholder sized to match a {@link ChatEmbed}, shown while the data\n * for a shared link is being fetched.\n *\n * @example\n * ```tsx\n * <ChatEmbedSkeleton variant=\"experience\" />\n * ```\n */\nexport const ChatEmbedSkeleton = React.forwardRef<HTMLDivElement, ChatEmbedSkeletonProps>(\n ({ variant = \"creator\", label = \"Loading\", className, ...props }, ref) => {\n return (\n <div\n ref={ref}\n aria-busy=\"true\"\n className={cn(FRAME, HEIGHT[variant], \"justify-end bg-surface-secondary\", className)}\n {...props}\n >\n <span className=\"sr-only\">{label}</span>\n <div className=\"relative flex items-center gap-3 p-3\">\n <Skeleton variant=\"circular\" width={40} height={40} className=\"shrink-0\" />\n <div className=\"flex min-w-0 flex-1 flex-col gap-1\">\n <Skeleton width=\"50%\" height={16} />\n <Skeleton width=\"30%\" height={14} />\n </div>\n </div>\n </div>\n );\n },\n);\n\nChatEmbedSkeleton.displayName = \"ChatEmbedSkeleton\";\n\n/**\n * Placeholder sized to match a {@link ChatEmbed}, shown in place of the card when\n * the shared profile or experience has been removed, hidden or unpublished.\n * Pass `children` to localise the message.\n *\n * @example\n * ```tsx\n * <ChatEmbedUnavailable variant=\"experience\" />\n * ```\n */\nexport const ChatEmbedUnavailable = React.forwardRef<HTMLDivElement, ChatEmbedUnavailableProps>(\n ({ variant = \"creator\", icon, className, children, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n FRAME,\n HEIGHT[variant],\n \"items-center justify-center gap-2 bg-surface-secondary px-6 text-center text-content-secondary\",\n className,\n )}\n {...props}\n >\n {icon && (\n <span aria-hidden=\"true\" className=\"flex\">\n {icon}\n </span>\n )}\n <p className=\"typography-body-small-14px-regular m-0\">\n {children ?? DEFAULT_UNAVAILABLE[variant]}\n </p>\n </div>\n );\n },\n);\n\nChatEmbedUnavailable.displayName = \"ChatEmbedUnavailable\";\n"],"names":[],"mappings":";;;;;;;;AAwGA,MAAM,QACJ;AAEF,MAAM,SAA2C;AAAA,EAC/C,SAAS;AAAA,EACT,YAAY;AACd;AAEA,MAAM,aACJ;AAEF,MAAM,aACJ;AAEF,MAAM,mBAAmB;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AACF;AAEA,MAAM,aAAa;AAEnB,MAAM,UACJ;AAEF,MAAM,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