{"version":3,"file":"chunk-ColorPicker.mjs","names":["useColorPickerContext","createContext","ColorPickerPrimitive","allHues","_Fragment","Tabs.Root","Toolbar.Root","Tabs.List","Tabs.Trigger","Toolbar.Separator","Tabs.Content","useArkColorPickerContext","hues"],"sources":["../../src/components/ColorPicker/ColorPicker.tsx"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport {\n  type Color,\n  ColorPicker as ColorPickerPrimitive,\n  parseColor,\n  useColorPickerContext as useArkColorPickerContext,\n} from '@ark-ui/react/color-picker';\nimport { Portal } from '@ark-ui/react/portal';\nimport React, {\n  type KeyboardEvent,\n  type PropsWithChildren,\n  type ReactNode,\n  type RefObject,\n  forwardRef,\n  useEffect,\n  useLayoutEffect,\n  useMemo,\n  useRef,\n  useState,\n} from 'react';\n\nimport { createContext } from '@dxos/react-hooks';\nimport { mx } from '@dxos/ui-theme';\nimport { type ChromaticPalette, type NeutralPalette, type ThemedClassName, hues as allHues } from '@dxos/ui-types';\n\nimport { recipes } from '../../recipes.ts';\nimport { Button } from '../Button/Button.tsx';\nimport { Input } from '../Input/Input.tsx';\nimport * as Tabs from '../Tabs/Tabs.tsx';\nimport * as Toolbar from '../Toolbar/Toolbar.tsx';\n\n//\n// Root\n//\n\n/** Shown in the picker when the value is unset or is not a color the picker can parse. */\nconst FALLBACK = '#808080';\n\nconst toColor = (value: string | undefined): Color => {\n  try {\n    return parseColor(value ?? FALLBACK);\n  } catch {\n    return parseColor(FALLBACK);\n  }\n};\n\ntype ColorPickerContextValue = {\n  /** Any CSS color string, as typed; undefined when unset. */\n  value?: string;\n  onValueChange?: (value: string | undefined) => void;\n  /** Called when a pick in the popover ends (a drag released), so a caller can save once rather than per move. */\n  onValueCommit?: (value: string | undefined) => void;\n  disabled?: boolean;\n};\n\nconst COLOR_PICKER_NAME = 'ColorPicker';\n\nconst [ColorPickerProvider, useColorPickerContext] = createContext<ColorPickerContextValue>(COLOR_PICKER_NAME);\n\ntype ColorPickerRootProps = PropsWithChildren<ColorPickerContextValue>;\n\n/**\n * A color value edited as text (any CSS color) or picked from the trigger's popover. The picker's machine lives here\n * (in a box with no layout of its own) so the trigger can be a bare button in an Input's end adornment.\n */\nconst ColorPickerRoot = ({ children, ...context }: ColorPickerRootProps) => {\n  const { value, onValueChange, onValueCommit, disabled } = context;\n  const color = useMemo(() => toColor(value), [value]);\n  return (\n    <ColorPickerProvider {...context}>\n      <ColorPickerPrimitive.Root\n        value={color}\n        disabled={disabled}\n        onValueChange={({ value: next }) => onValueChange?.(next.toString('hex'))}\n        onValueChangeEnd={({ value: next }) => onValueCommit?.(next.toString('hex'))}\n        positioning={{ placement: 'bottom-end' }}\n        className='contents'\n      >\n        {children}\n        <ColorPickerPrimitive.HiddenInput />\n      </ColorPickerPrimitive.Root>\n    </ColorPickerProvider>\n  );\n};\n\nColorPickerRoot.displayName = 'ColorPicker.Root';\n\n//\n// Input\n//\n\ntype ColorPickerInputProps = ThemedClassName<{\n  'placeholder'?: string;\n  /** The input's end adornment, typically `ColorPicker.Trigger`. */\n  'end'?: ReactNode;\n  'data-testid'?: string;\n}>;\n\n/** The color as text, so a value the swatch cannot show (a named or `oklch` color) can still be typed. */\nconst ColorPickerInput = forwardRef<HTMLInputElement, ColorPickerInputProps>(\n  ({ classNames, placeholder, end, ...props }, forwardedRef) => {\n    const { value, onValueChange, disabled } = useColorPickerContext(COLOR_PICKER_NAME);\n    return (\n      <Input\n        {...props}\n        ref={forwardedRef}\n        variant='mono'\n        noAutoFill\n        spellCheck={false}\n        disabled={disabled}\n        placeholder={placeholder}\n        value={value ?? ''}\n        onChange={(event) => onValueChange?.(event.target.value.trim() || undefined)}\n        end={end}\n        classNames={classNames}\n      />\n    );\n  },\n);\n\nColorPickerInput.displayName = 'ColorPicker.Input';\n\n//\n// Trigger\n//\n\n/** A swatch row: a theme hue or the neutral ramp. */\ntype SwatchHue = ChromaticPalette | NeutralPalette;\n\n/** The theme's tones the swatches offer by default, light to dark. */\nconst DEFAULT_TONES = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];\n\n/** The rows the swatches offer by default: neutral, then every theme hue. */\nconst DEFAULT_HUES: SwatchHue[] = ['neutral', ...allHues];\n\n/** A popover view: the saturation/brightness area with a hue slider, or the theme swatch grid. */\ntype ColorPickerView = 'wheel' | 'swatches';\n\nconst DEFAULT_VIEWS: ColorPickerView[] = ['wheel', 'swatches'];\n\ntype ColorPickerTriggerProps = ThemedClassName<{\n  label?: string;\n  /** Names the button at the end of the tab row that clears the value back to unset. */\n  resetLabel?: string;\n  /** Rows of the swatch grid; neutral, then every theme hue, by default. */\n  hues?: SwatchHue[];\n  /** Columns of the swatch grid: theme tones (e.g. `500`), light to dark. */\n  tones?: number[];\n  /** The views the popover offers, as tabs; with one, it shows that view alone (e.g. swatches only). Both by default. */\n  views?: ColorPickerView[];\n}>;\n\n/**\n * A swatch of the current color that opens two tabs: a wheel (a saturation/brightness area and a hue slider, which\n * write hex) and a grid of the theme's hues by tone.\n */\nconst ColorPickerTrigger = ({\n  classNames,\n  label = 'Pick color',\n  resetLabel = 'Reset',\n  hues,\n  tones,\n  views = DEFAULT_VIEWS,\n}: ColorPickerTriggerProps) => {\n  const { value, onValueChange, onValueCommit } = useColorPickerContext(COLOR_PICKER_NAME);\n  return (\n    <>\n      {/* A direct child of the adornment, so it sizes, hovers and sits flush at the end like every Input end button. */}\n      <ColorPickerPrimitive.Trigger asChild>\n        <Button\n          variant='ghost'\n          iconOnly\n          showTooltip={false}\n          label={label}\n          icon={value ? 'ph--square--fill' : 'ph--square--regular'}\n          // The square takes the color; unset, it is hollow.\n          style={value ? { color: value } : undefined}\n          classNames={classNames}\n        />\n      </ColorPickerPrimitive.Trigger>\n      <Portal>\n        <ColorPickerPrimitive.Positioner>\n          <ColorPickerPrimitive.Content\n            data-surface='popup'\n            className={mx(recipes.popup(), recipes.popoverContent(), 'p-2')}\n          >\n            {/* Keyed by the views, so a change of views starts again on the first one rather than keeping a missing tab. */}\n            <Tabs.Root key={views.join()} defaultValue={views[0]} size='sm'>\n              <Toolbar.Root size='sm'>\n                {views.length > 1 && (\n                  <Tabs.List aria-label={label}>\n                    {views.includes('wheel') && (\n                      <Tabs.Trigger value='wheel' icon='ph--palette--regular' label='Wheel' iconOnly />\n                    )}\n                    {views.includes('swatches') && (\n                      <Tabs.Trigger value='swatches' icon='ph--swatches--regular' label='Swatches' iconOnly />\n                    )}\n                  </Tabs.List>\n                )}\n                <Toolbar.Separator variant='gap' />\n                <Button\n                  variant='ghost'\n                  iconOnly\n                  icon='ph--minus-circle--regular'\n                  label={resetLabel}\n                  disabled={value === undefined}\n                  onClick={() => {\n                    onValueChange?.(undefined);\n                    onValueCommit?.(undefined);\n                  }}\n                />\n              </Toolbar.Root>\n              {views.includes('wheel') && (\n                <Tabs.Content value='wheel' classNames='flex flex-col gap-2 pt-2'>\n                  <ColorPickerPrimitive.Area className='relative size-48 rounded-sm overflow-hidden'>\n                    <ColorPickerPrimitive.AreaBackground className='size-full' />\n                    <ColorPickerPrimitive.AreaThumb className='size-3 rounded-full border-2 border-white shadow' />\n                  </ColorPickerPrimitive.Area>\n                  <ColorPickerPrimitive.ChannelSlider channel='hue' className='relative h-3 w-48'>\n                    <ColorPickerPrimitive.ChannelSliderTrack className='h-full rounded-full' />\n                    <ColorPickerPrimitive.ChannelSliderThumb className='size-3 -translate-y-1/2 rounded-full border-2 border-white shadow' />\n                  </ColorPickerPrimitive.ChannelSlider>\n                </Tabs.Content>\n              )}\n              {views.includes('swatches') && (\n                <Tabs.Content value='swatches' classNames='pt-2'>\n                  <Swatches\n                    value={value}\n                    hues={hues ?? DEFAULT_HUES}\n                    tones={tones ?? DEFAULT_TONES}\n                    onPick={(next) => {\n                      onValueChange?.(next);\n                      onValueCommit?.(next);\n                    }}\n                  />\n                </Tabs.Content>\n              )}\n            </Tabs.Root>\n          </ColorPickerPrimitive.Content>\n        </ColorPickerPrimitive.Positioner>\n      </Portal>\n    </>\n  );\n};\n\n/** The current swatch, ringed like focus (selection follows focus) and raised over its neighbours. */\nconst SELECTED_STYLE = {\n  zIndex: 10,\n  outline: 'var(--dx-focus-ring-width) solid var(--dx-focus-ring-color)',\n  outlineOffset: '1px',\n};\n\ntype SwatchGridProps = ThemedClassName<{\n  /** Cell names, row by row; each is its cell's accessible name. */\n  names: readonly string[];\n  columns: number;\n  /** A cell's fill, as a CSS color. */\n  colorOf: (name: string) => string;\n  /** Index of the selected cell, or -1. */\n  selected: number;\n  onSelect: (index: number) => void;\n  /** Grid track sizes; equal shares of the grid's width, one swatch tall, by default. */\n  columnWidth?: string;\n  rowHeight?: string;\n  onEnter?: () => void;\n  onEscape?: () => void;\n  /** After a click's selection; arrow keys select without it. */\n  onClickCell?: (index: number) => void;\n  /** The grid element, for a caller that reads the cells' computed colors. */\n  gridRef?: RefObject<HTMLDivElement | null>;\n}>;\n\n/**\n * A radio group of color cells whose selection follows focus: arrow keys, Home and End pick as they move, and a roving\n * tab stop enters the grid at the selected cell.\n */\nconst SwatchGrid = ({\n  classNames,\n  names,\n  columns,\n  colorOf,\n  selected,\n  onSelect,\n  columnWidth = 'minmax(0, 1fr)',\n  rowHeight = '1rem',\n  onEnter,\n  onEscape,\n  onClickCell,\n  gridRef: gridRefProp,\n}: SwatchGridProps) => {\n  const ownRef = useRef<HTMLDivElement>(null);\n  const gridRef = gridRefProp ?? ownRef;\n  const [active, setActive] = useState(0);\n  useEffect(() => {\n    if (selected >= 0) {\n      setActive(selected);\n    }\n  }, [selected]);\n\n  const select = (index: number) => {\n    setActive(index);\n    gridRef.current?.querySelectorAll<HTMLButtonElement>('button')[index]?.focus();\n    onSelect(index);\n  };\n\n  const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n    const last = names.length - 1;\n    const step: Record<string, number> = { ArrowLeft: -1, ArrowRight: 1, ArrowUp: -columns, ArrowDown: columns };\n    if (event.key in step) {\n      event.preventDefault();\n      select(Math.min(last, Math.max(0, active + step[event.key])));\n    } else if (event.key === 'Home' || event.key === 'End') {\n      event.preventDefault();\n      select(event.key === 'Home' ? 0 : last);\n    } else if (event.key === 'Enter' && onEnter) {\n      event.preventDefault();\n      onEnter();\n    } else if (event.key === 'Escape') {\n      onEscape?.();\n    }\n  };\n\n  return (\n    <div\n      ref={gridRef}\n      role='radiogroup'\n      className={mx('grid gap-0.5', classNames)}\n      style={{ gridTemplateColumns: `repeat(${columns}, ${columnWidth})`, gridAutoRows: rowHeight }}\n      onKeyDown={handleKeyDown}\n    >\n      {names.map((name, index) => (\n        <button\n          key={name}\n          type='button'\n          role='radio'\n          aria-checked={index === selected}\n          aria-label={name}\n          title={name}\n          tabIndex={index === active ? 0 : -1}\n          // A cell is too small for the inset focus ring, so focus and selection ring it outside, raised over its neighbours.\n          className='relative rounded-xs outline-none focus-visible:z-20 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-(--dx-focus-ring-color)'\n          style={{\n            backgroundColor: colorOf(name),\n            ...(index === selected && SELECTED_STYLE),\n          }}\n          onClick={() => {\n            select(index);\n            onClickCell?.(index);\n          }}\n        />\n      ))}\n    </div>\n  );\n};\n\ntype SwatchesProps = {\n  hues: SwatchHue[];\n  tones: number[];\n  /** The current color, ringed (and focused) when it is one of the swatches. */\n  value?: string;\n  /** A pick, or `undefined` when Escape restores an unset value. */\n  onPick: (color: string | undefined) => void;\n};\n\n/**\n * One row per hue, one column per tone; a pick writes the tone's resolved color, since a value must not be a `var()`.\n * The grid is the wheel's width whatever the tone count, and rows stay one swatch tall, so fewer tones widen the cells.\n * Enter closes the popover keeping the pick, and Escape closes it restoring the color it opened with.\n */\nconst Swatches = ({ hues, tones, value, onPick }: SwatchesProps) => {\n  const { open, setOpen } = useArkColorPickerContext();\n  const gridRef = useRef<HTMLDivElement>(null);\n  // The color the popover opened with, for Escape to restore; the grid stays mounted across openings.\n  const initialValue = useRef(value);\n  useEffect(() => {\n    if (open) {\n      initialValue.current = value;\n    }\n    // Only an opening re-reads the value; picks while open must not move the restore point.\n  }, [open]);\n  const names = useMemo(() => hues.flatMap((hue) => tones.map((tone) => `${hue}-${tone}`)), [hues, tones]);\n\n  // The swatches' colors as values: a stored color is a resolved string, so the selection is found by comparing them.\n  const [resolved, setResolved] = useState<string[]>([]);\n  useLayoutEffect(() => {\n    const style = gridRef.current && getComputedStyle(gridRef.current);\n    setResolved(style ? names.map((name) => style.getPropertyValue(`--color-${name}`).trim()) : []);\n  }, [names]);\n\n  return (\n    <SwatchGrid\n      gridRef={gridRef}\n      classNames='w-48'\n      names={names}\n      columns={tones.length}\n      colorOf={(name) => `var(--color-${name})`}\n      selected={value === undefined ? -1 : resolved.indexOf(value)}\n      onSelect={(index) => resolved[index] && onPick(resolved[index])}\n      onEnter={() => setOpen(false)}\n      // The picker's own Escape handling then closes the popover.\n      onEscape={() => onPick(initialValue.current)}\n    />\n  );\n};\n\n//\n// HueGrid\n//\n\ntype ColorPickerHueGridProps = ThemedClassName<{\n  /** The theme hues offered, in order; every chromatic hue by default. */\n  hues?: readonly string[];\n  /** Cells per row. */\n  columns?: number;\n  /** The selected hue's name (e.g. `blue`). */\n  value?: string;\n  onValueChange?: (hue: string) => void;\n  /** Called on Enter or a click, so a host popover can close keeping the pick. */\n  onCommit?: () => void;\n}>;\n\n/**\n * The hue-only variant: a grid of theme hues whose value is the hue's name rather than a color, for a setting that\n * follows the theme (a space's or an identity's hue). It has no Root; any popover can host it.\n */\nconst ColorPickerHueGrid = ({\n  classNames,\n  hues = allHues,\n  columns = 6,\n  value,\n  onValueChange,\n  onCommit,\n}: ColorPickerHueGridProps) => (\n  <SwatchGrid\n    classNames={['gap-1', classNames]}\n    names={hues}\n    columns={columns}\n    colorOf={(hue) => `var(--color-${hue}-surface)`}\n    selected={value === undefined ? -1 : hues.indexOf(value)}\n    onSelect={(index) => onValueChange?.(hues[index])}\n    columnWidth='1.5rem'\n    rowHeight='1.5rem'\n    onEnter={onCommit}\n    onClickCell={onCommit}\n  />\n);\n\nColorPickerHueGrid.displayName = 'ColorPicker.HueGrid';\n\nColorPickerTrigger.displayName = 'ColorPicker.Trigger';\n\n//\n// Exports\n//\n\nexport {\n  ColorPickerHueGrid as HueGrid,\n  ColorPickerInput as Input,\n  ColorPickerRoot as Root,\n  ColorPickerTrigger as Trigger,\n  useColorPickerContext,\n};\n\nexport { DEFAULT_HUES, DEFAULT_TONES };\n\nexport type { SwatchHue, ColorPickerView as View };\n\nexport type {\n  ColorPickerHueGridProps as HueGridProps,\n  ColorPickerInputProps as InputProps,\n  ColorPickerRootProps as RootProps,\n  ColorPickerTriggerProps as TriggerProps,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAyCA,IAAM,WAAW;AAEjB,IAAM,WAAW,UAAqC;CACpD,IAAI;EACF,OAAO,WAAW,SAAS,QAAQ;CACrC,QAAQ;EACN,OAAO,WAAW,QAAQ;CAC5B;AACF;AAWA,IAAM,oBAAoB;AAE1B,IAAM,CAAC,qBAAqBA,2BAAyBC,gBAAuC,iBAAiB;;;;;AAQ7G,IAAM,mBAAmB,EAAE,UAAU,GAAG,cAAoC;CAC1E,MAAM,EAAE,OAAO,eAAe,eAAe,aAAa;CAC1D,MAAM,QAAQ,cAAc,QAAQ,KAAK,GAAG,CAAC,KAAK,CAAC;CACnD,OACE,oBAAC,qBAAD;EAAqB,GAAI;EACvB,UAAA,qBAACC,YAAqB,MAAtB;GACE,OAAO;GACG;GACV,gBAAgB,EAAE,OAAO,WAAW,gBAAgB,KAAK,SAAS,KAAK,CAAC;GACxE,mBAAmB,EAAE,OAAO,WAAW,gBAAgB,KAAK,SAAS,KAAK,CAAC;GAC3E,aAAa,EAAE,WAAW,aAAa;GACvC,WAAU;GANZ,UAAA,CAQG,UACD,oBAACA,YAAqB,aAAtB,CAAmC,CAAA,CACV;;CACR,CAAA;AAEzB;AAEA,gBAAgB,cAAc;;AAc9B,IAAM,mBAAmB,YACtB,EAAE,YAAY,aAAa,KAAK,GAAG,SAAS,iBAAiB;CAC5D,MAAM,EAAE,OAAO,eAAe,aAAaF,wBA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