@particle-academy/react-fancy 5.61.0 → 5.62.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 (156) hide show
  1. package/CHANGELOG.md +81 -0
  2. package/dist/autocomplete.cjs +3 -3
  3. package/dist/autocomplete.js +2 -2
  4. package/dist/breadcrumbs.cjs +3 -3
  5. package/dist/breadcrumbs.js +2 -2
  6. package/dist/{chunk-KNKOSMOQ.cjs → chunk-35S5BTZH.cjs} +4 -4
  7. package/dist/{chunk-KNKOSMOQ.cjs.map → chunk-35S5BTZH.cjs.map} +1 -1
  8. package/dist/{chunk-O4HZVZMY.cjs → chunk-4GOOSZEK.cjs} +86 -24
  9. package/dist/chunk-4GOOSZEK.cjs.map +1 -0
  10. package/dist/{chunk-3I6PE2US.cjs → chunk-4XHG6Q42.cjs} +11 -11
  11. package/dist/{chunk-3I6PE2US.cjs.map → chunk-4XHG6Q42.cjs.map} +1 -1
  12. package/dist/{chunk-3AYRLFNO.js → chunk-A67EDGC7.js} +3 -3
  13. package/dist/{chunk-3AYRLFNO.js.map → chunk-A67EDGC7.js.map} +1 -1
  14. package/dist/{chunk-4HUD33OP.cjs → chunk-A6HWKQ4D.cjs} +4 -4
  15. package/dist/{chunk-4HUD33OP.cjs.map → chunk-A6HWKQ4D.cjs.map} +1 -1
  16. package/dist/{chunk-P6V4QWJK.cjs → chunk-AJPYGRLA.cjs} +4 -4
  17. package/dist/{chunk-P6V4QWJK.cjs.map → chunk-AJPYGRLA.cjs.map} +1 -1
  18. package/dist/{chunk-LMOPAY7Q.js → chunk-ARO2DNGS.js} +3 -3
  19. package/dist/{chunk-LMOPAY7Q.js.map → chunk-ARO2DNGS.js.map} +1 -1
  20. package/dist/{chunk-N7KUGFRG.js → chunk-BTNF3QBR.js} +4 -4
  21. package/dist/{chunk-N7KUGFRG.js.map → chunk-BTNF3QBR.js.map} +1 -1
  22. package/dist/{chunk-K6NADZ7O.cjs → chunk-CMC2TOEQ.cjs} +6 -6
  23. package/dist/{chunk-K6NADZ7O.cjs.map → chunk-CMC2TOEQ.cjs.map} +1 -1
  24. package/dist/{chunk-NDLESFUH.js → chunk-ELFTEJBT.js} +3 -3
  25. package/dist/{chunk-NDLESFUH.js.map → chunk-ELFTEJBT.js.map} +1 -1
  26. package/dist/{chunk-PKFEJWVI.js → chunk-EUVWYDFN.js} +3 -3
  27. package/dist/{chunk-PKFEJWVI.js.map → chunk-EUVWYDFN.js.map} +1 -1
  28. package/dist/{chunk-CEZVKKYW.js → chunk-EVIHLWPG.js} +4 -4
  29. package/dist/{chunk-CEZVKKYW.js.map → chunk-EVIHLWPG.js.map} +1 -1
  30. package/dist/{chunk-ULG4OA2T.js → chunk-FVI4JDLA.js} +3 -3
  31. package/dist/{chunk-ULG4OA2T.js.map → chunk-FVI4JDLA.js.map} +1 -1
  32. package/dist/{chunk-IY6LVALS.js → chunk-GEQKNV7E.js} +3 -3
  33. package/dist/{chunk-IY6LVALS.js.map → chunk-GEQKNV7E.js.map} +1 -1
  34. package/dist/{chunk-4FJWHVC7.js → chunk-GR2WKBER.js} +4 -2
  35. package/dist/chunk-GR2WKBER.js.map +1 -0
  36. package/dist/{chunk-UGXBTIV5.js → chunk-GZ5Z56QK.js} +4 -4
  37. package/dist/{chunk-UGXBTIV5.js.map → chunk-GZ5Z56QK.js.map} +1 -1
  38. package/dist/{chunk-Z5OTOYWI.cjs → chunk-HANQYZW2.cjs} +4 -4
  39. package/dist/{chunk-Z5OTOYWI.cjs.map → chunk-HANQYZW2.cjs.map} +1 -1
  40. package/dist/{chunk-UBEOB55O.js → chunk-JG2DJK5A.js} +3 -3
  41. package/dist/{chunk-UBEOB55O.js.map → chunk-JG2DJK5A.js.map} +1 -1
  42. package/dist/{chunk-J4FKJ4IR.cjs → chunk-LFC2DL6H.cjs} +4 -4
  43. package/dist/{chunk-J4FKJ4IR.cjs.map → chunk-LFC2DL6H.cjs.map} +1 -1
  44. package/dist/{chunk-FU6K7XXZ.cjs → chunk-MKGWHSNV.cjs} +4 -4
  45. package/dist/{chunk-FU6K7XXZ.cjs.map → chunk-MKGWHSNV.cjs.map} +1 -1
  46. package/dist/{chunk-BHUSI56C.js → chunk-MVVHUTXA.js} +3 -3
  47. package/dist/{chunk-BHUSI56C.js.map → chunk-MVVHUTXA.js.map} +1 -1
  48. package/dist/{chunk-UJZJBHMH.js → chunk-NILA2LZY.js} +3 -3
  49. package/dist/{chunk-UJZJBHMH.js.map → chunk-NILA2LZY.js.map} +1 -1
  50. package/dist/{chunk-SHF44YGG.js → chunk-NSJBVV7R.js} +3 -3
  51. package/dist/{chunk-SHF44YGG.js.map → chunk-NSJBVV7R.js.map} +1 -1
  52. package/dist/{chunk-QXMQVLRQ.cjs → chunk-OASSZI6M.cjs} +4 -2
  53. package/dist/chunk-OASSZI6M.cjs.map +1 -0
  54. package/dist/chunk-OUYC6EIL.cjs +66 -0
  55. package/dist/chunk-OUYC6EIL.cjs.map +1 -0
  56. package/dist/{chunk-5JFA7NYE.js → chunk-PXZRYL5I.js} +3 -3
  57. package/dist/{chunk-5JFA7NYE.js.map → chunk-PXZRYL5I.js.map} +1 -1
  58. package/dist/{chunk-TYTENEJQ.cjs → chunk-QNQNGARW.cjs} +6 -6
  59. package/dist/{chunk-TYTENEJQ.cjs.map → chunk-QNQNGARW.cjs.map} +1 -1
  60. package/dist/{chunk-74MEJWMH.js → chunk-QP35Z2WB.js} +3 -3
  61. package/dist/{chunk-74MEJWMH.js.map → chunk-QP35Z2WB.js.map} +1 -1
  62. package/dist/{chunk-NORVXHRU.js → chunk-QTS4Q2NK.js} +3 -3
  63. package/dist/{chunk-NORVXHRU.js.map → chunk-QTS4Q2NK.js.map} +1 -1
  64. package/dist/{chunk-4TTBPEQX.cjs → chunk-QWNZZPFL.cjs} +8 -8
  65. package/dist/{chunk-4TTBPEQX.cjs.map → chunk-QWNZZPFL.cjs.map} +1 -1
  66. package/dist/{chunk-7KTBVKNO.cjs → chunk-R6URPHEP.cjs} +4 -4
  67. package/dist/{chunk-7KTBVKNO.cjs.map → chunk-R6URPHEP.cjs.map} +1 -1
  68. package/dist/{chunk-4JLFIPHZ.js → chunk-RP43ZFZP.js} +8 -3
  69. package/dist/chunk-RP43ZFZP.js.map +1 -0
  70. package/dist/{chunk-RRMQGTVB.cjs → chunk-SYEHWUM5.cjs} +6 -6
  71. package/dist/{chunk-RRMQGTVB.cjs.map → chunk-SYEHWUM5.cjs.map} +1 -1
  72. package/dist/{chunk-IHQHTJNN.js → chunk-SZH7TFME.js} +4 -4
  73. package/dist/{chunk-IHQHTJNN.js.map → chunk-SZH7TFME.js.map} +1 -1
  74. package/dist/{chunk-JOWAS5A5.cjs → chunk-TQGRXJ74.cjs} +9 -9
  75. package/dist/{chunk-JOWAS5A5.cjs.map → chunk-TQGRXJ74.cjs.map} +1 -1
  76. package/dist/{chunk-6GBO7R25.cjs → chunk-UJRMY54A.cjs} +4 -4
  77. package/dist/{chunk-6GBO7R25.cjs.map → chunk-UJRMY54A.cjs.map} +1 -1
  78. package/dist/{chunk-ZPBCZPMD.cjs → chunk-VQJ5LJJH.cjs} +8 -3
  79. package/dist/chunk-VQJ5LJJH.cjs.map +1 -0
  80. package/dist/{chunk-MSGKIWYX.js → chunk-VZNBTCGA.js} +3 -3
  81. package/dist/{chunk-MSGKIWYX.js.map → chunk-VZNBTCGA.js.map} +1 -1
  82. package/dist/{chunk-M6MGQI6G.cjs → chunk-WKPBCB67.cjs} +4 -4
  83. package/dist/{chunk-M6MGQI6G.cjs.map → chunk-WKPBCB67.cjs.map} +1 -1
  84. package/dist/{chunk-QMCMRQ2G.cjs → chunk-WVSHAJKI.cjs} +7 -7
  85. package/dist/{chunk-QMCMRQ2G.cjs.map → chunk-WVSHAJKI.cjs.map} +1 -1
  86. package/dist/chunk-YX6FTJ6N.js +62 -0
  87. package/dist/chunk-YX6FTJ6N.js.map +1 -0
  88. package/dist/{chunk-HRYM76ZE.cjs → chunk-Z6LYBL5L.cjs} +9 -9
  89. package/dist/{chunk-HRYM76ZE.cjs.map → chunk-Z6LYBL5L.cjs.map} +1 -1
  90. package/dist/{chunk-3DMVK74Q.cjs → chunk-Z7SQMQTF.cjs} +4 -4
  91. package/dist/{chunk-3DMVK74Q.cjs.map → chunk-Z7SQMQTF.cjs.map} +1 -1
  92. package/dist/{chunk-NE3BZV3F.js → chunk-ZQ3VXRUY.js} +86 -24
  93. package/dist/chunk-ZQ3VXRUY.js.map +1 -0
  94. package/dist/command.cjs +4 -4
  95. package/dist/command.js +2 -2
  96. package/dist/composer.cjs +6 -6
  97. package/dist/composer.js +4 -4
  98. package/dist/context-menu.cjs +4 -4
  99. package/dist/context-menu.js +2 -2
  100. package/dist/drawer.cjs +4 -4
  101. package/dist/drawer.js +2 -2
  102. package/dist/dropdown.cjs +4 -4
  103. package/dist/dropdown.js +2 -2
  104. package/dist/editor.cjs +6 -6
  105. package/dist/editor.d.cts +1 -1
  106. package/dist/editor.d.ts +1 -1
  107. package/dist/editor.js +4 -4
  108. package/dist/full-screen.cjs +10 -9
  109. package/dist/full-screen.d.cts +5 -2
  110. package/dist/full-screen.d.ts +5 -2
  111. package/dist/full-screen.js +4 -3
  112. package/dist/index.cjs +81 -73
  113. package/dist/index.d.cts +2 -4
  114. package/dist/index.d.ts +2 -4
  115. package/dist/index.js +22 -22
  116. package/dist/input.cjs +5 -5
  117. package/dist/input.js +4 -4
  118. package/dist/inputs.cjs +7 -7
  119. package/dist/inputs.js +5 -5
  120. package/dist/json-editor.cjs +17 -17
  121. package/dist/json-editor.js +6 -6
  122. package/dist/mobile-menu.cjs +5 -5
  123. package/dist/mobile-menu.js +3 -3
  124. package/dist/modal.cjs +4 -4
  125. package/dist/modal.js +2 -2
  126. package/dist/paste-pills.cjs +16 -16
  127. package/dist/paste-pills.js +3 -3
  128. package/dist/popover.cjs +4 -4
  129. package/dist/popover.js +2 -2
  130. package/dist/prompt-input.cjs +6 -6
  131. package/dist/prompt-input.js +5 -5
  132. package/dist/reason-tag.cjs +4 -4
  133. package/dist/reason-tag.js +3 -3
  134. package/dist/select.cjs +3 -3
  135. package/dist/select.js +2 -2
  136. package/dist/sidebar.cjs +2 -2
  137. package/dist/sidebar.js +2 -2
  138. package/dist/styles.css +9 -0
  139. package/dist/styles.css.map +1 -1
  140. package/dist/tooltip.cjs +3 -2
  141. package/dist/tooltip.js +2 -1
  142. package/dist/{use-full-screen-H2j6qXDB.d.ts → use-full-screen-BUke36LI.d.cts} +36 -1
  143. package/dist/{use-full-screen-H2j6qXDB.d.cts → use-full-screen-BUke36LI.d.ts} +36 -1
  144. package/docs/FullScreen.md +15 -4
  145. package/docs/hooks.md +9 -3
  146. package/package.json +1 -1
  147. package/dist/chunk-4FJWHVC7.js.map +0 -1
  148. package/dist/chunk-4JLFIPHZ.js.map +0 -1
  149. package/dist/chunk-JXE5XID6.js +0 -19
  150. package/dist/chunk-JXE5XID6.js.map +0 -1
  151. package/dist/chunk-NE3BZV3F.js.map +0 -1
  152. package/dist/chunk-O4HZVZMY.cjs.map +0 -1
  153. package/dist/chunk-QXMQVLRQ.cjs.map +0 -1
  154. package/dist/chunk-RXDRYWVD.cjs +0 -21
  155. package/dist/chunk-RXDRYWVD.cjs.map +0 -1
  156. package/dist/chunk-ZPBCZPMD.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/styles.css"],"sourcesContent":["/* @particle-academy/react-fancy — base styles + animations */\n\n/* ─── Brand colour scheme ────────────────────────────────────────────────────\n Three token families every Fancy package can rely on, so a component never\n has to invent a palette or hardcode a literal:\n\n brand one accent — the thing a consumer rebrands first\n primary-* the accent as a full 50→950 scale\n secondary-* the NEUTRAL scale for surfaces, borders and body text\n\n Why this exists: packages were already writing `bg-brand`, `text-primary-600`\n and `border-secondary-200` against tokens nothing defined. Tailwind generated\n no such utility, the class silently resolved to nothing, and the component\n rendered unstyled — correct markup, no colour, no error. Defining them here\n turns those classes into a contract instead of a hope.\n\n SECONDARY INVERTS WITH THE THEME. `text-secondary-900` means \"strongest\n foreground\", not \"nearly black\" — so it stays readable on a dark surface.\n That distinction is the whole point: mixing a literal background (`bg-white`)\n with a semantic foreground (`text-secondary-900`) is what produced\n white-on-white in a dark host.\n\n OVERRIDE IT. Redefine any of these in your own `@theme` (or on `:root`) and\n yours wins — nothing here is `!important`, and the utilities read the variable\n rather than baking a value in:\n\n @theme { --color-brand: var(--color-emerald-600); }\n ──────────────────────────────────────────────────────────────────────────── */\n@theme {\n /* THE HOST'S OWN COLOUR. `color=\"brand\"` on any component resolves to these.\n Three variables, not one: a generated hover assumes \"same hue, darker\",\n and a brand palette need not work that way — a navy whose hover is gold\n cannot be derived from navy. So the host states the hover instead of the\n kit guessing it.\n\n :root {\n --color-brand: #003057;\n --color-brand-contrast: #ffffff; text/icon ON the brand colour\n --color-brand-hover: #D4A017; need not be a shade of brand\n }\n\n PER MODE, SWAP THE PAIR. `--color-brand` and `--color-brand-contrast` only\n mean anything together. Repointing one alone fails QUIETLY -- the button\n still renders, it is just unreadable (a pale surface still carrying white\n text; or, on ghost/outline where brand is the LABEL, dark text on a dark\n background):\n\n .dark { --color-brand: #BFD7EA; --color-brand-contrast: #003057; }\n\n `--color-brand-hover` usually needs no per-mode value: an accent chosen to\n stand against the brand tends to stand against it in both modes.\n\n NOTE: this comment does not survive the build -- `@theme` is emitted\n without it. The consumer-facing copy is in README.md, and that is the one\n to keep correct.\n\n Defaults keep the kit's violet so nothing changes for a host that never\n sets them. Soft/outline/ghost variants derive their tints with opacity\n modifiers (`bg-brand/10`), which is what lets three variables cover four\n variants without asking for a whole scale. */\n --color-brand: var(--color-violet-600);\n --color-brand-contrast: var(--color-white);\n --color-brand-hover: var(--color-violet-700);\n\n --color-primary-50: var(--color-violet-50);\n --color-primary-100: var(--color-violet-100);\n --color-primary-200: var(--color-violet-200);\n --color-primary-300: var(--color-violet-300);\n --color-primary-400: var(--color-violet-400);\n --color-primary-500: var(--color-violet-500);\n --color-primary-600: var(--color-violet-600);\n --color-primary-700: var(--color-violet-700);\n --color-primary-800: var(--color-violet-800);\n --color-primary-900: var(--color-violet-900);\n --color-primary-950: var(--color-violet-950);\n\n /* Light-theme defaults: 50 = faintest surface, 900/950 = strongest text. */\n --color-secondary-50: var(--color-zinc-50);\n --color-secondary-100: var(--color-zinc-100);\n --color-secondary-200: var(--color-zinc-200);\n --color-secondary-300: var(--color-zinc-300);\n --color-secondary-400: var(--color-zinc-400);\n --color-secondary-500: var(--color-zinc-500);\n --color-secondary-600: var(--color-zinc-600);\n --color-secondary-700: var(--color-zinc-700);\n --color-secondary-800: var(--color-zinc-800);\n --color-secondary-900: var(--color-zinc-900);\n --color-secondary-950: var(--color-zinc-950);\n}\n\n@layer base {\n\n/* ─── Progress (circular) — named diameters ──────────────────────────────────\n These ship as real CSS rather than Tailwind classes on the element, because a\n consumer who has not @sourced this package gets no generated utilities and\n the ring would render with NO SIZE at all. They were inline styles before,\n which always worked but could not be overridden by className (issue #17).\n\n Being inside @layer base, a className utility now beats them — which is the\n whole point, and the reason #20 had to land first. */\n[data-react-fancy-progress][data-size=\"sm\"] { width: 2rem; height: 2rem; }\n[data-react-fancy-progress][data-size=\"md\"] { width: 3rem; height: 3rem; }\n[data-react-fancy-progress][data-size=\"lg\"] { width: 4rem; height: 4rem; }\n\n\n\n/* Dark: the neutral scale flips, so \"900\" still means strongest foreground and\n \"50\" still means faintest surface. Wrapped in :where() for zero specificity,\n matching the rest of this file — any consumer override beats it.\n\n EVERY dark selector in this file names `[data-theme=\"dark\"]` beside `.dark`\n (5.53.0). A consumer's `@custom-variant dark` cannot reach these: it rewrites\n `dark:` utilities, never a selector with `.dark` written into it.\n tests/data-theme.test.ts fails on any `.dark` selector without its twin. */\n:where(.dark, [data-theme=\"dark\"]) {\n --color-secondary-50: var(--color-zinc-950);\n --color-secondary-100: var(--color-zinc-900);\n --color-secondary-200: var(--color-zinc-800);\n --color-secondary-300: var(--color-zinc-700);\n --color-secondary-400: var(--color-zinc-600);\n --color-secondary-500: var(--color-zinc-500);\n --color-secondary-600: var(--color-zinc-400);\n --color-secondary-700: var(--color-zinc-300);\n --color-secondary-800: var(--color-zinc-200);\n --color-secondary-900: var(--color-zinc-100);\n --color-secondary-950: var(--color-zinc-50);\n}\n\n/* ─── Input & Field defaults ─────────────────────────────────────────────────\n Better UX out of the box: spacing between stacked fields, smooth transitions,\n and polished dark-mode defaults. All overridable via data-attribute selectors.\n ──────────────────────────────────────────────────────────────────────────── */\n\n/* Field spacing is the CONTAINER's job, not the field's.\n ────────────────────────────────────────────────────────────────────────────\n This used to be:\n\n [data-react-fancy-field] + [data-react-fancy-field] { margin-top: 1rem; }\n\n An adjacent-sibling selector cannot know which way its parent lays children\n out. Stacked vertically it read as spacing; inside a `grid-cols-2` row it\n pushed the right-hand cell 16px down, and `items-start` could not fix it\n because a margin is not alignment. The only escape was wrapping every field\n in a plain <div> so each became an only-child.\n\n Space fields with the container instead — `space-y-4`, or `gap-4` on a flex\n or grid parent. A container knows its own axis; a sibling selector never\n can. See CHANGELOG 5.17.0 for the migration.\n ──────────────────────────────────────────────────────────────────────────── */\n\n/* Smooth transitions on all text inputs, selects, and textareas */\n[data-react-fancy-input] input,\n[data-react-fancy-textarea],\n[data-react-fancy-select],\n[data-react-fancy-date-picker],\n[data-react-fancy-autocomplete] input,\n[data-react-fancy-pillbox],\n[data-react-fancy-otp-input] input,\n[data-react-fancy-time-picker] input,\n[data-react-fancy-color-picker] input {\n transition: border-color 0.15s ease, box-shadow 0.15s ease,\n background-color 0.15s ease;\n}\n\n/* Dark-mode input refinements — slightly darker bg for contrast against page */\n/* ─── Inherent dark-mode defaults ────────────────────────────────────────────\n Every rule below is wrapped in :where() so it carries ZERO specificity, which\n buys two properties at once:\n 1. Inherent — a sensible dark appearance ships out of the box, even when the\n consumer's Tailwind build doesn't generate react-fancy's `dark:` utility\n classes (e.g. they didn't @source the package). This is what lets the\n overlays (Dropdown, Menu, Popover, …) go dark on their own.\n 2. Override-friendly — because specificity is 0, ANY consumer override wins:\n a plain `dark:bg-…` utility, a custom class, or the component's own\n `dark:` class (when it IS generated) all take precedence — no !important,\n no need to target the data-attribute.\n ──────────────────────────────────────────────────────────────────────────── */\n\n/* Every colour below reads a semantic token (`--fancy-<role>-dark`, see\n THEME_TOKENS / README \"Semantic tokens\") with today's value as the fallback,\n so a host that sets nothing sees exactly what it saw before. */\n\n/* Inputs / selects / textareas — darker bg for contrast against the page */\n:where(.dark [data-react-fancy-input] input, [data-theme=\"dark\"] [data-react-fancy-input] input),\n:where(.dark [data-react-fancy-textarea], [data-theme=\"dark\"] [data-react-fancy-textarea]),\n:where(.dark [data-react-fancy-select], [data-theme=\"dark\"] [data-react-fancy-select]),\n:where(.dark [data-react-fancy-date-picker], [data-theme=\"dark\"] [data-react-fancy-date-picker]),\n:where(.dark [data-react-fancy-autocomplete] input, [data-theme=\"dark\"] [data-react-fancy-autocomplete] input),\n:where(.dark [data-react-fancy-pillbox], [data-theme=\"dark\"] [data-react-fancy-pillbox]),\n:where(.dark [data-react-fancy-otp-input] input, [data-theme=\"dark\"] [data-react-fancy-otp-input] input),\n:where(.dark [data-react-fancy-time-picker] input, [data-theme=\"dark\"] [data-react-fancy-time-picker] input) {\n background-color: var(--fancy-input-dark, #1e1e24);\n border-color: var(--fancy-border-strong-dark, #3f3f46);\n}\n\n/* Focus ring — brighter border + subtle glow */\n:where(.dark [data-react-fancy-input] input:focus, [data-theme=\"dark\"] [data-react-fancy-input] input:focus),\n:where(.dark [data-react-fancy-textarea]:focus, [data-theme=\"dark\"] [data-react-fancy-textarea]:focus),\n:where(.dark [data-react-fancy-select]:focus, [data-theme=\"dark\"] [data-react-fancy-select]:focus),\n:where(.dark [data-react-fancy-date-picker]:focus, [data-theme=\"dark\"] [data-react-fancy-date-picker]:focus),\n:where(.dark [data-react-fancy-autocomplete] input:focus, [data-theme=\"dark\"] [data-react-fancy-autocomplete] input:focus),\n:where(.dark [data-react-fancy-otp-input] input:focus, [data-theme=\"dark\"] [data-react-fancy-otp-input] input:focus),\n:where(.dark [data-react-fancy-time-picker] input:focus, [data-theme=\"dark\"] [data-react-fancy-time-picker] input:focus) {\n border-color: var(--fancy-focus-dark, #60a5fa);\n /* = rgba(96, 165, 250, 0.15) when the token is unset */\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--fancy-focus-dark, #60a5fa) 15%, transparent);\n}\n\n/* Field labels — brighter for readability */\n:where(.dark [data-react-fancy-field] > label:first-child, [data-theme=\"dark\"] [data-react-fancy-field] > label:first-child) {\n color: var(--fancy-text-dark, #f4f4f5);\n}\n\n/* Checkbox & radio */\n:where(.dark [data-react-fancy-checkbox] input, [data-theme=\"dark\"] [data-react-fancy-checkbox] input),\n:where(.dark [data-react-fancy-radio-group] input, [data-theme=\"dark\"] [data-react-fancy-radio-group] input) {\n background-color: var(--fancy-input-dark, #1e1e24);\n border-color: var(--fancy-border-strong-dark, #3f3f46);\n}\n\n/* Switch unchecked track */\n:where(.dark [data-react-fancy-switch] button[aria-checked=\"false\"], [data-theme=\"dark\"] [data-react-fancy-switch] button[aria-checked=\"false\"]) {\n background-color: var(--fancy-border-dark, #3f3f46);\n}\n\n/* Input wrapper affixes */\n:where(.dark [data-react-fancy-input-wrapper] > span:first-child, [data-theme=\"dark\"] [data-react-fancy-input-wrapper] > span:first-child),\n:where(.dark [data-react-fancy-input-wrapper] > span:last-child, [data-theme=\"dark\"] [data-react-fancy-input-wrapper] > span:last-child) {\n border-color: var(--fancy-border-strong-dark, #3f3f46);\n background-color: var(--fancy-surface-muted-dark, #27272a);\n}\n\n/* Date picker icon (calendar, clock) */\n:where(.dark [data-react-fancy-date-picker]::-webkit-calendar-picker-indicator, [data-theme=\"dark\"] [data-react-fancy-date-picker]::-webkit-calendar-picker-indicator) {\n filter: invert(0.8);\n}\n\n/* ─── Overlays — inherent dark surfaces ──────────────────────────────────────\n Dropdown / Menu / Popover / ContextMenu / MobileMenu flyout / Modal / Toast.\n Mirrors the components' own `dark:` utilities (zinc-900 surface, zinc-700\n border, zinc-300 text) so overlays render correctly in dark mode WITHOUT the\n consumer @sourcing react-fancy. When those utilities ARE generated they win\n (specificity 0 here), so there's no drift or double-styling. */\n:where(.dark [data-react-fancy-dropdown], [data-theme=\"dark\"] [data-react-fancy-dropdown]),\n:where(.dark [data-react-fancy-menu], [data-theme=\"dark\"] [data-react-fancy-menu]),\n:where(.dark [data-react-fancy-popover], [data-theme=\"dark\"] [data-react-fancy-popover]),\n:where(.dark [data-react-fancy-context-menu], [data-theme=\"dark\"] [data-react-fancy-context-menu]),\n:where(.dark [data-react-fancy-context-menu-sub-content], [data-theme=\"dark\"] [data-react-fancy-context-menu-sub-content]),\n:where(.dark [data-react-fancy-mobile-menu-flyout], [data-theme=\"dark\"] [data-react-fancy-mobile-menu-flyout]),\n:where(.dark [data-react-fancy-modal], [data-theme=\"dark\"] [data-react-fancy-modal]),\n:where(.dark [data-react-fancy-toast-item], [data-theme=\"dark\"] [data-react-fancy-toast-item]) {\n background-color: var(--fancy-surface-dark, #18181b); /* zinc-900 */\n border-color: var(--fancy-border-dark, #3f3f46); /* zinc-700 */\n color: var(--fancy-text-soft-dark, #d4d4d8); /* zinc-300 */\n}\n\n/* Overlay item hover states */\n:where(.dark [data-react-fancy-dropdown-item]:hover, [data-theme=\"dark\"] [data-react-fancy-dropdown-item]:hover),\n:where(.dark [data-react-fancy-menu-item]:hover, [data-theme=\"dark\"] [data-react-fancy-menu-item]:hover),\n:where(.dark [data-react-fancy-context-menu-item]:hover, [data-theme=\"dark\"] [data-react-fancy-context-menu-item]:hover) {\n background-color: var(--fancy-surface-muted-dark, #27272a); /* zinc-800 */\n}\n\n/* Overlay separators */\n:where(.dark [data-react-fancy-dropdown-separator], [data-theme=\"dark\"] [data-react-fancy-dropdown-separator]),\n:where(.dark [data-react-fancy-context-menu-separator], [data-theme=\"dark\"] [data-react-fancy-context-menu-separator]) {\n background-color: var(--fancy-border-dark, #3f3f46); /* zinc-700 */\n}\n\n/* ─── Media viewer — transparency checkerboard ───────────────────────────────\n Backdrop for <ImageViewer> / <MediaViewer> so transparent images read clearly.\n Light + dark variants; the dark rule is wrapped in :where() (zero specificity)\n so it ships out of the box without the consumer @sourcing react-fancy. */\n.fancy-checkerboard {\n background-color: #ffffff;\n background-image:\n linear-gradient(45deg, #e5e7eb 25%, transparent 25%),\n linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, #e5e7eb 75%),\n linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);\n background-size: 16px 16px;\n background-position: 0 0, 0 8px, 8px -8px, -8px 0;\n}\n\n:where(.dark, [data-theme=\"dark\"]) .fancy-checkerboard {\n background-color: #18181b; /* zinc-900 */\n background-image:\n linear-gradient(45deg, #27272a 25%, transparent 25%),\n linear-gradient(-45deg, #27272a 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, #27272a 75%),\n linear-gradient(-45deg, transparent 75%, #27272a 75%);\n}\n}\n\n\n@keyframes fancy-fade-in {\n from {\n opacity: 0;\n transform: translateY(4px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n\n@keyframes fancy-slide-left {\n from {\n transform: translateX(100%);\n }\n to {\n transform: translateX(0);\n }\n}\n\n@keyframes fancy-slide-right {\n from {\n transform: translateX(-100%);\n }\n to {\n transform: translateX(0);\n }\n}\n\n@layer base {\n\n\n.fancy-fade-in {\n animation: fancy-fade-in 0.2s ease-out;\n}\n\n.fancy-slide-left {\n animation: fancy-slide-left 0.3s ease-out;\n}\n\n.fancy-slide-right {\n animation: fancy-slide-right 0.3s ease-out;\n}\n}\n\n\n/* Overlay / floating animations */\n\n@keyframes fancy-scale-in {\n from {\n opacity: 0;\n transform: scale(0.95);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n}\n\n@keyframes fancy-slide-up {\n from {\n opacity: 0;\n transform: translateY(16px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n\n@keyframes fancy-fade-out {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n}\n\n@keyframes fancy-toast-in {\n from {\n opacity: 0;\n transform: translateX(100%);\n }\n to {\n opacity: 1;\n transform: translateX(0);\n }\n}\n\n@keyframes fancy-collapse-open {\n from {\n grid-template-rows: 0fr;\n }\n to {\n grid-template-rows: 1fr;\n }\n}\n\n@keyframes fancy-collapse-close {\n from {\n grid-template-rows: 1fr;\n }\n to {\n grid-template-rows: 0fr;\n }\n}\n\n@layer base {\n\n\n.fancy-scale-in {\n animation: fancy-scale-in 0.15s ease-out;\n}\n\n.fancy-slide-up {\n animation: fancy-slide-up 0.2s ease-out;\n}\n\n.fancy-fade-out {\n animation: fancy-fade-out 0.15s ease-in forwards;\n}\n\n.fancy-toast-in {\n animation: fancy-toast-in 0.3s ease-out;\n}\n\n.fancy-collapse-open {\n animation: fancy-collapse-open 0.2s ease-out forwards;\n}\n\n.fancy-collapse-close {\n animation: fancy-collapse-close 0.15s ease-in forwards;\n}\n}\n\n\n/* Mobile flyout slide animations */\n\n@keyframes fancy-slide-in-left {\n from {\n transform: translateX(-100%);\n }\n to {\n transform: translateX(0);\n }\n}\n\n@keyframes fancy-slide-out-left {\n from {\n transform: translateX(0);\n }\n to {\n transform: translateX(-100%);\n }\n}\n\n@keyframes fancy-slide-in-right {\n from {\n transform: translateX(100%);\n }\n to {\n transform: translateX(0);\n }\n}\n\n/* Avatar glow — a looping halo ring (box-shadow only, no reflow). Color comes\n from the --fancy-glow custom property set on the element. */\n@keyframes fancy-avatar-glow {\n 0% {\n box-shadow: 0 0 0 0 color-mix(in srgb, var(--fancy-glow, #a855f7) 55%, transparent);\n opacity: 0.9;\n }\n 70% {\n box-shadow: 0 0 0 6px color-mix(in srgb, var(--fancy-glow, #a855f7) 0%, transparent);\n opacity: 0.5;\n }\n 100% {\n box-shadow: 0 0 0 0 color-mix(in srgb, var(--fancy-glow, #a855f7) 0%, transparent);\n opacity: 0.9;\n }\n}\n\n@layer base {\n\n\n.fancy-avatar-glow {\n position: absolute;\n inset: 0;\n border-radius: 9999px;\n pointer-events: none;\n box-shadow:\n 0 0 0 2px color-mix(in srgb, var(--fancy-glow, #a855f7) 70%, transparent),\n 0 0 10px 0 color-mix(in srgb, var(--fancy-glow, #a855f7) 45%, transparent);\n animation: fancy-avatar-glow 1.6s ease-out infinite;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .fancy-avatar-glow {\n animation: none;\n }\n}\n}\n\n\n@keyframes fancy-slide-out-right {\n from {\n transform: translateX(0);\n }\n to {\n transform: translateX(100%);\n }\n}\n\n@layer base {\n\n\n.fancy-slide-in-left {\n animation: fancy-slide-in-left 0.25s ease-out;\n}\n\n.fancy-slide-out-left {\n animation: fancy-slide-out-left 0.2s ease-in forwards;\n}\n\n.fancy-slide-in-right {\n animation: fancy-slide-in-right 0.25s ease-out;\n}\n\n.fancy-slide-out-right {\n animation: fancy-slide-out-right 0.2s ease-in forwards;\n}\n}\n\n\n/* Vertical drawer edges. The horizontal pair above predates Drawer (it was\n built for MobileMenu.Flyout, which only ever opened left/right); these\n complete the set so `side=\"top\"`/`side=\"bottom\"` animate rather than pop. */\n\n@keyframes fancy-slide-in-top {\n from {\n transform: translateY(-100%);\n }\n to {\n transform: translateY(0);\n }\n}\n\n@keyframes fancy-slide-out-top {\n from {\n transform: translateY(0);\n }\n to {\n transform: translateY(-100%);\n }\n}\n\n@keyframes fancy-slide-in-bottom {\n from {\n transform: translateY(100%);\n }\n to {\n transform: translateY(0);\n }\n}\n\n@keyframes fancy-slide-out-bottom {\n from {\n transform: translateY(0);\n }\n to {\n transform: translateY(100%);\n }\n}\n\n@layer base {\n\n\n.fancy-slide-in-top {\n animation: fancy-slide-in-top 0.25s ease-out;\n}\n\n.fancy-slide-out-top {\n animation: fancy-slide-out-top 0.2s ease-in forwards;\n}\n\n.fancy-slide-in-bottom {\n animation: fancy-slide-in-bottom 0.25s ease-out;\n}\n\n.fancy-slide-out-bottom {\n animation: fancy-slide-out-bottom 0.2s ease-in forwards;\n}\n\n/* Reduced motion collapses the travel to a ~0 duration. Since 5.51.0\n `useAnimation` also unmounts when no animation runs at all, so this is no\n longer what keeps a closed drawer from staying in the DOM — but a ~0 duration\n keeps the exit on the same path as every other close. */\n@media (prefers-reduced-motion: reduce) {\n .fancy-slide-in-left,\n .fancy-slide-out-left,\n .fancy-slide-in-right,\n .fancy-slide-out-right,\n .fancy-slide-in-top,\n .fancy-slide-out-top,\n .fancy-slide-in-bottom,\n .fancy-slide-out-bottom {\n animation-duration: 0.01ms;\n }\n}\n\n/* ─── Marquee ────────────────────────────────────────────────────────────────\n Edge-to-edge auto-scrolling strip. The track holds two identical copies of\n the content; translateX(-50%) over one loop shifts exactly one copy, so the\n wrap is seamless. Duration/gap/fade arrive as custom properties set by the\n component. No animation under prefers-reduced-motion.\n ──────────────────────────────────────────────────────────────────────────── */\n\n[data-react-fancy-marquee] {\n overflow: hidden;\n width: 100%;\n}\n\n.fancy-marquee--fade {\n -webkit-mask-image: linear-gradient(\n to right,\n transparent,\n black var(--fancy-marquee-fade, 48px),\n black calc(100% - var(--fancy-marquee-fade, 48px)),\n transparent\n );\n mask-image: linear-gradient(\n to right,\n transparent,\n black var(--fancy-marquee-fade, 48px),\n black calc(100% - var(--fancy-marquee-fade, 48px)),\n transparent\n );\n}\n\n.fancy-marquee__track {\n display: flex;\n width: max-content;\n animation: fancy-marquee var(--fancy-marquee-duration, 40s) linear infinite;\n will-change: transform;\n}\n\n[data-react-fancy-marquee][data-direction=\"right\"] .fancy-marquee__track {\n animation-direction: reverse;\n}\n\n.fancy-marquee--pause-hover:hover .fancy-marquee__track,\n[data-react-fancy-marquee][data-paused] .fancy-marquee__track {\n animation-play-state: paused;\n}\n\n.fancy-marquee__group {\n display: flex;\n flex: none;\n}\n\n.fancy-marquee__unit {\n display: flex;\n flex: none;\n align-items: center;\n gap: var(--fancy-marquee-gap, 40px);\n padding-inline-end: var(--fancy-marquee-gap, 40px);\n white-space: nowrap;\n}\n\n.fancy-marquee__item,\n.fancy-marquee__separator {\n flex: none;\n}\n}\n\n\n@keyframes fancy-marquee {\n from {\n trans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C,0BAAsB;AACxB;AAEA,GAAC;AACC,aAAS;AACT,UAAM;AACR;AAEA,GAAC;AACC,aAAS;AACT,UAAM;AACN,iBAAa;AACb,SAAK,IAAI,mBAAmB,EAAE;AAC9B,wBAAoB,IAAI,mBAAmB,EAAE;AAC7C,iBAAa;AACf;AAEA,GAAC;AAAA,EACD,CAAC;AACC,UAAM;AACR;AACA;AAGA,WAlCa;AAmCX;AACE,eAAW,WAAW;AACxB;AACA;AACE,eAAW,WAAW;AACxB;AACF;AAEA;AAGA,UAAO,wBAAyB;AAC9B,KAlDD;AAmDG,iBAAW;AACb;AACF;AACA;","names":[]}
1
+ {"version":3,"sources":["../src/styles.css"],"sourcesContent":["/* @particle-academy/react-fancy — base styles + animations */\n\n/* ─── Brand colour scheme ────────────────────────────────────────────────────\n Three token families every Fancy package can rely on, so a component never\n has to invent a palette or hardcode a literal:\n\n brand one accent — the thing a consumer rebrands first\n primary-* the accent as a full 50→950 scale\n secondary-* the NEUTRAL scale for surfaces, borders and body text\n\n Why this exists: packages were already writing `bg-brand`, `text-primary-600`\n and `border-secondary-200` against tokens nothing defined. Tailwind generated\n no such utility, the class silently resolved to nothing, and the component\n rendered unstyled — correct markup, no colour, no error. Defining them here\n turns those classes into a contract instead of a hope.\n\n SECONDARY INVERTS WITH THE THEME. `text-secondary-900` means \"strongest\n foreground\", not \"nearly black\" — so it stays readable on a dark surface.\n That distinction is the whole point: mixing a literal background (`bg-white`)\n with a semantic foreground (`text-secondary-900`) is what produced\n white-on-white in a dark host.\n\n OVERRIDE IT. Redefine any of these in your own `@theme` (or on `:root`) and\n yours wins — nothing here is `!important`, and the utilities read the variable\n rather than baking a value in:\n\n @theme { --color-brand: var(--color-emerald-600); }\n ──────────────────────────────────────────────────────────────────────────── */\n@theme {\n /* THE HOST'S OWN COLOUR. `color=\"brand\"` on any component resolves to these.\n Three variables, not one: a generated hover assumes \"same hue, darker\",\n and a brand palette need not work that way — a navy whose hover is gold\n cannot be derived from navy. So the host states the hover instead of the\n kit guessing it.\n\n :root {\n --color-brand: #003057;\n --color-brand-contrast: #ffffff; text/icon ON the brand colour\n --color-brand-hover: #D4A017; need not be a shade of brand\n }\n\n PER MODE, SWAP THE PAIR. `--color-brand` and `--color-brand-contrast` only\n mean anything together. Repointing one alone fails QUIETLY -- the button\n still renders, it is just unreadable (a pale surface still carrying white\n text; or, on ghost/outline where brand is the LABEL, dark text on a dark\n background):\n\n .dark { --color-brand: #BFD7EA; --color-brand-contrast: #003057; }\n\n `--color-brand-hover` usually needs no per-mode value: an accent chosen to\n stand against the brand tends to stand against it in both modes.\n\n NOTE: this comment does not survive the build -- `@theme` is emitted\n without it. The consumer-facing copy is in README.md, and that is the one\n to keep correct.\n\n Defaults keep the kit's violet so nothing changes for a host that never\n sets them. Soft/outline/ghost variants derive their tints with opacity\n modifiers (`bg-brand/10`), which is what lets three variables cover four\n variants without asking for a whole scale. */\n --color-brand: var(--color-violet-600);\n --color-brand-contrast: var(--color-white);\n --color-brand-hover: var(--color-violet-700);\n\n --color-primary-50: var(--color-violet-50);\n --color-primary-100: var(--color-violet-100);\n --color-primary-200: var(--color-violet-200);\n --color-primary-300: var(--color-violet-300);\n --color-primary-400: var(--color-violet-400);\n --color-primary-500: var(--color-violet-500);\n --color-primary-600: var(--color-violet-600);\n --color-primary-700: var(--color-violet-700);\n --color-primary-800: var(--color-violet-800);\n --color-primary-900: var(--color-violet-900);\n --color-primary-950: var(--color-violet-950);\n\n /* Light-theme defaults: 50 = faintest surface, 900/950 = strongest text. */\n --color-secondary-50: var(--color-zinc-50);\n --color-secondary-100: var(--color-zinc-100);\n --color-secondary-200: var(--color-zinc-200);\n --color-secondary-300: var(--color-zinc-300);\n --color-secondary-400: var(--color-zinc-400);\n --color-secondary-500: var(--color-zinc-500);\n --color-secondary-600: var(--color-zinc-600);\n --color-secondary-700: var(--color-zinc-700);\n --color-secondary-800: var(--color-zinc-800);\n --color-secondary-900: var(--color-zinc-900);\n --color-secondary-950: var(--color-zinc-950);\n}\n\n/* ─── Full screen in the top layer — neutralise the UA popover box ───────────\n An overlay-mode FullScreen is promoted with popover=\"manual\" so ancestor\n transforms / filters cannot trap it, and the UA sheet then styles it as a\n popover: padding .25em, a solid border, Canvas / CanvasText colours,\n overflow:auto. Any author rule outranks the UA origin, so this zero-\n specificity rule in the base layer puts those back to what a plain box has,\n while every utility a consumer passes through className still wins. Inline\n styles could not do that: they would beat the consumer's own classes. The\n box geometry (inset, width, height, margin) is set inline by the hook. */\n@layer base {\n :where([data-fullscreen-layer=\"top\"]) {\n padding: 0;\n border: 0 solid;\n background-color: transparent;\n color: inherit;\n overflow: visible;\n }\n}\n\n@layer base {\n\n/* ─── Progress (circular) — named diameters ──────────────────────────────────\n These ship as real CSS rather than Tailwind classes on the element, because a\n consumer who has not @sourced this package gets no generated utilities and\n the ring would render with NO SIZE at all. They were inline styles before,\n which always worked but could not be overridden by className (issue #17).\n\n Being inside @layer base, a className utility now beats them — which is the\n whole point, and the reason #20 had to land first. */\n[data-react-fancy-progress][data-size=\"sm\"] { width: 2rem; height: 2rem; }\n[data-react-fancy-progress][data-size=\"md\"] { width: 3rem; height: 3rem; }\n[data-react-fancy-progress][data-size=\"lg\"] { width: 4rem; height: 4rem; }\n\n\n\n/* Dark: the neutral scale flips, so \"900\" still means strongest foreground and\n \"50\" still means faintest surface. Wrapped in :where() for zero specificity,\n matching the rest of this file — any consumer override beats it.\n\n EVERY dark selector in this file names `[data-theme=\"dark\"]` beside `.dark`\n (5.53.0). A consumer's `@custom-variant dark` cannot reach these: it rewrites\n `dark:` utilities, never a selector with `.dark` written into it.\n tests/data-theme.test.ts fails on any `.dark` selector without its twin. */\n:where(.dark, [data-theme=\"dark\"]) {\n --color-secondary-50: var(--color-zinc-950);\n --color-secondary-100: var(--color-zinc-900);\n --color-secondary-200: var(--color-zinc-800);\n --color-secondary-300: var(--color-zinc-700);\n --color-secondary-400: var(--color-zinc-600);\n --color-secondary-500: var(--color-zinc-500);\n --color-secondary-600: var(--color-zinc-400);\n --color-secondary-700: var(--color-zinc-300);\n --color-secondary-800: var(--color-zinc-200);\n --color-secondary-900: var(--color-zinc-100);\n --color-secondary-950: var(--color-zinc-50);\n}\n\n/* ─── Input & Field defaults ─────────────────────────────────────────────────\n Better UX out of the box: spacing between stacked fields, smooth transitions,\n and polished dark-mode defaults. All overridable via data-attribute selectors.\n ──────────────────────────────────────────────────────────────────────────── */\n\n/* Field spacing is the CONTAINER's job, not the field's.\n ────────────────────────────────────────────────────────────────────────────\n This used to be:\n\n [data-react-fancy-field] + [data-react-fancy-field] { margin-top: 1rem; }\n\n An adjacent-sibling selector cannot know which way its parent lays children\n out. Stacked vertically it read as spacing; inside a `grid-cols-2` row it\n pushed the right-hand cell 16px down, and `items-start` could not fix it\n because a margin is not alignment. The only escape was wrapping every field\n in a plain <div> so each became an only-child.\n\n Space fields with the container instead — `space-y-4`, or `gap-4` on a flex\n or grid parent. A container knows its own axis; a sibling selector never\n can. See CHANGELOG 5.17.0 for the migration.\n ──────────────────────────────────────────────────────────────────────────── */\n\n/* Smooth transitions on all text inputs, selects, and textareas */\n[data-react-fancy-input] input,\n[data-react-fancy-textarea],\n[data-react-fancy-select],\n[data-react-fancy-date-picker],\n[data-react-fancy-autocomplete] input,\n[data-react-fancy-pillbox],\n[data-react-fancy-otp-input] input,\n[data-react-fancy-time-picker] input,\n[data-react-fancy-color-picker] input {\n transition: border-color 0.15s ease, box-shadow 0.15s ease,\n background-color 0.15s ease;\n}\n\n/* Dark-mode input refinements — slightly darker bg for contrast against page */\n/* ─── Inherent dark-mode defaults ────────────────────────────────────────────\n Every rule below is wrapped in :where() so it carries ZERO specificity, which\n buys two properties at once:\n 1. Inherent — a sensible dark appearance ships out of the box, even when the\n consumer's Tailwind build doesn't generate react-fancy's `dark:` utility\n classes (e.g. they didn't @source the package). This is what lets the\n overlays (Dropdown, Menu, Popover, …) go dark on their own.\n 2. Override-friendly — because specificity is 0, ANY consumer override wins:\n a plain `dark:bg-…` utility, a custom class, or the component's own\n `dark:` class (when it IS generated) all take precedence — no !important,\n no need to target the data-attribute.\n ──────────────────────────────────────────────────────────────────────────── */\n\n/* Every colour below reads a semantic token (`--fancy-<role>-dark`, see\n THEME_TOKENS / README \"Semantic tokens\") with today's value as the fallback,\n so a host that sets nothing sees exactly what it saw before. */\n\n/* Inputs / selects / textareas — darker bg for contrast against the page */\n:where(.dark [data-react-fancy-input] input, [data-theme=\"dark\"] [data-react-fancy-input] input),\n:where(.dark [data-react-fancy-textarea], [data-theme=\"dark\"] [data-react-fancy-textarea]),\n:where(.dark [data-react-fancy-select], [data-theme=\"dark\"] [data-react-fancy-select]),\n:where(.dark [data-react-fancy-date-picker], [data-theme=\"dark\"] [data-react-fancy-date-picker]),\n:where(.dark [data-react-fancy-autocomplete] input, [data-theme=\"dark\"] [data-react-fancy-autocomplete] input),\n:where(.dark [data-react-fancy-pillbox], [data-theme=\"dark\"] [data-react-fancy-pillbox]),\n:where(.dark [data-react-fancy-otp-input] input, [data-theme=\"dark\"] [data-react-fancy-otp-input] input),\n:where(.dark [data-react-fancy-time-picker] input, [data-theme=\"dark\"] [data-react-fancy-time-picker] input) {\n background-color: var(--fancy-input-dark, #1e1e24);\n border-color: var(--fancy-border-strong-dark, #3f3f46);\n}\n\n/* Focus ring — brighter border + subtle glow */\n:where(.dark [data-react-fancy-input] input:focus, [data-theme=\"dark\"] [data-react-fancy-input] input:focus),\n:where(.dark [data-react-fancy-textarea]:focus, [data-theme=\"dark\"] [data-react-fancy-textarea]:focus),\n:where(.dark [data-react-fancy-select]:focus, [data-theme=\"dark\"] [data-react-fancy-select]:focus),\n:where(.dark [data-react-fancy-date-picker]:focus, [data-theme=\"dark\"] [data-react-fancy-date-picker]:focus),\n:where(.dark [data-react-fancy-autocomplete] input:focus, [data-theme=\"dark\"] [data-react-fancy-autocomplete] input:focus),\n:where(.dark [data-react-fancy-otp-input] input:focus, [data-theme=\"dark\"] [data-react-fancy-otp-input] input:focus),\n:where(.dark [data-react-fancy-time-picker] input:focus, [data-theme=\"dark\"] [data-react-fancy-time-picker] input:focus) {\n border-color: var(--fancy-focus-dark, #60a5fa);\n /* = rgba(96, 165, 250, 0.15) when the token is unset */\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--fancy-focus-dark, #60a5fa) 15%, transparent);\n}\n\n/* Field labels — brighter for readability */\n:where(.dark [data-react-fancy-field] > label:first-child, [data-theme=\"dark\"] [data-react-fancy-field] > label:first-child) {\n color: var(--fancy-text-dark, #f4f4f5);\n}\n\n/* Checkbox & radio */\n:where(.dark [data-react-fancy-checkbox] input, [data-theme=\"dark\"] [data-react-fancy-checkbox] input),\n:where(.dark [data-react-fancy-radio-group] input, [data-theme=\"dark\"] [data-react-fancy-radio-group] input) {\n background-color: var(--fancy-input-dark, #1e1e24);\n border-color: var(--fancy-border-strong-dark, #3f3f46);\n}\n\n/* Switch unchecked track */\n:where(.dark [data-react-fancy-switch] button[aria-checked=\"false\"], [data-theme=\"dark\"] [data-react-fancy-switch] button[aria-checked=\"false\"]) {\n background-color: var(--fancy-border-dark, #3f3f46);\n}\n\n/* Input wrapper affixes */\n:where(.dark [data-react-fancy-input-wrapper] > span:first-child, [data-theme=\"dark\"] [data-react-fancy-input-wrapper] > span:first-child),\n:where(.dark [data-react-fancy-input-wrapper] > span:last-child, [data-theme=\"dark\"] [data-react-fancy-input-wrapper] > span:last-child) {\n border-color: var(--fancy-border-strong-dark, #3f3f46);\n background-color: var(--fancy-surface-muted-dark, #27272a);\n}\n\n/* Date picker icon (calendar, clock) */\n:where(.dark [data-react-fancy-date-picker]::-webkit-calendar-picker-indicator, [data-theme=\"dark\"] [data-react-fancy-date-picker]::-webkit-calendar-picker-indicator) {\n filter: invert(0.8);\n}\n\n/* ─── Overlays — inherent dark surfaces ──────────────────────────────────────\n Dropdown / Menu / Popover / ContextMenu / MobileMenu flyout / Modal / Toast.\n Mirrors the components' own `dark:` utilities (zinc-900 surface, zinc-700\n border, zinc-300 text) so overlays render correctly in dark mode WITHOUT the\n consumer @sourcing react-fancy. When those utilities ARE generated they win\n (specificity 0 here), so there's no drift or double-styling. */\n:where(.dark [data-react-fancy-dropdown], [data-theme=\"dark\"] [data-react-fancy-dropdown]),\n:where(.dark [data-react-fancy-menu], [data-theme=\"dark\"] [data-react-fancy-menu]),\n:where(.dark [data-react-fancy-popover], [data-theme=\"dark\"] [data-react-fancy-popover]),\n:where(.dark [data-react-fancy-context-menu], [data-theme=\"dark\"] [data-react-fancy-context-menu]),\n:where(.dark [data-react-fancy-context-menu-sub-content], [data-theme=\"dark\"] [data-react-fancy-context-menu-sub-content]),\n:where(.dark [data-react-fancy-mobile-menu-flyout], [data-theme=\"dark\"] [data-react-fancy-mobile-menu-flyout]),\n:where(.dark [data-react-fancy-modal], [data-theme=\"dark\"] [data-react-fancy-modal]),\n:where(.dark [data-react-fancy-toast-item], [data-theme=\"dark\"] [data-react-fancy-toast-item]) {\n background-color: var(--fancy-surface-dark, #18181b); /* zinc-900 */\n border-color: var(--fancy-border-dark, #3f3f46); /* zinc-700 */\n color: var(--fancy-text-soft-dark, #d4d4d8); /* zinc-300 */\n}\n\n/* Overlay item hover states */\n:where(.dark [data-react-fancy-dropdown-item]:hover, [data-theme=\"dark\"] [data-react-fancy-dropdown-item]:hover),\n:where(.dark [data-react-fancy-menu-item]:hover, [data-theme=\"dark\"] [data-react-fancy-menu-item]:hover),\n:where(.dark [data-react-fancy-context-menu-item]:hover, [data-theme=\"dark\"] [data-react-fancy-context-menu-item]:hover) {\n background-color: var(--fancy-surface-muted-dark, #27272a); /* zinc-800 */\n}\n\n/* Overlay separators */\n:where(.dark [data-react-fancy-dropdown-separator], [data-theme=\"dark\"] [data-react-fancy-dropdown-separator]),\n:where(.dark [data-react-fancy-context-menu-separator], [data-theme=\"dark\"] [data-react-fancy-context-menu-separator]) {\n background-color: var(--fancy-border-dark, #3f3f46); /* zinc-700 */\n}\n\n/* ─── Media viewer — transparency checkerboard ───────────────────────────────\n Backdrop for <ImageViewer> / <MediaViewer> so transparent images read clearly.\n Light + dark variants; the dark rule is wrapped in :where() (zero specificity)\n so it ships out of the box without the consumer @sourcing react-fancy. */\n.fancy-checkerboard {\n background-color: #ffffff;\n background-image:\n linear-gradient(45deg, #e5e7eb 25%, transparent 25%),\n linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, #e5e7eb 75%),\n linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);\n background-size: 16px 16px;\n background-position: 0 0, 0 8px, 8px -8px, -8px 0;\n}\n\n:where(.dark, [data-theme=\"dark\"]) .fancy-checkerboard {\n background-color: #18181b; /* zinc-900 */\n background-image:\n linear-gradient(45deg, #27272a 25%, transparent 25%),\n linear-gradient(-45deg, #27272a 25%, transparent 25%),\n linear-gradient(45deg, transparent 75%, #27272a 75%),\n linear-gradient(-45deg, transparent 75%, #27272a 75%);\n}\n}\n\n\n@keyframes fancy-fade-in {\n from {\n opacity: 0;\n transform: translateY(4px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n\n@keyframes fancy-slide-left {\n from {\n transform: translateX(100%);\n }\n to {\n transform: translateX(0);\n }\n}\n\n@keyframes fancy-slide-right {\n from {\n transform: translateX(-100%);\n }\n to {\n transform: translateX(0);\n }\n}\n\n@layer base {\n\n\n.fancy-fade-in {\n animation: fancy-fade-in 0.2s ease-out;\n}\n\n.fancy-slide-left {\n animation: fancy-slide-left 0.3s ease-out;\n}\n\n.fancy-slide-right {\n animation: fancy-slide-right 0.3s ease-out;\n}\n}\n\n\n/* Overlay / floating animations */\n\n@keyframes fancy-scale-in {\n from {\n opacity: 0;\n transform: scale(0.95);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n}\n\n@keyframes fancy-slide-up {\n from {\n opacity: 0;\n transform: translateY(16px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n\n@keyframes fancy-fade-out {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n}\n\n@keyframes fancy-toast-in {\n from {\n opacity: 0;\n transform: translateX(100%);\n }\n to {\n opacity: 1;\n transform: translateX(0);\n }\n}\n\n@keyframes fancy-collapse-open {\n from {\n grid-template-rows: 0fr;\n }\n to {\n grid-template-rows: 1fr;\n }\n}\n\n@keyframes fancy-collapse-close {\n from {\n grid-template-rows: 1fr;\n }\n to {\n grid-template-rows: 0fr;\n }\n}\n\n@layer base {\n\n\n.fancy-scale-in {\n animation: fancy-scale-in 0.15s ease-out;\n}\n\n.fancy-slide-up {\n animation: fancy-slide-up 0.2s ease-out;\n}\n\n.fancy-fade-out {\n animation: fancy-fade-out 0.15s ease-in forwards;\n}\n\n.fancy-toast-in {\n animation: fancy-toast-in 0.3s ease-out;\n}\n\n.fancy-collapse-open {\n animation: fancy-collapse-open 0.2s ease-out forwards;\n}\n\n.fancy-collapse-close {\n animation: fancy-collapse-close 0.15s ease-in forwards;\n}\n}\n\n\n/* Mobile flyout slide animations */\n\n@keyframes fancy-slide-in-left {\n from {\n transform: translateX(-100%);\n }\n to {\n transform: translateX(0);\n }\n}\n\n@keyframes fancy-slide-out-left {\n from {\n transform: translateX(0);\n }\n to {\n transform: translateX(-100%);\n }\n}\n\n@keyframes fancy-slide-in-right {\n from {\n transform: translateX(100%);\n }\n to {\n transform: translateX(0);\n }\n}\n\n/* Avatar glow — a looping halo ring (box-shadow only, no reflow). Color comes\n from the --fancy-glow custom property set on the element. */\n@keyframes fancy-avatar-glow {\n 0% {\n box-shadow: 0 0 0 0 color-mix(in srgb, var(--fancy-glow, #a855f7) 55%, transparent);\n opacity: 0.9;\n }\n 70% {\n box-shadow: 0 0 0 6px color-mix(in srgb, var(--fancy-glow, #a855f7) 0%, transparent);\n opacity: 0.5;\n }\n 100% {\n box-shadow: 0 0 0 0 color-mix(in srgb, var(--fancy-glow, #a855f7) 0%, transparent);\n opacity: 0.9;\n }\n}\n\n@layer base {\n\n\n.fancy-avatar-glow {\n position: absolute;\n inset: 0;\n border-radius: 9999px;\n pointer-events: none;\n box-shadow:\n 0 0 0 2px color-mix(in srgb, var(--fancy-glow, #a855f7) 70%, transparent),\n 0 0 10px 0 color-mix(in srgb, var(--fancy-glow, #a855f7) 45%, transparent);\n animation: fancy-avatar-glow 1.6s ease-out infinite;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .fancy-avatar-glow {\n animation: none;\n }\n}\n}\n\n\n@keyframes fancy-slide-out-right {\n from {\n transform: translateX(0);\n }\n to {\n transform: translateX(100%);\n }\n}\n\n@layer base {\n\n\n.fancy-slide-in-left {\n animation: fancy-slide-in-left 0.25s ease-out;\n}\n\n.fancy-slide-out-left {\n animation: fancy-slide-out-left 0.2s ease-in forwards;\n}\n\n.fancy-slide-in-right {\n animation: fancy-slide-in-right 0.25s ease-out;\n}\n\n.fancy-slide-out-right {\n animation: fancy-slide-out-right 0.2s ease-in forwards;\n}\n}\n\n\n/* Vertical drawer edges. The horizontal pair above predates Drawer (it was\n built for MobileMenu.Flyout, which only ever opened left/right); these\n complete the set so `side=\"top\"`/`side=\"bottom\"` animate rather than pop. */\n\n@keyframes fancy-slide-in-top {\n from {\n transform: translateY(-100%);\n }\n to {\n transform: translateY(0);\n }\n}\n\n@keyframes fancy-slide-out-top {\n from {\n transform: translateY(0);\n }\n to {\n transform: translateY(-100%);\n }\n}\n\n@keyframes fancy-slide-in-bottom {\n from {\n transform: translateY(100%);\n }\n to {\n transform: translateY(0);\n }\n}\n\n@keyframes fancy-slide-out-bottom {\n from {\n transform: translateY(0);\n }\n to {\n transform: translateY(100%);\n }\n}\n\n@layer base {\n\n\n.fancy-slide-in-top {\n animation: fancy-slide-in-top 0.25s ease-out;\n}\n\n.fancy-slide-out-top {\n animation: fancy-slide-out-top 0.2s ease-in forwards;\n}\n\n.fancy-slide-in-bottom {\n animation: fancy-slide-in-bottom 0.25s ease-out;\n}\n\n.fancy-slide-out-bottom {\n animation: fancy-slide-out-bottom 0.2s ease-in forwards;\n}\n\n/* Reduced motion collapses the travel to a ~0 duration. Since 5.51.0\n `useAnimation` also unmounts when no animation runs at all, so this is no\n longer what keeps a closed drawer from staying in the DOM — but a ~0 duration\n keeps the exit on the same path as every other close. */\n@media (prefers-reduced-motion: reduce) {\n .fancy-slide-in-left,\n .fancy-slide-out-left,\n .fancy-slide-in-right,\n .fancy-slide-out-right,\n .fancy-slide-in-top,\n .fancy-slide-out-top,\n .fancy-slide-in-bottom,\n .fancy-slide-out-bottom {\n animation-duration: 0.01ms;\n }\n}\n\n/* ─── Marquee ────────────────────────────────────────────────────────────────\n Edge-to-edge auto-scrolling strip. The track holds two identical copies of\n the content; translateX(-50%) over one loop shifts exactly one copy, so the\n wrap is seamless. Duration/gap/fade arrive as custom properties set by the\n component. No animation under prefers-reduced-motion.\n ──────────────────────────────────────────────────────────────────────────── */\n\n[data-react-fancy-marquee] {\n overflow: hidden;\n width: 100%;\n}\n\n.fancy-marquee--fade {\n -webkit-mask-image: linear-gradient(\n to right,\n transparent,\n black var(--fancy-marquee-fade, 48px),\n black calc(100% - var(--fancy-marquee-fade, 48px)),\n transparent\n );\n mask-image: linear-gradient(\n to right,\n transparent,\n black var(--fancy-marquee-fade, 48px),\n black calc(100% - var(--fancy-marquee-fade, 48px)),\n transparent\n );\n}\n\n.fancy-marquee__track {\n display: flex;\n width: max-content;\n animation: fancy-marquee var(--fancy-marquee-duration, 40s) linear infinite;\n will-change: transform;\n}\n\n[data-react-fancy-marquee][data-direction=\"right\"] .fancy-marquee__track {\n animation-direction: reverse;\n}\n\n.fancy-marquee--pause-hover:hover .fancy-marquee__track,\n[data-react-fancy-marquee][data-paused] .fancy-marquee__track {\n animation-play-state: paused;\n}\n\n.fancy-marquee__group {\n display: flex;\n flex: none;\n}\n\n.fancy-marquee__unit {\n display: flex;\n flex: none;\n align-items: center;\n gap: var(--fancy-marquee-gap, 40px);\n padding-inline-end: var(--fancy-marquee-gap, 40px);\n white-space: nowrap;\n}\n\n.fancy-marquee__item,\n.fancy-marquee__separator {\n flex: none;\n}\n}\n\n\n@keyframes fancy-marquee {\n from {\n transform: translateX(0);\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ACvB;AAEA,GAAC,0BAA0B,OAAO,CAXjC;AAAA,EAYD,CAAC,yBAAyB,CAAC,aAAa,CAZvC;AAaC,0BAAsB;AACxB;AAEA,GAAC;AACC,aAAS;AACT,UAAM;AACR;AAEA,GAAC;AACC,aAAS;AACT,UAAM;AACN,iBAAa;AACb,SAAK,IAAI,mBAAmB,EAAE;AAC9B,wBAAoB,IAAI,mBAAmB,EAAE;AAC7C,iBAAa;AACf;AAEA,GAAC;AAAA,EACD,CAAC;AACC,UAAM;AACR;AACA;AAGA,WAlCa;AAmCX;AACE,eAAW,WAAW;AACxB;AACA;AACE,eAAW,WAAW;AACxB;AACF;AAEA;AAGA,UAAO,wBAAyB;AAC9B,KAlDD;AAmDG,iBAAW;AACb;AACF;AACA;","names":[]}
package/dist/tooltip.cjs CHANGED
@@ -1,17 +1,18 @@
1
1
  'use strict';
2
2
 
3
- var chunkQXMQVLRQ_cjs = require('./chunk-QXMQVLRQ.cjs');
3
+ var chunkOASSZI6M_cjs = require('./chunk-OASSZI6M.cjs');
4
4
  require('./chunk-I27K6NLX.cjs');
5
5
  require('./chunk-J2DI6RMR.cjs');
6
6
  require('./chunk-MKHYENKR.cjs');
7
7
  require('./chunk-TI7D4QDM.cjs');
8
+ require('./chunk-OUYC6EIL.cjs');
8
9
  require('./chunk-ZU5Q77OT.cjs');
9
10
 
10
11
 
11
12
 
12
13
  Object.defineProperty(exports, "Tooltip", {
13
14
  enumerable: true,
14
- get: function () { return chunkQXMQVLRQ_cjs.Tooltip; }
15
+ get: function () { return chunkOASSZI6M_cjs.Tooltip; }
15
16
  });
16
17
  //# sourceMappingURL=tooltip.cjs.map
17
18
  //# sourceMappingURL=tooltip.cjs.map
package/dist/tooltip.js CHANGED
@@ -1,8 +1,9 @@
1
- export { Tooltip } from './chunk-4FJWHVC7.js';
1
+ export { Tooltip } from './chunk-GR2WKBER.js';
2
2
  import './chunk-SV5BW3IA.js';
3
3
  import './chunk-MQ6VGG62.js';
4
4
  import './chunk-5VMILVWD.js';
5
5
  import './chunk-RBCMKPBX.js';
6
+ import './chunk-YX6FTJ6N.js';
6
7
  import './chunk-MMW2JGKZ.js';
7
8
  //# sourceMappingURL=tooltip.js.map
8
9
  //# sourceMappingURL=tooltip.js.map
@@ -1,5 +1,25 @@
1
+ import * as react from 'react';
1
2
  import { RefObject, CSSProperties, KeyboardEvent } from 'react';
2
3
 
4
+ /** Identity of a full-screen surface for the layers rendered inside it. */
5
+ type EscapeScope = object;
6
+ /** The surface (if any) that layers rendered here belong to. */
7
+ declare const EscapeLayerContext: react.Context<object | null>;
8
+ /**
9
+ * Register a layer that closes on Escape while `enabled`. Pass `scope` only for
10
+ * a surface that other layers can open inside (a full-screen surface).
11
+ *
12
+ * Returns `isInnermost()`, for a layer that also handles Escape in its own key
13
+ * handler and must not act when a layer above it owns the key.
14
+ *
15
+ * @internal Exported for full-screen surfaces in sibling packages; ordinary
16
+ * layers call `useEscapeKey`.
17
+ */
18
+ declare function useEscapeLayer(handler: () => void, enabled: boolean, scope?: EscapeScope | null): {
19
+ isInnermost: () => boolean;
20
+ };
21
+ declare function useEscapeKey(handler: () => void, enabled?: boolean): void;
22
+
3
23
  /**
4
24
  * How a surface goes full screen.
5
25
  *
@@ -41,6 +61,7 @@ interface FullScreenTargetProps<T extends HTMLElement> {
41
61
  ref: RefObject<T | null>;
42
62
  "data-fullscreen": "true" | "false";
43
63
  "data-fullscreen-mode"?: FullScreenMode;
64
+ "data-fullscreen-layer"?: FullScreenLayer;
44
65
  style?: CSSProperties;
45
66
  onKeyDown: (event: KeyboardEvent<T>) => void;
46
67
  }
@@ -59,6 +80,12 @@ interface UseFullScreenResult<T extends HTMLElement = HTMLElement> {
59
80
  toggle: () => void;
60
81
  /** The mechanism in effect while active; `null` when not full screen. */
61
82
  activeMode: FullScreenMode | null;
83
+ /**
84
+ * `"top"` while the surface is in the browser's top layer (a manual popover,
85
+ * or the native full screen), `"fixed"` while it relies on `position: fixed`
86
+ * (no popover API, or the browser refused). `null` when not full screen.
87
+ */
88
+ layer: FullScreenLayer | null;
62
89
  /** Attach to the element that goes full screen. Also inside `targetProps`. */
63
90
  ref: RefObject<T | null>;
64
91
  /**
@@ -74,7 +101,15 @@ interface UseFullScreenResult<T extends HTMLElement = HTMLElement> {
74
101
  * `PortalContainerContext` so menus opened inside stay visible.
75
102
  */
76
103
  portalContainer: HTMLElement | null;
104
+ /**
105
+ * Identity of this surface for Escape routing. Provide it through
106
+ * `EscapeLayerContext` (FullScreenProvider does) so a menu opened inside
107
+ * gets Escape before the surface does.
108
+ */
109
+ escapeScope: EscapeScope;
77
110
  }
111
+ /** Which mechanism keeps the surface over the page. */
112
+ type FullScreenLayer = "top" | "fixed";
78
113
  /**
79
114
  * A controlled full-screen state for any surface: Editor today, DeckEditor and
80
115
  * SheetWorkbook next. Render-time output is pure (no `window`/`document`), so it
@@ -82,4 +117,4 @@ interface UseFullScreenResult<T extends HTMLElement = HTMLElement> {
82
117
  */
83
118
  declare function useFullScreen<T extends HTMLElement = HTMLElement>(options?: UseFullScreenOptions): UseFullScreenResult<T>;
84
119
 
85
- export { type FullScreenMode as F, type UseFullScreenOptions as U, type FullScreenTargetProps as a, type FullScreenToggleProps as b, type UseFullScreenResult as c, useFullScreen as u };
120
+ export { EscapeLayerContext as E, type FullScreenLayer as F, type UseFullScreenOptions as U, type EscapeScope as a, type FullScreenMode as b, type FullScreenTargetProps as c, type FullScreenToggleProps as d, type UseFullScreenResult as e, useEscapeLayer as f, useFullScreen as g, useEscapeKey as u };
@@ -1,5 +1,25 @@
1
+ import * as react from 'react';
1
2
  import { RefObject, CSSProperties, KeyboardEvent } from 'react';
2
3
 
4
+ /** Identity of a full-screen surface for the layers rendered inside it. */
5
+ type EscapeScope = object;
6
+ /** The surface (if any) that layers rendered here belong to. */
7
+ declare const EscapeLayerContext: react.Context<object | null>;
8
+ /**
9
+ * Register a layer that closes on Escape while `enabled`. Pass `scope` only for
10
+ * a surface that other layers can open inside (a full-screen surface).
11
+ *
12
+ * Returns `isInnermost()`, for a layer that also handles Escape in its own key
13
+ * handler and must not act when a layer above it owns the key.
14
+ *
15
+ * @internal Exported for full-screen surfaces in sibling packages; ordinary
16
+ * layers call `useEscapeKey`.
17
+ */
18
+ declare function useEscapeLayer(handler: () => void, enabled: boolean, scope?: EscapeScope | null): {
19
+ isInnermost: () => boolean;
20
+ };
21
+ declare function useEscapeKey(handler: () => void, enabled?: boolean): void;
22
+
3
23
  /**
4
24
  * How a surface goes full screen.
5
25
  *
@@ -41,6 +61,7 @@ interface FullScreenTargetProps<T extends HTMLElement> {
41
61
  ref: RefObject<T | null>;
42
62
  "data-fullscreen": "true" | "false";
43
63
  "data-fullscreen-mode"?: FullScreenMode;
64
+ "data-fullscreen-layer"?: FullScreenLayer;
44
65
  style?: CSSProperties;
45
66
  onKeyDown: (event: KeyboardEvent<T>) => void;
46
67
  }
@@ -59,6 +80,12 @@ interface UseFullScreenResult<T extends HTMLElement = HTMLElement> {
59
80
  toggle: () => void;
60
81
  /** The mechanism in effect while active; `null` when not full screen. */
61
82
  activeMode: FullScreenMode | null;
83
+ /**
84
+ * `"top"` while the surface is in the browser's top layer (a manual popover,
85
+ * or the native full screen), `"fixed"` while it relies on `position: fixed`
86
+ * (no popover API, or the browser refused). `null` when not full screen.
87
+ */
88
+ layer: FullScreenLayer | null;
62
89
  /** Attach to the element that goes full screen. Also inside `targetProps`. */
63
90
  ref: RefObject<T | null>;
64
91
  /**
@@ -74,7 +101,15 @@ interface UseFullScreenResult<T extends HTMLElement = HTMLElement> {
74
101
  * `PortalContainerContext` so menus opened inside stay visible.
75
102
  */
76
103
  portalContainer: HTMLElement | null;
104
+ /**
105
+ * Identity of this surface for Escape routing. Provide it through
106
+ * `EscapeLayerContext` (FullScreenProvider does) so a menu opened inside
107
+ * gets Escape before the surface does.
108
+ */
109
+ escapeScope: EscapeScope;
77
110
  }
111
+ /** Which mechanism keeps the surface over the page. */
112
+ type FullScreenLayer = "top" | "fixed";
78
113
  /**
79
114
  * A controlled full-screen state for any surface: Editor today, DeckEditor and
80
115
  * SheetWorkbook next. Render-time output is pure (no `window`/`document`), so it
@@ -82,4 +117,4 @@ interface UseFullScreenResult<T extends HTMLElement = HTMLElement> {
82
117
  */
83
118
  declare function useFullScreen<T extends HTMLElement = HTMLElement>(options?: UseFullScreenOptions): UseFullScreenResult<T>;
84
119
 
85
- export { type FullScreenMode as F, type UseFullScreenOptions as U, type FullScreenTargetProps as a, type FullScreenToggleProps as b, type UseFullScreenResult as c, useFullScreen as u };
120
+ export { EscapeLayerContext as E, type FullScreenLayer as F, type UseFullScreenOptions as U, type EscapeScope as a, type FullScreenMode as b, type FullScreenTargetProps as c, type FullScreenToggleProps as d, type UseFullScreenResult as e, useEscapeLayer as f, useFullScreen as g, useEscapeKey as u };
@@ -45,17 +45,27 @@ function DeckEditor({ fullScreen, defaultFullScreen, onFullScreenChange }) {
45
45
 
46
46
  | `mode` | What happens | When it fails |
47
47
  |---|---|---|
48
- | `"overlay"` (default) | The element itself becomes `position: fixed` over the viewport, in place, with `z-index` 50 (as `Modal`) | Never refused. An ancestor with `transform`, `filter`, `perspective` or `contain: paint` confines it to that ancestor |
49
- | `"native"` | The overlay, plus `element.requestFullscreen()` so the browser chrome hides too | Refused in an iframe without `allow="fullscreen"`, without a user gesture, or by a permissions policy. It then stays in the overlay. `data-fullscreen-mode` says which one is active |
48
+ | `"overlay"` (default) | The element covers the viewport in place: `position: fixed` plus, where the browser has the popover API, promotion into the **top layer** with `popover="manual"` | Never refused. Without the popover API it stays `position: fixed` (z-index 50, as `Modal`) and an ancestor with `transform`, `filter`, `perspective` or `contain: paint` confines it to that ancestor |
49
+ | `"native"` | `element.requestFullscreen()`, so the browser chrome hides too | Refused in an iframe without `allow="fullscreen"`, without a user gesture, or by a permissions policy. It then drops to the overlay, top layer included. `data-fullscreen-mode` says which one is active |
50
50
 
51
51
  The overlay is the default because it never asks the browser for permission. The element is not portalled, so nothing inside remounts. An editor keeps its caret, undo history and seeded content.
52
52
 
53
+ **Why the top layer.** `position: fixed` is fixed to the viewport only while no ancestor has a transform, filter, perspective or paint containment. With one, the overlay is fixed to that ancestor instead. A Tabs panel whose fade-in animation holds its end keyframe (`animation-fill-mode: both`) traps it this way, and so does a dialog centred with `transform`. A top-layer element's containing block is the viewport whatever its ancestors do. `data-fullscreen-layer` reports `"top"` (popover, or the native full screen) or `"fixed"` (no popover API, or the browser refused).
54
+
55
+ What the top layer changes:
56
+
57
+ - **Light dismiss does not apply.** The popover is `manual`, so outside clicks do not close it, and Escape goes through the surface's own handling.
58
+ - **The UA popover box is reset.** `styles.css` puts padding, border, background, text colour and overflow back to a plain box, in a zero-specificity rule in the `base` layer, so your own classes still win. Geometry is set inline. Without `styles.css` the UA popover padding, border and `Canvas` colours show.
59
+ - **Portals opened from inside stay visible**, because they are redirected into the surface. Overlays rendered from OUTSIDE the surface while it is active, such as an app-level toast, sit under it, like anything else in the page.
60
+ - **Native mode requests the browser's full screen before any popover.** Chromium refuses `requestFullscreen()` on an element that is already an open popover, so the popover is only used if that request fails.
61
+ - If something else closes the popover, the surface drops back to `position: fixed` rather than disappearing.
62
+
53
63
  In `native` mode the browser handles Esc itself. When the user leaves through the browser's UI, `onFullScreenChange(false)` fires so controlled state stays in sync.
54
64
 
55
65
  ## Behaviour
56
66
 
57
67
  - **Controlled:** `fullScreen` + `onFullScreenChange`, or `defaultFullScreen` uncontrolled. `onFullScreenChange` only fires on real transitions.
58
- - **Escape** leaves full screen. An Escape that a child already handled (`preventDefault`), or that comes from a menu or dialog opened from inside, is left to that child. The Escape is stopped at the surface, so an enclosing dialog does not also close. `closeOnEscape={false}` turns this off.
68
+ - **Escape** leaves full screen, but the innermost open layer owns it. With a Dropdown, Select, Popover, Tooltip, ContextMenu, Command or Modal open inside the surface, the first Escape closes that layer and the next one leaves full screen. Focus may still be on the menu's trigger, and the menu may have opened before the surface went full screen; neither changes this. Layers register while open through `useEscapeKey`, and `FullScreenProvider` marks them as inside the surface, so this does not depend on listener order. An Escape a child already handled (`preventDefault`) is left alone. The Escape is stopped at the surface, so an enclosing dialog does not also close. `closeOnEscape={false}` turns this off. Your own layers take part by calling `useEscapeKey(close, open)`. A surface that calls `useFullScreen()` without `FullScreenProvider` gets the recency rule only.
59
69
  - **Focus** moves inside on entry if it was outside. On exit it returns to the element that had it before, unless the user has since focused something else. Tab wraps within the surface.
60
70
  - **Scroll:** body scroll is locked while active (`lockScroll`, reference-counted). On exit the window and every scrolled ancestor go back to their offsets. Those offsets are read before the surface leaves the flow, which would otherwise clamp them.
61
71
  - **SSR:** nothing touches `window` or `document` during render. A surface that starts full screen renders the overlay on the server.
@@ -73,7 +83,7 @@ In `native` mode the browser handles Esc itself. When the user leaves through th
73
83
  | zIndex | `number` | `50` | Stacking order of the overlay |
74
84
  | labels | `{ enter?: string; exit?: string }` | "Enter full screen" / "Exit full screen" | Toggle accessible names |
75
85
 
76
- `useFullScreen()` returns `{ fullScreen, setFullScreen, toggle, activeMode, ref, targetProps, toggleProps, portalContainer }`.
86
+ `useFullScreen()` returns `{ fullScreen, setFullScreen, toggle, activeMode, layer, ref, targetProps, toggleProps, portalContainer }`.
77
87
 
78
88
  ### FullScreen.Toggle
79
89
 
@@ -92,4 +102,5 @@ Renders nothing outside a `FullScreen` / `FullScreenProvider`.
92
102
  | `[data-react-fancy-fullscreen]` | `<FullScreen>` root |
93
103
  | `[data-fullscreen="true"]` | Any surface while full screen (also on the toggle) |
94
104
  | `[data-fullscreen-mode="overlay" \| "native"]` | Which mechanism is active |
105
+ | `[data-fullscreen-layer="top" \| "fixed"]` | Whether the surface is in the top layer or relies on `position: fixed` |
95
106
  | `[data-react-fancy-fullscreen-toggle]` | Any full-screen toggle |
package/docs/hooks.md CHANGED
@@ -56,7 +56,7 @@ useOutsideClick(ref, handler, enabled, ignoreRef);
56
56
 
57
57
  ## useEscapeKey
58
58
 
59
- Calls a handler when the Escape key is pressed.
59
+ Registers an Escape layer: while `enabled`, Escape calls `handler`, but only if this is the innermost open layer.
60
60
 
61
61
  ```tsx
62
62
  useEscapeKey(handler, enabled);
@@ -64,8 +64,14 @@ useEscapeKey(handler, enabled);
64
64
 
65
65
  | Param | Type | Default | Description |
66
66
  |-------|------|---------|-------------|
67
- | handler | `() => void` | - | Called on Escape keydown |
68
- | enabled | `boolean` | `true` | Enable/disable the listener |
67
+ | handler | `() => void` | - | Called on Escape keydown when this layer is innermost |
68
+ | enabled | `boolean` | `true` | Whether the layer is open |
69
+
70
+ Every react-fancy layer uses it: Dropdown, Select, Popover, ContextMenu, Command, Autocomplete, Breadcrumbs dropdown, MobileMenu, Modal, Drawer, Tooltip and full-screen surfaces. One Escape closes one layer. With a menu open in a dialog, the menu closes first, and the dialog closes on the next press.
71
+
72
+ "Innermost" means the most recently opened layer, with one refinement. A layer rendered inside a full-screen surface counts as inside it however the two were opened, because the surface provides `EscapeLayerContext` to everything inside it, portals included. An Escape something already handled (`event.preventDefault()`) is left alone.
73
+
74
+ Use it for your own layers so they take part. `useEscapeLayer(handler, enabled, scope?)` is the same hook with a `scope`, for surfaces other layers open inside. It returns `isInnermost()` for a layer that also handles Escape in its own key handler.
69
75
 
70
76
  ---
71
77
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@particle-academy/react-fancy",
3
- "version": "5.61.0",
3
+ "version": "5.62.0",
4
4
  "description": "React UI component library for Human+ UX — controlled, agent-bridgeable primitives",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/Tooltip/Tooltip.tsx"],"names":["Tooltip"],"mappings":";;;;;;;AAgBO,IAAM,OAAA,GAAU,UAAA;AAAA,EACrB,SAASA,QAAAA,CACP,EAAE,QAAA,EAAU,OAAA,EAAS,SAAA,GAAY,KAAA,EAAO,KAAA,GAAQ,GAAA,EAAK,MAAA,GAAS,CAAA,EAAG,SAAA,IACjE,IAAA,EACA;AACA,IAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAS,KAAK,CAAA;AAC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back,\n useMemo,\n useRef,\n useState,\n type ReactElement,\n type Ref,\n} from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { composeRefs } from \"../../utils/compose-refs\";\nimport { Portal } from \"../Portal\";\nimport { useFloatingPosition } from \"../../hooks/use-floating-position\";\nimport type { TooltipProps } from \"./Tooltip.types\";\n\nexport const Tooltip = forwardRef<HTMLDivElement, TooltipProps>(\n function Tooltip(\n { children, content, placement = \"top\", delay = 200, offset = 8, className },\n _ref,\n ) {\n const [open, setOpen] = useState(false);\n const anchorRef = useRef<HTMLElement>(null);\n const floatingRef = useRef<HTMLDivElement>(null);\n const timeoutRef = useRef<ReturnType<typeof setTimeout>>(undefined);\n\n const position = useFloatingPosition(anchorRef, floatingRef, {\n placement,\n offset,\n enabled: open,\n });\n\n const show = useCallback(() => {\n timeoutRef.current = setTimeout(() => setOpen(true), delay);\n }, [delay]);\n\n const hide = useCallback(() => {\n clearTimeout(timeoutRef.current);\n setOpen(false);\n }, []);\n\n // The trigger is the caller's element, so its own ref and handlers have to\n // survive the clone. Overwriting them broke any child that needs its ref:\n // a <MultiSwitch> measures its thumb from it, and rendered with none.\n // className and every other prop are untouched — cloneElement keeps them.\n const child = children as ReactElement<Record<string, unknown>>;\n const childProps = child.props;\n const childRef = childProps.ref as Ref<HTMLElement> | undefined;\n const triggerRef = useMemo(() => composeRefs(childRef, anchorRef), [childRef]);\n const chain =\n (own: unknown, ours: () => void) =>\n (event: unknown) => {\n if (typeof own === \"function\") own(event);\n ours();\n };\n const trigger = cloneElement(child, {\n ref: triggerRef,\n onMouseEnter: chain(childProps.onMouseEnter, show),\n onMouseLeave: chain(childProps.onMouseLeave, hide),\n onFocus: chain(childProps.onFocus, show),\n onBlur: chain(childProps.onBlur, hide),\n });\n\n return (\n <>\n {trigger}\n {open && (\n <Portal>\n <div\n ref={floatingRef}\n data-react-fancy-tooltip=\"\"\n role=\"tooltip\"\n className={cn(\n \"fancy-fade-in pointer-events-none fixed z-50 max-w-xs rounded-lg bg-zinc-900 px-3 py-1.5 text-sm text-white shadow-lg dark:bg-zinc-700 dark:text-zinc-100\",\n className,\n )}\n style={{ left: position.x, top: position.y }}\n >\n {content}\n <div\n className={cn(\n // `bg-inherit`, not a colour of its own: a `className` that\n // restyles the bubble would otherwise leave a dark arrow\n // pointing out of a light one.\n \"absolute h-2 w-2 rotate-45 bg-inherit\",\n position.placement.startsWith(\"top\") &&\n \"bottom-[-4px] left-1/2 -translate-x-1/2\",\n position.placement.startsWith(\"bottom\") &&\n \"top-[-4px] left-1/2 -translate-x-1/2\",\n position.placement.startsWith(\"left\") &&\n \"right-[-4px] top-1/2 -translate-y-1/2\",\n position.placement.startsWith(\"right\") &&\n \"left-[-4px] top-1/2 -translate-y-1/2\",\n )}\n />\n </div>\n </Portal>\n )}\n </>\n );\n },\n);\n\nTooltip.displayName = \"Tooltip\";\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/FullScreen/FullScreen.context.tsx","../src/components/FullScreen/FullScreenToggle.tsx"],"names":["jsx"],"mappings":";;;;;;AAIO,IAAM,iBAAA,GAAoB,cAA0C,IAAI;AAGxE,SAAS,oBAAA,GAAmD;AACjE,EAAA,OAAO,WAAW,iBAAiB,CAAA;AACrC;AAaO,SAAS,kBAAA,CAAmB,EAAE,KAAA,EAAO,QAAA,EAAS,EAA4B;AAC/E,EAAA,uBACE,GAAA,CAAC,iBAAA,CAAkB,QAAA,EAAlB,EAA2B,KAAA,EAC1B,QAAA,kBAAA,GAAA,CAAC,sBAAA,CAAuB,QAAA,EAAvB,EAAgC,KAAA,EAAO,KAAA,CAAM,eAAA,EAAkB,UAAS,CAAA,EAC3E,CAAA;AAEJ;ACTO,SAAS,gBAAA,CAAiB;AAAA,EAC/B,SAAA,GAAY,YAAA;AAAA,EACZ,QAAA,GAAW,YAAA;AAAA,EACX,QAAA;AAAA,EACA,SAAA;AAAA,EACA,GAAG;AACL,CAAA,EAA0B;AACxB,EAAA,MAAM,KAAK,oBAAA,EAAqB;AAChC,EAAA,IAAI,CAAC,IAAI,OAAO,IAAA;AAEhB,EAAA,MAAM,UACJ,OAAO,QAAA,KAAa,aAChB,QAAA,CAAS,EAAA,CAAG,UAAU,CAAA,GACtB,QAAA,oBAAYA,GAAAA,CAAC,QAAK,IAAA,EAAM,EAAA,CAAG,aAAa,QAAA,GAAW,SAAA,EAAW,MAAK,IAAA,EAAK,CAAA;AAE9E,EAAA,uBACEA,GAAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACH,GAAG,EAAA,CAAG,WAAA;AAAA,MACP,SAAA,EAAW,EAAA;AAAA,QACT,sFAAA;AAAA,QACA,+IAAA;AAAA,QACA,+HAAA;AAAA,QACA;AAAA,OACF;AAAA,MAEC,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ;AAEA,gBAAA,CAAiB,WAAA,GAAc,kBAAA","file":"chunk-4JLFIPHZ.js","sourcesContent":["import { createContext, useContext, type ReactNode } from \"react\";\nimport { PortalContainerContext } from \"../Portal/Portal\";\nimport type { UseFullScreenResult } from \"../../hooks/use-full-screen\";\n\nexport const FullScreenContext = createContext<UseFullScreenResult | null>(null);\n\n/** The nearest full-screen surface's state, or `null` outside one. */\nexport function useFullScreenContext(): UseFullScreenResult | null {\n return useContext(FullScreenContext);\n}\n\nexport interface FullScreenProviderProps {\n /** What `useFullScreen()` returned for the surface. */\n value: UseFullScreenResult<HTMLElement> | UseFullScreenResult<HTMLDivElement>;\n children?: ReactNode;\n}\n\n/**\n * For a surface that owns its root and calls `useFullScreen()` itself (Editor,\n * DeckEditor, SheetWorkbook). Makes `<FullScreen.Toggle />` work anywhere inside\n * and redirects descendant `<Portal>`s into the surface while it is active.\n */\nexport function FullScreenProvider({ value, children }: FullScreenProviderProps) {\n return (\n <FullScreenContext.Provider value={value as UseFullScreenResult}>\n <PortalContainerContext.Provider value={value.portalContainer}>{children}</PortalContainerContext.Provider>\n </FullScreenContext.Provider>\n );\n}\n","import type { ButtonHTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { Icon } from \"../Icon\";\nimport { useFullScreenContext } from \"./FullScreen.context\";\n\nexport interface FullScreenToggleProps\n extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, \"type\" | \"onClick\" | \"children\"> {\n /** Lucide name shown while NOT full screen. @default \"maximize-2\" */\n enterIcon?: string;\n /** Lucide name shown while full screen. @default \"minimize-2\" */\n exitIcon?: string;\n /** Replace the icon entirely. Receives the current state. */\n children?: ReactNode | ((fullScreen: boolean) => ReactNode);\n}\n\n/**\n * The toggle for the nearest `<FullScreen>` / `<FullScreenProvider>`. Renders\n * nothing outside one, so a shared toolbar can include it unconditionally.\n */\nexport function FullScreenToggle({\n enterIcon = \"maximize-2\",\n exitIcon = \"minimize-2\",\n children,\n className,\n ...rest\n}: FullScreenToggleProps) {\n const fs = useFullScreenContext();\n if (!fs) return null;\n\n const content =\n typeof children === \"function\"\n ? children(fs.fullScreen)\n : children ?? <Icon name={fs.fullScreen ? exitIcon : enterIcon} size=\"sm\" />;\n\n return (\n <button\n {...rest}\n {...fs.toggleProps}\n className={cn(\n \"inline-flex h-8 w-8 items-center justify-center rounded-md text-sm transition-colors\",\n \"hover:bg-[color:var(--fancy-surface-muted,var(--color-zinc-100))] dark:hover:bg-[color:var(--fancy-surface-muted-dark,var(--color-zinc-800))]\",\n \"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[color:var(--color-brand,var(--color-blue-500))]\",\n className,\n )}\n >\n {content}\n </button>\n );\n}\n\nFullScreenToggle.displayName = \"FullScreenToggle\";\n"]}
@@ -1,19 +0,0 @@
1
- import { useEffect } from 'react';
2
-
3
- // src/hooks/use-escape-key.ts
4
- function useEscapeKey(handler, enabled = true) {
5
- useEffect(() => {
6
- if (!enabled) return;
7
- const listener = (event) => {
8
- if (event.key === "Escape") {
9
- handler();
10
- }
11
- };
12
- document.addEventListener("keydown", listener);
13
- return () => document.removeEventListener("keydown", listener);
14
- }, [handler, enabled]);
15
- }
16
-
17
- export { useEscapeKey };
18
- //# sourceMappingURL=chunk-JXE5XID6.js.map
19
- //# sourceMappingURL=chunk-JXE5XID6.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/hooks/use-escape-key.ts"],"names":[],"mappings":";;;AAEO,SAAS,YAAA,CACd,OAAA,EACA,OAAA,GAAmB,IAAA,EACb;AACN,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,CAAC,OAAA,EAAS;AAEd,IAAA,MAAM,QAAA,GAAW,CAAC,KAAA,KAAyB;AACzC,MAAA,IAAI,KAAA,CAAM,QAAQ,QAAA,EAAU;AAC1B,QAAA,OAAA,EAAQ;AAAA,MACV;AAAA,IACF,CAAA;AAEA,IAAA,QAAA,CAAS,gBAAA,CAAiB,WAAW,QAAQ,CAAA;AAC7C,IAAA,OAAO,MAAM,QAAA,CAAS,mBAAA,CAAoB,SAAA,EAAW,QAAQ,CAAA;AAAA,EAC/D,CAAA,EAAG,CAAC,OAAA,EAAS,OAAO,CAAC,CAAA;AACvB","file":"chunk-JXE5XID6.js","sourcesContent":["import { useEffect } from \"react\";\n\nexport function useEscapeKey(\n handler: () => void,\n enabled: boolean = true,\n): void {\n useEffect(() => {\n if (!enabled) return;\n\n const listener = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n handler();\n }\n };\n\n document.addEventListener(\"keydown\", listener);\n return () => document.removeEventListener(\"keydown\", listener);\n }, [handler, enabled]);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/utils/scroll-lock.ts","../src/hooks/use-full-screen.ts"],"names":[],"mappings":";;;;AAYA,IAAI,OAAA,GAAU,CAAA;AACd,IAAI,KAAA,GAAQ,EAAA;AAEL,SAAS,cAAA,GAA6B;AAC3C,EAAA,IAAI,YAAY,CAAA,EAAG;AACjB,IAAA,KAAA,GAAQ,QAAA,CAAS,KAAK,KAAA,CAAM,QAAA;AAC5B,IAAA,QAAA,CAAS,IAAA,CA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,aAAa,SAAA,GAAY,UAAA;AAAA,MACvC,KAAA,EAAO,aAAa,SAAA,GAAY,UAAA;AAAA,MAChC,oCAAA,EAAsC,EAAA;AAAA,MACtC,iBAAA,EAAmB,aAAa,MAAA,GAAS;AAAA;AAC3C,GACF;AACF","file":"chunk-NE3BZV3F.js","sourcesContent":["/**\n * Reference-counted body scroll lock.\n *\n * Two surfaces locking independently with the save-and-restore pattern\n * (`const original = body.style.overflow`) only unwind correctly in strict LIFO\n * order. Exit them out of order and the first one out restores `\"\"` while the\n * second is still covering the viewport, so the page scrolls behind it. Counting\n * holders keeps the lock until the last one lets go, and restores the value that\n * was there before the FIRST took it.\n *\n * Call only from an effect: it touches `document`.\n */\nlet holders = 0;\nlet saved = \"\";\n\nexport function lockBodyScroll(): () => void {\n if (holders === 0) {\n saved = document.body.style.overflow;\n document.body.style.overflow = \"hidden\";\n }\n holders++;\n\n let released = false;\n return () => {\n if (released) return;\n released = true;\n holders--;\n if (holders === 0) document.body.style.overflow = saved;\n };\n}\n","import {\n useCallback,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n type CSSProperties,\n type KeyboardEvent as ReactKeyboardEvent,\n type RefObject,\n} from \"react\";\nimport { useControllableState } from \"./use-controllable-state\";\nimport { lockBodyScroll } from \"../utils/scroll-lock\";\n\n/**\n * How a surface goes full screen.\n *\n * - `\"overlay\"` (default): the element itself becomes `position: fixed` over the\n * viewport, in place. It always works: inside an iframe without\n * `allow=\"fullscreen\"`, inside a dialog, without a user gesture. Nothing is\n * reparented, so an editor keeps its caret, undo stack and DOM.\n * - `\"native\"`: the browser Fullscreen API (`element.requestFullscreen()`),\n * which hides the browser chrome too. The overlay is applied first and stays\n * if the request is rejected or the API is missing, so the user gets full\n * screen either way; `activeMode` reports which one took.\n */\nexport type FullScreenMode = \"overlay\" | \"native\";\n\nexport interface UseFullScreenOptions {\n /** Controlled flag. Pair with `onFullScreenChange`. */\n fullScreen?: boolean;\n /** Initial flag when uncontrolled. @default false */\n defaultFullScreen?: boolean;\n /**\n * Fired with the requested state — from the toggle, Escape, an agent calling\n * `setFullScreen`, or the user leaving the browser's own full screen.\n */\n onFullScreenChange?: (fullScreen: boolean) => void;\n /** @default \"overlay\" */\n mode?: FullScreenMode;\n /** Leave full screen on Escape. @default true */\n closeOnEscape?: boolean;\n /** Stop the page behind from scrolling while active. @default true */\n lockScroll?: boolean;\n /** Stacking order of the overlay. Matches `Modal`. @default 50 */\n zIndex?: number;\n /** Accessible names for the toggle. */\n labels?: { enter?: string; exit?: string };\n}\n\nexport interface FullScreenTargetProps<T extends HTMLElement> {\n ref: RefObject<T | null>;\n \"data-fullscreen\": \"true\" | \"false\";\n \"data-fullscreen-mode\"?: FullScreenMode;\n style?: CSSProperties;\n onKeyDown: (event: ReactKeyboardEvent<T>) => void;\n}\n\nexport interface FullScreenToggleProps {\n type: \"button\";\n onClick: () => void;\n \"aria-pressed\": boolean;\n \"aria-label\": string;\n title: string;\n \"data-react-fancy-fullscreen-toggle\": \"\";\n \"data-fullscreen\": \"true\" | \"false\";\n}\n\nexport interface UseFullScreenResult<T extends HTMLElement = HTMLElement> {\n fullScreen: boolean;\n setFullScreen: (fullScreen: boolean) => void;\n toggle: () => void;\n /** The mechanism in effect while active; `null` when not full screen. */\n activeMode: FullScreenMode | null;\n /** Attach to the element that goes full screen. Also inside `targetProps`. */\n ref: RefObject<T | null>;\n /**\n * Spread onto the surface's root. Carries the ref, the `data-fullscreen`\n * handle, the overlay style and the Escape/Tab handler. Merge your own\n * `style` / `onKeyDown` if the root has them.\n */\n targetProps: FullScreenTargetProps<T>;\n /** Spread onto a `<button>` to make it the toggle. */\n toggleProps: FullScreenToggleProps;\n /**\n * The element to portal into while active, else `null`. Provide it through\n * `PortalContainerContext` so menus opened inside stay visible.\n */\n portalContainer: HTMLElement | null;\n}\n\nconst FOCUSABLE = [\n \"a[href]\",\n \"button:not([disabled])\",\n \"input:not([disabled])\",\n \"textarea:not([disabled])\",\n \"select:not([disabled])\",\n \"[contenteditable]:not([contenteditable='false'])\",\n \"[tabindex]:not([tabindex='-1'])\",\n].join(\", \");\n\n/** Active surfaces, innermost last. Only the top one answers a stray Escape. */\nconst activeStack: object[] = [];\n\nconst OVERLAY_STYLE: CSSProperties = {\n position: \"fixed\",\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n width: \"100%\",\n height: \"100%\",\n maxWidth: \"none\",\n maxHeight: \"none\",\n margin: 0,\n borderRadius: 0,\n boxSizing: \"border-box\",\n};\n\ninterface ScrollMemo {\n el: Element;\n top: number;\n left: number;\n}\n\n/**\n * A controlled full-screen state for any surface: Editor today, DeckEditor and\n * SheetWorkbook next. Render-time output is pure (no `window`/`document`), so it\n * server-renders; everything that touches the DOM runs in effects.\n */\nexport function useFullScreen<T extends HTMLElement = HTMLElement>(\n options: UseFullScreenOptions = {},\n): UseFullScreenResult<T> {\n const {\n fullScreen: controlled,\n defaultFullScreen = false,\n onFullScreenChange,\n mode = \"overlay\",\n closeOnEscape = true,\n lockScroll = true,\n zIndex = 50,\n labels,\n } = options;\n\n const [fullScreen, setState] = useControllableState(controlled, defaultFullScreen, onFullScreenChange);\n const ref = useRef<T | null>(null);\n const token = useRef({});\n const [nativeActive, setNativeActive] = useState(false);\n const [portalContainer, setPortalContainer] = useState<HTMLElement | null>(null);\n // Whether the overlay STYLE is on. It trails `fullScreen` by one synchronous\n // commit on entry, so the layout effect below reads scroll offsets while the\n // surface is still in flow. Read after the style lands and the browser has\n // already clamped every scroll container around it: a panel at 569 read as\n // 342 in Chromium, and that is where the user was sent back to. The re-render\n // happens inside the layout phase, before paint, so nothing flashes.\n // Initialised from `fullScreen` so a surface that starts full screen renders\n // the overlay on the server and on hydration alike.\n const [applied, setApplied] = useState(fullScreen);\n\n const current = useRef(fullScreen);\n current.current = fullScreen;\n\n // Only report real transitions: Escape on an inactive surface, or a second\n // click racing a re-render, must not fire `onFullScreenChange(false)` twice.\n const setFullScreen = useCallback(\n (next: boolean) => {\n if (current.current === next) return;\n current.current = next;\n setState(next);\n },\n [setState],\n );\n const toggle = useCallback(() => setFullScreen(!current.current), [setFullScreen]);\n\n // Enter / exit bookkeeping. A LAYOUT effect so the cleanup runs after the\n // overlay style has been removed from the DOM but before paint: scroll offsets\n // restored there never flash, and the surface is back in flow to measure.\n useLayoutEffect(() => {\n if (!fullScreen) return;\n const el = ref.current;\n if (!el) return;\n\n // Taking the surface out of flow shrinks every scroll container around it,\n // which clamps their scrollTop. Remember them so exit lands where it began.\n const scrolled: ScrollMemo[] = [];\n for (let p = el.parentElement; p && p !== document.body && p !== document.documentElement; p = p.parentElement) {\n if (p.scrollTop || p.scrollLeft) scrolled.push({ el: p, top: p.scrollTop, left: p.scrollLeft });\n }\n const winX = window.scrollX;\n const winY = window.scrollY;\n\n const release = lockScroll ? lockBodyScroll() : null;\n activeStack.push(token.current);\n setPortalContainer(el);\n setApplied(true);\n\n return () => {\n const i = activeStack.indexOf(token.current);\n if (i >= 0) activeStack.splice(i, 1);\n release?.();\n for (const m of scrolled) {\n if (m.el.scrollTop !== m.top) m.el.scrollTop = m.top;\n if (m.el.scrollLeft !== m.left) m.el.scrollLeft = m.left;\n }\n if (window.scrollX !== winX || window.scrollY !== winY) window.scrollTo(winX, winY);\n setPortalContainer(null);\n setApplied(false);\n };\n }, [fullScreen, lockScroll]);\n\n // Focus in and back out. A PASSIVE effect on purpose: React re-focuses\n // whatever had focus before a commit once the commit's mutations finish, so a\n // focus() issued from a layout-effect cleanup is silently undone.\n useEffect(() => {\n if (!fullScreen) return;\n const el = ref.current;\n if (!el) return;\n\n const opener =\n document.activeElement instanceof HTMLElement && document.activeElement !== document.body\n ? document.activeElement\n : null;\n\n // Focus must not stay behind the overlay, where the user cannot see it.\n if (!el.contains(document.activeElement)) {\n el.querySelector<HTMLElement>(FOCUSABLE)?.focus({ preventScroll: true });\n }\n\n return () => {\n // Give focus back only if it is still ours to give: inside the surface,\n // or lost to <body>. A user who clicked elsewhere keeps their choice.\n const active = document.activeElement;\n if (opener?.isConnected && (!active || active === document.body || el.contains(active))) {\n opener.focus({ preventScroll: true });\n }\n };\n }, [fullScreen]);\n\n // The browser Fullscreen API, on top of the overlay.\n useEffect(() => {\n if (!fullScreen || mode !== \"native\") return;\n const el = ref.current;\n if (!el || typeof el.requestFullscreen !== \"function\" || document.fullscreenEnabled === false) return;\n\n let cancelled = false;\n let entered = false;\n\n const onChange = () => {\n if (document.fullscreenElement === el) {\n entered = true;\n setNativeActive(true);\n } else if (entered) {\n // The user left through the browser's own UI (Esc, F11, the close\n // pill). Keep the controlled state honest rather than leaving an\n // overlay up that they believe they dismissed.\n entered = false;\n setNativeActive(false);\n if (!cancelled) setFullScreen(false);\n }\n };\n document.addEventListener(\"fullscreenchange\", onChange);\n\n // Blocked requests (iframe without allow=\"fullscreen\", no user gesture, a\n // permissions policy) reject, and some engines throw instead. Either way\n // the overlay is already up, so the user stays full screen in it.\n try {\n Promise.resolve(el.requestFullscreen()).then(onChange, () => {});\n } catch {\n /* stay in the overlay */\n }\n\n return () => {\n cancelled = true;\n document.removeEventListener(\"fullscreenchange\", onChange);\n if (document.fullscreenElement === el) {\n try {\n Promise.resolve(document.exitFullscreen()).catch(() => {});\n } catch {\n /* already left */\n }\n }\n setNativeActive(false);\n };\n }, [fullScreen, mode, setFullScreen]);\n\n // Escape with nothing focused never reaches the surface's own handler.\n useEffect(() => {\n if (!fullScreen || !closeOnEscape) return;\n const onKey = (e: KeyboardEvent) => {\n if (e.key !== \"Escape\" || e.defaultPrevented) return;\n const t = e.target;\n if (t !== document.body && t !== document.documentElement && t !== document) return;\n if (activeStack[activeStack.length - 1] !== token.current) return;\n setFullScreen(false);\n };\n document.addEventListener(\"keydown\", onKey);\n return () => document.removeEventListener(\"keydown\", onKey);\n }, [fullScreen, closeOnEscape, setFullScreen]);\n\n const onKeyDown = useCallback(\n (e: ReactKeyboardEvent<T>) => {\n if (!current.current || e.defaultPrevented) return;\n const el = ref.current;\n if (!el) return;\n\n if (e.key === \"Tab\") {\n // Keep Tab inside the surface; what is behind the overlay is invisible.\n const items = Array.from(el.querySelectorAll<HTMLElement>(FOCUSABLE));\n if (items.length === 0) return;\n const first = items[0];\n const last = items[items.length - 1];\n const active = document.activeElement;\n if (e.shiftKey && (active === first || active === el)) {\n e.preventDefault();\n last.focus();\n } else if (!e.shiftKey && active === last) {\n e.preventDefault();\n first.focus();\n }\n return;\n }\n\n if (e.key !== \"Escape\" || !closeOnEscape) return;\n // An Escape from inside a layer opened FROM this surface (a menu, a\n // popover, a dialog) belongs to that layer. React bubbles portal events\n // through the component tree, so check the DOM: a portal wrapper that\n // does not contain this surface is nested inside it.\n const layer = (e.target as Element).closest?.(\"[data-react-fancy-portal]\");\n if (layer && !layer.contains(el)) return;\n // Stop it here so an enclosing dialog's document listener does not also\n // close: one Escape, one step back.\n e.preventDefault();\n e.stopPropagation();\n setFullScreen(false);\n },\n [closeOnEscape, setFullScreen],\n );\n\n const activeMode: FullScreenMode | null = fullScreen ? (nativeActive ? \"native\" : \"overlay\") : null;\n const enterLabel = labels?.enter ?? \"Enter full screen\";\n const exitLabel = labels?.exit ?? \"Exit full screen\";\n\n return {\n fullScreen,\n setFullScreen,\n toggle,\n activeMode,\n ref,\n portalContainer,\n targetProps: {\n ref,\n \"data-fullscreen\": fullScreen ? \"true\" : \"false\",\n ...(activeMode ? { \"data-fullscreen-mode\": activeMode } : {}),\n ...(fullScreen && applied ? { style: { ...OVERLAY_STYLE, zIndex } } : {}),\n onKeyDown,\n },\n toggleProps: {\n type: \"button\",\n onClick: toggle,\n \"aria-pressed\": fullScreen,\n \"aria-label\": fullScreen ? exitLabel : enterLabel,\n title: fullScreen ? exitLabel : enterLabel,\n \"data-react-fancy-fullscreen-toggle\": \"\",\n \"data-fullscreen\": fullScreen ? \"true\" : \"false\",\n },\n };\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/utils/scroll-lock.ts","../src/hooks/use-full-screen.ts"],"names":["useControllableState","useRef","useState","useCallback","useLayoutEffect","useEffect"],"m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,IAAc,OAAA,GAAU,EAAE,KAAA,EAAO,EAAE,GAAG,aAAA,EAAe,MAAA,EAAO,EAAE,GAAI,EAAC;AAAA,MACvE;AAAA,KACF;AAAA,IACA,WAAA,EAAa;AAAA,MACX,IAAA,EAAM,QAAA;AAAA,MACN,OAAA,EAAS,MAAA;AAAA,MACT,cAAA,EAAgB,UAAA;AAAA,MAChB,YAAA,EAAc,aAAa,SAAA,GAAY,UAAA;AAAA,MACvC,KAAA,EAAO,aAAa,SAAA,GAAY,UAAA;AAAA,MAChC,oCAAA,EAAsC,EAAA;AAAA,MACtC,iBAAA,EAAmB,aAAa,MAAA,GAAS;AAAA;AAC3C,GACF;AACF","file":"chunk-O4HZVZMY.cjs","sourcesContent":["/**\n * Reference-counted body scroll lock.\n *\n * Two surfaces locking independently with the save-and-restore pattern\n * (`const original = body.style.overflow`) only unwind correctly in strict LIFO\n * order. Exit them out of order and the first one out restores `\"\"` while the\n * second is still covering the viewport, so the page scrolls behind it. Counting\n * holders keeps the lock until the last one lets go, and restores the value that\n * was there before the FIRST took it.\n *\n * Call only from an effect: it touches `document`.\n */\nlet holders = 0;\nlet saved = \"\";\n\nexport function lockBodyScroll(): () => void {\n if (holders === 0) {\n saved = document.body.style.overflow;\n document.body.style.overflow = \"hidden\";\n }\n holders++;\n\n let released = false;\n return () => {\n if (released) return;\n released = true;\n holders--;\n if (holders === 0) document.body.style.overflow = saved;\n };\n}\n","import {\n useCallback,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n type CSSProperties,\n type KeyboardEvent as ReactKeyboardEvent,\n type RefObject,\n} from \"react\";\nimport { useControllableState } from \"./use-controllable-state\";\nimport { lockBodyScroll } from \"../utils/scroll-lock\";\n\n/**\n * How a surface goes full screen.\n *\n * - `\"overlay\"` (default): the element itself becomes `position: fixed` over the\n * viewport, in place. It always works: inside an iframe without\n * `allow=\"fullscreen\"`, inside a dialog, without a user gesture. Nothing is\n * reparented, so an editor keeps its caret, undo stack and DOM.\n * - `\"native\"`: the browser Fullscreen API (`element.requestFullscreen()`),\n * which hides the browser chrome too. The overlay is applied first and stays\n * if the request is rejected or the API is missing, so the user gets full\n * screen either way; `activeMode` reports which one took.\n */\nexport type FullScreenMode = \"overlay\" | \"native\";\n\nexport interface UseFullScreenOptions {\n /** Controlled flag. Pair with `onFullScreenChange`. */\n fullScreen?: boolean;\n /** Initial flag when uncontrolled. @default false */\n defaultFullScreen?: boolean;\n /**\n * Fired with the requested state — from the toggle, Escape, an agent calling\n * `setFullScreen`, or the user leaving the browser's own full screen.\n */\n onFullScreenChange?: (fullScreen: boolean) => void;\n /** @default \"overlay\" */\n mode?: FullScreenMode;\n /** Leave full screen on Escape. @default true */\n closeOnEscape?: boolean;\n /** Stop the page behind from scrolling while active. @default true */\n lockScroll?: boolean;\n /** Stacking order of the overlay. Matches `Modal`. @default 50 */\n zIndex?: number;\n /** Accessible names for the toggle. */\n labels?: { enter?: string; exit?: string };\n}\n\nexport interface FullScreenTargetProps<T extends HTMLElement> {\n ref: RefObject<T | null>;\n \"data-fullscreen\": \"true\" | \"false\";\n \"data-fullscreen-mode\"?: FullScreenMode;\n style?: CSSProperties;\n onKeyDown: (event: ReactKeyboardEvent<T>) => void;\n}\n\nexport interface FullScreenToggleProps {\n type: \"button\";\n onClick: () => void;\n \"aria-pressed\": boolean;\n \"aria-label\": string;\n title: string;\n \"data-react-fancy-fullscreen-toggle\": \"\";\n \"data-fullscreen\": \"true\" | \"false\";\n}\n\nexport interface UseFullScreenResult<T extends HTMLElement = HTMLElement> {\n fullScreen: boolean;\n setFullScreen: (fullScreen: boolean) => void;\n toggle: () => void;\n /** The mechanism in effect while active; `null` when not full screen. */\n activeMode: FullScreenMode | null;\n /** Attach to the element that goes full screen. Also inside `targetProps`. */\n ref: RefObject<T | null>;\n /**\n * Spread onto the surface's root. Carries the ref, the `data-fullscreen`\n * handle, the overlay style and the Escape/Tab handler. Merge your own\n * `style` / `onKeyDown` if the root has them.\n */\n targetProps: FullScreenTargetProps<T>;\n /** Spread onto a `<button>` to make it the toggle. */\n toggleProps: FullScreenToggleProps;\n /**\n * The element to portal into while active, else `null`. Provide it through\n * `PortalContainerContext` so menus opened inside stay visible.\n */\n portalContainer: HTMLElement | null;\n}\n\nconst FOCUSABLE = [\n \"a[href]\",\n \"button:not([disabled])\",\n \"input:not([disabled])\",\n \"textarea:not([disabled])\",\n \"select:not([disabled])\",\n \"[contenteditable]:not([contenteditable='false'])\",\n \"[tabindex]:not([tabindex='-1'])\",\n].join(\", \");\n\n/** Active surfaces, innermost last. Only the top one answers a stray Escape. */\nconst activeStack: object[] = [];\n\nconst OVERLAY_STYLE: CSSProperties = {\n position: \"fixed\",\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n width: \"100%\",\n height: \"100%\",\n maxWidth: \"none\",\n maxHeight: \"none\",\n margin: 0,\n borderRadius: 0,\n boxSizing: \"border-box\",\n};\n\ninterface ScrollMemo {\n el: Element;\n top: number;\n left: number;\n}\n\n/**\n * A controlled full-screen state for any surface: Editor today, DeckEditor and\n * SheetWorkbook next. Render-time output is pure (no `window`/`document`), so it\n * server-renders; everything that touches the DOM runs in effects.\n */\nexport function useFullScreen<T extends HTMLElement = HTMLElement>(\n options: UseFullScreenOptions = {},\n): UseFullScreenResult<T> {\n const {\n fullScreen: controlled,\n defaultFullScreen = false,\n onFullScreenChange,\n mode = \"overlay\",\n closeOnEscape = true,\n lockScroll = true,\n zIndex = 50,\n labels,\n } = options;\n\n const [fullScreen, setState] = useControllableState(controlled, defaultFullScreen, onFullScreenChange);\n const ref = useRef<T | null>(null);\n const token = useRef({});\n const [nativeActive, setNativeActive] = useState(false);\n const [portalContainer, setPortalContainer] = useState<HTMLElement | null>(null);\n // Whether the overlay STYLE is on. It trails `fullScreen` by one synchronous\n // commit on entry, so the layout effect below reads scroll offsets while the\n // surface is still in flow. Read after the style lands and the browser has\n // already clamped every scroll container around it: a panel at 569 read as\n // 342 in Chromium, and that is where the user was sent back to. The re-render\n // happens inside the layout phase, before paint, so nothing flashes.\n // Initialised from `fullScreen` so a surface that starts full screen renders\n // the overlay on the server and on hydration alike.\n const [applied, setApplied] = useState(fullScreen);\n\n const current = useRef(fullScreen);\n current.current = fullScreen;\n\n // Only report real transitions: Escape on an inactive surface, or a second\n // click racing a re-render, must not fire `onFullScreenChange(false)` twice.\n const setFullScreen = useCallback(\n (next: boolean) => {\n if (current.current === next) return;\n current.current = next;\n setState(next);\n },\n [setState],\n );\n const toggle = useCallback(() => setFullScreen(!current.current), [setFullScreen]);\n\n // Enter / exit bookkeeping. A LAYOUT effect so the cleanup runs after the\n // overlay style has been removed from the DOM but before paint: scroll offsets\n // restored there never flash, and the surface is back in flow to measure.\n useLayoutEffect(() => {\n if (!fullScreen) return;\n const el = ref.current;\n if (!el) return;\n\n // Taking the surface out of flow shrinks every scroll container around it,\n // which clamps their scrollTop. Remember them so exit lands where it began.\n const scrolled: ScrollMemo[] = [];\n for (let p = el.parentElement; p && p !== document.body && p !== document.documentElement; p = p.parentElement) {\n if (p.scrollTop || p.scrollLeft) scrolled.push({ el: p, top: p.scrollTop, left: p.scrollLeft });\n }\n const winX = window.scrollX;\n const winY = window.scrollY;\n\n const release = lockScroll ? lockBodyScroll() : null;\n activeStack.push(token.current);\n setPortalContainer(el);\n setApplied(true);\n\n return () => {\n const i = activeStack.indexOf(token.current);\n if (i >= 0) activeStack.splice(i, 1);\n release?.();\n for (const m of scrolled) {\n if (m.el.scrollTop !== m.top) m.el.scrollTop = m.top;\n if (m.el.scrollLeft !== m.left) m.el.scrollLeft = m.left;\n }\n if (window.scrollX !== winX || window.scrollY !== winY) window.scrollTo(winX, winY);\n setPortalContainer(null);\n setApplied(false);\n };\n }, [fullScreen, lockScroll]);\n\n // Focus in and back out. A PASSIVE effect on purpose: React re-focuses\n // whatever had focus before a commit once the commit's mutations finish, so a\n // focus() issued from a layout-effect cleanup is silently undone.\n useEffect(() => {\n if (!fullScreen) return;\n const el = ref.current;\n if (!el) return;\n\n const opener =\n document.activeElement instanceof HTMLElement && document.activeElement !== document.body\n ? document.activeElement\n : null;\n\n // Focus must not stay behind the overlay, where the user cannot see it.\n if (!el.contains(document.activeElement)) {\n el.querySelector<HTMLElement>(FOCUSABLE)?.focus({ preventScroll: true });\n }\n\n return () => {\n // Give focus back only if it is still ours to give: inside the surface,\n // or lost to <body>. A user who clicked elsewhere keeps their choice.\n const active = document.activeElement;\n if (opener?.isConnected && (!active || active === document.body || el.contains(active))) {\n opener.focus({ preventScroll: true });\n }\n };\n }, [fullScreen]);\n\n // The browser Fullscreen API, on top of the overlay.\n useEffect(() => {\n if (!fullScreen || mode !== \"native\") return;\n const el = ref.current;\n if (!el || typeof el.requestFullscreen !== \"function\" || document.fullscreenEnabled === false) return;\n\n let cancelled = false;\n let entered = false;\n\n const onChange = () => {\n if (document.fullscreenElement === el) {\n entered = true;\n setNativeActive(true);\n } else if (entered) {\n // The user left through the browser's own UI (Esc, F11, the close\n // pill). Keep the controlled state honest rather than leaving an\n // overlay up that they believe they dismissed.\n entered = false;\n setNativeActive(false);\n if (!cancelled) setFullScreen(false);\n }\n };\n document.addEventListener(\"fullscreenchange\", onChange);\n\n // Blocked requests (iframe without allow=\"fullscreen\", no user gesture, a\n // permissions policy) reject, and some engines throw instead. Either way\n // the overlay is already up, so the user stays full screen in it.\n try {\n Promise.resolve(el.requestFullscreen()).then(onChange, () => {});\n } catch {\n /* stay in the overlay */\n }\n\n return () => {\n cancelled = true;\n document.removeEventListener(\"fullscreenchange\", onChange);\n if (document.fullscreenElement === el) {\n try {\n Promise.resolve(document.exitFullscreen()).catch(() => {});\n } catch {\n /* already left */\n }\n }\n setNativeActive(false);\n };\n }, [fullScreen, mode, setFullScreen]);\n\n // Escape with nothing focused never reaches the surface's own handler.\n useEffect(() => {\n if (!fullScreen || !closeOnEscape) return;\n const onKey = (e: KeyboardEvent) => {\n if (e.key !== \"Escape\" || e.defaultPrevented) return;\n const t = e.target;\n if (t !== document.body && t !== document.documentElement && t !== document) return;\n if (activeStack[activeStack.length - 1] !== token.current) return;\n setFullScreen(false);\n };\n document.addEventListener(\"keydown\", onKey);\n return () => document.removeEventListener(\"keydown\", onKey);\n }, [fullScreen, closeOnEscape, setFullScreen]);\n\n const onKeyDown = useCallback(\n (e: ReactKeyboardEvent<T>) => {\n if (!current.current || e.defaultPrevented) return;\n const el = ref.current;\n if (!el) return;\n\n if (e.key === \"Tab\") {\n // Keep Tab inside the surface; what is behind the overlay is invisible.\n const items = Array.from(el.querySelectorAll<HTMLElement>(FOCUSABLE));\n if (items.length === 0) return;\n const first = items[0];\n const last = items[items.length - 1];\n const active = document.activeElement;\n if (e.shiftKey && (active === first || active === el)) {\n e.preventDefault();\n last.focus();\n } else if (!e.shiftKey && active === last) {\n e.preventDefault();\n first.focus();\n }\n return;\n }\n\n if (e.key !== \"Escape\" || !closeOnEscape) return;\n // An Escape from inside a layer opened FROM this surface (a menu, a\n // popover, a dialog) belongs to that layer. React bubbles portal events\n // through the component tree, so check the DOM: a portal wrapper that\n // does not contain this surface is nested inside it.\n const layer = (e.target as Element).closest?.(\"[data-react-fancy-portal]\");\n if (layer && !layer.contains(el)) return;\n // Stop it here so an enclosing dialog's document listener does not also\n // close: one Escape, one step back.\n e.preventDefault();\n e.stopPropagation();\n setFullScreen(false);\n },\n [closeOnEscape, setFullScreen],\n );\n\n const activeMode: FullScreenMode | null = fullScreen ? (nativeActive ? \"native\" : \"overlay\") : null;\n const enterLabel = labels?.enter ?? \"Enter full screen\";\n const exitLabel = labels?.exit ?? \"Exit full screen\";\n\n return {\n fullScreen,\n setFullScreen,\n toggle,\n activeMode,\n ref,\n portalContainer,\n targetProps: {\n ref,\n \"data-fullscreen\": fullScreen ? \"true\" : \"false\",\n ...(activeMode ? { \"data-fullscreen-mode\": activeMode } : {}),\n ...(fullScreen && applied ? { style: { ...OVERLAY_STYLE, zIndex } } : {}),\n onKeyDown,\n },\n toggleProps: {\n type: \"button\",\n onClick: toggle,\n \"aria-pressed\": fullScreen,\n \"aria-label\": fullScreen ? exitLabel : enterLabel,\n title: fullScreen ? exitLabel : enterLabel,\n \"data-react-fancy-fullscreen-toggle\": \"\",\n \"data-fullscreen\": fullScreen ? \"true\" : \"false\",\n },\n };\n}\n"]}