@senvenli/react 0.3.3 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/action/fab.d.ts +7 -0
  2. package/dist/action/fab.js +22 -3
  3. package/dist/action/fab.js.map +1 -1
  4. package/dist/collection/data-table.d.ts +1 -1
  5. package/dist/collection/data-table.js +2 -2
  6. package/dist/collection/data-table.js.map +1 -1
  7. package/dist/collection/table.d.ts +7 -2
  8. package/dist/collection/table.js +17 -7
  9. package/dist/collection/table.js.map +1 -1
  10. package/dist/i18n.d.ts +8 -0
  11. package/dist/i18n.js +18 -1
  12. package/dist/i18n.js.map +1 -1
  13. package/dist/navigation/index.d.ts +2 -2
  14. package/dist/navigation/index.js +1 -1
  15. package/dist/navigation/index.js.map +1 -1
  16. package/dist/navigation/sidebar.d.ts +18 -0
  17. package/dist/navigation/sidebar.js +26 -2
  18. package/dist/navigation/sidebar.js.map +1 -1
  19. package/dist/overlay/floating.js +4 -1
  20. package/dist/overlay/floating.js.map +1 -1
  21. package/dist/overlay/index.d.ts +2 -0
  22. package/dist/overlay/index.js +2 -1
  23. package/dist/overlay/index.js.map +1 -1
  24. package/dist/overlay/tour.d.ts +88 -0
  25. package/dist/overlay/tour.js +302 -0
  26. package/dist/overlay/tour.js.map +1 -0
  27. package/package.json +2 -2
  28. package/dist/action/files.d.ts +0 -70
  29. package/dist/action/files.js +0 -156
  30. package/dist/action/files.js.map +0 -1
  31. package/dist/action/theme-toggle.d.ts +0 -43
  32. package/dist/action/theme-toggle.js +0 -259
  33. package/dist/action/theme-toggle.js.map +0 -1
  34. package/dist/display/image-crop.d.ts +0 -106
  35. package/dist/display/image-crop.js +0 -117
  36. package/dist/display/image-crop.js.map +0 -1
  37. package/dist/display/image-cropper.d.ts +0 -68
  38. package/dist/display/image-cropper.js +0 -284
  39. package/dist/display/image-cropper.js.map +0 -1
  40. package/dist/display/lozenge.d.ts +0 -30
  41. package/dist/display/lozenge.js +0 -55
  42. package/dist/display/lozenge.js.map +0 -1
  43. package/dist/display/scroll-area.d.ts +0 -29
  44. package/dist/display/scroll-area.js +0 -95
  45. package/dist/display/scroll-area.js.map +0 -1
  46. package/dist/feedback/cooldown.d.ts +0 -17
  47. package/dist/feedback/cooldown.js +0 -59
  48. package/dist/feedback/cooldown.js.map +0 -1
  49. package/dist/feedback/status-dot.d.ts +0 -23
  50. package/dist/feedback/status-dot.js +0 -37
  51. package/dist/feedback/status-dot.js.map +0 -1
  52. package/dist/form/input-otp.d.ts +0 -35
  53. package/dist/form/input-otp.js +0 -83
  54. package/dist/form/input-otp.js.map +0 -1
  55. package/dist/layout/auth-form-layout.d.ts +0 -71
  56. package/dist/layout/auth-form-layout.js +0 -61
  57. package/dist/layout/auth-form-layout.js.map +0 -1
  58. package/dist/layout/auth-layout.d.ts +0 -59
  59. package/dist/layout/auth-layout.js +0 -26
  60. package/dist/layout/auth-layout.js.map +0 -1
  61. package/dist/layout/pressable.d.ts +0 -40
  62. package/dist/layout/pressable.js +0 -65
  63. package/dist/layout/pressable.js.map +0 -1
  64. package/dist/layout/reset-sent-card.d.ts +0 -39
  65. package/dist/layout/reset-sent-card.js +0 -22
  66. package/dist/layout/reset-sent-card.js.map +0 -1
  67. package/dist/navigation/dock.d.ts +0 -27
  68. package/dist/navigation/dock.js +0 -47
  69. package/dist/navigation/dock.js.map +0 -1
  70. package/dist/navigation/footer.d.ts +0 -43
  71. package/dist/navigation/footer.js +0 -43
  72. package/dist/navigation/footer.js.map +0 -1
  73. package/dist/navigation/language-names.d.ts +0 -19
  74. package/dist/navigation/language-names.js +0 -79
  75. package/dist/navigation/language-names.js.map +0 -1
  76. package/dist/navigation/language-switcher.d.ts +0 -55
  77. package/dist/navigation/language-switcher.js +0 -53
  78. package/dist/navigation/language-switcher.js.map +0 -1
  79. package/dist/navigation/panel-header.d.ts +0 -37
  80. package/dist/navigation/panel-header.js +0 -50
  81. package/dist/navigation/panel-header.js.map +0 -1
  82. package/dist/navigation/toolbar.d.ts +0 -37
  83. package/dist/navigation/toolbar.js +0 -334
  84. package/dist/navigation/toolbar.js.map +0 -1
  85. package/dist/overlay/command-palette.d.ts +0 -53
  86. package/dist/overlay/command-palette.js +0 -130
  87. package/dist/overlay/command-palette.js.map +0 -1
  88. package/dist/overlay/overlay.d.ts +0 -299
  89. package/dist/overlay/overlay.js +0 -558
  90. package/dist/overlay/overlay.js.map +0 -1
  91. package/dist/selection/radio-card.d.ts +0 -31
  92. package/dist/selection/radio-card.js +0 -29
  93. package/dist/selection/radio-card.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"image-cropper.js","sourceRoot":"","sources":["../../src/display/image-cropper.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElG,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EACL,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,UAAU,GACX,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,C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AAc,EAAC,IAAI,EAAC,OAAO,GAAG,EAC7C,SAAS,KAAK,WAAW,IAAI,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,MAAM,EAAE,cAAc,CAAC,QAAQ,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,MAAM,CAAC,IAC5I,CACL,EAED,4BAAe,uBAAuB,EAAC,SAAS,EAAC,uCAAuC,aACrF,QAAQ,IAAI,KAAC,MAAM,IAAC,OAAO,EAAE,QAAQ,YAAG,WAAW,CAAC,MAAM,CAAC,GAAU,EACtE,KAAC,MAAM,IAAC,OAAO,EAAC,SAAS,EAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,IAAI,EAAE,YACzF,aAAa,CAAC,MAAM,CAAC,GACf,IACL,IACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Slider as AriaSlider, SliderThumb, SliderTrack, useLocale } from \"react-aria-components\";\n\nimport { cn } from \"../utils\";\nimport { Button } from \"../action/button\";\nimport { formatFileSize } from \"../action/files\";\nimport { ColorSwatchPicker } from \"../color/color\";\nimport {\n cancelLabel,\n colorBlackLabel,\n colorLightGreyLabel,\n colorWhiteLabel,\n cropAspectLabel,\n cropBackgroundLabel,\n cropCenteredLabel,\n cropContainLabel,\n cropCoverLabel,\n cropFitLabel,\n cropHelpLabel,\n cropKeepsAlphaLabel,\n cropLoadFailedLabel,\n cropOutputLabel,\n cropPositionLabel,\n cropRotateLeftLabel,\n cropRotateRightLabel,\n cropSaveFailedLabel,\n cropSaveLabel,\n cropSmallLabel,\n cropStatusLabel,\n cropTooLargeLabel,\n cropZoomInLabel,\n cropZoomLabel,\n cropZoomOutLabel,\n intlLocale,\n} from \"../i18n\";\nimport { SegmentedControl } from \"../navigation/tabs\";\nimport { SLIDER_FILL, SLIDER_RAIL, SLIDER_THUMB, SLIDER_TRACK } from \"../selection/styles\";\nimport { IconGlyph } from \"./icon\";\nimport {\n MAX_ZOOM,\n MIN_ZOOM,\n clampZoom,\n cropRegion,\n drawCrop,\n encodeWithin,\n extensionOf,\n hasAlpha,\n outputSize,\n rotatedSize,\n type CropFit,\n type CropOutputType,\n type CropRotation,\n} from \"./image-crop\";\n\nexport type ImageCropperAspect = number | \"free\";\n\nexport type ImageCropperPreset = {\n id: string;\n /** \"Cover 16:9\". */\n label: string;\n aspectRatio: ImageCropperAspect;\n /** The fit this surface uses; the cropper's `fit` otherwise. */\n fit?: CropFit;\n};\n\nexport type ImageCropperResult = { width: number; height: number; type: CropOutputType };\n\nexport type ImageCropperProps = {\n /**\n * The picked file (from FileTrigger, already checked for size and type), or an image URL. A URL from\n * another origin is loaded with CORS so the crop can be read back: its server must send\n * `Access-Control-Allow-Origin`, or the image does not open (rather than failing later at save).\n */\n src: Blob | string;\n /** What is being cropped (\"Cover photo\"); names the crop frame. */\n label: string;\n /** 16:9 by default; `\"free\"` keeps the image's own shape. Ignored when presets are given. */\n aspectRatio?: ImageCropperAspect;\n /** Two or more shapes to choose from (a segmented control); the first is selected. */\n aspectPresets?: readonly ImageCropperPreset[];\n /** `cover` (default) fills the frame; `contain` fits the whole image and leaves empty area. */\n fit?: CropFit;\n /** The empty area's colour in `contain` when the output has no alpha (JPEG). White by default. */\n background?: string;\n /** `image/jpeg` by default. PNG and WebP keep transparency. */\n outputType?: CropOutputType;\n /** 0–1, for JPEG and WebP. 0.9 by default. */\n quality?: number;\n /**\n * The largest file the surface takes, in bytes. A JPEG or WebP\n * over it is encoded again at a quality 0.1 lower each time, down to `minimumQuality`; when even that is over, or\n * a PNG is, nothing is handed to `onCrop` and the cropper says the image is over the limit (a smaller crop, by\n * zooming in, or another image fits).\n */\n maxBytes?: number;\n /** The lowest quality `maxBytes` may step down to (0.9 keeps a hero or slide sharp). 0.1 by default; at most `quality`. */\n minimumQuality?: number;\n /**\n * The output's long edge in px at most (a surface's size, 2560 for a full-width photo): larger crops scale down,\n * never up. 4096 by default, so a 48 MP phone photo stays within every browser's canvas limit.\n */\n maxOutputSize?: number;\n /** Under this long edge the warning shows; it never blocks. */\n minOutputSize?: number;\n /** The output file's name without extension; the source file's name by default. */\n fileName?: string;\n onCrop: (file: File, result: ImageCropperResult) => unknown;\n onCancel?: () => void;\n};\n\nconst STAGE_ASPECT = 16 / 10;\nconst FRAME_INSET = 0.06;\nconst ZOOM_STEP = 0.1;\n/** Fixed paper and light grey: the frame and checkerboard draw on the photo, not on a theme surface. */\nconst CHECKER = \"repeating-conic-gradient(#ebe9e6 0 25%, #fcfcfb 0 50%) 0 0 / 16px 16px\";\nconst SWATCHES = [\"#ffffff\", \"#ebe9e6\", \"#0e0c09\"] as const;\nconst TYPE_NAMES: Record<CropOutputType, string> = { \"image/jpeg\": \"JPEG\", \"image/png\": \"PNG\", \"image/webp\": \"WebP\" };\n\ntype Loaded = { image: HTMLImageElement; width: number; height: number };\n\n/** The image behind `src`, decoded; an object URL for a file, revoked when it changes. */\nfunction useSourceImage(src: Blob | string) {\n const [state, setState] = React.useState<{ url?: string; loaded?: Loaded; failed?: boolean }>({});\n React.useEffect(() => {\n const url = typeof src === \"string\" ? src : URL.createObjectURL(src);\n let live = true;\n setState({ url });\n const image = new Image();\n image.decoding = \"async\";\n // A URL from a CDN must not taint the canvas, or the crop could never be read back.\n if (typeof src === \"string\" && !/^(data|blob):/.test(src)) image.crossOrigin = \"anonymous\";\n image.onload = () => live && setState({ url, loaded: { image, width: image.naturalWidth, height: image.naturalHeight } });\n image.onerror = () => live && setState({ url, failed: true });\n image.src = url;\n return () => {\n live = false;\n if (typeof src !== \"string\") URL.revokeObjectURL(url);\n };\n }, [src]);\n return state;\n}\n\n/** The element's width in whole px, following resizes. */\nfunction useWidth() {\n const [element, setElement] = React.useState<HTMLElement | null>(null);\n const [width, setWidth] = React.useState(0);\n React.useLayoutEffect(() => {\n if (!element) return;\n setWidth(Math.floor(element.getBoundingClientRect().width));\n if (typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver(([entry]) => setWidth(Math.floor(entry!.contentRect.width)));\n observer.observe(element);\n return () => observer.disconnect();\n }, [element]);\n return [setElement, width, element] as const;\n}\n\n/**\n * Frames one picked image to the shape a surface needs (a 16:9 cover photo, a square logo) and hands\n * back the cropped file at the source's own pixel density: never upscaled, only scaled down to\n * `maxOutputSize`. In `contain`, the empty area takes `background` when the output has no\n * alpha, white by default, never black. A sunken stage dims what falls outside a white frame\n * with thirds guides; the toolbar holds the shapes, zoom, rotation and fit. The frame is one focusable\n * group: arrows move the image (Shift for 10%), + and − zoom, [ and ] rotate, and each change is announced.\n * The toolbar mirrors in RTL; the image and the arrows never do.\n */\nexport function ImageCropper({\n src,\n label,\n aspectRatio = 16 / 9,\n aspectPresets,\n fit: fitProp = \"cover\",\n background: backgroundProp = \"#ffffff\",\n outputType = \"image/jpeg\",\n quality = 0.9,\n maxBytes,\n minimumQuality,\n maxOutputSize = 4096,\n minOutputSize,\n fileName,\n onCrop,\n onCancel,\n}: ImageCropperProps) {\n const { locale } = useLocale();\n const source = useSourceImage(src);\n const presets = aspectPresets && aspectPresets.length > 1 ? aspectPresets : undefined;\n const [presetId, setPresetId] = React.useState(presets?.[0]?.id);\n const preset = presets?.find((item) => item.id === presetId) ?? presets?.[0];\n const [fit, setFit] = React.useState<CropFit>(preset?.fit ?? fitProp);\n const [background, setBackground] = React.useState(backgroundProp);\n // Props changed later win again: a new fit or background from the surface.\n React.useEffect(() => setFit(preset?.fit ?? fitProp), [fitProp]); // preset changes set fit themselves\n React.useEffect(() => setBackground(backgroundProp), [backgroundProp]);\n // `true` a failed save; \"too-large\" a crop over `maxBytes` at the lowest quality allowed.\n const [saveError, setSaveError] = React.useState<boolean | \"too-large\">(false);\n const [rotation, setRotation] = React.useState<CropRotation>(0);\n const [zoom, setZoom] = React.useState(1);\n const [center, setCenter] = React.useState<{ x: number; y: number } | null>(null);\n const [status, setStatus] = React.useState(\"\");\n const [saving, setSaving] = React.useState(false);\n const [stageRef, stageWidth, stageElement] = useWidth();\n const helpId = React.useId();\n\n const loaded = source.loaded;\n // A new picture starts afresh: upright, whole, centred.\n React.useEffect(() => {\n setRotation(0);\n setZoom(1);\n setCenter(null);\n setStatus(\"\");\n setSaveError(false);\n }, [source.url]);\n const turned = loaded ? rotatedSize(loaded.width, loaded.height, rotation) : { width: 1, height: 1 };\n const shape = preset ? preset.aspectRatio : aspectRatio;\n const aspect = shape === \"free\" ? turned.width / turned.height : shape;\n const centerX = center?.x ?? turned.width / 2;\n const centerY = center?.y ?? turned.height / 2;\n const region = cropRegion(turned, aspect, fit, { zoom, centerX, centerY });\n const size = outputSize(region, { maxOutputSize, minOutputSize });\n // The warning is about the source, not the zoom: shown when even the whole fit is under the surface's size.\n const sourceTooSmall = outputSize(cropRegion(turned, aspect, fit, { zoom: 1, centerX, centerY }), { maxOutputSize, minOutputSize }).small;\n const alpha = hasAlpha(outputType);\n\n // The frame inside the stage: the largest rectangle of the crop's shape, inset from the edges.\n const stageHeight = Math.round(stageWidth / STAGE_ASPECT);\n const roomWidth = stageWidth * (1 - 2 * FRAME_INSET);\n const roomHeight = stageHeight * (1 - 2 * FRAME_INSET);\n const frameWidth = Math.min(roomWidth, roomHeight * aspect);\n const frameHeight = frameWidth / aspect;\n const frameLeft = (stageWidth - frameWidth) / 2;\n const frameTop = (stageHeight - frameHeight) / 2;\n const scale = region.width > 0 ? frameWidth / region.width : 0;\n\n const percent = React.useMemo(() => new Intl.NumberFormat(intlLocale(locale), { style: \"percent\", maximumFractionDigits: 0 }), [locale]);\n const describe = (nextZoom: number, x: number, y: number, dims: { width: number; height: number } = turned) => {\n const across = x / dims.width;\n const down = y / dims.height;\n const position = Math.abs(across - 0.5) < 0.005 && Math.abs(down - 0.5) < 0.005 ? cropCenteredLabel(locale) : cropPositionLabel(locale, percent.format(across), percent.format(down));\n return cropStatusLabel(locale, percent.format(nextZoom), position);\n };\n\n // The latest position, ahead of React's render: several keys or wheel ticks in one task each build on the\n // one before instead of the same rendered state.\n const live = React.useRef({ zoom, x: centerX, y: centerY, rotation });\n live.current = { zoom, x: centerX, y: centerY, rotation };\n const turnedFor = (turn: CropRotation) => (loaded ? rotatedSize(loaded.width, loaded.height, turn) : turned);\n\n // Every change keeps the centre where the region can be, then says where things are.\n const apply = (next: { zoom?: number; x?: number; y?: number; rotation?: CropRotation }, announce = true) => {\n const base = live.current;\n const nextRotation = next.rotation ?? base.rotation;\n const nextTurned = turnedFor(nextRotation);\n const nextAspect = shape === \"free\" ? nextTurned.width / nextTurned.height : shape;\n const nextZoom = clampZoom(next.zoom ?? base.zoom);\n const settled = cropRegion(nextTurned, nextAspect, fit, { zoom: nextZoom, centerX: next.x ?? base.x, centerY: next.y ?? base.y });\n const x = settled.left + settled.width / 2;\n const y = settled.top + settled.height / 2;\n live.current = { zoom: nextZoom, x, y, rotation: nextRotation };\n setZoom(nextZoom);\n setCenter({ x, y });\n if (next.rotation !== undefined) setRotation(nextRotation);\n if (announce) setStatus(describe(nextZoom, x, y, nextTurned));\n };\n const zoomBy = (delta: number, announce = true) => apply({ zoom: live.current.zoom + delta }, announce);\n const nudge = (dx: number, dy: number) => {\n const size = turnedFor(live.current.rotation);\n apply({ x: live.current.x - dx * size.width, y: live.current.y - dy * size.height });\n };\n const rotate = (turn: 90 | -90) => {\n const next = ((((live.current.rotation + turn) % 360) + 360) % 360) as CropRotation;\n // The new shape starts centred.\n const nextTurned = turnedFor(next);\n apply({ rotation: next, x: nextTurned.width / 2, y: nextTurned.height / 2 });\n };\n\n const onKeyDown = (event: React.KeyboardEvent) => {\n // Browser zoom (Ctrl/Cmd with + and −) and other shortcuts stay the browser's.\n if (event.ctrlKey || event.metaKey || event.altKey) return;\n const step = event.shiftKey ? 0.1 : 0.01;\n // Spatial, so never mirrored in RTL: the image moves the way the arrow points.\n const moves: Record<string, [number, number]> = { ArrowLeft: [-step, 0], ArrowRight: [step, 0], ArrowUp: [0, -step], ArrowDown: [0, step] };\n if (moves[event.key]) nudge(...moves[event.key]!);\n else if (event.key === \"+\" || event.key === \"=\") zoomBy(ZOOM_STEP);\n else if (event.key === \"-\" || event.key === \"_\") zoomBy(-ZOOM_STEP);\n else if (event.key === \"[\") rotate(-90);\n else if (event.key === \"]\") rotate(90);\n else return;\n event.preventDefault();\n };\n\n // Pointer: drag moves, the wheel zooms.\n const drag = React.useRef<{ x: number; y: number; centerX: number; centerY: number } | null>(null);\n const onPointerDown = (event: React.PointerEvent) => {\n if (!loaded || event.button !== 0) return;\n (event.currentTarget as HTMLElement).setPointerCapture?.(event.pointerId);\n drag.current = { x: event.clientX, y: event.clientY, centerX, centerY };\n };\n const onPointerMove = (event: React.PointerEvent) => {\n if (!drag.current || scale <= 0) return;\n apply({ x: drag.current.centerX - (event.clientX - drag.current.x) / scale, y: drag.current.centerY - (event.clientY - drag.current.y) / scale }, false);\n };\n const onPointerUp = () => {\n if (drag.current) setStatus(describe(live.current.zoom, live.current.x, live.current.y, turnedFor(live.current.rotation)));\n drag.current = null;\n };\n\n // The wheel zooms in proportion to how far it turns (a trackpad sends many small steps) and never scrolls\n // the page underneath: React's wheel listener is passive, so this one is native.\n const wheelRef = React.useRef<(event: WheelEvent) => void>(() => {});\n wheelRef.current = (event: WheelEvent) => {\n if (!loaded || event.deltaY === 0) return;\n const pixels = event.deltaMode === 1 ? event.deltaY * 16 : event.deltaMode === 2 ? event.deltaY * 400 : event.deltaY;\n const zoomingIn = pixels < 0;\n // At a limit in the wheel's direction the page scrolls on, as it does over any other part of it.\n if ((zoomingIn && live.current.zoom >= MAX_ZOOM) || (!zoomingIn && live.current.zoom <= MIN_ZOOM)) return;\n event.preventDefault();\n zoomBy(Math.max(-0.5, Math.min(0.5, -pixels / 500)), false);\n };\n React.useEffect(() => {\n if (!stageElement) return;\n const onWheel = (event: WheelEvent) => wheelRef.current(event);\n stageElement.addEventListener(\"wheel\", onWheel, { passive: false });\n return () => stageElement.removeEventListener(\"wheel\", onWheel);\n }, [stageElement]);\n\n const save = async () => {\n if (!loaded) return;\n setSaving(true);\n setSaveError(false);\n try {\n const canvas = document.createElement(\"canvas\");\n canvas.width = size.width;\n canvas.height = size.height;\n const context = canvas.getContext(\"2d\");\n if (!context) throw new Error(\"canvas-unavailable\");\n drawCrop(context, loaded.image, loaded, region, size, { rotation, outputType, background });\n const encoded = await encodeWithin((step) => new Promise<Blob | null>((resolve) => canvas.toBlob(resolve, outputType, step)), {\n outputType,\n quality,\n minimumQuality,\n maxBytes,\n });\n if (!encoded.fits) {\n setSaveError(\"too-large\");\n return;\n }\n const blob = encoded.blob;\n const base = fileName ?? (typeof src !== \"string\" && \"name\" in src ? String((src as File).name).replace(/\\.[^.]+$/, \"\") : \"image\");\n await onCrop(new File([blob], `${base}.${extensionOf(outputType)}`, { type: outputType }), { width: size.width, height: size.height, type: outputType });\n } catch {\n // No canvas, a tainted canvas (a cross-origin image), a canvas too large for the device, or the app's\n // own save failing: say so and keep the crop, so it can be tried again.\n setSaveError(true);\n } finally {\n setSaving(false);\n }\n };\n\n const showBackground = fit === \"contain\" && !alpha;\n const swatches = [...new Set<string>([...SWATCHES, backgroundProp.toLowerCase()])].map((value) => ({\n value,\n name: value === \"#ffffff\" ? colorWhiteLabel(locale) : value === \"#ebe9e6\" ? colorLightGreyLabel(locale) : value === \"#0e0c09\" ? colorBlackLabel(locale) : value,\n }));\n const sizeText = `${size.width} × ${size.height} px`;\n\n return (\n <div data-slot=\"image-cropper\" className=\"flex min-w-0 flex-col gap-ds-150\">\n <div\n ref={stageRef}\n // Spatial: the photo and its frame never mirror; logical classes inside resolve as left and right.\n dir=\"ltr\"\n data-slot=\"image-cropper-stage\"\n className=\"relative w-full touch-none overflow-hidden rounded-ds-large bg-ds-surface-sunken select-none\"\n // Whole pixels once measured: a fractional height would shift everything below it off the pixel grid.\n style={stageWidth > 0 ? { height: stageHeight } : { aspectRatio: String(STAGE_ASPECT) }}\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={onPointerUp}\n onPointerCancel={onPointerUp}\n >\n {source.failed && (\n <p data-slot=\"image-cropper-error\" role=\"alert\" className=\"absolute inset-0 m-0 grid place-items-center p-ds-300 text-center text-body text-ds-text-subtle\">\n {cropLoadFailedLabel(locale)}\n </p>\n )}\n {loaded && stageWidth > 0 && (\n <>\n {/* What the empty area of the output will be: kept transparent (checkerboard) or the background. */}\n <div\n aria-hidden\n data-slot=\"image-cropper-fill\"\n className=\"absolute\"\n style={{ left: frameLeft, top: frameTop, width: frameWidth, height: frameHeight, background: alpha ? CHECKER : background }}\n />\n <div\n aria-hidden\n data-slot=\"image-cropper-image\"\n className=\"absolute\"\n style={{ left: frameLeft - region.left * scale, top: frameTop - region.top * scale, width: turned.width * scale, height: turned.height * scale }}\n >\n <img\n src={source.url}\n alt=\"\"\n draggable={false}\n className=\"absolute start-1/2 top-1/2 max-w-none\"\n style={{ width: loaded.width * scale, height: loaded.height * scale, transform: `translate(-50%, -50%) rotate(${rotation}deg)` }}\n />\n </div>\n </>\n )}\n <div\n role=\"group\"\n aria-label={label}\n aria-describedby={helpId}\n tabIndex={loaded ? 0 : -1}\n data-slot=\"image-cropper-frame\"\n onKeyDown={onKeyDown}\n className=\"absolute border border-[#fcfcfb] outline-hidden focus-visible:inset-ring-2 focus-visible:inset-ring-ds-border-focused\"\n // The blanket dims everything outside the frame.\n style={{ left: frameLeft, top: frameTop, width: frameWidth, height: frameHeight, boxShadow: \"0 0 0 9999px var(--ds-blanket)\" }}\n >\n {/* Rule-of-thirds guides, paper at 40%. */}\n <span aria-hidden className=\"absolute inset-y-0 start-1/3 w-px bg-[#fcfcfb]/40\" />\n <span aria-hidden className=\"absolute inset-y-0 start-2/3 w-px bg-[#fcfcfb]/40\" />\n <span aria-hidden className=\"absolute inset-x-0 top-1/3 h-px bg-[#fcfcfb]/40\" />\n <span aria-hidden className=\"absolute inset-x-0 top-2/3 h-px bg-[#fcfcfb]/40\" />\n {([\"-start-1.5 -top-1.5\", \"-end-1.5 -top-1.5\", \"-start-1.5 -bottom-1.5\", \"-end-1.5 -bottom-1.5\"] as const).map((corner) => (\n <span key={corner} aria-hidden data-slot=\"image-cropper-handle\" className={cn(\"absolute size-3 rounded-[2px] bg-[#fcfcfb] shadow-ds-raised\", corner)} />\n ))}\n </div>\n <span id={helpId} className=\"sr-only\">\n {cropHelpLabel(locale)}\n </span>\n <span role=\"status\" data-slot=\"image-cropper-status\" className=\"sr-only\">\n {status}\n </span>\n </div>\n\n <div data-slot=\"image-cropper-toolbar\" className=\"flex flex-wrap items-center gap-ds-150\">\n {presets && (\n <SegmentedControl\n label={cropAspectLabel(locale)}\n items={presets.map((item) => ({ id: item.id, label: item.label }))}\n value={preset?.id}\n onChange={(id) => {\n const next = presets.find((item) => item.id === id);\n setPresetId(String(id));\n if (next?.fit) setFit(next.fit);\n setCenter(null);\n setZoom(1);\n }}\n />\n )}\n <div data-slot=\"image-cropper-zoom\" className=\"flex min-w-48 flex-1 items-center gap-ds-100\">\n <Button size=\"small\" variant=\"subtle\" iconOnly iconBefore=\"minus\" aria-label={cropZoomOutLabel(locale)} isDisabled={!loaded || zoom <= MIN_ZOOM} onPress={() => zoomBy(-ZOOM_STEP)} />\n <AriaSlider\n aria-label={cropZoomLabel(locale)}\n minValue={MIN_ZOOM}\n maxValue={MAX_ZOOM}\n // Fine enough that a wheel or keyboard zoom is always a value the slider can show.\n step={0.01}\n value={zoom}\n onChange={(value) => apply({ zoom: value as number }, false)}\n onChangeEnd={() => setStatus(describe(live.current.zoom, live.current.x, live.current.y, turnedFor(live.current.rotation)))}\n isDisabled={!loaded}\n formatOptions={{ style: \"percent\" }}\n data-slot=\"image-cropper-zoom-slider\"\n className=\"min-w-24 flex-1\"\n >\n <SliderTrack className={SLIDER_TRACK}>\n {({ state }) => (\n <>\n <span aria-hidden className={SLIDER_RAIL} />\n <span aria-hidden className={SLIDER_FILL} style={{ insetInlineStart: 0, insetInlineEnd: `${100 - state.getThumbPercent(0) * 100}%` }} />\n <SliderThumb className={SLIDER_THUMB} />\n </>\n )}\n </SliderTrack>\n </AriaSlider>\n <Button size=\"small\" variant=\"subtle\" iconOnly iconBefore=\"plus\" aria-label={cropZoomInLabel(locale)} isDisabled={!loaded || zoom >= MAX_ZOOM} onPress={() => zoomBy(ZOOM_STEP)} />\n <span data-slot=\"image-cropper-zoom-value\" className=\"w-12 text-body-small tabular-nums text-ds-text-subtle\">\n {percent.format(zoom)}\n </span>\n </div>\n <span aria-hidden className=\"h-5 w-px bg-ds-border\" />\n <Button size=\"small\" variant=\"subtle\" iconOnly iconBefore=\"rotate-ccw\" aria-label={cropRotateLeftLabel(locale)} isDisabled={!loaded} onPress={() => rotate(-90)} />\n <Button size=\"small\" variant=\"subtle\" iconOnly iconBefore=\"rotate-cw\" aria-label={cropRotateRightLabel(locale)} isDisabled={!loaded} onPress={() => rotate(90)} />\n {presets && (\n <SegmentedControl\n label={cropFitLabel(locale)}\n items={[\n { id: \"cover\", label: cropCoverLabel(locale) },\n { id: \"contain\", label: cropContainLabel(locale) },\n ]}\n value={fit}\n onChange={(value) => {\n setFit(value as CropFit);\n setCenter(null);\n setZoom(1);\n }}\n />\n )}\n </div>\n\n {showBackground && (\n <ColorSwatchPicker label={cropBackgroundLabel(locale)} items={swatches} value={background.toLowerCase()} onChange={setBackground} />\n )}\n\n <div data-slot=\"image-cropper-meta\" className=\"flex flex-col gap-ds-050 text-body-small tabular-nums\">\n {loaded && (\n <span className=\"text-ds-text-subtlest\">\n {cropOutputLabel(locale, sizeText, TYPE_NAMES[outputType])}\n {alpha && fit === \"contain\" ? ` (${cropKeepsAlphaLabel(locale)})` : \"\"}\n </span>\n )}\n {loaded && sourceTooSmall && (\n <span data-slot=\"image-cropper-warning\" className=\"flex items-center gap-ds-050 text-ds-text-warning\">\n <IconGlyph name=\"triangle-alert\" size=\"small\" />\n {cropSmallLabel(locale, String(turned.width), sizeText)}\n </span>\n )}\n </div>\n\n {saveError && (\n <p\n role=\"alert\"\n data-slot=\"image-cropper-save-error\"\n data-reason={saveError === \"too-large\" ? \"too-large\" : undefined}\n className=\"m-0 flex items-center gap-ds-050 text-body-small text-ds-text-danger\"\n >\n <IconGlyph name=\"circle-alert\" size=\"small\" />\n {saveError === \"too-large\" && maxBytes ? cropTooLargeLabel(locale, formatFileSize(maxBytes, intlLocale(locale))) : cropSaveFailedLabel(locale)}\n </p>\n )}\n\n <div data-slot=\"image-cropper-actions\" className=\"flex flex-wrap justify-end gap-ds-100\">\n {onCancel && <Button onPress={onCancel}>{cancelLabel(locale)}</Button>}\n <Button variant=\"primary\" isPending={saving} isDisabled={!loaded} onPress={() => void save()}>\n {cropSaveLabel(locale)}\n </Button>\n </div>\n </div>\n );\n}\n"]}
@@ -1,30 +0,0 @@
1
- import * as React from "react";
2
- export type LozengeTone = "neutral" | "information" | "brand" | "success" | "warning" | "danger";
3
- /** `subtle` and `bold` are pills; `plain` is a dot and the word, for a live system state (online, syncing). */
4
- export type LozengeAppearance = "subtle" | "bold" | "plain";
5
- type Base = {
6
- /**
7
- * One meaning per tone: information (Approved, In progress) · brand (Featured) · success
8
- * (Completed, Available, Paid) · warning (Payment pending, Under review) · danger (Canceled,
9
- * Failed, Overdue) · neutral (Draft, Inactive).
10
- */
11
- tone?: LozengeTone;
12
- /** `bold` for the one status on the screen that needs attention now; `plain` for a live system state. */
13
- appearance?: LozengeAppearance;
14
- /** A 6px dot inside a pill (subtle or bold), for live states. `plain` always has its dot. */
15
- hasDot?: boolean;
16
- /** `plain` only: a 3px halo for a state that is active right now (connected, syncing). */
17
- isLive?: boolean;
18
- };
19
- export type LozengeProps = Base & ({
20
- /** The status word, sentence case ("Payment pending"); the word carries the meaning, never the colour. */
21
- children: React.ReactNode;
22
- "aria-label"?: never;
23
- } | {
24
- children?: never;
25
- /** `plain` only, where a visible word is impossible (a dense table cell with its own column header). */
26
- "aria-label": string;
27
- });
28
- /** The status of a record, or a live state, in one or two words. Not interactive; never inside a button. */
29
- export declare function Lozenge({ children, tone, appearance, hasDot, isLive, "aria-label": ariaLabel }: LozengeProps): React.JSX.Element;
30
- export {};
@@ -1,55 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import * as React from "react";
3
- import { cn } from "../utils.js";
4
- const SUBTLE = {
5
- neutral: "bg-ds-background-neutral text-ds-text-subtle",
6
- information: "bg-ds-background-information text-ds-text-information",
7
- brand: "bg-ds-background-brand-subtle text-ds-text-brand",
8
- success: "bg-ds-background-success text-ds-text-success",
9
- warning: "bg-ds-background-warning text-ds-text-warning",
10
- danger: "bg-ds-background-danger text-ds-text-danger",
11
- };
12
- const BOLD = {
13
- neutral: "bg-ds-background-neutral-bold text-ds-text-inverse",
14
- information: "bg-ds-background-information-bold text-ds-text-on-bold",
15
- brand: "bg-ds-background-brand-bold text-ds-text-on-brand",
16
- success: "bg-ds-background-success-bold text-ds-text-on-bold",
17
- warning: "bg-ds-background-warning-bold text-ds-text-on-warning",
18
- danger: "bg-ds-background-danger-bold text-ds-text-on-danger",
19
- };
20
- // `plain`: the 8px dot in the tone's icon color; the word stays in the body color.
21
- const DOT = {
22
- neutral: "bg-ds-icon-subtle",
23
- information: "bg-ds-icon-information",
24
- brand: "bg-ds-icon-brand",
25
- success: "bg-ds-icon-success",
26
- warning: "bg-ds-icon-warning",
27
- danger: "bg-ds-icon-danger",
28
- };
29
- // The live halo sits in the tone's status background.
30
- const HALO = {
31
- neutral: "ring-ds-background-neutral",
32
- information: "ring-ds-background-information",
33
- brand: "ring-ds-background-brand-subtle",
34
- success: "ring-ds-background-success",
35
- warning: "ring-ds-background-warning",
36
- danger: "ring-ds-background-danger",
37
- };
38
- /** The status of a record, or a live state, in one or two words. Not interactive; never inside a button. */
39
- export function Lozenge({ children, tone = "neutral", appearance = "subtle", hasDot, isLive, "aria-label": ariaLabel }) {
40
- if (appearance === "plain") {
41
- // null, false and "" are no word either.
42
- const hasWord = children != null && children !== false && children !== "";
43
- const dot = (_jsx("span", { "data-slot": "lozenge-dot", "aria-hidden": true, className: cn("size-ds-100 shrink-0 rounded-ds-full", DOT[tone], isLive && cn("ring-3", HALO[tone])) }));
44
- if (!hasWord) {
45
- return (
46
- // A named image with a label; without one it only decorates, never an unnamed image.
47
- _jsx("span", { role: ariaLabel ? "img" : undefined, "aria-label": ariaLabel, "aria-hidden": ariaLabel ? undefined : true, "data-slot": "lozenge", "data-tone": tone, "data-appearance": "plain", "data-live": isLive || undefined, className: "inline-flex items-center", children: dot }));
48
- }
49
- return (
50
- // The halo is a shadow and takes no space, so a live dot gets the wider gap to keep the word clear of it.
51
- _jsxs("span", { "data-slot": "lozenge", "data-tone": tone, "data-appearance": "plain", "data-live": isLive || undefined, className: cn("inline-flex items-center text-body text-ds-text", isLive ? "gap-ds-100" : "gap-ds-075"), children: [dot, _jsx("span", { "data-slot": "lozenge-label", children: children })] }));
52
- }
53
- return (_jsxs("span", { "data-slot": "lozenge", "data-tone": tone, "data-appearance": appearance, className: cn("inline-flex h-5 shrink-0 items-center gap-ds-050 rounded-ds-xsmall px-ds-075 text-body-small font-medium whitespace-nowrap", appearance === "bold" ? BOLD[tone] : SUBTLE[tone]), children: [hasDot && _jsx("span", { "data-slot": "lozenge-dot", "aria-hidden": true, className: "size-1.5 rounded-ds-full bg-current" }), children] }));
54
- }
55
- //# sourceMappingURL=lozenge.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lozenge.js","sourceRoot":"","sources":["../../src/display/lozenge.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAM9B,MAAM,MAAM,GAAgC;IAC1C,OAAO,EAAE,8CAA8C;IACvD,WAAW,EAAE,uDAAuD;IACpE,KAAK,EAAE,kDAAkD;IACzD,OAAO,EAAE,+CAA+C;IACxD,OAAO,EAAE,+CAA+C;IACxD,MAAM,EAAE,6CAA6C;CACtD,CAAC;AACF,MAAM,IAAI,GAAgC;IACxC,OAAO,EAAE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AAC,CAAC,CAAC,SAAS,gBACvB,SAAS,iBACR,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,eAC/B,SAAS,eACR,IAAI,qBACC,OAAO,eACZ,MAAM,IAAI,SAAS,EAC9B,SAAS,EAAC,0BAA0B,YAEnC,GAAG,GACC,CACR,CAAC;QACJ,CAAC;QACD,OAAO;QACL,0GAA0G;QAC1G,6BACY,SAAS,eACR,IAAI,qBACC,OAAO,eACZ,MAAM,IAAI,SAAS,EAC9B,SAAS,EAAE,EAAE,CAAC,iDAAiD,EAAE,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,aAErG,GAAG,EACJ,4BAAgB,eAAe,YAAE,QAAQ,GAAQ,IAC5C,CACR,CAAC;IACJ,CAAC;IACD,OAAO,CACL,6BACY,SAAS,eACR,IAAI,qBACE,UAAU,EAC3B,SAAS,EAAE,EAAE,CACX,4HAA4H,EAC5H,UAAU,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAClD,aAEA,MAAM,IAAI,4BAAgB,aAAa,uBAAa,SAAS,EAAC,qCAAqC,GAAG,EACtG,QAAQ,IACJ,CACR,CAAC;AACJ,CAAC","sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"../utils\";\n\nexport type LozengeTone = \"neutral\" | \"information\" | \"brand\" | \"success\" | \"warning\" | \"danger\";\n/** `subtle` and `bold` are pills; `plain` is a dot and the word, for a live system state (online, syncing). */\nexport type LozengeAppearance = \"subtle\" | \"bold\" | \"plain\";\n\nconst SUBTLE: Record<LozengeTone, string> = {\n neutral: \"bg-ds-background-neutral text-ds-text-subtle\",\n information: \"bg-ds-background-information text-ds-text-information\",\n brand: \"bg-ds-background-brand-subtle text-ds-text-brand\",\n success: \"bg-ds-background-success text-ds-text-success\",\n warning: \"bg-ds-background-warning text-ds-text-warning\",\n danger: \"bg-ds-background-danger text-ds-text-danger\",\n};\nconst BOLD: Record<LozengeTone, string> = {\n neutral: \"bg-ds-background-neutral-bold text-ds-text-inverse\",\n information: \"bg-ds-background-information-bold text-ds-text-on-bold\",\n brand: \"bg-ds-background-brand-bold text-ds-text-on-brand\",\n success: \"bg-ds-background-success-bold text-ds-text-on-bold\",\n warning: \"bg-ds-background-warning-bold text-ds-text-on-warning\",\n danger: \"bg-ds-background-danger-bold text-ds-text-on-danger\",\n};\n// `plain`: the 8px dot in the tone's icon color; the word stays in the body color.\nconst DOT: Record<LozengeTone, string> = {\n neutral: \"bg-ds-icon-subtle\",\n information: \"bg-ds-icon-information\",\n brand: \"bg-ds-icon-brand\",\n success: \"bg-ds-icon-success\",\n warning: \"bg-ds-icon-warning\",\n danger: \"bg-ds-icon-danger\",\n};\n// The live halo sits in the tone's status background.\nconst HALO: Record<LozengeTone, string> = {\n neutral: \"ring-ds-background-neutral\",\n information: \"ring-ds-background-information\",\n brand: \"ring-ds-background-brand-subtle\",\n success: \"ring-ds-background-success\",\n warning: \"ring-ds-background-warning\",\n danger: \"ring-ds-background-danger\",\n};\n\ntype Base = {\n /**\n * One meaning per tone: information (Approved, In progress) · brand (Featured) · success\n * (Completed, Available, Paid) · warning (Payment pending, Under review) · danger (Canceled,\n * Failed, Overdue) · neutral (Draft, Inactive).\n */\n tone?: LozengeTone;\n /** `bold` for the one status on the screen that needs attention now; `plain` for a live system state. */\n appearance?: LozengeAppearance;\n /** A 6px dot inside a pill (subtle or bold), for live states. `plain` always has its dot. */\n hasDot?: boolean;\n /** `plain` only: a 3px halo for a state that is active right now (connected, syncing). */\n isLive?: boolean;\n};\n\nexport type LozengeProps = Base &\n (\n | {\n /** The status word, sentence case (\"Payment pending\"); the word carries the meaning, never the colour. */\n children: React.ReactNode;\n \"aria-label\"?: never;\n }\n | {\n children?: never;\n /** `plain` only, where a visible word is impossible (a dense table cell with its own column header). */\n \"aria-label\": string;\n }\n );\n\n/** The status of a record, or a live state, in one or two words. Not interactive; never inside a button. */\nexport function Lozenge({ children, tone = \"neutral\", appearance = \"subtle\", hasDot, isLive, \"aria-label\": ariaLabel }: LozengeProps) {\n if (appearance === \"plain\") {\n // null, false and \"\" are no word either.\n const hasWord = children != null && children !== false && children !== \"\";\n const dot = (\n <span data-slot=\"lozenge-dot\" aria-hidden className={cn(\"size-ds-100 shrink-0 rounded-ds-full\", DOT[tone], isLive && cn(\"ring-3\", HALO[tone]))} />\n );\n if (!hasWord) {\n return (\n // A named image with a label; without one it only decorates, never an unnamed image.\n <span\n role={ariaLabel ? \"img\" : undefined}\n aria-label={ariaLabel}\n aria-hidden={ariaLabel ? undefined : true}\n data-slot=\"lozenge\"\n data-tone={tone}\n data-appearance=\"plain\"\n data-live={isLive || undefined}\n className=\"inline-flex items-center\"\n >\n {dot}\n </span>\n );\n }\n return (\n // The halo is a shadow and takes no space, so a live dot gets the wider gap to keep the word clear of it.\n <span\n data-slot=\"lozenge\"\n data-tone={tone}\n data-appearance=\"plain\"\n data-live={isLive || undefined}\n className={cn(\"inline-flex items-center text-body text-ds-text\", isLive ? \"gap-ds-100\" : \"gap-ds-075\")}\n >\n {dot}\n <span data-slot=\"lozenge-label\">{children}</span>\n </span>\n );\n }\n return (\n <span\n data-slot=\"lozenge\"\n data-tone={tone}\n data-appearance={appearance}\n className={cn(\n \"inline-flex h-5 shrink-0 items-center gap-ds-050 rounded-ds-xsmall px-ds-075 text-body-small font-medium whitespace-nowrap\",\n appearance === \"bold\" ? BOLD[tone] : SUBTLE[tone],\n )}\n >\n {hasDot && <span data-slot=\"lozenge-dot\" aria-hidden className=\"size-1.5 rounded-ds-full bg-current\" />}\n {children}\n </span>\n );\n}\n"]}
@@ -1,29 +0,0 @@
1
- import * as React from "react";
2
- export type ScrollAreaProps = {
3
- children: React.ReactNode;
4
- /** Names the region; screen readers announce it when focus enters. */
5
- "aria-label": string;
6
- /** The region's height limit ("320px", 320, "60vh"); for horizontal areas, set the width on the parent. */
7
- maxHeight?: number | string;
8
- /**
9
- * Fills the parent's height and scrolls inside it, for a pane in a flex column or a grid
10
- * row that is given its height: a conversation's messages between its header and the reply box, a list
11
- * beside it. The parent must give the area a definite height (`min-h-0` on a flex or grid child).
12
- * Leave `maxHeight` out when filling.
13
- */
14
- fill?: boolean;
15
- orientation?: "vertical" | "horizontal" | "both";
16
- };
17
- /**
18
- * A fixed-size region with its own native scroll (never hijacked) and the
19
- * scrollbar contract (thin, a ds-border-bold thumb), plus an overflow
20
- * shadow on each edge where content continues. When it holds nothing
21
- * focusable it becomes a focusable region itself, so keyboard users can
22
- * scroll it with the arrow keys.
23
- *
24
- * Known deviation: the design's 6px thumb is drawn by the platform's thin
25
- * scrollbar (about 8–11px); standard CSS cannot size it further without
26
- * replacing native scrolling. With `orientation="both"` the edge shadows
27
- * follow the vertical axis.
28
- */
29
- export declare function ScrollArea({ children, "aria-label": ariaLabel, maxHeight, fill, orientation }: ScrollAreaProps): React.JSX.Element;
@@ -1,95 +0,0 @@
1
- "use client";
2
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
- import * as React from "react";
4
- import { cn } from "../utils.js";
5
- const TABBABLE = 'a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]), [contenteditable="true"]';
6
- /** A tabbable descendant that is not hidden or inert. */
7
- function hasTabbable(root) {
8
- return Array.from(root.querySelectorAll(TABBABLE)).some((element) => !element.closest("[hidden], [inert]"));
9
- }
10
- /**
11
- * A fixed-size region with its own native scroll (never hijacked) and the
12
- * scrollbar contract (thin, a ds-border-bold thumb), plus an overflow
13
- * shadow on each edge where content continues. When it holds nothing
14
- * focusable it becomes a focusable region itself, so keyboard users can
15
- * scroll it with the arrow keys.
16
- *
17
- * Known deviation: the design's 6px thumb is drawn by the platform's thin
18
- * scrollbar (about 8–11px); standard CSS cannot size it further without
19
- * replacing native scrolling. With `orientation="both"` the edge shadows
20
- * follow the vertical axis.
21
- */
22
- export function ScrollArea({ children, "aria-label": ariaLabel, maxHeight, fill = false, orientation = "vertical" }) {
23
- const viewport = React.useRef(null);
24
- const [edges, setEdges] = React.useState({ start: false, end: false });
25
- const [needsFocus, setNeedsFocus] = React.useState(false);
26
- // The thumb shows while scrolling and fades shortly after.
27
- const [scrolling, setScrolling] = React.useState(false);
28
- const scrollTimer = React.useRef(undefined);
29
- React.useEffect(() => () => window.clearTimeout(scrollTimer.current), []);
30
- // Every scroll event restarts the fade-out, so a long scroll keeps the thumb steady.
31
- const onScrolling = () => {
32
- window.clearTimeout(scrollTimer.current);
33
- setScrolling(true);
34
- scrollTimer.current = window.setTimeout(() => setScrolling(false), 800);
35
- };
36
- const horizontal = orientation === "horizontal";
37
- const room = () => {
38
- const frame = viewport.current;
39
- return frame ? (horizontal ? frame.scrollWidth - frame.clientWidth : frame.scrollHeight - frame.clientHeight) : 0;
40
- };
41
- /** Which edges hide content; cheap enough for every scroll event. */
42
- const measureEdges = React.useCallback(() => {
43
- const frame = viewport.current;
44
- if (!frame)
45
- return;
46
- // Horizontal scroll positions are negative in RTL; magnitudes work for both directions.
47
- const position = Math.abs(horizontal ? frame.scrollLeft : frame.scrollTop);
48
- const space = horizontal ? frame.scrollWidth - frame.clientWidth : frame.scrollHeight - frame.clientHeight;
49
- const next = { start: position > 1, end: space - position > 1 };
50
- setEdges((current) => (current.start === next.start && current.end === next.end ? current : next));
51
- }, [horizontal]);
52
- /** Whether the region must take focus itself: it scrolls and holds nothing focusable. Runs on size and content changes. */
53
- const measureFocus = React.useCallback(() => {
54
- const frame = viewport.current;
55
- if (!frame)
56
- return;
57
- const next = room() > 1 && !hasTabbable(frame);
58
- // Never pull focus out from under the keyboard: keep the tab stop while the region itself has focus.
59
- setNeedsFocus((current) => (current && !next && document.activeElement === frame ? current : next));
60
- }, [horizontal]);
61
- React.useLayoutEffect(() => {
62
- measureEdges();
63
- measureFocus();
64
- const frame = viewport.current;
65
- if (!frame)
66
- return;
67
- const sized = () => {
68
- measureEdges();
69
- measureFocus();
70
- };
71
- const resize = typeof ResizeObserver === "undefined" ? undefined : new ResizeObserver(sized);
72
- resize?.observe(frame);
73
- if (frame.firstElementChild)
74
- resize?.observe(frame.firstElementChild);
75
- // Children that appear, disappear or change focusability without changing size.
76
- const mutation = typeof MutationObserver === "undefined" ? undefined : new MutationObserver(sized);
77
- mutation?.observe(frame, { childList: true, subtree: true, attributes: true, attributeFilter: ["disabled", "tabindex", "hidden", "inert", "href", "contenteditable"] });
78
- return () => {
79
- resize?.disconnect();
80
- mutation?.disconnect();
81
- };
82
- }, [measureEdges, measureFocus]);
83
- const shadow = "pointer-events-none absolute z-[1] shadow-ds-overflow transition-opacity duration-(--ds-duration-instant)";
84
- return (
85
- // Clipped: the edge-shadow casters sit just outside the box and only their inward shadow may show,
86
- // so the area never makes its column (or the page) scroll sideways.
87
- _jsxs("div", { "data-slot": "scroll-area", "data-orientation": orientation, "data-fill": fill || undefined, className: cn("relative min-h-0 min-w-0 overflow-clip", fill && "h-full"), children: [_jsx("div", { ref: viewport, "data-slot": "scroll-area-viewport", role: needsFocus ? "region" : undefined, "aria-label": needsFocus ? ariaLabel : undefined, tabIndex: needsFocus ? 0 : undefined, onScroll: () => {
88
- measureEdges();
89
- onScrolling();
90
- }, onBlur: measureFocus, "data-scrolling": scrolling || undefined, style: { maxHeight }, className: cn("peer outline-hidden", fill && "h-full",
91
- // The scrollbar: thin, a ds-border-bold thumb at 70% on no track, shown on hover, keyboard
92
- // focus and while scrolling. Native underneath, so wheel, touch and keyboard scroll as usual.
93
- "[scrollbar-width:thin] [scrollbar-color:transparent_transparent]", "hover:[scrollbar-color:color-mix(in_oklab,var(--ds-border-bold)_70%,transparent)_transparent]", "focus-visible:[scrollbar-color:color-mix(in_oklab,var(--ds-border-bold)_70%,transparent)_transparent]", "data-[scrolling]:[scrollbar-color:color-mix(in_oklab,var(--ds-border-bold)_70%,transparent)_transparent]", orientation === "vertical" && "overflow-y-auto overflow-x-hidden", orientation === "horizontal" && "overflow-x-auto overflow-y-hidden", orientation === "both" && "overflow-auto"), children: _jsx("div", { "data-slot": "scroll-area-content", children: children }) }), horizontal ? (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": true, "data-slot": "scroll-area-edge", "data-edge": "start", className: cn(shadow, "inset-y-0 start-0 w-3 [clip-path:inset(0_-12px_0_0)] rtl:[clip-path:inset(0_0_0_-12px)] -translate-x-full rtl:translate-x-full", !edges.start && "opacity-0") }), _jsx("span", { "aria-hidden": true, "data-slot": "scroll-area-edge", "data-edge": "end", className: cn(shadow, "inset-y-0 end-0 w-3 [clip-path:inset(0_0_0_-12px)] rtl:[clip-path:inset(0_-12px_0_0)] translate-x-full rtl:-translate-x-full", !edges.end && "opacity-0") })] })) : (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": true, "data-slot": "scroll-area-edge", "data-edge": "start", className: cn(shadow, "inset-x-0 top-0 h-3 -translate-y-full [clip-path:inset(0_0_-12px_0)]", !edges.start && "opacity-0") }), _jsx("span", { "aria-hidden": true, "data-slot": "scroll-area-edge", "data-edge": "end", className: cn(shadow, "inset-x-0 bottom-0 h-3 translate-y-full [clip-path:inset(-12px_0_0_0)]", !edges.end && "opacity-0") })] })), _jsx("span", { "aria-hidden": true, "data-slot": "scroll-area-focus", className: "pointer-events-none absolute inset-0 z-[2] peer-focus-visible:inset-ring-2 peer-focus-visible:inset-ring-ds-border-focused" })] }));
94
- }
95
- //# sourceMappingURL=scroll-area.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scroll-area.js","sourceRoot":"","sources":["../../src/display/scroll-area.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAkB9B,MAAM,QAAQ,GACZ,0LAA0L,CAAC;AAE7L,yDAAyD;AACzD,SAAS,WAAW,CAAC,IAAiB;IACpC,OAAO,KAAK,C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C,EACnE,WAAW,KAAK,MAAM,IAAI,eAAe,CAC1C,YAED,2BAAe,qBAAqB,YAAE,QAAQ,GAAO,GACjD,EAEL,UAAU,CAAC,CAAC,CAAC,CACZ,8BACE,iDAA4B,kBAAkB,eAAW,OAAO,EAAC,SAAS,EAAE,EAAE,CAAC,MAAM,EAAE,gIAAgI,EAAE,CAAC,KAAK,CAAC,KAAK,IAAI,WAAW,CAAC,GAAI,EACzP,iDAA4B,kBAAkB,eAAW,KAAK,EAAC,SAAS,EAAE,EAAE,CAAC,MAAM,EAAE,8HAA8H,EAAE,CAAC,KAAK,CAAC,GAAG,IAAI,WAAW,CAAC,GAAI,IAClP,CACJ,CAAC,CAAC,CAAC,CACF,8BACE,iDAA4B,kBAAkB,eAAW,OAAO,EAAC,SAAS,EAAE,EAAE,CAAC,MAAM,EAAE,sEAAsE,EAAE,CAAC,KAAK,CAAC,KAAK,IAAI,WAAW,CAAC,GAAI,EAC/L,iDAA4B,kBAAkB,eAAW,KAAK,EAAC,SAAS,EAAE,EAAE,CAAC,MAAM,EAAE,wEAAwE,EAAE,CAAC,KAAK,CAAC,GAAG,IAAI,WAAW,CAAC,GAAI,IAC5L,CACJ,EAED,iDAA4B,mBAAmB,EAAC,SAAS,EAAC,4HAA4H,GAAG,IACrL,CACP,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"../utils\";\n\nexport type ScrollAreaProps = {\n children: React.ReactNode;\n /** Names the region; screen readers announce it when focus enters. */\n \"aria-label\": string;\n /** The region's height limit (\"320px\", 320, \"60vh\"); for horizontal areas, set the width on the parent. */\n maxHeight?: number | string;\n /**\n * Fills the parent's height and scrolls inside it, for a pane in a flex column or a grid\n * row that is given its height: a conversation's messages between its header and the reply box, a list\n * beside it. The parent must give the area a definite height (`min-h-0` on a flex or grid child).\n * Leave `maxHeight` out when filling.\n */\n fill?: boolean;\n orientation?: \"vertical\" | \"horizontal\" | \"both\";\n};\n\nconst TABBABLE =\n 'a[href], button:not([disabled]), input:not([disabled]):not([type=\"hidden\"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"]), [contenteditable=\"true\"]';\n\n/** A tabbable descendant that is not hidden or inert. */\nfunction hasTabbable(root: HTMLElement) {\n return Array.from(root.querySelectorAll(TABBABLE)).some((element) => !element.closest(\"[hidden], [inert]\"));\n}\n\ntype Edges = { start: boolean; end: boolean };\n\n/**\n * A fixed-size region with its own native scroll (never hijacked) and the\n * scrollbar contract (thin, a ds-border-bold thumb), plus an overflow\n * shadow on each edge where content continues. When it holds nothing\n * focusable it becomes a focusable region itself, so keyboard users can\n * scroll it with the arrow keys.\n *\n * Known deviation: the design's 6px thumb is drawn by the platform's thin\n * scrollbar (about 8–11px); standard CSS cannot size it further without\n * replacing native scrolling. With `orientation=\"both\"` the edge shadows\n * follow the vertical axis.\n */\nexport function ScrollArea({ children, \"aria-label\": ariaLabel, maxHeight, fill = false, orientation = \"vertical\" }: ScrollAreaProps) {\n const viewport = React.useRef<HTMLDivElement>(null);\n const [edges, setEdges] = React.useState<Edges>({ start: false, end: false });\n const [needsFocus, setNeedsFocus] = React.useState(false);\n // The thumb shows while scrolling and fades shortly after.\n const [scrolling, setScrolling] = React.useState(false);\n const scrollTimer = React.useRef<number | undefined>(undefined);\n React.useEffect(() => () => window.clearTimeout(scrollTimer.current), []);\n // Every scroll event restarts the fade-out, so a long scroll keeps the thumb steady.\n const onScrolling = () => {\n window.clearTimeout(scrollTimer.current);\n setScrolling(true);\n scrollTimer.current = window.setTimeout(() => setScrolling(false), 800);\n };\n const horizontal = orientation === \"horizontal\";\n\n const room = () => {\n const frame = viewport.current;\n return frame ? (horizontal ? frame.scrollWidth - frame.clientWidth : frame.scrollHeight - frame.clientHeight) : 0;\n };\n\n /** Which edges hide content; cheap enough for every scroll event. */\n const measureEdges = React.useCallback(() => {\n const frame = viewport.current;\n if (!frame) return;\n // Horizontal scroll positions are negative in RTL; magnitudes work for both directions.\n const position = Math.abs(horizontal ? frame.scrollLeft : frame.scrollTop);\n const space = horizontal ? frame.scrollWidth - frame.clientWidth : frame.scrollHeight - frame.clientHeight;\n const next = { start: position > 1, end: space - position > 1 };\n setEdges((current) => (current.start === next.start && current.end === next.end ? current : next));\n }, [horizontal]);\n\n /** Whether the region must take focus itself: it scrolls and holds nothing focusable. Runs on size and content changes. */\n const measureFocus = React.useCallback(() => {\n const frame = viewport.current;\n if (!frame) return;\n const next = room() > 1 && !hasTabbable(frame);\n // Never pull focus out from under the keyboard: keep the tab stop while the region itself has focus.\n setNeedsFocus((current) => (current && !next && document.activeElement === frame ? current : next));\n }, [horizontal]);\n\n React.useLayoutEffect(() => {\n measureEdges();\n measureFocus();\n const frame = viewport.current;\n if (!frame) return;\n const sized = () => {\n measureEdges();\n measureFocus();\n };\n const resize = typeof ResizeObserver === \"undefined\" ? undefined : new ResizeObserver(sized);\n resize?.observe(frame);\n if (frame.firstElementChild) resize?.observe(frame.firstElementChild);\n // Children that appear, disappear or change focusability without changing size.\n const mutation = typeof MutationObserver === \"undefined\" ? undefined : new MutationObserver(sized);\n mutation?.observe(frame, { childList: true, subtree: true, attributes: true, attributeFilter: [\"disabled\", \"tabindex\", \"hidden\", \"inert\", \"href\", \"contenteditable\"] });\n return () => {\n resize?.disconnect();\n mutation?.disconnect();\n };\n }, [measureEdges, measureFocus]);\n\n const shadow = \"pointer-events-none absolute z-[1] shadow-ds-overflow transition-opacity duration-(--ds-duration-instant)\";\n return (\n // Clipped: the edge-shadow casters sit just outside the box and only their inward shadow may show,\n // so the area never makes its column (or the page) scroll sideways.\n <div\n data-slot=\"scroll-area\"\n data-orientation={orientation}\n data-fill={fill || undefined}\n className={cn(\"relative min-h-0 min-w-0 overflow-clip\", fill && \"h-full\")}\n >\n <div\n ref={viewport}\n data-slot=\"scroll-area-viewport\"\n role={needsFocus ? \"region\" : undefined}\n aria-label={needsFocus ? ariaLabel : undefined}\n tabIndex={needsFocus ? 0 : undefined}\n onScroll={() => {\n measureEdges();\n onScrolling();\n }}\n onBlur={measureFocus}\n data-scrolling={scrolling || undefined}\n style={{ maxHeight }}\n className={cn(\n \"peer outline-hidden\",\n fill && \"h-full\",\n // The scrollbar: thin, a ds-border-bold thumb at 70% on no track, shown on hover, keyboard\n // focus and while scrolling. Native underneath, so wheel, touch and keyboard scroll as usual.\n \"[scrollbar-width:thin] [scrollbar-color:transparent_transparent]\",\n \"hover:[scrollbar-color:color-mix(in_oklab,var(--ds-border-bold)_70%,transparent)_transparent]\",\n \"focus-visible:[scrollbar-color:color-mix(in_oklab,var(--ds-border-bold)_70%,transparent)_transparent]\",\n \"data-[scrolling]:[scrollbar-color:color-mix(in_oklab,var(--ds-border-bold)_70%,transparent)_transparent]\",\n orientation === \"vertical\" && \"overflow-y-auto overflow-x-hidden\",\n orientation === \"horizontal\" && \"overflow-x-auto overflow-y-hidden\",\n orientation === \"both\" && \"overflow-auto\",\n )}\n >\n <div data-slot=\"scroll-area-content\">{children}</div>\n </div>\n {/* Edge shadows where content continues, clipped to fall inward only. */}\n {horizontal ? (\n <>\n <span aria-hidden data-slot=\"scroll-area-edge\" data-edge=\"start\" className={cn(shadow, \"inset-y-0 start-0 w-3 [clip-path:inset(0_-12px_0_0)] rtl:[clip-path:inset(0_0_0_-12px)] -translate-x-full rtl:translate-x-full\", !edges.start && \"opacity-0\")} />\n <span aria-hidden data-slot=\"scroll-area-edge\" data-edge=\"end\" className={cn(shadow, \"inset-y-0 end-0 w-3 [clip-path:inset(0_0_0_-12px)] rtl:[clip-path:inset(0_-12px_0_0)] translate-x-full rtl:-translate-x-full\", !edges.end && \"opacity-0\")} />\n </>\n ) : (\n <>\n <span aria-hidden data-slot=\"scroll-area-edge\" data-edge=\"start\" className={cn(shadow, \"inset-x-0 top-0 h-3 -translate-y-full [clip-path:inset(0_0_-12px_0)]\", !edges.start && \"opacity-0\")} />\n <span aria-hidden data-slot=\"scroll-area-edge\" data-edge=\"end\" className={cn(shadow, \"inset-x-0 bottom-0 h-3 translate-y-full [clip-path:inset(-12px_0_0_0)]\", !edges.end && \"opacity-0\")} />\n </>\n )}\n {/* The keyboard focus border sits above the content, which would cover an inset ring on the viewport. */}\n <span aria-hidden data-slot=\"scroll-area-focus\" className=\"pointer-events-none absolute inset-0 z-[2] peer-focus-visible:inset-ring-2 peer-focus-visible:inset-ring-ds-border-focused\" />\n </div>\n );\n}\n"]}
@@ -1,17 +0,0 @@
1
- export type CooldownAction = {
2
- /** Runs the action; the cooldown starts only after it succeeds. */
3
- run: () => Promise<boolean>;
4
- /** Seconds left before the action is available again. */
5
- remaining: number;
6
- /** True while the action is running. */
7
- isPending: boolean;
8
- /** True after the last run failed (cleared by the next run). */
9
- failed: boolean;
10
- };
11
- /**
12
- * The resend pattern (code again, link again): a rejected or throwing action
13
- * never starts the wait and never escapes as an unhandled rejection
14
- *; a successful one starts `seconds` of cooldown. `initial` is
15
- * the wait already running (a code was just sent); a new value restarts it.
16
- */
17
- export declare function useCooldownAction(action: (() => unknown) | undefined, seconds: number, initial?: number): CooldownAction;
@@ -1,59 +0,0 @@
1
- "use client";
2
- import * as React from "react";
3
- /**
4
- * The resend pattern (code again, link again): a rejected or throwing action
5
- * never starts the wait and never escapes as an unhandled rejection
6
- *; a successful one starts `seconds` of cooldown. `initial` is
7
- * the wait already running (a code was just sent); a new value restarts it.
8
- */
9
- export function useCooldownAction(action, seconds, initial = 0) {
10
- const [remaining, setRemaining] = React.useState(initial);
11
- const [isPending, setPending] = React.useState(false);
12
- const [failed, setFailed] = React.useState(false);
13
- const latest = React.useRef(action);
14
- latest.current = action;
15
- const running = React.useRef(false);
16
- const remainingRef = React.useRef(remaining);
17
- remainingRef.current = remaining;
18
- // A new initial wait from the parent (a server "retry after") restarts the wait.
19
- const firstInitial = React.useRef(true);
20
- React.useEffect(() => {
21
- if (firstInitial.current) {
22
- firstInitial.current = false;
23
- return;
24
- }
25
- setRemaining(initial);
26
- }, [initial]);
27
- // One interval for the whole wait, counting down with a functional update: no per-tick rescheduling, so a long jump
28
- // of the clock (a backgrounded tab, fake timers) still lands on the right second.
29
- const cooling = remaining > 0;
30
- React.useEffect(() => {
31
- if (!cooling)
32
- return;
33
- const timer = window.setInterval(() => setRemaining((current) => Math.max(0, current - 1)), 1000);
34
- return () => window.clearInterval(timer);
35
- }, [cooling]);
36
- const run = React.useCallback(async () => {
37
- // One run at a time, and none while the wait is on.
38
- if (!latest.current || running.current || remainingRef.current > 0)
39
- return false;
40
- running.current = true;
41
- setPending(true);
42
- setFailed(false);
43
- try {
44
- await latest.current();
45
- setRemaining(seconds);
46
- return true;
47
- }
48
- catch {
49
- setFailed(true);
50
- return false;
51
- }
52
- finally {
53
- running.current = false;
54
- setPending(false);
55
- }
56
- }, [seconds]);
57
- return { run, remaining, isPending, failed };
58
- }
59
- //# sourceMappingURL=cooldown.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cooldown.js","sourceRoot":"","sources":["../../src/feedback/cooldown.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAa/B;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAmC,EAAE,OAAe,EAAE,OAAO,GAAG,CAAC;IACjG,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC1D,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACpC,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACpC,MAAM,YAAY,GAAG,KAAK,C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EAAE,CAAC;YACvB,YAAY,CAAC,OAAO,CAAC,CAAC;YACtB,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,MAAM,CAAC;YACP,SAAS,CAAC,IAAI,CAAC,CAAC;YAChB,OAAO,KAAK,CAAC;QACf,CAAC;gBAAS,CAAC;YACT,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC;YACxB,UAAU,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;IACH,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;AAC/C,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nexport type CooldownAction = {\n /** Runs the action; the cooldown starts only after it succeeds. */\n run: () => Promise<boolean>;\n /** Seconds left before the action is available again. */\n remaining: number;\n /** True while the action is running. */\n isPending: boolean;\n /** True after the last run failed (cleared by the next run). */\n failed: boolean;\n};\n\n/**\n * The resend pattern (code again, link again): a rejected or throwing action\n * never starts the wait and never escapes as an unhandled rejection\n *; a successful one starts `seconds` of cooldown. `initial` is\n * the wait already running (a code was just sent); a new value restarts it.\n */\nexport function useCooldownAction(action: (() => unknown) | undefined, seconds: number, initial = 0): CooldownAction {\n const [remaining, setRemaining] = React.useState(initial);\n const [isPending, setPending] = React.useState(false);\n const [failed, setFailed] = React.useState(false);\n const latest = React.useRef(action);\n latest.current = action;\n const running = React.useRef(false);\n const remainingRef = React.useRef(remaining);\n remainingRef.current = remaining;\n\n // A new initial wait from the parent (a server \"retry after\") restarts the wait.\n const firstInitial = React.useRef(true);\n React.useEffect(() => {\n if (firstInitial.current) {\n firstInitial.current = false;\n return;\n }\n setRemaining(initial);\n }, [initial]);\n\n // One interval for the whole wait, counting down with a functional update: no per-tick rescheduling, so a long jump\n // of the clock (a backgrounded tab, fake timers) still lands on the right second.\n const cooling = remaining > 0;\n React.useEffect(() => {\n if (!cooling) return;\n const timer = window.setInterval(() => setRemaining((current) => Math.max(0, current - 1)), 1000);\n return () => window.clearInterval(timer);\n }, [cooling]);\n\n const run = React.useCallback(async () => {\n // One run at a time, and none while the wait is on.\n if (!latest.current || running.current || remainingRef.current > 0) return false;\n running.current = true;\n setPending(true);\n setFailed(false);\n try {\n await latest.current();\n setRemaining(seconds);\n return true;\n } catch {\n setFailed(true);\n return false;\n } finally {\n running.current = false;\n setPending(false);\n }\n }, [seconds]);\n\n return { run, remaining, isPending, failed };\n}\n"]}
@@ -1,23 +0,0 @@
1
- import * as React from "react";
2
- export type StatusDotTone = "neutral" | "information" | "success" | "warning" | "danger";
3
- type Base = {
4
- tone?: StatusDotTone;
5
- /** A 3px halo for a state that is active right now (connected, syncing). */
6
- isLive?: boolean;
7
- };
8
- export type StatusDotProps = Base & ({
9
- /** The word: the colour never carries the state alone. */
10
- children: React.ReactNode;
11
- "aria-label"?: never;
12
- } | {
13
- children?: never;
14
- /** Only where a visible word is impossible (a dense table cell with its own column header). */
15
- "aria-label": string;
16
- });
17
- /**
18
- * A live system or connection state as an 8px dot and a word: integration
19
- * online, GPS signal, sync. For a record's status (order, invoice) use
20
- * Lozenge.
21
- */
22
- export declare function StatusDot({ tone, isLive, children, "aria-label": ariaLabel }: StatusDotProps): React.JSX.Element;
23
- export {};
@@ -1,37 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import * as React from "react";
3
- import { cn } from "../utils.js";
4
- const DOT = {
5
- neutral: "bg-ds-icon-subtle",
6
- information: "bg-ds-icon-information",
7
- success: "bg-ds-icon-success",
8
- warning: "bg-ds-icon-warning",
9
- danger: "bg-ds-icon-danger",
10
- };
11
- // The halo sits in the tone's status background.
12
- const HALO = {
13
- neutral: "ring-ds-background-neutral",
14
- information: "ring-ds-background-information",
15
- success: "ring-ds-background-success",
16
- warning: "ring-ds-background-warning",
17
- danger: "ring-ds-background-danger",
18
- };
19
- /**
20
- * A live system or connection state as an 8px dot and a word: integration
21
- * online, GPS signal, sync. For a record's status (order, invoice) use
22
- * Lozenge.
23
- */
24
- export function StatusDot({ tone = "neutral", isLive, children, "aria-label": ariaLabel }) {
25
- // null, false and "" are no word either.
26
- const hasWord = children != null && children !== false && children !== "";
27
- const dot = (_jsx("span", { "data-slot": "status-dot-mark", "aria-hidden": true, className: cn("size-ds-100 shrink-0 rounded-ds-full", DOT[tone], isLive && cn("ring-3", HALO[tone])) }));
28
- if (!hasWord) {
29
- return (
30
- // Named image with a label; without one it only decorates, never an unnamed image.
31
- _jsx("span", { role: ariaLabel ? "img" : undefined, "aria-label": ariaLabel, "aria-hidden": ariaLabel ? undefined : true, "data-slot": "status-dot", "data-tone": tone, "data-live": isLive || undefined, className: "inline-flex items-center", children: dot }));
32
- }
33
- return (
34
- // The halo is a shadow and takes no space, so a live dot gets the wider gap to keep the word clear of it.
35
- _jsxs("span", { "data-slot": "status-dot", "data-tone": tone, "data-live": isLive || undefined, className: cn("inline-flex items-center text-body text-ds-text", isLive ? "gap-ds-100" : "gap-ds-075"), children: [dot, _jsx("span", { "data-slot": "status-dot-label", children: children })] }));
36
- }
37
- //# sourceMappingURL=status-dot.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"status-dot.js","sourceRoot":"","sources":["../../src/feedback/status-dot.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAI9B,MAAM,GAAG,GAAkC;IACzC,OAAO,EAAE,mBAAmB;IAC5B,WAAW,EAAE,wBAAwB;IACrC,OAAO,EAAE,oBAAoB;IAC7B,OAAO,EAAE,oBAAoB;IAC7B,MAAM,EAAE,mBAAmB;CAC5B,CAAC;AACF,iDAAiD;AACjD,MAAM,IAAI,GAAkC;IAC1C,OAAO,EAAE,4BAA4B;IACrC,WAAW,EAAE,gCAAgC;IAC7C,OAAO,EAAE,4BAA4B;IACrC,OAAO,EAAE,4BAA4B;IACrC,MAAM,EAAE,2BAA2B;CACpC,CAAC;AAsBF;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,EAAE,IAAI,GAAG,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAkB;IACvG,yCAAyC;IACzC,MAAM,OAAO,GAAG,QAAQ,IAAI,IAAI,IAAI,QAAQ,KAAK,KAAK,IAAI,QAAQ,KAAK,EAAE,CAAC;IAC1E,MAAM,GAAG,GAAG,CACV,4BACY,iBAAiB,uBAE3B,SAAS,EAAE,EAAE,CAAC,sCAAsC,EAAE,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,IAAI,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GACpG,CACH,CAAC;IACF,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO;QACL,mFAAmF;QACnF,eAAM,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,gBAAc,SAAS,iBAAe,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,eAAY,YAAY,eAAY,IAAI,eAAa,MAAM,IAAI,SAAS,EAAE,SAAS,EAAC,0BAA0B,YACtN,GAAG,GACC,CACR,CAAC;IACJ,CAAC;IACD,OAAO;IACL,0GAA0G;IAC1G,6BAAgB,YAAY,eAAY,IAAI,eAAa,MAAM,IAAI,SAAS,EAAE,SAAS,EAAE,EAAE,CAAC,iDAAiD,EAAE,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,aACjL,GAAG,EACJ,4BAAgB,kBAAkB,YAAE,QAAQ,GAAQ,IAC/C,CACR,CAAC;AACJ,CAAC","sourcesContent":["import * as React from \"react\";\n\nimport { cn } from \"../utils\";\n\nexport type StatusDotTone = \"neutral\" | \"information\" | \"success\" | \"warning\" | \"danger\";\n\nconst DOT: Record<StatusDotTone, string> = {\n neutral: \"bg-ds-icon-subtle\",\n information: \"bg-ds-icon-information\",\n success: \"bg-ds-icon-success\",\n warning: \"bg-ds-icon-warning\",\n danger: \"bg-ds-icon-danger\",\n};\n// The halo sits in the tone's status background.\nconst HALO: Record<StatusDotTone, string> = {\n neutral: \"ring-ds-background-neutral\",\n information: \"ring-ds-background-information\",\n success: \"ring-ds-background-success\",\n warning: \"ring-ds-background-warning\",\n danger: \"ring-ds-background-danger\",\n};\n\ntype Base = {\n tone?: StatusDotTone;\n /** A 3px halo for a state that is active right now (connected, syncing). */\n isLive?: boolean;\n};\n\nexport type StatusDotProps = Base &\n (\n | {\n /** The word: the colour never carries the state alone. */\n children: React.ReactNode;\n \"aria-label\"?: never;\n }\n | {\n children?: never;\n /** Only where a visible word is impossible (a dense table cell with its own column header). */\n \"aria-label\": string;\n }\n );\n\n/**\n * A live system or connection state as an 8px dot and a word: integration\n * online, GPS signal, sync. For a record's status (order, invoice) use\n * Lozenge.\n */\nexport function StatusDot({ tone = \"neutral\", isLive, children, \"aria-label\": ariaLabel }: StatusDotProps) {\n // null, false and \"\" are no word either.\n const hasWord = children != null && children !== false && children !== \"\";\n const dot = (\n <span\n data-slot=\"status-dot-mark\"\n aria-hidden\n className={cn(\"size-ds-100 shrink-0 rounded-ds-full\", DOT[tone], isLive && cn(\"ring-3\", HALO[tone]))}\n />\n );\n if (!hasWord) {\n return (\n // Named image with a label; without one it only decorates, never an unnamed image.\n <span role={ariaLabel ? \"img\" : undefined} aria-label={ariaLabel} aria-hidden={ariaLabel ? undefined : true} data-slot=\"status-dot\" data-tone={tone} data-live={isLive || undefined} className=\"inline-flex items-center\">\n {dot}\n </span>\n );\n }\n return (\n // The halo is a shadow and takes no space, so a live dot gets the wider gap to keep the word clear of it.\n <span data-slot=\"status-dot\" data-tone={tone} data-live={isLive || undefined} className={cn(\"inline-flex items-center text-body text-ds-text\", isLive ? \"gap-ds-100\" : \"gap-ds-075\")}>\n {dot}\n <span data-slot=\"status-dot-label\">{children}</span>\n </span>\n );\n}\n"]}
@@ -1,35 +0,0 @@
1
- import * as React from "react";
2
- import { type TextFieldProps as AriaTextFieldProps } from "react-aria-components";
3
- import { type RequiredValidation } from "./validation.js";
4
- export type InputOTPProps = Omit<AriaTextFieldProps, "className" | "style" | "children" | "type" | "inputMode" | "autoComplete" | "maxLength"> & {
5
- label: React.ReactNode;
6
- /** 4 or 6 digits; 6 splits 3 + 3 with a dash. */
7
- length?: 4 | 6;
8
- description?: React.ReactNode;
9
- /** Say what to do: "Wrong code. Enter the latest code from your phone." */
10
- errorMessage?: React.ReactNode;
11
- /** Called once the last digit is entered (submit there). */
12
- onComplete?: (code: string) => void;
13
- /**
14
- * Who says an empty required field is missing: `field` (default) or `app`. With `app` a DS
15
- * Form's `onSubmit` runs with the field empty, and the app's own error must clear on change. See
16
- * {@link RequiredValidation} for the whole contract.
17
- */
18
- requiredValidation?: RequiredValidation;
19
- };
20
- export declare const InputOTP: React.ForwardRefExoticComponent<Omit<AriaTextFieldProps, "style" | "type" | "className" | "children" | "inputMode" | "autoComplete" | "maxLength"> & {
21
- label: React.ReactNode;
22
- /** 4 or 6 digits; 6 splits 3 + 3 with a dash. */
23
- length?: 4 | 6;
24
- description?: React.ReactNode;
25
- /** Say what to do: "Wrong code. Enter the latest code from your phone." */
26
- errorMessage?: React.ReactNode;
27
- /** Called once the last digit is entered (submit there). */
28
- onComplete?: (code: string) => void;
29
- /**
30
- * Who says an empty required field is missing: `field` (default) or `app`. With `app` a DS
31
- * Form's `onSubmit` runs with the field empty, and the app's own error must clear on change. See
32
- * {@link RequiredValidation} for the whole contract.
33
- */
34
- requiredValidation?: RequiredValidation;
35
- } & React.RefAttributes<HTMLInputElement>>;