@42-central/ui-react 0.25.0 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/dist/{chunk-LHUWOA2U.js → chunk-276RL7FX.js} +5 -5
  2. package/dist/{chunk-LHUWOA2U.js.map → chunk-276RL7FX.js.map} +1 -1
  3. package/dist/{chunk-6UIQJJNJ.js → chunk-2NTCQIRP.js} +4 -4
  4. package/dist/{chunk-6UIQJJNJ.js.map → chunk-2NTCQIRP.js.map} +1 -1
  5. package/dist/{chunk-T44RW5DW.js → chunk-2TZU4LSX.js} +4 -4
  6. package/dist/{chunk-T44RW5DW.js.map → chunk-2TZU4LSX.js.map} +1 -1
  7. package/dist/{chunk-QZ4N5LYG.js → chunk-7B44J3CF.js} +3 -3
  8. package/dist/{chunk-QZ4N5LYG.js.map → chunk-7B44J3CF.js.map} +1 -1
  9. package/dist/{chunk-XUFCI262.js → chunk-7OGZT7U2.js} +12 -4
  10. package/dist/chunk-7OGZT7U2.js.map +1 -0
  11. package/dist/{chunk-N5M4PDBK.js → chunk-DMI4KS32.js} +3 -3
  12. package/dist/{chunk-N5M4PDBK.js.map → chunk-DMI4KS32.js.map} +1 -1
  13. package/dist/{chunk-UDCCOUWR.js → chunk-DSZF2TW6.js} +5 -5
  14. package/dist/{chunk-UDCCOUWR.js.map → chunk-DSZF2TW6.js.map} +1 -1
  15. package/dist/{chunk-N66NC6QK.js → chunk-E3XLWMEB.js} +3 -3
  16. package/dist/{chunk-N66NC6QK.js.map → chunk-E3XLWMEB.js.map} +1 -1
  17. package/dist/{chunk-HRNWWL3Y.js → chunk-J2NW7JID.js} +61 -29
  18. package/dist/chunk-J2NW7JID.js.map +1 -0
  19. package/dist/{chunk-FZSLSUSX.js → chunk-JDPVD2YE.js} +3 -3
  20. package/dist/{chunk-FZSLSUSX.js.map → chunk-JDPVD2YE.js.map} +1 -1
  21. package/dist/{chunk-6II2DVYR.js → chunk-JFB6O7IY.js} +4 -4
  22. package/dist/{chunk-6II2DVYR.js.map → chunk-JFB6O7IY.js.map} +1 -1
  23. package/dist/chunk-LJVIZNPE.js +9 -0
  24. package/dist/chunk-LJVIZNPE.js.map +1 -0
  25. package/dist/{chunk-HQPU73WV.js → chunk-LYGOFMXJ.js} +3 -3
  26. package/dist/{chunk-HQPU73WV.js.map → chunk-LYGOFMXJ.js.map} +1 -1
  27. package/dist/{chunk-AHKMN3YQ.js → chunk-N42EFOML.js} +3 -3
  28. package/dist/{chunk-AHKMN3YQ.js.map → chunk-N42EFOML.js.map} +1 -1
  29. package/dist/{chunk-7HZBD4YZ.js → chunk-NF2PBGD3.js} +36 -23
  30. package/dist/chunk-NF2PBGD3.js.map +1 -0
  31. package/dist/{chunk-MW42XVPD.js → chunk-PBSVX5DB.js} +15 -5
  32. package/dist/chunk-PBSVX5DB.js.map +1 -0
  33. package/dist/{chunk-PI7X5YFJ.js → chunk-PT22KEVD.js} +4 -4
  34. package/dist/{chunk-PI7X5YFJ.js.map → chunk-PT22KEVD.js.map} +1 -1
  35. package/dist/{chunk-36NWC4GV.js → chunk-QEAF57ZQ.js} +3 -3
  36. package/dist/{chunk-36NWC4GV.js.map → chunk-QEAF57ZQ.js.map} +1 -1
  37. package/dist/{chunk-SAXWCGWR.js → chunk-SOUDKESO.js} +14 -7
  38. package/dist/chunk-SOUDKESO.js.map +1 -0
  39. package/dist/{chunk-54W6VAI3.js → chunk-THGJLR5S.js} +5 -5
  40. package/dist/{chunk-54W6VAI3.js.map → chunk-THGJLR5S.js.map} +1 -1
  41. package/dist/{chunk-LMCUGYHT.js → chunk-YMVUQ2L7.js} +3 -3
  42. package/dist/{chunk-LMCUGYHT.js.map → chunk-YMVUQ2L7.js.map} +1 -1
  43. package/dist/components/ambient-background/index.js +9 -23
  44. package/dist/components/ambient-background/index.js.map +1 -1
  45. package/dist/components/ambient-background/starfield.d.ts.map +1 -1
  46. package/dist/components/app-shell/app-shell.d.ts +55 -10
  47. package/dist/components/app-shell/app-shell.d.ts.map +1 -1
  48. package/dist/components/app-shell/index.d.ts +1 -1
  49. package/dist/components/app-shell/index.d.ts.map +1 -1
  50. package/dist/components/app-shell/index.js +297 -36
  51. package/dist/components/app-shell/index.js.map +1 -1
  52. package/dist/components/autocomplete/index.js +3 -3
  53. package/dist/components/avatar/avatar.d.ts +1 -1
  54. package/dist/components/avatar/avatar.d.ts.map +1 -1
  55. package/dist/components/avatar/index.js +10 -1
  56. package/dist/components/avatar/index.js.map +1 -1
  57. package/dist/components/button-group/button-group.d.ts +10 -2
  58. package/dist/components/button-group/button-group.d.ts.map +1 -1
  59. package/dist/components/button-group/index.js +1 -1
  60. package/dist/components/button-multi-select/index.js +2 -2
  61. package/dist/components/button-select/button-select-control.d.ts +4 -1
  62. package/dist/components/button-select/button-select-control.d.ts.map +1 -1
  63. package/dist/components/button-select/button-select.d.ts +4 -1
  64. package/dist/components/button-select/button-select.d.ts.map +1 -1
  65. package/dist/components/button-select/index.js +2 -2
  66. package/dist/components/camera/index.js +5 -5
  67. package/dist/components/code-block/chrome.js +3 -3
  68. package/dist/components/code-block/index.js +4 -4
  69. package/dist/components/combobox/index.js +3 -3
  70. package/dist/components/combobox-list/index.js +5 -5
  71. package/dist/components/data-table/index.js +13 -13
  72. package/dist/components/date-picker/index.js +7 -7
  73. package/dist/components/drawer/index.js +2 -2
  74. package/dist/components/geodesic/a11y.d.ts +3 -3
  75. package/dist/components/geodesic/a11y.d.ts.map +1 -1
  76. package/dist/components/geodesic/badge-frame.d.ts +13 -1
  77. package/dist/components/geodesic/badge-frame.d.ts.map +1 -1
  78. package/dist/components/geodesic/exam-badge.d.ts +4 -1
  79. package/dist/components/geodesic/exam-badge.d.ts.map +1 -1
  80. package/dist/components/geodesic/geometry.d.ts +14 -9
  81. package/dist/components/geodesic/geometry.d.ts.map +1 -1
  82. package/dist/components/geodesic/index.js +62 -23
  83. package/dist/components/geodesic/index.js.map +1 -1
  84. package/dist/components/geodesic/status.d.ts +8 -6
  85. package/dist/components/geodesic/status.d.ts.map +1 -1
  86. package/dist/components/geodesic/styles.css +15 -2
  87. package/dist/components/hover-card/index.js +2 -2
  88. package/dist/components/indicator/index.js +23 -8
  89. package/dist/components/indicator/index.js.map +1 -1
  90. package/dist/components/indicator/indicator.d.ts +15 -6
  91. package/dist/components/indicator/indicator.d.ts.map +1 -1
  92. package/dist/components/lightbox/index.js +2 -2
  93. package/dist/components/menu/index.js +3 -3
  94. package/dist/components/modal/index.js +2 -2
  95. package/dist/components/multi-combobox-list/index.js +5 -5
  96. package/dist/components/multi-select/index.js +3 -3
  97. package/dist/components/nav-link/index.js +5 -1
  98. package/dist/components/nav-link/nav-link.d.ts.map +1 -1
  99. package/dist/components/nav-link/tanstack.js +5 -1
  100. package/dist/components/nav-link/tanstack.js.map +1 -1
  101. package/dist/components/number-input/index.js +3 -3
  102. package/dist/components/overlays/index.js +3 -3
  103. package/dist/components/photo-capture/index.js +5 -5
  104. package/dist/components/popover/index.js +2 -2
  105. package/dist/components/schedule/index.js +3 -3
  106. package/dist/components/segment-group/index.js +1 -1
  107. package/dist/components/segment-group/segment-group.d.ts +6 -1
  108. package/dist/components/segment-group/segment-group.d.ts.map +1 -1
  109. package/dist/components/select/index.js +4 -4
  110. package/dist/components/spotlight/index.js +4 -4
  111. package/dist/components/tabs/index.js +1 -1
  112. package/dist/components/tabs/tabs-data.d.ts +4 -1
  113. package/dist/components/tabs/tabs-data.d.ts.map +1 -1
  114. package/dist/components/tabs/tabs.d.ts +4 -1
  115. package/dist/components/tabs/tabs.d.ts.map +1 -1
  116. package/dist/components/tags-input/index.js +2 -2
  117. package/dist/components/time-input/index.js +5 -5
  118. package/dist/components/tree-multi-select/index.js +3 -3
  119. package/dist/components/tree-select/index.js +3 -3
  120. package/dist/lib/sidebar-rail.d.ts +21 -0
  121. package/dist/lib/sidebar-rail.d.ts.map +1 -0
  122. package/dist/theme.css +7 -12
  123. package/package.json +1 -1
  124. package/src/as-child.contract.test.tsx +6 -0
  125. package/src/components/ambient-background/starfield.tsx +14 -41
  126. package/src/components/app-shell/app-shell.test.tsx +430 -5
  127. package/src/components/app-shell/app-shell.tsx +484 -24
  128. package/src/components/app-shell/index.ts +2 -0
  129. package/src/components/avatar/avatar.test.tsx +12 -0
  130. package/src/components/avatar/avatar.tsx +9 -0
  131. package/src/components/button-group/button-group.test.tsx +24 -0
  132. package/src/components/button-group/button-group.tsx +21 -4
  133. package/src/components/button-multi-select/button-multi-select.test.tsx +15 -0
  134. package/src/components/button-select/button-select-control.tsx +5 -0
  135. package/src/components/button-select/button-select.test.tsx +25 -0
  136. package/src/components/button-select/button-select.tsx +13 -2
  137. package/src/components/geodesic/badge-frame.tsx +67 -13
  138. package/src/components/geodesic/exam-badge.tsx +8 -4
  139. package/src/components/geodesic/geometry.ts +8 -6
  140. package/src/components/geodesic/status.test.ts +11 -2
  141. package/src/components/geodesic/status.ts +11 -7
  142. package/src/components/geodesic/styles.css +15 -2
  143. package/src/components/indicator/indicator.test.tsx +45 -0
  144. package/src/components/indicator/indicator.tsx +40 -13
  145. package/src/components/nav-link/nav-link.test.tsx +121 -1
  146. package/src/components/nav-link/nav-link.tsx +78 -29
  147. package/src/components/segment-group/segment-group.test.tsx +22 -0
  148. package/src/components/segment-group/segment-group.tsx +35 -19
  149. package/src/components/tabs/tabs-data.tsx +5 -1
  150. package/src/components/tabs/tabs.test.tsx +28 -0
  151. package/src/components/tabs/tabs.tsx +14 -4
  152. package/src/lib/sidebar-rail.ts +24 -0
  153. package/src/theme.css +7 -12
  154. package/src/theme.test.ts +0 -1
  155. package/dist/chunk-7HZBD4YZ.js.map +0 -1
  156. package/dist/chunk-HRNWWL3Y.js.map +0 -1
  157. package/dist/chunk-MW42XVPD.js.map +0 -1
  158. package/dist/chunk-SAXWCGWR.js.map +0 -1
  159. package/dist/chunk-XUFCI262.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/tabs/tabs.tsx","../src/components/tabs/tabs-data.tsx"],"names":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A,EACA;AACF,CAAC","file":"chunk-SOUDKESO.js","sourcesContent":["\"use client\"\n\nimport { Tabs as Ark, useTabsContext } from \"@ark-ui/react/tabs\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { createContext, useCallback, useContext, useEffect, useMemo, useState } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { useDirectionCheck } from \"../../lib/intl\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\n\n/**\n * Tabs — a navigation control on Ark UI's Tabs machine: a row (or column) of\n * triggers, each revealing its own content panel, over a hairline baseline\n * that spans the whole list. An indicator slides to the active trigger. Two\n * classic looks:\n *\n * - `underline` (default) — a 2px bar on the baseline under the active label.\n * - `enclosed` — the active tab is a hairline box (top + sides) that opens the\n * baseline beneath it, so the tab reads as attached to its panel.\n *\n * For a segmented pill tray, use `SegmentGroup` instead: Tabs is navigation\n * between content panels, not a single-choice value, and has no `Field`\n * integration (no label/description/error/name).\n *\n * Two ways to use it:\n *\n * // 1. Data-driven — the common case\n * <Tabs\n * color=\"brand\"\n * defaultValue=\"overview\"\n * data={[\n * { value: \"overview\", label: \"Overview\", content: <Overview /> },\n * { value: \"activity\", label: \"Activity\", content: <Activity /> },\n * ]}\n * />\n *\n * // 2. Compound — for anything the data array can't express\n * <Tabs.Root defaultValue=\"overview\">\n * <Tabs.List variant=\"enclosed\" color=\"brand\">\n * <Tabs.Indicator />\n * <Tabs.Trigger value=\"overview\">Overview</Tabs.Trigger>\n * <Tabs.Trigger value=\"activity\">Activity</Tabs.Trigger>\n * </Tabs.List>\n * <Tabs.Content value=\"overview\"><Overview /></Tabs.Content>\n * <Tabs.Content value=\"activity\"><Activity /></Tabs.Content>\n * </Tabs.Root>\n *\n * `variant`, `size` and `color` all live on `List` and apply to the baseline,\n * every trigger, and the indicator — set them once on `List` rather than\n * repeating them on each `Trigger`. `color` is a `data-color` attribute, so it\n * is scoped to the strip: it deliberately does *not* sit on `Root`, which also\n * wraps every `Content` panel and would leak the palette into whatever those\n * panels render — an uncoloured `Button` inside a panel would silently adopt\n * the tab's palette (#140).\n */\n\n/** The list: a full-width row (or column) with a hairline baseline on the\n * block-end edge when horizontal and the inline-end edge when vertical\n * (logical, so it flips under RTL). No tray fill, no inset, no separators.\n *\n * `underline` paints the baseline as the list's own border, in the kit's\n * hairline recipe (`border-brand-900/20 dark:border-white/15`). `enclosed`\n * keeps the same 1px border *transparent* — the geometry is identical, but\n * the line itself is drawn by the indicator (see `tabsIndicator`), which\n * needs the list to clip it at its two ends along the main axis. `clip`\n * rather than `hidden`: it creates no scroll container, and leaves the cross\n * axis visible. */\nconst tabsList = cva(\n [\n \"relative flex\",\n \"data-[orientation=horizontal]:border-b\",\n \"data-[orientation=vertical]:flex-col data-[orientation=vertical]:border-e\",\n ],\n {\n variants: {\n variant: {\n underline: \"border-brand-900/20 dark:border-white/15\",\n enclosed: [\n \"border-transparent\",\n \"data-[orientation=horizontal]:overflow-x-clip data-[orientation=vertical]:overflow-y-clip\",\n ],\n },\n size: {\n xs: \"gap-1\",\n sm: \"gap-1.5\",\n md: \"gap-2\",\n lg: \"gap-3\",\n xl: \"gap-4\",\n },\n },\n defaultVariants: { variant: \"underline\", size: \"md\" },\n },\n)\n\n/**\n * Each trigger. Every label sits on the page surface, never on a colored fill,\n * so there is no `--c-on-solid` branch. An unselected label is Figma's\n * `Text/text-secondary` (`TEXT_COLOR_CLASSES.secondary`), and the selected one\n * is `Text/text-primary`, or `--c-text` when the trigger or its list has a\n * `color`.\n *\n * The hover lift is scoped to unselected triggers: the selected label already\n * has its final color, and an unscoped `hover:` would tie on specificity and\n * win on source order alone, overriding `--c-text` with the neutral text.\n * Mirrors `Button`'s own `not-data-loading:hover:` scoping.\n *\n * Before the indicator is measured: Ark renders the indicator `hidden` with\n * no rect on the server, and shows it only once it has measured the selected\n * trigger on the client. Until then (`tabs-unmeasured:`, theme.css) the\n * selected trigger draws a static copy of the indicator from its own\n * pseudo-elements: the bar for `underline`; the box and the baseline around\n * it for `enclosed`, whose baseline would otherwise not exist at all. The\n * geometry is always there and only the paint is gated, and Ark unhides the\n * indicator in the same render it sets the rect, so the copy and the real\n * thing swap within one frame, in the same place and color. The indicator\n * doesn't slide in from 0,0 either: it comes out of `display: none`, which\n * starts no transition.\n */\nconst tabsTrigger = cva(\n [\n \"relative z-1 cursor-pointer text-center font-medium whitespace-nowrap select-none\",\n \"data-[orientation=vertical]:text-start\",\n TEXT_COLOR_CLASSES.secondary,\n \"not-data-selected:hover:text-brand-950 dark:not-data-selected:hover:text-white\",\n \"transition-colors\",\n \"data-disabled:cursor-not-allowed data-disabled:opacity-50\",\n ],\n {\n variants: {\n variant: {\n // The trigger paints nothing of its own (the bar is the indicator's\n // border), so its radius only shapes the focus ring: the same `xs`\n // the enclosed ring follows.\n underline: [\n focusStyles(),\n \"rounded-xs\",\n // Static bar (see \"Before the indicator is measured\" above): the\n // indicator's 2px border, one pixel past the trigger's edge.\n \"after:pointer-events-none after:absolute\",\n \"data-[orientation=horizontal]:after:inset-x-0 data-[orientation=horizontal]:after:-bottom-px data-[orientation=horizontal]:after:h-0.5\",\n \"data-[orientation=vertical]:after:inset-y-0 data-[orientation=vertical]:after:-end-px data-[orientation=vertical]:after:w-0.5\",\n ],\n // The enclosed list clips along its main axis, which would cut an\n // outset ring off the first and last triggers, so the ring goes\n // inside, rounded like the indicator box it matches.\n enclosed: [\n focusStyles({ inset: true, offset: false }),\n \"data-[orientation=horizontal]:rounded-t-xs data-[orientation=vertical]:rounded-s-xs\",\n // Static box (`::after`): the indicator's rect, shifted one pixel\n // toward the baseline, open on that side.\n \"after:pointer-events-none after:absolute after:border after:border-transparent\",\n \"data-[orientation=horizontal]:after:inset-x-0 data-[orientation=horizontal]:after:top-px data-[orientation=horizontal]:after:-bottom-px data-[orientation=horizontal]:after:border-b-0 data-[orientation=horizontal]:after:rounded-t-xs\",\n \"data-[orientation=vertical]:after:inset-y-0 data-[orientation=vertical]:after:start-px data-[orientation=vertical]:after:-end-px data-[orientation=vertical]:after:border-e-0 data-[orientation=vertical]:after:rounded-s-xs\",\n \"tabs-unmeasured:data-selected:after:border-(color:--default-border-color)\",\n // Static baseline (`::before`): a strip reaching 100vmax past both\n // ends of the trigger, painted by two backgrounds that each stop at\n // the trigger's edge, so it is open exactly under the box — the\n // indicator's two segments, in one pseudo-element. The list clips\n // it, as it clips the indicator's.\n \"before:pointer-events-none before:absolute before:bg-no-repeat\",\n \"data-[orientation=horizontal]:before:-inset-x-[100vmax] data-[orientation=horizontal]:before:-bottom-px data-[orientation=horizontal]:before:h-px data-[orientation=horizontal]:before:bg-[length:100vmax_1px] data-[orientation=horizontal]:before:bg-[position:left_bottom,right_bottom]\",\n \"data-[orientation=vertical]:before:-inset-y-[100vmax] data-[orientation=vertical]:before:-end-px data-[orientation=vertical]:before:w-px data-[orientation=vertical]:before:bg-[length:1px_100vmax] data-[orientation=vertical]:before:bg-[position:top,bottom]\",\n \"tabs-unmeasured:data-selected:before:bg-[image:linear-gradient(var(--default-border-color),var(--default-border-color)),linear-gradient(var(--default-border-color),var(--default-border-color))]\",\n ],\n },\n colored: {\n true: \"data-selected:text-(--c-text)\",\n false: \"data-selected:text-brand-950 dark:data-selected:text-white\",\n },\n // An even share of the list per trigger, like a tab bar. Read from\n // `TabsStyleContext` (set by `List`'s `grow`), not a child selector on\n // the list, so a custom element in the list never grows by accident.\n grow: { true: \"flex-1\" },\n size: {\n xs: \"px-2 py-0.5 text-xs\",\n sm: \"px-2.5 py-1 text-sm\",\n md: \"px-3 py-1.5 text-md\",\n lg: \"px-4 py-2 text-lg\",\n xl: \"px-5 py-2.5 text-xl\",\n },\n },\n // The static bar's color, chosen once per case like the indicator's.\n // Uncolored, `currentColor` is the selected label's `Text/text-primary`,\n // the same pair the indicator's `Border/border-full` bar paints.\n compoundVariants: [\n {\n variant: \"underline\",\n colored: false,\n className: \"tabs-unmeasured:data-selected:after:bg-current\",\n },\n {\n variant: \"underline\",\n colored: true,\n className: \"tabs-unmeasured:data-selected:after:bg-(--c-solid)\",\n },\n ],\n defaultVariants: { variant: \"underline\", colored: false, size: \"md\" },\n },\n)\n\n/**\n * The sliding indicator. It always covers the active trigger's rect, shifted\n * one pixel outward so its edge lands *on* the baseline row rather than beside\n * it (down when horizontal; toward the inline end when vertical, which is the\n * left edge under RTL, hence the `ltr:`/`rtl:` pair — `translate` has no\n * logical form).\n *\n * - `underline`: the 2px bar is the box's own block-end (or inline-end)\n * border, so one rect drives both axes and logical borders handle RTL. It\n * paints `--c-solid` with a `color`, and Figma's `Border/border-full`\n * (the selected label's `Text/text-primary` pair) without one.\n * - `enclosed`: a hairline box open on the baseline side. The baseline is\n * drawn by the box itself, as two 1px segments (`::before` / `::after`)\n * running from its corners out past both ends of the list, which clips them\n * (`tabsList`). So the line is open exactly under the active tab and the gap\n * slides with it, without painting over anything: an opaque patch over a\n * list-drawn baseline would have to guess the surface color, and showed as\n * a dark hole on a translucent `Card` or a colored one. Each segment starts\n * one pixel past the box's side border so the two never overlap (the\n * hairline is translucent, and an overlap would darken the corner pixel).\n * `100vmax` is \"longer than any list\": the clip trims it.\n */\nconst tabsIndicator = cva(\n [\n \"z-0 box-border\",\n // The slide's duration, read by the inline `transition-duration` (see\n // `Indicator`); reduced motion zeroes it, so the bar jumps instead.\n \"[--indicator-duration:var(--duration-normal)] motion-reduce:[--indicator-duration:0s]\",\n // Ark measures with offsetLeft/offsetWidth, which round to whole pixels.\n // On the cross axis every trigger fills the list, so pin it to the list's\n // exact box instead: a vertical list is often a fractional width, and the\n // rounded rect pushed the baseline half a pixel off the list's edge (and\n // off the static copy the SSR HTML draws).\n \"data-[orientation=horizontal]:[--tabs-top:0px] data-[orientation=horizontal]:[--tabs-height:100%]\",\n \"data-[orientation=vertical]:[--tabs-left:0px] data-[orientation=vertical]:[--tabs-width:100%]\",\n \"data-[orientation=horizontal]:translate-y-px\",\n \"data-[orientation=vertical]:ltr:translate-x-px data-[orientation=vertical]:rtl:-translate-x-px\",\n ],\n {\n variants: {\n variant: {\n underline:\n \"data-[orientation=horizontal]:border-b-2 data-[orientation=vertical]:border-e-2\",\n enclosed: [\n \"border border-brand-900/20 dark:border-white/15\",\n \"before:absolute before:bg-brand-900/20 dark:before:bg-white/15\",\n \"after:absolute after:bg-brand-900/20 dark:after:bg-white/15\",\n \"data-[orientation=horizontal]:rounded-t-xs data-[orientation=horizontal]:border-b-0\",\n \"data-[orientation=horizontal]:before:bottom-0 data-[orientation=horizontal]:before:right-[calc(100%+1px)] data-[orientation=horizontal]:before:h-px data-[orientation=horizontal]:before:w-[100vmax]\",\n \"data-[orientation=horizontal]:after:bottom-0 data-[orientation=horizontal]:after:left-[calc(100%+1px)] data-[orientation=horizontal]:after:h-px data-[orientation=horizontal]:after:w-[100vmax]\",\n \"data-[orientation=vertical]:rounded-s-xs data-[orientation=vertical]:border-e-0\",\n \"data-[orientation=vertical]:before:end-0 data-[orientation=vertical]:before:bottom-[calc(100%+1px)] data-[orientation=vertical]:before:w-px data-[orientation=vertical]:before:h-[100vmax]\",\n \"data-[orientation=vertical]:after:end-0 data-[orientation=vertical]:after:top-[calc(100%+1px)] data-[orientation=vertical]:after:w-px data-[orientation=vertical]:after:h-[100vmax]\",\n ],\n },\n colored: { true: \"\", false: \"\" },\n },\n // The bar's color is chosen in exactly one place per case: with both a\n // neutral border color and `border-(--c-solid)` in the list,\n // tailwind-merge can't tell that a bare `border-(--var)` is a color (it\n // could be a width), keeps both, and the stylesheet's order picks one.\n compoundVariants: [\n {\n variant: \"underline\",\n colored: false,\n className: \"border-brand-950 dark:border-white\",\n },\n { variant: \"underline\", colored: true, className: \"border-(--c-solid)\" },\n ],\n defaultVariants: { variant: \"underline\", colored: false },\n },\n)\n\n/** The root. Vertical tabs put the list *beside* the panels, so the baseline\n * on the list's inline-end edge runs between the two; horizontal stays a\n * plain block, list over panel. */\nconst tabsRoot = \"data-[orientation=vertical]:flex\"\n\n/** The content panel, spaced off the baseline: below it when horizontal,\n * after it (and filling the rest of the row) when vertical. Ark makes the\n * active panel focusable (roving from its trigger), so it gets its own focus\n * ring, matching the kit-wide convention. */\nconst tabsContent = cn(\n \"rounded-xs data-[orientation=horizontal]:mt-3\",\n \"data-[orientation=vertical]:ms-4 data-[orientation=vertical]:min-w-0 data-[orientation=vertical]:flex-1\",\n focusStyles(),\n)\n\nexport type TabsVariant = NonNullable<VariantProps<typeof tabsList>[\"variant\"]>\n\n/** Shared strip configuration, set once on `List` and read by `Trigger` and\n * `Indicator` so callers don't repeat `variant` / `size` on every trigger.\n *\n * `color` is *this* list's own palette, never an ancestor's: an ancestor's\n * `data-color` (a colored `Card` around the tabs) must not turn the selected\n * label and the bar into that palette, so \"is it colored\" can't be a\n * `[data-color]` selector — it is whether a `color` was passed here or on\n * the trigger.\n *\n * `colors` maps each trigger's value to its own `color`, for the triggers\n * that set one. `Indicator` reads it to paint itself in the selected tab's\n * palette. Triggers write it through `setTriggerColor` from an effect, so\n * the map is empty during SSR and the first client render; that is\n * harmless, because Ark keeps the indicator `hidden` until it has measured\n * the selected trigger, which also happens in an effect, after the\n * triggers' own (children's effects run first). */\ntype TabsStyle = {\n variant: TabsVariant\n size: Size\n grow: boolean\n color: Color | undefined\n colors: Readonly<Record<string, Color>>\n setTriggerColor: (value: string, color: Color | undefined) => void\n}\n\nconst TabsStyleContext = createContext<TabsStyle>({\n variant: \"underline\",\n size: \"md\",\n grow: false,\n color: undefined,\n colors: {},\n setTriggerColor: () => {},\n})\n\n/** `color` is deliberately omitted, not merely absent: React's `HTMLAttributes`\n * carries a legacy `color?: string`, so without the `Omit` a stale\n * `<Tabs.Root color=\"brand\">` would still compile and fall through `...rest`\n * onto the div as the deprecated HTML attribute — silently losing the palette.\n * Omitting it turns every such call site into a compile error pointing at the\n * line to change. Same convention as `Button` / `ActionIcon` (code-style.md). */\nexport type TabsRootProps = Omit<Ark.RootProps, \"color\"> & WithTestId\n\nconst Root = ({ orientation = \"horizontal\", className, testId, ...rest }: TabsRootProps) => {\n const checkDirection = useDirectionCheck()\n return (\n // `key={orientation}` remounts on an axis flip so Ark re-measures the\n // indicator rect for the new layout (it only measures on mount + value\n // change, mirroring the same limitation `SegmentGroup` works around) — at\n // the cost of resetting an *uncontrolled* value on that flip. Pass a\n // controlled `value` if the orientation can change at runtime and the\n // selection must survive it.\n <Ark.Root\n key={orientation}\n orientation={orientation}\n ref={checkDirection}\n className={cn(tabsRoot, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n )\n}\n\nexport type TabsListProps = Omit<Ark.ListProps, \"color\"> &\n WithTestId & {\n variant?: TabsVariant\n size?: Size\n /** Palette for the underline bar + active-trigger text. Sets `data-color`\n * on the list, so the `--c-*` slots reach the triggers and the indicator\n * without reaching the `Content` panels. */\n color?: Color\n /** Give every trigger an even share of the list's width (its height when\n * vertical), like a tab bar. Without it the triggers hug their labels. */\n grow?: boolean\n }\n\nconst List = ({\n variant = \"underline\",\n size = \"md\",\n grow = false,\n color,\n className,\n testId,\n ...rest\n}: TabsListProps) => {\n const [colors, setColors] = useState<Readonly<Record<string, Color>>>({})\n const setTriggerColor = useCallback((value: string, triggerColor: Color | undefined) => {\n setColors((prev) => {\n if (prev[value] === triggerColor) return prev\n const { [value]: _dropped, ...others } = prev\n return triggerColor === undefined ? others : { ...others, [value]: triggerColor }\n })\n }, [])\n const style = useMemo(\n () => ({ variant, size, grow, color, colors, setTriggerColor }),\n [variant, size, grow, color, colors, setTriggerColor],\n )\n return (\n <TabsStyleContext.Provider value={style}>\n <Ark.List\n className={cn(tabsList({ variant, size }), className)}\n data-color={color}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n </TabsStyleContext.Provider>\n )\n}\n\n/** `color` is omitted from Ark's props for the same reason as on `Root`\n * (React's legacy HTML `color?: string`) and re-added as the kit's palette. */\nexport type TabsTriggerProps = Omit<Ark.TriggerProps, \"color\"> &\n WithTestId & {\n /** This tab's own palette for its selected label and, while it is\n * selected, the indicator. Beats `List`'s `color`. Sets `data-color` on\n * the trigger only, so it never reaches the panels. */\n color?: Color\n }\n\nconst Trigger = ({ color, className, testId, ...rest }: TabsTriggerProps) => {\n const { variant, size, grow, color: listColor, setTriggerColor } = useContext(TabsStyleContext)\n const { value } = rest\n useEffect(() => {\n setTriggerColor(value, color)\n return () => setTriggerColor(value, undefined)\n }, [value, color, setTriggerColor])\n return (\n <Ark.Trigger\n className={cn(\n tabsTrigger({ variant, size, grow, colored: (color ?? listColor) !== undefined }),\n className,\n )}\n data-color={color}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n )\n}\n\nexport type TabsContentProps = Ark.ContentProps & WithTestId\n\nconst Content = ({ className, testId, ...rest }: TabsContentProps) => (\n <Ark.Content\n className={cn(tabsContent, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type TabsIndicatorProps = Ark.IndicatorProps & WithTestId\n\n/** The sliding indicator. Ark sets `position: absolute` + `--left`/`--top`/\n * `--width`/`--height` (the selected trigger's rect) inline, so it sits\n * behind the labels (`z-0`). Ark only places the main axis (`left` when\n * horizontal, `top` when vertical) and leaves the other at its static\n * position; we pin both, because the box must line up with the trigger's\n * edge on the baseline side, not wherever the flow happens to put it.\n *\n * We drive the slide transition ourselves rather than via Ark's gated\n * `animateIndicator` flag — the same fix `SegmentGroup` uses: Ark sets\n * `transition-property: none` whenever that flag is false, including the\n * instant it receives the `transitionend` of ANY animated property. With\n * several properties of differing end-times (a `left` redirected by an\n * interrupting click vs. a color/width that already settled), that early end\n * would null the transition and snap the indicator mid-slide. Overriding the real\n * `transition-*` props (our `style` wins via Ark's `mergeProps`) keeps the\n * transition always on, so interruptions re-target smoothly.\n *\n * The duration is read from `--indicator-duration` rather than written inline,\n * so the `motion-reduce:` class on `tabsIndicator` can zero it: an inline value\n * would beat any class, and the slide would play under reduced motion. */\nconst Indicator = ({ className, style, testId, ...rest }: TabsIndicatorProps) => {\n const { variant, color: listColor, colors } = useContext(TabsStyleContext)\n const { value } = useTabsContext()\n // The selected tab's own color, else the list's. Set as the indicator's own\n // `data-color` so its `--c-*` slots switch with the selection, and the\n // `border-color` transition below cross-fades the bar as it slides.\n const color = (value ? colors[value] : undefined) ?? listColor\n return (\n <Ark.Indicator\n data-color={color}\n style={{\n left: \"var(--tabs-left, var(--left))\",\n top: \"var(--tabs-top, var(--top))\",\n width: \"var(--tabs-width, var(--width))\",\n height: \"var(--tabs-height, var(--height))\",\n transitionProperty: \"left, top, width, height, background-color, border-color\",\n transitionDuration: \"var(--indicator-duration)\",\n transitionTimingFunction: \"var(--ease-emphasized)\",\n ...style,\n }}\n className={cn(tabsIndicator({ variant, colored: color !== undefined }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n )\n}\n\nexport { Content, Indicator, List, Root, Trigger }\nexport const Context = Ark.Context\n","\"use client\"\n\nimport type { ReactNode } from \"react\"\nimport type { ForbidAsChild } from \"../../lib/as-child\"\nimport type { Color } from \"../../lib/colors\"\nimport type { Size } from \"../../lib/sizes\"\nimport {\n Content,\n Context,\n Indicator,\n List,\n Root,\n type TabsRootProps,\n type TabsVariant,\n Trigger,\n} from \"./tabs\"\n\n/**\n * Data-driven Tabs — the convenience wrapper over the composable parts, for\n * the common case of a flat list of label + panel pairs:\n *\n * <Tabs\n * data={[\n * { value: \"overview\", label: \"Overview\", content: <Overview /> },\n * { value: \"activity\", label: \"Activity\", content: <Activity /> },\n * ]}\n * />\n *\n * Generic over `const data`, so an item's `value` narrows `onChange`. The\n * first item is selected by default when neither `value` nor `defaultValue`\n * is given — the low-level `Root` part has no `data` to default from, so this\n * only happens here. Drop to `Tabs.Root` / `Tabs.List` / `Tabs.Trigger` /\n * `Tabs.Content` for anything the flat array can't express (custom trigger\n * content, interleaved non-tab elements, …).\n */\n\n/** One tab: a trigger label and its panel content. */\nexport type TabsItem = {\n value: string\n label: ReactNode\n content: ReactNode\n disabled?: boolean\n /** This tab's own palette: its selected label, and the underline bar while\n * it is selected. Beats the `color` prop. */\n color?: Color\n /** `data-testid` on the trigger; the matching content panel gets\n * `` `${testId}-panel` ``. Defaults to `` `tab-${value}` `` / `` `tab-${value}-panel` ``\n * when omitted. Ark's own `data-value={value}` is also always present on the\n * trigger as a complementary, zero-config selector. */\n testId?: string\n}\n\n/** The `data` array `Tabs` is generic over. */\nexport type TabsData = ReadonlyArray<TabsItem>\n\n/** Extract the value-string union from a `TabsData` shape, for a typed `onChange`. */\nexport type TabsValue<Data extends TabsData> = Data[number][\"value\"]\n\nexport type TabsProps<Data extends TabsData = TabsData> = Omit<\n TabsRootProps,\n \"children\" | \"onValueChange\" | \"onChange\" | \"asChild\"\n> &\n ForbidAsChild & {\n /** Tabs, in order. Each needs its own `content`. */\n data: Data\n /** `underline` (default): a bar under the active tab. `enclosed`: the\n * active tab is a box attached to its panel. */\n variant?: TabsVariant\n /** Trigger size. */\n size?: Size\n /** Palette for the underline bar + active-trigger text. Scoped to the\n * strip (it lands on the `List`), so it never tints the panel content. */\n color?: Color\n /** Give every tab an even share of the strip, like a tab bar. Lands on the\n * `List`. */\n grow?: boolean\n /** Fires with the selected value (narrowed to the data value union). */\n onChange?: (value: TabsValue<Data>) => void\n }\n\nconst TabsComponent = <const Data extends TabsData>({\n data,\n variant,\n size,\n color,\n grow,\n value,\n defaultValue,\n onChange,\n asChild: _asChild,\n ...root\n}: TabsProps<Data>) => (\n <Root\n value={value}\n defaultValue={defaultValue ?? data[0]?.value}\n onValueChange={onChange ? (d) => onChange(d.value as TabsValue<Data>) : undefined}\n {...root}\n >\n <List variant={variant} size={size} color={color} grow={grow}>\n <Indicator />\n {data.map((item) => (\n <Trigger\n key={item.value}\n value={item.value}\n disabled={item.disabled}\n color={item.color}\n testId={item.testId ?? `tab-${item.value}`}\n >\n {item.label}\n </Trigger>\n ))}\n </List>\n {data.map((item) => (\n <Content\n key={item.value}\n value={item.value}\n testId={`${item.testId ?? `tab-${item.value}`}-panel`}\n >\n {item.content}\n </Content>\n ))}\n </Root>\n)\n\n/**\n * The public `Tabs` export — callable for the data-driven form, with the\n * composable parts attached (like `Menu`). `<Tabs data={…}>` and\n * `<Tabs.Root>…</Tabs.Root>` both work from one import.\n */\nexport const Tabs = Object.assign(TabsComponent, {\n Root,\n List,\n Trigger,\n Content,\n Indicator,\n Context,\n})\n"]}
@@ -1,8 +1,8 @@
1
- import { ComboboxSearchRow } from './chunk-36NWC4GV.js';
1
+ import { ComboboxSearchRow } from './chunk-QEAF57ZQ.js';
2
2
  import { normalizeSelectData, useLabelSearch, filterSelectData } from './chunk-7TDHT3QD.js';
3
- import { COMBOBOX_DEFAULT_TRANSLATIONS, Combobox } from './chunk-6UIQJJNJ.js';
3
+ import { COMBOBOX_DEFAULT_TRANSLATIONS, Combobox } from './chunk-2NTCQIRP.js';
4
4
  import { FieldShell } from './chunk-X6DESK37.js';
5
- import { popoverIndicator } from './chunk-N66NC6QK.js';
5
+ import { popoverIndicator } from './chunk-E3XLWMEB.js';
6
6
  import { useUncontrolled } from './chunk-PMUCGFY5.js';
7
7
  import { CheckIcon, CloseIcon } from './chunk-6YNLRQ25.js';
8
8
  import { mergeIcons, iconStroke } from './chunk-XXOR34T4.js';
@@ -143,5 +143,5 @@ var ComboboxList = ({
143
143
  };
144
144
 
145
145
  export { ComboboxList };
146
- //# sourceMappingURL=chunk-54W6VAI3.js.map
147
- //# sourceMappingURL=chunk-54W6VAI3.js.map
146
+ //# sourceMappingURL=chunk-THGJLR5S.js.map
147
+ //# sourceMappingURL=chunk-THGJLR5S.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/combobox-list/combobox-list.tsx"],"names":["ArkCombobox"],"mappings":";;;;;;;;;;;;;AA8DO,IAAM,aAAA,GAAyD;AAAA,EACpE,MAAA,kBAAQ,GAAA,CAAC,UAAA,EAAA,EAAW,SAAA,EAAW,UAAA,EAAY,CAAA;AAAA,EAC3C,KAAA,sBAAQ,SA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oBAAQ,GAAA,CAAC,QAAA,CAAS,KAAA,EAAT,EAAgB,QAAA,EAAA,KAAA,EAAM;AAAA,SAAA,EAC3C,CAAA;AAAA,QAKC,IAAA,IAAQ,wBAAQ,GAAA,CAAC,OAAA,EAAA,EAAM,MAAK,QAAA,EAAS,IAAA,EAAY,KAAA,EAAO,KAAA,IAAS,EAAA,EAAI;AAAA;AAAA;AAAA,GACxE;AAGF,EAAA,uBACE,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,WAAA;AAAA,MACA,KAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,IAAA;AAAA,MACA,WAAW,UAAA,EAAY,KAAA;AAAA,MAEtB,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ","file":"chunk-54W6VAI3.js","sourcesContent":["\"use client\"\n\nimport { Combobox as ArkCombobox } from \"@ark-ui/react/combobox\"\nimport { SearchIcon } from \"lucide-react\"\nimport { type FocusEvent, type ReactNode, type Ref, useMemo, useState } from \"react\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport {\n filterSelectData,\n type NormalizedItemOf,\n normalizeSelectData,\n type RenderItem,\n type SelectData,\n type SelectValue,\n useLabelSearch,\n} from \"../../lib/select-data\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport {\n COMBOBOX_DEFAULT_TRANSLATIONS,\n Combobox,\n type ComboboxTranslations,\n} from \"../combobox/combobox\"\nimport { type FieldProps, FieldShell } from \"../field/field\"\nimport type { InputSize, InputVariant } from \"../input/input\"\nimport { CheckIcon, CloseIcon } from \"../popover/icons\"\nimport { popoverIndicator } from \"../popover/popover\"\nimport { ComboboxSearchRow } from \"./combobox-search-row\"\n\n/**\n * ComboboxList — a searchable, single-value option list with no trigger of its\n * own. It renders permanently open: embed it inline inside a container you\n * already control the visibility of (a `Popover`, a `Drawer`, a custom panel)\n * rather than owning a floating dropdown. For a self-contained trigger +\n * floating panel, use [`Select`](/docs/select) instead — same `data` contract\n * and value shape, just with its own closed/open trigger button.\n *\n * - `data` / `value` / `onChange` match `Select` exactly\n * (`SelectValue<Data> | null`) — the picked value must come from `data`;\n * for free text see [`Autocomplete`](/docs/autocomplete).\n * - Type to filter; `clearable` adds a clear button next to the search icon\n * once there's a value.\n * - Label / description / error come from the built-in `Field`, same as the\n * rest of the family — omit them when embedding inside your own popover.\n */\n\ntype ComboboxListClassNames = {\n /** The field wrapper (label / description / error). */\n field?: string\n /** The search row (also targeted by `className`). */\n search?: string\n /** The search `<input>`. */\n input?: string\n /** A single option row. */\n option?: string\n /** The scrollable option list. */\n list?: string\n}\n\nexport type ComboboxListIconSlot = \"search\" | \"clear\" | \"check\"\nexport type ComboboxListIcons = IconMap<ComboboxListIconSlot>\n\n/** The default icons: the search row's magnifier and clear ×, and the selected option's check. */\nexport const DEFAULT_ICONS: Record<ComboboxListIconSlot, ReactNode> = {\n search: <SearchIcon className={iconStroke} />,\n clear: <CloseIcon />,\n check: <CheckIcon />,\n}\n\nexport type ComboboxListProps<Data extends SelectData = SelectData> = Pick<\n FieldProps,\n \"label\" | \"description\" | \"error\" | \"required\"\n> &\n WithTestId & {\n /** Options: `string[]`, `{ value, label?, disabled? }[]`, or `{ group, items }[]`. */\n data: Data\n /** Controlled value. */\n value?: SelectValue<Data> | null\n /** Uncontrolled initial value. */\n defaultValue?: SelectValue<Data> | null\n /** Fires with the selected value (or `null` when cleared). */\n onChange?: (value: SelectValue<Data> | null) => void\n /**\n * Render each option yourself. Receives the (value-narrowed) item and its live\n * `{ selected, highlighted }` state; you own the whole row, including any check\n * affordance. Omit it to render the label + selected check.\n */\n renderItem?: RenderItem<Data>\n /** Placeholder for the search field. */\n placeholder?: string\n /** Message shown when no option matches. Pass `null` to render nothing. */\n empty?: ReactNode\n /** Show a clear button once there's a value. */\n clearable?: boolean\n size?: InputSize\n /**\n * Search row treatment. Defaults to `\"unstyled\"` (no border/background) since\n * this is normally embedded inside a container that already draws its own\n * chrome; pass `\"default\"` / `\"filled\"` when using it standalone.\n */\n variant?: InputVariant\n disabled?: boolean\n readOnly?: boolean\n /** Red invalid state, independent of (and OR'd with) `error`. */\n invalid?: boolean\n /** Name for native form submission. */\n name?: string\n /** Forwarded to the search input; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n /** Lands on the focusable search `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n className?: string\n classNames?: ComboboxListClassNames\n /** Overrides the clear button's accessible name (`clearTriggerLabel`, default\n * `\"Clear value\"`) — the same key as the rest of the combobox family. */\n translations?: ComboboxListTranslations\n /** Replaces the default icons: `search`, `clear`, `check`. A missing key keeps its\n * default; `search: null` drops the magnifier. `renderItem` draws its own rows. */\n icons?: ComboboxListIcons\n }\n\n/** The combobox family's `clearTriggerLabel` — the only family key this always-open list\n * renders (it has no chevron). */\nexport type ComboboxListTranslations = Pick<ComboboxTranslations, \"clearTriggerLabel\">\n\n/** Wrap a scalar value into Ark's array contract (or clear with `[]`) — same\n * bridge `Select` uses (`toArkValue`, `select.tsx`). */\nconst toArkValue = (v: string | null): string[] => (v === null ? [] : [v])\n\nexport const ComboboxList = <const Data extends SelectData = SelectData>({\n data,\n value: valueProp,\n defaultValue,\n onChange,\n renderItem,\n placeholder = \"Search…\",\n empty = \"Nothing found\",\n clearable,\n size = \"md\",\n variant = \"unstyled\",\n disabled,\n readOnly,\n required,\n invalid,\n name,\n onBlur,\n ref,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n translations,\n icons: iconsProp,\n}: ComboboxListProps<Data>) => {\n const icons = mergeIcons(DEFAULT_ICONS, iconsProp)\n const clearLabel =\n translations?.clearTriggerLabel ?? COMBOBOX_DEFAULT_TRANSLATIONS.clearTriggerLabel\n type Item = SelectValue<Data>\n\n // Red state is driven independently of the `Field` error slot so a form\n // library can flip it from `fieldState.invalid` (see FormControlProps).\n const isInvalid = invalid || error != null\n\n const [value, setValue] = useUncontrolled<Item | null>({\n value: valueProp,\n defaultValue: defaultValue ?? null,\n onChange,\n })\n const [search, setSearch] = useState(\"\")\n\n // Normalize once per `data`; only the filter re-runs as the query changes.\n const normalized = useMemo(() => normalizeSelectData(data), [data])\n const labelSearch = useLabelSearch()\n const { collection, items, groups } = useMemo(\n () => filterSelectData(normalized, (item) => labelSearch.matches(item.label, search)),\n [normalized, search, labelSearch],\n )\n\n // `canClear` reserves the clear button's box (and the shell's end-slot\n // padding) for the whole time the field is clearable, not just while it\n // has a value — otherwise the button mounting/unmounting shifts the\n // search input's width. `showClear` only toggles visibility/interactivity.\n const canClear = Boolean(clearable) && !disabled && !readOnly\n const showClear = canClear && (value != null || search.length > 0)\n\n const renderOption = (item: NormalizedItemOf<Data>) => (\n <Combobox.Item\n key={item.value}\n item={item}\n data-testid={item.testId}\n className={classNames?.option}\n >\n {renderItem\n ? (state) => renderItem(item, state)\n : // `Combobox.Item`'s own label + check row, with the check from `icons`.\n () => (\n <>\n <ArkCombobox.ItemText>{item.label}</ArkCombobox.ItemText>\n <ArkCombobox.ItemIndicator className={popoverIndicator}>\n {icons.check}\n </ArkCombobox.ItemIndicator>\n </>\n )}\n </Combobox.Item>\n )\n\n const control = (\n <Combobox.Root<NormalizedItemOf<Data>>\n collection={collection}\n value={toArkValue(value)}\n // Ark types the value as `string[]`; it always originates from `data`,\n // so narrow it back to the caller's value union.\n onValueChange={(details) => setValue((details.value[0] ?? null) as Item)}\n inputValue={search}\n onInputValueChange={(details) => setSearch(details.inputValue)}\n // There's no trigger to open it — the caller (e.g. a `Popover`) already\n // owns whether this mounts at all, so keep the machine permanently open.\n open\n onOpenChange={() => {}}\n // The caller's own container (Popover, Drawer, …) already owns\n // dismiss-on-outside-click; without this the always-open machine\n // registers its own (functionally inert, since `onOpenChange` is a\n // no-op) listbox dismissable layer, which logs a spurious\n // \"[@zag-js/dismissable] node is `null` or `undefined`\" warning.\n disableLayer\n closeOnSelect={false}\n autoFocus\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n size={size}\n variant={variant}\n className={className}\n >\n <ComboboxSearchRow\n size={size}\n variant={variant}\n invalid={isInvalid}\n placeholder={placeholder}\n canClear={canClear}\n showClear={showClear}\n clearLabel={clearLabel}\n onClear={() => {\n setValue(null)\n setSearch(\"\")\n }}\n onBlur={onBlur}\n ref={ref}\n testId={testId}\n icons={icons}\n classNames={classNames}\n />\n\n <Combobox.Panel className={classNames?.list}>\n {groups\n ? groups.map((group) => (\n <Combobox.Group key={group.group} label={group.group}>\n {group.items.map(renderOption)}\n </Combobox.Group>\n ))\n : items.map(renderOption)}\n {empty != null && <Combobox.Empty>{empty}</Combobox.Empty>}\n </Combobox.Panel>\n\n {/* Carries the real selection so a native `<form>` submits it — the\n search input is unnamed (it would submit the typed query, not the\n value). */}\n {name != null && <input type=\"hidden\" name={name} value={value ?? \"\"} />}\n </Combobox.Root>\n )\n\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n >\n {control}\n </FieldShell>\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/components/combobox-list/combobox-list.tsx"],"names":["ArkCombobox"],"mappings":";;;;;;;;;;;;;AA8DO,IAAM,aAAA,GAAyD;AAAA,EACpE,MAAA,kBAAQ,GAAA,CAAC,UAAA,EAAA,EAAW,SAAA,EAAW,UAAA,EAAY,CAAA;AAAA,EAC3C,KAAA,sBAAQ,SAAA,EAAA,EAAU,CAAA;AAAA,EAClB,KAAA,sBAAQ,SAAA,EAAA,EAAU;AACpB,CAAA;AA4DA,IAAM,UAAA,GAAa,CAAC,CAAA,KAAgC,CAAA,KAAM,OAAO,EAAC,GAAI,CAAC,CAAC,CAAA;AAEjE,IAAM,eAAe,CAA6C;AAAA,EACvE,IAAA;AAAA,EACA,KAAA,EAAO,SAAA;AAAA,EACP,YAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,WAAA,GAAc,cAAA;AAAA,EACd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ACA,WAAA;AAAA,MACA,KAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MACA,IAAA;AAAA,MACA,WAAW,UAAA,EAAY,KAAA;AAAA,MAEtB,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ","file":"chunk-THGJLR5S.js","sourcesContent":["\"use client\"\n\nimport { Combobox as ArkCombobox } from \"@ark-ui/react/combobox\"\nimport { SearchIcon } from \"lucide-react\"\nimport { type FocusEvent, type ReactNode, type Ref, useMemo, useState } from \"react\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport {\n filterSelectData,\n type NormalizedItemOf,\n normalizeSelectData,\n type RenderItem,\n type SelectData,\n type SelectValue,\n useLabelSearch,\n} from \"../../lib/select-data\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { useUncontrolled } from \"../../lib/use-uncontrolled\"\nimport {\n COMBOBOX_DEFAULT_TRANSLATIONS,\n Combobox,\n type ComboboxTranslations,\n} from \"../combobox/combobox\"\nimport { type FieldProps, FieldShell } from \"../field/field\"\nimport type { InputSize, InputVariant } from \"../input/input\"\nimport { CheckIcon, CloseIcon } from \"../popover/icons\"\nimport { popoverIndicator } from \"../popover/popover\"\nimport { ComboboxSearchRow } from \"./combobox-search-row\"\n\n/**\n * ComboboxList — a searchable, single-value option list with no trigger of its\n * own. It renders permanently open: embed it inline inside a container you\n * already control the visibility of (a `Popover`, a `Drawer`, a custom panel)\n * rather than owning a floating dropdown. For a self-contained trigger +\n * floating panel, use [`Select`](/docs/select) instead — same `data` contract\n * and value shape, just with its own closed/open trigger button.\n *\n * - `data` / `value` / `onChange` match `Select` exactly\n * (`SelectValue<Data> | null`) — the picked value must come from `data`;\n * for free text see [`Autocomplete`](/docs/autocomplete).\n * - Type to filter; `clearable` adds a clear button next to the search icon\n * once there's a value.\n * - Label / description / error come from the built-in `Field`, same as the\n * rest of the family — omit them when embedding inside your own popover.\n */\n\ntype ComboboxListClassNames = {\n /** The field wrapper (label / description / error). */\n field?: string\n /** The search row (also targeted by `className`). */\n search?: string\n /** The search `<input>`. */\n input?: string\n /** A single option row. */\n option?: string\n /** The scrollable option list. */\n list?: string\n}\n\nexport type ComboboxListIconSlot = \"search\" | \"clear\" | \"check\"\nexport type ComboboxListIcons = IconMap<ComboboxListIconSlot>\n\n/** The default icons: the search row's magnifier and clear ×, and the selected option's check. */\nexport const DEFAULT_ICONS: Record<ComboboxListIconSlot, ReactNode> = {\n search: <SearchIcon className={iconStroke} />,\n clear: <CloseIcon />,\n check: <CheckIcon />,\n}\n\nexport type ComboboxListProps<Data extends SelectData = SelectData> = Pick<\n FieldProps,\n \"label\" | \"description\" | \"error\" | \"required\"\n> &\n WithTestId & {\n /** Options: `string[]`, `{ value, label?, disabled? }[]`, or `{ group, items }[]`. */\n data: Data\n /** Controlled value. */\n value?: SelectValue<Data> | null\n /** Uncontrolled initial value. */\n defaultValue?: SelectValue<Data> | null\n /** Fires with the selected value (or `null` when cleared). */\n onChange?: (value: SelectValue<Data> | null) => void\n /**\n * Render each option yourself. Receives the (value-narrowed) item and its live\n * `{ selected, highlighted }` state; you own the whole row, including any check\n * affordance. Omit it to render the label + selected check.\n */\n renderItem?: RenderItem<Data>\n /** Placeholder for the search field. */\n placeholder?: string\n /** Message shown when no option matches. Pass `null` to render nothing. */\n empty?: ReactNode\n /** Show a clear button once there's a value. */\n clearable?: boolean\n size?: InputSize\n /**\n * Search row treatment. Defaults to `\"unstyled\"` (no border/background) since\n * this is normally embedded inside a container that already draws its own\n * chrome; pass `\"default\"` / `\"filled\"` when using it standalone.\n */\n variant?: InputVariant\n disabled?: boolean\n readOnly?: boolean\n /** Red invalid state, independent of (and OR'd with) `error`. */\n invalid?: boolean\n /** Name for native form submission. */\n name?: string\n /** Forwarded to the search input; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n /** Lands on the focusable search `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n className?: string\n classNames?: ComboboxListClassNames\n /** Overrides the clear button's accessible name (`clearTriggerLabel`, default\n * `\"Clear value\"`) — the same key as the rest of the combobox family. */\n translations?: ComboboxListTranslations\n /** Replaces the default icons: `search`, `clear`, `check`. A missing key keeps its\n * default; `search: null` drops the magnifier. `renderItem` draws its own rows. */\n icons?: ComboboxListIcons\n }\n\n/** The combobox family's `clearTriggerLabel` — the only family key this always-open list\n * renders (it has no chevron). */\nexport type ComboboxListTranslations = Pick<ComboboxTranslations, \"clearTriggerLabel\">\n\n/** Wrap a scalar value into Ark's array contract (or clear with `[]`) — same\n * bridge `Select` uses (`toArkValue`, `select.tsx`). */\nconst toArkValue = (v: string | null): string[] => (v === null ? [] : [v])\n\nexport const ComboboxList = <const Data extends SelectData = SelectData>({\n data,\n value: valueProp,\n defaultValue,\n onChange,\n renderItem,\n placeholder = \"Search…\",\n empty = \"Nothing found\",\n clearable,\n size = \"md\",\n variant = \"unstyled\",\n disabled,\n readOnly,\n required,\n invalid,\n name,\n onBlur,\n ref,\n label,\n description,\n error,\n className,\n classNames,\n testId,\n translations,\n icons: iconsProp,\n}: ComboboxListProps<Data>) => {\n const icons = mergeIcons(DEFAULT_ICONS, iconsProp)\n const clearLabel =\n translations?.clearTriggerLabel ?? COMBOBOX_DEFAULT_TRANSLATIONS.clearTriggerLabel\n type Item = SelectValue<Data>\n\n // Red state is driven independently of the `Field` error slot so a form\n // library can flip it from `fieldState.invalid` (see FormControlProps).\n const isInvalid = invalid || error != null\n\n const [value, setValue] = useUncontrolled<Item | null>({\n value: valueProp,\n defaultValue: defaultValue ?? null,\n onChange,\n })\n const [search, setSearch] = useState(\"\")\n\n // Normalize once per `data`; only the filter re-runs as the query changes.\n const normalized = useMemo(() => normalizeSelectData(data), [data])\n const labelSearch = useLabelSearch()\n const { collection, items, groups } = useMemo(\n () => filterSelectData(normalized, (item) => labelSearch.matches(item.label, search)),\n [normalized, search, labelSearch],\n )\n\n // `canClear` reserves the clear button's box (and the shell's end-slot\n // padding) for the whole time the field is clearable, not just while it\n // has a value — otherwise the button mounting/unmounting shifts the\n // search input's width. `showClear` only toggles visibility/interactivity.\n const canClear = Boolean(clearable) && !disabled && !readOnly\n const showClear = canClear && (value != null || search.length > 0)\n\n const renderOption = (item: NormalizedItemOf<Data>) => (\n <Combobox.Item\n key={item.value}\n item={item}\n data-testid={item.testId}\n className={classNames?.option}\n >\n {renderItem\n ? (state) => renderItem(item, state)\n : // `Combobox.Item`'s own label + check row, with the check from `icons`.\n () => (\n <>\n <ArkCombobox.ItemText>{item.label}</ArkCombobox.ItemText>\n <ArkCombobox.ItemIndicator className={popoverIndicator}>\n {icons.check}\n </ArkCombobox.ItemIndicator>\n </>\n )}\n </Combobox.Item>\n )\n\n const control = (\n <Combobox.Root<NormalizedItemOf<Data>>\n collection={collection}\n value={toArkValue(value)}\n // Ark types the value as `string[]`; it always originates from `data`,\n // so narrow it back to the caller's value union.\n onValueChange={(details) => setValue((details.value[0] ?? null) as Item)}\n inputValue={search}\n onInputValueChange={(details) => setSearch(details.inputValue)}\n // There's no trigger to open it — the caller (e.g. a `Popover`) already\n // owns whether this mounts at all, so keep the machine permanently open.\n open\n onOpenChange={() => {}}\n // The caller's own container (Popover, Drawer, …) already owns\n // dismiss-on-outside-click; without this the always-open machine\n // registers its own (functionally inert, since `onOpenChange` is a\n // no-op) listbox dismissable layer, which logs a spurious\n // \"[@zag-js/dismissable] node is `null` or `undefined`\" warning.\n disableLayer\n closeOnSelect={false}\n autoFocus\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n size={size}\n variant={variant}\n className={className}\n >\n <ComboboxSearchRow\n size={size}\n variant={variant}\n invalid={isInvalid}\n placeholder={placeholder}\n canClear={canClear}\n showClear={showClear}\n clearLabel={clearLabel}\n onClear={() => {\n setValue(null)\n setSearch(\"\")\n }}\n onBlur={onBlur}\n ref={ref}\n testId={testId}\n icons={icons}\n classNames={classNames}\n />\n\n <Combobox.Panel className={classNames?.list}>\n {groups\n ? groups.map((group) => (\n <Combobox.Group key={group.group} label={group.group}>\n {group.items.map(renderOption)}\n </Combobox.Group>\n ))\n : items.map(renderOption)}\n {empty != null && <Combobox.Empty>{empty}</Combobox.Empty>}\n </Combobox.Panel>\n\n {/* Carries the real selection so a native `<form>` submits it — the\n search input is unnamed (it would submit the typed query, not the\n value). */}\n {name != null && <input type=\"hidden\" name={name} value={value ?? \"\"} />}\n </Combobox.Root>\n )\n\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n >\n {control}\n </FieldShell>\n )\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { createDialogParts, DIALOG_PADDING, useDialogNameCheck, DialogRootProviders } from './chunk-NLSJ6T7V.js';
2
- import { OverlayContainerProvider } from './chunk-7P32XCEU.js';
3
2
  import { useLayerGuard, NestedLayer } from './chunk-H7WOMZXO.js';
3
+ import { OverlayContainerProvider } from './chunk-7P32XCEU.js';
4
4
  import { props } from './chunk-WYCMIIRR.js';
5
5
  import { TEXT_COLOR_CLASSES } from './chunk-GIPQUKCN.js';
6
6
  import { cn } from './chunk-4ASNIDV7.js';
@@ -305,5 +305,5 @@ var Drawer = Object.assign(DrawerComponent, {
305
305
  });
306
306
 
307
307
  export { Drawer };
308
- //# sourceMappingURL=chunk-LMCUGYHT.js.map
309
- //# sourceMappingURL=chunk-LMCUGYHT.js.map
308
+ //# sourceMappingURL=chunk-YMVUQ2L7.js.map
309
+ //# sourceMappingURL=chunk-YMVUQ2L7.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/drawer/drawer.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;;;AAiDA,IAAM,kBAAA,GAAqB;AAAA,EACzB,KAAA,EAAO,OAAA;AAAA,EACP,GAAA,EAAK,KAAA;AAAA,EACL,GAAA,EAAK,IAAA;AAAA,EACL,MAAA,EAAQ;AACV,CAAA;AAGA,IAAM,sBAAA,GAAyB,cAA+B,KAAK,CAAA;AAEnE,IAAM,iBAAiB,GAAA,CAAI;AAAA,E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BACT,CAAC,SAAA,IAAa,CAAC,WAAA,IAAe,0BAAA;AAAA,oBAC9B,0BAAA;AAAA,oBACA,UAAA,EAAY;AAAA,mBACd;AAAA,kBAEC;AAAA;AAAA;AACH;AAAA;AAAA,SACF,EACF;AAAA,OAAA,EACF;AAAA;AAAA,GACF;AAEJ,CAAA;AAEO,IAAM,MAAA,GAAS,MAAA,CAAO,MAAA,CAAO,eAAA,EAAiB;AAAA,EACnD,IAAA,EAAM,UAAA;AAAA,EACN,OAAA,EAAS,aAAA;AAAA,EACT,OAAA,EAAS,aAAA;AAAA,EACT,QAAA,EAAU,cAAA;AAAA,EACV,UAAA,EAAY,gBAAA;AAAA,EACZ,OAAA,EAAS,aAAA;AAAA,EACT,KAAA,EAAO,WAAA;AAAA,EACP,WAAA,EAAa,iBAAA;AAAA,EACb,YAAA,EAAc,kBAAA;AAAA,EACd,OAAA,EAAS,aAAA;AAAA,EACT,MAAA,EAAQ,YAAA;AAAA,EACR,IAAA,EAAM,UAAA;AAAA,EACN,MAAA,EAAQ;AACV,CAAC","file":"chunk-LMCUGYHT.js","sourcesContent":["\"use client\"\n\nimport { Drawer as Ark } from \"@ark-ui/react/drawer\"\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport {\n type ComponentPropsWithoutRef,\n createContext,\n type ReactNode,\n useContext,\n useRef,\n} from \"react\"\nimport type { NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport { OverlayContainerProvider } from \"../../lib/overlay-container\"\nimport { NestedLayer, useLayerGuard } from \"../../lib/overlay-layer\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport {\n createDialogParts,\n DIALOG_PADDING,\n type DialogCloseTriggerProps,\n type DialogIconSlot,\n type DialogIcons,\n DialogRootProviders,\n type DialogSectionProps,\n useDialogNameCheck,\n} from \"../overlays/dialog-parts\"\n\n/**\n * Drawer — edge-anchored panel on top of Ark UI's Drawer state machine. Ark\n * owns swipe-to-dismiss, snap points, focus-trap, scroll-lock and the\n * `data-state=\"open|closed\"` attribute; this wrapper adds an RTL-aware\n * `placement` (Ark has none). It is set once, on `Drawer.Root`, which derives\n * Ark's logical `swipeDirection` from it and shares it with the parts through\n * context; the positioner and content write it as `data-placement`. The slide\n * animation and the docked border are pure CSS keyed on `[data-placement]`\n * (see `theme.css`), so `start`/`end` flip automatically under `dir=\"rtl\"`.\n *\n * Mirrors `Modal`'s dual API: high-level `<Drawer open placement size … >` plus\n * low-level parts (`Drawer.Root`, `Drawer.Content`, …). Padding flows through\n * the `--drawer-px` CSS var.\n */\n\nexport type DrawerPlacement = \"start\" | \"end\" | \"top\" | \"bottom\"\n\n/** placement → Ark logical swipe axis (RTL handled by Ark for start/end). */\nconst PLACEMENT_TO_SWIPE = {\n start: \"start\",\n end: \"end\",\n top: \"up\",\n bottom: \"down\",\n} as const\n\n/** The root's placement, so the parts dock themselves without repeating it. */\nconst DrawerPlacementContext = createContext<DrawerPlacement>(\"end\")\n\nconst drawerBackdrop = cva([\n \"fixed inset-0 z-[calc(var(--modal-z,150)+var(--layer-index,0))] bg-black/50 backdrop-blur-lg pointer-events-auto select-none\",\n \"data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out\",\n])\n\nconst drawerPositioner = cva(\n \"fixed inset-0 z-[calc(var(--modal-z,150)+var(--layer-index,0))] flex overflow-clip\",\n {\n variants: {\n placement: {\n start: \"items-stretch justify-start\",\n end: \"items-stretch justify-end\",\n top: \"items-start justify-stretch\",\n bottom: \"items-end justify-stretch\",\n },\n },\n defaultVariants: { placement: \"end\" },\n },\n)\n\nexport type DrawerPositionerProps = NoAsChild<ComponentPropsWithoutRef<typeof Ark.Positioner>> &\n WithTestId\n\n/** Docks itself to the root's `placement`. Publishes itself as the portal\n * target for any overlay opened inside the drawer, so a Menu/Select/DatePicker\n * in a drawer body stays above the panel instead of behind it. See\n * `lib/overlay-container.tsx`. */\nconst DrawerPositioner = ({\n className,\n children,\n testId,\n asChild: _asChild,\n ...rest\n}: DrawerPositionerProps) => {\n const placement = useContext(DrawerPlacementContext)\n const positioner = useRef<HTMLDivElement>(null)\n return (\n <Ark.Positioner\n ref={positioner}\n className={cn(drawerPositioner({ placement }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n data-placement={placement}\n >\n <OverlayContainerProvider value={positioner}>{children}</OverlayContainerProvider>\n </Ark.Positioner>\n )\n}\n\nconst drawerContent = cva(\n [\n \"relative flex flex-col overflow-hidden\",\n \"bg-brand-50 text-brand-950 shadow-2xl\",\n \"dark:bg-brand-950 dark:text-white\",\n \"focus:outline-none\",\n // border on the docked edge only — keyed by data-placement in theme.css\n \"data-[placement=start]:border-e data-[placement=end]:border-s\",\n \"data-[placement=top]:border-b data-[placement=bottom]:border-t\",\n \"border-brand-900/20 dark:border-white/15\",\n \"data-[state=open]:animate-drawer-in data-[state=closed]:animate-drawer-out\",\n ],\n {\n variants: {\n // Internal: Content reads it from the root's context.\n placement: {\n start: \"h-full max-w-[90vw]\",\n end: \"h-full max-w-[90vw]\",\n top: \"w-full max-h-[90dvh]\",\n bottom: \"w-full max-h-[90dvh]\",\n },\n // Width for inline placements, height for block ones: see compoundVariants.\n size: { xs: \"\", sm: \"\", md: \"\", lg: \"\", xl: \"\" },\n // Only the two corners away from the docked edge round: see compoundVariants.\n radius: { none: \"\", sm: \"\", md: \"\", lg: \"\", xl: \"\" },\n },\n compoundVariants: [\n { placement: [\"start\", \"end\"], size: \"xs\", class: \"w-[18rem]\" },\n { placement: [\"start\", \"end\"], size: \"sm\", class: \"w-[22rem]\" },\n { placement: [\"start\", \"end\"], size: \"md\", class: \"w-[28rem]\" },\n { placement: [\"start\", \"end\"], size: \"lg\", class: \"w-[34rem]\" },\n { placement: [\"start\", \"end\"], size: \"xl\", class: \"w-[42rem]\" },\n { placement: [\"top\", \"bottom\"], size: \"xs\", class: \"h-[30dvh]\" },\n { placement: [\"top\", \"bottom\"], size: \"sm\", class: \"h-[40dvh]\" },\n { placement: [\"top\", \"bottom\"], size: \"md\", class: \"h-[55dvh]\" },\n { placement: [\"top\", \"bottom\"], size: \"lg\", class: \"h-[70dvh]\" },\n { placement: [\"top\", \"bottom\"], size: \"xl\", class: \"h-[85dvh]\" },\n // Logical corners, so `start`/`end` mirror under RTL with the panel.\n { placement: \"start\", radius: \"sm\", class: \"rounded-e-sm\" },\n { placement: \"start\", radius: \"md\", class: \"rounded-e-md\" },\n { placement: \"start\", radius: \"lg\", class: \"rounded-e-xl\" },\n { placement: \"start\", radius: \"xl\", class: \"rounded-e-2xl\" },\n { placement: \"end\", radius: \"sm\", class: \"rounded-s-sm\" },\n { placement: \"end\", radius: \"md\", class: \"rounded-s-md\" },\n { placement: \"end\", radius: \"lg\", class: \"rounded-s-xl\" },\n { placement: \"end\", radius: \"xl\", class: \"rounded-s-2xl\" },\n { placement: \"top\", radius: \"sm\", class: \"rounded-b-sm\" },\n { placement: \"top\", radius: \"md\", class: \"rounded-b-md\" },\n { placement: \"top\", radius: \"lg\", class: \"rounded-b-xl\" },\n { placement: \"top\", radius: \"xl\", class: \"rounded-b-2xl\" },\n { placement: \"bottom\", radius: \"sm\", class: \"rounded-t-sm\" },\n { placement: \"bottom\", radius: \"md\", class: \"rounded-t-md\" },\n { placement: \"bottom\", radius: \"lg\", class: \"rounded-t-xl\" },\n { placement: \"bottom\", radius: \"xl\", class: \"rounded-t-2xl\" },\n ],\n defaultVariants: { placement: \"end\", size: \"md\", radius: \"none\" },\n },\n)\n\n// ---------------------------------------------------------------------------\n// Low-level parts\n// ---------------------------------------------------------------------------\n\nexport type DrawerIconSlot = DialogIconSlot\nexport type DrawerIcons = DialogIcons\n\nexport type DrawerRootProps = ComponentPropsWithoutRef<typeof Ark.Root> & {\n /** RTL-aware docking edge, shared with `Drawer.Positioner` and `Drawer.Content`. Also\n * sets Ark's `swipeDirection`, unless you pass one. @default \"end\" */\n placement?: DrawerPlacement\n /** Replaces the default icons: `close`. `Drawer.CloseTrigger`'s `children` win over it. */\n icons?: DrawerIcons\n}\n\n/** Ark's root, plus the nested-layer guard: while a picker opened inside the\n * drawer is open, an outside click closes the picker only, not the drawer\n * under it. It is also a layer of its own while open, so a hotkey on the page\n * (or in an enclosing overlay) yields to it. See `lib/overlay-layer.tsx`. */\nconst DrawerRoot = ({\n placement = \"end\",\n swipeDirection,\n onPointerDownOutside,\n icons,\n children,\n ...rest\n}: DrawerRootProps) => {\n const guard = useLayerGuard(onPointerDownOutside)\n return (\n <Ark.Root\n swipeDirection={swipeDirection ?? PLACEMENT_TO_SWIPE[placement]}\n onPointerDownOutside={guard.onPointerDownOutside}\n {...rest}\n >\n {/* A layer itself, registered with whatever it opened from (the page,\n or an enclosing overlay), so what's under it knows it's covered. */}\n <Ark.Context>{(api) => <NestedLayer open={api.open} />}</Ark.Context>\n <DrawerPlacementContext value={placement}>\n <DialogRootProviders icons={icons} layers={guard.layers}>\n {children}\n </DialogRootProviders>\n </DrawerPlacementContext>\n </Ark.Root>\n )\n}\nconst DrawerTrigger = Ark.Trigger\nconst DrawerContext = Ark.Context\n\nexport type DrawerBackdropProps = ComponentPropsWithoutRef<typeof Ark.Backdrop> & WithTestId\n\nconst DrawerBackdrop = ({ className, testId, ...rest }: DrawerBackdropProps) => (\n <Ark.Backdrop\n className={cn(drawerBackdrop(), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type DrawerTitleProps = ComponentPropsWithoutRef<typeof Ark.Title> & WithTestId\n\nconst DrawerTitle = ({ className, testId, ...rest }: DrawerTitleProps) => (\n <Ark.Title\n className={cn(\"text-xl font-semibold leading-tight\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type DrawerDescriptionProps = ComponentPropsWithoutRef<typeof Ark.Description> & WithTestId\n\nconst DrawerDescription = ({ className, testId, ...rest }: DrawerDescriptionProps) => (\n <Ark.Description\n className={cn(\"text-sm\", TEXT_COLOR_CLASSES.muted, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type DrawerSize = NonNullable<VariantProps<typeof drawerContent>[\"size\"]>\nexport type DrawerRadius = NonNullable<VariantProps<typeof drawerContent>[\"radius\"]>\n\nexport type DrawerContentProps = ComponentPropsWithoutRef<typeof Ark.Content> &\n WithTestId & {\n /** Width for `start`/`end` drawers, height for `top`/`bottom` ones. @default \"md\" */\n size?: DrawerSize\n /** Rounds the two corners away from the docked edge. @default \"none\" */\n radius?: DrawerRadius\n }\n\n/** The panel. It sizes and rounds itself for the root's `placement`, and writes\n * it as `data-placement`, which the slide animation and the docked border key on. */\nconst DrawerContent = ({ className, size, radius, testId, ...rest }: DrawerContentProps) => {\n const placement = useContext(DrawerPlacementContext)\n const nameCheck = useDialogNameCheck(\"Drawer\")\n return (\n <Ark.Content\n ref={nameCheck}\n className={cn(drawerContent({ placement, size, radius }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n data-placement={placement}\n />\n )\n}\n\nexport type DrawerCloseTriggerProps = DialogCloseTriggerProps\nexport type DrawerHeaderProps = DialogSectionProps\nexport type DrawerBodyProps = DialogSectionProps\nexport type DrawerFooterProps = DialogSectionProps\n\nconst {\n CloseTrigger: DrawerCloseTrigger,\n Header: DrawerHeader,\n Body: DrawerBody,\n Footer: DrawerFooter,\n} = createDialogParts(\"drawer\", Ark.CloseTrigger)\n\nexport type DrawerGrabberProps = NoAsChild<ComponentPropsWithoutRef<typeof Ark.Grabber>> &\n WithTestId\n\nconst DrawerGrabber = ({ className, testId, asChild: _asChild, ...rest }: DrawerGrabberProps) => (\n <Ark.Grabber\n className={cn(\n \"flex shrink-0 cursor-grab touch-none items-center justify-center py-2\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n <Ark.GrabberIndicator className=\"h-1.5 w-20 rounded-full bg-brand-900/10 dark:bg-white/16\" />\n </Ark.Grabber>\n)\n\n// ---------------------------------------------------------------------------\n// High-level props-driven Drawer\n// ---------------------------------------------------------------------------\n\ntype ArkRootProps = ComponentPropsWithoutRef<typeof Ark.Root>\n\nexport type DrawerClassNames = Partial<\n Record<\n | \"backdrop\"\n | \"positioner\"\n | \"content\"\n | \"header\"\n | \"title\"\n | \"description\"\n | \"body\"\n | \"grabber\"\n | \"closeButton\",\n string\n >\n>\n\nexport type DrawerProps = Omit<\n ArkRootProps,\n \"open\" | \"defaultOpen\" | \"onOpenChange\" | \"children\" | \"swipeDirection\" | \"role\"\n> &\n WithTestId & {\n /** Controlled open state. */\n open?: boolean\n /** Uncontrolled initial open state. */\n defaultOpen?: boolean\n /** Fires with the next open state. Flattened from Ark's `{ open }`. */\n onOpenChange?: (open: boolean) => void\n /** Fires on close (any source) — Escape, backdrop click, swipe, or a controlled `onOpenChange`. */\n onClose?: () => void\n /** RTL-aware docking edge. @default \"end\" */\n placement?: DrawerPlacement\n /** Width for `start`/`end` drawers, height for `top`/`bottom` ones. @default \"md\" */\n size?: DrawerSize\n /** Rounds the two corners away from the docked edge. @default \"none\" */\n radius?: DrawerRadius\n /** Header title; also the drawer's accessible name. */\n title?: ReactNode\n description?: ReactNode\n /** Accessible name for a drawer without a `title` (a navigation panel, say). */\n \"aria-label\"?: string\n /** Id of an element inside the drawer that names it, when there is no `title`. */\n \"aria-labelledby\"?: string\n /** Render the default close button in the header. @default true */\n withCloseButton?: boolean\n /** Show the drag grabber handle. @default false */\n withGrabber?: boolean\n /**\n * Render the dimming backdrop. Set `false` when an ancestor (e.g. the modals\n * manager) draws a single shared backdrop for the whole overlay stack.\n * @default true\n */\n withBackdrop?: boolean\n /** Inner padding token; sets `--drawer-px`. @default \"md\" */\n padding?: Size\n closeOnEscape?: boolean\n /** Close on a click outside the drawer. @default true, false for an `alertdialog` */\n closeOnInteractOutside?: boolean\n /** Use `alertdialog` semantics (confirm flows). @default \"dialog\" */\n role?: \"dialog\" | \"alertdialog\"\n /** Fires after the exit animation completes — the manager unmounts on this. */\n onExitComplete?: () => void\n /** Portal target. Defaults to `document.body`. */\n container?: HTMLElement | null\n children?: ReactNode\n className?: string\n classNames?: DrawerClassNames\n /** Overrides the default close button's accessible name (`closeTriggerLabel`, default\n * `\"Close\"`). The compound `DrawerCloseTrigger` part takes a plain `aria-label` instead. */\n translations?: DrawerTranslations\n /** Replaces the default icons: `close`, the header's close button. */\n icons?: DrawerIcons\n }\n\n/** The ready-made drawer's wording — `closeTriggerLabel` follows Ark's naming for the\n * same control. */\nexport type DrawerTranslations = { closeTriggerLabel?: string }\n\nconst DrawerComponent = ({\n open,\n defaultOpen,\n onOpenChange,\n onClose,\n placement = \"end\",\n size,\n radius,\n title,\n description,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledby,\n withCloseButton = true,\n withGrabber = false,\n withBackdrop = true,\n padding = \"md\",\n closeOnEscape,\n closeOnInteractOutside,\n role,\n onExitComplete,\n container,\n children,\n className,\n classNames,\n testId,\n translations,\n icons,\n ...rest\n}: DrawerProps) => {\n const hasHeader = title != null || description != null || withCloseButton\n\n return (\n <DrawerRoot\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={({ open: next }) => {\n onOpenChange?.(next)\n if (!next) onClose?.()\n }}\n placement={placement}\n closeOnEscape={closeOnEscape}\n // Spelled out to match Modal, whose Ark dialog derives this default from\n // `modal` (so the overlays manager's `withBackdrop={false}` would stop\n // outside clicks there). Ark's drawer defaults it to `true` for every role\n // instead, so here the one behaviour this changes is the `alertdialog`:\n // it stays sticky, as on Modal, unless the caller opts in explicitly.\n closeOnInteractOutside={closeOnInteractOutside ?? role !== \"alertdialog\"}\n role={role}\n // Unmount the whole content tree (incl. the `fixed inset-0` positioner)\n // on close — otherwise the positioner lingers as a transparent overlay\n // that swallows page clicks. `lazyMount` keeps it out of the DOM until\n // first open.\n lazyMount\n unmountOnExit\n modal={withBackdrop}\n onExitComplete={onExitComplete}\n icons={icons}\n {...rest}\n >\n <Portal container={container ? { current: container } : undefined}>\n {withBackdrop && <DrawerBackdrop className={classNames?.backdrop} />}\n <DrawerPositioner className={classNames?.positioner}>\n <DrawerContent\n size={size}\n radius={radius}\n style={{ [\"--drawer-px\" as string]: DIALOG_PADDING[padding] }}\n className={cn(className, classNames?.content)}\n testId={testId}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n >\n {withGrabber && <DrawerGrabber className={classNames?.grabber} />}\n {hasHeader && (\n <DrawerHeader className={classNames?.header}>\n <div className=\"flex flex-col gap-1\">\n {title != null && (\n <DrawerTitle className={classNames?.title}>{title}</DrawerTitle>\n )}\n {description != null && (\n <DrawerDescription className={classNames?.description}>\n {description}\n </DrawerDescription>\n )}\n </div>\n {withCloseButton && (\n <DrawerCloseTrigger\n aria-label={translations?.closeTriggerLabel}\n className={classNames?.closeButton}\n />\n )}\n </DrawerHeader>\n )}\n <DrawerBody\n className={cn(\n !hasHeader && !withGrabber && \"pt-(--drawer-px,1.25rem)\",\n \"pb-(--drawer-px,1.25rem)\",\n classNames?.body,\n )}\n >\n {children}\n </DrawerBody>\n </DrawerContent>\n </DrawerPositioner>\n </Portal>\n </DrawerRoot>\n )\n}\n\nexport const Drawer = Object.assign(DrawerComponent, {\n Root: DrawerRoot,\n Trigger: DrawerTrigger,\n Context: DrawerContext,\n Backdrop: DrawerBackdrop,\n Positioner: DrawerPositioner,\n Content: DrawerContent,\n Title: DrawerTitle,\n Description: DrawerDescription,\n CloseTrigger: DrawerCloseTrigger,\n Grabber: DrawerGrabber,\n Header: DrawerHeader,\n Body: DrawerBody,\n Footer: DrawerFooter,\n})\n"]}
1
+ {"version":3,"sources":["../src/components/drawer/drawer.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;;;AAiDA,IAAM,kBAAA,GAAqB;AAAA,EACzB,KAAA,EAAO,OAAA;AAAA,EACP,GAAA,EAAK,KAAA;AAAA,EACL,GAAA,EAAK,IAAA;AAAA,EACL,MAAA,EAAQ;AACV,CAAA;AAGA,IAAM,sBAAA,GAAyB,cAA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UAAA;AAAA,gBAAA;AAAA,kBACC,SAAA,EAAW,EAAA;AAAA,oBACT,CAAC,SAAA,IAAa,CAAC,WAAA,IAAe,0BAAA;AAAA,oBAC9B,0BAAA;AAAA,oBACA,UAAA,EAAY;AAAA,mBACd;AAAA,kBAEC;AAAA;AAAA;AACH;AAAA;AAAA,SACF,EACF;AAAA,OAAA,EACF;AAAA;AAAA,GACF;AAEJ,CAAA;AAEO,IAAM,MAAA,GAAS,MAAA,CAAO,MAAA,CAAO,eAAA,EAAiB;AAAA,EACnD,IAAA,EAAM,UAAA;AAAA,EACN,OAAA,EAAS,aAAA;AAAA,EACT,OAAA,EAAS,aAAA;AAAA,EACT,QAAA,EAAU,cAAA;AAAA,EACV,UAAA,EAAY,gBAAA;AAAA,EACZ,OAAA,EAAS,aAAA;AAAA,EACT,KAAA,EAAO,WAAA;AAAA,EACP,WAAA,EAAa,iBAAA;AAAA,EACb,YAAA,EAAc,kBAAA;AAAA,EACd,OAAA,EAAS,aAAA;AAAA,EACT,MAAA,EAAQ,YAAA;AAAA,EACR,IAAA,EAAM,UAAA;AAAA,EACN,MAAA,EAAQ;AACV,CAAC","file":"chunk-YMVUQ2L7.js","sourcesContent":["\"use client\"\n\nimport { Drawer as Ark } from \"@ark-ui/react/drawer\"\nimport { Portal } from \"@ark-ui/react/portal\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport {\n type ComponentPropsWithoutRef,\n createContext,\n type ReactNode,\n useContext,\n useRef,\n} from \"react\"\nimport type { NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport { OverlayContainerProvider } from \"../../lib/overlay-container\"\nimport { NestedLayer, useLayerGuard } from \"../../lib/overlay-layer\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport {\n createDialogParts,\n DIALOG_PADDING,\n type DialogCloseTriggerProps,\n type DialogIconSlot,\n type DialogIcons,\n DialogRootProviders,\n type DialogSectionProps,\n useDialogNameCheck,\n} from \"../overlays/dialog-parts\"\n\n/**\n * Drawer — edge-anchored panel on top of Ark UI's Drawer state machine. Ark\n * owns swipe-to-dismiss, snap points, focus-trap, scroll-lock and the\n * `data-state=\"open|closed\"` attribute; this wrapper adds an RTL-aware\n * `placement` (Ark has none). It is set once, on `Drawer.Root`, which derives\n * Ark's logical `swipeDirection` from it and shares it with the parts through\n * context; the positioner and content write it as `data-placement`. The slide\n * animation and the docked border are pure CSS keyed on `[data-placement]`\n * (see `theme.css`), so `start`/`end` flip automatically under `dir=\"rtl\"`.\n *\n * Mirrors `Modal`'s dual API: high-level `<Drawer open placement size … >` plus\n * low-level parts (`Drawer.Root`, `Drawer.Content`, …). Padding flows through\n * the `--drawer-px` CSS var.\n */\n\nexport type DrawerPlacement = \"start\" | \"end\" | \"top\" | \"bottom\"\n\n/** placement → Ark logical swipe axis (RTL handled by Ark for start/end). */\nconst PLACEMENT_TO_SWIPE = {\n start: \"start\",\n end: \"end\",\n top: \"up\",\n bottom: \"down\",\n} as const\n\n/** The root's placement, so the parts dock themselves without repeating it. */\nconst DrawerPlacementContext = createContext<DrawerPlacement>(\"end\")\n\nconst drawerBackdrop = cva([\n \"fixed inset-0 z-[calc(var(--modal-z,150)+var(--layer-index,0))] bg-black/50 backdrop-blur-lg pointer-events-auto select-none\",\n \"data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out\",\n])\n\nconst drawerPositioner = cva(\n \"fixed inset-0 z-[calc(var(--modal-z,150)+var(--layer-index,0))] flex overflow-clip\",\n {\n variants: {\n placement: {\n start: \"items-stretch justify-start\",\n end: \"items-stretch justify-end\",\n top: \"items-start justify-stretch\",\n bottom: \"items-end justify-stretch\",\n },\n },\n defaultVariants: { placement: \"end\" },\n },\n)\n\nexport type DrawerPositionerProps = NoAsChild<ComponentPropsWithoutRef<typeof Ark.Positioner>> &\n WithTestId\n\n/** Docks itself to the root's `placement`. Publishes itself as the portal\n * target for any overlay opened inside the drawer, so a Menu/Select/DatePicker\n * in a drawer body stays above the panel instead of behind it. See\n * `lib/overlay-container.tsx`. */\nconst DrawerPositioner = ({\n className,\n children,\n testId,\n asChild: _asChild,\n ...rest\n}: DrawerPositionerProps) => {\n const placement = useContext(DrawerPlacementContext)\n const positioner = useRef<HTMLDivElement>(null)\n return (\n <Ark.Positioner\n ref={positioner}\n className={cn(drawerPositioner({ placement }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n data-placement={placement}\n >\n <OverlayContainerProvider value={positioner}>{children}</OverlayContainerProvider>\n </Ark.Positioner>\n )\n}\n\nconst drawerContent = cva(\n [\n \"relative flex flex-col overflow-hidden\",\n \"bg-brand-50 text-brand-950 shadow-2xl\",\n \"dark:bg-brand-950 dark:text-white\",\n \"focus:outline-none\",\n // border on the docked edge only — keyed by data-placement in theme.css\n \"data-[placement=start]:border-e data-[placement=end]:border-s\",\n \"data-[placement=top]:border-b data-[placement=bottom]:border-t\",\n \"border-brand-900/20 dark:border-white/15\",\n \"data-[state=open]:animate-drawer-in data-[state=closed]:animate-drawer-out\",\n ],\n {\n variants: {\n // Internal: Content reads it from the root's context.\n placement: {\n start: \"h-full max-w-[90vw]\",\n end: \"h-full max-w-[90vw]\",\n top: \"w-full max-h-[90dvh]\",\n bottom: \"w-full max-h-[90dvh]\",\n },\n // Width for inline placements, height for block ones: see compoundVariants.\n size: { xs: \"\", sm: \"\", md: \"\", lg: \"\", xl: \"\" },\n // Only the two corners away from the docked edge round: see compoundVariants.\n radius: { none: \"\", sm: \"\", md: \"\", lg: \"\", xl: \"\" },\n },\n compoundVariants: [\n { placement: [\"start\", \"end\"], size: \"xs\", class: \"w-[18rem]\" },\n { placement: [\"start\", \"end\"], size: \"sm\", class: \"w-[22rem]\" },\n { placement: [\"start\", \"end\"], size: \"md\", class: \"w-[28rem]\" },\n { placement: [\"start\", \"end\"], size: \"lg\", class: \"w-[34rem]\" },\n { placement: [\"start\", \"end\"], size: \"xl\", class: \"w-[42rem]\" },\n { placement: [\"top\", \"bottom\"], size: \"xs\", class: \"h-[30dvh]\" },\n { placement: [\"top\", \"bottom\"], size: \"sm\", class: \"h-[40dvh]\" },\n { placement: [\"top\", \"bottom\"], size: \"md\", class: \"h-[55dvh]\" },\n { placement: [\"top\", \"bottom\"], size: \"lg\", class: \"h-[70dvh]\" },\n { placement: [\"top\", \"bottom\"], size: \"xl\", class: \"h-[85dvh]\" },\n // Logical corners, so `start`/`end` mirror under RTL with the panel.\n { placement: \"start\", radius: \"sm\", class: \"rounded-e-sm\" },\n { placement: \"start\", radius: \"md\", class: \"rounded-e-md\" },\n { placement: \"start\", radius: \"lg\", class: \"rounded-e-xl\" },\n { placement: \"start\", radius: \"xl\", class: \"rounded-e-2xl\" },\n { placement: \"end\", radius: \"sm\", class: \"rounded-s-sm\" },\n { placement: \"end\", radius: \"md\", class: \"rounded-s-md\" },\n { placement: \"end\", radius: \"lg\", class: \"rounded-s-xl\" },\n { placement: \"end\", radius: \"xl\", class: \"rounded-s-2xl\" },\n { placement: \"top\", radius: \"sm\", class: \"rounded-b-sm\" },\n { placement: \"top\", radius: \"md\", class: \"rounded-b-md\" },\n { placement: \"top\", radius: \"lg\", class: \"rounded-b-xl\" },\n { placement: \"top\", radius: \"xl\", class: \"rounded-b-2xl\" },\n { placement: \"bottom\", radius: \"sm\", class: \"rounded-t-sm\" },\n { placement: \"bottom\", radius: \"md\", class: \"rounded-t-md\" },\n { placement: \"bottom\", radius: \"lg\", class: \"rounded-t-xl\" },\n { placement: \"bottom\", radius: \"xl\", class: \"rounded-t-2xl\" },\n ],\n defaultVariants: { placement: \"end\", size: \"md\", radius: \"none\" },\n },\n)\n\n// ---------------------------------------------------------------------------\n// Low-level parts\n// ---------------------------------------------------------------------------\n\nexport type DrawerIconSlot = DialogIconSlot\nexport type DrawerIcons = DialogIcons\n\nexport type DrawerRootProps = ComponentPropsWithoutRef<typeof Ark.Root> & {\n /** RTL-aware docking edge, shared with `Drawer.Positioner` and `Drawer.Content`. Also\n * sets Ark's `swipeDirection`, unless you pass one. @default \"end\" */\n placement?: DrawerPlacement\n /** Replaces the default icons: `close`. `Drawer.CloseTrigger`'s `children` win over it. */\n icons?: DrawerIcons\n}\n\n/** Ark's root, plus the nested-layer guard: while a picker opened inside the\n * drawer is open, an outside click closes the picker only, not the drawer\n * under it. It is also a layer of its own while open, so a hotkey on the page\n * (or in an enclosing overlay) yields to it. See `lib/overlay-layer.tsx`. */\nconst DrawerRoot = ({\n placement = \"end\",\n swipeDirection,\n onPointerDownOutside,\n icons,\n children,\n ...rest\n}: DrawerRootProps) => {\n const guard = useLayerGuard(onPointerDownOutside)\n return (\n <Ark.Root\n swipeDirection={swipeDirection ?? PLACEMENT_TO_SWIPE[placement]}\n onPointerDownOutside={guard.onPointerDownOutside}\n {...rest}\n >\n {/* A layer itself, registered with whatever it opened from (the page,\n or an enclosing overlay), so what's under it knows it's covered. */}\n <Ark.Context>{(api) => <NestedLayer open={api.open} />}</Ark.Context>\n <DrawerPlacementContext value={placement}>\n <DialogRootProviders icons={icons} layers={guard.layers}>\n {children}\n </DialogRootProviders>\n </DrawerPlacementContext>\n </Ark.Root>\n )\n}\nconst DrawerTrigger = Ark.Trigger\nconst DrawerContext = Ark.Context\n\nexport type DrawerBackdropProps = ComponentPropsWithoutRef<typeof Ark.Backdrop> & WithTestId\n\nconst DrawerBackdrop = ({ className, testId, ...rest }: DrawerBackdropProps) => (\n <Ark.Backdrop\n className={cn(drawerBackdrop(), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type DrawerTitleProps = ComponentPropsWithoutRef<typeof Ark.Title> & WithTestId\n\nconst DrawerTitle = ({ className, testId, ...rest }: DrawerTitleProps) => (\n <Ark.Title\n className={cn(\"text-xl font-semibold leading-tight\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type DrawerDescriptionProps = ComponentPropsWithoutRef<typeof Ark.Description> & WithTestId\n\nconst DrawerDescription = ({ className, testId, ...rest }: DrawerDescriptionProps) => (\n <Ark.Description\n className={cn(\"text-sm\", TEXT_COLOR_CLASSES.muted, className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type DrawerSize = NonNullable<VariantProps<typeof drawerContent>[\"size\"]>\nexport type DrawerRadius = NonNullable<VariantProps<typeof drawerContent>[\"radius\"]>\n\nexport type DrawerContentProps = ComponentPropsWithoutRef<typeof Ark.Content> &\n WithTestId & {\n /** Width for `start`/`end` drawers, height for `top`/`bottom` ones. @default \"md\" */\n size?: DrawerSize\n /** Rounds the two corners away from the docked edge. @default \"none\" */\n radius?: DrawerRadius\n }\n\n/** The panel. It sizes and rounds itself for the root's `placement`, and writes\n * it as `data-placement`, which the slide animation and the docked border key on. */\nconst DrawerContent = ({ className, size, radius, testId, ...rest }: DrawerContentProps) => {\n const placement = useContext(DrawerPlacementContext)\n const nameCheck = useDialogNameCheck(\"Drawer\")\n return (\n <Ark.Content\n ref={nameCheck}\n className={cn(drawerContent({ placement, size, radius }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n data-placement={placement}\n />\n )\n}\n\nexport type DrawerCloseTriggerProps = DialogCloseTriggerProps\nexport type DrawerHeaderProps = DialogSectionProps\nexport type DrawerBodyProps = DialogSectionProps\nexport type DrawerFooterProps = DialogSectionProps\n\nconst {\n CloseTrigger: DrawerCloseTrigger,\n Header: DrawerHeader,\n Body: DrawerBody,\n Footer: DrawerFooter,\n} = createDialogParts(\"drawer\", Ark.CloseTrigger)\n\nexport type DrawerGrabberProps = NoAsChild<ComponentPropsWithoutRef<typeof Ark.Grabber>> &\n WithTestId\n\nconst DrawerGrabber = ({ className, testId, asChild: _asChild, ...rest }: DrawerGrabberProps) => (\n <Ark.Grabber\n className={cn(\n \"flex shrink-0 cursor-grab touch-none items-center justify-center py-2\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n <Ark.GrabberIndicator className=\"h-1.5 w-20 rounded-full bg-brand-900/10 dark:bg-white/16\" />\n </Ark.Grabber>\n)\n\n// ---------------------------------------------------------------------------\n// High-level props-driven Drawer\n// ---------------------------------------------------------------------------\n\ntype ArkRootProps = ComponentPropsWithoutRef<typeof Ark.Root>\n\nexport type DrawerClassNames = Partial<\n Record<\n | \"backdrop\"\n | \"positioner\"\n | \"content\"\n | \"header\"\n | \"title\"\n | \"description\"\n | \"body\"\n | \"grabber\"\n | \"closeButton\",\n string\n >\n>\n\nexport type DrawerProps = Omit<\n ArkRootProps,\n \"open\" | \"defaultOpen\" | \"onOpenChange\" | \"children\" | \"swipeDirection\" | \"role\"\n> &\n WithTestId & {\n /** Controlled open state. */\n open?: boolean\n /** Uncontrolled initial open state. */\n defaultOpen?: boolean\n /** Fires with the next open state. Flattened from Ark's `{ open }`. */\n onOpenChange?: (open: boolean) => void\n /** Fires on close (any source) — Escape, backdrop click, swipe, or a controlled `onOpenChange`. */\n onClose?: () => void\n /** RTL-aware docking edge. @default \"end\" */\n placement?: DrawerPlacement\n /** Width for `start`/`end` drawers, height for `top`/`bottom` ones. @default \"md\" */\n size?: DrawerSize\n /** Rounds the two corners away from the docked edge. @default \"none\" */\n radius?: DrawerRadius\n /** Header title; also the drawer's accessible name. */\n title?: ReactNode\n description?: ReactNode\n /** Accessible name for a drawer without a `title` (a navigation panel, say). */\n \"aria-label\"?: string\n /** Id of an element inside the drawer that names it, when there is no `title`. */\n \"aria-labelledby\"?: string\n /** Render the default close button in the header. @default true */\n withCloseButton?: boolean\n /** Show the drag grabber handle. @default false */\n withGrabber?: boolean\n /**\n * Render the dimming backdrop. Set `false` when an ancestor (e.g. the modals\n * manager) draws a single shared backdrop for the whole overlay stack.\n * @default true\n */\n withBackdrop?: boolean\n /** Inner padding token; sets `--drawer-px`. @default \"md\" */\n padding?: Size\n closeOnEscape?: boolean\n /** Close on a click outside the drawer. @default true, false for an `alertdialog` */\n closeOnInteractOutside?: boolean\n /** Use `alertdialog` semantics (confirm flows). @default \"dialog\" */\n role?: \"dialog\" | \"alertdialog\"\n /** Fires after the exit animation completes — the manager unmounts on this. */\n onExitComplete?: () => void\n /** Portal target. Defaults to `document.body`. */\n container?: HTMLElement | null\n children?: ReactNode\n className?: string\n classNames?: DrawerClassNames\n /** Overrides the default close button's accessible name (`closeTriggerLabel`, default\n * `\"Close\"`). The compound `DrawerCloseTrigger` part takes a plain `aria-label` instead. */\n translations?: DrawerTranslations\n /** Replaces the default icons: `close`, the header's close button. */\n icons?: DrawerIcons\n }\n\n/** The ready-made drawer's wording — `closeTriggerLabel` follows Ark's naming for the\n * same control. */\nexport type DrawerTranslations = { closeTriggerLabel?: string }\n\nconst DrawerComponent = ({\n open,\n defaultOpen,\n onOpenChange,\n onClose,\n placement = \"end\",\n size,\n radius,\n title,\n description,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledby,\n withCloseButton = true,\n withGrabber = false,\n withBackdrop = true,\n padding = \"md\",\n closeOnEscape,\n closeOnInteractOutside,\n role,\n onExitComplete,\n container,\n children,\n className,\n classNames,\n testId,\n translations,\n icons,\n ...rest\n}: DrawerProps) => {\n const hasHeader = title != null || description != null || withCloseButton\n\n return (\n <DrawerRoot\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={({ open: next }) => {\n onOpenChange?.(next)\n if (!next) onClose?.()\n }}\n placement={placement}\n closeOnEscape={closeOnEscape}\n // Spelled out to match Modal, whose Ark dialog derives this default from\n // `modal` (so the overlays manager's `withBackdrop={false}` would stop\n // outside clicks there). Ark's drawer defaults it to `true` for every role\n // instead, so here the one behaviour this changes is the `alertdialog`:\n // it stays sticky, as on Modal, unless the caller opts in explicitly.\n closeOnInteractOutside={closeOnInteractOutside ?? role !== \"alertdialog\"}\n role={role}\n // Unmount the whole content tree (incl. the `fixed inset-0` positioner)\n // on close — otherwise the positioner lingers as a transparent overlay\n // that swallows page clicks. `lazyMount` keeps it out of the DOM until\n // first open.\n lazyMount\n unmountOnExit\n modal={withBackdrop}\n onExitComplete={onExitComplete}\n icons={icons}\n {...rest}\n >\n <Portal container={container ? { current: container } : undefined}>\n {withBackdrop && <DrawerBackdrop className={classNames?.backdrop} />}\n <DrawerPositioner className={classNames?.positioner}>\n <DrawerContent\n size={size}\n radius={radius}\n style={{ [\"--drawer-px\" as string]: DIALOG_PADDING[padding] }}\n className={cn(className, classNames?.content)}\n testId={testId}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n >\n {withGrabber && <DrawerGrabber className={classNames?.grabber} />}\n {hasHeader && (\n <DrawerHeader className={classNames?.header}>\n <div className=\"flex flex-col gap-1\">\n {title != null && (\n <DrawerTitle className={classNames?.title}>{title}</DrawerTitle>\n )}\n {description != null && (\n <DrawerDescription className={classNames?.description}>\n {description}\n </DrawerDescription>\n )}\n </div>\n {withCloseButton && (\n <DrawerCloseTrigger\n aria-label={translations?.closeTriggerLabel}\n className={classNames?.closeButton}\n />\n )}\n </DrawerHeader>\n )}\n <DrawerBody\n className={cn(\n !hasHeader && !withGrabber && \"pt-(--drawer-px,1.25rem)\",\n \"pb-(--drawer-px,1.25rem)\",\n classNames?.body,\n )}\n >\n {children}\n </DrawerBody>\n </DrawerContent>\n </DrawerPositioner>\n </Portal>\n </DrawerRoot>\n )\n}\n\nexport const Drawer = Object.assign(DrawerComponent, {\n Root: DrawerRoot,\n Trigger: DrawerTrigger,\n Context: DrawerContext,\n Backdrop: DrawerBackdrop,\n Positioner: DrawerPositioner,\n Content: DrawerContent,\n Title: DrawerTitle,\n Description: DrawerDescription,\n CloseTrigger: DrawerCloseTrigger,\n Grabber: DrawerGrabber,\n Header: DrawerHeader,\n Body: DrawerBody,\n Footer: DrawerFooter,\n})\n"]}
@@ -51,54 +51,40 @@ var BRIGHT_STARS = [
51
51
  { x: "93%", y: "90%", sparkle: false, delay: "-2.5s", duration: "7s" }
52
52
  ];
53
53
  var SPARKLE = "M0 -6Q0 0 6 0Q0 0 0 6Q0 0 -6 0Q0 0 0 -6Z";
54
- var BLEED = 15;
55
- var SPAN = 100 + 2 * BLEED;
56
- var inLayer = (viewport, offset = 0) => `${round((viewport + offset) / SPAN * 100)}%`;
57
- var cloud = ({ rx, ry, x, y }, { color, strength }) => `radial-gradient(ellipse ${inLayer(rx)} ${inLayer(ry)} at ${inLayer(x, BLEED)} ${inLayer(y, BLEED)}, color-mix(in oklab, var(${color}) ${strength}%, transparent), color-mix(in oklab, var(${color}) ${strength * 0.45}%, transparent) 45%, transparent 100%)`;
54
+ var cloud = ({ rx, ry, x, y }, { color, strength }) => `radial-gradient(ellipse ${rx}% ${ry}% at ${x}% ${y}%, color-mix(in oklab, var(${color}) ${strength}%, transparent), color-mix(in oklab, var(${color}) ${strength * 0.45}%, transparent) 45%, transparent 100%)`;
58
55
  var CLOUDS = [
59
56
  {
60
57
  // Moved down-left, narrowed and brightened (9 → 17) against Figma's « Background / Cosmos »,
61
58
  // whose lower-left glows violet behind the first column (2026-10-29).
62
59
  at: { rx: 35, ry: 34, x: 23, y: 72 },
63
60
  dark: { color: "--color-purple-400", strength: 17 },
64
- light: { color: "--color-purple-200", strength: 14 },
65
- drift: { x: "6vw", y: "-4vh", scale: 1.12, fade: 0.7, duration: "70s", delay: "-20s" }
61
+ light: { color: "--color-purple-200", strength: 14 }
66
62
  },
67
63
  {
68
64
  at: { rx: 60, ry: 38, x: 42, y: 104 },
69
65
  dark: { color: "--color-purple-800", strength: 20 },
70
- light: { color: "--color-purple-200", strength: 26 },
71
- drift: { x: "-8vw", y: "-3vh", scale: 1.08, fade: 0.85, duration: "95s", delay: "-50s" }
66
+ light: { color: "--color-purple-200", strength: 26 }
72
67
  },
73
68
  {
74
69
  at: { rx: 40, ry: 34, x: 92, y: 4 },
75
70
  dark: { color: "--color-purple-800", strength: 22 },
76
- light: { color: "--color-purple-200", strength: 28 },
77
- drift: { x: "-5vw", y: "5vh", scale: 1.15, fade: 0.8, duration: "85s", delay: "-10s" }
71
+ light: { color: "--color-purple-200", strength: 28 }
78
72
  },
79
73
  {
80
74
  at: { rx: 46, ry: 40, x: 24, y: 20 },
81
75
  dark: { color: "--color-brand-700", strength: 18 },
82
- light: { color: "--color-brand-200", strength: 24 },
83
- drift: { x: "7vw", y: "4vh", scale: 1.1, fade: 0.85, duration: "110s", delay: "-70s" }
76
+ light: { color: "--color-brand-200", strength: 24 }
84
77
  },
85
78
  {
86
79
  at: { rx: 36, ry: 30, x: 4, y: 92 },
87
80
  dark: { color: "--color-pink-800", strength: 10 },
88
- light: { color: "--color-pink-200", strength: 16 },
89
- drift: { x: "5vw", y: "-6vh", scale: 1.2, fade: 0.6, duration: "75s", delay: "-35s" }
81
+ light: { color: "--color-pink-200", strength: 16 }
90
82
  }
91
83
  ];
92
- var cloudStyle = ({ at, dark, light, drift }) => ({
84
+ var cloudStyle = ({ at, dark, light }) => ({
93
85
  "--nebula-light": cloud(at, light),
94
86
  "--nebula-dark": cloud(at, dark),
95
- "--drift-x": drift.x,
96
- "--drift-y": drift.y,
97
- "--drift-scale": drift.scale,
98
- "--drift-fade": drift.fade,
99
- inset: `-${BLEED}%`,
100
- animationDuration: drift.duration,
101
- animationDelay: drift.delay
87
+ inset: 0
102
88
  });
103
89
  var METEORS = [
104
90
  { x: "72%", y: "8%", angle: "152deg", duration: "37s", delay: "9s" },
@@ -117,7 +103,7 @@ var Starfield = ({
117
103
  "aria-hidden": "true",
118
104
  className: cn(
119
105
  LAYER,
120
- "[background-image:var(--nebula-light)] motion-safe:animate-ambient-nebula-drift dark:[background-image:var(--nebula-dark)]",
106
+ "[background-image:var(--nebula-light)] dark:[background-image:var(--nebula-dark)]",
121
107
  classNames?.nebula
122
108
  ),
123
109
  style: cloudStyle(c),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/ambient-background/starfield.tsx","../../../src/components/ambient-background/ambient-background.tsx"],"names":["jsxs","Fragment","jsx"],"mappings":";;;;;AAoBA,IAAM,IAAA,GAAO,CAAC,IAAA,KAAiB,MAAM;AACnC,EAAA,IAAA,GAAQ,OAAO,UAAA,GAAc,CAAA;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,KAAA,IAAS,IAAA;AAAA,EACrB,aAAA,GAAgB,KAAA;AAAA,EAChB,UAAA;AAAA,EACA;AACF,CAAA,KAA8B;AAC5B,EAAA,IAAI,IAAA,KAAS,MAAA,EAAW,eAAA,CAAgB,mBAAA,EAAqB,QAAQ,UAAU,CAAA;AAC/E,EAAA,IAAI,KAAA,KAAU,MAAA,EAAW,eAAA,CAAgB,mBAAA,EAAqB,SAAS,WAAW,CAAA;AAClF,EAAA,uBACEA,IAAAA,CAAAC,QAAAA,EAAA,EACG,QAAA,EAAA;AAAA,IAAA,QAAA,oBACCC,GAAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,aAAA,EAAY,MAAA;AAAA,QACZ,SAAA,EAAW,EAAA;AAAA,UACT,8DAAA;AAAA,UACA,UAAA,EAAY;AAAA,SACd;AAAA,QACA,KAAA,EAAO,EAAE,eAAA,EAAiB,qBAAA,EAAsB;AAAA,QAC/C,GAAG,MAAM,EAAE,aAAA,EAAe,UAAU,CAAA,EAAG,MAAM,SAAS;AAAA;AAAA,KACzD;AAAA,IAED,6BACCA,GAAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,aAAA,EAAY,MAAA;AAAA,QACZ,SAAA,EAAW,EAAA;AAAA,UACT,wEAAA;AAAA,UACA,UAAA,EAAY;AAAA,SACd;AAAA,QACA,KAAA,EAAO,EAAE,eAAA,EAAiB,sBAAA,EAAuB;AAAA,QAChD,GAAG,MAAM,EAAE,aAAA,EAAe,UAAU,CAAA,EAAG,MAAM,UAAU;AAAA;AAAA,KAC1D;AAAA,IAED,aAAA,oBAAiBA,GAAAA,CAAC,SAAA,EAAA,EAAU,YAAwB,MAAA,EAAgB;AAAA,GAAA,EACvE,CAAA;AAEJ","file":"index.js","sourcesContent":["import type { CSSProperties } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { props } from \"../../lib/props\"\n\n// The starfield AmbientBackground draws with `withStarfield`: a starry sky over\n// soft violet nebulae, stacked on the glow and noise (the noise is what\n// dithers these gradients so they never band). Every layer takes the same\n// recipe as glow and noise (fixed, -z-10, no shared wrapper) and paints over\n// them, still under every piece of the app.\n//\n// Everything is computed once at module load from a seeded PRNG, so the sky\n// is identical on every render, on the server and the client, and on every\n// visit. It moves, slowly: the clouds drift and swell, the dust dims and comes\n// back, the brighter stars breathe, and now and then a meteor crosses. All of\n// it is CSS animation of transform and opacity (keyframes in theme.css), so\n// the compositor runs it and no script does per frame; and all of it sits\n// behind `motion-safe:` and the `data-motion=\"reduced\"` rule in theme.css, so\n// with reduced motion the sky is a still picture, without the meteors.\n\n// mulberry32: tiny, fast, and good enough to scatter dots.\nconst prng = (seed: number) => () => {\n seed = (seed + 0x6d2b79f5) | 0\n let t = Math.imul(seed ^ (seed >>> 15), 1 | seed)\n t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t\n return ((t ^ (t >>> 14)) >>> 0) / 4294967296\n}\n\nconst round = (n: number) => Math.round(n * 100) / 100\n\ntype Star = { x: number; y: number; r: number; opacity: number }\n\n// Most stars are a cool white; a few lean violet or pink, as in the design.\n// On a light sky the same hues go dark, so the dots read as ink, not glare.\nconst TONES = [\n \"fill-brand-500 dark:fill-brand-100\",\n \"fill-purple-500 dark:fill-purple-200\",\n \"fill-pink-500 dark:fill-pink-200\",\n] as const\n\ntype Tone = (typeof TONES)[number]\n\nconst pickTone = (n: number): Tone => (n < 0.78 ? TONES[0] : n < 0.95 ? TONES[1] : TONES[2])\n\n// The dust dims in a few groups, each on its own slow beat, so at any moment\n// some stars are fading and others coming back. A group is a whole layer\n// fading (cheap: the compositor does it), and its stars are scattered all\n// over, so it reads as single stars dimming, not as a region pulsing. The\n// beats share no common factor, so the groups never line up into one blink.\nconst DIM_BEATS = [\n { duration: \"11s\", delay: \"-3s\" },\n { duration: \"17s\", delay: \"-11s\" },\n { duration: \"23s\", delay: \"-7s\" },\n] as const\n\n// Dots for one repeating tile, by dimming group, then by tone so each tone\n// is one <g>.\nconst scatter = (seed: number, size: number, count: number) => {\n const random = prng(seed)\n // Its own sequence, so sorting the dots into groups doesn't move them.\n const group = prng(seed + 1)\n const phases = DIM_BEATS.map(() => new Map<Tone, Star[]>(TONES.map((tone) => [tone, []])))\n for (let i = 0; i < count; i++) {\n // Skewed towards the faintest, smallest dots: a real sky is mostly dust.\n const weight = random() ** 2.4\n const star = {\n // Kept off the tile's edge so no dot is cut in half where tiles meet.\n x: round(2 + random() * (size - 4)),\n y: round(2 + random() * (size - 4)),\n r: round(0.4 + weight * 0.75),\n opacity: round(0.22 + weight * 0.4 + random() * 0.1),\n }\n phases[Math.floor(group() * phases.length)]?.get(pickTone(random()))?.push(star)\n }\n return { size, phases: phases.map((phase) => [...phase]) }\n}\n\n// Two tiles of coprime-ish sizes overlap into a pattern that only repeats\n// every few thousand pixels, so the eye never catches the tiling. Fixed pixel\n// tiles (not a scaled viewBox) keep the same density on a phone and a wide\n// screen. Together about one dot per 6000px², the design's own density.\nconst TILES = [scatter(42, 509, 26), scatter(1337, 733, 38)]\n\n// The few brighter stars, placed by viewport percentage so they spread over\n// any screen. A soft halo rather than a hard disc; the three with `sparkle`\n// carry the design's diffraction spikes, kept thin and short.\nconst BRIGHT_STARS = [\n { x: \"8%\", y: \"14%\", sparkle: true, delay: \"0s\", duration: \"7s\" },\n { x: \"31%\", y: \"6%\", sparkle: false, delay: \"-2s\", duration: \"9s\" },\n { x: \"62%\", y: \"11%\", sparkle: false, delay: \"-5s\", duration: \"8s\" },\n { x: \"88%\", y: \"22%\", sparkle: true, delay: \"-3s\", duration: \"10s\" },\n { x: \"18%\", y: \"58%\", sparkle: false, delay: \"-6s\", duration: \"8s\" },\n { x: \"47%\", y: \"41%\", sparkle: false, delay: \"-1s\", duration: \"11s\" },\n { x: \"76%\", y: \"63%\", sparkle: true, delay: \"-4s\", duration: \"9s\" },\n { x: \"36%\", y: \"86%\", sparkle: false, delay: \"-7s\", duration: \"10s\" },\n { x: \"93%\", y: \"90%\", sparkle: false, delay: \"-2.5s\", duration: \"7s\" },\n] as const\n\n// A four-point sparkle with concave sides: reads as a lens glint, not a shape.\nconst SPARKLE = \"M0 -6Q0 0 6 0Q0 0 0 6Q0 0 -6 0Q0 0 0 -6Z\"\n\n// Each cloud's layer overhangs the viewport by this much on every side, so a\n// cloud cut by the screen's edge (several are) can drift without the cut\n// ever coming into view.\nconst BLEED = 15\nconst SPAN = 100 + 2 * BLEED\n\n// A length or a position given in viewport %, as % of the overhanging layer.\nconst inLayer = (viewport: number, offset = 0) => `${round(((viewport + offset) / SPAN) * 100)}%`\n\ntype Ellipse = { rx: number; ry: number; x: number; y: number }\ntype Hue = { color: string; strength: number }\n\n// Violet and indigo clouds after the design's \"Nébuleuse\", softened: wide\n// ellipses that fade out over their whole radius so no edge ever shows. The\n// design's blue core is already the kit's ambient glow; this adds the purple.\nconst cloud = ({ rx, ry, x, y }: Ellipse, { color, strength }: Hue) =>\n `radial-gradient(ellipse ${inLayer(rx)} ${inLayer(ry)} at ${inLayer(x, BLEED)} ${inLayer(y, BLEED)}, color-mix(in oklab, var(${color}) ${strength}%, transparent), color-mix(in oklab, var(${color}) ${strength * 0.45}%, transparent) 45%, transparent 100%)`\n\n// Each cloud drifts on its own long, slow swing (there and back, eased at\n// both ends), swelling a little and thinning as it goes: a few px a second,\n// so the sky is never seen moving, only found changed. On a light sky the\n// same clouds are pale tints, so the light theme keeps the violet without\n// muddying the page.\nconst CLOUDS: {\n at: Ellipse\n dark: Hue\n light: Hue\n drift: { x: string; y: string; scale: number; fade: number; duration: string; delay: string }\n}[] = [\n {\n // Moved down-left, narrowed and brightened (9 → 17) against Figma's « Background / Cosmos »,\n // whose lower-left glows violet behind the first column (2026-10-29).\n at: { rx: 35, ry: 34, x: 23, y: 72 },\n dark: { color: \"--color-purple-400\", strength: 17 },\n light: { color: \"--color-purple-200\", strength: 14 },\n drift: { x: \"6vw\", y: \"-4vh\", scale: 1.12, fade: 0.7, duration: \"70s\", delay: \"-20s\" },\n },\n {\n at: { rx: 60, ry: 38, x: 42, y: 104 },\n dark: { color: \"--color-purple-800\", strength: 20 },\n light: { color: \"--color-purple-200\", strength: 26 },\n drift: { x: \"-8vw\", y: \"-3vh\", scale: 1.08, fade: 0.85, duration: \"95s\", delay: \"-50s\" },\n },\n {\n at: { rx: 40, ry: 34, x: 92, y: 4 },\n dark: { color: \"--color-purple-800\", strength: 22 },\n light: { color: \"--color-purple-200\", strength: 28 },\n drift: { x: \"-5vw\", y: \"5vh\", scale: 1.15, fade: 0.8, duration: \"85s\", delay: \"-10s\" },\n },\n {\n at: { rx: 46, ry: 40, x: 24, y: 20 },\n dark: { color: \"--color-brand-700\", strength: 18 },\n light: { color: \"--color-brand-200\", strength: 24 },\n drift: { x: \"7vw\", y: \"4vh\", scale: 1.1, fade: 0.85, duration: \"110s\", delay: \"-70s\" },\n },\n {\n at: { rx: 36, ry: 30, x: 4, y: 92 },\n dark: { color: \"--color-pink-800\", strength: 10 },\n light: { color: \"--color-pink-200\", strength: 16 },\n drift: { x: \"5vw\", y: \"-6vh\", scale: 1.2, fade: 0.6, duration: \"75s\", delay: \"-35s\" },\n },\n]\n\n// The cloud's picture per theme and its drift, as variables the classes and\n// the ambient-nebula-drift keyframes (theme.css) read.\nconst cloudStyle = ({ at, dark, light, drift }: (typeof CLOUDS)[number]) =>\n ({\n \"--nebula-light\": cloud(at, light),\n \"--nebula-dark\": cloud(at, dark),\n \"--drift-x\": drift.x,\n \"--drift-y\": drift.y,\n \"--drift-scale\": drift.scale,\n \"--drift-fade\": drift.fade,\n inset: `-${BLEED}%`,\n animationDuration: drift.duration,\n animationDelay: drift.delay,\n }) as CSSProperties\n\n// The meteors: three, each on its own long cycle and visible for about a\n// second of it, so one crosses every twenty seconds or so, never on arrival\n// and almost never two at once. Thin, short and faint, high in the sky,\n// falling down and to the left. Seen from the corner of the eye, not watched.\nconst METEORS = [\n { x: \"72%\", y: \"8%\", angle: \"152deg\", duration: \"37s\", delay: \"9s\" },\n { x: \"50%\", y: \"20%\", angle: \"160deg\", duration: \"53s\", delay: \"24s\" },\n { x: \"92%\", y: \"30%\", angle: \"148deg\", duration: \"71s\", delay: \"41s\" },\n] as const\n\n// The halo's stops, per theme: a gradient stop takes no `dark:` class.\nconst HALO_THEME =\n \"[--star-halo-core:var(--color-brand-400)] [--star-halo-rim:var(--color-purple-400)] dark:[--star-halo-core:var(--color-brand-100)] dark:[--star-halo-rim:var(--color-purple-300)]\"\n\n// Every layer's recipe: decorative, out of the pointer's way and out of a\n// forced palette's. `ambient-starfield` is the hook theme.css's\n// `data-motion=\"reduced\"` rule stills it by.\nconst LAYER = \"ambient-starfield pointer-events-none fixed -z-10 forced-colors:hidden\"\n\nexport type StarfieldClassNames = {\n /** Each nebula cloud's layer. */\n nebula?: string\n /** The layer holding the dust and the brighter stars. */\n stars?: string\n /** The meteors' layer. */\n meteors?: string\n}\n\nexport const Starfield = ({\n classNames,\n testId,\n}: {\n classNames?: StarfieldClassNames\n testId?: string\n}) => (\n <>\n {CLOUDS.map((c, i) => (\n <div\n key={`${c.at.x}-${c.at.y}`}\n aria-hidden=\"true\"\n className={cn(\n LAYER,\n \"[background-image:var(--nebula-light)] motion-safe:animate-ambient-nebula-drift dark:[background-image:var(--nebula-dark)]\",\n classNames?.nebula,\n )}\n style={cloudStyle(c)}\n {...props({ \"data-testid\": testId && `${testId}-nebula-${i}` })}\n />\n ))}\n\n {/* Fainter on a light sky: dark dots at the dark sky's strength read\n as specks rather than dust. Set on the wrapper, because the layers\n inside animate their own opacity. */}\n <div\n aria-hidden=\"true\"\n className={cn(LAYER, \"inset-0 opacity-70 dark:opacity-100\", HALO_THEME, classNames?.stars)}\n {...props({ \"data-testid\": testId && `${testId}-stars` })}\n >\n <svg aria-hidden=\"true\" className=\"absolute size-0\">\n <defs>\n {TILES.flatMap(({ size, phases }, i) =>\n phases.map((groups, phase) => (\n <pattern\n // biome-ignore lint/suspicious/noArrayIndexKey: a static, never-reordered list\n key={`${i}-${phase}`}\n id={`ambient-starfield-tile-${i}-${phase}`}\n width={size}\n height={size}\n patternUnits=\"userSpaceOnUse\"\n >\n {groups.map(([tone, stars]) => (\n <g key={tone} className={tone}>\n {stars.map(({ x, y, r, opacity }) => (\n <circle key={`${x}-${y}`} cx={x} cy={y} r={r} fillOpacity={opacity} />\n ))}\n </g>\n ))}\n </pattern>\n )),\n )}\n <radialGradient id=\"ambient-starfield-halo\">\n <stop offset=\"0%\" style={{ stopColor: \"var(--star-halo-core)\" }} stopOpacity={0.32} />\n <stop offset=\"35%\" style={{ stopColor: \"var(--star-halo-rim)\" }} stopOpacity={0.1} />\n <stop offset=\"100%\" style={{ stopColor: \"var(--star-halo-rim)\" }} stopOpacity={0} />\n </radialGradient>\n </defs>\n </svg>\n\n {DIM_BEATS.map(({ duration, delay }, phase) => (\n <svg\n key={duration}\n aria-hidden=\"true\"\n className=\"absolute inset-0 size-full motion-safe:animate-ambient-star-dim\"\n style={{ animationDuration: duration, animationDelay: delay }}\n >\n {TILES.map(({ size }, i) => (\n <rect\n key={size}\n width=\"100%\"\n height=\"100%\"\n fill={`url(#ambient-starfield-tile-${i}-${phase})`}\n />\n ))}\n </svg>\n ))}\n\n <svg aria-hidden=\"true\" className=\"absolute inset-0 size-full\">\n {BRIGHT_STARS.map(({ x, y, sparkle, delay, duration }) => (\n <svg key={`${x}-${y}`} aria-hidden=\"true\" x={x} y={y} overflow=\"visible\">\n <g\n className=\"motion-safe:animate-ambient-star-twinkle\"\n style={{ animationDelay: delay, animationDuration: duration }}\n >\n <circle r={7} fill=\"url(#ambient-starfield-halo)\" />\n {sparkle ? (\n <path\n d={SPARKLE}\n className=\"fill-purple-400 dark:fill-purple-100\"\n fillOpacity={0.4}\n />\n ) : null}\n <circle r={1.1} className=\"fill-brand-500 dark:fill-brand-50\" fillOpacity={0.85} />\n </g>\n </svg>\n ))}\n </svg>\n </div>\n\n {/* Only where motion is welcome: a meteor standing still is a scratch. */}\n <div\n aria-hidden=\"true\"\n className={cn(\n LAYER,\n \"ambient-starfield-meteors inset-0 hidden overflow-hidden motion-safe:block\",\n classNames?.meteors,\n )}\n {...props({ \"data-testid\": testId && `${testId}-meteors` })}\n >\n {METEORS.map(({ x, y, angle, duration, delay }) => (\n // A zero-size anchor turned to the meteor's heading; the streak\n // ends at it, head first, and flies along that heading.\n <span\n key={`${x}-${y}`}\n className=\"absolute size-0\"\n style={{ left: x, top: y, rotate: angle }}\n >\n <span\n className=\"absolute top-0 right-0 h-px w-28 origin-right rounded-full bg-linear-to-r from-transparent to-brand-500/50 opacity-0 motion-safe:animate-ambient-meteor dark:to-white/60\"\n style={{ animationDuration: duration, animationDelay: delay }}\n />\n </span>\n ))}\n </div>\n </>\n)\n","import { cn } from \"../../lib/cn\"\nimport { warnRenamedProp } from \"../../lib/dev-warn\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { Starfield, type StarfieldClassNames } from \"./starfield\"\n\n/**\n * AmbientBackground — a decorative, brand-tinted page background: a soft\n * radial glow plus a fine film-grain noise texture, so a flat page fill reads\n * as a considered surface instead of a plain color.\n *\n * Render it once, as the first child of your root layout (so later content\n * naturally paints over it) — both layers are `position: fixed`, so a single\n * instance covers the whole viewport regardless of scroll position or page\n * height. It renders nothing interactive: `aria-hidden`, `pointer-events-none`,\n * and hidden under `forced-colors` (Windows High Contrast), since a decorative\n * background has no place overriding a user's forced palette.\n *\n * Glow and noise render as two *independent* fixed elements rather than one\n * wrapper containing two children, so either can be toggled/overridden\n * without the other, and neither traps a future blend-mode override inside\n * an isolated stacking context (`position: fixed` always creates one,\n * regardless of z-index — nesting a blended layer inside another `fixed`\n * wrapper would cut off what it can blend against).\n *\n * `withStarfield` adds a third, opt-in layer set: a slowly moving starry sky\n * over soft violet nebulae (dimming dust, breathing bright stars, a rare\n * meteor), seeded so it is identical on every render. It follows the same\n * recipe — separate fixed layers, no shared wrapper — and stills under reduced\n * motion, either the OS setting or `data-motion=\"reduced\"` on `<html>`.\n *\n * The actual glow/noise values are CSS custom properties (`--ambient-glow` /\n * `--ambient-noise`, defined in `theme.css`, brand-tinted and theme-aware via\n * `data-theme`) rather than hardcoded here — override either on `:root` to\n * reskin it without forking this component.\n *\n * Pure Server Component: no state, no client JS.\n *\n * @example\n * ```tsx\n * // app/layout.tsx\n * <body>\n * <AmbientBackground />\n * {children}\n * </body>\n * ```\n */\n/**\n * There is no root element, so `testId` lands on each layer with its part as a\n * suffix: `` `${testId}-glow` `` and `` `${testId}-noise` ``, and with the\n * starfield `` `${testId}-nebula-<n>` ``, `` `${testId}-stars` `` and\n * `` `${testId}-meteors` ``.\n */\nexport type AmbientBackgroundProps = WithTestId & {\n /** Render the radial glow layer. Default `true`. */\n withGlow?: boolean\n /** Render the film-grain noise layer. Default `true`. */\n withNoise?: boolean\n /** Render the starfield over the glow and noise: nebulae, stars and meteors. Default `false`. */\n withStarfield?: boolean\n /** @deprecated Renamed `withGlow`. Removed in the next minor. `withGlow` wins when both are set. */\n glow?: boolean\n /** @deprecated Renamed `withNoise`. Removed in the next minor. `withNoise` wins when both are set. */\n noise?: boolean\n /** Extra classes for each layer. */\n classNames?: StarfieldClassNames & {\n glow?: string\n noise?: string\n }\n}\n\nexport const AmbientBackground = ({\n glow,\n noise,\n withGlow = glow ?? true,\n withNoise = noise ?? true,\n withStarfield = false,\n classNames,\n testId,\n}: AmbientBackgroundProps) => {\n if (glow !== undefined) warnRenamedProp(\"AmbientBackground\", \"glow\", \"withGlow\")\n if (noise !== undefined) warnRenamedProp(\"AmbientBackground\", \"noise\", \"withNoise\")\n return (\n <>\n {withGlow && (\n <div\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none fixed inset-0 -z-10 forced-colors:hidden\",\n classNames?.glow,\n )}\n style={{ backgroundImage: \"var(--ambient-glow)\" }}\n {...props({ \"data-testid\": testId && `${testId}-glow` })}\n />\n )}\n {withNoise && (\n <div\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none fixed inset-0 -z-10 bg-repeat forced-colors:hidden\",\n classNames?.noise,\n )}\n style={{ backgroundImage: \"var(--ambient-noise)\" }}\n {...props({ \"data-testid\": testId && `${testId}-noise` })}\n />\n )}\n {withStarfield && <Starfield classNames={classNames} testId={testId} />}\n </>\n )\n}\n"]}
1
+ {"version":3,"sources":["../../../src/components/ambient-background/starfield.tsx","../../../src/components/ambient-background/ambient-background.tsx"],"names":["jsxs","Fragment","jsx"],"mappings":";;;;;AAsBA,IAAM,IAAA,GAAO,CAAC,IAAA,KAAiB,MAAM;AACnC,EAAA,IAAA,GAAQ,OAAO,UAAA,GAAc,CAAA;AAC7B,EAAA,IAAI,IAAI,IAAA,CAAK,IAAA,CAAK,OAAQ,IAAA,KAAS,EAAA,EAAK,IAAI,IAAI,CAAA;AAChD,EAAA,CAAA,GAAK,CAAA,GAAI,KAAK,IAAA,CAAK,CAAA,GAAK,MAAM,CAAA,EAAI,EAAA,GAAK,CAAC,CAAA,GAAK,CAAA;AAC7C,EAAA,OAAA,CAAA,CAAS,CAAA,GAAK,CAAA,KAAM,EAAA,MAAS,CAAA,IAAK,UAAA;AACpC,CAAA;AAEA,IAAM,QAAQ,CAAC,CAAA,KAAc,KAAK,KAAA,CAAM,CAAA,GAAI,GAAG,CAAA,GAAI,GAAA;AAMnD,IAAM,KAAA,GAAQ;AAAA,EACZ,oCAAA;AAAA,EACA,sCAAA;AAAA,EACA;AACF,CAAA;AAIA,IAAM,QAAA,GAAW,CAAC,CAAA,KAAqB,CAAA,GAAI,OAAO,KAAA,CAAM,CAAC,CAAA,GAAI,CAAA,GAAI,IAAA,GAAO,KAAA,CAAM,CAAC,CAAA,GAAI,MAAM,CAAC,CAAA;AAO1F,IAAM,SAAA,GAAY;AAAA,EAChB,EAAE,QAAA,EAAU,KAAA,EAAO,KAAA,EAAO,KAAA,EAAM;AAAA,EAChC,EAAE,QAAA,EAAU,KAAA,EAAO,KAAA,EAAO,MAAA,EAAO;AAAA,EACjC,EAAE,QAAA,EAAU,KAAA,EAAO,KAAA,EAAO,KAAA;AAC5B,CAAA;AAIA,I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B;AAAA,GAAA,EACvE,CAAA;AAEJ","file":"index.js","sourcesContent":["import type { CSSProperties } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { props } from \"../../lib/props\"\n\n// The starfield AmbientBackground draws with `withStarfield`: a starry sky over\n// soft violet nebulae, stacked on the glow and noise (the noise is what\n// dithers these gradients so they never band). Every layer takes the same\n// recipe as glow and noise (fixed, -z-10, no shared wrapper) and paints over\n// them, still under every piece of the app.\n//\n// Everything is computed once at module load from a seeded PRNG, so the sky\n// is identical on every render, on the server and the client, and on every\n// visit. The clouds hold still: a drifting full-screen gradient is redrawn\n// whole on every frame in Firefox, which kept its GPU busy for as long as a\n// page was open. The rest moves, slowly: the dust dims and comes back, the\n// brighter stars breathe, and now and then a meteor crosses. All of it is CSS\n// animation of opacity and transform (keyframes in theme.css), so the\n// compositor runs it and no script does per frame; and all of it sits\n// behind `motion-safe:` and the `data-motion=\"reduced\"` rule in theme.css, so\n// with reduced motion the sky is a still picture, without the meteors.\n\n// mulberry32: tiny, fast, and good enough to scatter dots.\nconst prng = (seed: number) => () => {\n seed = (seed + 0x6d2b79f5) | 0\n let t = Math.imul(seed ^ (seed >>> 15), 1 | seed)\n t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t\n return ((t ^ (t >>> 14)) >>> 0) / 4294967296\n}\n\nconst round = (n: number) => Math.round(n * 100) / 100\n\ntype Star = { x: number; y: number; r: number; opacity: number }\n\n// Most stars are a cool white; a few lean violet or pink, as in the design.\n// On a light sky the same hues go dark, so the dots read as ink, not glare.\nconst TONES = [\n \"fill-brand-500 dark:fill-brand-100\",\n \"fill-purple-500 dark:fill-purple-200\",\n \"fill-pink-500 dark:fill-pink-200\",\n] as const\n\ntype Tone = (typeof TONES)[number]\n\nconst pickTone = (n: number): Tone => (n < 0.78 ? TONES[0] : n < 0.95 ? TONES[1] : TONES[2])\n\n// The dust dims in a few groups, each on its own slow beat, so at any moment\n// some stars are fading and others coming back. A group is a whole layer\n// fading (cheap: the compositor does it), and its stars are scattered all\n// over, so it reads as single stars dimming, not as a region pulsing. The\n// beats share no common factor, so the groups never line up into one blink.\nconst DIM_BEATS = [\n { duration: \"11s\", delay: \"-3s\" },\n { duration: \"17s\", delay: \"-11s\" },\n { duration: \"23s\", delay: \"-7s\" },\n] as const\n\n// Dots for one repeating tile, by dimming group, then by tone so each tone\n// is one <g>.\nconst scatter = (seed: number, size: number, count: number) => {\n const random = prng(seed)\n // Its own sequence, so sorting the dots into groups doesn't move them.\n const group = prng(seed + 1)\n const phases = DIM_BEATS.map(() => new Map<Tone, Star[]>(TONES.map((tone) => [tone, []])))\n for (let i = 0; i < count; i++) {\n // Skewed towards the faintest, smallest dots: a real sky is mostly dust.\n const weight = random() ** 2.4\n const star = {\n // Kept off the tile's edge so no dot is cut in half where tiles meet.\n x: round(2 + random() * (size - 4)),\n y: round(2 + random() * (size - 4)),\n r: round(0.4 + weight * 0.75),\n opacity: round(0.22 + weight * 0.4 + random() * 0.1),\n }\n phases[Math.floor(group() * phases.length)]?.get(pickTone(random()))?.push(star)\n }\n return { size, phases: phases.map((phase) => [...phase]) }\n}\n\n// Two tiles of coprime-ish sizes overlap into a pattern that only repeats\n// every few thousand pixels, so the eye never catches the tiling. Fixed pixel\n// tiles (not a scaled viewBox) keep the same density on a phone and a wide\n// screen. Together about one dot per 6000px², the design's own density.\nconst TILES = [scatter(42, 509, 26), scatter(1337, 733, 38)]\n\n// The few brighter stars, placed by viewport percentage so they spread over\n// any screen. A soft halo rather than a hard disc; the three with `sparkle`\n// carry the design's diffraction spikes, kept thin and short.\nconst BRIGHT_STARS = [\n { x: \"8%\", y: \"14%\", sparkle: true, delay: \"0s\", duration: \"7s\" },\n { x: \"31%\", y: \"6%\", sparkle: false, delay: \"-2s\", duration: \"9s\" },\n { x: \"62%\", y: \"11%\", sparkle: false, delay: \"-5s\", duration: \"8s\" },\n { x: \"88%\", y: \"22%\", sparkle: true, delay: \"-3s\", duration: \"10s\" },\n { x: \"18%\", y: \"58%\", sparkle: false, delay: \"-6s\", duration: \"8s\" },\n { x: \"47%\", y: \"41%\", sparkle: false, delay: \"-1s\", duration: \"11s\" },\n { x: \"76%\", y: \"63%\", sparkle: true, delay: \"-4s\", duration: \"9s\" },\n { x: \"36%\", y: \"86%\", sparkle: false, delay: \"-7s\", duration: \"10s\" },\n { x: \"93%\", y: \"90%\", sparkle: false, delay: \"-2.5s\", duration: \"7s\" },\n] as const\n\n// A four-point sparkle with concave sides: reads as a lens glint, not a shape.\nconst SPARKLE = \"M0 -6Q0 0 6 0Q0 0 0 6Q0 0 -6 0Q0 0 0 -6Z\"\n\ntype Ellipse = { rx: number; ry: number; x: number; y: number }\ntype Hue = { color: string; strength: number }\n\n// Violet and indigo clouds after the design's \"Nébuleuse\", softened: wide\n// ellipses that fade out over their whole radius so no edge ever shows. The\n// design's blue core is already the kit's ambient glow; this adds the purple.\nconst cloud = ({ rx, ry, x, y }: Ellipse, { color, strength }: Hue) =>\n `radial-gradient(ellipse ${rx}% ${ry}% at ${x}% ${y}%, color-mix(in oklab, var(${color}) ${strength}%, transparent), color-mix(in oklab, var(${color}) ${strength * 0.45}%, transparent) 45%, transparent 100%)`\n\n// On a light sky the same clouds are pale tints, so the light theme keeps\n// the violet without muddying the page.\nconst CLOUDS: { at: Ellipse; dark: Hue; light: Hue }[] = [\n {\n // Moved down-left, narrowed and brightened (9 → 17) against Figma's « Background / Cosmos »,\n // whose lower-left glows violet behind the first column (2026-10-29).\n at: { rx: 35, ry: 34, x: 23, y: 72 },\n dark: { color: \"--color-purple-400\", strength: 17 },\n light: { color: \"--color-purple-200\", strength: 14 },\n },\n {\n at: { rx: 60, ry: 38, x: 42, y: 104 },\n dark: { color: \"--color-purple-800\", strength: 20 },\n light: { color: \"--color-purple-200\", strength: 26 },\n },\n {\n at: { rx: 40, ry: 34, x: 92, y: 4 },\n dark: { color: \"--color-purple-800\", strength: 22 },\n light: { color: \"--color-purple-200\", strength: 28 },\n },\n {\n at: { rx: 46, ry: 40, x: 24, y: 20 },\n dark: { color: \"--color-brand-700\", strength: 18 },\n light: { color: \"--color-brand-200\", strength: 24 },\n },\n {\n at: { rx: 36, ry: 30, x: 4, y: 92 },\n dark: { color: \"--color-pink-800\", strength: 10 },\n light: { color: \"--color-pink-200\", strength: 16 },\n },\n]\n\n// The cloud's picture per theme, as variables the classes read.\nconst cloudStyle = ({ at, dark, light }: (typeof CLOUDS)[number]) =>\n ({\n \"--nebula-light\": cloud(at, light),\n \"--nebula-dark\": cloud(at, dark),\n inset: 0,\n }) as CSSProperties\n\n// The meteors: three, each on its own long cycle and visible for about a\n// second of it, so one crosses every twenty seconds or so, never on arrival\n// and almost never two at once. Thin, short and faint, high in the sky,\n// falling down and to the left. Seen from the corner of the eye, not watched.\nconst METEORS = [\n { x: \"72%\", y: \"8%\", angle: \"152deg\", duration: \"37s\", delay: \"9s\" },\n { x: \"50%\", y: \"20%\", angle: \"160deg\", duration: \"53s\", delay: \"24s\" },\n { x: \"92%\", y: \"30%\", angle: \"148deg\", duration: \"71s\", delay: \"41s\" },\n] as const\n\n// The halo's stops, per theme: a gradient stop takes no `dark:` class.\nconst HALO_THEME =\n \"[--star-halo-core:var(--color-brand-400)] [--star-halo-rim:var(--color-purple-400)] dark:[--star-halo-core:var(--color-brand-100)] dark:[--star-halo-rim:var(--color-purple-300)]\"\n\n// Every layer's recipe: decorative, out of the pointer's way and out of a\n// forced palette's. `ambient-starfield` is the hook theme.css's\n// `data-motion=\"reduced\"` rule stills it by.\nconst LAYER = \"ambient-starfield pointer-events-none fixed -z-10 forced-colors:hidden\"\n\nexport type StarfieldClassNames = {\n /** Each nebula cloud's layer. */\n nebula?: string\n /** The layer holding the dust and the brighter stars. */\n stars?: string\n /** The meteors' layer. */\n meteors?: string\n}\n\nexport const Starfield = ({\n classNames,\n testId,\n}: {\n classNames?: StarfieldClassNames\n testId?: string\n}) => (\n <>\n {CLOUDS.map((c, i) => (\n <div\n key={`${c.at.x}-${c.at.y}`}\n aria-hidden=\"true\"\n className={cn(\n LAYER,\n \"[background-image:var(--nebula-light)] dark:[background-image:var(--nebula-dark)]\",\n classNames?.nebula,\n )}\n style={cloudStyle(c)}\n {...props({ \"data-testid\": testId && `${testId}-nebula-${i}` })}\n />\n ))}\n\n {/* Fainter on a light sky: dark dots at the dark sky's strength read\n as specks rather than dust. Set on the wrapper, because the layers\n inside animate their own opacity. */}\n <div\n aria-hidden=\"true\"\n className={cn(LAYER, \"inset-0 opacity-70 dark:opacity-100\", HALO_THEME, classNames?.stars)}\n {...props({ \"data-testid\": testId && `${testId}-stars` })}\n >\n <svg aria-hidden=\"true\" className=\"absolute size-0\">\n <defs>\n {TILES.flatMap(({ size, phases }, i) =>\n phases.map((groups, phase) => (\n <pattern\n // biome-ignore lint/suspicious/noArrayIndexKey: a static, never-reordered list\n key={`${i}-${phase}`}\n id={`ambient-starfield-tile-${i}-${phase}`}\n width={size}\n height={size}\n patternUnits=\"userSpaceOnUse\"\n >\n {groups.map(([tone, stars]) => (\n <g key={tone} className={tone}>\n {stars.map(({ x, y, r, opacity }) => (\n <circle key={`${x}-${y}`} cx={x} cy={y} r={r} fillOpacity={opacity} />\n ))}\n </g>\n ))}\n </pattern>\n )),\n )}\n <radialGradient id=\"ambient-starfield-halo\">\n <stop offset=\"0%\" style={{ stopColor: \"var(--star-halo-core)\" }} stopOpacity={0.32} />\n <stop offset=\"35%\" style={{ stopColor: \"var(--star-halo-rim)\" }} stopOpacity={0.1} />\n <stop offset=\"100%\" style={{ stopColor: \"var(--star-halo-rim)\" }} stopOpacity={0} />\n </radialGradient>\n </defs>\n </svg>\n\n {DIM_BEATS.map(({ duration, delay }, phase) => (\n <svg\n key={duration}\n aria-hidden=\"true\"\n className=\"absolute inset-0 size-full motion-safe:animate-ambient-star-dim\"\n style={{ animationDuration: duration, animationDelay: delay }}\n >\n {TILES.map(({ size }, i) => (\n <rect\n key={size}\n width=\"100%\"\n height=\"100%\"\n fill={`url(#ambient-starfield-tile-${i}-${phase})`}\n />\n ))}\n </svg>\n ))}\n\n <svg aria-hidden=\"true\" className=\"absolute inset-0 size-full\">\n {BRIGHT_STARS.map(({ x, y, sparkle, delay, duration }) => (\n <svg key={`${x}-${y}`} aria-hidden=\"true\" x={x} y={y} overflow=\"visible\">\n <g\n className=\"motion-safe:animate-ambient-star-twinkle\"\n style={{ animationDelay: delay, animationDuration: duration }}\n >\n <circle r={7} fill=\"url(#ambient-starfield-halo)\" />\n {sparkle ? (\n <path\n d={SPARKLE}\n className=\"fill-purple-400 dark:fill-purple-100\"\n fillOpacity={0.4}\n />\n ) : null}\n <circle r={1.1} className=\"fill-brand-500 dark:fill-brand-50\" fillOpacity={0.85} />\n </g>\n </svg>\n ))}\n </svg>\n </div>\n\n {/* Only where motion is welcome: a meteor standing still is a scratch. */}\n <div\n aria-hidden=\"true\"\n className={cn(\n LAYER,\n \"ambient-starfield-meteors inset-0 hidden overflow-hidden motion-safe:block\",\n classNames?.meteors,\n )}\n {...props({ \"data-testid\": testId && `${testId}-meteors` })}\n >\n {METEORS.map(({ x, y, angle, duration, delay }) => (\n // A zero-size anchor turned to the meteor's heading; the streak\n // ends at it, head first, and flies along that heading.\n <span\n key={`${x}-${y}`}\n className=\"absolute size-0\"\n style={{ left: x, top: y, rotate: angle }}\n >\n <span\n className=\"absolute top-0 right-0 h-px w-28 origin-right rounded-full bg-linear-to-r from-transparent to-brand-500/50 opacity-0 motion-safe:animate-ambient-meteor dark:to-white/60\"\n style={{ animationDuration: duration, animationDelay: delay }}\n />\n </span>\n ))}\n </div>\n </>\n)\n","import { cn } from \"../../lib/cn\"\nimport { warnRenamedProp } from \"../../lib/dev-warn\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { Starfield, type StarfieldClassNames } from \"./starfield\"\n\n/**\n * AmbientBackground — a decorative, brand-tinted page background: a soft\n * radial glow plus a fine film-grain noise texture, so a flat page fill reads\n * as a considered surface instead of a plain color.\n *\n * Render it once, as the first child of your root layout (so later content\n * naturally paints over it) — both layers are `position: fixed`, so a single\n * instance covers the whole viewport regardless of scroll position or page\n * height. It renders nothing interactive: `aria-hidden`, `pointer-events-none`,\n * and hidden under `forced-colors` (Windows High Contrast), since a decorative\n * background has no place overriding a user's forced palette.\n *\n * Glow and noise render as two *independent* fixed elements rather than one\n * wrapper containing two children, so either can be toggled/overridden\n * without the other, and neither traps a future blend-mode override inside\n * an isolated stacking context (`position: fixed` always creates one,\n * regardless of z-index — nesting a blended layer inside another `fixed`\n * wrapper would cut off what it can blend against).\n *\n * `withStarfield` adds a third, opt-in layer set: a slowly moving starry sky\n * over soft violet nebulae (dimming dust, breathing bright stars, a rare\n * meteor), seeded so it is identical on every render. It follows the same\n * recipe — separate fixed layers, no shared wrapper — and stills under reduced\n * motion, either the OS setting or `data-motion=\"reduced\"` on `<html>`.\n *\n * The actual glow/noise values are CSS custom properties (`--ambient-glow` /\n * `--ambient-noise`, defined in `theme.css`, brand-tinted and theme-aware via\n * `data-theme`) rather than hardcoded here — override either on `:root` to\n * reskin it without forking this component.\n *\n * Pure Server Component: no state, no client JS.\n *\n * @example\n * ```tsx\n * // app/layout.tsx\n * <body>\n * <AmbientBackground />\n * {children}\n * </body>\n * ```\n */\n/**\n * There is no root element, so `testId` lands on each layer with its part as a\n * suffix: `` `${testId}-glow` `` and `` `${testId}-noise` ``, and with the\n * starfield `` `${testId}-nebula-<n>` ``, `` `${testId}-stars` `` and\n * `` `${testId}-meteors` ``.\n */\nexport type AmbientBackgroundProps = WithTestId & {\n /** Render the radial glow layer. Default `true`. */\n withGlow?: boolean\n /** Render the film-grain noise layer. Default `true`. */\n withNoise?: boolean\n /** Render the starfield over the glow and noise: nebulae, stars and meteors. Default `false`. */\n withStarfield?: boolean\n /** @deprecated Renamed `withGlow`. Removed in the next minor. `withGlow` wins when both are set. */\n glow?: boolean\n /** @deprecated Renamed `withNoise`. Removed in the next minor. `withNoise` wins when both are set. */\n noise?: boolean\n /** Extra classes for each layer. */\n classNames?: StarfieldClassNames & {\n glow?: string\n noise?: string\n }\n}\n\nexport const AmbientBackground = ({\n glow,\n noise,\n withGlow = glow ?? true,\n withNoise = noise ?? true,\n withStarfield = false,\n classNames,\n testId,\n}: AmbientBackgroundProps) => {\n if (glow !== undefined) warnRenamedProp(\"AmbientBackground\", \"glow\", \"withGlow\")\n if (noise !== undefined) warnRenamedProp(\"AmbientBackground\", \"noise\", \"withNoise\")\n return (\n <>\n {withGlow && (\n <div\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none fixed inset-0 -z-10 forced-colors:hidden\",\n classNames?.glow,\n )}\n style={{ backgroundImage: \"var(--ambient-glow)\" }}\n {...props({ \"data-testid\": testId && `${testId}-glow` })}\n />\n )}\n {withNoise && (\n <div\n aria-hidden=\"true\"\n className={cn(\n \"pointer-events-none fixed inset-0 -z-10 bg-repeat forced-colors:hidden\",\n classNames?.noise,\n )}\n style={{ backgroundImage: \"var(--ambient-noise)\" }}\n {...props({ \"data-testid\": testId && `${testId}-noise` })}\n />\n )}\n {withStarfield && <Starfield classNames={classNames} testId={testId} />}\n </>\n )\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"starfield.d.ts","sourceRoot":"","sources":["../../../src/components/ambient-background/starfield.tsx"],"names":[],"mappings":"AAqMA,MAAM,MAAM,mBAAmB,GAAG;IAChC,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,0BAA0B;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,SAAS,4BAGnB;IACD,UAAU,CAAC,EAAE,mBAAmB,CAAA;IAChC,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,gCAwHA,CAAA"}
1
+ {"version":3,"file":"starfield.d.ts","sourceRoot":"","sources":["../../../src/components/ambient-background/starfield.tsx"],"names":[],"mappings":"AA0KA,MAAM,MAAM,mBAAmB,GAAG;IAChC,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,0BAA0B;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,SAAS,4BAGnB;IACD,UAAU,CAAC,EAAE,mBAAmB,CAAA;IAChC,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,gCAwHA,CAAA"}