@alfadocs/ui-kit 0.1.5 → 0.1.7

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.
Files changed (53) hide show
  1. package/README.md +26 -0
  2. package/dist/_chunks/{balance-cell-renderer-BRWt3neo.js → balance-cell-renderer-BWm3knY9.js} +2 -2
  3. package/dist/_chunks/{balance-cell-renderer-BRWt3neo.js.map → balance-cell-renderer-BWm3knY9.js.map} +1 -1
  4. package/dist/_chunks/{chat-container-BZvQ3_yT.js → chat-container-Cm3SlR2p.js} +12 -12
  5. package/dist/_chunks/{chat-container-BZvQ3_yT.js.map → chat-container-Cm3SlR2p.js.map} +1 -1
  6. package/dist/_chunks/{chat-input-DsIrWM4f.js → chat-input-DreOPP8A.js} +36 -31
  7. package/dist/_chunks/chat-input-DreOPP8A.js.map +1 -0
  8. package/dist/_chunks/{dropdown-menu-JNo66A-j.js → dropdown-menu-Cw3EyPZv.js} +35 -31
  9. package/dist/_chunks/dropdown-menu-Cw3EyPZv.js.map +1 -0
  10. package/dist/_chunks/{leo-sidebar-BzN4pJ7j.js → leo-sidebar-nbHib2D-.js} +136 -128
  11. package/dist/_chunks/leo-sidebar-nbHib2D-.js.map +1 -0
  12. package/dist/_chunks/{notification-tray-Bq-08ReD.js → notification-tray-B7U5YZYg.js} +5 -2
  13. package/dist/_chunks/notification-tray-B7U5YZYg.js.map +1 -0
  14. package/dist/_chunks/{patient-shell-DP54y6rc.js → patient-shell-7cXqIMFg.js} +2 -2
  15. package/dist/_chunks/{patient-shell-DP54y6rc.js.map → patient-shell-7cXqIMFg.js.map} +1 -1
  16. package/dist/_chunks/{popover-DvAtFOi-.js → popover-C3CTUsqh.js} +20 -16
  17. package/dist/_chunks/popover-C3CTUsqh.js.map +1 -0
  18. package/dist/_chunks/{privacy-lock-DS6QRo2N.js → privacy-lock-CQpgkLec.js} +23 -23
  19. package/dist/_chunks/{privacy-lock-DS6QRo2N.js.map → privacy-lock-CQpgkLec.js.map} +1 -1
  20. package/dist/_chunks/{suggestion-chip-6AB40rxz.js → suggestion-chip-BNJ2M8Os.js} +3 -3
  21. package/dist/_chunks/suggestion-chip-BNJ2M8Os.js.map +1 -0
  22. package/dist/_chunks/{theme-toggle-COHFwO2H.js → theme-toggle-BHiMMEQN.js} +2 -2
  23. package/dist/_chunks/{theme-toggle-COHFwO2H.js.map → theme-toggle-BHiMMEQN.js.map} +1 -1
  24. package/dist/_chunks/{workflow-map-DGJwVcO-.js → workflow-map-XeqHDFvp.js} +2 -2
  25. package/dist/_chunks/{workflow-map-DGJwVcO-.js.map → workflow-map-XeqHDFvp.js.map} +1 -1
  26. package/dist/agent-catalog.json +1 -1
  27. package/dist/components/chat-container/index.js +1 -1
  28. package/dist/components/chat-input/chat-input.d.ts.map +1 -1
  29. package/dist/components/chat-input/index.js +1 -1
  30. package/dist/components/data-table/index.js +1 -1
  31. package/dist/components/dropdown-menu/dropdown-menu.d.ts.map +1 -1
  32. package/dist/components/dropdown-menu/index.js +1 -1
  33. package/dist/components/notification-tray/index.js +1 -1
  34. package/dist/components/notification-tray/notification-tray.d.ts.map +1 -1
  35. package/dist/components/popover/index.js +1 -1
  36. package/dist/components/popover/popover.d.ts.map +1 -1
  37. package/dist/components/privacy-lock/index.js +1 -1
  38. package/dist/components/suggestion-chip/index.js +1 -1
  39. package/dist/components/theme-toggle/index.js +1 -1
  40. package/dist/components/workflow/index.js +1 -1
  41. package/dist/index.js +12 -12
  42. package/dist/patterns/leo-assistant/index.js +1 -1
  43. package/dist/patterns/leo-assistant/leo-chat-surface.d.ts.map +1 -1
  44. package/dist/patterns/leo-assistant/leo-sidebar.d.ts.map +1 -1
  45. package/dist/patterns/patient-shell/index.js +1 -1
  46. package/dist/tokens.css +1 -1
  47. package/package.json +1 -1
  48. package/dist/_chunks/chat-input-DsIrWM4f.js.map +0 -1
  49. package/dist/_chunks/dropdown-menu-JNo66A-j.js.map +0 -1
  50. package/dist/_chunks/leo-sidebar-BzN4pJ7j.js.map +0 -1
  51. package/dist/_chunks/notification-tray-Bq-08ReD.js.map +0 -1
  52. package/dist/_chunks/popover-DvAtFOi-.js.map +0 -1
  53. package/dist/_chunks/suggestion-chip-6AB40rxz.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"leo-sidebar-nbHib2D-.js","sources":["../../node_modules/lucide-react/dist/esm/icons/sparkles.js","../../src/patterns/leo-assistant/leo-chat-surface.tsx","../../src/patterns/leo-assistant/leo-embedded.tsx","../../src/patterns/leo-assistant/leo-popout.tsx","../../src/patterns/leo-assistant/leo-sidebar.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.8.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z\",\n key: \"1s2grr\"\n }\n ],\n [\"path\", { d: \"M20 2v4\", key: \"1rf3ol\" }],\n [\"path\", { d: \"M22 4h-4\", key: \"gwowj6\" }],\n [\"circle\", { cx: \"4\", cy: \"20\", r: \"2\", key: \"6kqj1y\" }]\n];\nconst Sparkles = createLucideIcon(\"sparkles\", __iconNode);\n\nexport { __iconNode, Sparkles as default };\n//# sourceMappingURL=sparkles.js.map\n","/**\n * Leo Assistant — inner chat surface shared between embedded and popout\n * modes. This is a pure presentational composition of existing DS\n * primitives and owns NO state, NO API calls, NO SSE parsing — the\n * consuming app drives `messages`, `isGenerating`, `usage`, and the\n * callbacks.\n */\nimport {\n forwardRef,\n useMemo,\n type ReactNode,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { Plus, Sparkles, Square, User } from 'lucide-react';\nimport { Avatar } from '../../components/avatar';\nimport { Button } from '../../components/button';\nimport { ChatContainer } from '../../components/chat-container';\nimport { ChatMessage } from '../../components/chat-message';\nimport { ChatInput } from '../../components/chat-input';\nimport { StreamingText } from '../../components/streaming-text';\nimport {\n SuggestionChip,\n SuggestionChipGroup,\n} from '../../components/suggestion-chip';\nimport { TypingIndicator } from '../../components/typing-indicator';\nimport { Progress } from '../../components/progress';\nimport type {\n LeoChatSurfaceProps,\n LeoMessage,\n LeoSuggestion,\n LeoUserAvatar,\n} from './leo-types';\n\n/* ------------------------------------------------------------------ */\n/* Leo identity tile — Sparkles on an accent-tinted disc. */\n/* */\n/* Used in place of <Avatar> for Leo's own identity (header + empty */\n/* state + streaming/typing rows) so the visual identity matches the */\n/* collapsed sidebar rail trigger. When the consuming app supplies an */\n/* `assistantAvatar.src`, LeoChatSurface falls back to <Avatar> — the */\n/* sparkle is for the DS-provided default only. */\n/* */\n/* Sizes mirror the Avatar size scale we were replacing: */\n/* sm → 32px (row messages, streaming bubble, compact header) */\n/* md → 40px (default header) */\n/* xl → 64px (empty-state hero) */\n/* ------------------------------------------------------------------ */\n\nconst LEO_TILE_SIZES = {\n sm: {\n box: 'ds:size-[calc(var(--spacing-md)*2)]',\n icon: 'ds:size-4',\n },\n md: {\n box: 'ds:size-[calc(var(--spacing-md)*2.5)]',\n icon: 'ds:size-[1.125rem]',\n },\n xl: {\n box: 'ds:size-[calc(var(--spacing-md)*4)]',\n icon: 'ds:size-8',\n },\n} as const;\n\nfunction LeoIdentityTile({\n size,\n label,\n}: {\n size: keyof typeof LEO_TILE_SIZES;\n label: string;\n}) {\n const dims = LEO_TILE_SIZES[size];\n return (\n <span\n role=\"img\"\n aria-label={label}\n className={[\n 'ds:inline-flex ds:shrink-0 ds:items-center ds:justify-center',\n 'ds:rounded-[var(--radius-full)]',\n // Subtle accent-tinted disc so the sparkle reads against both\n // light and dark surfaces without a hard-coded literal colour.\n 'ds:bg-[color-mix(in_srgb,var(--accent)_14%,transparent)]',\n 'ds:text-[color:var(--accent)]',\n // forced-colors: UA strips color-mix backgrounds; fall back to\n // a bordered disc so the identity still reads in HCM.\n 'ds:forced-colors:bg-transparent ds:forced-colors:border ds:forced-colors:border-[CanvasText]',\n dims.box,\n ].join(' ')}\n >\n <Sparkles aria-hidden=\"true\" className={dims.icon} />\n </span>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* User identity tile — neutral companion to the Sparkles tile above. */\n/* Rendered when the caller has no user avatar to display, so the */\n/* conversation still has a consistent visual anchor on both sides. */\n/* Uses --muted/--muted-foreground so it reads as \"neutral person\" */\n/* without borrowing the brand accent. */\n/* ------------------------------------------------------------------ */\n\nfunction UserIdentityTile({\n size,\n label,\n}: {\n size: keyof typeof LEO_TILE_SIZES;\n label: string;\n}) {\n const dims = LEO_TILE_SIZES[size];\n return (\n <span\n role=\"img\"\n aria-label={label}\n className={[\n 'ds:inline-flex ds:shrink-0 ds:items-center ds:justify-center',\n 'ds:rounded-[var(--radius-full)]',\n 'ds:bg-[color-mix(in_srgb,var(--muted-foreground)_14%,transparent)]',\n 'ds:text-[color:var(--muted-foreground)]',\n 'ds:forced-colors:bg-transparent ds:forced-colors:border ds:forced-colors:border-[CanvasText]',\n dims.box,\n ].join(' ')}\n >\n <User aria-hidden=\"true\" className={dims.icon} />\n </span>\n );\n}\n\n/**\n * Pick the right avatar shape for a user message.\n *\n * Precedence (highest wins):\n * 1. `userAvatar.slot` — caller supplied a fully custom node.\n * 2. `userAvatar.src` — caller supplied a photo (or initials override via `name`).\n * 3. `userAvatar.name` only — <Avatar> renders initials.\n * 4. Nothing supplied — fall back to the neutral `<UserIdentityTile>`.\n */\nfunction resolveUserAvatar(\n userAvatar: LeoUserAvatar | undefined,\n defaultLabel: string,\n) {\n if (!userAvatar) {\n return { slot: <UserIdentityTile size=\"sm\" label={defaultLabel} /> };\n }\n if (userAvatar.slot) return { slot: userAvatar.slot };\n // Pass the fields straight through; ChatMessage scrubs `src` with\n // `safeImageSrc` and falls back to initials from `name`.\n return { name: userAvatar.name, src: userAvatar.src };\n}\n\n/* ------------------------------------------------------------------ */\n/* Empty state — branded welcome shown when messages is empty */\n/* ------------------------------------------------------------------ */\n\ninterface EmptyStateProps {\n assistantName: string;\n avatarSrc?: string;\n greeting: string;\n subtitle: string;\n suggestions?: LeoSuggestion[];\n onSuggestion?: (suggestion: LeoSuggestion) => void;\n}\n\nfunction EmptyState({\n assistantName,\n avatarSrc,\n greeting,\n subtitle,\n suggestions,\n onSuggestion,\n}: EmptyStateProps) {\n const { t } = useTranslation();\n const headingId = 'leo-empty-state-heading';\n\n return (\n <section\n role=\"region\"\n aria-labelledby={headingId}\n className={[\n 'ds:flex ds:flex-1 ds:min-h-0 ds:flex-col ds:items-center ds:justify-center',\n 'ds:text-center',\n 'ds:ps-[var(--spacing-lg)] ds:pe-[var(--spacing-lg)]',\n 'ds:pt-[var(--spacing-xl)] ds:pb-[var(--spacing-xl)]',\n 'ds:gap-[var(--spacing-md)]',\n ].join(' ')}\n data-testid=\"leo-empty-state\"\n >\n {avatarSrc ? (\n <Avatar name={assistantName} src={avatarSrc} size=\"xl\" />\n ) : (\n <LeoIdentityTile size=\"xl\" label={assistantName} />\n )}\n <div className=\"ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-xs)] ds:max-w-[32rem]\">\n <h2\n id={headingId}\n className=\"type-title-section ds:m-0 ds:text-[color:var(--foreground)]\"\n >\n {greeting}\n </h2>\n <p className=\"type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]\">\n {subtitle}\n </p>\n </div>\n {suggestions && suggestions.length > 0 ? (\n <div className=\"ds:w-full ds:max-w-[40rem]\">\n <SuggestionChipGroup\n label={t('leo.exampleQuestions')}\n className=\"ds:justify-center\"\n >\n {suggestions.map((s) => (\n <SuggestionChip\n key={s.id}\n intent=\"suggestion\"\n startIcon={s.icon}\n keepOnSelect\n onSelect={() => onSuggestion?.(s)}\n >\n {s.label}\n </SuggestionChip>\n ))}\n </SuggestionChipGroup>\n </div>\n ) : null}\n </section>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Streaming message — renders the last assistant message's body via */\n/* StreamingText when `streaming: true`. */\n/* ------------------------------------------------------------------ */\n\ninterface StreamingMessageProps {\n message: LeoMessage;\n assistantName: string;\n avatarSrc?: string;\n renderMarkdown?: boolean;\n}\n\nfunction StreamingMessage({\n message,\n assistantName,\n avatarSrc,\n renderMarkdown,\n}: StreamingMessageProps) {\n const { t, i18n } = useTranslation();\n const roleLabel = t('chat.message.role.assistant');\n const formattedTime = useMemo(() => {\n if (!message.timestamp) return null;\n const date =\n message.timestamp instanceof Date\n ? message.timestamp\n : new Date(message.timestamp);\n if (Number.isNaN(date.getTime())) return null;\n return new Intl.DateTimeFormat(i18n.language, {\n hour: '2-digit',\n minute: '2-digit',\n }).format(date);\n }, [message.timestamp, i18n.language]);\n\n const label = formattedTime\n ? t('chat.message.label', { role: roleLabel, time: formattedTime })\n : t('chat.message.labelNoTime', { role: roleLabel });\n\n return (\n <article\n aria-label={label}\n className=\"ds:flex ds:w-full ds:items-start ds:flex-row ds:gap-[var(--spacing-sm)]\"\n >\n {avatarSrc ? (\n <Avatar name={assistantName} src={avatarSrc} size=\"sm\" />\n ) : (\n <LeoIdentityTile size=\"sm\" label={assistantName} />\n )}\n <div className=\"ds:flex ds:flex-col ds:items-start\">\n <div\n dir=\"auto\"\n className={[\n 'ds:relative ds:max-w-[min(42rem,90%)]',\n 'ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]',\n 'ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)]',\n 'type-body',\n 'ds:break-words',\n 'ds:bg-muted/40 ds:text-foreground',\n 'ds:rounded-[var(--radius-md)] ds:rounded-es-[var(--radius-sm)]',\n ].join(' ')}\n >\n <StreamingText\n content={message.content}\n isStreaming={true}\n renderMarkdown={renderMarkdown}\n />\n </div>\n </div>\n </article>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Header bar — avatar + name + optional new-conversation + end slot */\n/* ------------------------------------------------------------------ */\n\ninterface HeaderBarProps {\n assistantName: string;\n avatarSrc?: string;\n onNewConversation?: () => void;\n headerEndSlot?: ReactNode;\n density: 'default' | 'compact';\n}\n\nfunction HeaderBar({\n assistantName,\n avatarSrc,\n onNewConversation,\n headerEndSlot,\n density,\n}: HeaderBarProps) {\n const { t } = useTranslation();\n return (\n <header\n aria-label={t('leo.headerLabel')}\n className={[\n 'ds:flex ds:shrink-0 ds:items-center ds:gap-[var(--spacing-sm)]',\n // Soft drop-shadow on the block-end edge in place of a `border-b`\n // against `--border` — same rationale as the Leo sidebar's inline\n // edge (see leo-sidebar.tsx).\n 'ds:shadow-[var(--shadow-chrome-down)]',\n 'ds:bg-[var(--background)]',\n 'ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]',\n density === 'compact'\n ? 'ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)]'\n : 'ds:pt-[var(--spacing-md)] ds:pb-[var(--spacing-md)]',\n ].join(' ')}\n data-testid=\"leo-header\"\n >\n {avatarSrc ? (\n <Avatar\n name={assistantName}\n src={avatarSrc}\n size={density === 'compact' ? 'sm' : 'md'}\n />\n ) : (\n <LeoIdentityTile\n size={density === 'compact' ? 'sm' : 'md'}\n label={assistantName}\n />\n )}\n <span className=\"type-title-item ds:text-[color:var(--foreground)]\">\n {assistantName}\n </span>\n <div className=\"ds:ms-auto ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n {onNewConversation ? (\n <Button\n intent=\"ghost\"\n size=\"sm\"\n startIcon={<Plus aria-hidden=\"true\" />}\n onClick={onNewConversation}\n >\n {t('leo.newConversation')}\n </Button>\n ) : null}\n {headerEndSlot}\n </div>\n </header>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Main export — LeoChatSurface */\n/* ------------------------------------------------------------------ */\n\nexport const LeoChatSurface = forwardRef<HTMLDivElement, LeoChatSurfaceProps>(\n (\n {\n messages,\n onSend,\n onRetry,\n onSuggestion,\n suggestions,\n isGenerating = false,\n onStopGenerating,\n usage,\n onUpgrade,\n assistantName,\n assistantAvatar,\n userAvatar,\n greeting,\n subtitle,\n density = 'default',\n renderMarkdown = true,\n onNewConversation,\n onAttach,\n acceptedFileTypes,\n headerEndSlot,\n },\n ref,\n ) => {\n const { t } = useTranslation();\n\n const resolvedName = assistantName ?? t('leo.name');\n const resolvedGreeting = greeting ?? t('leo.greeting');\n const resolvedSubtitle = subtitle ?? t('leo.subtitle');\n\n const lastMessage = messages[messages.length - 1];\n const lastIsStreamingAssistant =\n lastMessage?.role === 'assistant' && lastMessage.streaming === true;\n const listMessages = lastIsStreamingAssistant\n ? messages.slice(0, -1)\n : messages;\n\n // ChatContainer messages — each visible non-streaming message becomes\n // a ChatMessage; the streaming tail + typing indicator are appended.\n const containerMessages = useMemo(() => {\n const userLabel = t('chat.message.role.user');\n const base = listMessages.map((m) => {\n let avatar;\n if (m.role === 'assistant') {\n // Consumer-provided image wins; otherwise render the Sparkles tile.\n avatar = assistantAvatar?.src\n ? { name: resolvedName, src: assistantAvatar.src }\n : { slot: <LeoIdentityTile size=\"sm\" label={resolvedName} /> };\n } else if (m.role === 'user') {\n avatar = resolveUserAvatar(userAvatar, userLabel);\n }\n return {\n id: m.id,\n node: (\n <ChatMessage\n role={m.role}\n content={m.content}\n avatar={avatar}\n timestamp={m.timestamp}\n status={m.status}\n renderMarkdown={renderMarkdown}\n onRetry={onRetry ? () => onRetry(m.id) : undefined}\n />\n ),\n };\n });\n\n if (lastIsStreamingAssistant && lastMessage) {\n base.push({\n id: lastMessage.id,\n node: (\n <StreamingMessage\n message={lastMessage}\n assistantName={resolvedName}\n avatarSrc={assistantAvatar?.src}\n renderMarkdown={renderMarkdown}\n />\n ),\n });\n }\n\n if (isGenerating && !lastIsStreamingAssistant) {\n base.push({\n id: '__leo-typing__',\n node: (\n <div className=\"ds:flex ds:w-full ds:items-start ds:gap-[var(--spacing-sm)]\">\n {assistantAvatar?.src ? (\n <Avatar\n name={resolvedName}\n src={assistantAvatar.src}\n size=\"sm\"\n />\n ) : (\n <LeoIdentityTile size=\"sm\" label={resolvedName} />\n )}\n <div\n className={[\n 'ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]',\n 'ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)]',\n 'ds:rounded-[var(--radius-md)] ds:rounded-es-[var(--radius-sm)]',\n 'ds:bg-muted/40',\n ].join(' ')}\n >\n <TypingIndicator\n label={t('chat.typing')}\n density={density}\n />\n </div>\n </div>\n ),\n });\n }\n\n return base;\n }, [\n listMessages,\n lastIsStreamingAssistant,\n lastMessage,\n isGenerating,\n resolvedName,\n assistantAvatar?.src,\n userAvatar,\n renderMarkdown,\n onRetry,\n density,\n t,\n ]);\n\n // Usage progress data.\n const usagePercent = usage\n ? Math.min(100, Math.max(0, (usage.current / Math.max(1, usage.limit)) * 100))\n : 0;\n const usageFull = usage ? usage.current >= usage.limit : false;\n const usageLabel = usage\n ? usage.label ??\n t('leo.usageLabel', {\n current: usage.current,\n limit: usage.limit,\n })\n : null;\n\n const isEmpty = messages.length === 0 && !isGenerating;\n\n // Composer — disabled when usage is full.\n const composer = (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n {usage ? (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <div className=\"ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)]\">\n <span\n className={[\n 'type-meta',\n usageFull\n ? 'ds:text-[color:var(--destructive)]'\n : 'ds:text-[color:var(--muted-foreground)]',\n ].join(' ')}\n data-testid=\"leo-usage-label\"\n >\n {usageFull ? t('leo.usageLimitReached') : usageLabel}\n </span>\n {usageFull && onUpgrade ? (\n <Button intent=\"primary\" size=\"sm\" onClick={onUpgrade}>\n {t('leo.upgrade')}\n </Button>\n ) : null}\n </div>\n <Progress\n value={usagePercent}\n max={100}\n size=\"sm\"\n ariaLabel={usageLabel ?? t('leo.usageLabel', {\n current: usage.current,\n limit: usage.limit,\n })}\n className={\n usageFull\n ? 'ds:[&_[role=progressbar]>*]:bg-[color:var(--destructive)]'\n : undefined\n }\n data-testid=\"leo-usage-progress\"\n />\n </div>\n ) : null}\n {!isEmpty && suggestions && suggestions.length > 0 && !isGenerating ? (\n <SuggestionChipGroup\n label={t('leo.exampleQuestions')}\n data-testid=\"leo-followup-suggestions\"\n >\n {suggestions.map((s) => (\n <SuggestionChip\n key={s.id}\n intent=\"followup\"\n startIcon={s.icon}\n keepOnSelect\n onSelect={() => onSuggestion?.(s)}\n >\n {s.label}\n </SuggestionChip>\n ))}\n </SuggestionChipGroup>\n ) : null}\n <div className=\"ds:flex ds:items-end ds:gap-[var(--spacing-sm)]\">\n <div className=\"ds:flex-1 ds:min-w-0\">\n <ChatInput\n submitOnEnter\n onSubmit={onSend}\n onAttach={onAttach}\n accept={acceptedFileTypes}\n disabled={usageFull}\n data-testid=\"leo-composer\"\n />\n </div>\n {isGenerating && onStopGenerating ? (\n <Button\n intent=\"outline\"\n size=\"sm\"\n startIcon={<Square aria-hidden=\"true\" />}\n onClick={onStopGenerating}\n aria-label={t('leo.stopGenerating')}\n >\n {t('leo.stopGenerating')}\n </Button>\n ) : null}\n </div>\n </div>\n );\n\n return (\n <div\n ref={ref}\n className={[\n 'ds:flex ds:min-h-0 ds:flex-1 ds:flex-col',\n 'ds:bg-[var(--background)] ds:text-[color:var(--foreground)]',\n ].join(' ')}\n data-testid=\"leo-surface\"\n >\n <HeaderBar\n assistantName={resolvedName}\n avatarSrc={assistantAvatar?.src}\n onNewConversation={onNewConversation}\n headerEndSlot={headerEndSlot}\n density={density}\n />\n {isEmpty ? (\n <>\n <EmptyState\n assistantName={resolvedName}\n avatarSrc={assistantAvatar?.src}\n greeting={resolvedGreeting}\n subtitle={resolvedSubtitle}\n suggestions={suggestions}\n onSuggestion={onSuggestion}\n />\n <div\n className={[\n // No top divider — the ChatInput's own soft shadow + the\n // border-radius give it enough visual containment, and a\n // surface-level separator here read as a sharp line at\n // 1px-equivalent shadow blur. Keep the bg explicit so\n // the chat-input chrome paints over the messages-area\n // background instead of mixing with it.\n 'ds:shrink-0 ds:bg-[var(--background)]',\n 'ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]',\n 'ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)]',\n ].join(' ')}\n >\n {composer}\n </div>\n </>\n ) : (\n <ChatContainer\n messages={containerMessages}\n density={density}\n composer={composer}\n className=\"ds:flex-1 ds:min-h-0\"\n />\n )}\n </div>\n );\n },\n);\n\nLeoChatSurface.displayName = 'LeoChatSurface';\n","/**\n * Leo Assistant — embedded (full-page) mode. Fills the parent container\n * (typically `<AppFrame padded={false}>`'s `<main>` slot) with a\n * ChatGPT-style centred conversation column.\n */\nimport { forwardRef, type ReactNode } from 'react';\nimport { LeoChatSurface } from './leo-chat-surface';\nimport type { LeoChatSurfaceProps } from './leo-types';\n\nexport interface LeoEmbeddedProps extends LeoChatSurfaceProps {\n /** Optional slot rendered above the chat surface (e.g. a breadcrumb). */\n headerSlot?: ReactNode;\n}\n\nexport const LeoEmbedded = forwardRef<HTMLDivElement, LeoEmbeddedProps>(\n ({ headerSlot, ...surfaceProps }, ref) => {\n return (\n <div\n ref={ref}\n className={[\n 'ds:flex ds:min-h-0 ds:flex-1 ds:flex-col',\n 'ds:bg-[var(--background)] ds:text-[color:var(--foreground)]',\n 'ds:h-full ds:w-full',\n ].join(' ')}\n data-testid=\"leo-embedded\"\n >\n {headerSlot ? (\n <div\n className={[\n 'ds:shrink-0',\n 'ds:ps-[var(--spacing-lg)] ds:pe-[var(--spacing-lg)]',\n 'ds:pt-[var(--spacing-sm)] ds:pb-[var(--spacing-sm)]',\n ].join(' ')}\n >\n {headerSlot}\n </div>\n ) : null}\n <div className=\"ds:flex ds:min-h-0 ds:flex-1 ds:flex-col ds:items-stretch\">\n <div\n className={[\n 'ds:flex ds:min-h-0 ds:w-full ds:flex-1 ds:flex-col',\n 'ds:ms-auto ds:me-auto',\n 'ds:[max-inline-size:48rem]',\n 'ds:ps-[var(--spacing-md)] ds:pe-[var(--spacing-md)]',\n ].join(' ')}\n >\n <LeoChatSurface {...surfaceProps} />\n </div>\n </div>\n </div>\n );\n },\n);\n\nLeoEmbedded.displayName = 'LeoEmbedded';\n","/**\n * Leo Assistant — popout (FAB + Sheet) mode. A floating trigger button\n * anchored to the bottom-inline-end corner opens a slide-in `Sheet`\n * panel containing the same `LeoChatSurface` in compact density.\n *\n * Z-index: the FAB sits on `--z-fixed`; the Sheet sits on `--z-modal`.\n * Both render above the app chrome but below any open Dialog.\n */\nimport { forwardRef } from 'react';\nimport * as RadixDialog from '@radix-ui/react-dialog';\nimport { useTranslation } from 'react-i18next';\nimport { Sparkles, X } from 'lucide-react';\nimport { FloatingActionButton } from '../../components/floating-action-button';\nimport { IconButton } from '../../components/button';\nimport { Sheet } from '../../components/sheet';\nimport { LeoChatSurface } from './leo-chat-surface';\nimport type { LeoChatSurfaceProps } from './leo-types';\n\nexport interface LeoPopoutProps extends LeoChatSurfaceProps {\n /** Whether the popout panel is open. */\n open: boolean;\n /** Fires when the panel should open or close. */\n onOpenChange: (open: boolean) => void;\n /** Position of the FAB trigger. */\n position?: 'bottom-end' | 'bottom-start';\n /** Optional unseen message count badge on the FAB. */\n unseenCount?: number;\n}\n\nfunction formatBadgeCount(count: number): string {\n return count > 99 ? '99+' : String(count);\n}\n\nexport const LeoPopout = forwardRef<HTMLDivElement, LeoPopoutProps>(\n (\n {\n open,\n onOpenChange,\n position = 'bottom-end',\n unseenCount,\n assistantName,\n assistantAvatar,\n ...surfaceProps\n },\n ref,\n ) => {\n const { t } = useTranslation();\n // `|| t(…)` (not `??`) — also defaults when the host passes an empty\n // string so Radix Dialog's required `Sheet.Title` is never empty.\n const resolvedName = assistantName || t('leo.name');\n const showBadge = typeof unseenCount === 'number' && unseenCount > 0;\n\n const triggerLabel = showBadge\n ? t('leo.unseenCount', { count: unseenCount })\n : t('leo.open');\n\n // Close button injected into the chat surface header via the\n // headerEndSlot hook — keeps the Sheet's title wiring and DialogClose\n // semantics without duplicating the header shell.\n const headerEndSlot = (\n <RadixDialog.Close asChild>\n <IconButton\n icon={<X aria-hidden=\"true\" />}\n intent=\"ghost\"\n size=\"sm\"\n aria-label={t('leo.close')}\n data-testid=\"leo-popout-close\"\n />\n </RadixDialog.Close>\n );\n\n return (\n <Sheet.Root open={open} onOpenChange={onOpenChange}>\n {/* FAB trigger — sits outside the Sheet.Trigger so the unseen-\n count badge can overlay it. A Sheet.Trigger wrapper would\n turn the FAB into a button-inside-a-button. Instead, we\n invoke `onOpenChange(true)` on click. */}\n <div\n ref={ref}\n className={[\n 'ds:fixed ds:z-[var(--z-fixed)]',\n 'ds:bottom-[calc(var(--spacing-lg)+env(safe-area-inset-bottom,0px))]',\n position === 'bottom-end'\n ? 'ds:end-[var(--spacing-lg)]'\n : 'ds:start-[var(--spacing-lg)]',\n ].join(' ')}\n data-testid=\"leo-popout-fab-wrapper\"\n >\n <div className=\"ds:relative\">\n <FloatingActionButton\n icon={<Sparkles aria-hidden=\"true\" />}\n aria-label={triggerLabel}\n variant=\"primary\"\n size=\"md\"\n position=\"static\"\n onClick={() => onOpenChange(true)}\n data-testid=\"leo-popout-fab\"\n />\n {showBadge ? (\n <span\n aria-hidden=\"true\"\n data-testid=\"leo-popout-badge\"\n className={[\n 'ds:absolute ds:-top-[var(--spacing-xs)] ds:-end-[var(--spacing-xs)]',\n 'ds:inline-flex ds:items-center ds:justify-center',\n 'ds:min-w-[calc(var(--spacing-md)+var(--spacing-xs))]',\n 'ds:h-[calc(var(--spacing-md)+var(--spacing-xs))]',\n 'ds:ps-[calc(var(--spacing-xs)/1.5)] ds:pe-[calc(var(--spacing-xs)/1.5)]',\n 'ds:rounded-[var(--radius-full)]',\n 'ds:bg-[color:var(--destructive)] ds:text-[color:var(--destructive-foreground)]',\n 'ds:text-[length:var(--font-size-xs)] ds:font-semibold ds:leading-none',\n 'ds:pointer-events-none ds:select-none',\n 'ds:forced-colors:outline ds:forced-colors:outline-1 ds:forced-colors:outline-[CanvasText]',\n ].join(' ')}\n >\n {formatBadgeCount(unseenCount)}\n </span>\n ) : null}\n </div>\n </div>\n\n <Sheet.Content\n side=\"end\"\n size=\"md\"\n aria-label={t('leo.panelLabel')}\n className=\"ds:flex ds:min-h-0 ds:flex-col ds:p-0\"\n data-testid=\"leo-popout-panel\"\n >\n {/* Sheet.Title is required by Radix Dialog for a11y. We hide it\n visually because LeoChatSurface renders its own header. */}\n <Sheet.Title className=\"ds:sr-only\">{resolvedName}</Sheet.Title>\n <LeoChatSurface\n {...surfaceProps}\n assistantName={resolvedName}\n assistantAvatar={assistantAvatar}\n density=\"compact\"\n headerEndSlot={headerEndSlot}\n />\n </Sheet.Content>\n </Sheet.Root>\n );\n },\n);\n\nLeoPopout.displayName = 'LeoPopout';\n","/**\n * Leo Assistant — sidebar (docked panel) mode.\n *\n * A persistent, non-modal panel that docks to the `inline-end` edge of\n * the layout. Unlike `LeoPopout` it does NOT trap focus or overlay\n * content — users can chat with Leo while continuing to interact with\n * the main surface. Collapses to an icon rail when `open={false}`.\n *\n * This is the intended **default desktop mode** for Leo once MCP tool\n * access and settings land: users will want Leo visible while they\n * configure servers, inspect tool runs, and reference data. On mobile\n * viewports the consuming app should flip to `LeoPopout` because a\n * 22rem sidebar would consume the entire screen.\n *\n * Unlike the popout (Radix Dialog) and embedded (full-page main) modes,\n * the sidebar is a plain `<aside>` landmark — it lives in the normal\n * layout flow and consumes inline space.\n */\nimport { forwardRef, type ReactNode } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport {\n ChevronsLeft,\n ChevronsRight,\n Sparkles,\n} from 'lucide-react';\nimport { IconButton } from '../../components/button';\nimport { LeoChatSurface } from './leo-chat-surface';\nimport type { LeoChatSurfaceProps } from './leo-types';\n\nexport interface LeoSidebarProps extends LeoChatSurfaceProps {\n /** Whether the sidebar is expanded. When false, a narrow icon rail\n * stays visible and clicking it fires `onOpenChange(true)`. */\n open: boolean;\n /** Fires when the user expands or collapses the sidebar. */\n onOpenChange: (open: boolean) => void;\n /** Which edge of the container the sidebar docks to. Defaults to\n * `'end'` (inline-end). RTL flips automatically via logical\n * properties. */\n side?: 'end' | 'start';\n /** Optional unseen-message count shown on the collapsed rail. */\n unseenCount?: number;\n /** Optional slot rendered under the chat surface (e.g. an MCP server\n * list or settings accordion). Future hook for the MCP panel. */\n footerSlot?: ReactNode;\n}\n\nfunction formatBadgeCount(count: number): string {\n return count > 99 ? '99+' : String(count);\n}\n\n// Fixed tokenised widths — keeps the pattern constraint-compliant (no\n// prop-driven inline styles). Consuming apps that need a different size\n// can wrap the sidebar in their own container and override via CSS.\nconst EXPANDED_WIDTH = 'ds:[inline-size:22rem]';\nconst RAIL_WIDTH = 'ds:[inline-size:3rem]';\n\nexport const LeoSidebar = forwardRef<HTMLElement, LeoSidebarProps>(\n (\n {\n open,\n onOpenChange,\n side = 'end',\n unseenCount,\n footerSlot,\n assistantName,\n assistantAvatar,\n ...surfaceProps\n },\n ref,\n ) => {\n const { t } = useTranslation();\n // `|| t(…)` — also defaults when the host passes an empty string,\n // so the collapsed-rail `aria-label` is never empty.\n const resolvedName = assistantName || t('leo.name');\n const showBadge = typeof unseenCount === 'number' && unseenCount > 0;\n\n // Soft drop-shadow on the inline-edge that faces the main content\n // area. Replaces a flat `border-s`/`border-e` against `--border`,\n // which since the WCAG 1.4.11 bump (grey-600 → grey-800) reads as a\n // heavy charcoal line at this scale. A directional shadow keeps the\n // panel-edge cue without needing to clear contrast thresholds the\n // way an actual border would. Tokenised via `--shadow-chrome-start`\n // / `--shadow-chrome-end` (see `src/tokens/index.css`).\n const borderClass =\n side === 'end'\n ? 'ds:shadow-[var(--shadow-chrome-start)]'\n : 'ds:shadow-[var(--shadow-chrome-end)]';\n\n const triggerLabel = showBadge\n ? t('leo.unseenCount', { count: unseenCount })\n : t('leo.open');\n\n // Collapsed rail — a tall vertical strip with the Leo icon plus an\n // unseen badge. Clicking it expands the sidebar.\n if (!open) {\n return (\n <aside\n ref={ref}\n aria-label={t('leo.panelLabel')}\n className={[\n 'ds:flex ds:shrink-0 ds:flex-col ds:items-center',\n 'ds:bg-[var(--background)]',\n borderClass,\n 'ds:pt-[var(--spacing-md)] ds:pb-[var(--spacing-md)]',\n RAIL_WIDTH,\n ].join(' ')}\n data-testid=\"leo-sidebar-rail\"\n data-leo-sidebar-state=\"collapsed\"\n >\n <div className=\"ds:relative ds:[&_svg]:text-[color:var(--accent)]\">\n <IconButton\n icon={<Sparkles aria-hidden=\"true\" />}\n aria-label={triggerLabel}\n aria-expanded=\"false\"\n intent=\"ghost\"\n size=\"sm\"\n onClick={() => onOpenChange(true)}\n data-testid=\"leo-sidebar-rail-trigger\"\n />\n {showBadge ? (\n <span\n aria-hidden=\"true\"\n data-testid=\"leo-sidebar-badge\"\n className={[\n 'ds:absolute ds:-top-[var(--spacing-xs)] ds:-end-[var(--spacing-xs)]',\n 'ds:inline-flex ds:items-center ds:justify-center',\n 'ds:min-w-[calc(var(--spacing-md)+var(--spacing-xs))]',\n 'ds:h-[calc(var(--spacing-md)+var(--spacing-xs))]',\n 'ds:ps-[calc(var(--spacing-xs)/1.5)] ds:pe-[calc(var(--spacing-xs)/1.5)]',\n 'ds:rounded-[var(--radius-full)]',\n 'ds:bg-[color:var(--destructive)] ds:text-[color:var(--destructive-foreground)]',\n 'ds:text-[length:var(--font-size-xs)] ds:font-semibold ds:leading-none',\n 'ds:pointer-events-none ds:select-none',\n 'ds:forced-colors:outline ds:forced-colors:outline-1 ds:forced-colors:outline-[CanvasText]',\n ].join(' ')}\n >\n {formatBadgeCount(unseenCount)}\n </span>\n ) : null}\n </div>\n </aside>\n );\n }\n\n // Expanded panel — same LeoChatSurface as embedded / popout, in\n // compact density, with a collapse-toggle injected into the header.\n // Chevron points toward the docked edge so users read it as\n // \"collapse toward that side\".\n const headerEndSlot = (\n <IconButton\n icon={side === 'end' ? <ChevronsRight /> : <ChevronsLeft />}\n intent=\"ghost\"\n size=\"sm\"\n aria-label={t('leo.close')}\n aria-expanded=\"true\"\n onClick={() => onOpenChange(false)}\n data-testid=\"leo-sidebar-collapse\"\n />\n );\n\n return (\n <aside\n ref={ref}\n aria-label={t('leo.panelLabel')}\n className={[\n 'ds:flex ds:shrink-0 ds:flex-col ds:min-h-0',\n 'ds:bg-[var(--background)]',\n borderClass,\n EXPANDED_WIDTH,\n 'ds:h-full',\n ].join(' ')}\n data-testid=\"leo-sidebar\"\n data-leo-sidebar-state=\"expanded\"\n >\n <div className=\"ds:flex ds:min-h-0 ds:flex-1 ds:flex-col\">\n <LeoChatSurface\n {...surfaceProps}\n assistantName={resolvedName}\n assistantAvatar={assistantAvatar}\n density=\"compact\"\n headerEndSlot={headerEndSlot}\n />\n </div>\n {footerSlot ? (\n <div\n data-testid=\"leo-sidebar-footer-slot\"\n className=\"ds:shrink-0 ds:shadow-[var(--shadow-chrome-up)]\"\n >\n {footerSlot}\n </div>\n ) : null}\n </aside>\n );\n },\n);\n\nLeoSidebar.displayName = 'LeoSidebar';\n"],"names":["__iconNode","Sparkles","createLucideIcon","LEO_TILE_SIZES","LeoIdentityTile","size","label","dims","jsx","UserIdentityTile","User","resolveUserAvatar","userAvatar","defaultLabel","EmptyState","assistantName","avatarSrc","greeting","subtitle","suggestions","onSuggestion","t","useTranslation","headingId","jsxs","Avatar","SuggestionChipGroup","s","SuggestionChip","StreamingMessage","message","renderMarkdown","i18n","roleLabel","formattedTime","useMemo","date","StreamingText","HeaderBar","onNewConversation","headerEndSlot","density","Button","Plus","LeoChatSurface","forwardRef","messages","onSend","onRetry","isGenerating","onStopGenerating","usage","onUpgrade","assistantAvatar","onAttach","acceptedFileTypes","ref","resolvedName","resolvedGreeting","resolvedSubtitle","lastMessage","lastIsStreamingAssistant","listMessages","containerMessages","userLabel","base","m","avatar","ChatMessage","TypingIndicator","usagePercent","usageFull","usageLabel","isEmpty","composer","Progress","ChatInput","Square","Fragment","ChatContainer","LeoEmbedded","headerSlot","surfaceProps","formatBadgeCount","count","LeoPopout","open","onOpenChange","position","unseenCount","showBadge","triggerLabel","RadixDialog","IconButton","X","Sheet","FloatingActionButton","EXPANDED_WIDTH","RAIL_WIDTH","LeoSidebar","side","footerSlot","borderClass","ChevronsRight","ChevronsLeft"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AAAA,EACE,CAAC,QAAQ,EAAE,GAAG,WAAW,KAAK,SAAQ,CAAE;AAAA,EACxC,CAAC,QAAQ,EAAE,GAAG,YAAY,KAAK,SAAQ,CAAE;AAAA,EACzC,CAAC,UAAU,EAAE,IAAI,KAAK,IAAI,MAAM,GAAG,KAAK,KAAK,SAAQ,CAAE;AACzD,GACMC,IAAWC,GAAiB,YAAYF,EAAU,GC2BlDG,IAAiB;AAAA,EACrB,IAAI;AAAA,IACF,KAAK;AAAA,IACL,MAAM;AAAA,EAAA;AAAA,EAER,IAAI;AAAA,IACF,KAAK;AAAA,IACL,MAAM;AAAA,EAAA;AAAA,EAER,IAAI;AAAA,IACF,KAAK;AAAA,IACL,MAAM;AAAA,EAAA;AAEV;AAEA,SAASC,EAAgB;AAAA,EACvB,MAAAC;AAAA,EACA,OAAAC;AACF,GAGG;AACD,QAAMC,IAAOJ,EAAeE,CAAI;AAChC,SACE,gBAAAG;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,cAAYF;AAAA,MACZ,WAAW;AAAA,QACT;AAAA,QACA;AAAA;AAAA;AAAA,QAGA;AAAA,QACA;AAAA;AAAA;AAAA,QAGA;AAAA,QACAC,EAAK;AAAA,MAAA,EACL,KAAK,GAAG;AAAA,MAEV,4BAACN,GAAA,EAAS,eAAY,QAAO,WAAWM,EAAK,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
40
40
  "ds:bg-[var(--popover)] ds:text-[var(--popover-foreground)]",
41
- "ds:border ds:border-[color:var(--border)]",
41
+ // Border kept (transparent) so the forced-colors override below can
42
+ // repaint a visible edge in HCM. In normal modes the soft drop-shadow
43
+ // carries the edge cue.
44
+ "ds:border ds:border-transparent",
42
45
  "ds:rounded-[var(--radius-md)]",
43
46
  "ds:shadow-[var(--shadow-lg)]",
44
47
  "ds:z-[var(--z-popover)]",
@@ -322,4 +325,4 @@ fe.displayName = "NotificationTray";
322
325
  export {
323
326
  fe as N
324
327
  };
325
- //# sourceMappingURL=notification-tray-Bq-08ReD.js.map
328
+ //# sourceMappingURL=notification-tray-B7U5YZYg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-tray-B7U5YZYg.js","sources":["../../node_modules/lucide-react/dist/esm/icons/bell.js","../../src/components/notification-tray/notification-tray.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.8.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M10.268 21a2 2 0 0 0 3.464 0\", key: \"vwvbt9\" }],\n [\n \"path\",\n {\n d: \"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326\",\n key: \"11g9vi\"\n }\n ]\n];\nconst Bell = createLucideIcon(\"bell\", __iconNode);\n\nexport { __iconNode, Bell as default };\n//# sourceMappingURL=bell.js.map\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n type HTMLAttributes,\n} from 'react';\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Bell } from 'lucide-react';\nimport { IconButton } from '../button/icon-button';\nimport { Button } from '../button/button';\nimport { Separator } from '../separator/separator';\nimport { Skeleton } from '../skeleton/skeleton';\nimport {\n NotificationCard,\n type NotificationItem,\n} from '../notification-card/notification-card';\n\n/* ------------------------------------------------------------------ */\n/* Types */\n/* ------------------------------------------------------------------ */\n\nexport interface NotificationTrayProps\n extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'onClick' | 'children' | 'role'\n >,\n VariantProps<typeof notificationTrayVariants> {\n /** Notifications rendered in the dropdown panel. */\n items: NotificationItem[];\n /** Number of unseen notifications. Drives the badge count. */\n unseenCount?: number;\n /** Controlled open state. */\n open?: boolean;\n /** Fires when the open state changes. */\n onOpenChange?: (open: boolean) => void;\n /** Fires when the user activates an item (click or Enter/Space). */\n onItemClick?: (item: NotificationItem) => void;\n /** Fires when the user dismisses a notification. */\n onDismiss?: (item: NotificationItem) => void;\n /** Fires when the user clicks the header \"Mark all as read\" action. */\n onMarkAllRead?: () => void;\n /** When true the panel shows skeleton placeholders. */\n loading?: boolean;\n /** Advisory item count before the list scrolls. Consumers override the cap\n * via the `--notification-tray-max-block-size` custom property. */\n maxVisible?: number;\n /** When set renders a footer link that invokes `onViewAll`. */\n viewAllLabel?: string;\n /** Fires when the footer \"View all\" link is clicked. */\n onViewAll?: () => void;\n /** Panel alignment relative to the trigger. Default `'end'`. */\n align?: 'start' | 'center' | 'end';\n /** Side of the trigger to open on. Default `'bottom'`. */\n side?: 'top' | 'bottom';\n}\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst notificationTrayVariants = cva('ds:relative ds:inline-flex ds:items-center', {\n variants: {\n size: {\n sm: '',\n md: '',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\nconst panelVariants = cva(\n [\n 'ds:flex ds:flex-col',\n 'ds:bg-[var(--popover)] ds:text-[var(--popover-foreground)]',\n // Border kept (transparent) so the forced-colors override below can\n // repaint a visible edge in HCM. In normal modes the soft drop-shadow\n // carries the edge cue.\n 'ds:border ds:border-transparent',\n 'ds:rounded-[var(--radius-md)]',\n 'ds:shadow-[var(--shadow-lg)]',\n 'ds:z-[var(--z-popover)]',\n // Width: fluid below the design cap so narrow viewports keep a visible\n // gutter on *both* sides of the panel (shadow included). The legacy\n // `min-w` approach clamped at 20rem, which flush-mounted the panel\n // against the inline-start viewport edge on phones.\n 'ds:w-[min(24rem,calc(100vw-2*var(--spacing-md)))]',\n // Height: below the `sm` breakpoint the panel takes a near-full-screen\n // sheet shape so the user gets room to triage messages / notifications\n // without scrolling a tiny popover. `6rem` reserves space for the\n // Header (≈4rem) plus the sideOffset + collisionPadding (≈2rem).\n // Above `sm` it returns to `h-auto` so the list's own\n // `--*-tray-max-block-size` cap governs the height.\n 'ds:h-[calc(100dvh-6rem)] ds:sm:h-auto',\n 'ds:data-[state=open]:animate-in ds:data-[state=closed]:animate-out',\n 'ds:data-[state=closed]:fade-out-0 ds:data-[state=open]:fade-in-0',\n 'ds:data-[state=closed]:zoom-out-95 ds:data-[state=open]:zoom-in-95',\n 'ds:motion-reduce:transition-none ds:motion-reduce:animate-none',\n 'ds:focus-visible:outline-none',\n 'ds:forced-colors:border-[CanvasText]',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:p-[var(--spacing-xs)]',\n md: 'ds:p-[var(--spacing-sm)]',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\nconst badgeVariants = cva(\n [\n // Anchored to the top-end corner of the trigger, nudged outward so\n // the bell icon isn't covered.\n 'ds:absolute ds:-top-[var(--spacing-xs)] ds:-end-[var(--spacing-xs)]',\n 'ds:inline-flex ds:items-center ds:justify-center',\n // Circle at 1-2 digits; widens into a pill only for \"99+\".\n 'ds:min-w-[calc(var(--spacing-md)+var(--spacing-xs))] ds:h-[calc(var(--spacing-md)+var(--spacing-xs))] ds:ps-[calc(var(--spacing-xs)/1.5)] ds:pe-[calc(var(--spacing-xs)/1.5)]',\n 'ds:rounded-[var(--radius-full)]',\n 'ds:bg-[color:var(--destructive)] ds:text-[color:var(--destructive-foreground)]',\n 'ds:text-[length:var(--font-size-xs)] ds:font-semibold ds:leading-none',\n 'ds:pointer-events-none ds:select-none',\n 'ds:forced-colors:outline ds:forced-colors:outline-1 ds:forced-colors:outline-[CanvasText]',\n ].join(' '),\n);\n\n/* ------------------------------------------------------------------ */\n/* Helpers */\n/* ------------------------------------------------------------------ */\n\nfunction formatBadgeCount(count: number, overflowLabel: string): string {\n return count > 99 ? overflowLabel : String(count);\n}\n\nfunction SkeletonRow() {\n return (\n <div\n aria-hidden=\"true\"\n className=\"ds:flex ds:items-start ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-sm)]\"\n >\n <Skeleton variant=\"circular\" size=\"sm\" />\n <div className=\"ds:flex-1 ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <Skeleton variant=\"text\" size=\"md\" width=\"70%\" />\n <Skeleton variant=\"text\" size=\"sm\" width=\"90%\" />\n <Skeleton variant=\"text\" size=\"sm\" width=\"30%\" />\n </div>\n </div>\n );\n}\n\nfunction EmptyPanel() {\n const { t } = useTranslation();\n return (\n <div\n role=\"status\"\n aria-live=\"polite\"\n className=\"ds:flex ds:flex-col ds:items-center ds:justify-center ds:gap-[var(--spacing-xs)] ds:p-[var(--spacing-lg)] ds:text-center\"\n >\n <span\n aria-hidden=\"true\"\n className=\"ds:inline-flex ds:items-center ds:justify-center ds:size-10 ds:rounded-[var(--radius-full)] ds:bg-[color:var(--muted)] ds:text-[color:var(--muted-foreground)] ds:[&>svg]:size-5\"\n >\n <Bell />\n </span>\n <p className=\"type-title-item ds:text-[color:var(--foreground)]\">\n {t('ui.notificationTray.noNotifications', 'No notifications')}\n </p>\n <p className=\"type-meta ds:text-[color:var(--muted-foreground)]\">\n {t(\n 'ui.notificationTray.noNotificationsDescription',\n \"You're all caught up.\",\n )}\n </p>\n </div>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Root */\n/* ------------------------------------------------------------------ */\n\nexport const NotificationTray = forwardRef<HTMLDivElement, NotificationTrayProps>(\n (\n {\n items,\n unseenCount,\n open,\n onOpenChange,\n onItemClick,\n onDismiss,\n onMarkAllRead,\n loading = false,\n maxVisible,\n viewAllLabel,\n onViewAll,\n align = 'end',\n side = 'bottom',\n size = 'md',\n className,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation();\n\n const isControlled = open !== undefined;\n const [internalOpen, setInternalOpen] = useState(false);\n const isOpen = isControlled ? open : internalOpen;\n\n const handleOpenChange = useCallback(\n (next: boolean) => {\n if (!isControlled) setInternalOpen(next);\n onOpenChange?.(next);\n },\n [isControlled, onOpenChange],\n );\n\n /* Exit-animation list (AnimatePresence-style).\n * `displayed` holds an entry per card that's currently mounted, even\n * briefly after the consumer removes an item from `items`. When the\n * consumer drops an id from `items`, we flip that entry to\n * `leaving: true` for one animation cycle, then prune it. */\n type Displayed = { item: NotificationItem; leaving: boolean };\n const [displayed, setDisplayed] = useState<Displayed[]>(() =>\n items.map((item) => ({ item, leaving: false })),\n );\n\n const animationDurationMs = useCallback((): number => {\n if (typeof window === 'undefined') return 200;\n const raw = window\n .getComputedStyle(document.documentElement)\n .getPropertyValue('--animation-duration');\n if (!raw) return 200;\n const trimmed = raw.trim();\n const n = parseFloat(trimmed);\n if (!Number.isFinite(n)) return 200;\n return trimmed.endsWith('ms') ? n : n * 1000;\n }, []);\n\n // `useLayoutEffect` so the `leaving=true` flip applies in the same paint\n // as the consumer's `items` update. With `useEffect` the browser paints\n // once with the dismissed card still at `leaving=false` (no animation)\n // before the flag flips — a visible lag before the exit animation starts.\n useLayoutEffect(() => {\n setDisplayed((prev) => {\n const nextIds = new Set(items.map((i) => i.id));\n const prevIds = new Set(prev.map((d) => d.item.id));\n\n const merged: Displayed[] = prev.map((d) => {\n if (nextIds.has(d.item.id)) {\n const fresh = items.find((i) => i.id === d.item.id);\n return fresh\n ? { item: fresh, leaving: false }\n : { ...d, leaving: true };\n }\n return { ...d, leaving: true };\n });\n\n for (const i of items) {\n if (!prevIds.has(i.id)) merged.push({ item: i, leaving: false });\n }\n return merged;\n });\n }, [items]);\n\n useEffect(() => {\n if (!displayed.some((d) => d.leaving)) return;\n const ms = animationDurationMs();\n const timer = setTimeout(() => {\n setDisplayed((prev) => prev.filter((d) => !d.leaving));\n }, ms);\n return () => clearTimeout(timer);\n }, [displayed, animationDurationMs]);\n\n /* Polite live region — announces when a new unread notification\n floats to the top of the list, even with the panel closed. */\n const liveRegionRef = useRef<HTMLDivElement | null>(null);\n const lastTopIdRef = useRef<string | undefined>(items[0]?.id);\n\n useEffect(() => {\n const topId = items[0]?.id;\n const prev = lastTopIdRef.current;\n if (prev && topId && prev !== topId && liveRegionRef.current) {\n const newest = items[0];\n if (newest && !newest.read) {\n liveRegionRef.current.textContent = t(\n 'ui.notificationTray.newNotification',\n {\n title: newest.title,\n defaultValue: 'New notification: {{title}}',\n },\n );\n }\n }\n lastTopIdRef.current = topId;\n }, [items, t]);\n\n const displayCount = unseenCount ?? 0;\n const triggerAriaLabel =\n displayCount > 0\n ? t('ui.notificationTray.triggerLabel', {\n count: displayCount,\n defaultValue: 'Notifications, {{count}} unread',\n })\n : t(\n 'ui.notificationTray.triggerLabelNone',\n 'Notifications, none unread',\n );\n\n const badgeLabel = formatBadgeCount(\n displayCount,\n t('ui.notificationTray.badgeCountOverflow', '99+'),\n );\n\n const panelClass = panelVariants({ size });\n\n return (\n <div\n ref={ref}\n data-component=\"notification-tray\"\n className={[notificationTrayVariants({ size }), className]\n .filter(Boolean)\n .join(' ')}\n {...rest}\n >\n <RadixPopover.Root open={isOpen} onOpenChange={handleOpenChange}>\n <RadixPopover.Trigger asChild>\n <IconButton\n icon={<Bell />}\n intent=\"outline\"\n size={size === 'sm' ? 'sm' : 'md'}\n aria-label={triggerAriaLabel}\n aria-haspopup=\"dialog\"\n />\n </RadixPopover.Trigger>\n {displayCount > 0 ? (\n <span\n aria-hidden=\"true\"\n data-testid=\"notification-tray-badge\"\n className={badgeVariants()}\n >\n {badgeLabel}\n </span>\n ) : null}\n {/* Live region sits outside the popover so it announces even\n while the panel is closed. */}\n <div\n ref={liveRegionRef}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className=\"ds:sr-only\"\n />\n <RadixPopover.Portal>\n <RadixPopover.Content\n role=\"dialog\"\n aria-label={t('ui.notificationTray.panelTitle', 'Notifications')}\n side={side}\n align={align}\n sideOffset={8}\n // `spacing-md` (16px) keeps Radix's collision-avoidance from\n // flush-mounting the panel against the viewport edge when the\n // trigger is near the inline-end of a narrow screen.\n collisionPadding={16}\n className={panelClass}\n >\n <div className=\"ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)] ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:pb-[var(--spacing-xs)]\">\n <h3 className=\"ds:m-0 type-title-card ds:text-[color:var(--foreground)]\">\n {t('ui.notificationTray.panelTitle', 'Notifications')}\n </h3>\n {onMarkAllRead && items.some((item) => !item.read) ? (\n <Button\n intent=\"link\"\n size=\"sm\"\n onClick={onMarkAllRead}\n className=\"ds:text-[length:var(--font-size-xs)]\"\n >\n {t('ui.notificationTray.markAllRead', 'Mark all as read')}\n </Button>\n ) : null}\n </div>\n <Separator />\n {/* Cap at ~24rem so ~5 items fit before the list scrolls.\n Consumers override via the --notification-tray-max-block-size\n custom property on the root element. */}\n <div\n role=\"list\"\n data-max-visible={maxVisible}\n // Below `sm` the panel is a near-full-screen sheet (see\n // `panelVariants`) and the list expands to fill the\n // remaining space with `flex-1`. Above `sm` the list\n // caps at the `--notification-tray-max-block-size` custom\n // property so the popover stays compact.\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:overflow-y-auto ds:pt-[var(--spacing-xs)] ds:flex-1 ds:sm:flex-none ds:sm:[max-block-size:var(--notification-tray-max-block-size,24rem)]\"\n >\n {loading ? (\n <>\n <SkeletonRow />\n <SkeletonRow />\n <SkeletonRow />\n </>\n ) : displayed.length === 0 ? (\n <EmptyPanel />\n ) : (\n displayed.map(({ item, leaving }) => (\n <NotificationCard\n key={item.id}\n item={item}\n variant=\"compact\"\n leaving={leaving}\n onActivate={onItemClick}\n onDismiss={onDismiss}\n />\n ))\n )}\n </div>\n {viewAllLabel ? (\n <>\n <Separator />\n <div className=\"ds:pt-[var(--spacing-xs)]\">\n <Button\n intent=\"link\"\n size=\"sm\"\n onClick={onViewAll}\n className=\"ds:w-full ds:justify-center\"\n >\n {viewAllLabel}\n </Button>\n </div>\n </>\n ) : null}\n </RadixPopover.Content>\n </RadixPopover.Portal>\n </RadixPopover.Root>\n </div>\n );\n },\n);\n\nNotificationTray.displayName = 'NotificationTray';\n"],"names":["__iconNode","Bell","createLucideIcon","notificationTrayVariants","cva","panelVariants","badgeVariants","formatBadgeCount","count","overflowLabel","SkeletonRow","jsxs","jsx","Skeleton","EmptyPanel","t","useTranslation","NotificationTray","forwardRef","items","unseenCount","open","onOpenChange","onItemClick","onDismiss","onMarkAllRead","loading","maxVisible","viewAllLabel","onViewAll","align","side","size","className","rest","ref","isControlled","internalOpen","setInternalOpen","useState","isOpen","handleOpenChange","useCallback","next","displayed","setDisplayed","item","animationDurationMs","raw","trimmed","n","useLayoutEffect","prev","nextIds","i","prevIds","d","merged","fresh","useEffect","ms","timer","liveRegionRef","useRef","lastTopIdRef","_a","topId","newest","displayCount","triggerAriaLabel","badgeLabel","panelClass","RadixPopover","IconButton","Button","Separator","Fragment","leaving","NotificationCard"],"mappings":";;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,gCAAgC,KAAK,SAAQ,CAAE;AAAA,EAC7D;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AACA,GACMC,IAAOC,GAAiB,QAAQF,EAAU,GC8C1CG,KAA2BC,EAAI,8CAA8C;AAAA,EACjF,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA;A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AAA,EACN,CACF;AAAA,QAAA,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEAX,GAAiB,cAAc;","x_google_ignoreList":[0]}
@@ -3,7 +3,7 @@ import { forwardRef as k, useState as w } from "react";
3
3
  import { useTranslation as c } from "react-i18next";
4
4
  import { A as y } from "./app-frame-6d7Lu4ea.js";
5
5
  import { I } from "./icon-button-Wnnde5lc.js";
6
- import { D as n } from "./dropdown-menu-JNo66A-j.js";
6
+ import { D as n } from "./dropdown-menu-Cw3EyPZv.js";
7
7
  import { H as L, g as A, f as H, e as x, a as C, c as M, d as B } from "./header-BGn1mRp8.js";
8
8
  import { L as N } from "./logo-BpFoCL-s.js";
9
9
  import { S as T, a as _, h as O, j as P, k as W, i as j } from "./sidebar-OVzwN3jE.js";
@@ -190,4 +190,4 @@ V.displayName = "PatientShell";
190
190
  export {
191
191
  V as P
192
192
  };
193
- //# sourceMappingURL=patient-shell-DP54y6rc.js.map
193
+ //# sourceMappingURL=patient-shell-7cXqIMFg.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"patient-shell-DP54y6rc.js","sources":["../../node_modules/lucide-react/dist/esm/icons/maximize-2.js","../../node_modules/lucide-react/dist/esm/icons/settings.js","../../src/patterns/patient-shell/patient-shell.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.8.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M15 3h6v6\", key: \"1q9fwt\" }],\n [\"path\", { d: \"m21 3-7 7\", key: \"1l2asr\" }],\n [\"path\", { d: \"m3 21 7-7\", key: \"tjx5ai\" }],\n [\"path\", { d: \"M9 21H3v-6\", key: \"wtvkvv\" }]\n];\nconst Maximize2 = createLucideIcon(\"maximize-2\", __iconNode);\n\nexport { __iconNode, Maximize2 as default };\n//# sourceMappingURL=maximize-2.js.map\n","/**\n * @license lucide-react v1.8.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915\",\n key: \"1i5ecw\"\n }\n ],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"3\", key: \"1v7zrd\" }]\n];\nconst Settings = createLucideIcon(\"settings\", __iconNode);\n\nexport { __iconNode, Settings as default };\n//# sourceMappingURL=settings.js.map\n","/**\n * Patient Shell — the chrome for AlfaDocs's patient-facing users\n * (patients managing their own appointments and records).\n *\n * Deliberately flatter than the clinician `AppFrame` composition: no\n * command palette, no favourites, no practice/chain affordances, no\n * Leo, no privacy lock. Mirrors the legacy `_header.html.twig`\n * `app.user.type == 'patient'` branch and the `knp_menu_render('pcp')`\n * flat nav menu.\n *\n * Unlike most patterns in this folder, PatientShell exports a runtime\n * component because the consuming patient-portal app mounts it in\n * production — the exports are surfaced via `src/patterns/index.ts`\n * and included in the library bundle.\n */\nimport { forwardRef, useState, type ReactNode } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { LogOut, Maximize2, Settings as SettingsIcon } from 'lucide-react';\n\nimport { AppFrame } from '../../components/app-frame';\nimport { IconButton } from '../../components/button';\nimport { DropdownMenu } from '../../components/dropdown-menu';\nimport {\n Header,\n HeaderBrand,\n HeaderCenter,\n HeaderEnd,\n HeaderMenuButton,\n HeaderSkipLink,\n HeaderStart,\n} from '../../components/header';\nimport { Logo } from '../../components/logo';\nimport {\n Sidebar,\n SidebarBody,\n SidebarItem,\n SidebarItemBadge,\n SidebarItemIcon,\n SidebarItemLabel,\n type SidebarMode,\n} from '../../components/sidebar';\nimport { ThemeRoot } from '../../components/theme-root';\nimport { TooltipProvider } from '../../components/tooltip';\nimport { useTheme } from '../../hooks/use-theme';\n\n/* ------------------------------------------------------------------ */\n/* Public API */\n/* ------------------------------------------------------------------ */\n\nexport interface PatientNavItem {\n id: string;\n /** Pre-translated label — patients' nav labels are emitted already\n * translated by the consuming app's backend (legacy `knp_menu`). */\n label: string;\n href: string;\n /** Optional leading icon. Pass a lucide-react or equivalent element. */\n icon?: ReactNode;\n /** Optional unseen-item count rendered as a pill badge. */\n badgeCount?: number;\n /** Mark the item as the current page (`aria-current='page'`). */\n isActive?: boolean;\n}\n\nexport interface PatientShellProps {\n /** Patient's display name. Used as the avatar fallback by consumers\n * that read the name through a slot; not rendered inside this shell\n * today because the legacy patient chrome carries no profile pill. */\n userName: string;\n /** Optional avatar URL. Reserved for future profile-pill surfaces;\n * no visible effect today. */\n userAvatarSrc?: string;\n /** Flat nav items rendered in the sidebar, in order. */\n menuItems: PatientNavItem[];\n /** URL the \"Logout\" action navigates to — typically `/logout`. */\n logoutHref: string;\n /** Fires when the user toggles fullscreen from the settings menu. */\n onToggleFullscreen?: () => void;\n /** Optional brand logo. Defaults to\n * `<Logo variant=\"monochrome\" size=\"md\" decorative />`. */\n brandLogo?: ReactNode;\n /** Link target for the brand — typically the patient dashboard. */\n brandHref?: string;\n /** Override the accessible name of the `<main>` landmark. */\n mainAriaLabel?: string;\n /**\n * Force the sidebar into a specific mode. Consuming apps typically\n * flip to `'overlay'` on narrow viewports and leave this undefined\n * elsewhere (the sidebar then defaults to `'expanded'`).\n */\n sidebarState?: SidebarMode;\n /** Children render inside the main content region. */\n children: ReactNode;\n}\n\n/* ------------------------------------------------------------------ */\n/* Internals */\n/* ------------------------------------------------------------------ */\n\nfunction formatBadgeCount(count: number): string {\n return count > 99 ? '99+' : String(count);\n}\n\n/**\n * Guard against `javascript:` and other non-navigation schemes before\n * handing the URL to `window.location.assign`. A consuming app that lets\n * attacker-controlled input reach `logoutHref` would otherwise execute\n * script. Allow only relative paths, hash fragments, and `http(s)` URLs.\n */\nfunction isSafeLogoutHref(href: string): boolean {\n if (href.startsWith('/') || href.startsWith('#') || href.startsWith('?')) {\n return true;\n }\n try {\n const url = new URL(href, window.location.origin);\n return url.protocol === 'http:' || url.protocol === 'https:';\n } catch {\n return false;\n }\n}\n\nfunction SettingsMenu({\n logoutHref,\n onToggleFullscreen,\n}: {\n logoutHref: string;\n onToggleFullscreen?: () => void;\n}) {\n const { t } = useTranslation();\n return (\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <IconButton\n icon={<SettingsIcon aria-hidden=\"true\" />}\n aria-label={t('patientShell.settings.triggerAria')}\n tooltip={t('patientShell.settings.triggerAria')}\n data-testid=\"patient-shell-settings-trigger\"\n />\n </DropdownMenu.Trigger>\n <DropdownMenu.Content align=\"end\">\n <DropdownMenu.Item\n startIcon={<Maximize2 aria-hidden=\"true\" />}\n onSelect={onToggleFullscreen}\n data-testid=\"patient-shell-fullscreen\"\n >\n {t('patientShell.settings.fullscreen')}\n </DropdownMenu.Item>\n <DropdownMenu.Separator />\n <DropdownMenu.Item\n startIcon={<LogOut aria-hidden=\"true\" />}\n onSelect={() => {\n if (typeof window === 'undefined') return;\n if (!isSafeLogoutHref(logoutHref)) return;\n window.location.assign(logoutHref);\n }}\n data-testid=\"patient-shell-logout\"\n >\n {t('patientShell.settings.logout')}\n </DropdownMenu.Item>\n </DropdownMenu.Content>\n </DropdownMenu.Root>\n );\n}\n\nfunction PatientSidebarNav({ menuItems }: { menuItems: PatientNavItem[] }) {\n return (\n <SidebarBody>\n {menuItems.map((item) => {\n const badge =\n typeof item.badgeCount === 'number' && item.badgeCount > 0\n ? item.badgeCount\n : undefined;\n return (\n <SidebarItem\n key={item.id}\n href={item.href}\n aria-label={item.label}\n isActive={item.isActive}\n >\n {item.icon ? <SidebarItemIcon>{item.icon}</SidebarItemIcon> : null}\n <SidebarItemLabel>{item.label}</SidebarItemLabel>\n {badge !== undefined ? (\n <SidebarItemBadge>{formatBadgeCount(badge)}</SidebarItemBadge>\n ) : null}\n </SidebarItem>\n );\n })}\n </SidebarBody>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Root */\n/* ------------------------------------------------------------------ */\n\nexport const PatientShell = forwardRef<HTMLDivElement, PatientShellProps>(\n (\n {\n menuItems,\n logoutHref,\n onToggleFullscreen,\n brandLogo,\n brandHref = '/',\n mainAriaLabel,\n sidebarState,\n children,\n // `userName` and `userAvatarSrc` are declared on the public API\n // for forward-compatibility (future profile-pill work) — they are\n // intentionally unused today because the legacy patient chrome\n // carries no profile pill.\n userName: _userName,\n userAvatarSrc: _userAvatarSrc,\n },\n ref,\n ) => {\n const { t } = useTranslation();\n const { resolvedTheme } = useTheme();\n const themeBase = resolvedTheme.startsWith('dark') ? 'dark' : 'light';\n const themeAccessible = resolvedTheme.endsWith('-accessible');\n\n // Narrow-viewport overlay: `HeaderMenuButton` only renders below the\n // `md` breakpoint, and toggling opens the Sidebar's overlay Dialog.\n const [sidebarOpen, setSidebarOpen] = useState(false);\n\n const resolvedLogo = brandLogo ?? (\n <Logo variant=\"monochrome\" size=\"md\" decorative />\n );\n\n return (\n <ThemeRoot\n ref={ref}\n theme={themeBase}\n accessible={themeAccessible}\n className=\"ds:contents\"\n >\n <TooltipProvider>\n <AppFrame\n mainAriaLabel={mainAriaLabel}\n header={\n <Header>\n <HeaderStart>\n <HeaderSkipLink href=\"#main-content\" />\n <HeaderMenuButton\n onMenuOpen={() => setSidebarOpen(true)}\n />\n <HeaderBrand\n logo={resolvedLogo}\n href={brandHref}\n aria-label={t('patientShell.brand.homeAria')}\n />\n </HeaderStart>\n <HeaderCenter />\n <HeaderEnd>\n <SettingsMenu\n logoutHref={logoutHref}\n onToggleFullscreen={onToggleFullscreen}\n />\n </HeaderEnd>\n </Header>\n }\n sidebar={\n <Sidebar\n {...(sidebarState !== undefined\n ? { state: sidebarState }\n : { defaultState: 'expanded' as const })}\n open={sidebarOpen}\n onOpenChange={setSidebarOpen}\n aria-label={t('patientShell.sidebar.panelLabel')}\n data-testid=\"patient-shell-sidebar\"\n >\n <PatientSidebarNav menuItems={menuItems} />\n </Sidebar>\n }\n >\n {children}\n </AppFrame>\n </TooltipProvider>\n </ThemeRoot>\n );\n },\n);\n\nPatientShell.displayName = 'PatientShell';\n"],"names":["__iconNode","Maximize2","createLucideIcon","Settings","formatBadgeCount","count","isSafeLogoutHref","href","url","SettingsMenu","logoutHref","onToggleFullscreen","t","useTranslation","jsxs","DropdownMenu","jsx","IconButton","SettingsIcon","LogOut","PatientSidebarNav","menuItems","SidebarBody","item","badge","SidebarItem","SidebarItemIcon","SidebarItemLabel","SidebarItemBadge","PatientShell","forwardRef","brandLogo","brandHref","mainAriaLabel","sidebarState","children","_userName","_userAvatarSrc","ref","resolvedTheme","useTheme","themeBase","themeAccessible","sidebarOpen","setSidebarOpen","useState","ThemeRoot","TooltipProvider","AppFrame","Header","HeaderStart","HeaderSkipLink","HeaderMenuButton","HeaderBrand","Logo","HeaderCenter","HeaderEnd","Sidebar"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,aAAa,KAAK,SAAQ,CAAE;AAAA,EAC1C,CAAC,QAAQ,EAAE,GAAG,aAAa,KAAK,SAAQ,CAAE;AAAA,EAC1C,CAAC,QAAQ,EAAE,GAAG,aAAa,KAAK,SAAQ,CAAE;AAAA,EAC1C,CAAC,QAAQ,EAAE,GAAG,cAAc,KAAK,SAAQ,CAAE;AAC7C,GACMC,IAAYC,EAAiB,cAAcF,CAAU;ACf3D;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB;AAAA,IACE;AAAA,I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;AAAA,cAAA;AAAA,gBACE,GAAIvB,MAAiB,SAClB,EAAE,OAAOA,MACT,EAAE,cAAc,WAAA;AAAA,gBACpB,MAAMS;AAAA,gBACN,cAAcC;AAAA,gBACd,cAAYhC,EAAE,iCAAiC;AAAA,gBAC/C,eAAY;AAAA,gBAEZ,UAAA,gBAAAI,EAACI,KAAkB,WAAAC,EAAA,CAAsB;AAAA,cAAA;AAAA,YAAA;AAAA,YAI5C,UAAAc;AAAA,UAAA;AAAA,QAAA,EACH,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEAN,EAAa,cAAc;","x_google_ignoreList":[0,1]}
1
+ {"version":3,"file":"patient-shell-7cXqIMFg.js","sources":["../../node_modules/lucide-react/dist/esm/icons/maximize-2.js","../../node_modules/lucide-react/dist/esm/icons/settings.js","../../src/patterns/patient-shell/patient-shell.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.8.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M15 3h6v6\", key: \"1q9fwt\" }],\n [\"path\", { d: \"m21 3-7 7\", key: \"1l2asr\" }],\n [\"path\", { d: \"m3 21 7-7\", key: \"tjx5ai\" }],\n [\"path\", { d: \"M9 21H3v-6\", key: \"wtvkvv\" }]\n];\nconst Maximize2 = createLucideIcon(\"maximize-2\", __iconNode);\n\nexport { __iconNode, Maximize2 as default };\n//# sourceMappingURL=maximize-2.js.map\n","/**\n * @license lucide-react v1.8.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915\",\n key: \"1i5ecw\"\n }\n ],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"3\", key: \"1v7zrd\" }]\n];\nconst Settings = createLucideIcon(\"settings\", __iconNode);\n\nexport { __iconNode, Settings as default };\n//# sourceMappingURL=settings.js.map\n","/**\n * Patient Shell — the chrome for AlfaDocs's patient-facing users\n * (patients managing their own appointments and records).\n *\n * Deliberately flatter than the clinician `AppFrame` composition: no\n * command palette, no favourites, no practice/chain affordances, no\n * Leo, no privacy lock. Mirrors the legacy `_header.html.twig`\n * `app.user.type == 'patient'` branch and the `knp_menu_render('pcp')`\n * flat nav menu.\n *\n * Unlike most patterns in this folder, PatientShell exports a runtime\n * component because the consuming patient-portal app mounts it in\n * production — the exports are surfaced via `src/patterns/index.ts`\n * and included in the library bundle.\n */\nimport { forwardRef, useState, type ReactNode } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { LogOut, Maximize2, Settings as SettingsIcon } from 'lucide-react';\n\nimport { AppFrame } from '../../components/app-frame';\nimport { IconButton } from '../../components/button';\nimport { DropdownMenu } from '../../components/dropdown-menu';\nimport {\n Header,\n HeaderBrand,\n HeaderCenter,\n HeaderEnd,\n HeaderMenuButton,\n HeaderSkipLink,\n HeaderStart,\n} from '../../components/header';\nimport { Logo } from '../../components/logo';\nimport {\n Sidebar,\n SidebarBody,\n SidebarItem,\n SidebarItemBadge,\n SidebarItemIcon,\n SidebarItemLabel,\n type SidebarMode,\n} from '../../components/sidebar';\nimport { ThemeRoot } from '../../components/theme-root';\nimport { TooltipProvider } from '../../components/tooltip';\nimport { useTheme } from '../../hooks/use-theme';\n\n/* ------------------------------------------------------------------ */\n/* Public API */\n/* ------------------------------------------------------------------ */\n\nexport interface PatientNavItem {\n id: string;\n /** Pre-translated label — patients' nav labels are emitted already\n * translated by the consuming app's backend (legacy `knp_menu`). */\n label: string;\n href: string;\n /** Optional leading icon. Pass a lucide-react or equivalent element. */\n icon?: ReactNode;\n /** Optional unseen-item count rendered as a pill badge. */\n badgeCount?: number;\n /** Mark the item as the current page (`aria-current='page'`). */\n isActive?: boolean;\n}\n\nexport interface PatientShellProps {\n /** Patient's display name. Used as the avatar fallback by consumers\n * that read the name through a slot; not rendered inside this shell\n * today because the legacy patient chrome carries no profile pill. */\n userName: string;\n /** Optional avatar URL. Reserved for future profile-pill surfaces;\n * no visible effect today. */\n userAvatarSrc?: string;\n /** Flat nav items rendered in the sidebar, in order. */\n menuItems: PatientNavItem[];\n /** URL the \"Logout\" action navigates to — typically `/logout`. */\n logoutHref: string;\n /** Fires when the user toggles fullscreen from the settings menu. */\n onToggleFullscreen?: () => void;\n /** Optional brand logo. Defaults to\n * `<Logo variant=\"monochrome\" size=\"md\" decorative />`. */\n brandLogo?: ReactNode;\n /** Link target for the brand — typically the patient dashboard. */\n brandHref?: string;\n /** Override the accessible name of the `<main>` landmark. */\n mainAriaLabel?: string;\n /**\n * Force the sidebar into a specific mode. Consuming apps typically\n * flip to `'overlay'` on narrow viewports and leave this undefined\n * elsewhere (the sidebar then defaults to `'expanded'`).\n */\n sidebarState?: SidebarMode;\n /** Children render inside the main content region. */\n children: ReactNode;\n}\n\n/* ------------------------------------------------------------------ */\n/* Internals */\n/* ------------------------------------------------------------------ */\n\nfunction formatBadgeCount(count: number): string {\n return count > 99 ? '99+' : String(count);\n}\n\n/**\n * Guard against `javascript:` and other non-navigation schemes before\n * handing the URL to `window.location.assign`. A consuming app that lets\n * attacker-controlled input reach `logoutHref` would otherwise execute\n * script. Allow only relative paths, hash fragments, and `http(s)` URLs.\n */\nfunction isSafeLogoutHref(href: string): boolean {\n if (href.startsWith('/') || href.startsWith('#') || href.startsWith('?')) {\n return true;\n }\n try {\n const url = new URL(href, window.location.origin);\n return url.protocol === 'http:' || url.protocol === 'https:';\n } catch {\n return false;\n }\n}\n\nfunction SettingsMenu({\n logoutHref,\n onToggleFullscreen,\n}: {\n logoutHref: string;\n onToggleFullscreen?: () => void;\n}) {\n const { t } = useTranslation();\n return (\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <IconButton\n icon={<SettingsIcon aria-hidden=\"true\" />}\n aria-label={t('patientShell.settings.triggerAria')}\n tooltip={t('patientShell.settings.triggerAria')}\n data-testid=\"patient-shell-settings-trigger\"\n />\n </DropdownMenu.Trigger>\n <DropdownMenu.Content align=\"end\">\n <DropdownMenu.Item\n startIcon={<Maximize2 aria-hidden=\"true\" />}\n onSelect={onToggleFullscreen}\n data-testid=\"patient-shell-fullscreen\"\n >\n {t('patientShell.settings.fullscreen')}\n </DropdownMenu.Item>\n <DropdownMenu.Separator />\n <DropdownMenu.Item\n startIcon={<LogOut aria-hidden=\"true\" />}\n onSelect={() => {\n if (typeof window === 'undefined') return;\n if (!isSafeLogoutHref(logoutHref)) return;\n window.location.assign(logoutHref);\n }}\n data-testid=\"patient-shell-logout\"\n >\n {t('patientShell.settings.logout')}\n </DropdownMenu.Item>\n </DropdownMenu.Content>\n </DropdownMenu.Root>\n );\n}\n\nfunction PatientSidebarNav({ menuItems }: { menuItems: PatientNavItem[] }) {\n return (\n <SidebarBody>\n {menuItems.map((item) => {\n const badge =\n typeof item.badgeCount === 'number' && item.badgeCount > 0\n ? item.badgeCount\n : undefined;\n return (\n <SidebarItem\n key={item.id}\n href={item.href}\n aria-label={item.label}\n isActive={item.isActive}\n >\n {item.icon ? <SidebarItemIcon>{item.icon}</SidebarItemIcon> : null}\n <SidebarItemLabel>{item.label}</SidebarItemLabel>\n {badge !== undefined ? (\n <SidebarItemBadge>{formatBadgeCount(badge)}</SidebarItemBadge>\n ) : null}\n </SidebarItem>\n );\n })}\n </SidebarBody>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Root */\n/* ------------------------------------------------------------------ */\n\nexport const PatientShell = forwardRef<HTMLDivElement, PatientShellProps>(\n (\n {\n menuItems,\n logoutHref,\n onToggleFullscreen,\n brandLogo,\n brandHref = '/',\n mainAriaLabel,\n sidebarState,\n children,\n // `userName` and `userAvatarSrc` are declared on the public API\n // for forward-compatibility (future profile-pill work) — they are\n // intentionally unused today because the legacy patient chrome\n // carries no profile pill.\n userName: _userName,\n userAvatarSrc: _userAvatarSrc,\n },\n ref,\n ) => {\n const { t } = useTranslation();\n const { resolvedTheme } = useTheme();\n const themeBase = resolvedTheme.startsWith('dark') ? 'dark' : 'light';\n const themeAccessible = resolvedTheme.endsWith('-accessible');\n\n // Narrow-viewport overlay: `HeaderMenuButton` only renders below the\n // `md` breakpoint, and toggling opens the Sidebar's overlay Dialog.\n const [sidebarOpen, setSidebarOpen] = useState(false);\n\n const resolvedLogo = brandLogo ?? (\n <Logo variant=\"monochrome\" size=\"md\" decorative />\n );\n\n return (\n <ThemeRoot\n ref={ref}\n theme={themeBase}\n accessible={themeAccessible}\n className=\"ds:contents\"\n >\n <TooltipProvider>\n <AppFrame\n mainAriaLabel={mainAriaLabel}\n header={\n <Header>\n <HeaderStart>\n <HeaderSkipLink href=\"#main-content\" />\n <HeaderMenuButton\n onMenuOpen={() => setSidebarOpen(true)}\n />\n <HeaderBrand\n logo={resolvedLogo}\n href={brandHref}\n aria-label={t('patientShell.brand.homeAria')}\n />\n </HeaderStart>\n <HeaderCenter />\n <HeaderEnd>\n <SettingsMenu\n logoutHref={logoutHref}\n onToggleFullscreen={onToggleFullscreen}\n />\n </HeaderEnd>\n </Header>\n }\n sidebar={\n <Sidebar\n {...(sidebarState !== undefined\n ? { state: sidebarState }\n : { defaultState: 'expanded' as const })}\n open={sidebarOpen}\n onOpenChange={setSidebarOpen}\n aria-label={t('patientShell.sidebar.panelLabel')}\n data-testid=\"patient-shell-sidebar\"\n >\n <PatientSidebarNav menuItems={menuItems} />\n </Sidebar>\n }\n >\n {children}\n </AppFrame>\n </TooltipProvider>\n </ThemeRoot>\n );\n },\n);\n\nPatientShell.displayName = 'PatientShell';\n"],"names":["__iconNode","Maximize2","createLucideIcon","Settings","formatBadgeCount","count","isSafeLogoutHref","href","url","SettingsMenu","logoutHref","onToggleFullscreen","t","useTranslation","jsxs","DropdownMenu","jsx","IconButton","SettingsIcon","LogOut","PatientSidebarNav","menuItems","SidebarBody","item","badge","SidebarItem","SidebarItemIcon","SidebarItemLabel","SidebarItemBadge","PatientShell","forwardRef","brandLogo","brandHref","mainAriaLabel","sidebarState","children","_userName","_userAvatarSrc","ref","resolvedTheme","useTheme","themeBase","themeAccessible","sidebarOpen","setSidebarOpen","useState","ThemeRoot","TooltipProvider","AppFrame","Header","HeaderStart","HeaderSkipLink","HeaderMenuButton","HeaderBrand","Logo","HeaderCenter","HeaderEnd","Sidebar"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,aAAa,KAAK,SAAQ,CAAE;AAAA,EAC1C,CAAC,QAAQ,EAAE,GAAG,aAAa,KAAK,SAAQ,CAAE;AAAA,EAC1C,CAAC,QAAQ,EAAE,GAAG,aAAa,KAAK,SAAQ,CAAE;AAAA,EAC1C,CAAC,QAAQ,EAAE,GAAG,cAAc,KAAK,SAAQ,CAAE;AAC7C,GACMC,IAAYC,EAAiB,cAAcF,CAAU;ACf3D;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AAAA,EACE,CAAC,UAAU,EAAE,IAAI,MAAM,IAAI,MAAM,GAAG,KAAK,KAAK,SAAQ,CAAE;AAC1D,GACMG,IAAWD,EAAiB,YAAYF,CAAU;AC+ExD,SAASI,EAAiBC,GAAuB;AAC/C,SAAOA,IAAQ,KAAK,QAAQ,OAAOA,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A,YAAA;AAAA,YAI5C,UAAAc;AAAA,UAAA;AAAA,QAAA,EACH,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEAN,EAAa,cAAc;","x_google_ignoreList":[0,1]}
@@ -26,7 +26,11 @@ function J(e) {
26
26
  }
27
27
  const K = X(
28
28
  [
29
- "ds:relative ds:bg-[var(--popover)] ds:border ds:border-[color:var(--border)] ds:rounded-[var(--radius-md)]",
29
+ // Border kept (transparent) so the forced-colors override below can
30
+ // repaint a visible edge in HCM. In normal modes the soft drop-shadow
31
+ // carries the edge cue; the heavy `--border` (grey-800 since WCAG
32
+ // 1.4.11 bump in 67fef8c) made the popover read as a charcoal box.
33
+ "ds:relative ds:bg-[var(--popover)] ds:border ds:border-transparent ds:rounded-[var(--radius-md)]",
30
34
  "ds:p-[var(--spacing-md)]",
31
35
  "ds:shadow-[var(--shadow-lg)]",
32
36
  "ds:z-[var(--z-popover)]",
@@ -62,22 +66,22 @@ function x({
62
66
  defaultOpen: n,
63
67
  modal: c
64
68
  }) {
65
- const [h, b] = H(n ?? !1), p = s !== void 0, y = p ? s : h, d = u(
69
+ const [h, b] = H(n ?? !1), p = s !== void 0, y = p ? s : h, a = u(
66
70
  (T) => {
67
71
  p || b(T), r == null || r(T);
68
72
  },
69
73
  [p, r]
70
- ), a = V(null), l = e === "hover" || e === "hover-or-click", i = u(() => {
71
- a.current && (clearTimeout(a.current), a.current = null);
74
+ ), d = V(null), l = e === "hover" || e === "hover-or-click", i = u(() => {
75
+ d.current && (clearTimeout(d.current), d.current = null);
72
76
  }, []), P = u(() => {
73
- i(), a.current = setTimeout(() => {
74
- d(!0);
77
+ i(), d.current = setTimeout(() => {
78
+ a(!0);
75
79
  }, 300);
76
- }, [i, d]), I = u(() => {
77
- i(), a.current = setTimeout(() => {
78
- d(!1);
80
+ }, [i, a]), I = u(() => {
81
+ i(), d.current = setTimeout(() => {
82
+ a(!1);
79
83
  }, 300);
80
- }, [i, d]);
84
+ }, [i, a]);
81
85
  C(() => () => i(), [i]);
82
86
  const [k, E] = H(void 0), [W, A] = H(
83
87
  void 0
@@ -85,7 +89,7 @@ function x({
85
89
  onMouseEnter: P,
86
90
  onMouseLeave: I,
87
91
  onFocus: () => {
88
- i(), d(!0);
92
+ i(), a(!0);
89
93
  },
90
94
  onBlur: I
91
95
  } : {};
@@ -101,7 +105,7 @@ function x({
101
105
  m.Root,
102
106
  {
103
107
  open: y,
104
- onOpenChange: d,
108
+ onOpenChange: a,
105
109
  modal: c,
106
110
  children: l ? /* @__PURE__ */ t("span", { className: "ds:inline-flex", ...F, children: o }) : o
107
111
  }
@@ -124,10 +128,10 @@ const R = v(
124
128
  children: c,
125
129
  ...h
126
130
  }, b) => {
127
- const { headingId: p, descriptionId: y } = f(g), { isHoverMode: d, clearHoverTimer: a, closeWithDelay: l } = f(w), i = J(e), P = d ? {
128
- onMouseEnter: a,
131
+ const { headingId: p, descriptionId: y } = f(g), { isHoverMode: a, clearHoverTimer: d, closeWithDelay: l } = f(w), i = J(e), P = a ? {
132
+ onMouseEnter: d,
129
133
  onMouseLeave: l,
130
- onFocus: a,
134
+ onFocus: d,
131
135
  onBlur: l
132
136
  } : {};
133
137
  return /* @__PURE__ */ t(m.Portal, { children: /* @__PURE__ */ L(
@@ -220,4 +224,4 @@ const O = Object.assign(x, {
220
224
  export {
221
225
  O as P
222
226
  };
223
- //# sourceMappingURL=popover-DvAtFOi-.js.map
227
+ //# sourceMappingURL=popover-C3CTUsqh.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"popover-C3CTUsqh.js","sources":["../../src/components/popover/popover.tsx"],"sourcesContent":["import {\n createContext,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useId,\n useRef,\n useState,\n type ComponentPropsWithoutRef,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { X } from 'lucide-react';\nimport { IconButton } from '../button/icon-button';\n\ninterface PopoverA11yContext {\n headingId: string | undefined;\n setHeadingId: (id: string | undefined) => void;\n descriptionId: string | undefined;\n setDescriptionId: (id: string | undefined) => void;\n}\n\nconst A11yContext = createContext<PopoverA11yContext>({\n headingId: undefined,\n setHeadingId: () => {},\n descriptionId: undefined,\n setDescriptionId: () => {},\n});\n\ninterface PopoverHoverContext {\n isHoverMode: boolean;\n clearHoverTimer: () => void;\n closeWithDelay: () => void;\n}\n\nconst HoverContext = createContext<PopoverHoverContext>({\n isHoverMode: false,\n clearHoverTimer: () => {},\n closeWithDelay: () => {},\n});\n\nfunction resolvePhysicalSide(\n logicalSide: 'start' | 'top' | 'end' | 'bottom',\n): 'left' | 'top' | 'right' | 'bottom' {\n if (logicalSide === 'top' || logicalSide === 'bottom') return logicalSide;\n const isRtl =\n typeof document !== 'undefined' && document.documentElement.dir === 'rtl';\n if (logicalSide === 'start') return isRtl ? 'right' : 'left';\n /* logicalSide === 'end' */\n return isRtl ? 'left' : 'right';\n}\n\nconst contentVariants = cva(\n [\n // Border kept (transparent) so the forced-colors override below can\n // repaint a visible edge in HCM. In normal modes the soft drop-shadow\n // carries the edge cue; the heavy `--border` (grey-800 since WCAG\n // 1.4.11 bump in 67fef8c) made the popover read as a charcoal box.\n 'ds:relative ds:bg-[var(--popover)] ds:border ds:border-transparent ds:rounded-[var(--radius-md)]',\n 'ds:p-[var(--spacing-md)]',\n 'ds:shadow-[var(--shadow-lg)]',\n 'ds:z-[var(--z-popover)]',\n 'ds:text-[var(--popover-foreground)] ds:text-[length:var(--font-size-sm)]',\n 'ds:break-words',\n 'ds:data-[state=open]:animate-in ds:data-[state=closed]:animate-out',\n 'ds:data-[state=closed]:fade-out-0 ds:data-[state=open]:fade-in-0',\n 'ds:data-[state=closed]:zoom-out-95 ds:data-[state=open]:zoom-in-95',\n 'ds:data-[side=bottom]:slide-in-from-top-2 ds:data-[side=left]:slide-in-from-right-2',\n 'ds:data-[side=right]:slide-in-from-left-2 ds:data-[side=top]:slide-in-from-bottom-2',\n 'ds:motion-reduce:transition-none ds:motion-reduce:animate-none',\n 'ds:forced-colors:border-[CanvasText]',\n 'ds:focus-visible:outline-none',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:max-w-[var(--popover-size-sm)]',\n md: 'ds:max-w-[var(--popover-size-md)]',\n lg: 'ds:max-w-[var(--popover-size-lg)]',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\nexport interface PopoverRootProps\n extends ComponentPropsWithoutRef<typeof RadixPopover.Root> {\n openOn?: 'click' | 'hover' | 'hover-or-click';\n children: ReactNode;\n}\n\nfunction PopoverRoot({\n openOn = 'click',\n children,\n open: controlledOpen,\n onOpenChange,\n defaultOpen,\n modal,\n}: PopoverRootProps) {\n const [internalOpen, setInternalOpen] = useState(defaultOpen ?? false);\n const isControlled = controlledOpen !== undefined;\n const isOpen = isControlled ? controlledOpen : internalOpen;\n\n const handleOpenChange = useCallback(\n (nextOpen: boolean) => {\n if (!isControlled) setInternalOpen(nextOpen);\n onOpenChange?.(nextOpen);\n },\n [isControlled, onOpenChange],\n );\n\n const hoverTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const isHoverMode = openOn === 'hover' || openOn === 'hover-or-click';\n\n const clearHoverTimer = useCallback(() => {\n if (hoverTimerRef.current) {\n clearTimeout(hoverTimerRef.current);\n hoverTimerRef.current = null;\n }\n }, []);\n\n const openWithDelay = useCallback(() => {\n clearHoverTimer();\n hoverTimerRef.current = setTimeout(() => {\n handleOpenChange(true);\n }, 300);\n }, [clearHoverTimer, handleOpenChange]);\n\n const closeWithDelay = useCallback(() => {\n clearHoverTimer();\n hoverTimerRef.current = setTimeout(() => {\n handleOpenChange(false);\n }, 300);\n }, [clearHoverTimer, handleOpenChange]);\n\n useEffect(() => {\n return () => clearHoverTimer();\n }, [clearHoverTimer]);\n\n /* a11y context state */\n const [headingId, setHeadingId] = useState<string | undefined>(undefined);\n const [descriptionId, setDescriptionId] = useState<string | undefined>(\n undefined,\n );\n\n const hoverHandlers = isHoverMode\n ? {\n onMouseEnter: openWithDelay,\n onMouseLeave: closeWithDelay,\n onFocus: () => {\n clearHoverTimer();\n handleOpenChange(true);\n },\n onBlur: closeWithDelay,\n }\n : {};\n\n return (\n <A11yContext.Provider\n value={{ headingId, setHeadingId, descriptionId, setDescriptionId }}\n >\n <HoverContext.Provider\n value={{ isHoverMode, clearHoverTimer, closeWithDelay }}\n >\n <RadixPopover.Root\n open={isOpen}\n onOpenChange={handleOpenChange}\n modal={modal}\n >\n {isHoverMode ? (\n <span className=\"ds:inline-flex\" {...hoverHandlers}>\n {children}\n </span>\n ) : (\n children\n )}\n </RadixPopover.Root>\n </HoverContext.Provider>\n </A11yContext.Provider>\n );\n}\nPopoverRoot.displayName = 'Popover.Root';\n\nconst PopoverTrigger = forwardRef<\n HTMLButtonElement,\n ComponentPropsWithoutRef<typeof RadixPopover.Trigger>\n>(({ children, ...props }, ref) => (\n <RadixPopover.Trigger ref={ref} {...props}>\n {children}\n </RadixPopover.Trigger>\n));\nPopoverTrigger.displayName = 'Popover.Trigger';\n\nexport interface PopoverContentProps\n extends Omit<\n ComponentPropsWithoutRef<typeof RadixPopover.Content>,\n 'side' | 'align'\n >,\n VariantProps<typeof contentVariants> {\n side?: 'start' | 'top' | 'end' | 'bottom';\n align?: 'start' | 'center' | 'end';\n size?: 'sm' | 'md' | 'lg';\n showArrow?: boolean;\n className?: string;\n children: ReactNode;\n}\n\nconst PopoverContent = forwardRef<HTMLDivElement, PopoverContentProps>(\n (\n {\n side = 'bottom',\n align = 'center',\n size = 'md',\n showArrow = true,\n className,\n children,\n ...props\n },\n ref,\n ) => {\n const { headingId, descriptionId } = useContext(A11yContext);\n const { isHoverMode: isHover, clearHoverTimer: cancelTimer, closeWithDelay: delayClose } =\n useContext(HoverContext);\n const physicalSide = resolvePhysicalSide(side);\n\n const contentHoverHandlers = isHover\n ? {\n onMouseEnter: cancelTimer,\n onMouseLeave: delayClose,\n onFocus: cancelTimer,\n onBlur: delayClose,\n }\n : {};\n\n return (\n <RadixPopover.Portal>\n <RadixPopover.Content\n ref={ref}\n side={physicalSide}\n align={align}\n sideOffset={8}\n collisionPadding={8}\n aria-labelledby={headingId}\n aria-describedby={descriptionId}\n className={contentVariants({ size, className })}\n data-component=\"popover\"\n {...contentHoverHandlers}\n {...props}\n >\n {children}\n {showArrow && (\n <RadixPopover.Arrow\n width={12}\n height={6}\n className=\"ds:fill-[var(--popover)]\"\n />\n )}\n </RadixPopover.Content>\n </RadixPopover.Portal>\n );\n },\n);\nPopoverContent.displayName = 'Popover.Content';\n\nconst PopoverClose = forwardRef<\n HTMLButtonElement,\n { className?: string }\n>(({ className }, ref) => {\n const { t } = useTranslation();\n\n return (\n <div className={['ds:absolute ds:top-[var(--spacing-sm)] ds:end-[var(--spacing-sm)]', className].filter(Boolean).join(' ')}>\n <RadixPopover.Close asChild>\n <IconButton\n ref={ref}\n icon={<X />}\n intent=\"ghost\"\n size=\"sm\"\n aria-label={t('ui.common.close', 'Close')}\n />\n </RadixPopover.Close>\n </div>\n );\n});\nPopoverClose.displayName = 'Popover.Close';\n\ninterface PopoverHeadingProps extends HTMLAttributes<HTMLHeadingElement> {\n as?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n}\n\nconst PopoverHeading = forwardRef<HTMLHeadingElement, PopoverHeadingProps>(\n ({ as: Tag = 'h3', className, ...props }, ref) => {\n const generatedId = useId();\n const { setHeadingId } = useContext(A11yContext);\n\n useEffect(() => {\n setHeadingId(generatedId);\n return () => setHeadingId(undefined);\n }, [generatedId, setHeadingId]);\n\n return (\n <Tag\n ref={ref}\n id={generatedId}\n className={[\n 'type-title-item ds:leading-snug ds:break-words',\n 'ds:pe-[var(--spacing-xl)]',\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n {...props}\n />\n );\n },\n);\nPopoverHeading.displayName = 'Popover.Heading';\n\nconst PopoverDescription = forwardRef<\n HTMLParagraphElement,\n HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => {\n const generatedId = useId();\n const { setDescriptionId } = useContext(A11yContext);\n\n useEffect(() => {\n setDescriptionId(generatedId);\n return () => setDescriptionId(undefined);\n }, [generatedId, setDescriptionId]);\n\n return (\n <p\n ref={ref}\n id={generatedId}\n className={[\n 'ds:text-[var(--muted-foreground)] type-body-sm ds:mt-[var(--spacing-xs)]',\n className,\n ]\n .filter(Boolean)\n .join(' ')}\n {...props}\n />\n );\n});\nPopoverDescription.displayName = 'Popover.Description';\n\nexport const Popover = Object.assign(PopoverRoot, {\n Root: PopoverRoot,\n Trigger: PopoverTrigger,\n Content: PopoverContent,\n Close: PopoverClose,\n Heading: PopoverHeading,\n Description: PopoverDescription,\n});\n\nexport type { PopoverRootProps as PopoverProps, PopoverHeadingProps };\n"],"names":["A11yContext","createContext","HoverContext","resolvePhysicalSide","logicalSide","isRtl","contentVariants","cva","PopoverRoot","openOn","children","controlledOpen","onOpenChange","defaultOpen","modal","internalOpen","setInternalOpen","useState","isControlled","isOpen","handleOpenChange","useCallback","nextOpen","hoverTimerRef","useRef","isHoverMode","clearHoverTimer","openWithDelay","closeWithDelay","useEffect","headingId","setHeadingId","descriptionId","setDescriptionId","hoverHandlers","jsx","RadixPopover","PopoverTrigger","forwardRef","props","ref","PopoverContent","side","align","size","showArrow","className","useContext","isHover","cancelTimer","delayClose","physicalSide","contentHoverHandlers","jsxs","PopoverClose","t","useTranslation","IconButton","X","PopoverHeading","Tag","generatedId","useId","PopoverDescription","Popover"],"mappings":";;;;;;;AA0BA,MAAMA,IAAcC,EAAkC;AAAA,EACpD,WAAW;AAAA,EACX,cAAc,MAAM;AAAA,EAAC;AAAA,EACrB,eAAe;AAAA,EACf,kBAAkB,MAAM;AAAA,EAAC;AAC3B,CAAC,GAQKC,IAAeD,EAAmC;AAAA,EACtD,aAAa;AAAA,EACb,iBAAiB,MAAM;AAAA,EAAC;AAAA,EACxB,gBAAgB,MAAM;AAAA,EAAC;AACzB,C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BAAA7B,EAAA,IAAqBc,EAAW/C,CAAW;AAEnD,SAAA6B,EAAU,OACRI,EAAiB4B,CAAW,GACrB,MAAM5B,EAAiB,MAAS,IACtC,CAAC4B,GAAa5B,CAAgB,CAAC,GAGhC,gBAAAE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAK;AAAA,MACA,IAAIqB;AAAA,MACJ,WAAW;AAAA,QACT;AAAA,QACAf;AAAA,MAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,MACV,GAAGP;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;AACDwB,EAAmB,cAAc;AAE1B,MAAMC,IAAU,OAAO,OAAOxD,GAAa;AAAA,EAChD,MAAMA;AAAA,EACN,SAAS6B;AAAA,EACT,SAASI;AAAA,EACT,OAAOa;AAAA,EACP,SAASK;AAAA,EACT,aAAaI;AACf,CAAC;"}
@@ -1,4 +1,4 @@
1
- import { jsxs as a, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as a, jsx as o } from "react/jsx-runtime";
2
2
  import { forwardRef as F, useState as K, useCallback as f } from "react";
3
3
  import { useTranslation as q } from "react-i18next";
4
4
  import * as r from "@radix-ui/react-dialog";
@@ -15,7 +15,7 @@ const Q = F(
15
15
  onOpenChange: s,
16
16
  onUnlock: g,
17
17
  onAccountPage: p,
18
- onSignOut: u,
18
+ onSignOut: m,
19
19
  triggerIcon: L,
20
20
  triggerAriaLabel: k,
21
21
  triggerTooltip: h,
@@ -27,7 +27,7 @@ const Q = F(
27
27
  className: P,
28
28
  ...w
29
29
  }, I) => {
30
- const { t: o } = q(), [O, j] = K(y), i = l !== void 0, z = i ? l : O, n = f(
30
+ const { t } = q(), [O, j] = K(y), i = l !== void 0, z = i ? l : O, n = f(
31
31
  (e) => {
32
32
  i || j(e), s == null || s(e);
33
33
  },
@@ -37,16 +37,16 @@ const Q = F(
37
37
  e == null || e(), S.defaultPrevented || n(!1);
38
38
  },
39
39
  [n]
40
- ), A = k ?? o("privacyLock.triggerAriaLabel", "Lock screen for privacy"), U = h ?? o("privacyLock.triggerTooltip", "Lock screen"), m = x ?? o("privacyLock.title", "Screen locked for privacy"), C = b ?? o(
40
+ ), A = k ?? t("privacyLock.triggerAriaLabel", "Lock screen for privacy"), U = h ?? t("privacyLock.triggerTooltip", "Lock screen"), u = x ?? t("privacyLock.title", "Screen locked for privacy"), C = b ?? t(
41
41
  "privacyLock.description",
42
42
  "Locking the screen helps protect the privacy of your data."
43
- ), B = D ?? o("privacyLock.unlock", "Unlock screen"), E = T ?? o("privacyLock.accountPage", "Account page"), R = N ?? o("privacyLock.signOut", "Log out");
43
+ ), B = D ?? t("privacyLock.unlock", "Unlock screen"), E = T ?? t("privacyLock.accountPage", "Account page"), R = N ?? t("privacyLock.signOut", "Log out");
44
44
  return /* @__PURE__ */ a(r.Root, { open: z, onOpenChange: n, children: [
45
- /* @__PURE__ */ t(r.Trigger, { asChild: !0, children: /* @__PURE__ */ t(
45
+ /* @__PURE__ */ o(r.Trigger, { asChild: !0, children: /* @__PURE__ */ o(
46
46
  G,
47
47
  {
48
48
  ref: I,
49
- icon: L ?? /* @__PURE__ */ t(v, { "aria-hidden": !0 }),
49
+ icon: L ?? /* @__PURE__ */ o(v, { "aria-hidden": !0 }),
50
50
  "aria-label": A,
51
51
  tooltip: U,
52
52
  className: P,
@@ -55,7 +55,7 @@ const Q = F(
55
55
  }
56
56
  ) }),
57
57
  /* @__PURE__ */ a(r.Portal, { children: [
58
- /* @__PURE__ */ t(
58
+ /* @__PURE__ */ o(
59
59
  r.Overlay,
60
60
  {
61
61
  className: [
@@ -69,10 +69,10 @@ const Q = F(
69
69
  ].join(" ")
70
70
  }
71
71
  ),
72
- /* @__PURE__ */ t(
72
+ /* @__PURE__ */ o(
73
73
  r.Content,
74
74
  {
75
- "aria-label": m,
75
+ "aria-label": u,
76
76
  onEscapeKeyDown: (e) => e.preventDefault(),
77
77
  onPointerDownOutside: (e) => e.preventDefault(),
78
78
  onInteractOutside: (e) => e.preventDefault(),
@@ -86,38 +86,38 @@ const Q = F(
86
86
  "ds:motion-reduce:animate-none"
87
87
  ].join(" "),
88
88
  children: /* @__PURE__ */ a("div", { className: "ds:flex ds:flex-col ds:items-center ds:gap-[var(--spacing-lg)] ds:w-[min(22rem,calc(100vw-var(--spacing-xl)))] ds:text-center", children: [
89
- /* @__PURE__ */ t(H, { size: "xl", decorative: !0 }),
90
- /* @__PURE__ */ t(r.Title, { className: "ds:sr-only", children: m }),
89
+ /* @__PURE__ */ o(H, { size: "xl", decorative: !0 }),
90
+ /* @__PURE__ */ o(r.Title, { className: "ds:sr-only", children: u }),
91
91
  /* @__PURE__ */ a("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:w-full", children: [
92
- /* @__PURE__ */ t(
92
+ /* @__PURE__ */ o(
93
93
  d,
94
94
  {
95
95
  intent: "primary",
96
- startIcon: /* @__PURE__ */ t(v, { "aria-hidden": !0 }),
96
+ startIcon: /* @__PURE__ */ o(v, { "aria-hidden": !0 }),
97
97
  onClick: c(g),
98
98
  children: B
99
99
  }
100
100
  ),
101
- p ? /* @__PURE__ */ t(
101
+ p ? /* @__PURE__ */ o(
102
102
  d,
103
103
  {
104
- intent: "outline",
105
- startIcon: /* @__PURE__ */ t(J, { "aria-hidden": !0 }),
104
+ intent: "secondary",
105
+ startIcon: /* @__PURE__ */ o(J, { "aria-hidden": !0 }),
106
106
  onClick: c(p),
107
107
  children: E
108
108
  }
109
109
  ) : null,
110
- u ? /* @__PURE__ */ t(
110
+ m ? /* @__PURE__ */ o(
111
111
  d,
112
112
  {
113
- intent: "outline",
114
- startIcon: /* @__PURE__ */ t(M, { "aria-hidden": !0 }),
115
- onClick: c(u),
113
+ intent: "secondary",
114
+ startIcon: /* @__PURE__ */ o(M, { "aria-hidden": !0 }),
115
+ onClick: c(m),
116
116
  children: R
117
117
  }
118
118
  ) : null
119
119
  ] }),
120
- /* @__PURE__ */ t(r.Description, { className: "type-body-sm ds:opacity-90", children: C })
120
+ /* @__PURE__ */ o(r.Description, { className: "type-body-sm ds:opacity-90", children: C })
121
121
  ] })
122
122
  }
123
123
  )
@@ -129,4 +129,4 @@ Q.displayName = "PrivacyLock";
129
129
  export {
130
130
  Q as P
131
131
  };
132
- //# sourceMappingURL=privacy-lock-DS6QRo2N.js.map
132
+ //# sourceMappingURL=privacy-lock-CQpgkLec.js.map