@senvenli/react 0.3.3 → 0.3.4

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 (93) hide show
  1. package/dist/action/fab.d.ts +7 -0
  2. package/dist/action/fab.js +22 -3
  3. package/dist/action/fab.js.map +1 -1
  4. package/dist/collection/data-table.d.ts +1 -1
  5. package/dist/collection/data-table.js +2 -2
  6. package/dist/collection/data-table.js.map +1 -1
  7. package/dist/collection/table.d.ts +7 -2
  8. package/dist/collection/table.js +17 -7
  9. package/dist/collection/table.js.map +1 -1
  10. package/dist/i18n.d.ts +8 -0
  11. package/dist/i18n.js +18 -1
  12. package/dist/i18n.js.map +1 -1
  13. package/dist/navigation/index.d.ts +2 -2
  14. package/dist/navigation/index.js +1 -1
  15. package/dist/navigation/index.js.map +1 -1
  16. package/dist/navigation/sidebar.d.ts +18 -0
  17. package/dist/navigation/sidebar.js +26 -2
  18. package/dist/navigation/sidebar.js.map +1 -1
  19. package/dist/overlay/floating.js +4 -1
  20. package/dist/overlay/floating.js.map +1 -1
  21. package/dist/overlay/index.d.ts +2 -0
  22. package/dist/overlay/index.js +2 -1
  23. package/dist/overlay/index.js.map +1 -1
  24. package/dist/overlay/tour.d.ts +88 -0
  25. package/dist/overlay/tour.js +302 -0
  26. package/dist/overlay/tour.js.map +1 -0
  27. package/package.json +2 -2
  28. package/dist/action/files.d.ts +0 -70
  29. package/dist/action/files.js +0 -156
  30. package/dist/action/files.js.map +0 -1
  31. package/dist/action/theme-toggle.d.ts +0 -43
  32. package/dist/action/theme-toggle.js +0 -259
  33. package/dist/action/theme-toggle.js.map +0 -1
  34. package/dist/display/image-crop.d.ts +0 -106
  35. package/dist/display/image-crop.js +0 -117
  36. package/dist/display/image-crop.js.map +0 -1
  37. package/dist/display/image-cropper.d.ts +0 -68
  38. package/dist/display/image-cropper.js +0 -284
  39. package/dist/display/image-cropper.js.map +0 -1
  40. package/dist/display/lozenge.d.ts +0 -30
  41. package/dist/display/lozenge.js +0 -55
  42. package/dist/display/lozenge.js.map +0 -1
  43. package/dist/display/scroll-area.d.ts +0 -29
  44. package/dist/display/scroll-area.js +0 -95
  45. package/dist/display/scroll-area.js.map +0 -1
  46. package/dist/feedback/cooldown.d.ts +0 -17
  47. package/dist/feedback/cooldown.js +0 -59
  48. package/dist/feedback/cooldown.js.map +0 -1
  49. package/dist/feedback/status-dot.d.ts +0 -23
  50. package/dist/feedback/status-dot.js +0 -37
  51. package/dist/feedback/status-dot.js.map +0 -1
  52. package/dist/form/input-otp.d.ts +0 -35
  53. package/dist/form/input-otp.js +0 -83
  54. package/dist/form/input-otp.js.map +0 -1
  55. package/dist/layout/auth-form-layout.d.ts +0 -71
  56. package/dist/layout/auth-form-layout.js +0 -61
  57. package/dist/layout/auth-form-layout.js.map +0 -1
  58. package/dist/layout/auth-layout.d.ts +0 -59
  59. package/dist/layout/auth-layout.js +0 -26
  60. package/dist/layout/auth-layout.js.map +0 -1
  61. package/dist/layout/pressable.d.ts +0 -40
  62. package/dist/layout/pressable.js +0 -65
  63. package/dist/layout/pressable.js.map +0 -1
  64. package/dist/layout/reset-sent-card.d.ts +0 -39
  65. package/dist/layout/reset-sent-card.js +0 -22
  66. package/dist/layout/reset-sent-card.js.map +0 -1
  67. package/dist/navigation/dock.d.ts +0 -27
  68. package/dist/navigation/dock.js +0 -47
  69. package/dist/navigation/dock.js.map +0 -1
  70. package/dist/navigation/footer.d.ts +0 -43
  71. package/dist/navigation/footer.js +0 -43
  72. package/dist/navigation/footer.js.map +0 -1
  73. package/dist/navigation/language-names.d.ts +0 -19
  74. package/dist/navigation/language-names.js +0 -79
  75. package/dist/navigation/language-names.js.map +0 -1
  76. package/dist/navigation/language-switcher.d.ts +0 -55
  77. package/dist/navigation/language-switcher.js +0 -53
  78. package/dist/navigation/language-switcher.js.map +0 -1
  79. package/dist/navigation/panel-header.d.ts +0 -37
  80. package/dist/navigation/panel-header.js +0 -50
  81. package/dist/navigation/panel-header.js.map +0 -1
  82. package/dist/navigation/toolbar.d.ts +0 -37
  83. package/dist/navigation/toolbar.js +0 -334
  84. package/dist/navigation/toolbar.js.map +0 -1
  85. package/dist/overlay/command-palette.d.ts +0 -53
  86. package/dist/overlay/command-palette.js +0 -130
  87. package/dist/overlay/command-palette.js.map +0 -1
  88. package/dist/overlay/overlay.d.ts +0 -299
  89. package/dist/overlay/overlay.js +0 -558
  90. package/dist/overlay/overlay.js.map +0 -1
  91. package/dist/selection/radio-card.d.ts +0 -31
  92. package/dist/selection/radio-card.js +0 -29
  93. package/dist/selection/radio-card.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar.js","sourceRoot":"","sources":["../../src/navigation/sidebar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,MAAM,IAAI,UAAU,EACpB,UAAU,EACV,eAAe,EACf,IAAI,IAAI,QAAQ,EAChB,SAAS,GACV,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAmB,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAuB,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAiB,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACxF,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AA+FlD,SAAS,UAAU,CAAC,UAAkB;IACpC,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,MAAM,CAAC,YAAY,C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,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IACvD,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACzC,OAAO,CACL,MAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,MAAM,aAClC,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,CACnB,0BAAc,cAAc,EAAC,SAAS,EAAC,uBAAuB,YAC3D,KAAK,GACH,CACN,EACA,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,CACtB,2BAAe,kBAAkB,EAAC,SAAS,EAAC,0BAA0B,YACnE,QAAQ,GACL,CACP,IACsB,CAC1B,CAAC;AACJ,CAAC;AAED,sGAAsG;AACtG,MAAM,UAAU,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,KAAK,EAA6B;IACrE,OAAO,CACL,KAAC,WAAW,IAAC,MAAM,EAAE,MAAM,YACzB,KAAC,WAAW,OAAM,KAAsB,GAAI,GAChC,CACf,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n Button as AriaButton,\n Disclosure,\n DisclosurePanel,\n Link as AriaLink,\n useLocale,\n} from \"react-aria-components\";\n\nimport { cn } from \"../utils\";\nimport { MotionScope, type WithMotion } from \"../defaults\";\nimport { Button } from \"../action/button\";\nimport { Badge, type BadgeCountTone } from \"../display/badge\";\nimport { IconGlyph, type IconName } from \"../display/icon\";\nimport { collapseSidebarLabel, expandSidebarLabel, mainNavigationLabel } from \"../i18n\";\nimport { Tooltip, TooltipFor } from \"../overlay/floating\";\nimport { NavPanel } from \"./nav-panel\";\nimport { ROOT_ATTRIBUTE } from \"./sidebar-script\";\n\nexport type SidebarItemData = {\n id: string;\n /** A noun for the section (\"Orders\"). */\n label: string;\n /** Lucide name; top-level items carry one (it is all a collapsed sidebar shows). */\n icon?: IconName;\n /** The page; an item with `children` is a group and has none. */\n href?: string;\n /** A count (\"4 new\"): a Badge after the label, on the icon when collapsed. */\n badge?: { value: number; tone?: BadgeCountTone };\n /** Nested items, shown indented on a rail under the group. */\n children?: readonly SidebarItemData[];\n};\n\n/**\n * A labelled block of items: an overline (\"Filo\") over its own list, not collapsible. The group is\n * named by its label (role=\"group\" + aria-labelledby), also when the sidebar is collapsed: the label is then\n * visually hidden and a thin separator marks where the section starts.\n */\nexport type SidebarSectionData = {\n /** Stable key for the section; also on the DOM as `data-section`. Unique among the sections. */\n id: string;\n /** The heading over the items, already translated by the app; it is the group's accessible name. */\n label: string;\n /**\n * The section's items: links or groups with `children`, exactly as in `items`. Icons are Lucide names. Item\n * ids are unique across `items` and every section: `currentKey` marks each item with that id, so a\n * repeated id gives two `aria-current=\"page\"` items (a development warning names it).\n */\n items: readonly SidebarItemData[];\n};\n\nexport type SidebarProps = {\n /** The product name, after `logo` (or the logo and name together). It links to `brandHref`. Or a `SidebarHeader` child. */\n brand?: React.ReactNode;\n /**\n * The app's mark (an Icon or an image) before `brand`. Collapsed, the rail shows it alone, centred; the\n * name stays the link's accessible name. Without it, collapsed shows the start of `brand`.\n */\n logo?: React.ReactNode;\n brandHref?: string;\n /**\n * The top-level items (links, or groups with `children`); five to eight is the comfortable range. With\n * `sections`, these are the unlabelled items above the labelled sections (a dashboard) and may be empty. Ids\n * are unique across `items` and `sections` (a repeated id marks two items as the current page).\n * Leave it out to compose the navigation as children instead.\n */\n items?: readonly SidebarItemData[];\n /**\n * With no `items`: the navigation composed from `SidebarItem`, `SidebarSubmenu` and `SidebarSection`\n * (loose items first, then the sections), plus an optional `SidebarHeader` (instead of `brand`) and\n * `SidebarFooter` (instead of `footer`).\n */\n children?: React.ReactNode;\n /**\n * Labelled sections under `items`, in order. Each is a named group with an overline; collapsed,\n * the overline is visually hidden (the group keeps its name) and a separator stands in for it. Not\n * collapsible. Left out (or empty), the Sidebar renders exactly as before.\n */\n sections?: readonly SidebarSectionData[];\n /** The id of the page's item: marked `aria-current=\"page\"`; its group stays open. */\n currentKey?: string;\n /** The account at the bottom: name and role after `avatar` (or Avatar, name and role together). Or a `SidebarFooter` child. */\n footer?: React.ReactNode;\n /**\n * The account's Avatar before `footer`. Collapsed, the rail shows it alone, centred, and `footer` is hidden.\n * Without it, collapsed shows the start of `footer`.\n */\n avatar?: React.ReactNode;\n /**\n * Keeps the account (`footer`) and the collapse toggle in view at the bottom: the brand stays at\n * the top and only the navigation (`items`, then `sections`) scrolls between them, expanded and\n * collapsed. In the phone panel the account stays at the bottom the same way. The DOM order, and so the Tab\n * order, is the same as without it. Off by default: the whole sidebar scrolls as one, as before.\n */\n isFooterPinned?: boolean;\n /** Icons only (56px), labels in tooltips. Controlled; or `defaultCollapsed` + `onCollapsedChange`. */\n isCollapsed?: boolean;\n defaultCollapsed?: boolean;\n onCollapsedChange?: (isCollapsed: boolean) => void;\n /**\n * Remembers the collapsed choice in localStorage under this key. Render `sidebarScript(storageKey,\n * { defaultCollapsed })` in <head> as well, with the same `defaultCollapsed`, so the first frame already\n * has the remembered width (no layout jump). Uncontrolled only: with `isCollapsed` the app owns the state.\n */\n storageKey?: string;\n /** Under 1024px the sidebar is a menu panel from the start edge; the app's menu button opens it. */\n isMobileOpen?: boolean;\n onMobileOpenChange?: (isOpen: boolean) => void;\n /** Names the navigation landmark; \"Main menu\" by default. */\n \"aria-label\"?: string;\n};\n\nfunction readStored(storageKey: string): boolean | undefined {\n try {\n const value = window.localStorage.getItem(storageKey);\n return value === \"collapsed\" ? true : value === \"expanded\" ? false : undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction writeStored(storageKey: string, collapsed: boolean) {\n try {\n window.localStorage.setItem(storageKey, collapsed ? \"collapsed\" : \"expanded\");\n } catch {\n // Storage can be full or blocked: the choice lasts for this page only.\n }\n}\n\n/**\n * Collapsed styling has two sources so the first frame is right in both modes: the sidebar's own\n * `data-collapsed`, or (remembered choice) the <html> attribute the head script set before React ran.\n * Classes are written out in full so Tailwind finds them.\n */\nconst WHEN_COLLAPSED = {\n root: \"data-[collapsed]:w-14 [:root[data-ds-sidebar=collapsed]_&]:w-14\",\n label:\n \"group-data-[collapsed]/sidebar:sr-only [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:sr-only\",\n hidden:\n \"group-data-[collapsed]/sidebar:hidden [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:hidden\",\n /** Shown only collapsed (the section separator). */\n shown:\n \"hidden group-data-[collapsed]/sidebar:block [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:block\",\n badge:\n \"group-data-[collapsed]/sidebar:absolute group-data-[collapsed]/sidebar:-top-1 group-data-[collapsed]/sidebar:end-0 \" +\n \"[:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:absolute [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:-top-1 [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:end-0\",\n /**\n * The account in the 56px rail: exactly the 32px avatar, no padding around it, centred. The 8px\n * padding it kept before cut the avatar in half.\n */\n clip:\n \"group-data-[collapsed]/sidebar:w-8 group-data-[collapsed]/sidebar:flex-none group-data-[collapsed]/sidebar:justify-start group-data-[collapsed]/sidebar:overflow-hidden group-data-[collapsed]/sidebar:p-0 \" +\n \"[:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:w-8 [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:flex-none [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:justify-start [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:overflow-hidden [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:p-0\",\n /** With a `logo` or `avatar`: only that mark is left, so the 32px box centres it. */\n centre:\n \"group-data-[collapsed]/sidebar:justify-center [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:justify-center\",\n} as const;\n\n/**\n * The scrollbar on the sidebar's link list, as on ScrollArea: thin, no track, its thumb shown\n * only on hover, keyboard focus inside the list, or while scrolling. A long list no longer shows a grey bar the full\n * height of the panel. Native underneath, so wheel, touch and keyboard scroll as before.\n */\nconst SCROLLBAR =\n \"[scrollbar-width:thin] [scrollbar-color:transparent_transparent] \" +\n \"hover:[scrollbar-color:color-mix(in_oklab,var(--ds-border-bold)_70%,transparent)_transparent] \" +\n \"focus-within:[scrollbar-color:color-mix(in_oklab,var(--ds-border-bold)_70%,transparent)_transparent]\";\n\n/**\n * The bottom block: a two-column grid, so the account and the collapse toggle share one row (the\n * account takes the room, the toggle sits at its end) A divider sets\n * the account row off from the links. Collapsed, the rail is one column: the account above the toggle, both centred.\n * The children and their order are unchanged.\n */\nconst BOTTOM =\n // No column gap: the divider over the account and the toggle reads as one line.\n \"grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-0 gap-y-ds-100 \" +\n \"group-data-[collapsed]/sidebar:grid-cols-1 group-data-[collapsed]/sidebar:justify-items-center \" +\n \"[:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:grid-cols-1 [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:justify-items-center\";\n/** The account: the room of the row. Square, so the divider over it ends straight; its Pressable keeps its own radius. */\nconst FOOTER = \"flex min-w-0 items-center gap-ds-100 p-ds-050\";\n/** The divider runs the full width of the account row: over the account and the toggle alike. */\nconst FOOTER_RULE = \"border-t border-ds-border pt-ds-150\";\n\n/**\n * `isFooterPinned`: the scrolling part between the brand and the pinned bottom. It reaches out over\n * the sidebar's padding (and takes it back inside), so the scrollbar sits on the sidebar's edge; its scroll padding\n * matches that inset, so a row that focus scrolls into view stops short of the edge and its ring is never clipped. Collapsed, the 56px rail has no room for a scrollbar beside the icons,\n * so it is hidden there (wheel, touch and focus still scroll). Written out in full so Tailwind finds them.\n */\nconst PINNED = {\n scroll:\n \"-mx-ds-150 -my-ds-050 flex min-h-0 flex-1 flex-col gap-ds-200 overflow-x-hidden overflow-y-auto overscroll-contain px-ds-150 py-ds-050 scroll-py-ds-050 \" + SCROLLBAR + \" \" +\n \"group-data-[collapsed]/sidebar:[scrollbar-width:none] [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:[scrollbar-width:none]\",\n /** The phone panel: its content box has 16px padding; the list scrolls, the account stays below it. */\n panelScroll: \"-mx-ds-200 -my-ds-050 flex min-h-0 flex-1 flex-col gap-ds-200 overflow-y-auto overscroll-contain px-ds-200 py-ds-050 scroll-py-ds-050 \" + SCROLLBAR,\n} as const;\n\n/** The overline over a labelled section. */\nconst OVERLINE = \"px-ds-100 pt-ds-100 pb-ds-050 text-heading-xxsmall text-ds-text-subtlest\";\n\nconst ROW =\n \"relative flex h-8 w-full items-center gap-ds-100 rounded-ds-medium px-ds-100 text-body font-medium text-ds-text-subtle outline-hidden \" +\n \"transition-colors duration-(--ds-duration-fast) motion-reduce:transition-none \" +\n \"data-[hovered]:bg-ds-background-neutral-subtle-hovered data-[hovered]:text-ds-text data-[pressed]:bg-ds-background-neutral-pressed \" +\n \"data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused \" +\n // The page in view: a soft neutral fill and the full text color, no edge marker (a 2px inset bent into a bracket on\n // the rounded row). One step darker than the sunken sidebar ground, which equals ds-background-neutral.\n \"aria-[current=page]:bg-ds-background-neutral-hovered aria-[current=page]:text-ds-text aria-[current=page]:data-[hovered]:bg-ds-background-neutral-hovered \" +\n // Collapsed: the icon alone, centred in the 56px rail.\n \"group-data-[collapsed]/sidebar:justify-center [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:justify-center\";\n\nconst ICON = \"text-ds-icon-subtle group-aria-[current=page]/row:text-ds-icon-brand\";\n\nconst contains = (item: SidebarItemData, key: string | undefined): boolean =>\n !!key && (item.id === key || !!item.children?.some((child) => contains(child, key)));\n\ntype Shared = { currentKey?: string; collapsed: boolean; expand: () => void };\n\n/** Every item id in the trees, depth first, repeats included. */\nfunction itemIds(items: readonly SidebarItemData[], into: string[] = []): string[] {\n for (const item of items) {\n into.push(item.id);\n if (item.children) itemIds(item.children, into);\n }\n return into;\n}\n\n/**\n * Item ids that repeat across `items` and `sections`, said once per set of ids, in development only\n * (the Table's repeated-id warning does the same). A repeated id would mark two items `aria-current=\"page\"`.\n *\n */\nfunction repeatedIds(items: readonly SidebarItemData[], sections: readonly SidebarSectionData[] | undefined) {\n const ids = itemIds(items);\n for (const section of sections ?? []) itemIds(section.items, ids);\n const seen = new Set<string>();\n const repeated = new Set<string>();\n for (const id of ids) (seen.has(id) ? repeated : seen).add(id);\n return [...repeated].map((id) => JSON.stringify(id)).join(\", \");\n}\n\nfunction useRepeatedIdWarning(items: readonly SidebarItemData[], sections: readonly SidebarSectionData[] | undefined) {\n // Production never warns, so it never walks the trees either; the hooks below still run in order.\n const signature = process.env.NODE_ENV === \"production\" ? \"\" : repeatedIds(items, sections);\n const warned = React.useRef<Set<string> | null>(null);\n React.useEffect(() => {\n if (process.env.NODE_ENV === \"production\" || !signature) return;\n warned.current ??= new Set();\n if (warned.current.has(signature)) return;\n warned.current.add(signature);\n console.warn(`Sidebar: the item ids ${signature} repeat across items and sections. Give every item its own id; currentKey marks each item with that id as the current page.`);\n }, [signature]);\n}\n\n/**\n * The main navigation of admin apps: brand, sections with nested items, optional\n * labelled `sections` and the account. Collapses to 56px icons\n * (tooltips carry the labels); under 1024px it is a menu panel from the start edge.\n */\nfunction SidebarBody({\n brand: brandProp,\n logo: logoProp,\n brandHref = \"/\",\n items,\n children,\n sections,\n currentKey,\n footer: footerProp,\n avatar: avatarProp,\n isFooterPinned = false,\n isCollapsed,\n defaultCollapsed = false,\n onCollapsedChange,\n storageKey,\n isMobileOpen = false,\n onMobileOpenChange,\n \"aria-label\": label,\n}: SidebarProps) {\n const { locale, direction } = useLocale();\n const slots = splitSlots(children);\n const { nav } = slots;\n const brand = brandProp ?? slots.header;\n const logo = logoProp ?? slots.logo;\n const footer = footerProp ?? slots.footer;\n const avatar = avatarProp ?? slots.avatar;\n const hasBrand = brand != null || logo != null;\n const hasFooter = footer != null || avatar != null;\n const name = label ?? mainNavigationLabel(locale);\n const [own, setOwn] = React.useState(defaultCollapsed);\n // The remembered choice is read after hydration (the head script already painted it).\n React.useLayoutEffect(() => {\n if (!storageKey) return;\n const stored = readStored(storageKey);\n if (stored !== undefined) setOwn(stored);\n }, [storageKey]);\n const collapsed = isCollapsed ?? own;\n React.useLayoutEffect(() => {\n if (storageKey) document.documentElement.setAttribute(ROOT_ATTRIBUTE, collapsed ? \"collapsed\" : \"expanded\");\n }, [storageKey, collapsed]);\n const setCollapsed = (next: boolean) => {\n if (isCollapsed === undefined) setOwn(next);\n if (storageKey) writeStored(storageKey, next);\n onCollapsedChange?.(next);\n };\n const toggleLabel = collapsed ? expandSidebarLabel(locale) : collapseSidebarLabel(locale);\n const shared: Shared = { currentKey, collapsed, expand: () => setCollapsed(false) };\n const labelled = sections && sections.length > 0 ? sections : undefined;\n useRepeatedIdWarning(items ?? [], labelled);\n\n return (\n <>\n <nav\n aria-label={name}\n data-slot=\"sidebar\"\n // Remembered choice: the <html> attribute styles it, so the server and first client render agree.\n data-collapsed={!storageKey && collapsed ? \"\" : undefined}\n className={cn(\n \"group/sidebar sticky top-0 hidden h-dvh max-h-full w-60 shrink-0 flex-col gap-ds-200 overflow-x-hidden overflow-y-auto border-e border-ds-border bg-ds-surface-sunken px-ds-150 py-ds-200 lg:flex\",\n \"transition-[width] duration-(--ds-duration-medium) ease-ds-standard motion-reduce:transition-none\",\n WHEN_COLLAPSED.root,\n // Pinned: the nav no longer scrolls as one; its middle part does.\n isFooterPinned ? \"overflow-y-hidden\" : SCROLLBAR,\n )}\n data-footer-pinned={isFooterPinned ? \"\" : undefined}\n >\n {hasBrand && <Brand brand={brand} logo={logo} href={brandHref} />}\n {isFooterPinned ? (\n <div data-slot=\"sidebar-scroll\" className={PINNED.scroll}>\n <Navigation items={items} nodes={nav} sections={labelled} shared={shared} />\n </div>\n ) : (\n <Navigation items={items} nodes={nav} sections={labelled} shared={shared} />\n )}\n <div className={cn(BOTTOM, isFooterPinned ? \"shrink-0\" : \"mt-auto\")}>\n {hasFooter && <Account footer={footer} avatar={avatar} className={cn(FOOTER_RULE, WHEN_COLLAPSED.clip, avatar != null && WHEN_COLLAPSED.centre)} />}\n <div\n data-slot=\"sidebar-toggle\"\n className={cn(\n \"flex justify-end group-data-[collapsed]/sidebar:justify-center [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:justify-center\",\n // Beside the account, under the same divider; alone, it keeps the row's end.\n hasFooter ? cn(FOOTER_RULE, \"self-stretch items-center ps-ds-050 group-data-[collapsed]/sidebar:border-t-0 group-data-[collapsed]/sidebar:pt-0 [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:border-t-0 [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:pt-0\") : \"col-span-full\",\n )}\n >\n <Tooltip content={toggleLabel} placement=\"end\">\n <Button\n variant=\"subtle\"\n size=\"small\"\n iconOnly\n // The panel edge is the inline start: left in LTR, right in RTL.\n iconBefore={\n direction === \"rtl\"\n ? collapsed ? \"panel-right-open\" : \"panel-right-close\"\n : collapsed ? \"panel-left-open\" : \"panel-left-close\"\n }\n aria-label={toggleLabel}\n aria-expanded={!collapsed}\n onPress={() => setCollapsed(!collapsed)}\n />\n </Tooltip>\n </div>\n </div>\n </nav>\n <NavPanel\n isOpen={isMobileOpen}\n onOpenChange={(open) => onMobileOpenChange?.(open)}\n label={name}\n side=\"start\"\n slot=\"sidebar\"\n header={hasBrand ? <Brand brand={brand} logo={logo} href={brandHref} /> : undefined}\n >\n {/* The dialog already carries the name; a second landmark name would be read twice. */}\n {isFooterPinned ? (\n // Pinned: the list scrolls inside the panel and the account stays at its bottom edge.\n <nav className=\"flex min-h-0 flex-1 flex-col gap-ds-200\" data-footer-pinned=\"\">\n <div data-slot=\"sidebar-scroll\" className={PINNED.panelScroll}>\n <Navigation items={items} nodes={nav} sections={labelled} shared={{ ...shared, collapsed: false }} />\n </div>\n {hasFooter && <Account footer={footer} avatar={avatar} className={cn(FOOTER_RULE, \"shrink-0\")} />}\n </nav>\n ) : (\n <nav className=\"flex flex-1 flex-col gap-ds-200\">\n <Navigation items={items} nodes={nav} sections={labelled} shared={{ ...shared, collapsed: false }} />\n {hasFooter && <Account footer={footer} avatar={avatar} className={cn(FOOTER_RULE, \"mt-auto\")} />}\n </nav>\n )}\n </NavPanel>\n </>\n );\n}\n\n/**\n * The brand link. With a `logo`, the name is a separate span that collapses to visually hidden, so the rail\n * shows the logo alone and the link keeps the name. Without one, the content is kept as given and the 32px box\n * shows its start.\n */\nfunction Brand({ brand, logo, href }: { brand: React.ReactNode; logo: React.ReactNode; href: string }) {\n return (\n <AriaLink\n href={href}\n data-slot=\"sidebar-brand\"\n className={cn(\n \"flex min-w-0 shrink-0 items-center gap-ds-100 rounded-ds-medium px-ds-100 text-body-strong text-ds-text outline-hidden data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused\",\n WHEN_COLLAPSED.clip,\n logo != null && WHEN_COLLAPSED.centre,\n )}\n >\n {logo == null ? (\n brand\n ) : (\n <>\n <span data-slot=\"sidebar-brand-logo\" className=\"flex shrink-0 items-center\">{logo}</span>\n {brand != null && <span data-slot=\"sidebar-brand-name\" className={cn(\"min-w-0 truncate\", WHEN_COLLAPSED.label)}>{brand}</span>}\n </>\n )}\n </AriaLink>\n );\n}\n\n/**\n * The account block. With an `avatar`, the rest of the account is hidden collapsed (it may hold controls, so\n * not merely visually hidden) and the rail shows the Avatar alone.\n */\nfunction Account({ footer, avatar, className }: { footer: React.ReactNode; avatar: React.ReactNode; className?: string }) {\n return (\n <div data-slot=\"sidebar-footer\" className={cn(FOOTER, className)}>\n {avatar == null ? (\n footer\n ) : (\n <>\n <span data-slot=\"sidebar-footer-avatar\" className=\"flex shrink-0\">{avatar}</span>\n {footer != null && <div data-slot=\"sidebar-footer-content\" className={cn(\"flex min-w-0 flex-1 items-center gap-ds-100\", WHEN_COLLAPSED.hidden)}>{footer}</div>}\n </>\n )}\n </div>\n );\n}\n\n/**\n * The top list, then the labelled sections. One child in its parent either way, so without sections the tree\n * (and the server's useId ids) is exactly what it was before sections existed.\n */\nfunction Navigation({ items, nodes, sections, shared }: { items?: readonly SidebarItemData[]; nodes: React.ReactNode[]; sections?: readonly SidebarSectionData[]; shared: Shared }) {\n if (!items) return <ComposedNavigation nodes={nodes} shared={shared} />;\n if (!sections) return <Tree items={items} shared={shared} />;\n return (\n <>\n {/* With sections, an empty top list is left out; without them it renders (also empty), as before. */}\n {items.length > 0 && <Tree items={items} shared={shared} />}\n <Sections sections={sections} shared={shared} />\n </>\n );\n}\n\nfunction Sections({ sections, shared }: { sections: readonly SidebarSectionData[]; shared: Shared }) {\n return (\n <div data-slot=\"sidebar-sections\" className=\"flex flex-col gap-ds-100\">\n {sections.map((section) => (\n <Section key={section.id} section={section} shared={shared} />\n ))}\n </div>\n );\n}\n\n/** A labelled section: an overline that names the group, plus a separator that shows only collapsed. */\nfunction Section({ section, shared }: { section: SidebarSectionData; shared: Shared }) {\n return (\n <SectionBlock id={section.id} label={section.label}>\n <Tree items={section.items} shared={shared} />\n </SectionBlock>\n );\n}\n\nfunction SectionBlock({ id: sectionId, label, children }: { id?: string; label: string; children: React.ReactNode }) {\n const id = React.useId();\n return (\n <div role=\"group\" aria-labelledby={id} data-slot=\"sidebar-nav-section\" data-section={sectionId} className=\"flex flex-col gap-0.5\">\n <span aria-hidden=\"true\" data-slot=\"sidebar-nav-section-separator\" className={cn(\"mx-ds-050 mb-ds-100 border-t border-ds-border\", WHEN_COLLAPSED.shown)} />\n <span id={id} data-slot=\"sidebar-nav-section-label\" className={cn(OVERLINE, WHEN_COLLAPSED.label)}>\n {label}\n </span>\n {children}\n </div>\n );\n}\n\nfunction Tree({ items, shared, nested }: { items: readonly SidebarItemData[]; shared: Shared; nested?: boolean }) {\n return (\n <ul data-slot={nested ? \"sidebar-subtree\" : \"sidebar-tree\"} className=\"flex flex-col gap-0.5\">\n {items.map((item) => (\n <li key={item.id}>\n {item.children ? (\n <GroupItem item={item} shared={shared} holdsCurrent={contains(item, shared.currentKey)}>\n <Tree items={item.children} shared={shared} nested />\n </GroupItem>\n ) : (\n <LinkItem item={item} shared={shared} nested={nested} />\n )}\n </li>\n ))}\n </ul>\n );\n}\n\n/** What a row shows, from data or from a `SidebarItem`/`SidebarSubmenu`. */\ntype Entry = Pick<SidebarItemData, \"id\" | \"label\" | \"icon\" | \"href\" | \"badge\"> & { isCurrent?: boolean };\n\nfunction Label({ item }: { item: Entry }) {\n return (\n <>\n {item.icon && <IconGlyph name={item.icon} data-slot=\"sidebar-item-icon\" className={ICON} />}\n <span data-slot=\"sidebar-item-label\" className={cn(\"min-w-0 flex-1 truncate text-start\", WHEN_COLLAPSED.label)}>\n {item.label}\n </span>\n {item.badge && item.badge.value > 0 && (\n <span data-slot=\"sidebar-item-badge\" className={cn(\"ms-auto\", WHEN_COLLAPSED.badge)}>\n <Badge variant=\"count\" value={item.badge.value} tone={item.badge.tone} />\n </span>\n )}\n </>\n );\n}\n\nfunction LinkItem({ item, shared, nested }: { item: Entry; shared: Shared; nested?: boolean }) {\n const link = (\n <AriaLink\n href={item.href}\n data-slot=\"sidebar-item\"\n aria-current={item.isCurrent || item.id === shared.currentKey ? \"page\" : undefined}\n className={cn(\"group/row\", ROW)}\n >\n <Label item={item} />\n </AriaLink>\n );\n return shared.collapsed && !nested ? (\n <TooltipFor content={item.label} placement=\"end\">\n {link}\n </TooltipFor>\n ) : (\n link\n );\n}\n\nfunction GroupItem({ item, shared, holdsCurrent, children }: { item: Entry; shared: Shared; holdsCurrent: boolean; children: React.ReactNode }) {\n const [expanded, setExpanded] = React.useState(holdsCurrent);\n // The group of the page's item stays open as the page changes.\n const [wasHolding, setWasHolding] = React.useState(holdsCurrent);\n if (wasHolding !== holdsCurrent) {\n setWasHolding(holdsCurrent);\n if (holdsCurrent) setExpanded(true);\n }\n const trigger = (\n <AriaButton\n slot=\"trigger\"\n data-slot=\"sidebar-group-trigger\"\n // Collapsed, the group holding the page is the only mark of where the reader is.\n data-current={holdsCurrent ? \"\" : undefined}\n // Collapsed, a group's icon opens the sidebar on that group.\n onPress={shared.collapsed ? shared.expand : undefined}\n className={cn(\n \"group/row\",\n ROW,\n \"group-data-[collapsed]/sidebar:data-[current]:bg-ds-background-neutral-hovered [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:data-[current]:bg-ds-background-neutral-hovered\",\n )}\n >\n <Label item={item} />\n <IconGlyph\n name=\"chevron-down\"\n size=\"small\"\n data-slot=\"sidebar-group-chevron\"\n className={cn(\"text-ds-icon-subtle transition-transform duration-(--ds-duration-fast) group-aria-expanded/row:rotate-180 motion-reduce:transition-none\", WHEN_COLLAPSED.hidden)}\n />\n </AriaButton>\n );\n return (\n <Disclosure\n // Collapsed, the panel is hidden, so it reports closed; pressing it opens the sidebar on the group.\n isExpanded={!shared.collapsed && expanded}\n onExpandedChange={(next) => setExpanded(shared.collapsed ? true : next)}\n data-slot=\"sidebar-group\"\n >\n {shared.collapsed ? (\n <TooltipFor content={item.label} placement=\"end\">\n {trigger}\n </TooltipFor>\n ) : (\n trigger\n )}\n <DisclosurePanel data-slot=\"sidebar-group-panel\" className={WHEN_COLLAPSED.hidden}>\n <div className=\"mt-0.5 ps-ds-400\">{children}</div>\n </DisclosurePanel>\n </Disclosure>\n );\n}\n\n\n// ---- Composed from parts ---------------------------------------------------------------------------------------\n\n/** The sidebar's state for its parts: the page's item, collapsed or not (never collapsed in the phone panel). */\nconst SharedContext = React.createContext<Shared | null>(null);\n/** True inside a `SidebarSubmenu`: its items are indented rows with no tooltip of their own. */\nconst NestedContext = React.createContext(false);\n\nfunction useShared(part: string): Shared {\n const shared = React.useContext(SharedContext);\n if (!shared) throw new Error(`${part} must be inside a Sidebar.`);\n return shared;\n}\n\nexport type SidebarHeaderProps = {\n /** The product name (or the logo and name together); it links to the Sidebar's `brandHref`. */\n children?: React.ReactNode;\n /** The app's mark before the name; collapsed, the rail shows it alone. As the Sidebar's `logo`. */\n logo?: React.ReactNode;\n};\n\n/** The brand at the top, as a child instead of the `brand` prop. */\nexport function SidebarHeader({ children }: SidebarHeaderProps) {\n return <>{children}</>;\n}\n\nexport type SidebarFooterProps = {\n /** The account's name and role (or Avatar, name and role together). */\n children?: React.ReactNode;\n /** The account's Avatar before the rest; collapsed, the rail shows it alone. As the Sidebar's `avatar`. */\n avatar?: React.ReactNode;\n};\n\n/** The account at the bottom, as a child instead of the `footer` prop; it shares a row with the collapse toggle. */\nexport function SidebarFooter({ children }: SidebarFooterProps) {\n return <>{children}</>;\n}\n\nexport type SidebarItemProps = {\n /** Unique in the sidebar; `currentKey` matches it. */\n id: string;\n /** A noun for the page (\"Orders\"); also the tooltip when the sidebar is collapsed. */\n label: string;\n /** Lucide name; top-level items carry one (it is all a collapsed sidebar shows). */\n icon?: IconName;\n href?: string;\n /** A count (\"4 new\"): a Badge after the label, on the icon when collapsed. */\n badge?: { value: number; tone?: BadgeCountTone };\n /** Marks this item as the page in view, instead of the Sidebar's `currentKey`. */\n isCurrent?: boolean;\n};\n\n/** One link in the navigation: at the top, in a `SidebarSection`, or nested in a `SidebarSubmenu`. */\nexport function SidebarItem(props: SidebarItemProps) {\n const shared = useShared(\"SidebarItem\");\n const nested = React.useContext(NestedContext);\n return (\n <li>\n <LinkItem item={props} shared={shared} nested={nested} />\n </li>\n );\n}\n\nexport type SidebarSubmenuProps = Omit<SidebarItemProps, \"href\" | \"isCurrent\"> & {\n /** The nested `SidebarItem`s, shown indented when it is open. */\n children: React.ReactNode;\n};\n\n/** An item that opens to nested items. It starts open, and stays open, while it holds the page in view. */\nexport function SidebarSubmenu({ children, ...item }: SidebarSubmenuProps) {\n const shared = useShared(\"SidebarSubmenu\");\n return (\n <li>\n <GroupItem item={item} shared={shared} holdsCurrent={holdsKey(children, shared.currentKey)}>\n <NestedContext.Provider value={true}>\n <ul data-slot=\"sidebar-subtree\" className=\"flex flex-col gap-0.5\">\n {children}\n </ul>\n </NestedContext.Provider>\n </GroupItem>\n </li>\n );\n}\n\nexport type SidebarSectionProps = {\n /** Also on the DOM as `data-section`. */\n id?: string;\n /** The overline over the items, already translated; it names the group, also when collapsed. */\n label: string;\n /** `SidebarItem`s and `SidebarSubmenu`s. */\n children: React.ReactNode;\n};\n\n/** A labelled block of items with an overline; collapsed, a thin separator stands in for the overline. */\nexport function SidebarSection({ id, label, children }: SidebarSectionProps) {\n useShared(\"SidebarSection\");\n return (\n <SectionBlock id={id} label={label}>\n <ul data-slot=\"sidebar-tree\" className=\"flex flex-col gap-0.5\">\n {children}\n </ul>\n </SectionBlock>\n );\n}\n\n/** Whether an item among these elements (at any depth) is the page in view. */\nfunction holdsKey(children: React.ReactNode, key: string | undefined): boolean {\n return React.Children.toArray(children).some((child) => {\n if (!React.isValidElement<{ id?: string; isCurrent?: boolean; children?: React.ReactNode }>(child)) return false;\n return (!!key && child.props.id === key) || !!child.props.isCurrent || holdsKey(child.props.children, key);\n });\n}\n\n/** Pulls the `SidebarHeader` and `SidebarFooter` out of the children; the rest is the navigation. */\nfunction splitSlots(children: React.ReactNode) {\n let header: React.ReactNode;\n let logo: React.ReactNode;\n let footer: React.ReactNode;\n let avatar: React.ReactNode;\n const nav: React.ReactNode[] = [];\n for (const child of React.Children.toArray(children)) {\n if (React.isValidElement<SidebarHeaderProps>(child) && child.type === SidebarHeader) {\n header = child.props.children;\n logo = child.props.logo;\n } else if (React.isValidElement<SidebarFooterProps>(child) && child.type === SidebarFooter) {\n footer = child.props.children;\n avatar = child.props.avatar;\n } else nav.push(child);\n }\n return { header, logo, footer, avatar, nav };\n}\n\n/** The composed navigation: loose items in one list, then the sections, as with `items` and `sections`. */\nfunction ComposedNavigation({ nodes, shared }: { nodes: React.ReactNode[]; shared: Shared }) {\n const isSection = (node: React.ReactNode) => React.isValidElement(node) && node.type === SidebarSection;\n const loose = nodes.filter((node) => !isSection(node));\n const sections = nodes.filter(isSection);\n return (\n <SharedContext.Provider value={shared}>\n {loose.length > 0 && (\n <ul data-slot=\"sidebar-tree\" className=\"flex flex-col gap-0.5\">\n {loose}\n </ul>\n )}\n {sections.length > 0 && (\n <div data-slot=\"sidebar-sections\" className=\"flex flex-col gap-ds-100\">\n {sections}\n </div>\n )}\n </SharedContext.Provider>\n );\n}\n\n/** Sidebar with its own `motion` (auto, reduce or none); see SidebarBody for the component itself. */\nexport function Sidebar({ motion, ...props }: SidebarProps & WithMotion) {\n return (\n <MotionScope motion={motion}>\n <SidebarBody {...(props as SidebarProps)} />\n </MotionScope>\n );\n}\n"]}
1
+ {"version":3,"file":"sidebar.js","sourceRoot":"","sources":["../../src/navigation/sidebar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,MAAM,IAAI,UAAU,EACpB,UAAU,EACV,eAAe,EACf,IAAI,IAAI,QAAQ,EAChB,SAAS,GACV,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAmB,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAuB,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAiB,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACxF,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAkB,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AA+FlD,SAAS,UAAU,CAAC,UAAkB;IACpC,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QACtD,O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AAE,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC;IACxG,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IACvD,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACzC,OAAO,CACL,MAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,MAAM,aAClC,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,CACnB,0BAAc,cAAc,EAAC,SAAS,EAAC,uBAAuB,YAC3D,KAAK,GACH,CACN,EACA,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,CACtB,2BAAe,kBAAkB,EAAC,SAAS,EAAC,0BAA0B,YACnE,QAAQ,GACL,CACP,IACsB,CAC1B,CAAC;AACJ,CAAC;AAED,sGAAsG;AACtG,MAAM,UAAU,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,KAAK,EAA6B;IACrE,OAAO,CACL,KAAC,WAAW,IAAC,MAAM,EAAE,MAAM,YACzB,KAAC,WAAW,OAAM,KAAsB,GAAI,GAChC,CACf,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n Button as AriaButton,\n Disclosure,\n DisclosurePanel,\n Link as AriaLink,\n useLocale,\n} from \"react-aria-components\";\n\nimport { cn } from \"../utils\";\nimport { MotionScope, type WithMotion } from \"../defaults\";\nimport { Button } from \"../action/button\";\nimport { Badge, type BadgeCountTone } from \"../display/badge\";\nimport { IconGlyph, type IconName } from \"../display/icon\";\nimport { collapseSidebarLabel, expandSidebarLabel, mainNavigationLabel } from \"../i18n\";\nimport { Menu, Tooltip, TooltipFor, type MenuEntry } from \"../overlay/floating\";\nimport { Avatar } from \"../display/avatar\";\nimport { NavPanel } from \"./nav-panel\";\nimport { ROOT_ATTRIBUTE } from \"./sidebar-script\";\n\nexport type SidebarItemData = {\n id: string;\n /** A noun for the section (\"Orders\"). */\n label: string;\n /** Lucide name; top-level items carry one (it is all a collapsed sidebar shows). */\n icon?: IconName;\n /** The page; an item with `children` is a group and has none. */\n href?: string;\n /** A count (\"4 new\"): a Badge after the label, on the icon when collapsed. */\n badge?: { value: number; tone?: BadgeCountTone };\n /** Nested items, shown indented on a rail under the group. */\n children?: readonly SidebarItemData[];\n};\n\n/**\n * A labelled block of items: an overline (\"Filo\") over its own list, not collapsible. The group is\n * named by its label (role=\"group\" + aria-labelledby), also when the sidebar is collapsed: the label is then\n * visually hidden and a thin separator marks where the section starts.\n */\nexport type SidebarSectionData = {\n /** Stable key for the section; also on the DOM as `data-section`. Unique among the sections. */\n id: string;\n /** The heading over the items, already translated by the app; it is the group's accessible name. */\n label: string;\n /**\n * The section's items: links or groups with `children`, exactly as in `items`. Icons are Lucide names. Item\n * ids are unique across `items` and every section: `currentKey` marks each item with that id, so a\n * repeated id gives two `aria-current=\"page\"` items (a development warning names it).\n */\n items: readonly SidebarItemData[];\n};\n\nexport type SidebarProps = {\n /** The product name, after `logo` (or the logo and name together). It links to `brandHref`. Or a `SidebarHeader` child. */\n brand?: React.ReactNode;\n /**\n * The app's mark (an Icon or an image) before `brand`. Collapsed, the rail shows it alone, centred; the\n * name stays the link's accessible name. Without it, collapsed shows the start of `brand`.\n */\n logo?: React.ReactNode;\n brandHref?: string;\n /**\n * The top-level items (links, or groups with `children`); five to eight is the comfortable range. With\n * `sections`, these are the unlabelled items above the labelled sections (a dashboard) and may be empty. Ids\n * are unique across `items` and `sections` (a repeated id marks two items as the current page).\n * Leave it out to compose the navigation as children instead.\n */\n items?: readonly SidebarItemData[];\n /**\n * With no `items`: the navigation composed from `SidebarItem`, `SidebarSubmenu` and `SidebarSection`\n * (loose items first, then the sections), plus an optional `SidebarHeader` (instead of `brand`) and\n * `SidebarFooter` (instead of `footer`).\n */\n children?: React.ReactNode;\n /**\n * Labelled sections under `items`, in order. Each is a named group with an overline; collapsed,\n * the overline is visually hidden (the group keeps its name) and a separator stands in for it. Not\n * collapsible. Left out (or empty), the Sidebar renders exactly as before.\n */\n sections?: readonly SidebarSectionData[];\n /** The id of the page's item: marked `aria-current=\"page\"`; its group stays open. */\n currentKey?: string;\n /** The account at the bottom: name and role after `avatar` (or Avatar, name and role together). Or a `SidebarFooter` child. */\n footer?: React.ReactNode;\n /**\n * The account's Avatar before `footer`. Collapsed, the rail shows it alone, centred, and `footer` is hidden.\n * Without it, collapsed shows the start of `footer`.\n */\n avatar?: React.ReactNode;\n /**\n * Keeps the account (`footer`) and the collapse toggle in view at the bottom: the brand stays at\n * the top and only the navigation (`items`, then `sections`) scrolls between them, expanded and\n * collapsed. In the phone panel the account stays at the bottom the same way. The DOM order, and so the Tab\n * order, is the same as without it. Off by default: the whole sidebar scrolls as one, as before.\n */\n isFooterPinned?: boolean;\n /** Icons only (56px), labels in tooltips. Controlled; or `defaultCollapsed` + `onCollapsedChange`. */\n isCollapsed?: boolean;\n defaultCollapsed?: boolean;\n onCollapsedChange?: (isCollapsed: boolean) => void;\n /**\n * Remembers the collapsed choice in localStorage under this key. Render `sidebarScript(storageKey,\n * { defaultCollapsed })` in <head> as well, with the same `defaultCollapsed`, so the first frame already\n * has the remembered width (no layout jump). Uncontrolled only: with `isCollapsed` the app owns the state.\n */\n storageKey?: string;\n /** Under 1024px the sidebar is a menu panel from the start edge; the app's menu button opens it. */\n isMobileOpen?: boolean;\n onMobileOpenChange?: (isOpen: boolean) => void;\n /** Names the navigation landmark; \"Main menu\" by default. */\n \"aria-label\"?: string;\n};\n\nfunction readStored(storageKey: string): boolean | undefined {\n try {\n const value = window.localStorage.getItem(storageKey);\n return value === \"collapsed\" ? true : value === \"expanded\" ? false : undefined;\n } catch {\n return undefined;\n }\n}\n\nfunction writeStored(storageKey: string, collapsed: boolean) {\n try {\n window.localStorage.setItem(storageKey, collapsed ? \"collapsed\" : \"expanded\");\n } catch {\n // Storage can be full or blocked: the choice lasts for this page only.\n }\n}\n\n/**\n * Collapsed styling has two sources so the first frame is right in both modes: the sidebar's own\n * `data-collapsed`, or (remembered choice) the <html> attribute the head script set before React ran.\n * Classes are written out in full so Tailwind finds them.\n */\nconst WHEN_COLLAPSED = {\n root: \"data-[collapsed]:w-14 [:root[data-ds-sidebar=collapsed]_&]:w-14\",\n label:\n \"group-data-[collapsed]/sidebar:sr-only [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:sr-only\",\n hidden:\n \"group-data-[collapsed]/sidebar:hidden [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:hidden\",\n /** Shown only collapsed (the section separator). */\n shown:\n \"hidden group-data-[collapsed]/sidebar:block [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:block\",\n badge:\n \"group-data-[collapsed]/sidebar:absolute group-data-[collapsed]/sidebar:-top-1 group-data-[collapsed]/sidebar:end-0 \" +\n \"[:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:absolute [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:-top-1 [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:end-0\",\n /**\n * The account in the 56px rail: exactly the 32px avatar, no padding around it, centred. The 8px\n * padding it kept before cut the avatar in half.\n */\n clip:\n \"group-data-[collapsed]/sidebar:w-8 group-data-[collapsed]/sidebar:flex-none group-data-[collapsed]/sidebar:justify-start group-data-[collapsed]/sidebar:overflow-hidden group-data-[collapsed]/sidebar:p-0 \" +\n \"[:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:w-8 [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:flex-none [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:justify-start [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:overflow-hidden [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:p-0\",\n /** With a `logo` or `avatar`: only that mark is left, so the 32px box centres it. */\n centre:\n \"group-data-[collapsed]/sidebar:justify-center [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:justify-center\",\n} as const;\n\n/**\n * The scrollbar on the sidebar's link list, as on ScrollArea: thin, no track, its thumb shown\n * only on hover, keyboard focus inside the list, or while scrolling. A long list no longer shows a grey bar the full\n * height of the panel. Native underneath, so wheel, touch and keyboard scroll as before.\n */\nconst SCROLLBAR =\n \"[scrollbar-width:thin] [scrollbar-color:transparent_transparent] \" +\n \"hover:[scrollbar-color:color-mix(in_oklab,var(--ds-border-bold)_70%,transparent)_transparent] \" +\n \"focus-within:[scrollbar-color:color-mix(in_oklab,var(--ds-border-bold)_70%,transparent)_transparent]\";\n\n/**\n * The bottom block: a two-column grid, so the account and the collapse toggle share one row (the\n * account takes the room, the toggle sits at its end) A divider sets\n * the account row off from the links. Collapsed, the rail is one column: the account above the toggle, both centred.\n * The children and their order are unchanged.\n */\nconst BOTTOM =\n // No column gap: the divider over the account and the toggle reads as one line.\n \"grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-0 gap-y-ds-100 \" +\n \"group-data-[collapsed]/sidebar:grid-cols-1 group-data-[collapsed]/sidebar:justify-items-center \" +\n \"[:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:grid-cols-1 [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:justify-items-center\";\n/** The account: the room of the row. Square, so the divider over it ends straight; its Pressable keeps its own radius. */\nconst FOOTER = \"flex min-w-0 items-center gap-ds-100 p-ds-050\";\n/** The divider runs the full width of the account row: over the account and the toggle alike. */\nconst FOOTER_RULE = \"border-t border-ds-border pt-ds-150\";\n\n/**\n * `isFooterPinned`: the scrolling part between the brand and the pinned bottom. It reaches out over\n * the sidebar's padding (and takes it back inside), so the scrollbar sits on the sidebar's edge; its scroll padding\n * matches that inset, so a row that focus scrolls into view stops short of the edge and its ring is never clipped. Collapsed, the 56px rail has no room for a scrollbar beside the icons,\n * so it is hidden there (wheel, touch and focus still scroll). Written out in full so Tailwind finds them.\n */\nconst PINNED = {\n scroll:\n \"-mx-ds-150 -my-ds-050 flex min-h-0 flex-1 flex-col gap-ds-200 overflow-x-hidden overflow-y-auto overscroll-contain px-ds-150 py-ds-050 scroll-py-ds-050 \" + SCROLLBAR + \" \" +\n \"group-data-[collapsed]/sidebar:[scrollbar-width:none] [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:[scrollbar-width:none]\",\n /** The phone panel: its content box has 16px padding; the list scrolls, the account stays below it. */\n panelScroll: \"-mx-ds-200 -my-ds-050 flex min-h-0 flex-1 flex-col gap-ds-200 overflow-y-auto overscroll-contain px-ds-200 py-ds-050 scroll-py-ds-050 \" + SCROLLBAR,\n} as const;\n\n/** The overline over a labelled section. */\nconst OVERLINE = \"px-ds-100 pt-ds-100 pb-ds-050 text-heading-xxsmall text-ds-text-subtlest\";\n\nconst ROW =\n \"relative flex h-8 w-full items-center gap-ds-100 rounded-ds-medium px-ds-100 text-body font-medium text-ds-text-subtle outline-hidden \" +\n \"transition-colors duration-(--ds-duration-fast) motion-reduce:transition-none \" +\n \"data-[hovered]:bg-ds-background-neutral-subtle-hovered data-[hovered]:text-ds-text data-[pressed]:bg-ds-background-neutral-pressed \" +\n \"data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused \" +\n // The page in view: a soft neutral fill and the full text color, no edge marker (a 2px inset bent into a bracket on\n // the rounded row). One step darker than the sunken sidebar ground, which equals ds-background-neutral.\n \"aria-[current=page]:bg-ds-background-neutral-hovered aria-[current=page]:text-ds-text aria-[current=page]:data-[hovered]:bg-ds-background-neutral-hovered \" +\n // Collapsed: the icon alone, centred in the 56px rail.\n \"group-data-[collapsed]/sidebar:justify-center [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:justify-center\";\n\nconst ICON = \"text-ds-icon-subtle group-aria-[current=page]/row:text-ds-icon-brand\";\n\nconst contains = (item: SidebarItemData, key: string | undefined): boolean =>\n !!key && (item.id === key || !!item.children?.some((child) => contains(child, key)));\n\ntype Shared = { currentKey?: string; collapsed: boolean; expand: () => void };\n\n/** Every item id in the trees, depth first, repeats included. */\nfunction itemIds(items: readonly SidebarItemData[], into: string[] = []): string[] {\n for (const item of items) {\n into.push(item.id);\n if (item.children) itemIds(item.children, into);\n }\n return into;\n}\n\n/**\n * Item ids that repeat across `items` and `sections`, said once per set of ids, in development only\n * (the Table's repeated-id warning does the same). A repeated id would mark two items `aria-current=\"page\"`.\n *\n */\nfunction repeatedIds(items: readonly SidebarItemData[], sections: readonly SidebarSectionData[] | undefined) {\n const ids = itemIds(items);\n for (const section of sections ?? []) itemIds(section.items, ids);\n const seen = new Set<string>();\n const repeated = new Set<string>();\n for (const id of ids) (seen.has(id) ? repeated : seen).add(id);\n return [...repeated].map((id) => JSON.stringify(id)).join(\", \");\n}\n\nfunction useRepeatedIdWarning(items: readonly SidebarItemData[], sections: readonly SidebarSectionData[] | undefined) {\n // Production never warns, so it never walks the trees either; the hooks below still run in order.\n const signature = process.env.NODE_ENV === \"production\" ? \"\" : repeatedIds(items, sections);\n const warned = React.useRef<Set<string> | null>(null);\n React.useEffect(() => {\n if (process.env.NODE_ENV === \"production\" || !signature) return;\n warned.current ??= new Set();\n if (warned.current.has(signature)) return;\n warned.current.add(signature);\n console.warn(`Sidebar: the item ids ${signature} repeat across items and sections. Give every item its own id; currentKey marks each item with that id as the current page.`);\n }, [signature]);\n}\n\n/**\n * The main navigation of admin apps: brand, sections with nested items, optional\n * labelled `sections` and the account. Collapses to 56px icons\n * (tooltips carry the labels); under 1024px it is a menu panel from the start edge.\n */\nfunction SidebarBody({\n brand: brandProp,\n logo: logoProp,\n brandHref = \"/\",\n items,\n children,\n sections,\n currentKey,\n footer: footerProp,\n avatar: avatarProp,\n isFooterPinned = false,\n isCollapsed,\n defaultCollapsed = false,\n onCollapsedChange,\n storageKey,\n isMobileOpen = false,\n onMobileOpenChange,\n \"aria-label\": label,\n}: SidebarProps) {\n const { locale, direction } = useLocale();\n const slots = splitSlots(children);\n const { nav } = slots;\n const brand = brandProp ?? slots.header;\n const logo = logoProp ?? slots.logo;\n const footer = footerProp ?? slots.footer;\n const avatar = avatarProp ?? slots.avatar;\n const hasBrand = brand != null || logo != null;\n const hasFooter = footer != null || avatar != null;\n const name = label ?? mainNavigationLabel(locale);\n const [own, setOwn] = React.useState(defaultCollapsed);\n // The remembered choice is read after hydration (the head script already painted it).\n React.useLayoutEffect(() => {\n if (!storageKey) return;\n const stored = readStored(storageKey);\n if (stored !== undefined) setOwn(stored);\n }, [storageKey]);\n const collapsed = isCollapsed ?? own;\n React.useLayoutEffect(() => {\n if (storageKey) document.documentElement.setAttribute(ROOT_ATTRIBUTE, collapsed ? \"collapsed\" : \"expanded\");\n }, [storageKey, collapsed]);\n const setCollapsed = (next: boolean) => {\n if (isCollapsed === undefined) setOwn(next);\n if (storageKey) writeStored(storageKey, next);\n onCollapsedChange?.(next);\n };\n const toggleLabel = collapsed ? expandSidebarLabel(locale) : collapseSidebarLabel(locale);\n const shared: Shared = { currentKey, collapsed, expand: () => setCollapsed(false) };\n const labelled = sections && sections.length > 0 ? sections : undefined;\n useRepeatedIdWarning(items ?? [], labelled);\n\n return (\n <>\n <nav\n aria-label={name}\n data-slot=\"sidebar\"\n // Remembered choice: the <html> attribute styles it, so the server and first client render agree.\n data-collapsed={!storageKey && collapsed ? \"\" : undefined}\n className={cn(\n \"group/sidebar sticky top-0 hidden h-dvh max-h-full w-60 shrink-0 flex-col gap-ds-200 overflow-x-hidden overflow-y-auto border-e border-ds-border bg-ds-surface-sunken px-ds-150 py-ds-200 lg:flex\",\n \"transition-[width] duration-(--ds-duration-medium) ease-ds-standard motion-reduce:transition-none\",\n WHEN_COLLAPSED.root,\n // Pinned: the nav no longer scrolls as one; its middle part does.\n isFooterPinned ? \"overflow-y-hidden\" : SCROLLBAR,\n )}\n data-footer-pinned={isFooterPinned ? \"\" : undefined}\n >\n {hasBrand && <Brand brand={brand} logo={logo} href={brandHref} />}\n {isFooterPinned ? (\n <div data-slot=\"sidebar-scroll\" className={PINNED.scroll}>\n <Navigation items={items} nodes={nav} sections={labelled} shared={shared} />\n </div>\n ) : (\n <Navigation items={items} nodes={nav} sections={labelled} shared={shared} />\n )}\n <div className={cn(BOTTOM, isFooterPinned ? \"shrink-0\" : \"mt-auto\")}>\n {hasFooter && (\n <SharedContext.Provider value={shared}>\n <Account footer={footer} avatar={avatar} className={cn(FOOTER_RULE, WHEN_COLLAPSED.clip, avatar != null && WHEN_COLLAPSED.centre)} />\n </SharedContext.Provider>\n )}\n <div\n data-slot=\"sidebar-toggle\"\n className={cn(\n \"flex justify-end group-data-[collapsed]/sidebar:justify-center [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:justify-center\",\n // Beside the account, under the same divider; alone, it keeps the row's end.\n hasFooter ? cn(FOOTER_RULE, \"self-stretch items-center ps-ds-050 group-data-[collapsed]/sidebar:border-t-0 group-data-[collapsed]/sidebar:pt-0 [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:border-t-0 [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:pt-0\") : \"col-span-full\",\n )}\n >\n <Tooltip content={toggleLabel} placement=\"end\">\n <Button\n variant=\"subtle\"\n size=\"small\"\n iconOnly\n // The panel edge is the inline start: left in LTR, right in RTL.\n iconBefore={\n direction === \"rtl\"\n ? collapsed ? \"panel-right-open\" : \"panel-right-close\"\n : collapsed ? \"panel-left-open\" : \"panel-left-close\"\n }\n aria-label={toggleLabel}\n aria-expanded={!collapsed}\n onPress={() => setCollapsed(!collapsed)}\n />\n </Tooltip>\n </div>\n </div>\n </nav>\n <NavPanel\n isOpen={isMobileOpen}\n onOpenChange={(open) => onMobileOpenChange?.(open)}\n label={name}\n side=\"start\"\n slot=\"sidebar\"\n header={hasBrand ? <Brand brand={brand} logo={logo} href={brandHref} /> : undefined}\n >\n {/* The dialog already carries the name; a second landmark name would be read twice. */}\n {isFooterPinned ? (\n // Pinned: the list scrolls inside the panel and the account stays at its bottom edge.\n <nav className=\"flex min-h-0 flex-1 flex-col gap-ds-200\" data-footer-pinned=\"\">\n <div data-slot=\"sidebar-scroll\" className={PINNED.panelScroll}>\n <Navigation items={items} nodes={nav} sections={labelled} shared={{ ...shared, collapsed: false }} />\n </div>\n {hasFooter && <Account footer={footer} avatar={avatar} className={cn(FOOTER_RULE, \"shrink-0\")} />}\n </nav>\n ) : (\n <nav className=\"flex flex-1 flex-col gap-ds-200\">\n <Navigation items={items} nodes={nav} sections={labelled} shared={{ ...shared, collapsed: false }} />\n {hasFooter && <Account footer={footer} avatar={avatar} className={cn(FOOTER_RULE, \"mt-auto\")} />}\n </nav>\n )}\n </NavPanel>\n </>\n );\n}\n\n/**\n * The brand link. With a `logo`, the name is a separate span that collapses to visually hidden, so the rail\n * shows the logo alone and the link keeps the name. Without one, the content is kept as given and the 32px box\n * shows its start.\n */\nfunction Brand({ brand, logo, href }: { brand: React.ReactNode; logo: React.ReactNode; href: string }) {\n return (\n <AriaLink\n href={href}\n data-slot=\"sidebar-brand\"\n className={cn(\n \"flex min-w-0 shrink-0 items-center gap-ds-100 rounded-ds-medium px-ds-100 text-body-strong text-ds-text outline-hidden data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused\",\n WHEN_COLLAPSED.clip,\n logo != null && WHEN_COLLAPSED.centre,\n )}\n >\n {logo == null ? (\n brand\n ) : (\n <>\n <span data-slot=\"sidebar-brand-logo\" className=\"flex shrink-0 items-center\">{logo}</span>\n {brand != null && <span data-slot=\"sidebar-brand-name\" className={cn(\"min-w-0 truncate\", WHEN_COLLAPSED.label)}>{brand}</span>}\n </>\n )}\n </AriaLink>\n );\n}\n\n/**\n * The account block. With an `avatar`, the rest of the account is hidden collapsed (it may hold controls, so\n * not merely visually hidden) and the rail shows the Avatar alone.\n */\nfunction Account({ footer, avatar, className }: { footer: React.ReactNode; avatar: React.ReactNode; className?: string }) {\n return (\n <div data-slot=\"sidebar-footer\" className={cn(FOOTER, className)}>\n {avatar == null ? (\n footer\n ) : (\n <>\n <span data-slot=\"sidebar-footer-avatar\" className=\"flex shrink-0\">{avatar}</span>\n {footer != null && <div data-slot=\"sidebar-footer-content\" className={cn(\"flex min-w-0 flex-1 items-center gap-ds-100\", WHEN_COLLAPSED.hidden)}>{footer}</div>}\n </>\n )}\n </div>\n );\n}\n\n/**\n * The top list, then the labelled sections. One child in its parent either way, so without sections the tree\n * (and the server's useId ids) is exactly what it was before sections existed.\n */\nfunction Navigation({ items, nodes, sections, shared }: { items?: readonly SidebarItemData[]; nodes: React.ReactNode[]; sections?: readonly SidebarSectionData[]; shared: Shared }) {\n if (!items) return <ComposedNavigation nodes={nodes} shared={shared} />;\n if (!sections) return <Tree items={items} shared={shared} />;\n return (\n <>\n {/* With sections, an empty top list is left out; without them it renders (also empty), as before. */}\n {items.length > 0 && <Tree items={items} shared={shared} />}\n <Sections sections={sections} shared={shared} />\n </>\n );\n}\n\nfunction Sections({ sections, shared }: { sections: readonly SidebarSectionData[]; shared: Shared }) {\n return (\n <div data-slot=\"sidebar-sections\" className=\"flex flex-col gap-ds-100\">\n {sections.map((section) => (\n <Section key={section.id} section={section} shared={shared} />\n ))}\n </div>\n );\n}\n\n/** A labelled section: an overline that names the group, plus a separator that shows only collapsed. */\nfunction Section({ section, shared }: { section: SidebarSectionData; shared: Shared }) {\n return (\n <SectionBlock id={section.id} label={section.label}>\n <Tree items={section.items} shared={shared} />\n </SectionBlock>\n );\n}\n\nfunction SectionBlock({ id: sectionId, label, children }: { id?: string; label: string; children: React.ReactNode }) {\n const id = React.useId();\n return (\n <div role=\"group\" aria-labelledby={id} data-slot=\"sidebar-nav-section\" data-section={sectionId} className=\"flex flex-col gap-0.5\">\n <span aria-hidden=\"true\" data-slot=\"sidebar-nav-section-separator\" className={cn(\"mx-ds-050 mb-ds-100 border-t border-ds-border\", WHEN_COLLAPSED.shown)} />\n <span id={id} data-slot=\"sidebar-nav-section-label\" className={cn(OVERLINE, WHEN_COLLAPSED.label)}>\n {label}\n </span>\n {children}\n </div>\n );\n}\n\nfunction Tree({ items, shared, nested }: { items: readonly SidebarItemData[]; shared: Shared; nested?: boolean }) {\n return (\n <ul data-slot={nested ? \"sidebar-subtree\" : \"sidebar-tree\"} className=\"flex flex-col gap-0.5\">\n {items.map((item) => (\n <li key={item.id}>\n {item.children ? (\n <GroupItem item={item} shared={shared} holdsCurrent={contains(item, shared.currentKey)}>\n <Tree items={item.children} shared={shared} nested />\n </GroupItem>\n ) : (\n <LinkItem item={item} shared={shared} nested={nested} />\n )}\n </li>\n ))}\n </ul>\n );\n}\n\n/** What a row shows, from data or from a `SidebarItem`/`SidebarSubmenu`. */\ntype Entry = Pick<SidebarItemData, \"id\" | \"label\" | \"icon\" | \"href\" | \"badge\"> & { isCurrent?: boolean };\n\nfunction Label({ item }: { item: Entry }) {\n return (\n <>\n {item.icon && <IconGlyph name={item.icon} data-slot=\"sidebar-item-icon\" className={ICON} />}\n <span data-slot=\"sidebar-item-label\" className={cn(\"min-w-0 flex-1 truncate text-start\", WHEN_COLLAPSED.label)}>\n {item.label}\n </span>\n {item.badge && item.badge.value > 0 && (\n <span data-slot=\"sidebar-item-badge\" className={cn(\"ms-auto\", WHEN_COLLAPSED.badge)}>\n <Badge variant=\"count\" value={item.badge.value} tone={item.badge.tone} />\n </span>\n )}\n </>\n );\n}\n\nfunction LinkItem({ item, shared, nested }: { item: Entry; shared: Shared; nested?: boolean }) {\n const link = (\n <AriaLink\n href={item.href}\n data-slot=\"sidebar-item\"\n aria-current={item.isCurrent || item.id === shared.currentKey ? \"page\" : undefined}\n className={cn(\"group/row\", ROW)}\n >\n <Label item={item} />\n </AriaLink>\n );\n return shared.collapsed && !nested ? (\n <TooltipFor content={item.label} placement=\"end\">\n {link}\n </TooltipFor>\n ) : (\n link\n );\n}\n\nfunction GroupItem({ item, shared, holdsCurrent, children }: { item: Entry; shared: Shared; holdsCurrent: boolean; children: React.ReactNode }) {\n const [expanded, setExpanded] = React.useState(holdsCurrent);\n // The group of the page's item stays open as the page changes.\n const [wasHolding, setWasHolding] = React.useState(holdsCurrent);\n if (wasHolding !== holdsCurrent) {\n setWasHolding(holdsCurrent);\n if (holdsCurrent) setExpanded(true);\n }\n const trigger = (\n <AriaButton\n slot=\"trigger\"\n data-slot=\"sidebar-group-trigger\"\n // Collapsed, the group holding the page is the only mark of where the reader is.\n data-current={holdsCurrent ? \"\" : undefined}\n // Collapsed, a group's icon opens the sidebar on that group.\n onPress={shared.collapsed ? shared.expand : undefined}\n className={cn(\n \"group/row\",\n ROW,\n \"group-data-[collapsed]/sidebar:data-[current]:bg-ds-background-neutral-hovered [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:data-[current]:bg-ds-background-neutral-hovered\",\n )}\n >\n <Label item={item} />\n <IconGlyph\n name=\"chevron-down\"\n size=\"small\"\n data-slot=\"sidebar-group-chevron\"\n className={cn(\"text-ds-icon-subtle transition-transform duration-(--ds-duration-fast) group-aria-expanded/row:rotate-180 motion-reduce:transition-none\", WHEN_COLLAPSED.hidden)}\n />\n </AriaButton>\n );\n return (\n <Disclosure\n // Collapsed, the panel is hidden, so it reports closed; pressing it opens the sidebar on the group.\n isExpanded={!shared.collapsed && expanded}\n onExpandedChange={(next) => setExpanded(shared.collapsed ? true : next)}\n data-slot=\"sidebar-group\"\n >\n {shared.collapsed ? (\n <TooltipFor content={item.label} placement=\"end\">\n {trigger}\n </TooltipFor>\n ) : (\n trigger\n )}\n <DisclosurePanel data-slot=\"sidebar-group-panel\" className={WHEN_COLLAPSED.hidden}>\n <div className=\"mt-0.5 ps-ds-400\">{children}</div>\n </DisclosurePanel>\n </Disclosure>\n );\n}\n\n\n// ---- Composed from parts ---------------------------------------------------------------------------------------\n\n/** The sidebar's state for its parts: the page's item, collapsed or not (never collapsed in the phone panel). */\nconst SharedContext = React.createContext<Shared | null>(null);\n/** True inside a `SidebarSubmenu`: its items are indented rows with no tooltip of their own. */\nconst NestedContext = React.createContext(false);\n\nfunction useShared(part: string): Shared {\n const shared = React.useContext(SharedContext);\n if (!shared) throw new Error(`${part} must be inside a Sidebar.`);\n return shared;\n}\n\nexport type SidebarHeaderProps = {\n /** The product name (or the logo and name together); it links to the Sidebar's `brandHref`. */\n children?: React.ReactNode;\n /** The app's mark before the name; collapsed, the rail shows it alone. As the Sidebar's `logo`. */\n logo?: React.ReactNode;\n};\n\n/**\n * The account row's trigger: the nav row's hover, press, focus and radius, so it reads as one of them. Expanded it is\n * the avatar with the name over a second line; collapsed it is a 32px square, exactly a collapsed nav item, with the\n * 24px avatar centred where an icon sits.\n */\nconst ACCOUNT_TRIGGER =\n \"relative flex min-h-8 w-full cursor-pointer items-center gap-ds-100 rounded-ds-medium px-ds-100 py-ds-050 text-start outline-hidden \" +\n \"transition-colors duration-(--ds-duration-fast) motion-reduce:transition-none \" +\n \"data-[hovered]:bg-ds-background-neutral-subtle-hovered data-[pressed]:bg-ds-background-neutral-pressed \" +\n \"aria-expanded:bg-ds-background-neutral-hovered \" +\n \"data-[focus-visible]:inset-ring-2 data-[focus-visible]:inset-ring-ds-border-focused \" +\n \"group-data-[collapsed]/sidebar:size-8 group-data-[collapsed]/sidebar:min-h-0 group-data-[collapsed]/sidebar:justify-center group-data-[collapsed]/sidebar:p-0 \" +\n \"[:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:size-8 [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:min-h-0 [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:justify-center [:root[data-ds-sidebar=collapsed]_[data-slot=sidebar]_&]:p-0\";\n\nexport type SidebarAccountProps = {\n /** The person's name: the row's first line, the trigger's name and, collapsed, its tooltip. */\n name: string;\n /** The second line: an email or a role. */\n description?: string;\n /** A photo; the name's initials otherwise. */\n avatarSrc?: string;\n /** The account menu: profile, settings, sign out (a `danger` item goes last). */\n items: readonly MenuEntry[];\n onAction?: (id: React.Key) => void;\n};\n\n/**\n * The signed-in person at the bottom of the sidebar, as the `footer` (or in a `SidebarFooter`): a row that opens the\n * account menu. Collapsed it stays reachable as a square the size of a nav icon, its avatar centred, with the name\n * as its tooltip, so sign-out is never hidden behind expanding the sidebar.\n */\nexport function SidebarAccount({ name, description, avatarSrc, items, onAction }: SidebarAccountProps) {\n // In the footer, outside the navigation's context; the phone panel never collapses.\n const collapsed = React.useContext(SharedContext)?.collapsed ?? false;\n const trigger = (\n <AriaButton data-slot=\"sidebar-account\" aria-label={name} className={ACCOUNT_TRIGGER}>\n {/* The button is named by the person alone; the avatar's own name would say it twice. */}\n <span aria-hidden className=\"flex shrink-0\">\n <Avatar name={name} src={avatarSrc} size=\"small\" />\n </span>\n <span data-slot=\"sidebar-account-text\" className={cn(\"flex min-w-0 flex-1 flex-col\", WHEN_COLLAPSED.label)}>\n <span className=\"truncate text-body font-medium text-ds-text\">{name}</span>\n {description && <span className=\"truncate text-body-small text-ds-text-subtle\">{description}</span>}\n </span>\n <IconGlyph name=\"chevrons-up-down\" size=\"small\" className={cn(\"shrink-0 text-ds-icon-subtle\", WHEN_COLLAPSED.hidden)} />\n </AriaButton>\n );\n return (\n <Menu\n trigger={collapsed ? <TooltipFor content={name} placement=\"end\">{trigger}</TooltipFor> : trigger}\n items={items}\n onAction={onAction && ((id) => onAction(id))}\n placement={collapsed ? \"end bottom\" : \"top start\"}\n />\n );\n}\n\n/** The brand at the top, as a child instead of the `brand` prop. */\nexport function SidebarHeader({ children }: SidebarHeaderProps) {\n return <>{children}</>;\n}\n\nexport type SidebarFooterProps = {\n /** The account's name and role (or Avatar, name and role together). */\n children?: React.ReactNode;\n /** The account's Avatar before the rest; collapsed, the rail shows it alone. As the Sidebar's `avatar`. */\n avatar?: React.ReactNode;\n};\n\n/** The account at the bottom, as a child instead of the `footer` prop; it shares a row with the collapse toggle. */\nexport function SidebarFooter({ children }: SidebarFooterProps) {\n return <>{children}</>;\n}\n\nexport type SidebarItemProps = {\n /** Unique in the sidebar; `currentKey` matches it. */\n id: string;\n /** A noun for the page (\"Orders\"); also the tooltip when the sidebar is collapsed. */\n label: string;\n /** Lucide name; top-level items carry one (it is all a collapsed sidebar shows). */\n icon?: IconName;\n href?: string;\n /** A count (\"4 new\"): a Badge after the label, on the icon when collapsed. */\n badge?: { value: number; tone?: BadgeCountTone };\n /** Marks this item as the page in view, instead of the Sidebar's `currentKey`. */\n isCurrent?: boolean;\n};\n\n/** One link in the navigation: at the top, in a `SidebarSection`, or nested in a `SidebarSubmenu`. */\nexport function SidebarItem(props: SidebarItemProps) {\n const shared = useShared(\"SidebarItem\");\n const nested = React.useContext(NestedContext);\n return (\n <li>\n <LinkItem item={props} shared={shared} nested={nested} />\n </li>\n );\n}\n\nexport type SidebarSubmenuProps = Omit<SidebarItemProps, \"href\" | \"isCurrent\"> & {\n /** The nested `SidebarItem`s, shown indented when it is open. */\n children: React.ReactNode;\n};\n\n/** An item that opens to nested items. It starts open, and stays open, while it holds the page in view. */\nexport function SidebarSubmenu({ children, ...item }: SidebarSubmenuProps) {\n const shared = useShared(\"SidebarSubmenu\");\n return (\n <li>\n <GroupItem item={item} shared={shared} holdsCurrent={holdsKey(children, shared.currentKey)}>\n <NestedContext.Provider value={true}>\n <ul data-slot=\"sidebar-subtree\" className=\"flex flex-col gap-0.5\">\n {children}\n </ul>\n </NestedContext.Provider>\n </GroupItem>\n </li>\n );\n}\n\nexport type SidebarSectionProps = {\n /** Also on the DOM as `data-section`. */\n id?: string;\n /** The overline over the items, already translated; it names the group, also when collapsed. */\n label: string;\n /** `SidebarItem`s and `SidebarSubmenu`s. */\n children: React.ReactNode;\n};\n\n/** A labelled block of items with an overline; collapsed, a thin separator stands in for the overline. */\nexport function SidebarSection({ id, label, children }: SidebarSectionProps) {\n useShared(\"SidebarSection\");\n return (\n <SectionBlock id={id} label={label}>\n <ul data-slot=\"sidebar-tree\" className=\"flex flex-col gap-0.5\">\n {children}\n </ul>\n </SectionBlock>\n );\n}\n\n/** Whether an item among these elements (at any depth) is the page in view. */\nfunction holdsKey(children: React.ReactNode, key: string | undefined): boolean {\n return React.Children.toArray(children).some((child) => {\n if (!React.isValidElement<{ id?: string; isCurrent?: boolean; children?: React.ReactNode }>(child)) return false;\n return (!!key && child.props.id === key) || !!child.props.isCurrent || holdsKey(child.props.children, key);\n });\n}\n\n/** Pulls the `SidebarHeader` and `SidebarFooter` out of the children; the rest is the navigation. */\nfunction splitSlots(children: React.ReactNode) {\n let header: React.ReactNode;\n let logo: React.ReactNode;\n let footer: React.ReactNode;\n let avatar: React.ReactNode;\n const nav: React.ReactNode[] = [];\n for (const child of React.Children.toArray(children)) {\n if (React.isValidElement<SidebarHeaderProps>(child) && child.type === SidebarHeader) {\n header = child.props.children;\n logo = child.props.logo;\n } else if (React.isValidElement<SidebarFooterProps>(child) && child.type === SidebarFooter) {\n footer = child.props.children;\n avatar = child.props.avatar;\n } else nav.push(child);\n }\n return { header, logo, footer, avatar, nav };\n}\n\n/** The composed navigation: loose items in one list, then the sections, as with `items` and `sections`. */\nfunction ComposedNavigation({ nodes, shared }: { nodes: React.ReactNode[]; shared: Shared }) {\n const isSection = (node: React.ReactNode) => React.isValidElement(node) && node.type === SidebarSection;\n const loose = nodes.filter((node) => !isSection(node));\n const sections = nodes.filter(isSection);\n return (\n <SharedContext.Provider value={shared}>\n {loose.length > 0 && (\n <ul data-slot=\"sidebar-tree\" className=\"flex flex-col gap-0.5\">\n {loose}\n </ul>\n )}\n {sections.length > 0 && (\n <div data-slot=\"sidebar-sections\" className=\"flex flex-col gap-ds-100\">\n {sections}\n </div>\n )}\n </SharedContext.Provider>\n );\n}\n\n/** Sidebar with its own `motion` (auto, reduce or none); see SidebarBody for the component itself. */\nexport function Sidebar({ motion, ...props }: SidebarProps & WithMotion) {\n return (\n <MotionScope motion={motion}>\n <SidebarBody {...(props as SidebarProps)} />\n </MotionScope>\n );\n}\n"]}
@@ -76,7 +76,10 @@ export function TooltipFor({ content, children, placement = "top", shortcut, ope
76
76
  return (_jsxs(TooltipTrigger, { delay: 300, closeDelay: 0, children: [children, _jsx(TooltipBubble, { content: content, placement: placement, shortcut: shortcut })] }));
77
77
  }
78
78
  const TooltipBubble = React.forwardRef(function TooltipBubble({ content, placement, shortcut }, ref) {
79
- return (_jsxs(AriaTooltip, { ...useMotionAttribute(), ref: ref, "data-slot": "tooltip", placement: placement, offset: 6, className: cn("flex max-w-60 items-center gap-ds-075 rounded-ds-small bg-ds-background-neutral-bold px-ds-100 py-ds-050 text-body-small text-ds-text-inverse", "transition-opacity duration-(--ds-duration-fast) data-[entering]:opacity-0 data-[exiting]:opacity-0 motion-reduce:transition-none"), children: [_jsx("span", { "data-slot": "tooltip-content", children: content }), shortcut && (_jsx("span", { "data-slot": "tooltip-shortcut", className: "flex", children: _jsx(Kbd, { children: shortcut }) }))] }));
79
+ return (_jsxs(AriaTooltip, { ...useMotionAttribute(), ref: ref, "data-slot": "tooltip", placement: placement, offset: 6, className: cn("flex max-w-60 items-center gap-ds-075 rounded-ds-small bg-ds-background-neutral-bold px-ds-100 py-ds-050 text-body-small text-ds-text-inverse",
80
+ // A shortcut's keycaps take the bubble's colours (a clear cap with a faint edge), not the page's surface,
81
+ // which read as a loud white chip in the dark bubble.
82
+ "[&_[data-slot=kbd]]:border-current/30 [&_[data-slot=kbd]]:bg-transparent [&_[data-slot=kbd]]:text-ds-text-inverse", "transition-opacity duration-(--ds-duration-fast) data-[entering]:opacity-0 data-[exiting]:opacity-0 motion-reduce:transition-none"), children: [_jsx("span", { "data-slot": "tooltip-content", children: content }), shortcut && (_jsx("span", { "data-slot": "tooltip-shortcut", className: "flex", children: _jsx(Kbd, { children: shortcut }) }))] }));
80
83
  });
81
84
  /**
82
85
  * `openOnTouch`. The tooltip is controlled: React Aria still opens it on hover and keyboard focus and
@@ -1 +1 @@
1
- {"version":3,"file":"floating.js","sourceRoot":"","sources":["../../src/overlay/floating.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,UAAU,EAA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, DialogTrigger as AriaDialogTrigger, Focusable, Heading, Header, Keyboard, Menu as AriaMenu, MenuItem as AriaMenuItem, MenuSection as AriaMenuSection, MenuTrigger, OverlayArrow, Popover as AriaPopover, Separator, SubmenuTrigger, Tooltip as AriaTooltip, TooltipTrigger, type Key, type Placement, type Selection } from \"react-aria-components\";\nimport { cn } from \"../utils\";\nimport { MotionScope, type WithMotion, useMotionAttribute } from \"../defaults\";\nimport { Button, CloseButton, Fab, Link, ToggleButton } from \"../action/index\";\nimport { IconGlyph, type IconName } from \"../display/icon\";\nimport { Kbd } from \"../display/kbd\";\nimport { OverlayContents } from \"./overlay-base\";\n\n/**\n * One floating surface for Popover and Menu: `ds-surface-overlay`, `ds-shadow-overlay`, `ds-radius-large`,\n * anchored to its trigger by React Aria (flips and shifts at the viewport edge, mirrors in RTL). React Aria\n * caps its height to the space left on screen; the panel's content scrolls inside (SCROLL) instead of running\n * off it. The surface itself does not clip, or it would hide the arrow React Aria places outside it.\n */\nexport const SURFACE =\n \"flex flex-col rounded-ds-large [--ds-surface-radius:var(--ds-radius-large)] bg-ds-surface-overlay text-ds-text shadow-ds-overlay outline-hidden \" +\n \"transition-[opacity,translate] duration-(--ds-duration-medium) ease-ds-enter data-[exiting]:ease-ds-exit motion-reduce:transition-none \" +\n \"data-[entering]:opacity-0 data-[exiting]:opacity-0 \" +\n \"data-[placement=bottom]:data-[entering]:-translate-y-1 data-[placement=top]:data-[entering]:translate-y-1\";\n\n/** The scrolling inside a floating surface: as tall as React Aria lets the surface be, no taller. */\nexport const SCROLL = \"min-h-0 max-h-[inherit] overflow-auto\";\n\n/** The 12px arrow pointing at the trigger, turned to whichever side the panel opened on. */\nfunction Arrow() {\n return (\n <OverlayArrow data-slot=\"popover-arrow\" className=\"group\">\n <svg width={12} height={12} viewBox=\"0 0 12 12\" aria-hidden className=\"block fill-ds-surface-overlay group-data-[placement=bottom]:rotate-180 group-data-[placement=left]:-rotate-90 group-data-[placement=right]:rotate-90\">\n <path d=\"M0 0 L6 6 L12 0\" />\n </svg>\n </OverlayArrow>\n );\n}\n\nexport type PopoverProps = {\n /** The pressable that opens it (a DS Button: \"Filtre\"). */\n trigger: React.ReactElement;\n children: React.ReactNode;\n /** \"bottom start\" by default; React Aria flips it when there is no room. */\n placement?: Placement;\n isOpen?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (isOpen: boolean) => void;\n /** A heading that also names the panel (\"Filters\"); without it, give `aria-label`. */\n title?: React.ReactNode;\n \"aria-label\"?: string;\n};\n\n/**\n * A small non-modal panel anchored to its trigger: filters, a quick edit, extra details. 240–360px wide,\n * with an arrow to the trigger. Esc and an outside click close it; focus moves in on open and back to the\n * trigger on close. One small task; more than about four fields belongs in a Drawer.\n */\nfunction PopoverBody({ trigger, children, placement = \"bottom start\", isOpen, defaultOpen, onOpenChange, title, \"aria-label\": ariaLabel }: PopoverProps) {\n return (\n <AriaDialogTrigger isOpen={isOpen} defaultOpen={defaultOpen} onOpenChange={onOpenChange}>\n {trigger}\n <AriaPopover {...useMotionAttribute()} data-slot=\"popover\" placement={placement} offset={10} className={cn(SURFACE, \"min-w-60 max-w-90\")}>\n <Arrow />\n <AriaDialog aria-label={title ? undefined : ariaLabel} data-slot=\"popover-dialog\" className={cn(SCROLL, \"flex flex-col gap-ds-150 p-ds-200 outline-hidden\")}>\n <OverlayContents>\n {title && <Heading slot=\"title\" data-slot=\"popover-title\" className=\"m-0 text-heading-xsmall\">{title}</Heading>}\n {children}\n </OverlayContents>\n </AriaDialog>\n </AriaPopover>\n </AriaDialogTrigger>\n );\n}\n\nexport type TooltipProps = {\n /** Plain text only: the same words as the control's `aria-label`, or a truncated value in full. */\n content: string;\n /** The trigger. It must be focusable; a non-interactive element (a truncated lozenge) is made focusable. */\n children: React.ReactElement;\n placement?: Placement;\n /** A keyboard shortcut shown as a chip (\"F\"). */\n shortcut?: string;\n /**\n * Readable on touch screens: a tap on the trigger opens the tooltip and a second tap closes it;\n * a tap anywhere else, or Esc, closes it. Mouse hover and keyboard focus work exactly as without it. For a\n * trigger that does nothing on its own (a country flag, a truncated value); on a button the tap still presses it.\n */\n openOnTouch?: boolean;\n};\n\n/** DS controls built on React Aria: they take a tooltip as they are. */\nconst ARIA_TRIGGERS = new Set<unknown>([Button, CloseButton, ToggleButton, Link, Fab]);\n\n/**\n * The tooltip's trigger. A DS button or link is used as it is. A plain element gets a tab stop (keeping one it\n * already has). Any other component (a Badge, a truncated value) is wrapped in a focusable span, since React\n * Aria can only attach to an element it can reach; the wrapper takes no tab stop of its own when what it holds\n * is already focusable (a raw React Aria button), so keyboard users still meet one stop. For a Menu or a\n * Popover, put the Tooltip on its trigger button, not around the whole component.\n */\nfunction TooltipTarget({ children }: { children: React.ReactElement }) {\n const wrapper = React.useRef<HTMLSpanElement>(null);\n const [holdsFocusable, setHoldsFocusable] = React.useState(false);\n React.useLayoutEffect(() => {\n setHoldsFocusable(!!wrapper.current?.querySelector(\"button, a[href], input, select, textarea, [tabindex]:not([tabindex='-1'])\"));\n });\n if (ARIA_TRIGGERS.has(children.type)) return children;\n type Focus = React.ComponentProps<typeof Focusable>[\"children\"];\n if (typeof children.type === \"string\") {\n const props = children.props as { tabIndex?: number };\n return <Focusable>{React.cloneElement(children as React.ReactElement<{ tabIndex?: number }>, { tabIndex: props.tabIndex ?? 0 }) as Focus}</Focusable>;\n }\n return (\n // React Aria gives a Focusable child tabIndex 0 unless it is excluded from the tab order.\n <Focusable excludeFromTabOrder={holdsFocusable}>\n <span\n ref={wrapper}\n tabIndex={holdsFocusable ? -1 : 0}\n data-slot=\"tooltip-target\"\n className=\"inline-flex rounded-ds-small outline-hidden focus-visible:inset-ring-2 focus-visible:inset-ring-ds-border-focused\"\n >\n {children}\n </span>\n </Focusable>\n );\n}\n\n/**\n * Names an icon-only control or shows a truncated value in full. Shows after 300ms of hover and at once on\n * keyboard focus; Esc hides it. The control keeps its own `aria-label` (the tooltip only describes it), and\n * touch users never see a tooltip, so it never holds anything needed to finish a task. With `openOnTouch` a tap\n * toggles it, for a value that a touch user should also be able to read. No provider needed.\n */\nfunction TooltipBody(props: TooltipProps) {\n return <TooltipFor {...props} children={<TooltipTarget>{props.children}</TooltipTarget>} />;\n}\n\n/**\n * Inside the design system only (not exported from the package): a tooltip on a child that is itself a\n * React Aria focusable (a `Link`, a `Button slot=\"trigger\"`), so it takes the trigger props directly.\n */\nexport function TooltipFor({ content, children, placement = \"top\", shortcut, openOnTouch }: TooltipProps) {\n if (openOnTouch) return <TouchTooltipFor content={content} placement={placement} shortcut={shortcut}>{children}</TouchTooltipFor>;\n return (\n <TooltipTrigger delay={300} closeDelay={0}>\n {children}\n <TooltipBubble content={content} placement={placement} shortcut={shortcut} />\n </TooltipTrigger>\n );\n}\n\nconst TooltipBubble = React.forwardRef<HTMLDivElement, Pick<TooltipProps, \"content\" | \"placement\" | \"shortcut\">>(function TooltipBubble(\n { content, placement, shortcut },\n ref,\n) {\n return (\n <AriaTooltip\n {...useMotionAttribute()}\n ref={ref}\n data-slot=\"tooltip\"\n placement={placement}\n offset={6}\n className={cn(\n \"flex max-w-60 items-center gap-ds-075 rounded-ds-small bg-ds-background-neutral-bold px-ds-100 py-ds-050 text-body-small text-ds-text-inverse\",\n \"transition-opacity duration-(--ds-duration-fast) data-[entering]:opacity-0 data-[exiting]:opacity-0 motion-reduce:transition-none\",\n )}\n >\n <span data-slot=\"tooltip-content\">{content}</span>\n {shortcut && (\n <span data-slot=\"tooltip-shortcut\" className=\"flex\">\n <Kbd>{shortcut}</Kbd>\n </span>\n )}\n </AriaTooltip>\n );\n});\n\n/**\n * `openOnTouch`. The tooltip is controlled: React Aria still opens it on hover and keyboard focus and\n * closes it on press, blur and Esc through `onOpenChange`. A touch tap is decided on pointerdown, from the state\n * the finger found (React Aria's own close-on-press runs in the same event), and applied on pointerup, so a tap\n * toggles it; a scroll that cancels the touch changes nothing. While it is open, a pointer down outside the trigger\n * and the bubble closes it. The trigger sits in a `display: contents` span, which adds no box to the layout.\n */\nfunction TouchTooltipFor({ content, children, placement, shortcut }: Omit<TooltipProps, \"openOnTouch\">) {\n const [isOpen, setOpen] = React.useState(false);\n const zone = React.useRef<HTMLSpanElement>(null);\n const bubble = React.useRef<HTMLDivElement>(null);\n const tap = React.useRef<boolean | null>(null);\n React.useEffect(() => {\n if (!isOpen) return;\n const outside = (event: PointerEvent) => {\n const target = event.target as Node | null;\n if (target && (zone.current?.contains(target) || bubble.current?.contains(target))) return;\n setOpen(false);\n };\n document.addEventListener(\"pointerdown\", outside, true);\n return () => document.removeEventListener(\"pointerdown\", outside, true);\n }, [isOpen]);\n return (\n <span\n ref={zone}\n data-slot=\"tooltip-touch\"\n className=\"contents\"\n onPointerDownCapture={(event) => {\n // React events bubble through the portal: a tap on the bubble is not a tap on the trigger.\n const onTrigger = zone.current?.contains(event.target as Node) ?? false;\n tap.current = event.pointerType === \"touch\" && onTrigger ? !isOpen : null;\n }}\n onPointerUp={(event) => {\n const next = tap.current;\n tap.current = null;\n if (event.pointerType === \"touch\" && next !== null) setOpen(next);\n }}\n onPointerCancel={() => {\n tap.current = null;\n }}\n >\n <TooltipTrigger delay={300} closeDelay={0} isOpen={isOpen} onOpenChange={setOpen}>\n {children}\n <TooltipBubble ref={bubble} content={content} placement={placement} shortcut={shortcut} />\n </TooltipTrigger>\n </span>\n );\n}\n\nexport type MenuItemDef = {\n id: Key;\n /** A verb (\"Edit\"); a disabled item says why (\"Send invoice (payment pending)\"). */\n label: string;\n icon?: IconName;\n /** Shown in mono at the end (\"E\"). */\n shortcut?: string;\n isDisabled?: boolean;\n /** `danger` for the destructive action; it is placed last, after a separator. */\n tone?: \"danger\";\n /** A submenu: opens on hover and on → (← in RTL). */\n children?: readonly MenuItemDef[];\n /** Makes the item a link (a language of the page, another page); it goes through the host router. */\n href?: string;\n /** The language of the label, when it differs from the page (\"English\" in a Turkish language list). */\n lang?: string;\n};\n\nexport type MenuSectionDef = {\n id: Key;\n /** \"Share\". */\n title: string;\n items: readonly MenuItemDef[];\n};\n\nexport type MenuEntry = MenuItemDef | MenuSectionDef;\n\nexport type MenuProps = {\n /** The pressable that opens it: the row \"…\" button, the account button. */\n trigger: React.ReactElement;\n /** Items, or sections of items with a title. Leave it out to compose the menu as children instead. */\n items?: readonly MenuEntry[];\n /**\n * With no `items`: `MenuItem`, `MenuSection`, `MenuSubmenu` and `MenuSeparator`, in the order given (put the\n * destructive item last yourself; with `items` the menu moves it there).\n */\n children?: React.ReactNode;\n onAction?: (id: Key) => void;\n disabledKeys?: Iterable<Key>;\n /** \"bottom end\" by default: under the trigger, aligned to its inline end, as row menus sit. */\n placement?: Placement;\n /** For menus that also hold a choice (a view option): checkmarks on the selected items. */\n selectionMode?: \"none\" | \"single\" | \"multiple\";\n selectedKeys?: Iterable<Key>;\n defaultSelectedKeys?: Iterable<Key>;\n onSelectionChange?: (keys: Selection) => void;\n isOpen?: boolean;\n onOpenChange?: (isOpen: boolean) => void;\n /** Names the menu when the trigger's own name is not enough. */\n \"aria-label\"?: string;\n};\n\nconst ITEM =\n \"group flex min-h-8 cursor-default items-center gap-ds-100 rounded-[max(var(--ds-radius-small),calc(var(--ds-surface-radius,var(--ds-radius-large))-var(--ds-space-050)))] px-ds-100 text-body outline-hidden select-none \" +\n \"data-[focused]:bg-ds-background-neutral-subtle-hovered data-[pressed]:bg-ds-background-neutral-pressed \" +\n \"data-[disabled]:cursor-not-allowed data-[disabled]:text-ds-text-disabled\";\n\nfunction isSection(entry: MenuEntry): entry is MenuSectionDef {\n return \"items\" in entry;\n}\n\ntype Group = { kind: \"section\"; section: MenuSectionDef; items: MenuItemDef[] } | { kind: \"run\"; key: string; items: MenuItemDef[] };\n\n/**\n * The menu as rendered: entries in the order given, consecutive loose items as one group, and every\n * destructive item pulled out of its group and placed once at the end. Separators go between the groups that\n * actually render, and before the destructive ones.\n */\nfunction layout(entries: readonly MenuEntry[]) {\n const groups: Group[] = [];\n const danger: MenuItemDef[] = [];\n for (const entry of entries) {\n if (isSection(entry)) {\n const items = entry.items.filter((item) => (item.tone === \"danger\" ? (danger.push(item), false) : true));\n if (items.length) groups.push({ kind: \"section\", section: entry, items });\n } else if (entry.tone === \"danger\") {\n danger.push(entry);\n } else {\n const last = groups[groups.length - 1];\n if (last?.kind === \"run\") last.items.push(entry);\n else groups.push({ kind: \"run\", key: `run-${String(entry.id)}`, items: [entry] });\n }\n }\n return { groups, danger };\n}\n\n/** A line between groups of items. */\nexport function MenuSeparator() {\n return <Separator data-slot=\"menu-separator\" className=\"my-ds-050 border-t border-ds-border\" />;\n}\n\n/** Phones (below 640px): a submenu opens under its item, inside the menu's width, not beside it off-screen. */\nfunction useNarrow() {\n return React.useSyncExternalStore(\n (notify) => {\n if (typeof window.matchMedia !== \"function\") return () => {};\n const query = window.matchMedia(\"(max-width: 639px)\");\n query.addEventListener(\"change\", notify);\n return () => query.removeEventListener(\"change\", notify);\n },\n () => typeof window.matchMedia === \"function\" && window.matchMedia(\"(max-width: 639px)\").matches,\n () => false,\n );\n}\n\nfunction Submenu({ children }: { children: React.ReactNode }) {\n const narrow = useNarrow();\n return (\n <AriaPopover\n {...useMotionAttribute()}\n data-slot=\"menu-submenu\"\n placement={narrow ? \"bottom end\" : \"end top\"}\n offset={narrow ? 2 : -4}\n crossOffset={narrow ? 0 : -4}\n className={cn(SURFACE, \"min-w-48 max-w-[min(22.5rem,calc(100vw-1.5rem))]\")}\n >\n <AriaMenu data-slot=\"menu-list\" className={cn(SCROLL, \"p-ds-050 outline-hidden\")}>\n {children}\n </AriaMenu>\n </AriaPopover>\n );\n}\n\n/** Groups in order, separators between them, the destructive items last after one more separator. */\nexport function MenuBody({ entries }: { entries: readonly MenuEntry[] }) {\n const { groups, danger } = layout(entries);\n return (\n <>\n {groups.map((group, index) => (\n <React.Fragment key={group.kind === \"section\" ? String(group.section.id) : group.key}>\n {index > 0 && <MenuSeparator />}\n {group.kind === \"section\" ? (\n <MenuSection id={group.section.id} title={group.section.title}>\n {group.items.map((item) => <Item key={String(item.id)} item={item} />)}\n </MenuSection>\n ) : (\n group.items.map((item) => <Item key={String(item.id)} item={item} />)\n )}\n </React.Fragment>\n ))}\n {danger.length > 0 && groups.length > 0 && <MenuSeparator />}\n {danger.map((item) => <Item key={String(item.id)} item={item} />)}\n </>\n );\n}\n\nfunction Item({ item }: { item: MenuItemDef }) {\n const row = { id: item.id, textValue: item.label, icon: item.icon, shortcut: item.shortcut, isDisabled: item.isDisabled, tone: item.tone, href: item.href, lang: item.lang };\n if (!item.children) return <ItemRow {...row}>{item.label}</ItemRow>;\n return (\n <SubmenuTrigger>\n <ItemRow {...row} hasSubmenu>\n {item.label}\n </ItemRow>\n <Submenu>\n <MenuBody entries={item.children} />\n </Submenu>\n </SubmenuTrigger>\n );\n}\n\ntype ItemRowProps = Omit<MenuItemProps, \"textValue\"> & { textValue: string; hasSubmenu?: boolean };\n\n/** One 32px row: a check when the menu selects, an icon, the label, then a shortcut or a submenu chevron. */\nfunction ItemRow({ id, children, textValue, icon, shortcut, isDisabled, tone, href, lang, hasSubmenu }: ItemRowProps) {\n return (\n <AriaMenuItem\n id={id}\n textValue={textValue}\n isDisabled={isDisabled}\n href={href}\n data-slot=\"menu-item\"\n data-tone={tone}\n className={cn(ITEM, tone === \"danger\" && \"text-ds-text-danger\")}\n >\n {({ isSelected, selectionMode }) => (\n <>\n {selectionMode !== \"none\" && (\n <span data-slot=\"menu-item-check\" className=\"grid size-4 shrink-0 place-items-center\">\n {isSelected && <IconGlyph name=\"check\" size=\"small\" />}\n </span>\n )}\n {icon && (\n <IconGlyph\n name={icon}\n size=\"small\"\n data-slot=\"menu-item-icon\"\n className={cn(tone === \"danger\" ? \"text-ds-icon-danger\" : \"text-ds-icon-subtle\", \"group-data-[disabled]:text-ds-text-disabled\")}\n />\n )}\n <span data-slot=\"menu-item-label\" lang={lang} className=\"min-w-0 flex-1 truncate\">{children}</span>\n {shortcut && (\n <Keyboard data-slot=\"menu-item-shortcut\" className=\"font-ds-mono text-code text-ds-text-subtlest\">{shortcut}</Keyboard>\n )}\n {hasSubmenu && <IconGlyph name=\"chevron-right\" size=\"small\" data-slot=\"menu-item-submenu\" className=\"text-ds-icon-subtle\" />}\n </>\n )}\n </AriaMenuItem>\n );\n}\n\n// ---- Composed from parts ---------------------------------------------------------------------------------------\n\nexport type MenuItemProps = {\n id: Key;\n /** The label: a verb (\"Edit\"). It may hold more than text (an avatar, two lines); then give `textValue`. */\n children: React.ReactNode;\n /** The words typing jumps to; the label itself when it is plain text. */\n textValue?: string;\n icon?: IconName;\n /** Shown in mono at the end (\"E\"). */\n shortcut?: string;\n isDisabled?: boolean;\n /** `danger` for the destructive action; put it last, after a `MenuSeparator`. */\n tone?: \"danger\";\n /** Makes the item a link; it goes through the host router. */\n href?: string;\n /** The language of the label, when it differs from the page. */\n lang?: string;\n};\n\nfunction textOf(children: React.ReactNode, textValue: string | undefined, part: string): string {\n if (textValue !== undefined) return textValue;\n if (typeof children === \"string\" || typeof children === \"number\") return String(children);\n if (process.env.NODE_ENV !== \"production\") console.warn(`${part}: give textValue when the label is not plain text, so typing can jump to it.`);\n return \"\";\n}\n\n/** One action in a Menu or ContextMenu composed from parts. */\nexport function MenuItem({ children, textValue, ...rest }: MenuItemProps) {\n return (\n <ItemRow {...rest} textValue={textOf(children, textValue, \"MenuItem\")}>\n {children}\n </ItemRow>\n );\n}\n\nexport type MenuSectionProps = {\n id?: Key;\n /** The section's title (\"Share\"); it names the group. */\n title: string;\n /** `MenuItem`s and `MenuSubmenu`s. */\n children: React.ReactNode;\n};\n\n/** A titled group of items. */\nexport function MenuSection({ id, title, children }: MenuSectionProps) {\n return (\n <AriaMenuSection data-slot=\"menu-section\" id={id}>\n <Header data-slot=\"menu-section-title\" className=\"px-ds-100 pt-ds-100 pb-ds-050 text-heading-xxsmall text-ds-text-subtle\">\n {title}\n </Header>\n {children}\n </AriaMenuSection>\n );\n}\n\nexport type MenuSubmenuProps = Omit<MenuItemProps, \"href\" | \"children\" | \"textValue\" | \"tone\"> & {\n /** The item that opens the submenu (\"Move to\"). */\n label: string;\n /** The submenu's `MenuItem`s. */\n children: React.ReactNode;\n};\n\n/** An item that opens a submenu: on hover and on → (← in RTL); under the item on phones. */\nexport function MenuSubmenu({ label, children, ...rest }: MenuSubmenuProps) {\n return (\n <SubmenuTrigger>\n <ItemRow {...rest} textValue={label} hasSubmenu>\n {label}\n </ItemRow>\n <Submenu>{children}</Submenu>\n </SubmenuTrigger>\n );\n}\n\n/**\n * The actions for an object behind a trigger: the row \"…\" menu, the account menu. 32px items with an icon,\n * a label and a shortcut or a submenu chevron; the destructive action last, after a separator. Anchored to\n * its trigger on every viewport and in RTL. Arrows move, typing jumps, Home/End go to the ends,\n * Enter acts, Esc closes and returns focus to the trigger. Choosing a value is a Select, not a Menu.\n */\nfunction MenuRoot({\n trigger, items, children, onAction, disabledKeys, placement = \"bottom end\", selectionMode = \"none\", selectedKeys, defaultSelectedKeys,\n onSelectionChange, isOpen, onOpenChange, \"aria-label\": ariaLabel,\n}: MenuProps) {\n return (\n <MenuTrigger isOpen={isOpen} onOpenChange={onOpenChange}>\n {trigger}\n <AriaPopover {...useMotionAttribute()} data-slot=\"menu-popover\" placement={placement} offset={4} className={cn(SURFACE, \"min-w-60 max-w-90\")}>\n <AriaMenu\n aria-label={ariaLabel}\n onAction={onAction}\n disabledKeys={disabledKeys}\n selectionMode={selectionMode}\n selectedKeys={selectedKeys}\n defaultSelectedKeys={defaultSelectedKeys}\n onSelectionChange={onSelectionChange}\n data-slot=\"menu\"\n className={cn(SCROLL, \"p-ds-050 outline-hidden\")}\n >\n {items ? <MenuBody entries={items} /> : children}\n </AriaMenu>\n </AriaPopover>\n </MenuTrigger>\n );\n}\n\n/** Popover with its own `motion` (auto, reduce or none); see PopoverBody for the component itself. */\nexport function Popover({ motion, ...props }: PopoverProps & WithMotion) {\n return (\n <MotionScope motion={motion}>\n <PopoverBody {...(props as PopoverProps)} />\n </MotionScope>\n );\n}\n\n/** Menu with its own `motion` (auto, reduce or none); see MenuRoot for the component itself. */\nexport function Menu({ motion, ...props }: MenuProps & WithMotion) {\n return (\n <MotionScope motion={motion}>\n <MenuRoot {...(props as MenuProps)} />\n </MotionScope>\n );\n}\n\n/** Tooltip with its own `motion` (auto, reduce or none); see TooltipBody for the component itself. */\nexport function Tooltip({ motion, ...props }: TooltipProps & WithMotion) {\n return (\n <MotionScope motion={motion}>\n <TooltipBody {...(props as TooltipProps)} />\n </MotionScope>\n );\n}\n\n/* ── ContextMenu ─────────────────────────────────────────────────────────── */\n"]}
1
+ {"version":3,"file":"floating.js","sourceRoot":"","sources":["../../src/overlay/floating.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,aAAa,IAAI,iBAAiB,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,IAAI,QAAQ,EAAE,QAAQ,IAAI,YAAY,EAAE,WAAW,IAAI,eAAe,EAAE,WAAW,EAAE,YAAY,EAAE,OAAO,IAAI,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,IAAI,WAAW,EAAE,cAAc,EAA4C,MAAM,uBAAuB,CAAC;AACnX,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAmB,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAiB,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,OAAO,GAClB,kJAAkJ;IAClJ,yIAAyI;IACzI,qDAAqD;IACrD,2GAA2G,CAAC;AAE9G,qGAAq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KAAsB,GAAI,GAChC,CACf,CAAC;AACJ,CAAC;AAED,gGAAgG;AAChG,MAAM,UAAU,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,KAAK,EAA0B;IAC/D,OAAO,CACL,KAAC,WAAW,IAAC,MAAM,EAAE,MAAM,YACzB,KAAC,QAAQ,OAAM,KAAmB,GAAI,GAC1B,CACf,CAAC;AACJ,CAAC;AAED,sGAAsG;AACtG,MAAM,UAAU,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,KAAK,EAA6B;IACrE,OAAO,CACL,KAAC,WAAW,IAAC,MAAM,EAAE,MAAM,YACzB,KAAC,WAAW,OAAM,KAAsB,GAAI,GAChC,CACf,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Dialog as AriaDialog, DialogTrigger as AriaDialogTrigger, Focusable, Heading, Header, Keyboard, Menu as AriaMenu, MenuItem as AriaMenuItem, MenuSection as AriaMenuSection, MenuTrigger, OverlayArrow, Popover as AriaPopover, Separator, SubmenuTrigger, Tooltip as AriaTooltip, TooltipTrigger, type Key, type Placement, type Selection } from \"react-aria-components\";\nimport { cn } from \"../utils\";\nimport { MotionScope, type WithMotion, useMotionAttribute } from \"../defaults\";\nimport { Button, CloseButton, Fab, Link, ToggleButton } from \"../action/index\";\nimport { IconGlyph, type IconName } from \"../display/icon\";\nimport { Kbd } from \"../display/kbd\";\nimport { OverlayContents } from \"./overlay-base\";\n\n/**\n * One floating surface for Popover and Menu: `ds-surface-overlay`, `ds-shadow-overlay`, `ds-radius-large`,\n * anchored to its trigger by React Aria (flips and shifts at the viewport edge, mirrors in RTL). React Aria\n * caps its height to the space left on screen; the panel's content scrolls inside (SCROLL) instead of running\n * off it. The surface itself does not clip, or it would hide the arrow React Aria places outside it.\n */\nexport const SURFACE =\n \"flex flex-col rounded-ds-large [--ds-surface-radius:var(--ds-radius-large)] bg-ds-surface-overlay text-ds-text shadow-ds-overlay outline-hidden \" +\n \"transition-[opacity,translate] duration-(--ds-duration-medium) ease-ds-enter data-[exiting]:ease-ds-exit motion-reduce:transition-none \" +\n \"data-[entering]:opacity-0 data-[exiting]:opacity-0 \" +\n \"data-[placement=bottom]:data-[entering]:-translate-y-1 data-[placement=top]:data-[entering]:translate-y-1\";\n\n/** The scrolling inside a floating surface: as tall as React Aria lets the surface be, no taller. */\nexport const SCROLL = \"min-h-0 max-h-[inherit] overflow-auto\";\n\n/** The 12px arrow pointing at the trigger, turned to whichever side the panel opened on. */\nfunction Arrow() {\n return (\n <OverlayArrow data-slot=\"popover-arrow\" className=\"group\">\n <svg width={12} height={12} viewBox=\"0 0 12 12\" aria-hidden className=\"block fill-ds-surface-overlay group-data-[placement=bottom]:rotate-180 group-data-[placement=left]:-rotate-90 group-data-[placement=right]:rotate-90\">\n <path d=\"M0 0 L6 6 L12 0\" />\n </svg>\n </OverlayArrow>\n );\n}\n\nexport type PopoverProps = {\n /** The pressable that opens it (a DS Button: \"Filtre\"). */\n trigger: React.ReactElement;\n children: React.ReactNode;\n /** \"bottom start\" by default; React Aria flips it when there is no room. */\n placement?: Placement;\n isOpen?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: (isOpen: boolean) => void;\n /** A heading that also names the panel (\"Filters\"); without it, give `aria-label`. */\n title?: React.ReactNode;\n \"aria-label\"?: string;\n};\n\n/**\n * A small non-modal panel anchored to its trigger: filters, a quick edit, extra details. 240–360px wide,\n * with an arrow to the trigger. Esc and an outside click close it; focus moves in on open and back to the\n * trigger on close. One small task; more than about four fields belongs in a Drawer.\n */\nfunction PopoverBody({ trigger, children, placement = \"bottom start\", isOpen, defaultOpen, onOpenChange, title, \"aria-label\": ariaLabel }: PopoverProps) {\n return (\n <AriaDialogTrigger isOpen={isOpen} defaultOpen={defaultOpen} onOpenChange={onOpenChange}>\n {trigger}\n <AriaPopover {...useMotionAttribute()} data-slot=\"popover\" placement={placement} offset={10} className={cn(SURFACE, \"min-w-60 max-w-90\")}>\n <Arrow />\n <AriaDialog aria-label={title ? undefined : ariaLabel} data-slot=\"popover-dialog\" className={cn(SCROLL, \"flex flex-col gap-ds-150 p-ds-200 outline-hidden\")}>\n <OverlayContents>\n {title && <Heading slot=\"title\" data-slot=\"popover-title\" className=\"m-0 text-heading-xsmall\">{title}</Heading>}\n {children}\n </OverlayContents>\n </AriaDialog>\n </AriaPopover>\n </AriaDialogTrigger>\n );\n}\n\nexport type TooltipProps = {\n /** Plain text only: the same words as the control's `aria-label`, or a truncated value in full. */\n content: string;\n /** The trigger. It must be focusable; a non-interactive element (a truncated lozenge) is made focusable. */\n children: React.ReactElement;\n placement?: Placement;\n /** A keyboard shortcut shown as a chip (\"F\"). */\n shortcut?: string;\n /**\n * Readable on touch screens: a tap on the trigger opens the tooltip and a second tap closes it;\n * a tap anywhere else, or Esc, closes it. Mouse hover and keyboard focus work exactly as without it. For a\n * trigger that does nothing on its own (a country flag, a truncated value); on a button the tap still presses it.\n */\n openOnTouch?: boolean;\n};\n\n/** DS controls built on React Aria: they take a tooltip as they are. */\nconst ARIA_TRIGGERS = new Set<unknown>([Button, CloseButton, ToggleButton, Link, Fab]);\n\n/**\n * The tooltip's trigger. A DS button or link is used as it is. A plain element gets a tab stop (keeping one it\n * already has). Any other component (a Badge, a truncated value) is wrapped in a focusable span, since React\n * Aria can only attach to an element it can reach; the wrapper takes no tab stop of its own when what it holds\n * is already focusable (a raw React Aria button), so keyboard users still meet one stop. For a Menu or a\n * Popover, put the Tooltip on its trigger button, not around the whole component.\n */\nfunction TooltipTarget({ children }: { children: React.ReactElement }) {\n const wrapper = React.useRef<HTMLSpanElement>(null);\n const [holdsFocusable, setHoldsFocusable] = React.useState(false);\n React.useLayoutEffect(() => {\n setHoldsFocusable(!!wrapper.current?.querySelector(\"button, a[href], input, select, textarea, [tabindex]:not([tabindex='-1'])\"));\n });\n if (ARIA_TRIGGERS.has(children.type)) return children;\n type Focus = React.ComponentProps<typeof Focusable>[\"children\"];\n if (typeof children.type === \"string\") {\n const props = children.props as { tabIndex?: number };\n return <Focusable>{React.cloneElement(children as React.ReactElement<{ tabIndex?: number }>, { tabIndex: props.tabIndex ?? 0 }) as Focus}</Focusable>;\n }\n return (\n // React Aria gives a Focusable child tabIndex 0 unless it is excluded from the tab order.\n <Focusable excludeFromTabOrder={holdsFocusable}>\n <span\n ref={wrapper}\n tabIndex={holdsFocusable ? -1 : 0}\n data-slot=\"tooltip-target\"\n className=\"inline-flex rounded-ds-small outline-hidden focus-visible:inset-ring-2 focus-visible:inset-ring-ds-border-focused\"\n >\n {children}\n </span>\n </Focusable>\n );\n}\n\n/**\n * Names an icon-only control or shows a truncated value in full. Shows after 300ms of hover and at once on\n * keyboard focus; Esc hides it. The control keeps its own `aria-label` (the tooltip only describes it), and\n * touch users never see a tooltip, so it never holds anything needed to finish a task. With `openOnTouch` a tap\n * toggles it, for a value that a touch user should also be able to read. No provider needed.\n */\nfunction TooltipBody(props: TooltipProps) {\n return <TooltipFor {...props} children={<TooltipTarget>{props.children}</TooltipTarget>} />;\n}\n\n/**\n * Inside the design system only (not exported from the package): a tooltip on a child that is itself a\n * React Aria focusable (a `Link`, a `Button slot=\"trigger\"`), so it takes the trigger props directly.\n */\nexport function TooltipFor({ content, children, placement = \"top\", shortcut, openOnTouch }: TooltipProps) {\n if (openOnTouch) return <TouchTooltipFor content={content} placement={placement} shortcut={shortcut}>{children}</TouchTooltipFor>;\n return (\n <TooltipTrigger delay={300} closeDelay={0}>\n {children}\n <TooltipBubble content={content} placement={placement} shortcut={shortcut} />\n </TooltipTrigger>\n );\n}\n\nconst TooltipBubble = React.forwardRef<HTMLDivElement, Pick<TooltipProps, \"content\" | \"placement\" | \"shortcut\">>(function TooltipBubble(\n { content, placement, shortcut },\n ref,\n) {\n return (\n <AriaTooltip\n {...useMotionAttribute()}\n ref={ref}\n data-slot=\"tooltip\"\n placement={placement}\n offset={6}\n className={cn(\n \"flex max-w-60 items-center gap-ds-075 rounded-ds-small bg-ds-background-neutral-bold px-ds-100 py-ds-050 text-body-small text-ds-text-inverse\",\n // A shortcut's keycaps take the bubble's colours (a clear cap with a faint edge), not the page's surface,\n // which read as a loud white chip in the dark bubble.\n \"[&_[data-slot=kbd]]:border-current/30 [&_[data-slot=kbd]]:bg-transparent [&_[data-slot=kbd]]:text-ds-text-inverse\",\n \"transition-opacity duration-(--ds-duration-fast) data-[entering]:opacity-0 data-[exiting]:opacity-0 motion-reduce:transition-none\",\n )}\n >\n <span data-slot=\"tooltip-content\">{content}</span>\n {shortcut && (\n <span data-slot=\"tooltip-shortcut\" className=\"flex\">\n <Kbd>{shortcut}</Kbd>\n </span>\n )}\n </AriaTooltip>\n );\n});\n\n/**\n * `openOnTouch`. The tooltip is controlled: React Aria still opens it on hover and keyboard focus and\n * closes it on press, blur and Esc through `onOpenChange`. A touch tap is decided on pointerdown, from the state\n * the finger found (React Aria's own close-on-press runs in the same event), and applied on pointerup, so a tap\n * toggles it; a scroll that cancels the touch changes nothing. While it is open, a pointer down outside the trigger\n * and the bubble closes it. The trigger sits in a `display: contents` span, which adds no box to the layout.\n */\nfunction TouchTooltipFor({ content, children, placement, shortcut }: Omit<TooltipProps, \"openOnTouch\">) {\n const [isOpen, setOpen] = React.useState(false);\n const zone = React.useRef<HTMLSpanElement>(null);\n const bubble = React.useRef<HTMLDivElement>(null);\n const tap = React.useRef<boolean | null>(null);\n React.useEffect(() => {\n if (!isOpen) return;\n const outside = (event: PointerEvent) => {\n const target = event.target as Node | null;\n if (target && (zone.current?.contains(target) || bubble.current?.contains(target))) return;\n setOpen(false);\n };\n document.addEventListener(\"pointerdown\", outside, true);\n return () => document.removeEventListener(\"pointerdown\", outside, true);\n }, [isOpen]);\n return (\n <span\n ref={zone}\n data-slot=\"tooltip-touch\"\n className=\"contents\"\n onPointerDownCapture={(event) => {\n // React events bubble through the portal: a tap on the bubble is not a tap on the trigger.\n const onTrigger = zone.current?.contains(event.target as Node) ?? false;\n tap.current = event.pointerType === \"touch\" && onTrigger ? !isOpen : null;\n }}\n onPointerUp={(event) => {\n const next = tap.current;\n tap.current = null;\n if (event.pointerType === \"touch\" && next !== null) setOpen(next);\n }}\n onPointerCancel={() => {\n tap.current = null;\n }}\n >\n <TooltipTrigger delay={300} closeDelay={0} isOpen={isOpen} onOpenChange={setOpen}>\n {children}\n <TooltipBubble ref={bubble} content={content} placement={placement} shortcut={shortcut} />\n </TooltipTrigger>\n </span>\n );\n}\n\nexport type MenuItemDef = {\n id: Key;\n /** A verb (\"Edit\"); a disabled item says why (\"Send invoice (payment pending)\"). */\n label: string;\n icon?: IconName;\n /** Shown in mono at the end (\"E\"). */\n shortcut?: string;\n isDisabled?: boolean;\n /** `danger` for the destructive action; it is placed last, after a separator. */\n tone?: \"danger\";\n /** A submenu: opens on hover and on → (← in RTL). */\n children?: readonly MenuItemDef[];\n /** Makes the item a link (a language of the page, another page); it goes through the host router. */\n href?: string;\n /** The language of the label, when it differs from the page (\"English\" in a Turkish language list). */\n lang?: string;\n};\n\nexport type MenuSectionDef = {\n id: Key;\n /** \"Share\". */\n title: string;\n items: readonly MenuItemDef[];\n};\n\nexport type MenuEntry = MenuItemDef | MenuSectionDef;\n\nexport type MenuProps = {\n /** The pressable that opens it: the row \"…\" button, the account button. */\n trigger: React.ReactElement;\n /** Items, or sections of items with a title. Leave it out to compose the menu as children instead. */\n items?: readonly MenuEntry[];\n /**\n * With no `items`: `MenuItem`, `MenuSection`, `MenuSubmenu` and `MenuSeparator`, in the order given (put the\n * destructive item last yourself; with `items` the menu moves it there).\n */\n children?: React.ReactNode;\n onAction?: (id: Key) => void;\n disabledKeys?: Iterable<Key>;\n /** \"bottom end\" by default: under the trigger, aligned to its inline end, as row menus sit. */\n placement?: Placement;\n /** For menus that also hold a choice (a view option): checkmarks on the selected items. */\n selectionMode?: \"none\" | \"single\" | \"multiple\";\n selectedKeys?: Iterable<Key>;\n defaultSelectedKeys?: Iterable<Key>;\n onSelectionChange?: (keys: Selection) => void;\n isOpen?: boolean;\n onOpenChange?: (isOpen: boolean) => void;\n /** Names the menu when the trigger's own name is not enough. */\n \"aria-label\"?: string;\n};\n\nconst ITEM =\n \"group flex min-h-8 cursor-default items-center gap-ds-100 rounded-[max(var(--ds-radius-small),calc(var(--ds-surface-radius,var(--ds-radius-large))-var(--ds-space-050)))] px-ds-100 text-body outline-hidden select-none \" +\n \"data-[focused]:bg-ds-background-neutral-subtle-hovered data-[pressed]:bg-ds-background-neutral-pressed \" +\n \"data-[disabled]:cursor-not-allowed data-[disabled]:text-ds-text-disabled\";\n\nfunction isSection(entry: MenuEntry): entry is MenuSectionDef {\n return \"items\" in entry;\n}\n\ntype Group = { kind: \"section\"; section: MenuSectionDef; items: MenuItemDef[] } | { kind: \"run\"; key: string; items: MenuItemDef[] };\n\n/**\n * The menu as rendered: entries in the order given, consecutive loose items as one group, and every\n * destructive item pulled out of its group and placed once at the end. Separators go between the groups that\n * actually render, and before the destructive ones.\n */\nfunction layout(entries: readonly MenuEntry[]) {\n const groups: Group[] = [];\n const danger: MenuItemDef[] = [];\n for (const entry of entries) {\n if (isSection(entry)) {\n const items = entry.items.filter((item) => (item.tone === \"danger\" ? (danger.push(item), false) : true));\n if (items.length) groups.push({ kind: \"section\", section: entry, items });\n } else if (entry.tone === \"danger\") {\n danger.push(entry);\n } else {\n const last = groups[groups.length - 1];\n if (last?.kind === \"run\") last.items.push(entry);\n else groups.push({ kind: \"run\", key: `run-${String(entry.id)}`, items: [entry] });\n }\n }\n return { groups, danger };\n}\n\n/** A line between groups of items. */\nexport function MenuSeparator() {\n return <Separator data-slot=\"menu-separator\" className=\"my-ds-050 border-t border-ds-border\" />;\n}\n\n/** Phones (below 640px): a submenu opens under its item, inside the menu's width, not beside it off-screen. */\nfunction useNarrow() {\n return React.useSyncExternalStore(\n (notify) => {\n if (typeof window.matchMedia !== \"function\") return () => {};\n const query = window.matchMedia(\"(max-width: 639px)\");\n query.addEventListener(\"change\", notify);\n return () => query.removeEventListener(\"change\", notify);\n },\n () => typeof window.matchMedia === \"function\" && window.matchMedia(\"(max-width: 639px)\").matches,\n () => false,\n );\n}\n\nfunction Submenu({ children }: { children: React.ReactNode }) {\n const narrow = useNarrow();\n return (\n <AriaPopover\n {...useMotionAttribute()}\n data-slot=\"menu-submenu\"\n placement={narrow ? \"bottom end\" : \"end top\"}\n offset={narrow ? 2 : -4}\n crossOffset={narrow ? 0 : -4}\n className={cn(SURFACE, \"min-w-48 max-w-[min(22.5rem,calc(100vw-1.5rem))]\")}\n >\n <AriaMenu data-slot=\"menu-list\" className={cn(SCROLL, \"p-ds-050 outline-hidden\")}>\n {children}\n </AriaMenu>\n </AriaPopover>\n );\n}\n\n/** Groups in order, separators between them, the destructive items last after one more separator. */\nexport function MenuBody({ entries }: { entries: readonly MenuEntry[] }) {\n const { groups, danger } = layout(entries);\n return (\n <>\n {groups.map((group, index) => (\n <React.Fragment key={group.kind === \"section\" ? String(group.section.id) : group.key}>\n {index > 0 && <MenuSeparator />}\n {group.kind === \"section\" ? (\n <MenuSection id={group.section.id} title={group.section.title}>\n {group.items.map((item) => <Item key={String(item.id)} item={item} />)}\n </MenuSection>\n ) : (\n group.items.map((item) => <Item key={String(item.id)} item={item} />)\n )}\n </React.Fragment>\n ))}\n {danger.length > 0 && groups.length > 0 && <MenuSeparator />}\n {danger.map((item) => <Item key={String(item.id)} item={item} />)}\n </>\n );\n}\n\nfunction Item({ item }: { item: MenuItemDef }) {\n const row = { id: item.id, textValue: item.label, icon: item.icon, shortcut: item.shortcut, isDisabled: item.isDisabled, tone: item.tone, href: item.href, lang: item.lang };\n if (!item.children) return <ItemRow {...row}>{item.label}</ItemRow>;\n return (\n <SubmenuTrigger>\n <ItemRow {...row} hasSubmenu>\n {item.label}\n </ItemRow>\n <Submenu>\n <MenuBody entries={item.children} />\n </Submenu>\n </SubmenuTrigger>\n );\n}\n\ntype ItemRowProps = Omit<MenuItemProps, \"textValue\"> & { textValue: string; hasSubmenu?: boolean };\n\n/** One 32px row: a check when the menu selects, an icon, the label, then a shortcut or a submenu chevron. */\nfunction ItemRow({ id, children, textValue, icon, shortcut, isDisabled, tone, href, lang, hasSubmenu }: ItemRowProps) {\n return (\n <AriaMenuItem\n id={id}\n textValue={textValue}\n isDisabled={isDisabled}\n href={href}\n data-slot=\"menu-item\"\n data-tone={tone}\n className={cn(ITEM, tone === \"danger\" && \"text-ds-text-danger\")}\n >\n {({ isSelected, selectionMode }) => (\n <>\n {selectionMode !== \"none\" && (\n <span data-slot=\"menu-item-check\" className=\"grid size-4 shrink-0 place-items-center\">\n {isSelected && <IconGlyph name=\"check\" size=\"small\" />}\n </span>\n )}\n {icon && (\n <IconGlyph\n name={icon}\n size=\"small\"\n data-slot=\"menu-item-icon\"\n className={cn(tone === \"danger\" ? \"text-ds-icon-danger\" : \"text-ds-icon-subtle\", \"group-data-[disabled]:text-ds-text-disabled\")}\n />\n )}\n <span data-slot=\"menu-item-label\" lang={lang} className=\"min-w-0 flex-1 truncate\">{children}</span>\n {shortcut && (\n <Keyboard data-slot=\"menu-item-shortcut\" className=\"font-ds-mono text-code text-ds-text-subtlest\">{shortcut}</Keyboard>\n )}\n {hasSubmenu && <IconGlyph name=\"chevron-right\" size=\"small\" data-slot=\"menu-item-submenu\" className=\"text-ds-icon-subtle\" />}\n </>\n )}\n </AriaMenuItem>\n );\n}\n\n// ---- Composed from parts ---------------------------------------------------------------------------------------\n\nexport type MenuItemProps = {\n id: Key;\n /** The label: a verb (\"Edit\"). It may hold more than text (an avatar, two lines); then give `textValue`. */\n children: React.ReactNode;\n /** The words typing jumps to; the label itself when it is plain text. */\n textValue?: string;\n icon?: IconName;\n /** Shown in mono at the end (\"E\"). */\n shortcut?: string;\n isDisabled?: boolean;\n /** `danger` for the destructive action; put it last, after a `MenuSeparator`. */\n tone?: \"danger\";\n /** Makes the item a link; it goes through the host router. */\n href?: string;\n /** The language of the label, when it differs from the page. */\n lang?: string;\n};\n\nfunction textOf(children: React.ReactNode, textValue: string | undefined, part: string): string {\n if (textValue !== undefined) return textValue;\n if (typeof children === \"string\" || typeof children === \"number\") return String(children);\n if (process.env.NODE_ENV !== \"production\") console.warn(`${part}: give textValue when the label is not plain text, so typing can jump to it.`);\n return \"\";\n}\n\n/** One action in a Menu or ContextMenu composed from parts. */\nexport function MenuItem({ children, textValue, ...rest }: MenuItemProps) {\n return (\n <ItemRow {...rest} textValue={textOf(children, textValue, \"MenuItem\")}>\n {children}\n </ItemRow>\n );\n}\n\nexport type MenuSectionProps = {\n id?: Key;\n /** The section's title (\"Share\"); it names the group. */\n title: string;\n /** `MenuItem`s and `MenuSubmenu`s. */\n children: React.ReactNode;\n};\n\n/** A titled group of items. */\nexport function MenuSection({ id, title, children }: MenuSectionProps) {\n return (\n <AriaMenuSection data-slot=\"menu-section\" id={id}>\n <Header data-slot=\"menu-section-title\" className=\"px-ds-100 pt-ds-100 pb-ds-050 text-heading-xxsmall text-ds-text-subtle\">\n {title}\n </Header>\n {children}\n </AriaMenuSection>\n );\n}\n\nexport type MenuSubmenuProps = Omit<MenuItemProps, \"href\" | \"children\" | \"textValue\" | \"tone\"> & {\n /** The item that opens the submenu (\"Move to\"). */\n label: string;\n /** The submenu's `MenuItem`s. */\n children: React.ReactNode;\n};\n\n/** An item that opens a submenu: on hover and on → (← in RTL); under the item on phones. */\nexport function MenuSubmenu({ label, children, ...rest }: MenuSubmenuProps) {\n return (\n <SubmenuTrigger>\n <ItemRow {...rest} textValue={label} hasSubmenu>\n {label}\n </ItemRow>\n <Submenu>{children}</Submenu>\n </SubmenuTrigger>\n );\n}\n\n/**\n * The actions for an object behind a trigger: the row \"…\" menu, the account menu. 32px items with an icon,\n * a label and a shortcut or a submenu chevron; the destructive action last, after a separator. Anchored to\n * its trigger on every viewport and in RTL. Arrows move, typing jumps, Home/End go to the ends,\n * Enter acts, Esc closes and returns focus to the trigger. Choosing a value is a Select, not a Menu.\n */\nfunction MenuRoot({\n trigger, items, children, onAction, disabledKeys, placement = \"bottom end\", selectionMode = \"none\", selectedKeys, defaultSelectedKeys,\n onSelectionChange, isOpen, onOpenChange, \"aria-label\": ariaLabel,\n}: MenuProps) {\n return (\n <MenuTrigger isOpen={isOpen} onOpenChange={onOpenChange}>\n {trigger}\n <AriaPopover {...useMotionAttribute()} data-slot=\"menu-popover\" placement={placement} offset={4} className={cn(SURFACE, \"min-w-60 max-w-90\")}>\n <AriaMenu\n aria-label={ariaLabel}\n onAction={onAction}\n disabledKeys={disabledKeys}\n selectionMode={selectionMode}\n selectedKeys={selectedKeys}\n defaultSelectedKeys={defaultSelectedKeys}\n onSelectionChange={onSelectionChange}\n data-slot=\"menu\"\n className={cn(SCROLL, \"p-ds-050 outline-hidden\")}\n >\n {items ? <MenuBody entries={items} /> : children}\n </AriaMenu>\n </AriaPopover>\n </MenuTrigger>\n );\n}\n\n/** Popover with its own `motion` (auto, reduce or none); see PopoverBody for the component itself. */\nexport function Popover({ motion, ...props }: PopoverProps & WithMotion) {\n return (\n <MotionScope motion={motion}>\n <PopoverBody {...(props as PopoverProps)} />\n </MotionScope>\n );\n}\n\n/** Menu with its own `motion` (auto, reduce or none); see MenuRoot for the component itself. */\nexport function Menu({ motion, ...props }: MenuProps & WithMotion) {\n return (\n <MotionScope motion={motion}>\n <MenuRoot {...(props as MenuProps)} />\n </MotionScope>\n );\n}\n\n/** Tooltip with its own `motion` (auto, reduce or none); see TooltipBody for the component itself. */\nexport function Tooltip({ motion, ...props }: TooltipProps & WithMotion) {\n return (\n <MotionScope motion={motion}>\n <TooltipBody {...(props as TooltipProps)} />\n </MotionScope>\n );\n}\n\n/* ── ContextMenu ─────────────────────────────────────────────────────────── */\n"]}
@@ -16,3 +16,5 @@ export { Command } from "./command.js";
16
16
  export type { CommandGroup, CommandItem, CommandProps } from "./command.js";
17
17
  export { Toaster, toast } from "./toast.js";
18
18
  export type { ToastOptions, ToastPromiseMessages, ToastTone } from "./toast.js";
19
+ export { Tour } from "./tour.js";
20
+ export type { TourPlacement, TourProps, TourStep, TourTarget } from "./tour.js";
@@ -1,5 +1,5 @@
1
1
  // @senvenli/react/overlay: Dialog, AlertDialog, Drawer and DialogTrigger; Popover, Tooltip, Menu, ContextMenu and HoverCard;
2
- // Command, Toaster and toast(). Each is built on React Aria Components.
2
+ // Command, Toaster and toast(); Tour. Each is built on React Aria Components.
3
3
  export { DialogTrigger } from "./overlay-base.js";
4
4
  export { Dialog, useDialogClose } from "./dialog.js";
5
5
  export { AlertDialog } from "./alert-dialog.js";
@@ -9,4 +9,5 @@ export { ContextMenu, ContextMenuTrigger } from "./context-menu.js";
9
9
  export { HoverCard } from "./hover-card.js";
10
10
  export { Command } from "./command.js";
11
11
  export { Toaster, toast } from "./toast.js";
12
+ export { Tour } from "./tour.js";
12
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/overlay/index.ts"],"names":[],"mappings":"AAAA,6HAA6H;AAC7H,wEAAwE;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAElD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAElD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEvG,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEjE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC","sourcesContent":["// @senvenli/react/overlay: Dialog, AlertDialog, Drawer and DialogTrigger; Popover, Tooltip, Menu, ContextMenu and HoverCard;\n// Command, Toaster and toast(). Each is built on React Aria Components.\nexport { DialogTrigger } from \"./overlay-base\";\nexport type { OverlaySize } from \"./overlay-base\";\nexport { Dialog, useDialogClose } from \"./dialog\";\nexport type { DialogAction, DialogProps } from \"./dialog\";\nexport { AlertDialog } from \"./alert-dialog\";\nexport type { AlertDialogProps } from \"./alert-dialog\";\nexport { Drawer, useDrawerClose } from \"./drawer\";\nexport type { DrawerClose, DrawerPosition, DrawerProps } from \"./drawer\";\nexport { Menu, MenuItem, MenuSection, MenuSeparator, MenuSubmenu, Popover, Tooltip } from \"./floating\";\nexport type { MenuEntry, MenuItemDef, MenuItemProps, MenuProps, MenuSectionDef, MenuSectionProps, MenuSubmenuProps, PopoverProps, TooltipProps } from \"./floating\";\nexport { ContextMenu, ContextMenuTrigger } from \"./context-menu\";\nexport type { ContextMenuProps, ContextMenuTriggerProps } from \"./context-menu\";\nexport { HoverCard } from \"./hover-card\";\nexport type { HoverCardProps } from \"./hover-card\";\nexport { Command } from \"./command\";\nexport type { CommandGroup, CommandItem, CommandProps } from \"./command\";\nexport { Toaster, toast } from \"./toast\";\nexport type { ToastOptions, ToastPromiseMessages, ToastTone } from \"./toast\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/overlay/index.ts"],"names":[],"mappings":"AAAA,6HAA6H;AAC7H,8EAA8E;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAElD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAElD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEvG,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEjE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC","sourcesContent":["// @senvenli/react/overlay: Dialog, AlertDialog, Drawer and DialogTrigger; Popover, Tooltip, Menu, ContextMenu and HoverCard;\n// Command, Toaster and toast(); Tour. Each is built on React Aria Components.\nexport { DialogTrigger } from \"./overlay-base\";\nexport type { OverlaySize } from \"./overlay-base\";\nexport { Dialog, useDialogClose } from \"./dialog\";\nexport type { DialogAction, DialogProps } from \"./dialog\";\nexport { AlertDialog } from \"./alert-dialog\";\nexport type { AlertDialogProps } from \"./alert-dialog\";\nexport { Drawer, useDrawerClose } from \"./drawer\";\nexport type { DrawerClose, DrawerPosition, DrawerProps } from \"./drawer\";\nexport { Menu, MenuItem, MenuSection, MenuSeparator, MenuSubmenu, Popover, Tooltip } from \"./floating\";\nexport type { MenuEntry, MenuItemDef, MenuItemProps, MenuProps, MenuSectionDef, MenuSectionProps, MenuSubmenuProps, PopoverProps, TooltipProps } from \"./floating\";\nexport { ContextMenu, ContextMenuTrigger } from \"./context-menu\";\nexport type { ContextMenuProps, ContextMenuTriggerProps } from \"./context-menu\";\nexport { HoverCard } from \"./hover-card\";\nexport type { HoverCardProps } from \"./hover-card\";\nexport { Command } from \"./command\";\nexport type { CommandGroup, CommandItem, CommandProps } from \"./command\";\nexport { Toaster, toast } from \"./toast\";\nexport type { ToastOptions, ToastPromiseMessages, ToastTone } from \"./toast\";\nexport { Tour } from \"./tour\";\nexport type { TourPlacement, TourProps, TourStep, TourTarget } from \"./tour\";\n"]}