@42-central/ui-react 0.20.1 → 0.22.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 (129) hide show
  1. package/dist/{chunk-45QRQKRC.js → chunk-3L5GLI67.js} +12 -8
  2. package/dist/chunk-3L5GLI67.js.map +1 -0
  3. package/dist/{chunk-BNWQ7IAZ.js → chunk-4FEOMQYR.js} +5 -5
  4. package/dist/{chunk-BNWQ7IAZ.js.map → chunk-4FEOMQYR.js.map} +1 -1
  5. package/dist/{chunk-POKLPMSB.js → chunk-D3JYDAUZ.js} +3 -3
  6. package/dist/{chunk-POKLPMSB.js.map → chunk-D3JYDAUZ.js.map} +1 -1
  7. package/dist/{chunk-KMZENCEP.js → chunk-DHJB4UJD.js} +4 -4
  8. package/dist/{chunk-KMZENCEP.js.map → chunk-DHJB4UJD.js.map} +1 -1
  9. package/dist/{chunk-IOYZC7SA.js → chunk-DJAXXLN6.js} +3 -3
  10. package/dist/{chunk-IOYZC7SA.js.map → chunk-DJAXXLN6.js.map} +1 -1
  11. package/dist/{chunk-3BXKTWWD.js → chunk-FB2G4LNH.js} +5 -5
  12. package/dist/{chunk-3BXKTWWD.js.map → chunk-FB2G4LNH.js.map} +1 -1
  13. package/dist/{chunk-E63VD25L.js → chunk-HQPU73WV.js} +4 -4
  14. package/dist/{chunk-E63VD25L.js.map → chunk-HQPU73WV.js.map} +1 -1
  15. package/dist/{chunk-RCF7HTG5.js → chunk-IRNF274I.js} +5 -5
  16. package/dist/chunk-IRNF274I.js.map +1 -0
  17. package/dist/{chunk-O5W3QWJ6.js → chunk-J44FJ7PH.js} +3 -3
  18. package/dist/{chunk-O5W3QWJ6.js.map → chunk-J44FJ7PH.js.map} +1 -1
  19. package/dist/{chunk-TWLJQE75.js → chunk-MRAJ45IM.js} +4 -4
  20. package/dist/{chunk-TWLJQE75.js.map → chunk-MRAJ45IM.js.map} +1 -1
  21. package/dist/{chunk-5HUEBSIS.js → chunk-N66NC6QK.js} +120 -24
  22. package/dist/chunk-N66NC6QK.js.map +1 -0
  23. package/dist/{chunk-SXNAUSEB.js → chunk-OZMSXYBX.js} +4 -4
  24. package/dist/{chunk-SXNAUSEB.js.map → chunk-OZMSXYBX.js.map} +1 -1
  25. package/dist/{chunk-LBAE6FP6.js → chunk-SZEOTXRZ.js} +4 -4
  26. package/dist/{chunk-LBAE6FP6.js.map → chunk-SZEOTXRZ.js.map} +1 -1
  27. package/dist/chunk-V6PY7C6S.js +18 -0
  28. package/dist/chunk-V6PY7C6S.js.map +1 -0
  29. package/dist/{chunk-MKKQE3TM.js → chunk-YPFSRZ3T.js} +4 -4
  30. package/dist/{chunk-MKKQE3TM.js.map → chunk-YPFSRZ3T.js.map} +1 -1
  31. package/dist/{chunk-NJPHZBLI.js → chunk-YWTOW7PZ.js} +5 -5
  32. package/dist/{chunk-NJPHZBLI.js.map → chunk-YWTOW7PZ.js.map} +1 -1
  33. package/dist/{chunk-VTDBWU6H.js → chunk-YZJUPYPO.js} +3 -3
  34. package/dist/{chunk-VTDBWU6H.js.map → chunk-YZJUPYPO.js.map} +1 -1
  35. package/dist/components/autocomplete/index.js +4 -3
  36. package/dist/components/autocomplete/index.js.map +1 -1
  37. package/dist/components/calendar-heatmap/calendar-heatmap-grid.d.ts +94 -0
  38. package/dist/components/calendar-heatmap/calendar-heatmap-grid.d.ts.map +1 -0
  39. package/dist/components/calendar-heatmap/calendar-heatmap.d.ts +76 -0
  40. package/dist/components/calendar-heatmap/calendar-heatmap.d.ts.map +1 -0
  41. package/dist/components/calendar-heatmap/index.d.ts +2 -0
  42. package/dist/components/calendar-heatmap/index.d.ts.map +1 -0
  43. package/dist/components/calendar-heatmap/index.js +311 -0
  44. package/dist/components/calendar-heatmap/index.js.map +1 -0
  45. package/dist/components/camera/index.js +6 -5
  46. package/dist/components/clipboard/index.js +1 -1
  47. package/dist/components/code-block/chrome.js +4 -4
  48. package/dist/components/code-block/index.js +5 -5
  49. package/dist/components/combobox/index.js +4 -3
  50. package/dist/components/combobox-list/index.js +6 -5
  51. package/dist/components/data-table/index.js +16 -16
  52. package/dist/components/date-picker/index.js +7 -6
  53. package/dist/components/date-picker/index.js.map +1 -1
  54. package/dist/components/hover-card/hover-card.d.ts +44 -26
  55. package/dist/components/hover-card/hover-card.d.ts.map +1 -1
  56. package/dist/components/hover-card/index.js +35 -53
  57. package/dist/components/hover-card/index.js.map +1 -1
  58. package/dist/components/input/index.js +1 -1
  59. package/dist/components/input/input.d.ts.map +1 -1
  60. package/dist/components/menu/index.js +3 -3
  61. package/dist/components/menu/menu.d.ts +7 -5
  62. package/dist/components/menu/menu.d.ts.map +1 -1
  63. package/dist/components/multi-combobox-list/index.js +6 -5
  64. package/dist/components/multi-select/index.js +5 -4
  65. package/dist/components/multi-select/index.js.map +1 -1
  66. package/dist/components/navigation-progress/index.d.ts +2 -0
  67. package/dist/components/navigation-progress/index.d.ts.map +1 -0
  68. package/dist/components/navigation-progress/index.js +133 -0
  69. package/dist/components/navigation-progress/index.js.map +1 -0
  70. package/dist/components/navigation-progress/navigation-progress.d.ts +46 -0
  71. package/dist/components/navigation-progress/navigation-progress.d.ts.map +1 -0
  72. package/dist/components/number-input/index.js +4 -3
  73. package/dist/components/number-input/number-input.d.ts.map +1 -1
  74. package/dist/components/password-input/index.js +1 -1
  75. package/dist/components/photo-capture/index.js +6 -5
  76. package/dist/components/photo-capture/index.js.map +1 -1
  77. package/dist/components/pills-input/index.js +2 -2
  78. package/dist/components/pin-input/index.js +1 -1
  79. package/dist/components/popover/index.d.ts +1 -1
  80. package/dist/components/popover/index.d.ts.map +1 -1
  81. package/dist/components/popover/index.js +2 -1
  82. package/dist/components/popover/popover.d.ts +44 -29
  83. package/dist/components/popover/popover.d.ts.map +1 -1
  84. package/dist/components/schedule/index.js +2 -2
  85. package/dist/components/select/index.js +5 -4
  86. package/dist/components/spotlight/index.js +5 -4
  87. package/dist/components/spotlight/index.js.map +1 -1
  88. package/dist/components/tags-input/index.js +4 -3
  89. package/dist/components/tags-input/index.js.map +1 -1
  90. package/dist/components/text-input/index.js +1 -1
  91. package/dist/components/textarea/index.js +1 -1
  92. package/dist/components/time-input/index.js +5 -4
  93. package/dist/components/time-input/index.js.map +1 -1
  94. package/dist/components/tooltip/index.js +2 -2
  95. package/dist/components/tree-multi-select/index.js +5 -4
  96. package/dist/components/tree-multi-select/index.js.map +1 -1
  97. package/dist/components/tree-select/index.js +4 -3
  98. package/dist/components/tree-select/index.js.map +1 -1
  99. package/dist/index.js +2 -2
  100. package/dist/lib/placement.d.ts +42 -1
  101. package/dist/lib/placement.d.ts.map +1 -1
  102. package/dist/lib/slide-on-switch.d.ts +69 -0
  103. package/dist/lib/slide-on-switch.d.ts.map +1 -0
  104. package/package.json +1 -1
  105. package/src/as-child.contract.test.tsx +4 -0
  106. package/src/components/calendar-heatmap/calendar-heatmap-grid.test.ts +186 -0
  107. package/src/components/calendar-heatmap/calendar-heatmap-grid.ts +192 -0
  108. package/src/components/calendar-heatmap/calendar-heatmap.test.tsx +180 -0
  109. package/src/components/calendar-heatmap/calendar-heatmap.tsx +385 -0
  110. package/src/components/calendar-heatmap/index.ts +11 -0
  111. package/src/components/hover-card/hover-card.tsx +89 -167
  112. package/src/components/input/input.test.tsx +23 -0
  113. package/src/components/input/input.tsx +10 -6
  114. package/src/components/menu/menu.tsx +16 -9
  115. package/src/components/navigation-progress/index.ts +14 -0
  116. package/src/components/navigation-progress/navigation-progress.test.tsx +184 -0
  117. package/src/components/navigation-progress/navigation-progress.tsx +228 -0
  118. package/src/components/number-input/number-input.tsx +3 -4
  119. package/src/components/popover/index.ts +2 -0
  120. package/src/components/popover/popover.test.tsx +131 -0
  121. package/src/components/popover/popover.tsx +191 -53
  122. package/src/lib/placement.test.ts +37 -0
  123. package/src/lib/placement.ts +60 -1
  124. package/src/lib/slide-on-switch.ts +99 -0
  125. package/dist/chunk-45QRQKRC.js.map +0 -1
  126. package/dist/chunk-5HUEBSIS.js.map +0 -1
  127. package/dist/chunk-G52U24GR.js +0 -10
  128. package/dist/chunk-G52U24GR.js.map +0 -1
  129. package/dist/chunk-RCF7HTG5.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/photo-capture/photo-capture-machine.ts","../../../src/components/photo-capture/use-photo-capture.ts","../../../src/components/photo-capture/photo-capture.tsx"],"names":["match","crop","CameraIcon","useRef"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDO,IAAM,wBAAA,GAA8C,EAAE,IAAA,EAAM,QAAA,EAAU,OAAO,KAAA,EAAM;AAE1F,IAAM,IAAA,GAAO,CAAC,KAAA,EAAa,MAAA,MAAmD;AAAA,EAC5E,IAAA,EAAM,MAAA;AAAA,EACN,KAAA,EAAO,IAAA;AAAA,EACP,KAAA;AAAA,EACA,MAAA;AAAA,EACA,IAAA,EAAM,KAAA;AAAA,EACN,MAAA,EAAQ;AACV,CAAA,CAAA;AAMO,IAAM,qBAAqB,CAChC,KAAA,EACA,UAEA,KAAA,CAAM,KAAK,EACR,UAAA,EAA8B,CAC9B,KAAK,EAAE,IAAA,EAAM,QAAO,EAAG,MAAO,MAAM,IAAA,KAAS,QAAA,GAAW,EAAE,IAAA,EAAM,MAAA,EAAQ,OAAO,IAAA,EAAK,GAAI,KAAM,CAAA,CAC9F,IAAA,CAAK,EAAE,IAAA,EAAM,MAAA,IAAU,CAAC,EAAE,OAAM,KAAO,KAAA,CAAM,SAAS,MAAA,GAAS,IAAA,CAAK,OAAO,QAAQ,CAAA,GAAI,KAAM,CAAA,CAC7F,IAAA;AAAA,EAAK,EAAE,MAAM,MAAA,EAAO;AAAA,EAAG,CAAC,EAAE,KAAA,EAAO,MAAA,EAAO;AAAA;AAAA,IAEvC,KAAA,CAAM,SAAS,MAAA,IAAU,KAAA,CAAM,OAAO,KAAA,GAAQ,IAAA,CAAK,OAAO,MAAM;AAAA;AAClE,CAAA,CACC,IAAA;AAAA,EAAK,EAAE,MAAM,QAAA,EA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AAM,gBAAA;AAAA,EACN,IAAA,EAAM,gBAAA;AAAA,EACN,MAAA,EAAQ,kBAAA;AAAA,EACR,OAAA,EAAS;AACX,CAAC","file":"index.js","sourcesContent":["import { match, P } from \"ts-pattern\"\n\n/**\n * PhotoCapture's steps, kept pure so every transition is unit-tested without\n * a camera or a canvas: `usePhotoCapture` feeds it what the parts report and\n * renders whatever it returns. The camera and the cropper keep their own\n * state; this only knows which of them is on screen, and with which photo.\n */\n\n/**\n * - `source`: the choice, camera or file. The first step, and where a used photo returns to.\n * - `live`: the in-page camera.\n * - `crop`: the photo, taken or picked, in the cropper, until it's used or retaken.\n */\nexport type PhotoCaptureStep = \"source\" | \"live\" | \"crop\"\n\n/**\n * Where the photo in the cropper came from, which decides what \"retake\"\n * means: the in-page camera again, the phone's camera app again, or another\n * file.\n */\nexport type PhotoCaptureOrigin = \"camera\" | \"native\" | \"file\"\n\nexport type PhotoCaptureState =\n | {\n step: \"source\"\n /** Whether a step was ever left: `false` on mount, so nothing steals focus as the page loads. */\n moved: boolean\n }\n | { step: \"live\"; moved: true }\n | {\n step: \"crop\"\n moved: true\n photo: File\n origin: PhotoCaptureOrigin\n /** The crop is being exported. */\n busy: boolean\n /** The last export failed. */\n failed: boolean\n }\n\nexport type PhotoCaptureEvent =\n /** \"Take photo\", in the page: the camera opens. */\n | { type: \"open\" }\n /** The shutter's photo. */\n | { type: \"take\"; photo: File }\n /** A file from the picker, or from the phone's camera app. */\n | { type: \"pick\"; photo: File; origin: Exclude<PhotoCaptureOrigin, \"camera\"> }\n /** Back to the in-page camera, for another shot. */\n | { type: \"retake\" }\n /** \"Use photo\": the export starts. */\n | { type: \"confirm\" }\n | { type: \"fail\" }\n /** The File went out: back to the start. */\n | { type: \"done\" }\n | { type: \"reset\" }\n\nexport const initialPhotoCaptureState: PhotoCaptureState = { step: \"source\", moved: false }\n\nconst crop = (photo: File, origin: PhotoCaptureOrigin): PhotoCaptureState => ({\n step: \"crop\",\n moved: true,\n photo,\n origin,\n busy: false,\n failed: false,\n})\n\n/**\n * The next state. An event that doesn't apply to the current step (a late\n * shutter after a file was picked, a double \"Use photo\") leaves it as it is.\n */\nexport const reducePhotoCapture = (\n state: PhotoCaptureState,\n event: PhotoCaptureEvent,\n): PhotoCaptureState =>\n match(event)\n .returnType<PhotoCaptureState>()\n .with({ type: \"open\" }, () => (state.step === \"source\" ? { step: \"live\", moved: true } : state))\n .with({ type: \"take\" }, ({ photo }) => (state.step === \"live\" ? crop(photo, \"camera\") : state))\n .with({ type: \"pick\" }, ({ photo, origin }) =>\n // From any step, but never over an export in flight.\n state.step === \"crop\" && state.busy ? state : crop(photo, origin),\n )\n .with({ type: \"retake\" }, () =>\n match(state)\n .returnType<PhotoCaptureState>()\n .with({ step: \"crop\", origin: \"camera\", busy: false }, () => ({\n step: \"live\",\n moved: true,\n }))\n .otherwise(() => state),\n )\n .with({ type: \"confirm\" }, () =>\n match(state)\n .with({ step: \"crop\", busy: false }, (s) => ({ ...s, busy: true, failed: false }))\n .otherwise(() => state),\n )\n .with({ type: \"fail\" }, () =>\n match(state)\n .with({ step: \"crop\", busy: true }, (s) => ({ ...s, busy: false, failed: true }))\n .otherwise(() => state),\n )\n .with({ type: \"done\" }, () => (state.step === \"crop\" ? { step: \"source\", moved: true } : state))\n .with({ type: \"reset\" }, () =>\n match(state)\n .returnType<PhotoCaptureState>()\n .with({ step: \"crop\", busy: true }, () => state)\n .with({ step: P.union(\"live\", \"crop\") }, () => ({ step: \"source\", moved: true }))\n .otherwise(() => state),\n )\n .exhaustive()\n","\"use client\"\n\nimport { useCallback, useReducer, useRef } from \"react\"\nimport { match } from \"ts-pattern\"\nimport { imageFile } from \"../../lib/image-file\"\nimport type { Ratio } from \"../../lib/ratio\"\nimport { useIsomorphicLayoutEffect } from \"../../lib/use-isomorphic-layout-effect\"\nimport { useMediaQuery } from \"../../lib/use-media-query\"\nimport type { CameraFacing, CameraResolution } from \"../camera/camera-machine\"\nimport { type UseCameraResult, useCamera } from \"../camera/use-camera\"\nimport {\n initialPhotoCaptureState,\n type PhotoCaptureOrigin,\n type PhotoCaptureStep,\n reducePhotoCapture,\n} from \"./photo-capture-machine\"\n\n/**\n * How the photo is taken:\n * - `live`: the camera in the page, a viewfinder and a shutter.\n * - `native`: the phone's own camera app, through a file input with `capture`. No viewfinder in the page.\n * - `auto`: `native` under a coarse pointer (a phone, a tablet), `live` otherwise.\n */\nexport type PhotoCaptureCamera = \"live\" | \"native\" | \"auto\"\n\nexport type PhotoCaptureOutput = {\n /** The encoding. A browser that can't encode it falls back to PNG, and the File says so. Defaults to `image/jpeg`. */\n type?: string\n /** 0–1, for JPEG and WebP. Defaults to 0.9. */\n quality?: number\n /** The longest side, in px: a larger crop is scaled down to fit, a smaller one is kept as is. */\n size?: number\n}\n\nexport type UsePhotoCaptureOptions = {\n /** Receives the cropped photo once \"Use photo\" is pressed. Nothing is emitted before. */\n onChange?: (file: File) => void\n /** The in-page camera, the phone's camera app, or whichever suits the device. Defaults to `auto`. */\n camera?: PhotoCaptureCamera\n /** The camera to open: the front one (`user`, the default) or the back one. */\n facing?: CameraFacing\n /** The crop's width / height, and the viewfinder's box. Free when unset; a circle is always 1. */\n ratio?: Ratio\n /** The capture size to aim for, for the in-page camera. See `useCamera`. */\n resolution?: CameraResolution\n /** Saves a selfie as the preview shows it, mirrored. Off by default: a saved selfie reads the right way round. */\n mirror?: boolean\n /** The File's encoding and size. */\n output?: PhotoCaptureOutput\n}\n\n/** What `confirm()` hands to the cropper's export: `ImageCropper`'s `getCroppedImage`. */\nexport type PhotoCaptureCrop = (options: {\n type: string\n quality: number\n maxSize?: { width: number; height: number }\n}) => Promise<Blob | string | null>\n\nexport type UsePhotoCaptureResult = {\n step: PhotoCaptureStep\n /** `auto` resolved for this device. */\n mode: \"live\" | \"native\"\n /** The photo in the cropper, taken or picked, before it's cropped. */\n photo: File | null\n /** Where `photo` came from, which decides what a retake means. */\n origin: PhotoCaptureOrigin | null\n /** The crop is being exported. */\n busy: boolean\n /** The last export failed. */\n failed: boolean\n /** Whether a step was ever left, so a part knows to move focus when it appears. */\n moved: boolean\n /** The in-page camera. Lazy: it turns on with `open()`, never on its own. */\n camera: UseCameraResult\n facing: CameraFacing\n ratio: Ratio | undefined\n mirror: boolean\n /** Opens the in-page camera. */\n open: () => void\n /** The shutter's photo: `Camera.Root`'s `onCapture`. */\n take: (photo: File) => void\n /** A picked file (the first of `files`), from the library or, with `native`, the phone's camera app. */\n pick: (files: readonly File[], origin?: Exclude<PhotoCaptureOrigin, \"camera\">) => void\n /** Back to the in-page camera for another shot. */\n retake: () => void\n /** Exports the crop through `crop`, then hands the File to `onChange` and starts over. Resolves the File, or `null` if the export failed. */\n confirm: (crop: PhotoCaptureCrop) => Promise<File | null>\n /** Back to the source step, the camera off. */\n reset: () => void\n}\n\n/**\n * PhotoCapture as plain state plus handlers: which step is on screen, the\n * photo in it, and the in-page camera. The steps are a pure reducer\n * (`reducePhotoCapture`); the camera is `useCamera`, mounted lazily so it\n * never lights up before \"Take photo\"; the crop is whatever `ImageCropper`\n * exports. This hook only wires them together.\n *\n * const flow = usePhotoCapture({ ratio: 1, output: { size: 512 }, onChange: upload })\n * <PhotoCapture.Root flow={flow} shape=\"circle\">…</PhotoCapture.Root>\n *\n * The camera turns off when the photo is taken, when a file is picked\n * instead, on `reset()` and on unmount. Nothing is uploaded: `onChange`\n * gets a File and the rest is yours.\n */\nexport function usePhotoCapture({\n onChange,\n camera: wanted = \"auto\",\n facing = \"user\",\n ratio,\n resolution,\n mirror = false,\n output,\n}: UsePhotoCaptureOptions = {}): UsePhotoCaptureResult {\n const [state, dispatch] = useReducer(reducePhotoCapture, initialPhotoCaptureState)\n const camera = useCamera({ facing, ratio, resolution, lazy: true })\n const coarse = useMediaQuery(\"(pointer: coarse)\")\n const mode = match(wanted)\n .returnType<\"live\" | \"native\">()\n .with(\"auto\", () => (coarse ? \"native\" : \"live\"))\n .otherwise((chosen) => chosen)\n\n // Read when the export resolves, not when it started: the latest callback and encoding.\n const latest = useRef({ onChange, output })\n useIsomorphicLayoutEffect(() => {\n latest.current = { onChange, output }\n })\n\n const { start, stop } = camera\n\n const open = useCallback(() => {\n dispatch({ type: \"open\" })\n void start()\n }, [start])\n\n const take = useCallback((photo: File) => dispatch({ type: \"take\", photo }), [])\n\n const pick = useCallback(\n (files: readonly File[], origin: Exclude<PhotoCaptureOrigin, \"camera\"> = \"file\") => {\n const [photo] = files\n if (!photo) return\n // A file instead of the shot: the camera goes off with the viewfinder.\n stop()\n dispatch({ type: \"pick\", photo, origin })\n },\n [stop],\n )\n\n const retake = useCallback(() => {\n if (state.step !== \"crop\" || state.origin !== \"camera\" || state.busy) return\n dispatch({ type: \"retake\" })\n void start()\n }, [state, start])\n\n const confirm = useCallback(async (crop: PhotoCaptureCrop) => {\n dispatch({ type: \"confirm\" })\n const { type = \"image/jpeg\", quality = 0.9, size } = latest.current.output ?? {}\n const blob = await crop({\n type,\n quality,\n ...(size ? { maxSize: { width: size, height: size } } : {}),\n }).catch(() => null)\n if (!(blob instanceof Blob)) {\n // A tainted canvas, an image that never loaded: the crop step says so.\n dispatch({ type: \"fail\" })\n return null\n }\n const file = imageFile(blob, \"photo\")\n latest.current.onChange?.(file)\n dispatch({ type: \"done\" })\n return file\n }, [])\n\n const reset = useCallback(() => {\n stop()\n dispatch({ type: \"reset\" })\n }, [stop])\n\n const crop = state.step === \"crop\" ? state : null\n return {\n step: state.step,\n mode,\n photo: crop?.photo ?? null,\n origin: crop?.origin ?? null,\n busy: crop?.busy ?? false,\n failed: crop?.failed ?? false,\n moved: state.moved,\n camera,\n facing,\n ratio,\n mirror,\n open,\n take,\n pick,\n retake,\n confirm,\n reset,\n }\n}\n","\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react/factory\"\nimport { Camera as CameraIcon, Check, ImageUp, RotateCcw } from \"lucide-react\"\nimport {\n type ComponentPropsWithoutRef,\n createContext,\n type ReactNode,\n type Ref,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from \"react\"\nimport { match } from \"ts-pattern\"\nimport { composeChildren, type NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport { useDirectionCheck } from \"../../lib/intl\"\nimport { useMergedRefs } from \"../../lib/merge-refs\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { useObjectUrl } from \"../../lib/use-object-url\"\nimport { Button, type ButtonProps } from \"../button/button\"\nimport { Camera, type CameraIconSlot, type CameraTranslations } from \"../camera/camera\"\nimport { FileTrigger } from \"../file-trigger/file-trigger\"\nimport {\n ImageCropper,\n type ImageCropperTranslations,\n useImageCropperContext,\n} from \"../image-cropper/image-cropper\"\nimport {\n type UsePhotoCaptureOptions,\n type UsePhotoCaptureResult,\n usePhotoCapture,\n} from \"./use-photo-capture\"\n\n/**\n * PhotoCapture — take a photo with the camera, or pick a file, crop it, and\n * get a File back. The brick a profile picture, a badge photo or a scanned\n * document is added with.\n *\n * <PhotoCapture shape=\"circle\" output={{ size: 512 }} onChange={(file) => setAvatar(file)} />\n *\n * It's a composition, not a new widget: `Camera` takes the photo,\n * `FileTrigger` picks a file (or opens a phone's camera app), `ImageCropper`\n * crops it, and `usePhotoCapture`, a small step reducer, says which of them\n * is on screen. Every part reads that hook, so a layout of your own drives\n * the same flow:\n *\n * const flow = usePhotoCapture({ ratio: \"3/4\", onChange: setBadge })\n * <PhotoCapture.Root flow={flow} shape=\"rectangle\">\n * <PhotoCapture.Source />\n * <PhotoCapture.Live />\n * <PhotoCapture.Crop />\n * </PhotoCapture.Root>\n *\n * It renders inline. In a modal, it's the modal's content: the camera stops\n * when it unmounts. Nothing is uploaded; `onChange` gets the cropped File\n * after \"Use photo\", and never before.\n */\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\n/** A rectangle, or a circle for a face. Drives the camera's guide and the cropper. */\nexport type PhotoCaptureShape = \"rectangle\" | \"circle\"\n\nexport type PhotoCaptureOwnTranslations = {\n /** The source step's heading. */\n sourceTitle?: string\n sourceBody?: string\n /** Takes a photo: opens the camera in the page, or the phone's camera app. */\n take?: string\n /** Picks a file, next to the in-page camera. */\n file?: string\n /** Picks from the phone's library, next to its camera app. */\n library?: string\n /** Back to the camera, from the crop. */\n retake?: string\n /** Picks another file, from the crop of a picked one. */\n another?: string\n /** Hands the crop to `onChange`. */\n confirm?: string\n /** Shown, as an alert, when the crop couldn't be exported. */\n failed?: string\n /** Announced politely when the photo reaches the cropper, and once it's been used. */\n announceCrop?: string\n announceDone?: string\n}\n\n/**\n * One map for everything PhotoCapture shows: its own strings, the camera's\n * (`CameraTranslations`) and the cropper's (`ImageCropperTranslations`).\n */\nexport type PhotoCaptureTranslations = PhotoCaptureOwnTranslations &\n CameraTranslations &\n ImageCropperTranslations\n\nexport const DEFAULT_TRANSLATIONS: Required<PhotoCaptureOwnTranslations> = {\n sourceTitle: \"Add a photo\",\n sourceBody: \"Nothing leaves this page until you choose Use photo.\",\n take: \"Take photo\",\n file: \"Choose a file\",\n library: \"Choose from library\",\n retake: \"Retake\",\n another: \"Choose another\",\n confirm: \"Use photo\",\n failed: \"The photo couldn't be prepared. Try again, or choose another.\",\n announceCrop: \"Photo ready to crop\",\n announceDone: \"Photo added\",\n}\n\nexport type PhotoCaptureIconSlot = \"take\" | \"file\" | \"retake\" | \"confirm\"\n/** PhotoCapture's own icons, and the camera's (`shutter`, `flip`, `start`, `retry`, `off`). */\nexport type PhotoCaptureIcons = IconMap<PhotoCaptureIconSlot | CameraIconSlot>\n\nexport const DEFAULT_ICONS: Record<PhotoCaptureIconSlot, ReactNode> = {\n take: <CameraIcon aria-hidden className={iconStroke} />,\n file: <ImageUp aria-hidden className={iconStroke} />,\n retake: <RotateCcw aria-hidden className={iconStroke} />,\n confirm: <Check aria-hidden className={iconStroke} />,\n}\n\ntype Shared = {\n flow: UsePhotoCaptureResult\n t: Required<PhotoCaptureOwnTranslations>\n /** The `translations` prop as given, for the camera and the cropper to merge with their own defaults. */\n translations: PhotoCaptureTranslations | undefined\n icons: Record<PhotoCaptureIconSlot, ReactNode>\n /** The `icons` prop as given, for the camera. */\n cameraIcons: PhotoCaptureIcons | undefined\n shape: PhotoCaptureShape\n accept: string | string[]\n color: Color\n announce: (message: string) => void\n}\n\nconst PhotoCaptureContext = createContext<Shared | null>(null)\n\n/** The nearest `PhotoCapture.Root`'s flow, translations and icons, for a part of your own. */\nexport const usePhotoCaptureContext = (): Shared => {\n const shared = useContext(PhotoCaptureContext)\n if (!shared)\n throw new Error(\"[@42/ui-react] PhotoCapture parts must be inside <PhotoCapture.Root>.\")\n return shared\n}\n\n/** What the camera encodes the shot as, on its way to the cropper, which re-encodes it as `output`. */\nconst SHOT = { type: \"image/jpeg\", quality: 0.95 }\n\n// ---------------------------------------------------------------------------\n// Root\n// ---------------------------------------------------------------------------\n\nexport type PhotoCaptureRootProps = Omit<HTMLArkProps<\"div\">, \"color\" | \"onChange\"> &\n WithTestId & {\n /** The flow, from `usePhotoCapture()`. */\n flow: UsePhotoCaptureResult\n /** A rectangle, or a circle for a face: the camera's guide and the crop. Defaults to `rectangle`. */\n shape?: PhotoCaptureShape\n /** The file types the pickers offer. Defaults to `image/*`. */\n accept?: string | string[]\n translations?: PhotoCaptureTranslations\n icons?: PhotoCaptureIcons\n /** The palette of the buttons, the shutter, the guide and the crop. `brand` by default. */\n color?: Color\n ref?: Ref<HTMLDivElement>\n }\n\n/** Announces each step, politely, from a visually hidden region. */\nconst Announcer = ({ message }: { message: string }) => (\n <div role=\"status\" aria-live=\"polite\" className=\"sr-only\">\n {message}\n </div>\n)\n\nconst PhotoCaptureRoot = ({\n flow,\n shape = \"rectangle\",\n accept = \"image/*\",\n translations,\n icons,\n color = \"brand\",\n className,\n testId,\n asChild,\n children,\n ref,\n ...rest\n}: PhotoCaptureRootProps) => {\n const direction = useDirectionCheck()\n const [message, setMessage] = useState(\"\")\n\n const shared = useMemo<Shared>(\n () => ({\n flow,\n t: { ...DEFAULT_TRANSLATIONS, ...translations },\n translations,\n icons: mergeIcons(DEFAULT_ICONS, icons),\n cameraIcons: icons,\n shape,\n accept,\n color,\n announce: setMessage,\n }),\n [flow, translations, icons, shape, accept, color],\n )\n\n // The live step announces itself through the camera's own region.\n useEffect(() => {\n if (flow.step === \"crop\") setMessage(shared.t.announceCrop)\n }, [flow.step, shared.t])\n\n const rootRef = useMergedRefs(ref, direction)\n return (\n <PhotoCaptureContext value={shared}>\n <ark.div\n ref={rootRef}\n asChild={asChild}\n data-color={color}\n data-step={flow.step}\n data-mode={flow.mode}\n className={cn(\"flex w-full flex-col gap-3\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {composeChildren(asChild, children, (own) => (\n <>\n {own}\n <Announcer message={message} />\n </>\n ))}\n </ark.div>\n </PhotoCaptureContext>\n )\n}\n\n// ---------------------------------------------------------------------------\n// Actions\n// ---------------------------------------------------------------------------\n\nexport type PhotoCaptureActionProps = NoAsChild<\n Omit<ButtonProps, \"onClick\" | \"onSelect\" | \"children\"> & {\n /** Replaces the label from `translations`. */\n children?: ReactNode\n }\n>\n\n/**\n * Takes a photo. With the in-page camera, it opens the `live` step; with\n * `native`, it opens the phone's camera app (`capture`), whose photo goes\n * straight to the crop. Hidden where the in-page camera can't work at all.\n */\nconst PhotoCaptureTake = ({ children, asChild: _asChild, ...rest }: PhotoCaptureActionProps) => {\n const { flow, t, icons, accept } = usePhotoCaptureContext()\n const label = children ?? t.take\n return match(flow.mode)\n .with(\"native\", () => (\n <FileTrigger\n accept={accept}\n capture={flow.facing}\n onSelect={(files) => flow.pick(files, \"native\")}\n startSlot={icons.take}\n {...rest}\n >\n {label}\n </FileTrigger>\n ))\n .with(\"live\", () =>\n flow.camera.status === \"unsupported\" ? null : (\n <Button startSlot={icons.take} onClick={flow.open} {...rest}>\n {label}\n </Button>\n ),\n )\n .exhaustive()\n}\n\n/**\n * Picks a file: \"Choose a file\" beside the in-page camera, \"Choose from\n * library\" beside the phone's camera app. Always there, at the same weight\n * as the camera, for anyone whose camera won't do.\n */\nconst PhotoCaptureFile = ({ children, asChild: _asChild, ...rest }: PhotoCaptureActionProps) => {\n const { flow, t, icons, accept } = usePhotoCaptureContext()\n return (\n <FileTrigger\n accept={accept}\n onSelect={(files) => flow.pick(files, \"file\")}\n startSlot={icons.file}\n {...rest}\n >\n {children ?? (flow.mode === \"native\" ? t.library : t.file)}\n </FileTrigger>\n )\n}\n\n/**\n * Back for another photo, the way this one came: the in-page camera again,\n * the phone's camera app again, or another file (\"Choose another\").\n */\nconst PhotoCaptureRetake = ({ children, asChild: _asChild, ...rest }: PhotoCaptureActionProps) => {\n const { flow, t, icons, accept } = usePhotoCaptureContext()\n return match(flow.origin)\n .with(\"camera\", () => (\n <Button\n variant=\"light\"\n startSlot={icons.retake}\n disabled={flow.busy}\n onClick={flow.retake}\n {...rest}\n >\n {children ?? t.retake}\n </Button>\n ))\n .with(\"native\", () => (\n <FileTrigger\n variant=\"light\"\n accept={accept}\n capture={flow.facing}\n disabled={flow.busy}\n onSelect={(files) => flow.pick(files, \"native\")}\n startSlot={icons.retake}\n {...rest}\n >\n {children ?? t.retake}\n </FileTrigger>\n ))\n .with(\"file\", () => (\n <FileTrigger\n variant=\"light\"\n accept={accept}\n disabled={flow.busy}\n onSelect={(files) => flow.pick(files, \"file\")}\n startSlot={icons.file}\n {...rest}\n >\n {children ?? t.another}\n </FileTrigger>\n ))\n .with(null, () => null)\n .exhaustive()\n}\n\n/**\n * \"Use photo\": exports the crop as `output` says, hands the File to\n * `onChange`, and starts over. Inside `PhotoCapture.Crop`, which provides the\n * cropper it exports. Takes focus when it appears, so after the shutter (or a\n * pick) Enter uses the photo.\n */\nconst PhotoCaptureConfirm = ({\n id,\n children,\n asChild: _asChild,\n ...rest\n}: PhotoCaptureActionProps) => {\n const { flow, t, icons, announce } = usePhotoCaptureContext()\n const cropper = useImageCropperContext()\n // Button takes no ref: found by its id to move focus to it.\n const generated = useId()\n const button = id ?? generated\n\n // The crop is only ever reached by a user's step: the shutter or a pick.\n // Again after a failure, which disabled (and so blurred) the button.\n useEffect(() => {\n if (!flow.busy) document.getElementById(button)?.focus()\n }, [flow.busy, button])\n\n return (\n <Button\n id={button}\n startSlot={icons.confirm}\n loading={flow.busy}\n onClick={async () => {\n const file = await flow.confirm(cropper.getCroppedImage)\n if (file) announce(t.announceDone)\n }}\n {...rest}\n >\n {children ?? t.confirm}\n </Button>\n )\n}\n\n// ---------------------------------------------------------------------------\n// Steps\n// ---------------------------------------------------------------------------\n\nexport type PhotoCaptureSourceProps = NoAsChild<ComponentPropsWithoutRef<\"div\"> & WithTestId>\n\n/**\n * The first step: \"Take photo\" and the file picker, side by side at the same\n * weight, under a line that says nothing leaves the page. With `native`,\n * that's the phone's camera app and its library: two pickers, because\n * Android 14 and 15 hide the camera from a picker without `capture`.\n * Children replace the two buttons.\n */\nconst PhotoCaptureSource = ({\n className,\n testId,\n children,\n asChild: _asChild,\n ...rest\n}: PhotoCaptureSourceProps) => {\n const { flow, t } = usePhotoCaptureContext()\n const root = useRef<HTMLDivElement>(null)\n\n // Back here after a photo was used: focus goes to the first choice, not the page.\n useEffect(() => {\n if (flow.step === \"source\" && flow.moved)\n root.current?.querySelector<HTMLElement>(\"button:not(:disabled)\")?.focus()\n }, [flow.step, flow.moved])\n\n if (flow.step !== \"source\") return null\n return (\n <div\n ref={root}\n data-part=\"source\"\n className={cn(\n \"flex flex-col items-center justify-center gap-4 rounded-input border border-dashed p-6 text-center\",\n // The kit's hairline, dashed: FileUpload's dropzone.\n \"border-brand-900/20 dark:border-white/15\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n <div className=\"flex flex-col gap-1\">\n <p className=\"font-medium text-brand-950 text-md dark:text-white\">{t.sourceTitle}</p>\n <p className=\"text-black/50 text-sm dark:text-white/50\">{t.sourceBody}</p>\n </div>\n {/* Side by side when they fit, stacked full width when not: the same weight either way. */}\n <div className=\"grid w-full max-w-md grid-cols-[repeat(auto-fit,minmax(min(100%,11rem),1fr))] gap-2\">\n {children ?? (\n <>\n <PhotoCaptureTake />\n <PhotoCaptureFile />\n </>\n )}\n </div>\n </div>\n )\n}\n\nexport type PhotoCaptureLiveClassNames = {\n viewfinder?: string\n controls?: string\n}\n\nexport type PhotoCaptureLiveProps = NoAsChild<\n Omit<ComponentPropsWithoutRef<\"div\">, \"children\" | \"color\"> &\n WithTestId & {\n classNames?: PhotoCaptureLiveClassNames\n }\n>\n\n/**\n * The in-page camera: `Camera`'s viewfinder with a guide in the flow's\n * shape, its status panels, the shutter, the camera switch and picker, and\n * the file picker beside the shutter. Every panel (asking, refused, busy, no\n * camera) offers the file picker too.\n *\n * Focus comes here as the step opens, and moves to the shutter once the\n * picture is live.\n */\nconst PhotoCaptureLive = ({\n className,\n classNames,\n testId,\n asChild: _asChild,\n ...rest\n}: PhotoCaptureLiveProps) => {\n const { flow, translations, cameraIcons, shape, color } = usePhotoCaptureContext()\n const root = useRef<HTMLDivElement>(null)\n const shutter = useRef<HTMLButtonElement>(null)\n /** Whether the shutter should take focus once it's enabled: after \"Take photo\" or a retake. */\n const pending = useRef(false)\n const status = flow.camera.status\n\n useEffect(() => {\n if (flow.step !== \"live\" || !flow.moved) return\n pending.current = true\n // The button that brought us here is gone: hold focus in the step until the shutter can take it.\n root.current?.focus()\n }, [flow.step, flow.moved])\n\n useEffect(() => {\n if (!pending.current || status !== \"live\") return\n pending.current = false\n shutter.current?.focus()\n }, [status])\n\n if (flow.step !== \"live\") return null\n return (\n <Camera.Root\n ref={root}\n tabIndex={-1}\n camera={flow.camera}\n onCapture={flow.take}\n output={SHOT}\n mirror={flow.mirror}\n translations={translations}\n icons={cameraIcons}\n color={color}\n data-part=\"live\"\n className={cn(\"outline-none\", className)}\n testId={testId}\n {...rest}\n >\n <Camera.Viewfinder ratio={flow.ratio} className={classNames?.viewfinder}>\n <Camera.Guide shape={shape} ratio={shape === \"rectangle\" ? flow.ratio : undefined} />\n <Camera.Live className=\"absolute start-2 top-2 z-1\" />\n <Camera.Status>{() => <PhotoCaptureFile size=\"sm\" />}</Camera.Status>\n </Camera.Viewfinder>\n <div className={cn(\"grid grid-cols-[1fr_auto_1fr] items-center gap-3\", classNames?.controls)}>\n {/* While a panel is up, it carries the file picker. */}\n <div className=\"flex min-w-0 justify-start\">\n {status === \"live\" && <PhotoCaptureFile variant=\"light\" />}\n </div>\n <Camera.Shutter ref={shutter} />\n <div className=\"flex min-w-0 items-center justify-end gap-2\">\n <Camera.Devices className=\"min-w-0\" />\n <Camera.Flip />\n </div>\n </div>\n </Camera.Root>\n )\n}\n\nexport type PhotoCaptureCropClassNames = {\n viewport?: string\n controls?: string\n actions?: string\n}\n\nexport type PhotoCaptureCropProps = NoAsChild<\n Omit<ComponentPropsWithoutRef<\"div\">, \"color\"> &\n WithTestId & {\n classNames?: PhotoCaptureCropClassNames\n /** Replaces the Retake and Use photo buttons. `PhotoCapture.Confirm` must stay inside. */\n children?: ReactNode\n }\n>\n\n/**\n * The photo in `ImageCropper`, locked to the flow's ratio and shape, with\n * its zoom, rotate and flip controls, then Retake and Use photo. Taking the\n * photo and cropping it are one step: there's no review screen between.\n */\nconst PhotoCaptureCrop = ({\n className,\n classNames,\n testId,\n children,\n asChild: _asChild,\n ...rest\n}: PhotoCaptureCropProps) => {\n const { flow, t, translations, shape, color } = usePhotoCaptureContext()\n // One URL per photo, which is also the cropper's key: a new photo starts a new crop.\n const url = useObjectUrl(flow.photo)\n\n if (flow.step !== \"crop\" || !url) return null\n return (\n <ImageCropper.Root\n key={url}\n ratio={shape === \"circle\" ? 1 : flow.ratio}\n shape={shape}\n color={color}\n translations={translations}\n data-part=\"crop\"\n className={className}\n testId={testId}\n {...rest}\n >\n <ImageCropper.Viewport className={classNames?.viewport}>\n <ImageCropper.Image src={url} />\n <ImageCropper.Selection />\n </ImageCropper.Viewport>\n <ImageCropper.Controls className={classNames?.controls} />\n {flow.failed && (\n <p role=\"alert\" className={cn(TEXT_COLOR_CLASSES.error, \"text-sm\")}>\n {t.failed}\n </p>\n )}\n <div className={cn(\"flex flex-wrap items-center justify-end gap-2\", classNames?.actions)}>\n {children ?? (\n <>\n <PhotoCaptureRetake />\n <PhotoCaptureConfirm />\n </>\n )}\n </div>\n </ImageCropper.Root>\n )\n}\n\n// ---------------------------------------------------------------------------\n// Convenience\n// ---------------------------------------------------------------------------\n\nexport type PhotoCaptureClassNames = {\n source?: string\n live?: string\n viewfinder?: string\n crop?: string\n viewport?: string\n controls?: string\n actions?: string\n}\n\nexport type PhotoCaptureProps = NoAsChild<\n Omit<PhotoCaptureRootProps, \"flow\" | \"children\"> &\n UsePhotoCaptureOptions & {\n classNames?: PhotoCaptureClassNames\n }\n>\n\nconst PhotoCaptureComponent = ({\n onChange,\n camera,\n facing,\n ratio,\n resolution,\n mirror,\n output,\n classNames,\n asChild: _asChild,\n ...rest\n}: PhotoCaptureProps) => {\n const flow = usePhotoCapture({ onChange, camera, facing, ratio, resolution, mirror, output })\n return (\n <PhotoCaptureRoot flow={flow} {...rest}>\n <PhotoCaptureSource className={classNames?.source} />\n <PhotoCaptureLive\n className={classNames?.live}\n classNames={{ viewfinder: classNames?.viewfinder, controls: classNames?.controls }}\n />\n <PhotoCaptureCrop\n className={classNames?.crop}\n classNames={{\n viewport: classNames?.viewport,\n controls: classNames?.controls,\n actions: classNames?.actions,\n }}\n />\n </PhotoCaptureRoot>\n )\n}\n\nexport const PhotoCapture = Object.assign(PhotoCaptureComponent, {\n Root: PhotoCaptureRoot,\n Source: PhotoCaptureSource,\n Live: PhotoCaptureLive,\n Crop: PhotoCaptureCrop,\n Take: PhotoCaptureTake,\n File: PhotoCaptureFile,\n Retake: PhotoCaptureRetake,\n Confirm: PhotoCaptureConfirm,\n})\n"]}
1
+ {"version":3,"sources":["../../../src/components/photo-capture/photo-capture-machine.ts","../../../src/components/photo-capture/use-photo-capture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pure so every transition is unit-tested without\n * a camera or a canvas: `usePhotoCapture` feeds it what the parts report and\n * renders whatever it returns. The camera and the cropper keep their own\n * state; this only knows which of them is on screen, and with which photo.\n */\n\n/**\n * - `source`: the choice, camera or file. The first step, and where a used photo returns to.\n * - `live`: the in-page camera.\n * - `crop`: the photo, taken or picked, in the cropper, until it's used or retaken.\n */\nexport type PhotoCaptureStep = \"source\" | \"live\" | \"crop\"\n\n/**\n * Where the photo in the cropper came from, which decides what \"retake\"\n * means: the in-page camera again, the phone's camera app again, or another\n * file.\n */\nexport type PhotoCaptureOrigin = \"camera\" | \"native\" | \"file\"\n\nexport type PhotoCaptureState =\n | {\n step: \"source\"\n /** Whether a step was ever left: `false` on mount, so nothing steals focus as the page loads. */\n moved: boolean\n }\n | { step: \"live\"; moved: true }\n | {\n step: \"crop\"\n moved: true\n photo: File\n origin: PhotoCaptureOrigin\n /** The crop is being exported. */\n busy: boolean\n /** The last export failed. */\n failed: boolean\n }\n\nexport type PhotoCaptureEvent =\n /** \"Take photo\", in the page: the camera opens. */\n | { type: \"open\" }\n /** The shutter's photo. */\n | { type: \"take\"; photo: File }\n /** A file from the picker, or from the phone's camera app. */\n | { type: \"pick\"; photo: File; origin: Exclude<PhotoCaptureOrigin, \"camera\"> }\n /** Back to the in-page camera, for another shot. */\n | { type: \"retake\" }\n /** \"Use photo\": the export starts. */\n | { type: \"confirm\" }\n | { type: \"fail\" }\n /** The File went out: back to the start. */\n | { type: \"done\" }\n | { type: \"reset\" }\n\nexport const initialPhotoCaptureState: PhotoCaptureState = { step: \"source\", moved: false }\n\nconst crop = (photo: File, origin: PhotoCaptureOrigin): PhotoCaptureState => ({\n step: \"crop\",\n moved: true,\n photo,\n origin,\n busy: false,\n failed: false,\n})\n\n/**\n * The next state. An event that doesn't apply to the current step (a late\n * shutter after a file was picked, a double \"Use photo\") leaves it as it is.\n */\nexport const reducePhotoCapture = (\n state: PhotoCaptureState,\n event: PhotoCaptureEvent,\n): PhotoCaptureState =>\n match(event)\n .returnType<PhotoCaptureState>()\n .with({ type: \"open\" }, () => (state.step === \"source\" ? { step: \"live\", moved: true } : state))\n .with({ type: \"take\" }, ({ photo }) => (state.step === \"live\" ? crop(photo, \"camera\") : state))\n .with({ type: \"pick\" }, ({ photo, origin }) =>\n // From any step, but never over an export in flight.\n state.step === \"crop\" && state.busy ? state : crop(photo, origin),\n )\n .with({ type: \"retake\" }, () =>\n match(state)\n .returnType<PhotoCaptureState>()\n .with({ step: \"crop\", origin: \"camera\", busy: false }, () => ({\n step: \"live\",\n moved: true,\n }))\n .otherwise(() => state),\n )\n .with({ type: \"confirm\" }, () =>\n match(state)\n .with({ step: \"crop\", busy: false }, (s) => ({ ...s, busy: true, failed: false }))\n .otherwise(() => state),\n )\n .with({ type: \"fail\" }, () =>\n match(state)\n .with({ step: \"crop\", busy: true }, (s) => ({ ...s, busy: false, failed: true }))\n .otherwise(() => state),\n )\n .with({ type: \"done\" }, () => (state.step === \"crop\" ? { step: \"source\", moved: true } : state))\n .with({ type: \"reset\" }, () =>\n match(state)\n .returnType<PhotoCaptureState>()\n .with({ step: \"crop\", busy: true }, () => state)\n .with({ step: P.union(\"live\", \"crop\") }, () => ({ step: \"source\", moved: true }))\n .otherwise(() => state),\n )\n .exhaustive()\n","\"use client\"\n\nimport { useCallback, useReducer, useRef } from \"react\"\nimport { match } from \"ts-pattern\"\nimport { imageFile } from \"../../lib/image-file\"\nimport type { Ratio } from \"../../lib/ratio\"\nimport { useIsomorphicLayoutEffect } from \"../../lib/use-isomorphic-layout-effect\"\nimport { useMediaQuery } from \"../../lib/use-media-query\"\nimport type { CameraFacing, CameraResolution } from \"../camera/camera-machine\"\nimport { type UseCameraResult, useCamera } from \"../camera/use-camera\"\nimport {\n initialPhotoCaptureState,\n type PhotoCaptureOrigin,\n type PhotoCaptureStep,\n reducePhotoCapture,\n} from \"./photo-capture-machine\"\n\n/**\n * How the photo is taken:\n * - `live`: the camera in the page, a viewfinder and a shutter.\n * - `native`: the phone's own camera app, through a file input with `capture`. No viewfinder in the page.\n * - `auto`: `native` under a coarse pointer (a phone, a tablet), `live` otherwise.\n */\nexport type PhotoCaptureCamera = \"live\" | \"native\" | \"auto\"\n\nexport type PhotoCaptureOutput = {\n /** The encoding. A browser that can't encode it falls back to PNG, and the File says so. Defaults to `image/jpeg`. */\n type?: string\n /** 0–1, for JPEG and WebP. Defaults to 0.9. */\n quality?: number\n /** The longest side, in px: a larger crop is scaled down to fit, a smaller one is kept as is. */\n size?: number\n}\n\nexport type UsePhotoCaptureOptions = {\n /** Receives the cropped photo once \"Use photo\" is pressed. Nothing is emitted before. */\n onChange?: (file: File) => void\n /** The in-page camera, the phone's camera app, or whichever suits the device. Defaults to `auto`. */\n camera?: PhotoCaptureCamera\n /** The camera to open: the front one (`user`, the default) or the back one. */\n facing?: CameraFacing\n /** The crop's width / height, and the viewfinder's box. Free when unset; a circle is always 1. */\n ratio?: Ratio\n /** The capture size to aim for, for the in-page camera. See `useCamera`. */\n resolution?: CameraResolution\n /** Saves a selfie as the preview shows it, mirrored. Off by default: a saved selfie reads the right way round. */\n mirror?: boolean\n /** The File's encoding and size. */\n output?: PhotoCaptureOutput\n}\n\n/** What `confirm()` hands to the cropper's export: `ImageCropper`'s `getCroppedImage`. */\nexport type PhotoCaptureCrop = (options: {\n type: string\n quality: number\n maxSize?: { width: number; height: number }\n}) => Promise<Blob | string | null>\n\nexport type UsePhotoCaptureResult = {\n step: PhotoCaptureStep\n /** `auto` resolved for this device. */\n mode: \"live\" | \"native\"\n /** The photo in the cropper, taken or picked, before it's cropped. */\n photo: File | null\n /** Where `photo` came from, which decides what a retake means. */\n origin: PhotoCaptureOrigin | null\n /** The crop is being exported. */\n busy: boolean\n /** The last export failed. */\n failed: boolean\n /** Whether a step was ever left, so a part knows to move focus when it appears. */\n moved: boolean\n /** The in-page camera. Lazy: it turns on with `open()`, never on its own. */\n camera: UseCameraResult\n facing: CameraFacing\n ratio: Ratio | undefined\n mirror: boolean\n /** Opens the in-page camera. */\n open: () => void\n /** The shutter's photo: `Camera.Root`'s `onCapture`. */\n take: (photo: File) => void\n /** A picked file (the first of `files`), from the library or, with `native`, the phone's camera app. */\n pick: (files: readonly File[], origin?: Exclude<PhotoCaptureOrigin, \"camera\">) => void\n /** Back to the in-page camera for another shot. */\n retake: () => void\n /** Exports the crop through `crop`, then hands the File to `onChange` and starts over. Resolves the File, or `null` if the export failed. */\n confirm: (crop: PhotoCaptureCrop) => Promise<File | null>\n /** Back to the source step, the camera off. */\n reset: () => void\n}\n\n/**\n * PhotoCapture as plain state plus handlers: which step is on screen, the\n * photo in it, and the in-page camera. The steps are a pure reducer\n * (`reducePhotoCapture`); the camera is `useCamera`, mounted lazily so it\n * never lights up before \"Take photo\"; the crop is whatever `ImageCropper`\n * exports. This hook only wires them together.\n *\n * const flow = usePhotoCapture({ ratio: 1, output: { size: 512 }, onChange: upload })\n * <PhotoCapture.Root flow={flow} shape=\"circle\">…</PhotoCapture.Root>\n *\n * The camera turns off when the photo is taken, when a file is picked\n * instead, on `reset()` and on unmount. Nothing is uploaded: `onChange`\n * gets a File and the rest is yours.\n */\nexport function usePhotoCapture({\n onChange,\n camera: wanted = \"auto\",\n facing = \"user\",\n ratio,\n resolution,\n mirror = false,\n output,\n}: UsePhotoCaptureOptions = {}): UsePhotoCaptureResult {\n const [state, dispatch] = useReducer(reducePhotoCapture, initialPhotoCaptureState)\n const camera = useCamera({ facing, ratio, resolution, lazy: true })\n const coarse = useMediaQuery(\"(pointer: coarse)\")\n const mode = match(wanted)\n .returnType<\"live\" | \"native\">()\n .with(\"auto\", () => (coarse ? \"native\" : \"live\"))\n .otherwise((chosen) => chosen)\n\n // Read when the export resolves, not when it started: the latest callback and encoding.\n const latest = useRef({ onChange, output })\n useIsomorphicLayoutEffect(() => {\n latest.current = { onChange, output }\n })\n\n const { start, stop } = camera\n\n const open = useCallback(() => {\n dispatch({ type: \"open\" })\n void start()\n }, [start])\n\n const take = useCallback((photo: File) => dispatch({ type: \"take\", photo }), [])\n\n const pick = useCallback(\n (files: readonly File[], origin: Exclude<PhotoCaptureOrigin, \"camera\"> = \"file\") => {\n const [photo] = files\n if (!photo) return\n // A file instead of the shot: the camera goes off with the viewfinder.\n stop()\n dispatch({ type: \"pick\", photo, origin })\n },\n [stop],\n )\n\n const retake = useCallback(() => {\n if (state.step !== \"crop\" || state.origin !== \"camera\" || state.busy) return\n dispatch({ type: \"retake\" })\n void start()\n }, [state, start])\n\n const confirm = useCallback(async (crop: PhotoCaptureCrop) => {\n dispatch({ type: \"confirm\" })\n const { type = \"image/jpeg\", quality = 0.9, size } = latest.current.output ?? {}\n const blob = await crop({\n type,\n quality,\n ...(size ? { maxSize: { width: size, height: size } } : {}),\n }).catch(() => null)\n if (!(blob instanceof Blob)) {\n // A tainted canvas, an image that never loaded: the crop step says so.\n dispatch({ type: \"fail\" })\n return null\n }\n const file = imageFile(blob, \"photo\")\n latest.current.onChange?.(file)\n dispatch({ type: \"done\" })\n return file\n }, [])\n\n const reset = useCallback(() => {\n stop()\n dispatch({ type: \"reset\" })\n }, [stop])\n\n const crop = state.step === \"crop\" ? state : null\n return {\n step: state.step,\n mode,\n photo: crop?.photo ?? null,\n origin: crop?.origin ?? null,\n busy: crop?.busy ?? false,\n failed: crop?.failed ?? false,\n moved: state.moved,\n camera,\n facing,\n ratio,\n mirror,\n open,\n take,\n pick,\n retake,\n confirm,\n reset,\n }\n}\n","\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react/factory\"\nimport { Camera as CameraIcon, Check, ImageUp, RotateCcw } from \"lucide-react\"\nimport {\n type ComponentPropsWithoutRef,\n createContext,\n type ReactNode,\n type Ref,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from \"react\"\nimport { match } from \"ts-pattern\"\nimport { composeChildren, type NoAsChild } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport { useDirectionCheck } from \"../../lib/intl\"\nimport { useMergedRefs } from \"../../lib/merge-refs\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { useObjectUrl } from \"../../lib/use-object-url\"\nimport { Button, type ButtonProps } from \"../button/button\"\nimport { Camera, type CameraIconSlot, type CameraTranslations } from \"../camera/camera\"\nimport { FileTrigger } from \"../file-trigger/file-trigger\"\nimport {\n ImageCropper,\n type ImageCropperTranslations,\n useImageCropperContext,\n} from \"../image-cropper/image-cropper\"\nimport {\n type UsePhotoCaptureOptions,\n type UsePhotoCaptureResult,\n usePhotoCapture,\n} from \"./use-photo-capture\"\n\n/**\n * PhotoCapture — take a photo with the camera, or pick a file, crop it, and\n * get a File back. The brick a profile picture, a badge photo or a scanned\n * document is added with.\n *\n * <PhotoCapture shape=\"circle\" output={{ size: 512 }} onChange={(file) => setAvatar(file)} />\n *\n * It's a composition, not a new widget: `Camera` takes the photo,\n * `FileTrigger` picks a file (or opens a phone's camera app), `ImageCropper`\n * crops it, and `usePhotoCapture`, a small step reducer, says which of them\n * is on screen. Every part reads that hook, so a layout of your own drives\n * the same flow:\n *\n * const flow = usePhotoCapture({ ratio: \"3/4\", onChange: setBadge })\n * <PhotoCapture.Root flow={flow} shape=\"rectangle\">\n * <PhotoCapture.Source />\n * <PhotoCapture.Live />\n * <PhotoCapture.Crop />\n * </PhotoCapture.Root>\n *\n * It renders inline. In a modal, it's the modal's content: the camera stops\n * when it unmounts. Nothing is uploaded; `onChange` gets the cropped File\n * after \"Use photo\", and never before.\n */\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\n/** A rectangle, or a circle for a face. Drives the camera's guide and the cropper. */\nexport type PhotoCaptureShape = \"rectangle\" | \"circle\"\n\nexport type PhotoCaptureOwnTranslations = {\n /** The source step's heading. */\n sourceTitle?: string\n sourceBody?: string\n /** Takes a photo: opens the camera in the page, or the phone's camera app. */\n take?: string\n /** Picks a file, next to the in-page camera. */\n file?: string\n /** Picks from the phone's library, next to its camera app. */\n library?: string\n /** Back to the camera, from the crop. */\n retake?: string\n /** Picks another file, from the crop of a picked one. */\n another?: string\n /** Hands the crop to `onChange`. */\n confirm?: string\n /** Shown, as an alert, when the crop couldn't be exported. */\n failed?: string\n /** Announced politely when the photo reaches the cropper, and once it's been used. */\n announceCrop?: string\n announceDone?: string\n}\n\n/**\n * One map for everything PhotoCapture shows: its own strings, the camera's\n * (`CameraTranslations`) and the cropper's (`ImageCropperTranslations`).\n */\nexport type PhotoCaptureTranslations = PhotoCaptureOwnTranslations &\n CameraTranslations &\n ImageCropperTranslations\n\nexport const DEFAULT_TRANSLATIONS: Required<PhotoCaptureOwnTranslations> = {\n sourceTitle: \"Add a photo\",\n sourceBody: \"Nothing leaves this page until you choose Use photo.\",\n take: \"Take photo\",\n file: \"Choose a file\",\n library: \"Choose from library\",\n retake: \"Retake\",\n another: \"Choose another\",\n confirm: \"Use photo\",\n failed: \"The photo couldn't be prepared. Try again, or choose another.\",\n announceCrop: \"Photo ready to crop\",\n announceDone: \"Photo added\",\n}\n\nexport type PhotoCaptureIconSlot = \"take\" | \"file\" | \"retake\" | \"confirm\"\n/** PhotoCapture's own icons, and the camera's (`shutter`, `flip`, `start`, `retry`, `off`). */\nexport type PhotoCaptureIcons = IconMap<PhotoCaptureIconSlot | CameraIconSlot>\n\nexport const DEFAULT_ICONS: Record<PhotoCaptureIconSlot, ReactNode> = {\n take: <CameraIcon aria-hidden className={iconStroke} />,\n file: <ImageUp aria-hidden className={iconStroke} />,\n retake: <RotateCcw aria-hidden className={iconStroke} />,\n confirm: <Check aria-hidden className={iconStroke} />,\n}\n\ntype Shared = {\n flow: UsePhotoCaptureResult\n t: Required<PhotoCaptureOwnTranslations>\n /** The `translations` prop as given, for the camera and the cropper to merge with their own defaults. */\n translations: PhotoCaptureTranslations | undefined\n icons: Record<PhotoCaptureIconSlot, ReactNode>\n /** The `icons` prop as given, for the camera. */\n cameraIcons: PhotoCaptureIcons | undefined\n shape: PhotoCaptureShape\n accept: string | string[]\n color: Color\n announce: (message: string) => void\n}\n\nconst PhotoCaptureContext = createContext<Shared | null>(null)\n\n/** The nearest `PhotoCapture.Root`'s flow, translations and icons, for a part of your own. */\nexport const usePhotoCaptureContext = (): Shared => {\n const shared = useContext(PhotoCaptureContext)\n if (!shared)\n throw new Error(\"[@42/ui-react] PhotoCapture parts must be inside <PhotoCapture.Root>.\")\n return shared\n}\n\n/** What the camera encodes the shot as, on its way to the cropper, which re-encodes it as `output`. */\nconst SHOT = { type: \"image/jpeg\", quality: 0.95 }\n\n// ---------------------------------------------------------------------------\n// Root\n// ---------------------------------------------------------------------------\n\nexport type PhotoCaptureRootProps = Omit<HTMLArkProps<\"div\">, \"color\" | \"onChange\"> &\n WithTestId & {\n /** The flow, from `usePhotoCapture()`. */\n flow: UsePhotoCaptureResult\n /** A rectangle, or a circle for a face: the camera's guide and the crop. Defaults to `rectangle`. */\n shape?: PhotoCaptureShape\n /** The file types the pickers offer. Defaults to `image/*`. */\n accept?: string | string[]\n translations?: PhotoCaptureTranslations\n icons?: PhotoCaptureIcons\n /** The palette of the buttons, the shutter, the guide and the crop. `brand` by default. */\n color?: Color\n ref?: Ref<HTMLDivElement>\n }\n\n/** Announces each step, politely, from a visually hidden region. */\nconst Announcer = ({ message }: { message: string }) => (\n <div role=\"status\" aria-live=\"polite\" className=\"sr-only\">\n {message}\n </div>\n)\n\nconst PhotoCaptureRoot = ({\n flow,\n shape = \"rectangle\",\n accept = \"image/*\",\n translations,\n icons,\n color = \"brand\",\n className,\n testId,\n asChild,\n children,\n ref,\n ...rest\n}: PhotoCaptureRootProps) => {\n const direction = useDirectionCheck()\n const [message, setMessage] = useState(\"\")\n\n const shared = useMemo<Shared>(\n () => ({\n flow,\n t: { ...DEFAULT_TRANSLATIONS, ...translations },\n translations,\n icons: mergeIcons(DEFAULT_ICONS, icons),\n cameraIcons: icons,\n shape,\n accept,\n color,\n announce: setMessage,\n }),\n [flow, translations, icons, shape, accept, color],\n )\n\n // The live step announces itself through the camera's own region.\n useEffect(() => {\n if (flow.step === \"crop\") setMessage(shared.t.announceCrop)\n }, [flow.step, shared.t])\n\n const rootRef = useMergedRefs(ref, direction)\n return (\n <PhotoCaptureContext value={shared}>\n <ark.div\n ref={rootRef}\n asChild={asChild}\n data-color={color}\n data-step={flow.step}\n data-mode={flow.mode}\n className={cn(\"flex w-full flex-col gap-3\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n {composeChildren(asChild, children, (own) => (\n <>\n {own}\n <Announcer message={message} />\n </>\n ))}\n </ark.div>\n </PhotoCaptureContext>\n )\n}\n\n// ---------------------------------------------------------------------------\n// Actions\n// ---------------------------------------------------------------------------\n\nexport type PhotoCaptureActionProps = NoAsChild<\n Omit<ButtonProps, \"onClick\" | \"onSelect\" | \"children\"> & {\n /** Replaces the label from `translations`. */\n children?: ReactNode\n }\n>\n\n/**\n * Takes a photo. With the in-page camera, it opens the `live` step; with\n * `native`, it opens the phone's camera app (`capture`), whose photo goes\n * straight to the crop. Hidden where the in-page camera can't work at all.\n */\nconst PhotoCaptureTake = ({ children, asChild: _asChild, ...rest }: PhotoCaptureActionProps) => {\n const { flow, t, icons, accept } = usePhotoCaptureContext()\n const label = children ?? t.take\n return match(flow.mode)\n .with(\"native\", () => (\n <FileTrigger\n accept={accept}\n capture={flow.facing}\n onSelect={(files) => flow.pick(files, \"native\")}\n startSlot={icons.take}\n {...rest}\n >\n {label}\n </FileTrigger>\n ))\n .with(\"live\", () =>\n flow.camera.status === \"unsupported\" ? null : (\n <Button startSlot={icons.take} onClick={flow.open} {...rest}>\n {label}\n </Button>\n ),\n )\n .exhaustive()\n}\n\n/**\n * Picks a file: \"Choose a file\" beside the in-page camera, \"Choose from\n * library\" beside the phone's camera app. Always there, at the same weight\n * as the camera, for anyone whose camera won't do.\n */\nconst PhotoCaptureFile = ({ children, asChild: _asChild, ...rest }: PhotoCaptureActionProps) => {\n const { flow, t, icons, accept } = usePhotoCaptureContext()\n return (\n <FileTrigger\n accept={accept}\n onSelect={(files) => flow.pick(files, \"file\")}\n startSlot={icons.file}\n {...rest}\n >\n {children ?? (flow.mode === \"native\" ? t.library : t.file)}\n </FileTrigger>\n )\n}\n\n/**\n * Back for another photo, the way this one came: the in-page camera again,\n * the phone's camera app again, or another file (\"Choose another\").\n */\nconst PhotoCaptureRetake = ({ children, asChild: _asChild, ...rest }: PhotoCaptureActionProps) => {\n const { flow, t, icons, accept } = usePhotoCaptureContext()\n return match(flow.origin)\n .with(\"camera\", () => (\n <Button\n variant=\"light\"\n startSlot={icons.retake}\n disabled={flow.busy}\n onClick={flow.retake}\n {...rest}\n >\n {children ?? t.retake}\n </Button>\n ))\n .with(\"native\", () => (\n <FileTrigger\n variant=\"light\"\n accept={accept}\n capture={flow.facing}\n disabled={flow.busy}\n onSelect={(files) => flow.pick(files, \"native\")}\n startSlot={icons.retake}\n {...rest}\n >\n {children ?? t.retake}\n </FileTrigger>\n ))\n .with(\"file\", () => (\n <FileTrigger\n variant=\"light\"\n accept={accept}\n disabled={flow.busy}\n onSelect={(files) => flow.pick(files, \"file\")}\n startSlot={icons.file}\n {...rest}\n >\n {children ?? t.another}\n </FileTrigger>\n ))\n .with(null, () => null)\n .exhaustive()\n}\n\n/**\n * \"Use photo\": exports the crop as `output` says, hands the File to\n * `onChange`, and starts over. Inside `PhotoCapture.Crop`, which provides the\n * cropper it exports. Takes focus when it appears, so after the shutter (or a\n * pick) Enter uses the photo.\n */\nconst PhotoCaptureConfirm = ({\n id,\n children,\n asChild: _asChild,\n ...rest\n}: PhotoCaptureActionProps) => {\n const { flow, t, icons, announce } = usePhotoCaptureContext()\n const cropper = useImageCropperContext()\n // Button takes no ref: found by its id to move focus to it.\n const generated = useId()\n const button = id ?? generated\n\n // The crop is only ever reached by a user's step: the shutter or a pick.\n // Again after a failure, which disabled (and so blurred) the button.\n useEffect(() => {\n if (!flow.busy) document.getElementById(button)?.focus()\n }, [flow.busy, button])\n\n return (\n <Button\n id={button}\n startSlot={icons.confirm}\n loading={flow.busy}\n onClick={async () => {\n const file = await flow.confirm(cropper.getCroppedImage)\n if (file) announce(t.announceDone)\n }}\n {...rest}\n >\n {children ?? t.confirm}\n </Button>\n )\n}\n\n// ---------------------------------------------------------------------------\n// Steps\n// ---------------------------------------------------------------------------\n\nexport type PhotoCaptureSourceProps = NoAsChild<ComponentPropsWithoutRef<\"div\"> & WithTestId>\n\n/**\n * The first step: \"Take photo\" and the file picker, side by side at the same\n * weight, under a line that says nothing leaves the page. With `native`,\n * that's the phone's camera app and its library: two pickers, because\n * Android 14 and 15 hide the camera from a picker without `capture`.\n * Children replace the two buttons.\n */\nconst PhotoCaptureSource = ({\n className,\n testId,\n children,\n asChild: _asChild,\n ...rest\n}: PhotoCaptureSourceProps) => {\n const { flow, t } = usePhotoCaptureContext()\n const root = useRef<HTMLDivElement>(null)\n\n // Back here after a photo was used: focus goes to the first choice, not the page.\n useEffect(() => {\n if (flow.step === \"source\" && flow.moved)\n root.current?.querySelector<HTMLElement>(\"button:not(:disabled)\")?.focus()\n }, [flow.step, flow.moved])\n\n if (flow.step !== \"source\") return null\n return (\n <div\n ref={root}\n data-part=\"source\"\n className={cn(\n \"flex flex-col items-center justify-center gap-4 rounded-input border border-dashed p-6 text-center\",\n // The kit's hairline, dashed: FileUpload's dropzone.\n \"border-brand-900/20 dark:border-white/15\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n >\n <div className=\"flex flex-col gap-1\">\n <p className=\"font-medium text-brand-950 text-md dark:text-white\">{t.sourceTitle}</p>\n <p className=\"text-black/50 text-sm dark:text-white/50\">{t.sourceBody}</p>\n </div>\n {/* Side by side when they fit, stacked full width when not: the same weight either way. */}\n <div className=\"grid w-full max-w-md grid-cols-[repeat(auto-fit,minmax(min(100%,11rem),1fr))] gap-2\">\n {children ?? (\n <>\n <PhotoCaptureTake />\n <PhotoCaptureFile />\n </>\n )}\n </div>\n </div>\n )\n}\n\nexport type PhotoCaptureLiveClassNames = {\n viewfinder?: string\n controls?: string\n}\n\nexport type PhotoCaptureLiveProps = NoAsChild<\n Omit<ComponentPropsWithoutRef<\"div\">, \"children\" | \"color\"> &\n WithTestId & {\n classNames?: PhotoCaptureLiveClassNames\n }\n>\n\n/**\n * The in-page camera: `Camera`'s viewfinder with a guide in the flow's\n * shape, its status panels, the shutter, the camera switch and picker, and\n * the file picker beside the shutter. Every panel (asking, refused, busy, no\n * camera) offers the file picker too.\n *\n * Focus comes here as the step opens, and moves to the shutter once the\n * picture is live.\n */\nconst PhotoCaptureLive = ({\n className,\n classNames,\n testId,\n asChild: _asChild,\n ...rest\n}: PhotoCaptureLiveProps) => {\n const { flow, translations, cameraIcons, shape, color } = usePhotoCaptureContext()\n const root = useRef<HTMLDivElement>(null)\n const shutter = useRef<HTMLButtonElement>(null)\n /** Whether the shutter should take focus once it's enabled: after \"Take photo\" or a retake. */\n const pending = useRef(false)\n const status = flow.camera.status\n\n useEffect(() => {\n if (flow.step !== \"live\" || !flow.moved) return\n pending.current = true\n // The button that brought us here is gone: hold focus in the step until the shutter can take it.\n root.current?.focus()\n }, [flow.step, flow.moved])\n\n useEffect(() => {\n if (!pending.current || status !== \"live\") return\n pending.current = false\n shutter.current?.focus()\n }, [status])\n\n if (flow.step !== \"live\") return null\n return (\n <Camera.Root\n ref={root}\n tabIndex={-1}\n camera={flow.camera}\n onCapture={flow.take}\n output={SHOT}\n mirror={flow.mirror}\n translations={translations}\n icons={cameraIcons}\n color={color}\n data-part=\"live\"\n className={cn(\"outline-none\", className)}\n testId={testId}\n {...rest}\n >\n <Camera.Viewfinder ratio={flow.ratio} className={classNames?.viewfinder}>\n <Camera.Guide shape={shape} ratio={shape === \"rectangle\" ? flow.ratio : undefined} />\n <Camera.Live className=\"absolute start-2 top-2 z-1\" />\n <Camera.Status>{() => <PhotoCaptureFile size=\"sm\" />}</Camera.Status>\n </Camera.Viewfinder>\n <div className={cn(\"grid grid-cols-[1fr_auto_1fr] items-center gap-3\", classNames?.controls)}>\n {/* While a panel is up, it carries the file picker. */}\n <div className=\"flex min-w-0 justify-start\">\n {status === \"live\" && <PhotoCaptureFile variant=\"light\" />}\n </div>\n <Camera.Shutter ref={shutter} />\n <div className=\"flex min-w-0 items-center justify-end gap-2\">\n <Camera.Devices className=\"min-w-0\" />\n <Camera.Flip />\n </div>\n </div>\n </Camera.Root>\n )\n}\n\nexport type PhotoCaptureCropClassNames = {\n viewport?: string\n controls?: string\n actions?: string\n}\n\nexport type PhotoCaptureCropProps = NoAsChild<\n Omit<ComponentPropsWithoutRef<\"div\">, \"color\"> &\n WithTestId & {\n classNames?: PhotoCaptureCropClassNames\n /** Replaces the Retake and Use photo buttons. `PhotoCapture.Confirm` must stay inside. */\n children?: ReactNode\n }\n>\n\n/**\n * The photo in `ImageCropper`, locked to the flow's ratio and shape, with\n * its zoom, rotate and flip controls, then Retake and Use photo. Taking the\n * photo and cropping it are one step: there's no review screen between.\n */\nconst PhotoCaptureCrop = ({\n className,\n classNames,\n testId,\n children,\n asChild: _asChild,\n ...rest\n}: PhotoCaptureCropProps) => {\n const { flow, t, translations, shape, color } = usePhotoCaptureContext()\n // One URL per photo, which is also the cropper's key: a new photo starts a new crop.\n const url = useObjectUrl(flow.photo)\n\n if (flow.step !== \"crop\" || !url) return null\n return (\n <ImageCropper.Root\n key={url}\n ratio={shape === \"circle\" ? 1 : flow.ratio}\n shape={shape}\n color={color}\n translations={translations}\n data-part=\"crop\"\n className={className}\n testId={testId}\n {...rest}\n >\n <ImageCropper.Viewport className={classNames?.viewport}>\n <ImageCropper.Image src={url} />\n <ImageCropper.Selection />\n </ImageCropper.Viewport>\n <ImageCropper.Controls className={classNames?.controls} />\n {flow.failed && (\n <p role=\"alert\" className={cn(TEXT_COLOR_CLASSES.error, \"text-sm\")}>\n {t.failed}\n </p>\n )}\n <div className={cn(\"flex flex-wrap items-center justify-end gap-2\", classNames?.actions)}>\n {children ?? (\n <>\n <PhotoCaptureRetake />\n <PhotoCaptureConfirm />\n </>\n )}\n </div>\n </ImageCropper.Root>\n )\n}\n\n// ---------------------------------------------------------------------------\n// Convenience\n// ---------------------------------------------------------------------------\n\nexport type PhotoCaptureClassNames = {\n source?: string\n live?: string\n viewfinder?: string\n crop?: string\n viewport?: string\n controls?: string\n actions?: string\n}\n\nexport type PhotoCaptureProps = NoAsChild<\n Omit<PhotoCaptureRootProps, \"flow\" | \"children\"> &\n UsePhotoCaptureOptions & {\n classNames?: PhotoCaptureClassNames\n }\n>\n\nconst PhotoCaptureComponent = ({\n onChange,\n camera,\n facing,\n ratio,\n resolution,\n mirror,\n output,\n classNames,\n asChild: _asChild,\n ...rest\n}: PhotoCaptureProps) => {\n const flow = usePhotoCapture({ onChange, camera, facing, ratio, resolution, mirror, output })\n return (\n <PhotoCaptureRoot flow={flow} {...rest}>\n <PhotoCaptureSource className={classNames?.source} />\n <PhotoCaptureLive\n className={classNames?.live}\n classNames={{ viewfinder: classNames?.viewfinder, controls: classNames?.controls }}\n />\n <PhotoCaptureCrop\n className={classNames?.crop}\n classNames={{\n viewport: classNames?.viewport,\n controls: classNames?.controls,\n actions: classNames?.actions,\n }}\n />\n </PhotoCaptureRoot>\n )\n}\n\nexport const PhotoCapture = Object.assign(PhotoCaptureComponent, {\n Root: PhotoCaptureRoot,\n Source: PhotoCaptureSource,\n Live: PhotoCaptureLive,\n Crop: PhotoCaptureCrop,\n Take: PhotoCaptureTake,\n File: PhotoCaptureFile,\n Retake: PhotoCaptureRetake,\n Confirm: PhotoCaptureConfirm,\n})\n"]}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
- export { PillOverflowCounter, PillsInput, pillsContent, pillsShell, usePillOverflow } from '../../chunk-O5W3QWJ6.js';
2
+ export { PillOverflowCounter, PillsInput, pillsContent, pillsShell, usePillOverflow } from '../../chunk-J44FJ7PH.js';
3
3
  import '../../chunk-6M6YZ3PQ.js';
4
- import '../../chunk-45QRQKRC.js';
4
+ import '../../chunk-3L5GLI67.js';
5
5
  import '../../chunk-VD6PB3VA.js';
6
6
  import '../../chunk-2LI3VPDP.js';
7
7
  import '../../chunk-IPYHTCFL.js';
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { shellChrome, shellVariants } from '../../chunk-45QRQKRC.js';
2
+ import { shellChrome, shellVariants } from '../../chunk-3L5GLI67.js';
3
3
  import { FieldShell, fieldA11yProps } from '../../chunk-VD6PB3VA.js';
4
4
  import { props } from '../../chunk-WYCMIIRR.js';
5
5
  import '../../chunk-GIPQUKCN.js';
@@ -1,2 +1,2 @@
1
- export { Popover, type PopoverContentProps, type PopoverProps, type PopoverTriggerProps, } from "./popover";
1
+ export { Popover, type PopoverContentProps, type PopoverGroupProps, type PopoverPosition, type PopoverProps, type PopoverTriggerProps, } from "./popover";
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/popover/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,OAAO,EACP,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,KAAK,mBAAmB,GACzB,MAAM,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/popover/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,OAAO,EACP,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,mBAAmB,GACzB,MAAM,WAAW,CAAA"}
@@ -1,5 +1,6 @@
1
1
  "use client";
2
- export { Popover } from '../../chunk-5HUEBSIS.js';
2
+ export { Popover } from '../../chunk-N66NC6QK.js';
3
+ import '../../chunk-V6PY7C6S.js';
3
4
  import '../../chunk-7P32XCEU.js';
4
5
  import '../../chunk-H7WOMZXO.js';
5
6
  import '../../chunk-PMUCGFY5.js';
@@ -2,6 +2,7 @@ import { Popover as ArkPopover } from "@ark-ui/react/popover";
2
2
  import { type ComponentPropsWithoutRef } from "react";
3
3
  import type { NoAsChild } from "../../lib/as-child";
4
4
  import type { UnavailableProps } from "../../lib/available-if";
5
+ import { type LogicalPosition, type Placement, type PlacementProps } from "../../lib/placement";
5
6
  import type { WithTestId } from "../../lib/test-id";
6
7
  /** Shared floating-panel chrome — border, surface, shadow, layering token, and
7
8
  * the open/close animation (origin follows `data-placement`). Every popover
@@ -95,7 +96,9 @@ export declare const popoverEmpty: string;
95
96
  * mouse-only, unfocusable link preview by design (Ark's HoverCard ignores
96
97
  * touch and never takes focus).
97
98
  */
98
- type PopoverPosition = NonNullable<NonNullable<ArkPopover.RootProps["positioning"]>["placement"]>;
99
+ /** `position` accepts Ark's physical placements plus the logical, RTL-aware
100
+ * horizontal sides `start` / `end` (resolved to `left` / `right` by direction). */
101
+ export type PopoverPosition = LogicalPosition<Placement>;
99
102
  type PopoverHoverDelays = {
100
103
  /** Hover time in ms before the preview opens. Default `600`, like `HoverCard`. */
101
104
  openDelay?: number;
@@ -113,33 +116,9 @@ type PopoverModeProps = ({
113
116
  } & UnavailableProps<PopoverHoverDelays, 'requires mode="hover"'>) | ({
114
117
  mode: "hover";
115
118
  } & PopoverHoverDelays);
116
- export type PopoverProps = ArkPopover.RootProps & PopoverModeProps & {
119
+ export type PopoverProps = Omit<ArkPopover.RootProps, "positioning"> & PopoverModeProps & PlacementProps & {
117
120
  /** Match the trigger's width (`"target"`, default) or size to content (`"auto"`). */
118
121
  width?: "target" | "auto";
119
- /** Panel placement relative to the trigger. Defaults to Ark's `"bottom"`. */
120
- position?: PopoverPosition;
121
- /** Gap in px between the trigger and the panel. */
122
- gutter?: number;
123
- /** Fine placement, in px: `mainAxis` is the gap from the trigger (it replaces `gutter` when
124
- * set), `crossAxis` slides the panel along the trigger's edge. Floating UI's `offset()`. */
125
- offset?: {
126
- mainAxis?: number | undefined;
127
- crossAxis?: number | undefined;
128
- } | undefined;
129
- /** Hide the panel (`visibility: hidden`, no pointer events) once the
130
- * trigger is fully clipped by its own scrolling ancestor, and restore it
131
- * once back in view — Floating UI's `hide()` middleware
132
- * (`strategy: "referenceHidden"`), already wired into Ark's positioning
133
- * engine, just not exposed until now. Rides the positioner's existing
134
- * scroll/resize listeners, so no extra observer is needed. Default `true`
135
- * — a panel that can't see its own trigger is never in a state worth
136
- * keeping visible; pass `false` to restore the old "keep following the
137
- * trigger's last known position" behavior. */
138
- hideWhenDetached?: boolean;
139
- /** Ark's full positioning options (`flip`, `slide`, `overlap`, `boundary`,
140
- * `getAnchorElement`, …), for placements the props above can't express.
141
- * Applied over them, so a key set here wins. */
142
- positioning?: ArkPopover.RootProps["positioning"];
143
122
  /** Render the panel in a Portal so it escapes clipping ancestors. Default `true`. */
144
123
  withinPortal?: boolean;
145
124
  /** Portal target. Defaults to the enclosing `Modal`/`Drawer` when there is
@@ -148,13 +127,48 @@ export type PopoverProps = ArkPopover.RootProps & PopoverModeProps & {
148
127
  /** Fires on close (any source) — Escape, outside interaction, or a controlled `onOpenChange`. */
149
128
  onClose?: () => void;
150
129
  };
151
- declare const Root: ({ mode, openDelay, closeDelay, width, position, gutter, offset, hideWhenDetached, positioning, withinPortal, container, children, open, defaultOpen, autoFocus, restoreFocus, modal, onOpenChange, onClose, onPointerDownOutside, ...rest }: PopoverProps) => import("react").JSX.Element;
130
+ declare const Root: (props: PopoverProps) => import("react").JSX.Element;
131
+ export type PopoverGroupProps = PopoverProps;
132
+ /**
133
+ * One shared panel across several triggers (e.g. a row of avatars) — the
134
+ * same `Popover.Trigger` / `Popover.Content` parts `Popover.Root` uses, just
135
+ * several of each, matched by a shared `value`. The Popover counterpart of
136
+ * `HoverCard.Group`, with the same contract, for cards people act on:
137
+ *
138
+ * <Popover.Group mode="hover" width="auto">
139
+ * <Popover.Trigger value="ada"><Avatar name="Ada Lovelace" /></Popover.Trigger>
140
+ * <Popover.Trigger value="grace"><Avatar name="Grace Hopper" /></Popover.Trigger>
141
+ *
142
+ * <Popover.Content value="ada">Ada's card</Popover.Content>
143
+ * <Popover.Content value="grace">Grace's card</Popover.Content>
144
+ * </Popover.Group>
145
+ *
146
+ * zag's Popover supports several named triggers on one machine: clicking
147
+ * another trigger while the panel is open moves it there instead of closing
148
+ * it, and only the active trigger gets `aria-expanded`. In `mode="hover"`,
149
+ * hovering another trigger while the preview is open moves it too, with no
150
+ * delay replay; a click, tap or Enter on any trigger, or a press or focus in
151
+ * the panel, pins it exactly like a single `mode="hover"` Popover. Either
152
+ * way the panel slides between triggers (`slideStyle`), never on the first
153
+ * open.
154
+ *
155
+ * `triggerValue` / `defaultTriggerValue` / `onTriggerValueChange` read and
156
+ * drive the active trigger. `Trigger`/`Content` must be `Group`'s own direct
157
+ * children (it scans one level, like `HoverCard.Group`); `Group` renders no
158
+ * DOM node, so wrap it from the outside for row layout (`Avatar.Group`).
159
+ */
160
+ declare const Group: (props: PopoverGroupProps) => import("react").JSX.Element;
152
161
  export type PopoverTriggerProps = ArkPopover.TriggerProps & WithTestId;
153
162
  /** Ark's trigger, plus the hover handlers in `mode="hover"`. Ark merges them
154
163
  * with its own, so `asChild` and the click/keyboard toggle are untouched. */
155
164
  declare const Trigger: ({ onPointerEnter, onPointerLeave, onClickCapture, testId, ...rest }: PopoverTriggerProps) => import("react").JSX.Element;
156
- export type PopoverContentProps = NoAsChild<ArkPopover.ContentProps> & WithTestId;
157
- declare const Content: ({ className, children, testId, onPointerEnter, onPointerLeave, onPointerDown, onFocus, asChild: _asChild, ...rest }: PopoverContentProps) => import("react").JSX.Element;
165
+ export type PopoverContentProps = NoAsChild<ArkPopover.ContentProps> & WithTestId & {
166
+ /** Which `Popover.Group` trigger this content belongs to — only
167
+ * meaningful inside `Popover.Group`, where `Group` renders the one whose
168
+ * `value` matches the active trigger. Never forwarded to the DOM. */
169
+ value?: string;
170
+ };
171
+ declare const Content: ({ className, children, testId, onPointerEnter, onPointerLeave, onPointerDown, onFocus, asChild: _asChild, value: _value, ...rest }: PopoverContentProps) => import("react").JSX.Element;
158
172
  export type PopoverHeaderProps = ComponentPropsWithoutRef<"div"> & WithTestId;
159
173
  /** Fixed slot above the scrolling Body — a search input, filters, etc. */
160
174
  declare const Header: ({ className, testId, ...rest }: PopoverHeaderProps) => import("react").JSX.Element;
@@ -170,6 +184,7 @@ declare const Body: ({ className, testId, ...rest }: PopoverBodyProps) => import
170
184
  export type PopoverAnchorProps = ArkPopover.AnchorProps;
171
185
  export declare const Popover: {
172
186
  Root: typeof Root;
187
+ Group: typeof Group;
173
188
  Trigger: typeof Trigger;
174
189
  /** Positions the panel without attaching any click/keyboard trigger
175
190
  * semantics — for a host that already owns its own click resolution
@@ -1 +1 @@
1
- {"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../src/components/popover/popover.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAqB,MAAM,uBAAuB,CAAA;AAGhF,OAAO,EACL,KAAK,wBAAwB,EAQ9B,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAU9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAYnD;;;;;;;;;;gFAUgF;AAChF,eAAO,MAAM,aAAa,QAOzB,CAAA;AAED;;;;;;sEAMsE;AACtE,eAAO,MAAM,cAAc,QAA4D,CAAA;AAEvF;;;;;0BAK0B;AAC1B,eAAO,MAAM,WAAW;;8EAavB,CAAA;AAED;;;;+DAI+D;AAC/D,eAAO,MAAM,yBAAyB,oBAEnC;IACD,UAAU,EAAE,MAAM,WAAW,GAAG,IAAI,CAAA;CACrC,qBAAuD,CAAA;AAExD;;;;0DAI0D;AAC1D,eAAO,MAAM,YAAY,QAAqD,CAAA;AAE9E;0DAC0D;AAC1D,eAAO,MAAM,eAAe,QAG3B,CAAA;AAED;mEACmE;AACnE,eAAO,MAAM,cAAc,mEAAmE,CAAA;AAE9F,+FAA+F;AAC/F,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AAC,EAAE,MAAM,CAAA;CACf,CAAA;AAEH,QAAA,MAAM,OAAO,uIAWV,mBAAmB,gCAwCrB,CAAA;AAID,MAAM,MAAM,kBAAkB,GAAG,wBAAwB,CAAC,KAAK,CAAC,GAAG,UAAU,CAAA;AAE7E,0EAA0E;AAC1E,QAAA,MAAM,MAAM,mCAAoC,kBAAkB,gCAMjE,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG,wBAAwB,CAAC,KAAK,CAAC,GAAG,UAAU,CAAA;AAE7E;;;4CAG4C;AAC5C,QAAA,MAAM,MAAM,mCAAoC,kBAAkB,gCAEjE,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,wBAAwB,CAAC,KAAK,CAAC,GAAG,UAAU,CAAA;AAE3E,+EAA+E;AAC/E,QAAA,MAAM,IAAI,mCAAoC,gBAAgB,gCAM7D,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,WAAW,CAAA;AAEvD,eAAO,MAAM,OAAO;;;;IAIlB;;;6CAGyC;;;;;;CAM1C,CAAA"}
@@ -9,8 +9,8 @@ import { prefersReducedMotion } from '../../chunk-CQ4M4BSF.js';
9
9
  import '../../chunk-HDYORQZN.js';
10
10
  import { useMergedRefs } from '../../chunk-HBWV5EPU.js';
11
11
  import { useLocale, useTimeZone, DEFAULT_LOCALE } from '../../chunk-IPYHTCFL.js';
12
- import { resolveLogicalPlacement } from '../../chunk-G52U24GR.js';
13
- import { Popover } from '../../chunk-5HUEBSIS.js';
12
+ import { Popover } from '../../chunk-N66NC6QK.js';
13
+ import { resolveLogicalPlacement } from '../../chunk-V6PY7C6S.js';
14
14
  import { OverlayContainerProvider } from '../../chunk-7P32XCEU.js';
15
15
  import '../../chunk-H7WOMZXO.js';
16
16
  import { ActionIcon } from '../../chunk-BE2LWUHY.js';
@@ -1,12 +1,13 @@
1
1
  "use client";
2
- export { Select } from '../../chunk-3BXKTWWD.js';
2
+ export { Select } from '../../chunk-FB2G4LNH.js';
3
3
  import '../../chunk-7TDHT3QD.js';
4
+ import '../../chunk-YPFSRZ3T.js';
4
5
  import '../../chunk-5FDOOG4J.js';
5
- import '../../chunk-MKKQE3TM.js';
6
- import '../../chunk-45QRQKRC.js';
6
+ import '../../chunk-3L5GLI67.js';
7
7
  import '../../chunk-VD6PB3VA.js';
8
8
  import '../../chunk-HBWV5EPU.js';
9
- import '../../chunk-5HUEBSIS.js';
9
+ import '../../chunk-N66NC6QK.js';
10
+ import '../../chunk-V6PY7C6S.js';
10
11
  import '../../chunk-7P32XCEU.js';
11
12
  import '../../chunk-H7WOMZXO.js';
12
13
  import '../../chunk-PMUCGFY5.js';
@@ -1,18 +1,19 @@
1
1
  "use client";
2
- import { Modal } from '../../chunk-JVG5ISPT.js';
3
2
  import { Kbd } from '../../chunk-DT6LKNZF.js';
3
+ import { Modal } from '../../chunk-JVG5ISPT.js';
4
4
  import { Pill } from '../../chunk-6M6YZ3PQ.js';
5
5
  import { Mark } from '../../chunk-NS6RGPWR.js';
6
6
  import { Skeleton } from '../../chunk-TWNIAF7K.js';
7
7
  import '../../chunk-DA4QII2N.js';
8
- import { Combobox } from '../../chunk-MKKQE3TM.js';
9
- import '../../chunk-45QRQKRC.js';
8
+ import { Combobox } from '../../chunk-YPFSRZ3T.js';
9
+ import '../../chunk-3L5GLI67.js';
10
10
  import '../../chunk-VD6PB3VA.js';
11
11
  import { useLocalStorage, useInView } from '../../chunk-HC4XVBP2.js';
12
12
  import { useHotkey, KBD_DEFAULT_TRANSLATIONS } from '../../chunk-FUNTJZX7.js';
13
13
  import { observeResize } from '../../chunk-2LI3VPDP.js';
14
14
  import { useLinkComponent } from '../../chunk-GTKKRV5N.js';
15
- import { popoverOption, popoverGroupLabel, popoverEmpty } from '../../chunk-5HUEBSIS.js';
15
+ import { popoverOption, popoverGroupLabel, popoverEmpty } from '../../chunk-N66NC6QK.js';
16
+ import '../../chunk-V6PY7C6S.js';
16
17
  import '../../chunk-7P32XCEU.js';
17
18
  import '../../chunk-H7WOMZXO.js';
18
19
  import '../../chunk-BE2LWUHY.js';