@yamada-ui/color-picker 1.4.9-dev-20241109081144 → 1.4.9-dev-20241110140144

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,7 @@ import {
3
3
  ColorPickerProvider,
4
4
  useColorPicker,
5
5
  useColorPickerContext
6
- } from "./chunk-MEG43CIO.mjs";
6
+ } from "./chunk-Z2KAER2U.mjs";
7
7
  import {
8
8
  ColorSelector
9
9
  } from "./chunk-HJMXAALX.mjs";
@@ -65,6 +65,7 @@ var ColorPicker = forwardRef(
65
65
  ...computedProps
66
66
  } = omitThemeProps(mergedProps, ["withSwatch"]);
67
67
  const {
68
+ id,
68
69
  eyeDropperSupported,
69
70
  value,
70
71
  getContainerProps,
@@ -122,6 +123,7 @@ var ColorPicker = forwardRef(
122
123
  /* @__PURE__ */ jsx(Portal, { ...portalProps, children: /* @__PURE__ */ jsx(
123
124
  PopoverContent,
124
125
  {
126
+ id,
125
127
  className: "ui-color-picker__content",
126
128
  __css: { ...styles.content },
127
129
  children: /* @__PURE__ */ jsx(
@@ -254,4 +256,4 @@ ColorPickerEyeDropper.__ui__ = "ColorPickerEyeDropper";
254
256
  export {
255
257
  ColorPicker
256
258
  };
257
- //# sourceMappingURL=chunk-OJVCLBAG.mjs.map
259
+ //# sourceMappingURL=chunk-CRZIBBBY.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/color-picker.tsx"],"sourcesContent":["import type { CSSUIObject, HTMLUIProps, ThemeProps } from \"@yamada-ui/core\"\nimport type { PortalProps } from \"@yamada-ui/portal\"\nimport type { FC, ReactNode, RefAttributes } from \"react\"\nimport type { ColorSelectorProps } from \"./color-selector\"\nimport type { ColorSwatchProps } from \"./color-swatch\"\nimport type { UseColorPickerProps } from \"./use-color-picker\"\nimport {\n forwardRef,\n omitThemeProps,\n ui,\n useComponentMultiStyle,\n} from \"@yamada-ui/core\"\nimport { Popover, PopoverContent, PopoverTrigger } from \"@yamada-ui/popover\"\nimport { Portal } from \"@yamada-ui/portal\"\nimport {\n cx,\n getValidChildren,\n isValidElement,\n mergeRefs,\n runIfFunc,\n} from \"@yamada-ui/utils\"\nimport { cloneElement } from \"react\"\nimport { ColorSelector } from \"./color-selector\"\nimport { EyeDropperIcon } from \"./color-selector-eye-dropper\"\nimport { ColorSwatch } from \"./color-swatch\"\nimport {\n ColorPickerProvider,\n useColorPicker,\n useColorPickerContext,\n} from \"./use-color-picker\"\n\ninterface ColorPickerOptions {\n children?: FC<{ value: string; onClose: () => void }> | ReactNode\n /**\n * The border color when the input is invalid.\n */\n errorBorderColor?: string\n /**\n * The border color when the input is focused.\n */\n focusBorderColor?: string\n /**\n * If `true`, display the eye dropper component.\n *\n * @default true\n */\n withEyeDropper?: boolean\n /**\n * If `true`, display the color swatch component.\n *\n * @default true\n */\n withSwatch?: boolean\n /**\n * Props for color picker container element.\n */\n containerProps?: Omit<HTMLUIProps, \"children\">\n /**\n * Props for color eye dropper component.\n */\n eyeDropperProps?: ColorPickerEyeDropperProps\n /**\n * Props for color picker field element.\n */\n fieldProps?: Omit<ColorPickerFieldProps, \"children\" | \"inputProps\">\n /**\n * Props for color picker input element.\n */\n inputProps?: HTMLUIProps<\"input\">\n /**\n * Props to be forwarded to the portal component.\n *\n * @default '{ isDisabled: true }'\n */\n portalProps?: Omit<PortalProps, \"children\">\n /**\n * Props for color swatch component.\n */\n swatchProps?: ColorPickerSwatchProps\n}\n\nexport interface ColorPickerProps\n extends ThemeProps<\"ColorPicker\">,\n UseColorPickerProps,\n ColorPickerOptions,\n Pick<\n ColorSelectorProps,\n | \"alphaSliderProps\"\n | \"alphaSliderRef\"\n | \"channelProps\"\n | \"channelsProps\"\n | \"hueSliderProps\"\n | \"hueSliderRef\"\n | \"saturationSliderProps\"\n | \"saturationSliderRef\"\n | \"swatchesProps\"\n > {}\n\n/**\n * `ColorPicker` is a component used by the user to select a color or enter an arbitrary color value.\n *\n * @see Docs https://yamada-ui.com/components/forms/color-picker\n */\nexport const ColorPicker = forwardRef<ColorPickerProps, \"input\">(\n ({ withSwatch = true, ...props }, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\"ColorPicker\", {\n withSwatch,\n ...props,\n })\n let {\n className,\n alphaSliderRef,\n children,\n color,\n h,\n height,\n hueSliderRef,\n minH,\n minHeight,\n saturationSliderRef,\n withEyeDropper = true,\n alphaSliderProps,\n channelProps,\n channelsProps,\n containerProps,\n eyeDropperProps,\n fieldProps,\n hueSliderProps,\n inputProps,\n portalProps = { isDisabled: true },\n saturationSliderProps,\n swatchesProps,\n swatchProps,\n ...computedProps\n } = omitThemeProps(mergedProps, [\"withSwatch\"])\n const {\n id,\n eyeDropperSupported,\n value,\n getContainerProps,\n getEyeDropperProps,\n getFieldProps,\n getInputProps,\n getPopoverProps,\n getSelectorProps,\n onClose,\n ...rest\n } = useColorPicker(computedProps)\n\n h ??= height\n minH ??= minHeight\n\n const css: CSSUIObject = {\n color,\n h: \"fit-content\",\n w: \"100%\",\n ...styles.container,\n }\n\n return (\n <ColorPickerProvider value={{ styles, value, ...rest }}>\n <Popover {...getPopoverProps()}>\n <ui.div\n className={cx(\"ui-color-picker\", className)}\n __css={css}\n {...getContainerProps(containerProps)}\n >\n <ui.div\n className=\"ui-color-picker__inner\"\n __css={{\n position: \"relative\",\n ...styles.inner,\n }}\n >\n {withSwatch ? <ColorPickerSwatch {...swatchProps} /> : null}\n\n <ColorPickerField\n h={h}\n minH={minH}\n {...getFieldProps(fieldProps, ref)}\n inputProps={getInputProps(inputProps)}\n />\n\n {eyeDropperSupported && withEyeDropper ? (\n <ColorPickerEyeDropper\n {...getEyeDropperProps(eyeDropperProps)}\n />\n ) : null}\n </ui.div>\n\n <Portal {...portalProps}>\n <PopoverContent\n id={id}\n className=\"ui-color-picker__content\"\n __css={{ ...styles.content }}\n >\n <ColorSelector\n className=\"ui-color-picker__picker\"\n {...getSelectorProps({\n alphaSliderRef,\n hueSliderRef,\n saturationSliderRef,\n alphaSliderProps,\n channelProps,\n channelsProps,\n hueSliderProps,\n saturationSliderProps,\n swatchesProps,\n })}\n >\n {runIfFunc(children, { value, onClose })}\n </ColorSelector>\n </PopoverContent>\n </Portal>\n </ui.div>\n </Popover>\n </ColorPickerProvider>\n )\n },\n)\n\nColorPicker.displayName = \"ColorPicker\"\nColorPicker.__ui__ = \"ColorPicker\"\n\ninterface ColorPickerFieldOptions {\n inputProps?: HTMLUIProps<\"input\"> & RefAttributes<HTMLInputElement>\n}\n\ninterface ColorPickerFieldProps extends HTMLUIProps, ColorPickerFieldOptions {}\n\nconst ColorPickerField = forwardRef<ColorPickerFieldProps, \"input\">(\n ({ className, h, minH, inputProps, ...rest }, ref) => {\n const { styles } = useColorPickerContext()\n const { ref: inputRef, ...computedInputProps } = inputProps ?? {}\n\n const css: CSSUIObject = {\n alignItems: \"center\",\n display: \"flex\",\n h,\n minH,\n pe: \"2rem\",\n ps: \"2rem\",\n ...styles.field,\n }\n\n return (\n <PopoverTrigger>\n <ui.div\n className={cx(\"ui-color-picker__field\", className)}\n __css={css}\n {...rest}\n >\n <ui.input\n ref={mergeRefs(ref, inputRef)}\n className=\"ui-color-picker-picker__field__input\"\n display=\"inline-block\"\n w=\"100%\"\n {...computedInputProps}\n />\n </ui.div>\n </PopoverTrigger>\n )\n },\n)\n\nColorPickerField.displayName = \"ColorPickerField\"\nColorPickerField.__ui__ = \"ColorPickerField\"\n\ninterface ColorPickerSwatchProps extends ColorSwatchProps {}\n\nconst ColorPickerSwatch = forwardRef<ColorPickerSwatchProps, \"div\">(\n ({ className, ...rest }, ref) => {\n const { styles, value } = useColorPickerContext()\n\n const css: CSSUIObject = {\n position: \"absolute\",\n top: \"50%\",\n transform: \"translateY(-50%)\",\n zIndex: 1,\n ...styles.swatch,\n }\n\n return (\n <ColorSwatch\n ref={ref}\n className={cx(\"ui-color-picker__swatch\", className)}\n color={value}\n isRounded\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nColorPickerSwatch.displayName = \"ColorPickerSwatch\"\nColorPickerSwatch.__ui__ = \"ColorPickerSwatch\"\n\ninterface ColorPickerEyeDropperProps extends HTMLUIProps<\"button\"> {}\n\nconst ColorPickerEyeDropper = forwardRef<ColorPickerEyeDropperProps, \"button\">(\n ({ className, children, ...rest }, ref) => {\n const { styles } = useColorPickerContext()\n\n const css: CSSUIObject = {\n alignItems: \"center\",\n display: \"inline-flex\",\n justifyContent: \"center\",\n position: \"absolute\",\n top: \"50%\",\n transform: \"translateY(-50%)\",\n zIndex: 1,\n ...styles.eyeDropper,\n }\n\n const validChildren = getValidChildren(children)\n\n const cloneChildren = validChildren.map((child) =>\n cloneElement(child, {\n style: {\n color: \"currentColor\",\n maxHeight: \"1em\",\n maxWidth: \"1em\",\n },\n \"aria-hidden\": true,\n focusable: false,\n }),\n )\n\n return (\n <ui.button\n ref={ref}\n className={cx(\"ui-color-picker__eye-dropper\", className)}\n __css={css}\n {...rest}\n >\n {isValidElement(children) ? (\n cloneChildren\n ) : (\n <EyeDropperIcon className=\"ui-color-picker__eye-dropper__icon\" />\n )}\n </ui.button>\n )\n },\n)\n\nColorPickerEyeDropper.displayName = \"ColorPickerEyeDropper\"\nColorPickerEyeDropper.__ui__ = \"ColorPickerEyeDropper\"\n"],"mappings":";;;;;;;;;;;;;;;;;AAMA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,SAAS,gBAAgB,sBAAsB;AACxD,SAAS,cAAc;AACvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,oBAAoB;AAkJjB,SAOgB,KAPhB;AAhEL,IAAM,cAAc;AAAA,EACzB,CAAC,EAAE,aAAa,MAAM,GAAG,MAAM,GAAG,QAAQ;AACxC,UAAM,CAAC,QAAQ,WAAW,IAAI,uBAAuB,eAAe;AAAA,MAClE;AAAA,MACA,GAAG;AAAA,IACL,CAAC;AACD,QAAI;AAAA,MACF;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AA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A;AAAA,IAEnE;AAAA,EAEJ;AACF;AAEA,sBAAsB,cAAc;AACpC,sBAAsB,SAAS;","names":[]}
@@ -23,14 +23,15 @@ import {
23
23
  splitObject,
24
24
  useUpdateEffect
25
25
  } from "@yamada-ui/utils";
26
- import { useCallback, useRef, useState } from "react";
26
+ import { useCallback, useId, useRef, useState } from "react";
27
27
  var defaultFormatInput = (value) => value;
28
28
  var [ColorPickerProvider, useColorPickerContext] = createContext({
29
29
  name: "ColorPickerContext",
30
30
  errorMessage: `useColorPickerContext returned is 'undefined'. Seems you forgot to wrap the components in "<ColorPicker />"`
31
31
  });
32
32
  var useColorPicker = (props) => {
33
- const {
33
+ let {
34
+ id,
34
35
  allowInput = true,
35
36
  animation,
36
37
  boundary,
@@ -110,6 +111,8 @@ var useColorPicker = (props) => {
110
111
  onClose: onCloseProp,
111
112
  onOpen: onOpenProp
112
113
  });
114
+ const uuid = useId();
115
+ id != null ? id : id = uuid;
113
116
  const onOpen = useCallback(() => {
114
117
  if (disabled || readOnly) return;
115
118
  onInternalOpen();
@@ -318,6 +321,8 @@ var useColorPicker = (props) => {
318
321
  ...disabled || !allowInput ? { pointerEvents: "none" } : {}
319
322
  };
320
323
  return {
324
+ "aria-controls": id,
325
+ role: "combobox",
321
326
  tabIndex: !allowInput ? -1 : 0,
322
327
  ...formControlProps,
323
328
  ...inputProps,
@@ -329,6 +334,7 @@ var useColorPicker = (props) => {
329
334
  };
330
335
  },
331
336
  [
337
+ id,
332
338
  inputProps,
333
339
  allowInput,
334
340
  disabled,
@@ -399,6 +405,7 @@ var useColorPicker = (props) => {
399
405
  ]
400
406
  );
401
407
  return {
408
+ id,
402
409
  allowInput,
403
410
  eyeDropperSupported,
404
411
  value,
@@ -417,4 +424,4 @@ export {
417
424
  useColorPickerContext,
418
425
  useColorPicker
419
426
  };
420
- //# sourceMappingURL=chunk-MEG43CIO.mjs.map
427
+ //# sourceMappingURL=chunk-Z2KAER2U.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/use-color-picker.ts"],"sourcesContent":["import type {\n CSSUIObject,\n HTMLUIProps,\n PropGetter,\n ThemeProps,\n} from \"@yamada-ui/core\"\nimport type { ComboBoxProps, PopoverProps } from \"@yamada-ui/popover\"\nimport type { ColorFormat } from \"@yamada-ui/utils\"\nimport type {\n ChangeEvent,\n CSSProperties,\n FocusEvent,\n KeyboardEvent,\n MouseEvent,\n} from \"react\"\nimport type { ColorSelectorProps } from \"./color-selector\"\nimport type { UseColorSelectorBaseProps } from \"./use-color-selector\"\nimport { layoutStyleProperties } from \"@yamada-ui/core\"\nimport {\n formControlProperties,\n useFormControlProps,\n} from \"@yamada-ui/form-control\"\nimport { useControllableState } from \"@yamada-ui/use-controllable-state\"\nimport { useDisclosure } from \"@yamada-ui/use-disclosure\"\nimport { useEyeDropper } from \"@yamada-ui/use-eye-dropper\"\nimport { useOutsideClick } from \"@yamada-ui/use-outside-click\"\nimport {\n calcFormat,\n convertColor,\n createContext,\n dataAttr,\n getEventRelatedTarget,\n handlerAll,\n isContains,\n mergeRefs,\n pickObject,\n splitObject,\n useUpdateEffect,\n} from \"@yamada-ui/utils\"\nimport { useCallback, useId, useRef, useState } from \"react\"\n\nconst defaultFormatInput = (value: string) => value\n\ntype ColorSelectorThemeProps = ThemeProps<\"ColorSelector\">\n\ninterface ColorPickerContext {\n styles: { [key: string]: CSSUIObject | undefined }\n value: string\n}\n\nexport const [ColorPickerProvider, useColorPickerContext] =\n createContext<ColorPickerContext>({\n name: \"ColorPickerContext\",\n errorMessage: `useColorPickerContext returned is 'undefined'. Seems you forgot to wrap the components in \"<ColorPicker />\"`,\n })\n\ninterface UseColorPickerOptions {\n /**\n * If `true`, allows input.\n *\n * @default true\n */\n allowInput?: boolean\n /**\n * If `true`, the color swatch will be closed when value is selected.\n */\n closeOnSelectSwatch?: boolean\n /**\n * ColorScheme for the color selector component.\n */\n colorSelectorColorScheme?: ColorSelectorThemeProps[\"colorScheme\"]\n /**\n * Size for the color selector component.\n */\n colorSelectorSize?: ColorSelectorThemeProps[\"size\"]\n /**\n * Variant for the color selector component.\n */\n colorSelectorVariant?: ColorSelectorThemeProps[\"variant\"]\n /**\n * The initial value of the color selector.\n */\n defaultColor?: string\n /**\n * A callback function to format the input entered.\n */\n formatInput?: (value: string) => string\n /**\n * If `true` display the eye dropper component.\n *\n * @default false\n */\n withColorSelectorEyeDropper?: boolean\n /**\n * If `true`, display the result component.\n *\n * @default false\n */\n withResult?: boolean\n /**\n * Props for color selector component.\n */\n colorSelectorProps?: ColorSelectorProps\n}\n\nexport interface UseColorPickerProps\n extends Omit<\n HTMLUIProps<\"input\">,\n | \"animation\"\n | \"children\"\n | \"defaultValue\"\n | \"offset\"\n | \"onChange\"\n | \"size\"\n | \"value\"\n >,\n Omit<UseColorSelectorBaseProps, \"id\" | \"name\">,\n ComboBoxProps,\n Pick<\n ColorSelectorProps,\n | \"swatches\"\n | \"swatchesColumns\"\n | \"swatchesLabel\"\n | \"withChannel\"\n | \"withPicker\"\n >,\n UseColorPickerOptions {}\n\nexport const useColorPicker = (props: UseColorPickerProps) => {\n let {\n id,\n allowInput = true,\n animation,\n boundary,\n closeDelay,\n closeOnBlur = true,\n closeOnEsc = true,\n closeOnSelectSwatch,\n colorSelectorColorScheme,\n colorSelectorSize,\n colorSelectorVariant,\n defaultColor,\n defaultIsOpen,\n defaultValue,\n duration = 0.2,\n eventListeners,\n fallbackValue,\n flip,\n format,\n formatInput = defaultFormatInput,\n gutter,\n isLazy,\n isOpen: isOpenProp,\n lazyBehavior,\n matchWidth = colorSelectorSize === \"full\",\n modifiers,\n offset,\n openDelay,\n placement = \"bottom-start\",\n preventOverflow,\n strategy,\n swatches,\n swatchesColumns,\n swatchesLabel,\n value: valueProp,\n withChannel,\n withColorSelectorEyeDropper = false,\n withPicker,\n withResult = false,\n onChange: onChangeProp,\n onChangeEnd,\n onChangeStart,\n onClick,\n onClose: onCloseProp,\n onKeyDown,\n onOpen: onOpenProp,\n onSwatchClick,\n ...rest\n } = useFormControlProps(props)\n const {\n \"aria-readonly\": _ariaReadonly,\n onBlur,\n onFocus,\n ...formControlProps\n } = pickObject(rest, formControlProperties)\n const { disabled, readOnly } = formControlProps\n const [containerProps, inputProps] = splitObject(rest, layoutStyleProperties)\n const containerRef = useRef<HTMLDivElement>(null)\n const fieldRef = useRef<HTMLInputElement>(null)\n const { supported: eyeDropperSupported, onOpen: onEyeDropperOpen } =\n useEyeDropper()\n const [value, setValue] = useControllableState({\n defaultValue,\n value: valueProp,\n onChange: onChangeProp,\n })\n const formatRef = useRef<ColorFormat>(\n format ?? calcFormat(value || defaultColor || \"\"),\n )\n const isInputFocused = useRef<boolean>(false)\n const [inputValue, setInputValue] = useState<string>(value || \"\")\n const {\n isOpen,\n onClose: onInternalClose,\n onOpen: onInternalOpen,\n } = useDisclosure({\n defaultIsOpen,\n isOpen: isOpenProp,\n onClose: onCloseProp,\n onOpen: onOpenProp,\n })\n const uuid = useId()\n\n id ??= uuid\n\n const onOpen = useCallback(() => {\n if (disabled || readOnly) return\n\n onInternalOpen()\n }, [onInternalOpen, disabled, readOnly])\n\n const onClose = useCallback(() => {\n if (!isOpen) return\n\n const next = convertColor(value, fallbackValue)(formatRef.current)\n\n setValue((prev) => (!next || prev === next ? prev : next))\n setInputValue(formatInput(next ?? \"\"))\n\n onInternalClose()\n }, [\n formatRef,\n isOpen,\n setValue,\n onInternalClose,\n value,\n formatInput,\n setInputValue,\n fallbackValue,\n ])\n\n const onContainerClick = useCallback(() => {\n if (isOpen) return\n\n onOpen()\n }, [isOpen, onOpen])\n\n const onInputFocus = useCallback(() => {\n isInputFocused.current = true\n\n if (isOpen) return\n\n onOpen()\n }, [isOpen, onOpen])\n\n const onInputBlur = useCallback(() => {\n isInputFocused.current = false\n }, [])\n\n const onContainerBlur = useCallback(\n (ev: FocusEvent<HTMLDivElement>) => {\n const relatedTarget = getEventRelatedTarget(ev)\n\n if (isContains(containerRef.current, relatedTarget)) return\n\n if (!closeOnBlur) return\n\n if (isOpen) onClose()\n },\n [closeOnBlur, isOpen, onClose],\n )\n\n const onInputKeyDown = useCallback(\n (ev: KeyboardEvent<HTMLInputElement>) => {\n if (ev.key === \" \") ev.key = ev.code\n\n if (disabled || readOnly) return\n\n const actions: { [key: string]: Function | undefined } = {\n Enter: !isOpen ? onOpen : undefined,\n Escape: closeOnEsc ? onClose : undefined,\n Space: !isOpen ? onOpen : undefined,\n }\n\n const action = actions[ev.key]\n\n if (!action) return\n\n ev.preventDefault()\n ev.stopPropagation()\n action()\n },\n [disabled, readOnly, isOpen, onOpen, closeOnEsc, onClose],\n )\n\n const onInputChange = useCallback(\n (ev: ChangeEvent<HTMLInputElement>) => {\n const value = ev.target.value\n\n setInputValue(formatInput(value))\n setValue(value)\n },\n [setInputValue, formatInput, setValue],\n )\n\n const onColorSelectorChange = useCallback(\n (value: string) => {\n setValue(value)\n\n setTimeout(() => {\n if (!isInputFocused.current) setInputValue(formatInput(value))\n })\n },\n [setValue, formatInput],\n )\n\n const onEyeDropperClick = useCallback(\n async (ev: MouseEvent<HTMLButtonElement>) => {\n ev.preventDefault()\n ev.stopPropagation()\n\n try {\n const { sRGBHex } = (await onEyeDropperOpen()) ?? {}\n\n if (!sRGBHex) return\n\n onColorSelectorChange(sRGBHex)\n onChangeEnd?.(sRGBHex)\n } catch {}\n },\n [onEyeDropperOpen, onColorSelectorChange, onChangeEnd],\n )\n\n useOutsideClick({\n ref: containerRef,\n enabled: isOpen && closeOnBlur,\n handler: onClose,\n })\n\n useUpdateEffect(() => {\n if (!format || !value) return\n\n formatRef.current = format\n\n const nextValue = convertColor(value, fallbackValue)(format)\n\n if (!nextValue) return\n\n setInputValue(formatInput(nextValue))\n setValue(nextValue)\n }, [format])\n\n useUpdateEffect(() => {\n if (isInputFocused.current || !valueProp) return\n\n setInputValue(formatInput(valueProp))\n }, [valueProp])\n\n const getPopoverProps = useCallback(\n (props?: PopoverProps): PopoverProps => ({\n animation,\n boundary,\n closeDelay,\n closeOnBlur,\n duration,\n eventListeners,\n flip,\n gutter,\n isLazy,\n lazyBehavior,\n matchWidth,\n modifiers,\n offset,\n openDelay,\n placement,\n preventOverflow,\n strategy,\n ...props,\n closeOnButton: false,\n isOpen,\n trigger: \"never\",\n onClose,\n onOpen,\n }),\n [\n closeOnBlur,\n openDelay,\n closeDelay,\n isLazy,\n lazyBehavior,\n animation,\n duration,\n offset,\n gutter,\n preventOverflow,\n flip,\n matchWidth,\n boundary,\n eventListeners,\n strategy,\n placement,\n modifiers,\n isOpen,\n onOpen,\n onClose,\n ],\n )\n\n const getContainerProps: PropGetter = useCallback(\n (props = {}, ref = null) => ({\n ref: mergeRefs(containerRef, ref),\n ...containerProps,\n ...props,\n ...formControlProps,\n onBlur: handlerAll(props.onBlur, onBlur, onContainerBlur),\n onClick: handlerAll(props.onClick, onClick, onContainerClick),\n }),\n [\n containerProps,\n formControlProps,\n onBlur,\n onClick,\n onContainerBlur,\n onContainerClick,\n ],\n )\n\n const getFieldProps: PropGetter = useCallback(\n (props = {}, ref = null) => ({\n \"aria-expanded\": dataAttr(isOpen),\n \"data-active\": dataAttr(isOpen),\n \"data-not-allowed\": dataAttr(!readOnly && !disabled && !allowInput),\n tabIndex: !allowInput ? -1 : 0,\n ...formControlProps,\n ...props,\n ref: mergeRefs(fieldRef, ref),\n onBlur: handlerAll(props.onFocus, onInputBlur),\n onFocus: handlerAll(props.onFocus, onFocus, onInputFocus),\n onKeyDown: handlerAll(props.onKeyDown, onKeyDown, onInputKeyDown),\n }),\n [\n allowInput,\n formControlProps,\n isOpen,\n readOnly,\n disabled,\n onInputBlur,\n onFocus,\n onInputFocus,\n onKeyDown,\n onInputKeyDown,\n ],\n )\n\n const getInputProps: PropGetter<\"input\"> = useCallback(\n (props = {}, ref = null) => {\n const style: CSSProperties = {\n ...props.style,\n ...inputProps.style,\n ...(disabled || !allowInput ? { pointerEvents: \"none\" } : {}),\n }\n\n return {\n \"aria-controls\": id,\n role: \"combobox\",\n tabIndex: !allowInput ? -1 : 0,\n ...formControlProps,\n ...inputProps,\n ...props,\n ref,\n style,\n value: inputValue,\n onChange: handlerAll(props.onChange, onInputChange),\n }\n },\n [\n id,\n inputProps,\n allowInput,\n disabled,\n formControlProps,\n inputValue,\n onInputChange,\n ],\n )\n\n const getEyeDropperProps: PropGetter<\"button\"> = useCallback(\n (props = {}, ref = null) => ({\n \"aria-label\": \"Pick a color\",\n disabled,\n ...props,\n ref,\n style: { ...props.style, pointerEvents: readOnly ? \"none\" : undefined },\n onClick: handlerAll(props.onClick, onEyeDropperClick),\n }),\n [disabled, onEyeDropperClick, readOnly],\n )\n\n const getSelectorProps: PropGetter<ColorSelectorProps> = useCallback(\n (props) => ({\n ...formControlProps,\n ...props,\n colorScheme: colorSelectorColorScheme,\n size: colorSelectorSize,\n variant: colorSelectorVariant,\n defaultValue: defaultColor,\n fallbackValue,\n format: formatRef.current,\n swatches,\n swatchesColumns,\n swatchesLabel,\n value,\n withChannel,\n withEyeDropper: withColorSelectorEyeDropper,\n withPicker,\n withResult,\n onChange: onColorSelectorChange,\n onChangeEnd,\n onChangeStart,\n onSwatchClick: handlerAll(\n onSwatchClick,\n closeOnSelectSwatch ? onClose : undefined,\n ),\n }),\n [\n formControlProps,\n value,\n fallbackValue,\n defaultColor,\n onColorSelectorChange,\n onChangeStart,\n onChangeEnd,\n onSwatchClick,\n onClose,\n closeOnSelectSwatch,\n formatRef,\n withPicker,\n withChannel,\n withResult,\n withColorSelectorEyeDropper,\n swatchesLabel,\n swatches,\n swatchesColumns,\n colorSelectorColorScheme,\n colorSelectorSize,\n colorSelectorVariant,\n ],\n )\n\n return {\n id,\n allowInput,\n eyeDropperSupported,\n value,\n getContainerProps,\n getEyeDropperProps,\n getFieldProps,\n getInputProps,\n getPopoverProps,\n getSelectorProps,\n onClose,\n }\n}\n\nexport type UseColorPickerReturn = ReturnType<typeof useColorPicker>\n"],"mappings":";;;AAiBA,SAAS,6BAA6B;AACtC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,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AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["value","props"]}
@@ -1896,7 +1896,8 @@ var [ColorPickerProvider, useColorPickerContext] = (0, import_utils14.createCont
1896
1896
  errorMessage: `useColorPickerContext returned is 'undefined'. Seems you forgot to wrap the components in "<ColorPicker />"`
1897
1897
  });
1898
1898
  var useColorPicker = (props) => {
1899
- const {
1899
+ let {
1900
+ id,
1900
1901
  allowInput = true,
1901
1902
  animation,
1902
1903
  boundary,
@@ -1976,6 +1977,8 @@ var useColorPicker = (props) => {
1976
1977
  onClose: onCloseProp,
1977
1978
  onOpen: onOpenProp
1978
1979
  });
1980
+ const uuid = (0, import_react5.useId)();
1981
+ id != null ? id : id = uuid;
1979
1982
  const onOpen = (0, import_react5.useCallback)(() => {
1980
1983
  if (disabled || readOnly) return;
1981
1984
  onInternalOpen();
@@ -2184,6 +2187,8 @@ var useColorPicker = (props) => {
2184
2187
  ...disabled || !allowInput ? { pointerEvents: "none" } : {}
2185
2188
  };
2186
2189
  return {
2190
+ "aria-controls": id,
2191
+ role: "combobox",
2187
2192
  tabIndex: !allowInput ? -1 : 0,
2188
2193
  ...formControlProps,
2189
2194
  ...inputProps,
@@ -2195,6 +2200,7 @@ var useColorPicker = (props) => {
2195
2200
  };
2196
2201
  },
2197
2202
  [
2203
+ id,
2198
2204
  inputProps,
2199
2205
  allowInput,
2200
2206
  disabled,
@@ -2265,6 +2271,7 @@ var useColorPicker = (props) => {
2265
2271
  ]
2266
2272
  );
2267
2273
  return {
2274
+ id,
2268
2275
  allowInput,
2269
2276
  eyeDropperSupported,
2270
2277
  value,
@@ -2313,6 +2320,7 @@ var ColorPicker = (0, import_core12.forwardRef)(
2313
2320
  ...computedProps
2314
2321
  } = (0, import_core12.omitThemeProps)(mergedProps, ["withSwatch"]);
2315
2322
  const {
2323
+ id,
2316
2324
  eyeDropperSupported,
2317
2325
  value,
2318
2326
  getContainerProps,
@@ -2370,6 +2378,7 @@ var ColorPicker = (0, import_core12.forwardRef)(
2370
2378
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_portal.Portal, { ...portalProps, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2371
2379
  import_popover.PopoverContent,
2372
2380
  {
2381
+ id,
2373
2382
  className: "ui-color-picker__content",
2374
2383
  __css: { ...styles.content },
2375
2384
  children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(