@yamada-ui/color-picker 1.4.9-dev-20241109144901 → 1.4.9-dev-20241110143958
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{chunk-OJVCLBAG.mjs → chunk-CRZIBBBY.mjs} +4 -2
- package/dist/chunk-CRZIBBBY.mjs.map +1 -0
- package/dist/{chunk-MEG43CIO.mjs → chunk-Z2KAER2U.mjs} +10 -3
- package/dist/chunk-Z2KAER2U.mjs.map +1 -0
- package/dist/color-picker.js +10 -1
- package/dist/color-picker.js.map +1 -1
- package/dist/color-picker.mjs +2 -2
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/use-color-picker.d.mts +1 -0
- package/dist/use-color-picker.d.ts +1 -0
- package/dist/use-color-picker.js +8 -1
- package/dist/use-color-picker.js.map +1 -1
- package/dist/use-color-picker.mjs +1 -1
- package/package.json +7 -7
- package/dist/chunk-MEG43CIO.mjs.map +0 -1
- package/dist/chunk-OJVCLBAG.mjs.map +0 -1
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/alpha-slider.tsx","../src/use-color-slider.ts","../src/color-picker.tsx","../src/color-selector.tsx","../src/color-selector-body.tsx","../src/color-selector-eye-dropper.tsx","../src/use-color-selector.ts","../src/color-selector-sliders.tsx","../src/hue-slider.tsx","../src/color-swatch.tsx","../src/color-selector-channels.tsx","../src/color-selector-swatches.tsx","../src/saturation-slider.tsx","../src/use-saturation-slider.ts","../src/use-color-picker.ts"],"sourcesContent":["export { AlphaSlider } from \"./alpha-slider\"\nexport type { AlphaSliderProps } from \"./alpha-slider\"\nexport { ColorPicker } from \"./color-picker\"\nexport type { ColorPickerProps } from \"./color-picker\"\nexport { ColorSelector } from \"./color-selector\"\nexport type { ColorSelectorProps } from \"./color-selector\"\nexport { ColorSwatch } from \"./color-swatch\"\nexport type { ColorSwatchProps } from \"./color-swatch\"\nexport { HueSlider } from \"./hue-slider\"\nexport type { HueSliderProps } from \"./hue-slider\"\nexport { SaturationSlider } from \"./saturation-slider\"\nexport type { SaturationSliderProps } from \"./saturation-slider\"\nexport type { Hsv } from \"./use-saturation-slider\"\n","import type { CSSUIObject, HTMLUIProps, ThemeProps } from \"@yamada-ui/core\"\nimport type { UseColorSliderProps } from \"./use-color-slider\"\nimport {\n forwardRef,\n omitThemeProps,\n ui,\n useComponentMultiStyle,\n} from \"@yamada-ui/core\"\nimport { alphaToHex, convertColor, createContext, cx } from \"@yamada-ui/utils\"\nimport { useColorSlider } from \"./use-color-slider\"\n\ninterface AlphaSliderContext {\n styles: { [key: string]: CSSUIObject | undefined }\n}\n\nconst [AlphaSliderProvider, useAlphaSlider] = createContext<AlphaSliderContext>(\n {\n name: \"SliderContext\",\n errorMessage: `useSliderContext returned is 'undefined'. Seems you forgot to wrap the components in \"<AlphaSlider />\" `,\n },\n)\n\nconst defaultOverlays = (\n color: string,\n min: number,\n max: number,\n withShadow: boolean,\n): HTMLUIProps[] => {\n let overlays: HTMLUIProps[] = [\n {\n bgImage:\n \"linear-gradient(45deg, $checkers 25%, transparent 25%), linear-gradient(-45deg, $checkers 25%, transparent 25%), linear-gradient(45deg, transparent 75%, $checkers 75%), linear-gradient(-45deg, $body 75%, $checkers 75%)\",\n bgPosition: `0 0, 0 4px, 4px -4px, -4px 0`,\n bgSize: `8px 8px`,\n vars: [\n {\n name: \"checkers\",\n token: \"colors\",\n value: [\"blackAlpha.300\", \"whiteAlpha.300\"],\n },\n {\n name: \"body\",\n token: \"colors\",\n value: [\"whiteAlpha.500\", \"blackAlpha.500\"],\n },\n ],\n },\n {\n bgGradient: `linear(to-r, ${\n convertColor(color)(\"hex\") + alphaToHex(min)\n }, ${convertColor(color)(\"hex\") + alphaToHex(max)})`,\n },\n ]\n\n if (withShadow)\n overlays = [\n ...overlays,\n {\n boxShadow: `rgba(0, 0, 0, .1) 0 0 0 1px inset, rgb(0, 0, 0, .15) 0 0 4px inset`,\n },\n ]\n\n return overlays\n}\n\ninterface AlphaSliderOptions {\n /**\n * The color used for the slider.\n *\n * @default \"#ffffff\"\n */\n color?: string\n /**\n * The maximum allowed value of the slider. Cannot be less than min.\n *\n * @default 1\n */\n max?: number\n /**\n * The minimum allowed value of the slider. Cannot be greater than max.\n *\n * @default 0\n */\n min?: number\n /**\n * The overlay used for the slider.\n */\n overlays?: HTMLUIProps[]\n /**\n * The step in which increments or decrements have to be made.\n *\n * @default 0.01\n */\n step?: number\n /**\n * If `true`, the slider has an inner `box-shadow`.\n *\n * @default true\n */\n withShadow?: boolean\n /**\n * Props for slider input element.\n */\n inputProps?: HTMLUIProps<\"input\">\n /**\n * Props for slider thumb element.\n */\n thumbProps?: HTMLUIProps\n /**\n * Props for slider track element.\n */\n trackProps?: HTMLUIProps\n}\n\nexport interface AlphaSliderProps\n extends ThemeProps<\"AlphaSlider\">,\n Partial<Omit<UseColorSliderProps, \"channel\" | \"color\">>,\n AlphaSliderOptions {}\n\n/**\n * `AlphaSlider` is a component used to allow the user to select color transparency.\n *\n * @see Docs https://yamada-ui.com/components/forms/alpha-slider\n */\nexport const AlphaSlider = forwardRef<AlphaSliderProps, \"input\">(\n (props, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\"AlphaSlider\", props)\n const {\n className,\n color = \"#ffffff\",\n max = 1,\n min = 0,\n withShadow = true,\n overlays = defaultOverlays(color, min, max, withShadow),\n inputProps,\n thumbProps,\n trackProps,\n __css,\n ...computedProps\n } = omitThemeProps(mergedProps)\n const { getContainerProps, getInputProps, getThumbProps, getTrackProps } =\n useColorSlider({\n max,\n min,\n step: 0.01,\n thumbColor: \"transparent\",\n ...computedProps,\n channel: \"alpha\",\n })\n\n const css: CSSUIObject = {\n position: \"relative\",\n ...styles.container,\n ...__css,\n }\n\n return (\n <AlphaSliderProvider value={{ styles }}>\n <ui.div\n className={cx(\"ui-alpha-slider\", className)}\n __css={css}\n {...getContainerProps()}\n >\n <ui.input {...getInputProps(inputProps, ref)} />\n\n {overlays.map((props, index) => (\n <AlphaSliderOverlay key={index} {...props} />\n ))}\n\n <AlphaSliderTrack {...getTrackProps(trackProps)}>\n <AlphaSliderThumb {...getThumbProps(thumbProps)} />\n </AlphaSliderTrack>\n </ui.div>\n </AlphaSliderProvider>\n )\n },\n)\n\nAlphaSlider.displayName = \"AlphaSlider\"\nAlphaSlider.__ui__ = \"AlphaSlider\"\n\ninterface AlphaSliderOverlayProps extends HTMLUIProps {}\n\nconst AlphaSliderOverlay = forwardRef<AlphaSliderOverlayProps, \"div\">(\n ({ className, ...rest }, ref) => {\n const { styles } = useAlphaSlider()\n\n const css: CSSUIObject = {\n bottom: 0,\n left: 0,\n position: \"absolute\",\n right: 0,\n top: 0,\n ...styles.overlay,\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-alpha-slider__overlay\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nAlphaSliderOverlay.displayName = \"AlphaSliderOverlay\"\nAlphaSliderOverlay.__ui__ = \"AlphaSliderOverlay\"\n\ninterface AlphaSliderTrackProps extends HTMLUIProps {}\n\nconst AlphaSliderTrack = forwardRef<AlphaSliderTrackProps, \"div\">(\n ({ className, ...rest }, ref) => {\n const { styles } = useAlphaSlider()\n\n const css: CSSUIObject = {\n h: \"100%\",\n position: \"relative\",\n w: \"100%\",\n ...styles.track,\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-alpha-slider__track\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nAlphaSliderTrack.displayName = \"AlphaSliderTrack\"\nAlphaSliderTrack.__ui__ = \"AlphaSliderTrack\"\n\ninterface AlphaSliderThumbProps extends HTMLUIProps {}\n\nconst AlphaSliderThumb = forwardRef<AlphaSliderThumbProps, \"div\">(\n ({ className, ...rest }, ref) => {\n const { styles } = useAlphaSlider()\n\n const css: CSSUIObject = { ...styles.thumb }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-alpha-slider__thumb\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nAlphaSliderThumb.displayName = \"AlphaSliderThumb\"\nAlphaSliderThumb.__ui__ = \"AlphaSliderThumb\"\n","import type { CSSUIProps, HTMLUIProps, PropGetter } from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\nimport type { CSSProperties, KeyboardEvent, KeyboardEventHandler } from \"react\"\nimport {\n formControlProperties,\n useFormControlProps,\n} from \"@yamada-ui/form-control\"\nimport { useControllableState } from \"@yamada-ui/use-controllable-state\"\nimport { useLatestRef } from \"@yamada-ui/use-latest-ref\"\nimport { usePanEvent } from \"@yamada-ui/use-pan-event\"\nimport { useSize } from \"@yamada-ui/use-size\"\nimport {\n clampNumber,\n dataAttr,\n handlerAll,\n mergeRefs,\n percentToValue,\n roundNumberToStep,\n splitObject,\n useCallbackRef,\n useUpdateEffect,\n valueToPercent,\n} from \"@yamada-ui/utils\"\nimport { useCallback, useRef, useState } from \"react\"\n\ntype ColorSliderChannel = \"alpha\" | \"hue\"\n\ninterface UseColorSliderOptions {\n /**\n * The maximum allowed value of the slider. Cannot be less than min.\n */\n max: number\n /**\n * The minimum allowed value of the slider. Cannot be greater than max.\n */\n min: number\n /**\n * The base `id` to use for the slider.\n */\n id?: string\n /**\n * The name attribute of the hidden `input` field.\n * This is particularly useful in forms.\n */\n name?: string\n /**\n * The channel of the slider.\n */\n channel?: ColorSliderChannel\n /**\n * The initial value of the slider.\n */\n defaultValue?: number\n /**\n * If `false`, the slider handle will not capture focus when value changes.\n *\n * @default true\n */\n focusThumbOnChange?: boolean\n /**\n * The step in which increments or decrements have to be made.\n *\n * @default 1\n */\n step?: number\n /**\n * The CSS `background` property. Used in `background` of thumb element.\n */\n thumbColor?: CSSUIProps[\"bg\"]\n /**\n * The value of the slider.\n */\n value?: number\n /**\n * Function called whenever the slider value changes.\n */\n onChange?: (value: number) => void\n /**\n * Function called when the user is done selecting a new value.\n */\n onChangeEnd?: (value: number) => void\n /**\n * Function called when the user starts selecting a new value.\n */\n onChangeStart?: (value: number) => void\n}\n\nexport interface UseColorSliderProps\n extends Omit<HTMLUIProps, \"defaultValue\" | \"onChange\">,\n UseColorSliderOptions,\n FormControlOptions {}\n\nexport const useColorSlider = ({\n focusThumbOnChange = true,\n ...props\n}: UseColorSliderProps) => {\n if (!focusThumbOnChange) props.isReadOnly = true\n\n const {\n id,\n name,\n style: styleProp,\n channel = \"hue\",\n defaultValue,\n max,\n min = 0,\n step = 1,\n thumbColor,\n value: valueProp,\n onChange: onChangeProp,\n onChangeEnd: onChangeEndProp,\n onChangeStart: onChangeStartProp,\n ...rest\n } = useFormControlProps(props)\n const [\n {\n \"aria-readonly\": ariaReadonly,\n disabled,\n readOnly,\n required,\n onBlur: onBlurProp,\n onFocus: onFocusProp,\n ...formControlProps\n },\n containerProps,\n ] = splitObject(rest, formControlProperties)\n\n const onChangeStart = useCallbackRef(onChangeStartProp)\n const onChangeEnd = useCallbackRef(onChangeEndProp)\n\n const [computedValue, setValue] = useControllableState({\n defaultValue: defaultValue ?? min + (max - min) / 2,\n value: valueProp,\n onChange: onChangeProp,\n })\n const value = clampNumber(computedValue, min, max)\n const thumbPercent = valueToPercent(value, min, max)\n const [isDragging, setDragging] = useState(false)\n const isInteractive = !(disabled || readOnly)\n\n const oneStep = step || (max - min) / 100\n const tenStep = (max - min) / 10\n\n const containerRef = useRef<HTMLElement>(null)\n const trackRef = useRef<HTMLElement>(null)\n const thumbRef = useRef<HTMLElement>(null)\n const latestRef = useLatestRef({\n eventSource: null as \"keyboard\" | \"pointer\" | null,\n focusThumbOnChange,\n isInteractive,\n max,\n min,\n step,\n value,\n })\n\n const thumbSize = useSize(thumbRef)\n\n const getValueFromPointer = useCallback(\n (ev: any) => {\n if (!trackRef.current) return\n\n const { max, min, step } = latestRef.current\n\n latestRef.current.eventSource = \"pointer\"\n\n const { left, width } = trackRef.current.getBoundingClientRect()\n const { clientX } = ev.touches?.[0] ?? ev\n\n let percent = (clientX - left) / width\n\n let nextValue = percentToValue(percent, min, max)\n\n if (step) nextValue = parseFloat(roundNumberToStep(nextValue, min, step))\n\n nextValue = clampNumber(nextValue, min, max)\n\n return nextValue\n },\n [latestRef],\n )\n\n const setValueFromPointer = (ev: MouseEvent | PointerEvent | TouchEvent) => {\n const { value } = latestRef.current\n const nextValue = getValueFromPointer(ev)\n\n if (nextValue != null && nextValue !== value) setValue(nextValue)\n }\n\n const focusThumb = useCallback(() => {\n const { focusThumbOnChange } = latestRef.current\n\n if (focusThumbOnChange) setTimeout(() => thumbRef.current?.focus())\n }, [latestRef])\n\n const constrain = useCallback(\n (value: number) => {\n const { isInteractive, max, min } = latestRef.current\n\n if (!isInteractive) return\n\n value = parseFloat(roundNumberToStep(value, min, oneStep))\n value = clampNumber(value, min, max)\n\n setValue(value)\n },\n [setValue, latestRef, oneStep],\n )\n\n const stepUp = useCallback(\n (step = oneStep) => constrain(value + step),\n [constrain, value, oneStep],\n )\n\n const stepDown = useCallback(\n (step = oneStep) => constrain(value - step),\n [constrain, value, oneStep],\n )\n\n const onKeyDown = useCallback(\n (ev: KeyboardEvent<HTMLElement>) => {\n const { max, min } = latestRef.current\n\n const actions: { [key: string]: KeyboardEventHandler } = {\n ArrowDown: () => stepDown(),\n ArrowLeft: () => stepDown(),\n ArrowRight: () => stepUp(),\n ArrowUp: () => stepUp(),\n End: () => constrain(max),\n Home: () => constrain(min),\n PageDown: () => stepDown(tenStep),\n PageUp: () => stepUp(tenStep),\n }\n\n const action = actions[ev.key]\n\n if (!action) return\n\n ev.preventDefault()\n ev.stopPropagation()\n\n action(ev)\n\n latestRef.current.eventSource = \"keyboard\"\n },\n [constrain, latestRef, stepDown, stepUp, tenStep],\n )\n\n usePanEvent(containerRef, {\n onMove: (ev) => {\n const { isInteractive } = latestRef.current\n\n if (!isInteractive) return\n\n setValueFromPointer(ev)\n },\n onSessionEnd: () => {\n const { isInteractive, value } = latestRef.current\n\n if (!isInteractive) return\n\n setDragging(false)\n onChangeEnd(value)\n },\n onSessionStart: (ev) => {\n const { isInteractive, value } = latestRef.current\n\n if (!isInteractive) return\n\n setDragging(true)\n focusThumb()\n setValueFromPointer(ev)\n onChangeStart(value)\n },\n })\n\n useUpdateEffect(() => {\n const { eventSource, value } = latestRef.current\n\n if (eventSource === \"keyboard\") onChangeEnd(value)\n }, [value, onChangeEnd])\n\n const getContainerProps: PropGetter = useCallback(\n (props = {}, ref = null) => {\n const { width: w } = thumbSize ?? { width: 0 }\n\n const style: CSSProperties = {\n ...props.style,\n ...styleProp,\n paddingInline: `${w / 2}px`,\n }\n\n return {\n ...props,\n ...formControlProps,\n ...containerProps,\n ref: mergeRefs(ref, containerRef),\n style,\n tabIndex: -1,\n }\n },\n [containerProps, formControlProps, styleProp, thumbSize],\n )\n\n const getInputProps: PropGetter<\"input\"> = useCallback(\n (props = {}, ref = null) => ({\n ...formControlProps,\n \"aria-readonly\": ariaReadonly,\n ...props,\n id,\n ref,\n type: \"hidden\",\n name,\n disabled,\n readOnly,\n required,\n value,\n }),\n [\n ariaReadonly,\n disabled,\n formControlProps,\n id,\n name,\n readOnly,\n required,\n value,\n ],\n )\n\n const getTrackProps: PropGetter = useCallback(\n (props = {}, ref = null) => ({\n ...formControlProps,\n ...props,\n ref: mergeRefs(ref, trackRef),\n }),\n [formControlProps],\n )\n\n const getThumbProps: PropGetter = useCallback(\n (props = {}, ref = null) => {\n const n = thumbPercent\n const { width: w } = thumbSize ?? { width: 0 }\n\n const style: CSSProperties = {\n ...props.style,\n left: `calc(${n}% - ${w / 2}px)`,\n position: \"absolute\",\n touchAction: \"none\",\n userSelect: \"none\",\n }\n\n return {\n \"aria-label\": \"Slider thumb\",\n bg: thumbColor ?? `hsl(${value}, 100%, 50%)`,\n ...formControlProps,\n \"aria-readonly\": ariaReadonly,\n ...props,\n ref: mergeRefs(ref, thumbRef),\n style,\n \"aria-valuemax\": max,\n \"aria-valuemin\": min,\n \"aria-valuenow\": value,\n \"aria-valuetext\": getAriaValueText(channel, value),\n \"data-active\": dataAttr(isDragging && focusThumbOnChange),\n role: \"slider\",\n tabIndex: isInteractive && focusThumbOnChange ? 0 : undefined,\n onBlur: handlerAll(props.onBlur, onBlurProp),\n onFocus: handlerAll(props.onFocus, onFocusProp),\n onKeyDown: handlerAll(props.onKeyDown, onKeyDown),\n }\n },\n [\n thumbPercent,\n thumbSize,\n thumbColor,\n value,\n formControlProps,\n ariaReadonly,\n max,\n min,\n channel,\n isDragging,\n focusThumbOnChange,\n isInteractive,\n onBlurProp,\n onFocusProp,\n onKeyDown,\n ],\n )\n\n return {\n value,\n getContainerProps,\n getInputProps,\n getThumbProps,\n getTrackProps,\n }\n}\n\nexport type UseColorSliderReturn = ReturnType<typeof useColorSlider>\n\nexport const getAriaValueText = (\n channel: ColorSliderChannel,\n value: number,\n) => {\n if (channel === \"hue\") {\n return `${value}°, ${getColorName(value)}`\n } else {\n return `${value * 100}%`\n }\n}\n\nconst getColorName = (hue: number): string => {\n if (hue < 30 || hue >= 330) return \"Red\"\n if (hue < 90) return \"Yellow\"\n if (hue < 150) return \"Green\"\n if (hue < 210) return \"Cyan\"\n if (hue < 270) return \"Blue\"\n return \"Magenta\"\n}\n","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 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 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","import type { CSSUIObject, HTMLUIProps, ThemeProps } from \"@yamada-ui/core\"\nimport type { FC, ForwardedRef, ReactNode } from \"react\"\nimport type { ColorSelectorBodyProps } from \"./color-selector-body\"\nimport type { ColorSelectorChannelsProps } from \"./color-selector-channels\"\nimport type { ColorSelectorSwatchesProps } from \"./color-selector-swatches\"\nimport type { SaturationSliderProps } from \"./saturation-slider\"\nimport type { UseColorSelectorProps } from \"./use-color-selector\"\nimport {\n forwardRef,\n omitThemeProps,\n ui,\n useComponentMultiStyle,\n} from \"@yamada-ui/core\"\nimport { cx, runIfFunc } from \"@yamada-ui/utils\"\nimport { ColorSelectorBody } from \"./color-selector-body\"\nimport { ColorSelectorChannels } from \"./color-selector-channels\"\nimport { ColorSelectorSwatches } from \"./color-selector-swatches\"\nimport { SaturationSlider } from \"./saturation-slider\"\nimport { ColorSelectorProvider, useColorSelector } from \"./use-color-selector\"\n\ninterface ColorSelectorOptions {\n children?: FC<{ value: string }> | ReactNode\n /**\n * Ref for the saturation slider component.\n */\n saturationSliderRef?: ForwardedRef<HTMLInputElement>\n /**\n * If `true`, display the channels component.\n *\n * @default true\n */\n withChannel?: boolean\n /**\n * If `true`, display the saturation, hue, alpha, channels and eye dropper component.\n *\n * @default true\n */\n withPicker?: boolean\n /**\n * Props for the channels component.\n */\n channelsProps?: ColorSelectorChannelsProps\n /**\n * Props for the color selector input element.\n */\n inputProps?: HTMLUIProps<\"input\">\n /**\n * Props for the saturation slider component.\n */\n saturationSliderProps?: Omit<SaturationSliderProps, \"defaultValue\" | \"value\">\n /**\n * Props for the swatches component.\n */\n swatchesProps?: ColorSelectorSwatchesProps\n}\n\nexport interface ColorSelectorProps\n extends ThemeProps<\"ColorSelector\">,\n UseColorSelectorProps,\n ColorSelectorOptions,\n Pick<\n ColorSelectorBodyProps,\n | \"alphaSliderProps\"\n | \"alphaSliderRef\"\n | \"eyeDropperProps\"\n | \"eyeDropperRef\"\n | \"hueSliderProps\"\n | \"hueSliderRef\"\n | \"withEyeDropper\"\n | \"withResult\"\n >,\n Pick<\n ColorSelectorSwatchesProps,\n \"swatches\" | \"swatchesColumns\" | \"swatchesLabel\" | \"swatchProps\"\n >,\n Pick<ColorSelectorChannelsProps, \"channelProps\"> {}\n\n/**\n * `ColorSelector` is a component used by the user to select a color.\n *\n * @see Docs https://yamada-ui.com/components/forms/color-selector\n */\nexport const ColorSelector = forwardRef<ColorSelectorProps, \"input\">(\n ({ size, ...props }, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\"ColorSelector\", {\n size,\n ...props,\n })\n const {\n className,\n alphaSliderRef,\n children,\n eyeDropperRef,\n hueSliderRef,\n saturationSliderRef,\n swatches,\n swatchesColumns = 7,\n swatchesLabel,\n withChannel = true,\n withEyeDropper,\n withPicker = true,\n withResult = true,\n alphaSliderProps,\n channelProps,\n channelsProps,\n eyeDropperProps,\n hueSliderProps,\n inputProps,\n saturationSliderProps,\n swatchesProps,\n swatchProps,\n ...computedProps\n } = omitThemeProps(mergedProps)\n const {\n value,\n getContainerProps,\n getInputProps,\n getSaturationSliderProps,\n ...rest\n } = useColorSelector(computedProps)\n\n const css: CSSUIObject = {\n display: \"flex\",\n flexDirection: \"column\",\n ...styles.container,\n }\n\n return (\n <ColorSelectorProvider value={{ size, styles, value, ...rest }}>\n <ui.div\n ref={ref}\n className={cx(\"ui-color-selector\", className)}\n __css={css}\n {...getContainerProps()}\n >\n <ui.input {...getInputProps(inputProps, ref)} />\n\n {withPicker ? (\n <SaturationSlider\n className=\"ui-color-selector__saturation-slider\"\n size={size}\n __css={{ ...styles.saturationSlider }}\n {...getSaturationSliderProps(\n saturationSliderProps,\n saturationSliderRef,\n )}\n />\n ) : null}\n\n {withPicker ? (\n <ColorSelectorBody\n {...{\n alphaSliderRef,\n eyeDropperRef,\n hueSliderRef,\n withEyeDropper,\n withResult,\n alphaSliderProps,\n eyeDropperProps,\n hueSliderProps,\n }}\n />\n ) : null}\n\n {withPicker && withChannel ? (\n <ColorSelectorChannels {...{ channelProps, ...channelsProps }} />\n ) : null}\n\n <ColorSelectorSwatches\n {...{\n swatches,\n swatchesColumns,\n swatchesLabel,\n swatchProps,\n ...swatchesProps,\n }}\n />\n\n {runIfFunc(children, { value })}\n </ui.div>\n </ColorSelectorProvider>\n )\n },\n)\n\nColorSelector.displayName = \"ColorSelector\"\nColorSelector.__ui__ = \"ColorSelector\"\n","import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport type { ForwardedRef } from \"react\"\nimport type { ColorSelectorEyeDropperProps } from \"./color-selector-eye-dropper\"\nimport type { ColorSelectorSlidersProps } from \"./color-selector-sliders\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { ColorSelectorEyeDropper } from \"./color-selector-eye-dropper\"\nimport { ColorSelectorSliders } from \"./color-selector-sliders\"\nimport { ColorSwatch } from \"./color-swatch\"\nimport { useColorSelectorContext } from \"./use-color-selector\"\n\ninterface ColorSelectorBodyOptions {\n /**\n * Ref for the eye dropper component.\n */\n eyeDropperRef?: ForwardedRef<HTMLButtonElement>\n /**\n * If `true` display the eye dropper component.\n *\n * @default true\n */\n withEyeDropper?: boolean\n /**\n * If `true`, display the result component.\n *\n * @default true\n */\n withResult?: boolean\n /**\n * Props for the eye dropper component.\n */\n eyeDropperProps?: ColorSelectorEyeDropperProps\n}\n\nexport interface ColorSelectorBodyProps\n extends Omit<HTMLUIProps, \"children\">,\n ColorSelectorBodyOptions,\n Pick<\n ColorSelectorSlidersProps,\n \"alphaSliderProps\" | \"alphaSliderRef\" | \"hueSliderProps\" | \"hueSliderRef\"\n > {}\n\nexport const ColorSelectorBody = forwardRef<ColorSelectorBodyProps, \"div\">(\n (\n {\n className,\n alphaSliderRef,\n eyeDropperRef,\n hueSliderRef,\n withEyeDropper = true,\n withResult,\n alphaSliderProps,\n eyeDropperProps,\n hueSliderProps,\n ...rest\n },\n ref,\n ) => {\n const { eyeDropperSupported, styles, value } = useColorSelectorContext()\n\n const css: CSSUIObject = {\n display: \"flex\",\n w: \"100%\",\n ...styles.body,\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-color-selector__body\", className)}\n __css={css}\n {...rest}\n >\n <ColorSelectorSliders\n {...{\n alphaSliderRef,\n hueSliderRef,\n alphaSliderProps,\n hueSliderProps,\n }}\n />\n\n {withEyeDropper && eyeDropperSupported ? (\n <ColorSelectorEyeDropper ref={eyeDropperRef} {...eyeDropperProps} />\n ) : null}\n\n {withResult ? (\n <ColorSwatch\n className=\"ui-color-selector__result\"\n color={value}\n __css={{ ...styles.result }}\n />\n ) : null}\n </ui.div>\n )\n },\n)\n\nColorSelectorBody.displayName = \"ColorSelectorBody\"\nColorSelectorBody.__ui__ = \"ColorSelectorBody\"\n","import type { IconButtonProps } from \"@yamada-ui/button\"\nimport type { CSSUIObject, FC } from \"@yamada-ui/core\"\nimport type { IconProps } from \"@yamada-ui/icon\"\nimport { IconButton } from \"@yamada-ui/button\"\nimport { forwardRef } from \"@yamada-ui/core\"\nimport { Icon } from \"@yamada-ui/icon\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useColorSelectorContext } from \"./use-color-selector\"\n\nexport interface ColorSelectorEyeDropperProps extends IconButtonProps {}\n\nexport const ColorSelectorEyeDropper = forwardRef<\n ColorSelectorEyeDropperProps,\n \"button\"\n>(({ className, ...rest }, ref) => {\n const { size, readOnly, styles, getEyeDropperProps } =\n useColorSelectorContext()\n\n const css: CSSUIObject = {\n h: \"auto\",\n minW: \"auto\",\n pointerEvents: readOnly ? \"none\" : undefined,\n ...styles.eyeDropper,\n }\n\n return (\n <IconButton\n className={cx(\"ui-color-selector__eye-dropper\", className)}\n size={size}\n variant=\"outline\"\n __css={css}\n {...getEyeDropperProps(rest, ref)}\n >\n <EyeDropperIcon className=\"ui-color-selector__eye-dropper__icon\" />\n </IconButton>\n )\n})\n\nColorSelectorEyeDropper.displayName = \"ColorSelectorEyeDropper\"\nColorSelectorEyeDropper.__ui__ = \"ColorSelectorEyeDropper\"\n\nexport const EyeDropperIcon: FC<IconProps> = ({ ...rest }) => {\n return (\n <Icon\n fill=\"none\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n {...rest}\n >\n <path d=\"m2 22 1-1h3l9-9\" />\n <path d=\"M3 21v-3l9-9\" />\n <path d=\"m15 6 3.4-3.4a2.1 2.1 0 1 1 3 3L18 9l.4.4a2.1 2.1 0 1 1-3 3l-3.8-3.8a2.1 2.1 0 1 1 3-3l.4.4Z\" />\n </Icon>\n )\n}\n\nEyeDropperIcon.displayName = \"EyeDropperIcon\"\nEyeDropperIcon.__ui__ = \"EyeDropperIcon\"\n","import type {\n CSSUIObject,\n HTMLUIProps,\n PropGetter,\n RequiredPropGetter,\n ThemeProps,\n} from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\nimport type { InputProps } from \"@yamada-ui/input\"\nimport type { ColorFormat, Dict } from \"@yamada-ui/utils\"\nimport type { ChangeEvent } from \"react\"\nimport type { AlphaSliderProps } from \"./alpha-slider\"\nimport type { ColorSwatchProps } from \"./color-swatch\"\nimport type { HueSliderProps } from \"./hue-slider\"\nimport type { SaturationSliderProps } from \"./saturation-slider\"\nimport {\n formControlProperties,\n useFormControlProps,\n} from \"@yamada-ui/form-control\"\nimport { useControllableState } from \"@yamada-ui/use-controllable-state\"\nimport { useEyeDropper } from \"@yamada-ui/use-eye-dropper\"\nimport {\n calcFormat,\n convertColor,\n createContext,\n handlerAll,\n hslaTo,\n hsvTo,\n isString,\n parseToHsla,\n parseToHsv,\n parseToRgba,\n rgbaTo,\n splitObject,\n useCallbackRef,\n useUpdateEffect,\n} from \"@yamada-ui/utils\"\nimport { useCallback, useMemo, useRef, useState } from \"react\"\n\ntype Space = keyof Hsla | keyof Rgba\ninterface Hsla {\n a: number\n h: number\n l: number\n s: number\n}\ninterface Rgba {\n a: number\n b: number\n g: number\n r: number\n}\ninterface Hsva {\n a: number\n h: number\n s: number\n v: number\n}\ninterface Channel {\n label: string\n max: number\n min: number\n space: Space\n value: number\n}\n\nconst convertHsla = (value: string, fallback?: string): Hsla => {\n let [h, s, l, a] = parseToHsla(value, fallback) ?? [0, 0, 1, 1]\n\n if (a > 1) a = 1\n\n return { a, h, l, s }\n}\n\nconst convertRgba = (value: string, fallback?: string): Rgba => {\n let [r, g, b, a] = parseToRgba(value, fallback) ?? [255, 255, 255, 1]\n\n if (r > 255) r = 255\n if (g > 255) g = 255\n if (b > 255) b = 255\n if (a > 1) a = 1\n\n return { a, b, g, r }\n}\n\nconst convertHsva = (value: string, fallback?: string): Hsva => {\n const [h, s, v, a] = parseToHsv(value, fallback)\n\n return { a, h, s, v }\n}\n\ninterface ColorSelectorContext {\n channels: Channel[]\n eyeDropperSupported: boolean\n isInteractive: boolean\n styles: { [key: string]: CSSUIObject | undefined }\n value: string\n withAlpha: boolean\n getAlphaSliderProps: PropGetter<AlphaSliderProps>\n getChannelProps: RequiredPropGetter<{ space: Space } & InputProps, InputProps>\n getEyeDropperProps: PropGetter<\"button\">\n getHueSliderProps: PropGetter<HueSliderProps>\n getSwatchProps: PropGetter<ColorSwatchProps>\n onChange: (value: Partial<Hsva> | string) => void\n size?: ThemeProps<\"ColorSelector\">[\"size\"]\n disabled?: boolean\n readOnly?: boolean\n}\n\nexport const [ColorSelectorProvider, useColorSelectorContext] =\n createContext<ColorSelectorContext>({\n name: \"ColorSelectorContext\",\n errorMessage: `useColorSelectorContext returned is 'undefined'. Seems you forgot to wrap the components in \"<ColorSelector />\"`,\n })\n\ninterface UseColorSelectorOptions {\n /**\n * The base `id` to use for the color selector.\n */\n id?: string\n /**\n * The name attribute of the hidden `input` field.\n * This is particularly useful in forms.\n */\n name?: string\n /**\n * The initial value of the color selector.\n */\n defaultValue?: string\n /**\n * The fallback value returned when color determination fails.\n */\n fallbackValue?: string\n /**\n * Color format. For example, `hex`, `rgba`, etc.\n *\n * @default \"hexa\"\n */\n format?: ColorFormat\n /**\n * The value of the color selector.\n */\n value?: string\n /**\n * Function called whenever the color selector value changes.\n */\n onChange?: (value: string) => void\n /**\n * Function called when the user is done selecting a new value.\n */\n onChangeEnd?: (value: string) => void\n /**\n * Function called when the user starts selecting a new value.\n */\n onChangeStart?: (value: string) => void\n /**\n * Function called whenever the color swatch click.\n */\n onSwatchClick?: (value: string) => void\n}\n\nexport interface UseColorSelectorBaseProps\n extends UseColorSelectorOptions,\n FormControlOptions {}\n\nexport interface UseColorSelectorProps\n extends Omit<HTMLUIProps, \"children\" | \"defaultValue\" | \"onChange\">,\n UseColorSelectorBaseProps {}\n\nexport const useColorSelector = ({\n isInvalid,\n ...props\n}: UseColorSelectorProps) => {\n const {\n id,\n name,\n defaultValue,\n fallbackValue,\n format: formatProp,\n value: valueProp,\n onChange: onChangeProp,\n onChangeEnd: onChangeEndProp,\n onChangeStart: onChangeStartProp,\n onSwatchClick,\n ...rest\n } = useFormControlProps({ isInvalid, ...props })\n const [\n {\n \"aria-readonly\": ariaReadonly,\n disabled,\n readOnly,\n required,\n ...formControlProps\n },\n containerProps,\n ] = splitObject(rest, formControlProperties)\n\n const onChangeStartRef = useCallbackRef(onChangeStartProp)\n const onChangeEndRef = useCallbackRef(onChangeEndProp)\n const { supported: eyeDropperSupported, onOpen } = useEyeDropper()\n const [value, setValue] = useControllableState({\n defaultValue: defaultValue ?? fallbackValue,\n value: valueProp,\n onChange: onChangeProp,\n })\n const format = useMemo(\n () => formatProp ?? calcFormat(value || \"#ffffff\"),\n [value, formatProp],\n )\n const resolvedValue = convertColor(value, \"#ffffff\")(format) as string\n const timeoutId = useRef<any>(undefined)\n const isDraggingRef = useRef<boolean>(false)\n const [parsedValue, setParsedValue] = useState<Hsva>(\n convertHsva(resolvedValue, fallbackValue),\n )\n const { a, h, s, v } = parsedValue\n const withAlpha = format.endsWith(\"a\")\n const isInteractive = !(disabled || readOnly)\n\n const channels: Channel[] = useMemo(() => {\n if (resolvedValue.startsWith(\"hsl\")) {\n const { a, h, l, s } = convertHsla(resolvedValue, fallbackValue)\n\n let channels: Channel[] = [\n { label: \"H\", max: 360, min: 0, space: \"h\", value: Math.round(h) },\n {\n label: \"S(%)\",\n max: 100,\n min: 0,\n space: \"s\",\n value: Math.round(s * 100),\n },\n {\n label: \"L(%)\",\n max: 100,\n min: 0,\n space: \"l\",\n value: Math.round(l * 100),\n },\n ]\n\n if (withAlpha) {\n channels = [\n ...channels,\n {\n label: \"A(%)\",\n max: 100,\n min: 0,\n space: \"a\",\n value: Math.round(a * 100),\n },\n ]\n }\n\n return channels\n } else {\n const { a, b, g, r } = convertRgba(resolvedValue, fallbackValue)\n\n let channels: Channel[] = [\n { label: \"R\", max: 255, min: 0, space: \"r\", value: Math.round(r) },\n { label: \"G\", max: 255, min: 0, space: \"g\", value: Math.round(g) },\n { label: \"B\", max: 255, min: 0, space: \"b\", value: Math.round(b) },\n ]\n\n if (withAlpha) {\n channels = [\n ...channels,\n {\n label: \"A(%)\",\n max: 100,\n min: 0,\n space: \"a\",\n value: Math.round(a * 100),\n },\n ]\n }\n\n return channels\n }\n }, [resolvedValue, withAlpha, fallbackValue])\n\n const onChange = useCallback(\n (value: Partial<Hsva> | string) => {\n if (isString(value)) {\n setParsedValue(convertHsva(value, fallbackValue))\n } else {\n setParsedValue((prev) => ({ ...prev, ...value }))\n }\n },\n [fallbackValue],\n )\n\n const onChangeStart = useCallback(\n (value: Partial<Hsva>) => {\n window.clearTimeout(timeoutId.current)\n\n isDraggingRef.current = true\n\n const { a, h, s, v } = { ...parsedValue, ...value }\n\n const nextValue = hsvTo([h, s, v, a], fallbackValue)(format)\n\n if (nextValue) onChangeStartRef(nextValue)\n },\n [onChangeStartRef, fallbackValue, parsedValue, format],\n )\n\n const onChangeEnd = useCallback(\n (value: Partial<Hsva> | string) => {\n window.clearTimeout(timeoutId.current)\n\n timeoutId.current = window.setTimeout(() => {\n isDraggingRef.current = false\n }, 200)\n\n let nextValue: string | undefined\n\n if (isString(value)) {\n nextValue = convertColor(value, fallbackValue)(format)\n } else {\n const { a, h, s, v } = { ...parsedValue, ...value }\n\n nextValue = hsvTo([h, s, v, a], fallbackValue)(format)\n }\n\n if (nextValue) onChangeEndRef(nextValue)\n },\n [onChangeEndRef, fallbackValue, parsedValue, format],\n )\n\n const onChannelChange = useCallback(\n (ev: ChangeEvent<HTMLInputElement>, space: Space) => {\n let n = Math.floor(parseFloat(ev.target.value))\n\n if (isNaN(n)) n = 0\n\n if ([\"a\", \"l\", \"s\"].includes(space)) n = n / 100\n\n let nextValue: string | undefined\n\n if (resolvedValue.startsWith(\"hsl\")) {\n const { a, h, l, s } = Object.assign(\n convertHsla(resolvedValue, fallbackValue),\n { [space]: n },\n )\n\n nextValue = hslaTo([h, s, l, a], fallbackValue)(format)\n } else {\n const { a, b, g, r } = Object.assign(\n convertRgba(resolvedValue, fallbackValue),\n { [space]: n },\n )\n\n nextValue = rgbaTo([r, g, b, a], fallbackValue)(format)\n }\n\n if (!nextValue) return\n\n onChange(nextValue)\n onChangeEnd(nextValue)\n },\n [resolvedValue, onChange, onChangeEnd, fallbackValue, format],\n )\n\n const onEyeDropperClick = useCallback(async () => {\n try {\n const { sRGBHex } = (await onOpen()) ?? {}\n\n if (!sRGBHex) return\n\n onChange(sRGBHex)\n onChangeEnd(sRGBHex)\n } catch {}\n }, [onOpen, onChange, onChangeEnd])\n\n useUpdateEffect(() => {\n const nextValue = hsvTo([h, s, v, a], fallbackValue)(format)\n\n if (nextValue) setValue(nextValue)\n }, [h, s, v, a])\n\n useUpdateEffect(() => {\n if (isDraggingRef.current) return\n\n if (valueProp) setParsedValue(convertHsva(valueProp, fallbackValue))\n }, [valueProp])\n\n useUpdateEffect(() => {\n if (!value) return\n\n const nextValue = convertColor(value, fallbackValue)(format)\n\n if (nextValue) setValue(nextValue)\n }, [format])\n\n const getContainerProps: PropGetter = useCallback(\n (props = {}, ref = null) => ({\n ...props,\n ref,\n ...formControlProps,\n ...containerProps,\n }),\n [containerProps, formControlProps],\n )\n\n const getInputProps: PropGetter<\"input\"> = useCallback(\n (props = {}, ref = null) => ({\n ...formControlProps,\n \"aria-readonly\": ariaReadonly,\n ...props,\n id,\n ref,\n type: \"hidden\",\n name,\n disabled,\n readOnly,\n required,\n value: resolvedValue,\n }),\n [\n formControlProps,\n ariaReadonly,\n id,\n name,\n resolvedValue,\n required,\n disabled,\n readOnly,\n ],\n )\n\n const getSaturationSliderProps: PropGetter<SaturationSliderProps> =\n useCallback(\n (props = {}, ref = null) => ({\n disabled,\n isInvalid,\n readOnly,\n required,\n ...props,\n ref,\n value: [h, s, v],\n onChange: handlerAll(props.onChange, ([, s, v]) => onChange({ s, v })),\n onChangeEnd: handlerAll(props.onChangeEnd, ([, s, v]) =>\n onChangeEnd({ s, v }),\n ),\n onChangeStart: handlerAll(props.onChangeStart, ([, s, v]) =>\n onChangeStart({ s, v }),\n ),\n }),\n [\n required,\n disabled,\n readOnly,\n isInvalid,\n h,\n s,\n v,\n onChange,\n onChangeStart,\n onChangeEnd,\n ],\n )\n\n const getHueSliderProps: PropGetter<HueSliderProps> = useCallback(\n (props = {}, ref = null) => ({\n disabled,\n isInvalid,\n readOnly,\n required,\n ...props,\n ref,\n value: h,\n onChange: handlerAll(props.onChange, (h) => onChange({ h })),\n onChangeEnd: handlerAll(props.onChangeEnd, (h) => onChangeEnd({ h })),\n onChangeStart: handlerAll(props.onChangeStart, (h) =>\n onChangeStart({ h }),\n ),\n }),\n [\n required,\n disabled,\n readOnly,\n isInvalid,\n h,\n onChange,\n onChangeStart,\n onChangeEnd,\n ],\n )\n\n const getAlphaSliderProps: PropGetter<AlphaSliderProps> = useCallback(\n (props = {}, ref = null) => ({\n disabled,\n isInvalid,\n readOnly,\n required,\n ...props,\n ref,\n color: hsvTo([h, s, v, a], fallbackValue)(format),\n value: a,\n onChange: handlerAll(props.onChange, (a) => onChange({ a })),\n onChangeEnd: handlerAll(props.onChangeEnd, (a) => onChangeEnd({ a })),\n onChangeStart: handlerAll(props.onChangeStart, (a) =>\n onChangeStart({ a }),\n ),\n }),\n [\n fallbackValue,\n required,\n disabled,\n readOnly,\n isInvalid,\n format,\n h,\n s,\n v,\n a,\n onChange,\n onChangeStart,\n onChangeEnd,\n ],\n )\n\n const getChannelProps: RequiredPropGetter<\n { space: Space } & InputProps,\n InputProps\n > = useCallback(\n ({ space, ...props }, ref = null) => {\n return {\n disabled,\n isInvalid,\n readOnly,\n required,\n ...props,\n ref,\n type: \"number\",\n step: 1,\n onChange: handlerAll(props.onChange, (ev) =>\n onChannelChange(ev, space),\n ),\n } as Dict\n },\n [required, disabled, readOnly, isInvalid, onChannelChange],\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 onClick: handlerAll(props.onClick, onEyeDropperClick),\n }),\n [disabled, onEyeDropperClick],\n )\n\n const getSwatchProps: PropGetter<ColorSwatchProps> = useCallback(\n ({ color, ...props } = {}, ref = null) => ({\n \"aria-label\": `Select ${color} as the color`,\n disabled,\n readOnly,\n ...props,\n ref,\n color,\n onClick: handlerAll(props.onClick, () => {\n if (!isString(color)) return\n\n onSwatchClick?.(color)\n onChange(color)\n onChangeEnd(color)\n }),\n }),\n [disabled, readOnly, onSwatchClick, onChange, onChangeEnd],\n )\n\n return {\n channels,\n disabled,\n eyeDropperSupported,\n isInteractive,\n readOnly,\n value: resolvedValue,\n withAlpha,\n getAlphaSliderProps,\n getChannelProps,\n getContainerProps,\n getEyeDropperProps,\n getHueSliderProps,\n getInputProps,\n getSaturationSliderProps,\n getSwatchProps,\n onChange,\n }\n}\n\nexport type UseColorSelectorReturn = ReturnType<typeof useColorSelector>\n","import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport type { ForwardedRef } from \"react\"\nimport type { AlphaSliderProps } from \"./alpha-slider\"\nimport type { HueSliderProps } from \"./hue-slider\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { AlphaSlider } from \"./alpha-slider\"\nimport { HueSlider } from \"./hue-slider\"\nimport { useColorSelectorContext } from \"./use-color-selector\"\n\ninterface ColorSelectorSlidersOptions {\n /**\n * Ref for the alpha slider component.\n */\n alphaSliderRef?: ForwardedRef<HTMLInputElement>\n /**\n * Ref for the hue slider component.\n */\n hueSliderRef?: ForwardedRef<HTMLInputElement>\n /**\n * Props for the alpha slider component.\n */\n alphaSliderProps?: Omit<AlphaSliderProps, \"defaultValue\" | \"value\">\n /**\n * Props for the hue slider component.\n */\n hueSliderProps?: Omit<HueSliderProps, \"defaultValue\" | \"value\">\n}\n\nexport interface ColorSelectorSlidersProps\n extends Omit<HTMLUIProps, \"children\">,\n ColorSelectorSlidersOptions {}\n\nexport const ColorSelectorSliders = forwardRef<\n ColorSelectorSlidersProps,\n \"div\"\n>(\n (\n {\n className,\n alphaSliderRef,\n hueSliderRef,\n alphaSliderProps,\n hueSliderProps,\n ...rest\n },\n ref,\n ) => {\n let { size, styles, withAlpha, getAlphaSliderProps, getHueSliderProps } =\n useColorSelectorContext()\n\n if (size === \"full\") size = \"lg\"\n\n const css: CSSUIObject = {\n display: \"flex\",\n flexDirection: \"column\",\n ...styles.sliders,\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-color-selector__sliders\", className)}\n __css={css}\n {...rest}\n >\n <HueSlider\n className=\"ui-color-selector__hue-slider\"\n size={size}\n __css={{ ...styles.hueSlider }}\n {...getHueSliderProps(hueSliderProps, hueSliderRef)}\n />\n\n {withAlpha ? (\n <AlphaSlider\n className=\"ui-color-selector__alpha-slider\"\n size={size}\n __css={{ ...styles.alphaSlider }}\n {...getAlphaSliderProps(alphaSliderProps, alphaSliderRef)}\n />\n ) : null}\n </ui.div>\n )\n },\n)\n\nColorSelectorSliders.displayName = \"ColorSelectorSliders\"\nColorSelectorSliders.__ui__ = \"ColorSelectorSliders\"\n","import type { CSSUIObject, HTMLUIProps, ThemeProps } from \"@yamada-ui/core\"\nimport type { UseColorSliderProps } from \"./use-color-slider\"\nimport {\n forwardRef,\n omitThemeProps,\n ui,\n useComponentMultiStyle,\n} from \"@yamada-ui/core\"\nimport { createContext, cx } from \"@yamada-ui/utils\"\nimport { useColorSlider } from \"./use-color-slider\"\n\ninterface HueSliderContext {\n styles: { [key: string]: CSSUIObject | undefined }\n}\n\nconst [HueSliderProvider, useHueSlider] = createContext<HueSliderContext>({\n name: \"SliderContext\",\n errorMessage: `useSliderContext returned is 'undefined'. Seems you forgot to wrap the components in \"<HueSlider />\" `,\n})\n\nconst defaultOverlays = (\n min: number,\n max: number,\n withShadow: boolean,\n): HTMLUIProps[] => {\n let overlays: HTMLUIProps[] = [\n {\n bgGradient: `linear(to-r, ${[...Array(7)]\n .map(\n (_, index) =>\n `hsl(${Math.round(min + ((max - min) / 6) * index)}, 100%, 50%)`,\n )\n .join(\", \")})`,\n },\n ]\n\n if (withShadow)\n overlays = [\n ...overlays,\n {\n boxShadow: `rgba(0, 0, 0, .1) 0 0 0 1px inset, rgb(0, 0, 0, .15) 0 0 4px inset`,\n },\n ]\n\n return overlays\n}\n\ninterface HueSliderOptions {\n /**\n * The maximum allowed value of the slider. Cannot be less than min.\n *\n * @default 360\n */\n max?: number\n /**\n * The minimum allowed value of the slider. Cannot be greater than max.\n *\n * @default 0\n */\n min?: number\n /**\n * The overlay used for the slider.\n */\n overlays?: HTMLUIProps[]\n /**\n * The step in which increments or decrements have to be made.\n *\n * @default 1\n */\n step?: number\n /**\n * If `true`, the slider has an inner `box-shadow`.\n *\n * @default true\n */\n withShadow?: boolean\n /**\n * Props for slider input element.\n */\n inputProps?: HTMLUIProps<\"input\">\n /**\n * Props for slider thumb element.\n */\n thumbProps?: HTMLUIProps\n /**\n * Props for slider track element.\n */\n trackProps?: HTMLUIProps\n}\n\nexport interface HueSliderProps\n extends ThemeProps<\"HueSlider\">,\n Partial<Omit<UseColorSliderProps, \"channel\">>,\n HueSliderOptions {}\n\n/**\n * `HueSlider` is a component used to allow the user to select a color hue.\n *\n * @see Docs https://yamada-ui.com/components/forms/hue-slider\n */\nexport const HueSlider = forwardRef<HueSliderProps, \"input\">((props, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\"HueSlider\", props)\n const {\n className,\n max = 360,\n min = 0,\n withShadow = true,\n overlays = defaultOverlays(min, max, withShadow),\n inputProps,\n thumbProps,\n trackProps,\n __css,\n ...computedProps\n } = omitThemeProps(mergedProps)\n const { getContainerProps, getInputProps, getThumbProps, getTrackProps } =\n useColorSlider({ max, min, step: 1, ...computedProps, channel: \"hue\" })\n\n const css: CSSUIObject = {\n position: \"relative\",\n ...styles.container,\n ...__css,\n }\n\n return (\n <HueSliderProvider value={{ styles }}>\n <ui.div\n className={cx(\"ui-hue-slider\", className)}\n __css={css}\n {...getContainerProps()}\n >\n <ui.input {...getInputProps(inputProps, ref)} />\n\n {overlays.map((props, index) => (\n <HueSliderOverlay key={index} {...props} />\n ))}\n\n <HueSliderTrack {...getTrackProps(trackProps)}>\n <HueSliderThumb {...getThumbProps(thumbProps)} />\n </HueSliderTrack>\n </ui.div>\n </HueSliderProvider>\n )\n})\n\nHueSlider.displayName = \"HueSlider\"\nHueSlider.__ui__ = \"HueSlider\"\n\ninterface HueSliderOverlayProps extends HTMLUIProps {}\n\nconst HueSliderOverlay = forwardRef<HueSliderOverlayProps, \"div\">(\n ({ className, ...rest }, ref) => {\n const { styles } = useHueSlider()\n\n const css: CSSUIObject = {\n bottom: 0,\n left: 0,\n position: \"absolute\",\n right: 0,\n top: 0,\n ...styles.overlay,\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-hue-slider__overlay\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nHueSliderOverlay.displayName = \"HueSliderOverlay\"\nHueSliderOverlay.__ui__ = \"HueSliderOverlay\"\n\ninterface HueSliderTrackProps extends HTMLUIProps {}\n\nconst HueSliderTrack = forwardRef<HueSliderTrackProps, \"div\">(\n ({ className, ...rest }, ref) => {\n const { styles } = useHueSlider()\n\n const css: CSSUIObject = {\n h: \"100%\",\n position: \"relative\",\n w: \"100%\",\n ...styles.track,\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-hue-slider__track\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nHueSliderTrack.displayName = \"HueSliderTrack\"\nHueSliderTrack.__ui__ = \"HueSliderTrack\"\n\ninterface HueSliderThumbProps extends HTMLUIProps {}\n\nconst HueSliderThumb = forwardRef<HueSliderThumbProps, \"div\">(\n ({ className, ...rest }, ref) => {\n const { styles } = useHueSlider()\n\n const css: CSSUIObject = { ...styles.thumb }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-hue-slider__thumb\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nHueSliderThumb.displayName = \"HueSliderThumb\"\nHueSliderThumb.__ui__ = \"HueSliderThumb\"\n","import type {\n CSSUIObject,\n CSSUIProps,\n HTMLUIProps,\n ThemeProps,\n} from \"@yamada-ui/core\"\nimport {\n forwardRef,\n omitThemeProps,\n ui,\n useComponentMultiStyle,\n} from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\n\nconst defaultOverlays = (\n background: CSSUIProps[\"color\"],\n withShadow: boolean,\n): HTMLUIProps[] => {\n let overlays: HTMLUIProps[] = [\n {\n bgImage:\n \"linear-gradient(45deg, $checkers 25%, transparent 25%), linear-gradient(-45deg, $checkers 25%, transparent 25%), linear-gradient(45deg, transparent 75%, $checkers 75%), linear-gradient(-45deg, $body 75%, $checkers 75%)\",\n bgPosition: `0 0, 0 4px, 4px -4px, -4px 0`,\n bgSize: `8px 8px`,\n vars: [\n {\n name: \"checkers\",\n token: \"colors\",\n value: [\"blackAlpha.300\", \"whiteAlpha.300\"],\n },\n {\n name: \"body\",\n token: \"colors\",\n value: [\"whiteAlpha.500\", \"blackAlpha.500\"],\n },\n ],\n },\n { background },\n ]\n\n if (withShadow)\n overlays = [\n ...overlays,\n {\n boxShadow: `rgba(0, 0, 0, .1) 0 0 0 1px inset, rgb(0, 0, 0, .15) 0 0 4px inset`,\n },\n ]\n\n return overlays\n}\n\ninterface ColorSwatchOptions {\n /**\n * The color used for the swatch element.\n *\n * @default \"#ffffff00\"\n */\n color?: CSSUIProps[\"color\"]\n /**\n * If `true`, the color swatch will be perfectly round. Else, it'll be slightly round.\n *\n * @default false\n */\n isRounded?: boolean\n /**\n * The overlay used for the swatch element.\n */\n overlays?: HTMLUIProps[]\n /**\n * If `true`, the swatch element has an inner `box-shadow`.\n *\n * @default true\n */\n withShadow?: boolean\n}\n\nexport interface ColorSwatchProps\n extends Omit<HTMLUIProps, \"color\">,\n ThemeProps<\"ColorSwatch\">,\n ColorSwatchOptions {}\n\n/**\n * `ColorSwatch` is a component that displays color samples.\n *\n * @see Docs https://yamada-ui.com/components/data-display/color-swatch\n */\nexport const ColorSwatch = forwardRef<ColorSwatchProps, \"div\">((props, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\"ColorSwatch\", props)\n const {\n className,\n color = \"#ffffff00\",\n isRounded,\n withShadow = true,\n overlays = defaultOverlays(color, withShadow),\n __css,\n ...rest\n } = omitThemeProps(mergedProps)\n\n const css: CSSUIObject = {\n \"& > *\": {\n alignItems: \"center\",\n bottom: \"0\",\n display: \"flex\",\n h: \"100%\",\n justifyContent: \"center\",\n left: \"0\",\n overflow: \"hidden\",\n position: \"absolute\",\n right: \"0\",\n top: \"0\",\n w: \"100%\",\n },\n position: \"relative\",\n _before: {\n content: `\"\"`,\n display: \"block\",\n h: 0,\n pb: \"100%\",\n },\n ...styles.container,\n ...__css,\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-color-swatch\", className)}\n {...(isRounded ? { rounded: \"fallback(full, 9999px)\" } : {})}\n __css={css}\n {...rest}\n >\n <ui.div {...(isRounded ? { rounded: \"fallback(full, 9999px)\" } : {})}>\n {overlays.map((props, index) => (\n <ui.div\n key={index}\n __css={{\n bottom: 0,\n left: 0,\n position: \"absolute\",\n right: 0,\n top: 0,\n ...styles.overlay,\n }}\n {...(isRounded ? { rounded: \"fallback(full, 9999px)\" } : {})}\n {...props}\n />\n ))}\n </ui.div>\n </ui.div>\n )\n})\n\nColorSwatch.displayName = \"ColorSwatch\"\nColorSwatch.__ui__ = \"ColorSwatch\"\n","import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport type { InputProps } from \"@yamada-ui/input\"\nimport type { ReactNode } from \"react\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { Input } from \"@yamada-ui/input\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useId } from \"react\"\nimport { useColorSelectorContext } from \"./use-color-selector\"\n\ninterface ColorSelectorChannelsOptions {\n /**\n * Props for the chancel component.\n */\n channelProps?: Omit<ColorSelectorChannelProps, \"channelLabel\">\n}\n\nexport interface ColorSelectorChannelsProps\n extends Omit<HTMLUIProps, \"children\">,\n ColorSelectorChannelsOptions {}\n\nexport const ColorSelectorChannels = forwardRef<\n ColorSelectorChannelsProps,\n \"div\"\n>(({ className, channelProps, ...rest }, ref) => {\n const { channels, styles, withAlpha, getChannelProps } =\n useColorSelectorContext()\n\n const css: CSSUIObject = {\n display: \"grid\",\n gridTemplateColumns: `repeat(${withAlpha ? \"4\" : \"3\"}, 1fr)`,\n ...styles.channels,\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-color-selector__channels\", className)}\n __css={css}\n {...rest}\n >\n {channels.map(({ label, max, min, space, value }) => (\n <ColorSelectorChannel\n key={label}\n channelLabel={label}\n {...getChannelProps({ ...channelProps, max, min, space, value })}\n />\n ))}\n </ui.div>\n )\n})\n\nColorSelectorChannels.displayName = \"ColorSelectorChannels\"\nColorSelectorChannels.__ui__ = \"ColorSelectorChannels\"\n\ninterface ColorSelectorChannelOptions {\n channelLabel?: ReactNode\n}\n\nexport type ColorSelectorChannelProps = ColorSelectorChannelOptions &\n Omit<\n InputProps,\n \"defaultValue\" | \"max\" | \"min\" | \"pattern\" | \"type\" | \"value\"\n >\n\nexport const ColorSelectorChannel = forwardRef<\n ColorSelectorChannelProps,\n \"input\"\n>(({ className, channelLabel, ...rest }, ref) => {\n const id = useId()\n let { size, disabled, readOnly, styles } = useColorSelectorContext()\n\n if (size === \"full\") size = \"lg\"\n\n const css: CSSUIObject = { ...styles.channel }\n\n return (\n <ui.div className={cx(\"ui-color-selector__channel\", className)}>\n {channelLabel ? (\n <ui.label\n htmlFor={id}\n style={{ cursor: disabled ? \"not-allowed\" : undefined }}\n __css={{\n display: \"block\",\n pointerEvents: readOnly ? \"none\" : undefined,\n ...styles.channelLabel,\n }}\n >\n {channelLabel}\n </ui.label>\n ) : null}\n\n <Input id={id} ref={ref} size={size} __css={css} {...rest} />\n </ui.div>\n )\n})\n\nColorSelectorChannel.displayName = \"ColorSelectorChannel\"\nColorSelectorChannel.__ui__ = \"ColorSelectorChannel\"\n","import type { CSSUIObject, HTMLUIProps, Token } from \"@yamada-ui/core\"\nimport type { ReactNode } from \"react\"\nimport type { ColorSwatchProps } from \"./color-swatch\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx, replaceObject } from \"@yamada-ui/utils\"\nimport { ColorSwatch } from \"./color-swatch\"\nimport { useColorSelectorContext } from \"./use-color-selector\"\n\ninterface ColorSelectorSwatchesOptions {\n /**\n * An array of colors in one of the supported formats.\n * Used to render swatches list below the color selector.\n */\n swatches?: string[]\n /**\n * Number of swatches grid columns.\n *\n * @default 7\n */\n swatchesColumns?: Token<number>\n /**\n * The swatches label to use.\n */\n swatchesLabel?: ReactNode\n /**\n * Props for the swatches container element.\n */\n swatchesContainerProps?: Omit<HTMLUIProps, \"children\">\n /**\n * Props for the color swatch component.\n */\n swatchProps?: ColorSwatchProps\n}\n\nexport interface ColorSelectorSwatchesProps\n extends Omit<HTMLUIProps, \"children\">,\n ColorSelectorSwatchesOptions {}\n\nexport const ColorSelectorSwatches = forwardRef<\n ColorSelectorSwatchesProps,\n \"div\"\n>(\n (\n {\n className,\n swatches,\n swatchesColumns,\n swatchesLabel,\n swatchesContainerProps,\n swatchProps,\n ...rest\n },\n ref,\n ) => {\n const { readOnly, styles, getSwatchProps } = useColorSelectorContext()\n\n const css: CSSUIObject = {\n display: \"grid\",\n gridTemplateColumns: replaceObject(swatchesColumns, (value) =>\n value != null ? `repeat(${value}, minmax(0, 1fr))` : undefined,\n ) as CSSUIObject[\"gridTemplateColumns\"],\n ...styles.swatches,\n }\n\n return swatches?.length ? (\n <ui.div {...swatchesContainerProps}>\n {swatchesLabel ? (\n <ui.p\n className=\"ui-color-selector__swatches__label\"\n __css={{ ...styles.swatchesLabel }}\n >\n {swatchesLabel}\n </ui.p>\n ) : null}\n\n <ui.div\n ref={ref}\n className={cx(\"ui-color-selector__swatches\", className)}\n __css={css}\n {...rest}\n >\n {swatches.map((color) => (\n <ColorSwatch\n key={color}\n as=\"button\"\n __css={{\n boxSize: \"100%\",\n pointerEvents: readOnly ? \"none\" : undefined,\n ...styles.swatch,\n }}\n {...getSwatchProps({ color, ...swatchProps })}\n />\n ))}\n </ui.div>\n </ui.div>\n ) : null\n },\n)\n\nColorSelectorSwatches.displayName = \"ColorSelectorSwatches\"\nColorSelectorSwatches.__ui__ = \"ColorSelectorSwatches\"\n","import type {\n CSSUIObject,\n HTMLUIProps,\n ThemeProps,\n Token,\n} from \"@yamada-ui/core\"\nimport type { UseSaturationSliderProps } from \"./use-saturation-slider\"\nimport {\n forwardRef,\n omitThemeProps,\n ui,\n useComponentMultiStyle,\n} from \"@yamada-ui/core\"\nimport { cx, replaceObject } from \"@yamada-ui/utils\"\nimport { useSaturationSlider } from \"./use-saturation-slider\"\n\ninterface SaturationSliderOptions {\n /**\n * The aspect ratio of the saturation slider.\n *\n * @default '16 / 9'\n */\n ratio?: Token<number>\n /**\n * Props for saturation slider inner element.\n */\n innerProps?: HTMLUIProps\n /**\n * Props for saturation slider input element.\n */\n inputProps?: HTMLUIProps<\"input\">\n /**\n * Props for saturation slider thumb element.\n */\n thumbProps?: HTMLUIProps\n /**\n * Props for saturation slider track element.\n */\n trackProps?: HTMLUIProps\n}\n\nexport interface SaturationSliderProps\n extends ThemeProps<\"SaturationSlider\">,\n UseSaturationSliderProps,\n SaturationSliderOptions {}\n\n/**\n * `SaturationSlider` is a component used to allow the user to select a color saturation.\n *\n * @see Docs https://yamada-ui.com/components/forms/saturation-slider\n */\nexport const SaturationSlider = forwardRef<SaturationSliderProps, \"input\">(\n (props, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\n \"SaturationSlider\",\n props,\n )\n const {\n className,\n ratio = 16 / 9,\n innerProps,\n inputProps,\n thumbProps,\n trackProps,\n __css,\n ...computedProps\n } = omitThemeProps(mergedProps)\n const {\n overlays,\n getContainerProps,\n getInnerProps,\n getInputProps,\n getThumbProps,\n getTrackProps,\n } = useSaturationSlider(computedProps)\n\n const css: CSSUIObject = {\n \"& > *\": {\n alignItems: \"center\",\n bottom: \"0\",\n display: \"flex\",\n h: \"100%\",\n justifyContent: \"center\",\n left: \"0\",\n position: \"absolute\",\n right: \"0\",\n top: \"0\",\n w: \"100%\",\n },\n position: \"relative\",\n _before: {\n content: `\"\"`,\n display: \"block\",\n h: 0,\n pb: replaceObject(ratio, (r) => `${(1 / r) * 100}%`),\n },\n ...styles.container,\n ...__css,\n }\n\n return (\n <ui.div\n className={cx(\"ui-saturation-slider\", className)}\n __css={css}\n {...getContainerProps()}\n >\n <ui.div\n className={cx(\"ui-saturation-slider__inner\", className)}\n __css={{ ...styles.inner }}\n {...getInnerProps(innerProps)}\n >\n <ui.input {...getInputProps(inputProps, ref)} />\n\n {overlays.map((props, index) => (\n <ui.div\n key={index}\n className=\"ui-saturation-slider__overlay\"\n __css={{\n bottom: 0,\n left: 0,\n position: \"absolute\",\n right: 0,\n top: 0,\n ...styles.overlay,\n }}\n {...props}\n />\n ))}\n\n <ui.div\n className=\"ui-saturation-slider__track\"\n __css={{\n h: \"100%\",\n position: \"relative\",\n w: \"100%\",\n ...styles.track,\n }}\n {...getTrackProps(trackProps)}\n >\n <ui.div\n className=\"ui-saturation-slider__thumb\"\n __css={{ ...styles.thumb }}\n {...getThumbProps(thumbProps)}\n />\n </ui.div>\n </ui.div>\n </ui.div>\n )\n },\n)\n\nSaturationSlider.displayName = \"SaturationSlider\"\nSaturationSlider.__ui__ = \"SaturationSlider\"\n","import type { CSSUIProps, HTMLUIProps, PropGetter } from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\nimport type { CSSProperties, KeyboardEvent, KeyboardEventHandler } from \"react\"\nimport {\n formControlProperties,\n useFormControlProps,\n} from \"@yamada-ui/form-control\"\nimport { useControllableState } from \"@yamada-ui/use-controllable-state\"\nimport { useLatestRef } from \"@yamada-ui/use-latest-ref\"\nimport { usePanEvent } from \"@yamada-ui/use-pan-event\"\nimport { useSize } from \"@yamada-ui/use-size\"\nimport {\n clampNumber,\n dataAttr,\n handlerAll,\n hsvTo,\n mergeRefs,\n roundNumberToStep,\n runIfFunc,\n splitObject,\n useCallbackRef,\n useUpdateEffect,\n} from \"@yamada-ui/utils\"\nimport { useCallback, useMemo, useRef, useState } from \"react\"\n\nexport type Hsv = [number, number, number]\ntype Overlay = ((value: Hsv) => HTMLUIProps) | HTMLUIProps\n\nconst defaultOverlays = (withShadow: boolean): Overlay[] => {\n let overlays: Overlay[] = [\n ([h]) => ({\n bg: `hsl(${h}, 100%, 50%)`,\n bgImage:\n \"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, transparent)\",\n }),\n ]\n\n if (withShadow)\n overlays = [\n ...overlays,\n {\n boxShadow: `rgba(0, 0, 0, .1) 0 0 0 1px inset, rgb(0, 0, 0, .15) 0 0 4px inset`,\n },\n ]\n\n return overlays\n}\n\ninterface UseSaturationSliderOptions {\n /**\n * The base `id` to use for the saturation slider.\n */\n id?: string\n /**\n * The name attribute of the hidden `input` field.\n * This is particularly useful in forms.\n */\n name?: string\n /**\n * The initial value of the saturation slider.\n *\n * @default \"[0, 0, 1]\"\n */\n defaultValue?: Hsv\n /**\n * If `false`, the saturation slider handle will not capture focus when value changes.\n *\n * @default true\n */\n focusThumbOnChange?: boolean\n /**\n * The overlay used for the saturation slider.\n */\n overlays?: Overlay[]\n /**\n * The step in which increments or decrements have to be made.\n *\n * @default 0.01\n */\n step?: number\n /**\n * The CSS `background` property. Used in `background` of thumb element.\n */\n thumbColor?: CSSUIProps[\"bg\"]\n /**\n * The value of the saturation slider.\n */\n value?: Hsv\n /**\n * If `true`, the slider has an inner `box-shadow`.\n *\n * @default true\n */\n withShadow?: boolean\n /**\n * Function called whenever the saturation slider value changes.\n */\n onChange?: (value: Hsv) => void\n /**\n * Function called when the user is done selecting a new value.\n */\n onChangeEnd?: (value: Hsv) => void\n /**\n * Function called when the user starts selecting a new value.\n */\n onChangeStart?: (value: Hsv) => void\n}\n\nexport interface UseSaturationSliderProps\n extends Omit<HTMLUIProps, \"defaultValue\" | \"onChange\">,\n UseSaturationSliderOptions,\n FormControlOptions {}\n\nexport const useSaturationSlider = ({\n focusThumbOnChange = true,\n ...props\n}: UseSaturationSliderProps) => {\n if (!focusThumbOnChange) props.isReadOnly = true\n\n let {\n id,\n name,\n defaultValue = [0, 0, 1],\n withShadow = true,\n overlays: overlaysProp = defaultOverlays(withShadow),\n step = 0.01,\n thumbColor,\n value: valueProp,\n onChange: onChangeProp,\n onChangeEnd: onChangeEndProp,\n onChangeStart: onChangeStartProp,\n ...rest\n } = useFormControlProps(props)\n const [\n {\n \"aria-readonly\": _ariaReadonly,\n disabled,\n readOnly,\n required,\n ...formControlProps\n },\n containerProps,\n ] = splitObject(rest, formControlProperties)\n\n const onChangeStart = useCallbackRef(onChangeStartProp)\n const onChangeEnd = useCallbackRef(onChangeEndProp)\n\n const [value, setValue] = useControllableState({\n defaultValue,\n value: valueProp,\n onChange: onChangeProp,\n })\n const [isDragging, setDragging] = useState(false)\n const isInteractive = !(disabled || readOnly)\n let [h, s, v] = value\n\n s = clampNumber(s, 0, 1)\n v = clampNumber(v, 0, 1)\n\n const containerRef = useRef<HTMLElement>(null)\n const trackRef = useRef<HTMLElement>(null)\n const thumbRef = useRef<HTMLElement>(null)\n const latestRef = useLatestRef({\n eventSource: null as \"keyboard\" | \"pointer\" | null,\n focusThumbOnChange,\n isInteractive,\n step,\n value,\n })\n\n const thumbSize = useSize(thumbRef)\n\n const overlays = useMemo(\n () => overlaysProp.map((propsOrFunc) => runIfFunc(propsOrFunc, [h, s, v])),\n [overlaysProp, h, s, v],\n )\n\n const getValueFromPointer = useCallback(\n (ev: any) => {\n if (!trackRef.current) return []\n\n const { step } = latestRef.current\n\n latestRef.current.eventSource = \"pointer\"\n\n const { bottom, height, left, width } =\n trackRef.current.getBoundingClientRect()\n const { clientX, clientY } = ev.touches?.[0] ?? ev\n\n let s = clampNumber((clientX - left) / width, 0, 1)\n let v = clampNumber((bottom - clientY) / height, 0, 1)\n\n if (step) {\n s = parseFloat(roundNumberToStep(s, 0, step))\n v = parseFloat(roundNumberToStep(v, 0, step))\n }\n\n return [s, v]\n },\n [latestRef],\n )\n\n const setValueFromPointer = (ev: MouseEvent | PointerEvent | TouchEvent) => {\n const { value } = latestRef.current\n const [nextS, nextV] = getValueFromPointer(ev)\n\n if (nextS == null || nextV == null) return\n\n const [, s, v] = value\n\n if (nextS !== s || nextV !== v) setValue(([h]) => [h, nextS, nextV])\n }\n\n const focusThumb = useCallback(() => {\n const { focusThumbOnChange } = latestRef.current\n\n if (focusThumbOnChange) setTimeout(() => thumbRef.current?.focus())\n }, [latestRef])\n\n const constrain = useCallback(\n ([s, v]: [number, number]) => {\n const { isInteractive } = latestRef.current\n\n if (!isInteractive) return\n\n s = clampNumber(s, 0, 1)\n v = clampNumber(v, 0, 1)\n\n setValue(([h]) => [h, s, v])\n },\n [latestRef, setValue],\n )\n\n const onKeyDown = useCallback(\n (ev: KeyboardEvent<HTMLElement>) => {\n const actions: { [key: string]: KeyboardEventHandler } = {\n ArrowDown: () => constrain([s, v - step]),\n ArrowLeft: () => constrain([s - step, v]),\n ArrowRight: () => constrain([s + step, v]),\n ArrowUp: () => constrain([s, v + step]),\n }\n\n const action = actions[ev.key]\n\n if (!action) return\n\n ev.preventDefault()\n ev.stopPropagation()\n\n action(ev)\n\n latestRef.current.eventSource = \"keyboard\"\n },\n [latestRef, constrain, s, v, step],\n )\n\n usePanEvent(containerRef, {\n onMove: (ev) => {\n const { isInteractive } = latestRef.current\n\n if (!isInteractive) return\n\n setValueFromPointer(ev)\n },\n onSessionEnd: () => {\n const { isInteractive, value } = latestRef.current\n\n if (!isInteractive) return\n\n setDragging(false)\n onChangeEnd(value)\n },\n onSessionStart: (ev) => {\n const { isInteractive, value } = latestRef.current\n\n if (!isInteractive) return\n\n setDragging(true)\n focusThumb()\n setValueFromPointer(ev)\n onChangeStart(value)\n },\n })\n\n useUpdateEffect(() => {\n const { eventSource, value } = latestRef.current\n\n if (eventSource === \"keyboard\") onChangeEnd(value)\n }, [value, onChangeEnd])\n\n const getContainerProps: PropGetter = useCallback(\n (props = {}, ref = null) => ({\n ...props,\n ...containerProps,\n ...formControlProps,\n ref: mergeRefs(ref, containerRef),\n tabIndex: -1,\n }),\n [containerProps, formControlProps],\n )\n\n const getInnerProps: PropGetter = useCallback(\n (props = {}, ref = null) => {\n const { width: w } = thumbSize ?? { width: 0 }\n\n const style: CSSProperties = {\n ...props.style,\n ...rest.style,\n padding: `${w / 2}px`,\n }\n\n return {\n ...props,\n ref,\n style,\n }\n },\n [rest, thumbSize],\n )\n\n const getInputProps: PropGetter<\"input\"> = useCallback(\n (props = {}, ref = null) => ({\n ...formControlProps,\n ...props,\n id,\n ref,\n type: \"hidden\",\n name,\n disabled,\n readOnly,\n required,\n value: [h, s, v].toString(),\n }),\n [formControlProps, id, name, h, s, v, required, disabled, readOnly],\n )\n\n const getTrackProps: PropGetter = useCallback(\n (props = {}, ref = null) => ({\n ...formControlProps,\n ...props,\n ref: mergeRefs(ref, trackRef),\n }),\n [formControlProps],\n )\n\n const getThumbProps: PropGetter = useCallback(\n (props = {}, ref = null) => {\n const { height, width } = thumbSize ?? { height: 0, width: 0 }\n const x = s * 100\n const y = v * 100\n\n const style: CSSProperties = {\n ...props.style,\n bottom: `calc(${y}% - ${height / 2}px)`,\n left: `calc(${x}% - ${width / 2}px)`,\n position: \"absolute\",\n touchAction: \"none\",\n userSelect: \"none\",\n }\n\n return {\n \"aria-label\": \"Saturation and brightness thumb\",\n \"aria-roledescription\": \"2D slider\",\n bg: thumbColor ?? hsvTo([h, s, v])(),\n ...formControlProps,\n ...props,\n ref: mergeRefs(ref, thumbRef),\n style,\n \"aria-valuemax\": 100,\n \"aria-valuemin\": 0,\n \"aria-valuenow\": s,\n \"aria-valuetext\": `saturation ${s}, brightness ${v}`,\n \"data-active\": dataAttr(isDragging && focusThumbOnChange),\n role: \"slider\",\n tabIndex: isInteractive && focusThumbOnChange ? 0 : undefined,\n onBlur: handlerAll(props.onBlur, rest.onBlur),\n onFocus: handlerAll(props.onFocus, rest.onFocus),\n onKeyDown: handlerAll(props.onKeyDown, onKeyDown),\n }\n },\n [\n thumbSize,\n s,\n v,\n thumbColor,\n h,\n formControlProps,\n isInteractive,\n focusThumbOnChange,\n isDragging,\n onKeyDown,\n rest,\n ],\n )\n\n return {\n overlays,\n value,\n getContainerProps,\n getInnerProps,\n getInputProps,\n getThumbProps,\n getTrackProps,\n }\n}\n\nexport type UseSaturationSliderReturn = ReturnType<typeof useSaturationSlider>\n","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, 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 const {\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\n const containerRef = useRef<HTMLDivElement>(null)\n const fieldRef = useRef<HTMLInputElement>(null)\n\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\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 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 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 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":";;;;;;;;;;;;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QACP,WAAS;AAAA,QACT,OAAO;AAAA,QACN,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;AAEA,kBAAkB,cAAc;AAChC,kBAAkB,SAAS;AAI3B,IAAM,4BAAwB;AAAA,EAC5B,CAAC,EAAE,WAAW,UAAU,GAAG,KAAK,GAAG,QAAQ;AACzC,UAAM,EAAE,OAAO,IAAI,sBAAsB;AAEzC,UAAM,MAAmB;AAAA,MACvB,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,UAAU;AAAA,MACV,KAAK;AAAA,MACL,WAAW;AAAA,MACX,QAAQ;AAAA,MACR,GAAG,OAAO;AAAA,IACZ;AAEA,UAAM,oBAAgB,iCAAiB,QAAQ;AAE/C,UAAM,gBAAgB,cAAc;AAAA,MAAI,CAAC,cACvC,4BAAa,OAAO;AAAA,QAClB,OAAO;AAAA,UACL,OAAO;AAAA,UACP,WAAW;AAAA,UACX,UAAU;AAAA,QACZ;AAAA,QACA,eAAe;AAAA,QACf,WAAW;AAAA,MACb,CAAC;AAAA,IACH;AAEA,WACE;AAAA,MAAC,iBAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,eAAW,mBAAG,gCAAgC,SAAS;AAAA,QACvD,OAAO;AAAA,QACN,GAAG;AAAA,QAEH,6CAAe,QAAQ,IACtB,gBAEA,8CAAC,kBAAe,WAAU,sCAAqC;AAAA;AAAA,IAEnE;AAAA,EAEJ;AACF;AAEA,sBAAsB,cAAc;AACpC,sBAAsB,SAAS;","names":["import_utils","max","min","step","value","focusThumbOnChange","isInteractive","props","props","import_core","import_utils","import_react","import_core","import_utils","import_core","import_utils","import_core","import_utils","import_form_control","import_use_controllable_state","import_utils","import_react","a","h","s","channels","value","v","props","import_jsx_runtime","import_core","import_utils","import_core","import_utils","import_jsx_runtime","defaultOverlays","props","import_jsx_runtime","import_core","import_utils","import_jsx_runtime","defaultOverlays","props","import_jsx_runtime","import_core","import_utils","import_react","import_jsx_runtime","import_core","import_utils","import_jsx_runtime","import_core","import_utils","import_form_control","import_use_controllable_state","import_use_latest_ref","import_use_pan_event","import_use_size","import_utils","import_react","defaultOverlays","step","s","v","value","h","focusThumbOnChange","isInteractive","props","import_jsx_runtime","props","import_jsx_runtime","import_core","import_form_control","import_use_controllable_state","import_use_eye_dropper","import_utils","import_react","value","props","import_jsx_runtime"]}
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/alpha-slider.tsx","../src/use-color-slider.ts","../src/color-picker.tsx","../src/color-selector.tsx","../src/color-selector-body.tsx","../src/color-selector-eye-dropper.tsx","../src/use-color-selector.ts","../src/color-selector-sliders.tsx","../src/hue-slider.tsx","../src/color-swatch.tsx","../src/color-selector-channels.tsx","../src/color-selector-swatches.tsx","../src/saturation-slider.tsx","../src/use-saturation-slider.ts","../src/use-color-picker.ts"],"sourcesContent":["export { AlphaSlider } from \"./alpha-slider\"\nexport type { AlphaSliderProps } from \"./alpha-slider\"\nexport { ColorPicker } from \"./color-picker\"\nexport type { ColorPickerProps } from \"./color-picker\"\nexport { ColorSelector } from \"./color-selector\"\nexport type { ColorSelectorProps } from \"./color-selector\"\nexport { ColorSwatch } from \"./color-swatch\"\nexport type { ColorSwatchProps } from \"./color-swatch\"\nexport { HueSlider } from \"./hue-slider\"\nexport type { HueSliderProps } from \"./hue-slider\"\nexport { SaturationSlider } from \"./saturation-slider\"\nexport type { SaturationSliderProps } from \"./saturation-slider\"\nexport type { Hsv } from \"./use-saturation-slider\"\n","import type { CSSUIObject, HTMLUIProps, ThemeProps } from \"@yamada-ui/core\"\nimport type { UseColorSliderProps } from \"./use-color-slider\"\nimport {\n forwardRef,\n omitThemeProps,\n ui,\n useComponentMultiStyle,\n} from \"@yamada-ui/core\"\nimport { alphaToHex, convertColor, createContext, cx } from \"@yamada-ui/utils\"\nimport { useColorSlider } from \"./use-color-slider\"\n\ninterface AlphaSliderContext {\n styles: { [key: string]: CSSUIObject | undefined }\n}\n\nconst [AlphaSliderProvider, useAlphaSlider] = createContext<AlphaSliderContext>(\n {\n name: \"SliderContext\",\n errorMessage: `useSliderContext returned is 'undefined'. Seems you forgot to wrap the components in \"<AlphaSlider />\" `,\n },\n)\n\nconst defaultOverlays = (\n color: string,\n min: number,\n max: number,\n withShadow: boolean,\n): HTMLUIProps[] => {\n let overlays: HTMLUIProps[] = [\n {\n bgImage:\n \"linear-gradient(45deg, $checkers 25%, transparent 25%), linear-gradient(-45deg, $checkers 25%, transparent 25%), linear-gradient(45deg, transparent 75%, $checkers 75%), linear-gradient(-45deg, $body 75%, $checkers 75%)\",\n bgPosition: `0 0, 0 4px, 4px -4px, -4px 0`,\n bgSize: `8px 8px`,\n vars: [\n {\n name: \"checkers\",\n token: \"colors\",\n value: [\"blackAlpha.300\", \"whiteAlpha.300\"],\n },\n {\n name: \"body\",\n token: \"colors\",\n value: [\"whiteAlpha.500\", \"blackAlpha.500\"],\n },\n ],\n },\n {\n bgGradient: `linear(to-r, ${\n convertColor(color)(\"hex\") + alphaToHex(min)\n }, ${convertColor(color)(\"hex\") + alphaToHex(max)})`,\n },\n ]\n\n if (withShadow)\n overlays = [\n ...overlays,\n {\n boxShadow: `rgba(0, 0, 0, .1) 0 0 0 1px inset, rgb(0, 0, 0, .15) 0 0 4px inset`,\n },\n ]\n\n return overlays\n}\n\ninterface AlphaSliderOptions {\n /**\n * The color used for the slider.\n *\n * @default \"#ffffff\"\n */\n color?: string\n /**\n * The maximum allowed value of the slider. Cannot be less than min.\n *\n * @default 1\n */\n max?: number\n /**\n * The minimum allowed value of the slider. Cannot be greater than max.\n *\n * @default 0\n */\n min?: number\n /**\n * The overlay used for the slider.\n */\n overlays?: HTMLUIProps[]\n /**\n * The step in which increments or decrements have to be made.\n *\n * @default 0.01\n */\n step?: number\n /**\n * If `true`, the slider has an inner `box-shadow`.\n *\n * @default true\n */\n withShadow?: boolean\n /**\n * Props for slider input element.\n */\n inputProps?: HTMLUIProps<\"input\">\n /**\n * Props for slider thumb element.\n */\n thumbProps?: HTMLUIProps\n /**\n * Props for slider track element.\n */\n trackProps?: HTMLUIProps\n}\n\nexport interface AlphaSliderProps\n extends ThemeProps<\"AlphaSlider\">,\n Partial<Omit<UseColorSliderProps, \"channel\" | \"color\">>,\n AlphaSliderOptions {}\n\n/**\n * `AlphaSlider` is a component used to allow the user to select color transparency.\n *\n * @see Docs https://yamada-ui.com/components/forms/alpha-slider\n */\nexport const AlphaSlider = forwardRef<AlphaSliderProps, \"input\">(\n (props, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\"AlphaSlider\", props)\n const {\n className,\n color = \"#ffffff\",\n max = 1,\n min = 0,\n withShadow = true,\n overlays = defaultOverlays(color, min, max, withShadow),\n inputProps,\n thumbProps,\n trackProps,\n __css,\n ...computedProps\n } = omitThemeProps(mergedProps)\n const { getContainerProps, getInputProps, getThumbProps, getTrackProps } =\n useColorSlider({\n max,\n min,\n step: 0.01,\n thumbColor: \"transparent\",\n ...computedProps,\n channel: \"alpha\",\n })\n\n const css: CSSUIObject = {\n position: \"relative\",\n ...styles.container,\n ...__css,\n }\n\n return (\n <AlphaSliderProvider value={{ styles }}>\n <ui.div\n className={cx(\"ui-alpha-slider\", className)}\n __css={css}\n {...getContainerProps()}\n >\n <ui.input {...getInputProps(inputProps, ref)} />\n\n {overlays.map((props, index) => (\n <AlphaSliderOverlay key={index} {...props} />\n ))}\n\n <AlphaSliderTrack {...getTrackProps(trackProps)}>\n <AlphaSliderThumb {...getThumbProps(thumbProps)} />\n </AlphaSliderTrack>\n </ui.div>\n </AlphaSliderProvider>\n )\n },\n)\n\nAlphaSlider.displayName = \"AlphaSlider\"\nAlphaSlider.__ui__ = \"AlphaSlider\"\n\ninterface AlphaSliderOverlayProps extends HTMLUIProps {}\n\nconst AlphaSliderOverlay = forwardRef<AlphaSliderOverlayProps, \"div\">(\n ({ className, ...rest }, ref) => {\n const { styles } = useAlphaSlider()\n\n const css: CSSUIObject = {\n bottom: 0,\n left: 0,\n position: \"absolute\",\n right: 0,\n top: 0,\n ...styles.overlay,\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-alpha-slider__overlay\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nAlphaSliderOverlay.displayName = \"AlphaSliderOverlay\"\nAlphaSliderOverlay.__ui__ = \"AlphaSliderOverlay\"\n\ninterface AlphaSliderTrackProps extends HTMLUIProps {}\n\nconst AlphaSliderTrack = forwardRef<AlphaSliderTrackProps, \"div\">(\n ({ className, ...rest }, ref) => {\n const { styles } = useAlphaSlider()\n\n const css: CSSUIObject = {\n h: \"100%\",\n position: \"relative\",\n w: \"100%\",\n ...styles.track,\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-alpha-slider__track\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nAlphaSliderTrack.displayName = \"AlphaSliderTrack\"\nAlphaSliderTrack.__ui__ = \"AlphaSliderTrack\"\n\ninterface AlphaSliderThumbProps extends HTMLUIProps {}\n\nconst AlphaSliderThumb = forwardRef<AlphaSliderThumbProps, \"div\">(\n ({ className, ...rest }, ref) => {\n const { styles } = useAlphaSlider()\n\n const css: CSSUIObject = { ...styles.thumb }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-alpha-slider__thumb\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nAlphaSliderThumb.displayName = \"AlphaSliderThumb\"\nAlphaSliderThumb.__ui__ = \"AlphaSliderThumb\"\n","import type { CSSUIProps, HTMLUIProps, PropGetter } from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\nimport type { CSSProperties, KeyboardEvent, KeyboardEventHandler } from \"react\"\nimport {\n formControlProperties,\n useFormControlProps,\n} from \"@yamada-ui/form-control\"\nimport { useControllableState } from \"@yamada-ui/use-controllable-state\"\nimport { useLatestRef } from \"@yamada-ui/use-latest-ref\"\nimport { usePanEvent } from \"@yamada-ui/use-pan-event\"\nimport { useSize } from \"@yamada-ui/use-size\"\nimport {\n clampNumber,\n dataAttr,\n handlerAll,\n mergeRefs,\n percentToValue,\n roundNumberToStep,\n splitObject,\n useCallbackRef,\n useUpdateEffect,\n valueToPercent,\n} from \"@yamada-ui/utils\"\nimport { useCallback, useRef, useState } from \"react\"\n\ntype ColorSliderChannel = \"alpha\" | \"hue\"\n\ninterface UseColorSliderOptions {\n /**\n * The maximum allowed value of the slider. Cannot be less than min.\n */\n max: number\n /**\n * The minimum allowed value of the slider. Cannot be greater than max.\n */\n min: number\n /**\n * The base `id` to use for the slider.\n */\n id?: string\n /**\n * The name attribute of the hidden `input` field.\n * This is particularly useful in forms.\n */\n name?: string\n /**\n * The channel of the slider.\n */\n channel?: ColorSliderChannel\n /**\n * The initial value of the slider.\n */\n defaultValue?: number\n /**\n * If `false`, the slider handle will not capture focus when value changes.\n *\n * @default true\n */\n focusThumbOnChange?: boolean\n /**\n * The step in which increments or decrements have to be made.\n *\n * @default 1\n */\n step?: number\n /**\n * The CSS `background` property. Used in `background` of thumb element.\n */\n thumbColor?: CSSUIProps[\"bg\"]\n /**\n * The value of the slider.\n */\n value?: number\n /**\n * Function called whenever the slider value changes.\n */\n onChange?: (value: number) => void\n /**\n * Function called when the user is done selecting a new value.\n */\n onChangeEnd?: (value: number) => void\n /**\n * Function called when the user starts selecting a new value.\n */\n onChangeStart?: (value: number) => void\n}\n\nexport interface UseColorSliderProps\n extends Omit<HTMLUIProps, \"defaultValue\" | \"onChange\">,\n UseColorSliderOptions,\n FormControlOptions {}\n\nexport const useColorSlider = ({\n focusThumbOnChange = true,\n ...props\n}: UseColorSliderProps) => {\n if (!focusThumbOnChange) props.isReadOnly = true\n\n const {\n id,\n name,\n style: styleProp,\n channel = \"hue\",\n defaultValue,\n max,\n min = 0,\n step = 1,\n thumbColor,\n value: valueProp,\n onChange: onChangeProp,\n onChangeEnd: onChangeEndProp,\n onChangeStart: onChangeStartProp,\n ...rest\n } = useFormControlProps(props)\n const [\n {\n \"aria-readonly\": ariaReadonly,\n disabled,\n readOnly,\n required,\n onBlur: onBlurProp,\n onFocus: onFocusProp,\n ...formControlProps\n },\n containerProps,\n ] = splitObject(rest, formControlProperties)\n\n const onChangeStart = useCallbackRef(onChangeStartProp)\n const onChangeEnd = useCallbackRef(onChangeEndProp)\n\n const [computedValue, setValue] = useControllableState({\n defaultValue: defaultValue ?? min + (max - min) / 2,\n value: valueProp,\n onChange: onChangeProp,\n })\n const value = clampNumber(computedValue, min, max)\n const thumbPercent = valueToPercent(value, min, max)\n const [isDragging, setDragging] = useState(false)\n const isInteractive = !(disabled || readOnly)\n\n const oneStep = step || (max - min) / 100\n const tenStep = (max - min) / 10\n\n const containerRef = useRef<HTMLElement>(null)\n const trackRef = useRef<HTMLElement>(null)\n const thumbRef = useRef<HTMLElement>(null)\n const latestRef = useLatestRef({\n eventSource: null as \"keyboard\" | \"pointer\" | null,\n focusThumbOnChange,\n isInteractive,\n max,\n min,\n step,\n value,\n })\n\n const thumbSize = useSize(thumbRef)\n\n const getValueFromPointer = useCallback(\n (ev: any) => {\n if (!trackRef.current) return\n\n const { max, min, step } = latestRef.current\n\n latestRef.current.eventSource = \"pointer\"\n\n const { left, width } = trackRef.current.getBoundingClientRect()\n const { clientX } = ev.touches?.[0] ?? ev\n\n let percent = (clientX - left) / width\n\n let nextValue = percentToValue(percent, min, max)\n\n if (step) nextValue = parseFloat(roundNumberToStep(nextValue, min, step))\n\n nextValue = clampNumber(nextValue, min, max)\n\n return nextValue\n },\n [latestRef],\n )\n\n const setValueFromPointer = (ev: MouseEvent | PointerEvent | TouchEvent) => {\n const { value } = latestRef.current\n const nextValue = getValueFromPointer(ev)\n\n if (nextValue != null && nextValue !== value) setValue(nextValue)\n }\n\n const focusThumb = useCallback(() => {\n const { focusThumbOnChange } = latestRef.current\n\n if (focusThumbOnChange) setTimeout(() => thumbRef.current?.focus())\n }, [latestRef])\n\n const constrain = useCallback(\n (value: number) => {\n const { isInteractive, max, min } = latestRef.current\n\n if (!isInteractive) return\n\n value = parseFloat(roundNumberToStep(value, min, oneStep))\n value = clampNumber(value, min, max)\n\n setValue(value)\n },\n [setValue, latestRef, oneStep],\n )\n\n const stepUp = useCallback(\n (step = oneStep) => constrain(value + step),\n [constrain, value, oneStep],\n )\n\n const stepDown = useCallback(\n (step = oneStep) => constrain(value - step),\n [constrain, value, oneStep],\n )\n\n const onKeyDown = useCallback(\n (ev: KeyboardEvent<HTMLElement>) => {\n const { max, min } = latestRef.current\n\n const actions: { [key: string]: KeyboardEventHandler } = {\n ArrowDown: () => stepDown(),\n ArrowLeft: () => stepDown(),\n ArrowRight: () => stepUp(),\n ArrowUp: () => stepUp(),\n End: () => constrain(max),\n Home: () => constrain(min),\n PageDown: () => stepDown(tenStep),\n PageUp: () => stepUp(tenStep),\n }\n\n const action = actions[ev.key]\n\n if (!action) return\n\n ev.preventDefault()\n ev.stopPropagation()\n\n action(ev)\n\n latestRef.current.eventSource = \"keyboard\"\n },\n [constrain, latestRef, stepDown, stepUp, tenStep],\n )\n\n usePanEvent(containerRef, {\n onMove: (ev) => {\n const { isInteractive } = latestRef.current\n\n if (!isInteractive) return\n\n setValueFromPointer(ev)\n },\n onSessionEnd: () => {\n const { isInteractive, value } = latestRef.current\n\n if (!isInteractive) return\n\n setDragging(false)\n onChangeEnd(value)\n },\n onSessionStart: (ev) => {\n const { isInteractive, value } = latestRef.current\n\n if (!isInteractive) return\n\n setDragging(true)\n focusThumb()\n setValueFromPointer(ev)\n onChangeStart(value)\n },\n })\n\n useUpdateEffect(() => {\n const { eventSource, value } = latestRef.current\n\n if (eventSource === \"keyboard\") onChangeEnd(value)\n }, [value, onChangeEnd])\n\n const getContainerProps: PropGetter = useCallback(\n (props = {}, ref = null) => {\n const { width: w } = thumbSize ?? { width: 0 }\n\n const style: CSSProperties = {\n ...props.style,\n ...styleProp,\n paddingInline: `${w / 2}px`,\n }\n\n return {\n ...props,\n ...formControlProps,\n ...containerProps,\n ref: mergeRefs(ref, containerRef),\n style,\n tabIndex: -1,\n }\n },\n [containerProps, formControlProps, styleProp, thumbSize],\n )\n\n const getInputProps: PropGetter<\"input\"> = useCallback(\n (props = {}, ref = null) => ({\n ...formControlProps,\n \"aria-readonly\": ariaReadonly,\n ...props,\n id,\n ref,\n type: \"hidden\",\n name,\n disabled,\n readOnly,\n required,\n value,\n }),\n [\n ariaReadonly,\n disabled,\n formControlProps,\n id,\n name,\n readOnly,\n required,\n value,\n ],\n )\n\n const getTrackProps: PropGetter = useCallback(\n (props = {}, ref = null) => ({\n ...formControlProps,\n ...props,\n ref: mergeRefs(ref, trackRef),\n }),\n [formControlProps],\n )\n\n const getThumbProps: PropGetter = useCallback(\n (props = {}, ref = null) => {\n const n = thumbPercent\n const { width: w } = thumbSize ?? { width: 0 }\n\n const style: CSSProperties = {\n ...props.style,\n left: `calc(${n}% - ${w / 2}px)`,\n position: \"absolute\",\n touchAction: \"none\",\n userSelect: \"none\",\n }\n\n return {\n \"aria-label\": \"Slider thumb\",\n bg: thumbColor ?? `hsl(${value}, 100%, 50%)`,\n ...formControlProps,\n \"aria-readonly\": ariaReadonly,\n ...props,\n ref: mergeRefs(ref, thumbRef),\n style,\n \"aria-valuemax\": max,\n \"aria-valuemin\": min,\n \"aria-valuenow\": value,\n \"aria-valuetext\": getAriaValueText(channel, value),\n \"data-active\": dataAttr(isDragging && focusThumbOnChange),\n role: \"slider\",\n tabIndex: isInteractive && focusThumbOnChange ? 0 : undefined,\n onBlur: handlerAll(props.onBlur, onBlurProp),\n onFocus: handlerAll(props.onFocus, onFocusProp),\n onKeyDown: handlerAll(props.onKeyDown, onKeyDown),\n }\n },\n [\n thumbPercent,\n thumbSize,\n thumbColor,\n value,\n formControlProps,\n ariaReadonly,\n max,\n min,\n channel,\n isDragging,\n focusThumbOnChange,\n isInteractive,\n onBlurProp,\n onFocusProp,\n onKeyDown,\n ],\n )\n\n return {\n value,\n getContainerProps,\n getInputProps,\n getThumbProps,\n getTrackProps,\n }\n}\n\nexport type UseColorSliderReturn = ReturnType<typeof useColorSlider>\n\nexport const getAriaValueText = (\n channel: ColorSliderChannel,\n value: number,\n) => {\n if (channel === \"hue\") {\n return `${value}°, ${getColorName(value)}`\n } else {\n return `${value * 100}%`\n }\n}\n\nconst getColorName = (hue: number): string => {\n if (hue < 30 || hue >= 330) return \"Red\"\n if (hue < 90) return \"Yellow\"\n if (hue < 150) return \"Green\"\n if (hue < 210) return \"Cyan\"\n if (hue < 270) return \"Blue\"\n return \"Magenta\"\n}\n","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","import type { CSSUIObject, HTMLUIProps, ThemeProps } from \"@yamada-ui/core\"\nimport type { FC, ForwardedRef, ReactNode } from \"react\"\nimport type { ColorSelectorBodyProps } from \"./color-selector-body\"\nimport type { ColorSelectorChannelsProps } from \"./color-selector-channels\"\nimport type { ColorSelectorSwatchesProps } from \"./color-selector-swatches\"\nimport type { SaturationSliderProps } from \"./saturation-slider\"\nimport type { UseColorSelectorProps } from \"./use-color-selector\"\nimport {\n forwardRef,\n omitThemeProps,\n ui,\n useComponentMultiStyle,\n} from \"@yamada-ui/core\"\nimport { cx, runIfFunc } from \"@yamada-ui/utils\"\nimport { ColorSelectorBody } from \"./color-selector-body\"\nimport { ColorSelectorChannels } from \"./color-selector-channels\"\nimport { ColorSelectorSwatches } from \"./color-selector-swatches\"\nimport { SaturationSlider } from \"./saturation-slider\"\nimport { ColorSelectorProvider, useColorSelector } from \"./use-color-selector\"\n\ninterface ColorSelectorOptions {\n children?: FC<{ value: string }> | ReactNode\n /**\n * Ref for the saturation slider component.\n */\n saturationSliderRef?: ForwardedRef<HTMLInputElement>\n /**\n * If `true`, display the channels component.\n *\n * @default true\n */\n withChannel?: boolean\n /**\n * If `true`, display the saturation, hue, alpha, channels and eye dropper component.\n *\n * @default true\n */\n withPicker?: boolean\n /**\n * Props for the channels component.\n */\n channelsProps?: ColorSelectorChannelsProps\n /**\n * Props for the color selector input element.\n */\n inputProps?: HTMLUIProps<\"input\">\n /**\n * Props for the saturation slider component.\n */\n saturationSliderProps?: Omit<SaturationSliderProps, \"defaultValue\" | \"value\">\n /**\n * Props for the swatches component.\n */\n swatchesProps?: ColorSelectorSwatchesProps\n}\n\nexport interface ColorSelectorProps\n extends ThemeProps<\"ColorSelector\">,\n UseColorSelectorProps,\n ColorSelectorOptions,\n Pick<\n ColorSelectorBodyProps,\n | \"alphaSliderProps\"\n | \"alphaSliderRef\"\n | \"eyeDropperProps\"\n | \"eyeDropperRef\"\n | \"hueSliderProps\"\n | \"hueSliderRef\"\n | \"withEyeDropper\"\n | \"withResult\"\n >,\n Pick<\n ColorSelectorSwatchesProps,\n \"swatches\" | \"swatchesColumns\" | \"swatchesLabel\" | \"swatchProps\"\n >,\n Pick<ColorSelectorChannelsProps, \"channelProps\"> {}\n\n/**\n * `ColorSelector` is a component used by the user to select a color.\n *\n * @see Docs https://yamada-ui.com/components/forms/color-selector\n */\nexport const ColorSelector = forwardRef<ColorSelectorProps, \"input\">(\n ({ size, ...props }, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\"ColorSelector\", {\n size,\n ...props,\n })\n const {\n className,\n alphaSliderRef,\n children,\n eyeDropperRef,\n hueSliderRef,\n saturationSliderRef,\n swatches,\n swatchesColumns = 7,\n swatchesLabel,\n withChannel = true,\n withEyeDropper,\n withPicker = true,\n withResult = true,\n alphaSliderProps,\n channelProps,\n channelsProps,\n eyeDropperProps,\n hueSliderProps,\n inputProps,\n saturationSliderProps,\n swatchesProps,\n swatchProps,\n ...computedProps\n } = omitThemeProps(mergedProps)\n const {\n value,\n getContainerProps,\n getInputProps,\n getSaturationSliderProps,\n ...rest\n } = useColorSelector(computedProps)\n\n const css: CSSUIObject = {\n display: \"flex\",\n flexDirection: \"column\",\n ...styles.container,\n }\n\n return (\n <ColorSelectorProvider value={{ size, styles, value, ...rest }}>\n <ui.div\n ref={ref}\n className={cx(\"ui-color-selector\", className)}\n __css={css}\n {...getContainerProps()}\n >\n <ui.input {...getInputProps(inputProps, ref)} />\n\n {withPicker ? (\n <SaturationSlider\n className=\"ui-color-selector__saturation-slider\"\n size={size}\n __css={{ ...styles.saturationSlider }}\n {...getSaturationSliderProps(\n saturationSliderProps,\n saturationSliderRef,\n )}\n />\n ) : null}\n\n {withPicker ? (\n <ColorSelectorBody\n {...{\n alphaSliderRef,\n eyeDropperRef,\n hueSliderRef,\n withEyeDropper,\n withResult,\n alphaSliderProps,\n eyeDropperProps,\n hueSliderProps,\n }}\n />\n ) : null}\n\n {withPicker && withChannel ? (\n <ColorSelectorChannels {...{ channelProps, ...channelsProps }} />\n ) : null}\n\n <ColorSelectorSwatches\n {...{\n swatches,\n swatchesColumns,\n swatchesLabel,\n swatchProps,\n ...swatchesProps,\n }}\n />\n\n {runIfFunc(children, { value })}\n </ui.div>\n </ColorSelectorProvider>\n )\n },\n)\n\nColorSelector.displayName = \"ColorSelector\"\nColorSelector.__ui__ = \"ColorSelector\"\n","import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport type { ForwardedRef } from \"react\"\nimport type { ColorSelectorEyeDropperProps } from \"./color-selector-eye-dropper\"\nimport type { ColorSelectorSlidersProps } from \"./color-selector-sliders\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { ColorSelectorEyeDropper } from \"./color-selector-eye-dropper\"\nimport { ColorSelectorSliders } from \"./color-selector-sliders\"\nimport { ColorSwatch } from \"./color-swatch\"\nimport { useColorSelectorContext } from \"./use-color-selector\"\n\ninterface ColorSelectorBodyOptions {\n /**\n * Ref for the eye dropper component.\n */\n eyeDropperRef?: ForwardedRef<HTMLButtonElement>\n /**\n * If `true` display the eye dropper component.\n *\n * @default true\n */\n withEyeDropper?: boolean\n /**\n * If `true`, display the result component.\n *\n * @default true\n */\n withResult?: boolean\n /**\n * Props for the eye dropper component.\n */\n eyeDropperProps?: ColorSelectorEyeDropperProps\n}\n\nexport interface ColorSelectorBodyProps\n extends Omit<HTMLUIProps, \"children\">,\n ColorSelectorBodyOptions,\n Pick<\n ColorSelectorSlidersProps,\n \"alphaSliderProps\" | \"alphaSliderRef\" | \"hueSliderProps\" | \"hueSliderRef\"\n > {}\n\nexport const ColorSelectorBody = forwardRef<ColorSelectorBodyProps, \"div\">(\n (\n {\n className,\n alphaSliderRef,\n eyeDropperRef,\n hueSliderRef,\n withEyeDropper = true,\n withResult,\n alphaSliderProps,\n eyeDropperProps,\n hueSliderProps,\n ...rest\n },\n ref,\n ) => {\n const { eyeDropperSupported, styles, value } = useColorSelectorContext()\n\n const css: CSSUIObject = {\n display: \"flex\",\n w: \"100%\",\n ...styles.body,\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-color-selector__body\", className)}\n __css={css}\n {...rest}\n >\n <ColorSelectorSliders\n {...{\n alphaSliderRef,\n hueSliderRef,\n alphaSliderProps,\n hueSliderProps,\n }}\n />\n\n {withEyeDropper && eyeDropperSupported ? (\n <ColorSelectorEyeDropper ref={eyeDropperRef} {...eyeDropperProps} />\n ) : null}\n\n {withResult ? (\n <ColorSwatch\n className=\"ui-color-selector__result\"\n color={value}\n __css={{ ...styles.result }}\n />\n ) : null}\n </ui.div>\n )\n },\n)\n\nColorSelectorBody.displayName = \"ColorSelectorBody\"\nColorSelectorBody.__ui__ = \"ColorSelectorBody\"\n","import type { IconButtonProps } from \"@yamada-ui/button\"\nimport type { CSSUIObject, FC } from \"@yamada-ui/core\"\nimport type { IconProps } from \"@yamada-ui/icon\"\nimport { IconButton } from \"@yamada-ui/button\"\nimport { forwardRef } from \"@yamada-ui/core\"\nimport { Icon } from \"@yamada-ui/icon\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useColorSelectorContext } from \"./use-color-selector\"\n\nexport interface ColorSelectorEyeDropperProps extends IconButtonProps {}\n\nexport const ColorSelectorEyeDropper = forwardRef<\n ColorSelectorEyeDropperProps,\n \"button\"\n>(({ className, ...rest }, ref) => {\n const { size, readOnly, styles, getEyeDropperProps } =\n useColorSelectorContext()\n\n const css: CSSUIObject = {\n h: \"auto\",\n minW: \"auto\",\n pointerEvents: readOnly ? \"none\" : undefined,\n ...styles.eyeDropper,\n }\n\n return (\n <IconButton\n className={cx(\"ui-color-selector__eye-dropper\", className)}\n size={size}\n variant=\"outline\"\n __css={css}\n {...getEyeDropperProps(rest, ref)}\n >\n <EyeDropperIcon className=\"ui-color-selector__eye-dropper__icon\" />\n </IconButton>\n )\n})\n\nColorSelectorEyeDropper.displayName = \"ColorSelectorEyeDropper\"\nColorSelectorEyeDropper.__ui__ = \"ColorSelectorEyeDropper\"\n\nexport const EyeDropperIcon: FC<IconProps> = ({ ...rest }) => {\n return (\n <Icon\n fill=\"none\"\n stroke=\"currentColor\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n {...rest}\n >\n <path d=\"m2 22 1-1h3l9-9\" />\n <path d=\"M3 21v-3l9-9\" />\n <path d=\"m15 6 3.4-3.4a2.1 2.1 0 1 1 3 3L18 9l.4.4a2.1 2.1 0 1 1-3 3l-3.8-3.8a2.1 2.1 0 1 1 3-3l.4.4Z\" />\n </Icon>\n )\n}\n\nEyeDropperIcon.displayName = \"EyeDropperIcon\"\nEyeDropperIcon.__ui__ = \"EyeDropperIcon\"\n","import type {\n CSSUIObject,\n HTMLUIProps,\n PropGetter,\n RequiredPropGetter,\n ThemeProps,\n} from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\nimport type { InputProps } from \"@yamada-ui/input\"\nimport type { ColorFormat, Dict } from \"@yamada-ui/utils\"\nimport type { ChangeEvent } from \"react\"\nimport type { AlphaSliderProps } from \"./alpha-slider\"\nimport type { ColorSwatchProps } from \"./color-swatch\"\nimport type { HueSliderProps } from \"./hue-slider\"\nimport type { SaturationSliderProps } from \"./saturation-slider\"\nimport {\n formControlProperties,\n useFormControlProps,\n} from \"@yamada-ui/form-control\"\nimport { useControllableState } from \"@yamada-ui/use-controllable-state\"\nimport { useEyeDropper } from \"@yamada-ui/use-eye-dropper\"\nimport {\n calcFormat,\n convertColor,\n createContext,\n handlerAll,\n hslaTo,\n hsvTo,\n isString,\n parseToHsla,\n parseToHsv,\n parseToRgba,\n rgbaTo,\n splitObject,\n useCallbackRef,\n useUpdateEffect,\n} from \"@yamada-ui/utils\"\nimport { useCallback, useMemo, useRef, useState } from \"react\"\n\ntype Space = keyof Hsla | keyof Rgba\ninterface Hsla {\n a: number\n h: number\n l: number\n s: number\n}\ninterface Rgba {\n a: number\n b: number\n g: number\n r: number\n}\ninterface Hsva {\n a: number\n h: number\n s: number\n v: number\n}\ninterface Channel {\n label: string\n max: number\n min: number\n space: Space\n value: number\n}\n\nconst convertHsla = (value: string, fallback?: string): Hsla => {\n let [h, s, l, a] = parseToHsla(value, fallback) ?? [0, 0, 1, 1]\n\n if (a > 1) a = 1\n\n return { a, h, l, s }\n}\n\nconst convertRgba = (value: string, fallback?: string): Rgba => {\n let [r, g, b, a] = parseToRgba(value, fallback) ?? [255, 255, 255, 1]\n\n if (r > 255) r = 255\n if (g > 255) g = 255\n if (b > 255) b = 255\n if (a > 1) a = 1\n\n return { a, b, g, r }\n}\n\nconst convertHsva = (value: string, fallback?: string): Hsva => {\n const [h, s, v, a] = parseToHsv(value, fallback)\n\n return { a, h, s, v }\n}\n\ninterface ColorSelectorContext {\n channels: Channel[]\n eyeDropperSupported: boolean\n isInteractive: boolean\n styles: { [key: string]: CSSUIObject | undefined }\n value: string\n withAlpha: boolean\n getAlphaSliderProps: PropGetter<AlphaSliderProps>\n getChannelProps: RequiredPropGetter<{ space: Space } & InputProps, InputProps>\n getEyeDropperProps: PropGetter<\"button\">\n getHueSliderProps: PropGetter<HueSliderProps>\n getSwatchProps: PropGetter<ColorSwatchProps>\n onChange: (value: Partial<Hsva> | string) => void\n size?: ThemeProps<\"ColorSelector\">[\"size\"]\n disabled?: boolean\n readOnly?: boolean\n}\n\nexport const [ColorSelectorProvider, useColorSelectorContext] =\n createContext<ColorSelectorContext>({\n name: \"ColorSelectorContext\",\n errorMessage: `useColorSelectorContext returned is 'undefined'. Seems you forgot to wrap the components in \"<ColorSelector />\"`,\n })\n\ninterface UseColorSelectorOptions {\n /**\n * The base `id` to use for the color selector.\n */\n id?: string\n /**\n * The name attribute of the hidden `input` field.\n * This is particularly useful in forms.\n */\n name?: string\n /**\n * The initial value of the color selector.\n */\n defaultValue?: string\n /**\n * The fallback value returned when color determination fails.\n */\n fallbackValue?: string\n /**\n * Color format. For example, `hex`, `rgba`, etc.\n *\n * @default \"hexa\"\n */\n format?: ColorFormat\n /**\n * The value of the color selector.\n */\n value?: string\n /**\n * Function called whenever the color selector value changes.\n */\n onChange?: (value: string) => void\n /**\n * Function called when the user is done selecting a new value.\n */\n onChangeEnd?: (value: string) => void\n /**\n * Function called when the user starts selecting a new value.\n */\n onChangeStart?: (value: string) => void\n /**\n * Function called whenever the color swatch click.\n */\n onSwatchClick?: (value: string) => void\n}\n\nexport interface UseColorSelectorBaseProps\n extends UseColorSelectorOptions,\n FormControlOptions {}\n\nexport interface UseColorSelectorProps\n extends Omit<HTMLUIProps, \"children\" | \"defaultValue\" | \"onChange\">,\n UseColorSelectorBaseProps {}\n\nexport const useColorSelector = ({\n isInvalid,\n ...props\n}: UseColorSelectorProps) => {\n const {\n id,\n name,\n defaultValue,\n fallbackValue,\n format: formatProp,\n value: valueProp,\n onChange: onChangeProp,\n onChangeEnd: onChangeEndProp,\n onChangeStart: onChangeStartProp,\n onSwatchClick,\n ...rest\n } = useFormControlProps({ isInvalid, ...props })\n const [\n {\n \"aria-readonly\": ariaReadonly,\n disabled,\n readOnly,\n required,\n ...formControlProps\n },\n containerProps,\n ] = splitObject(rest, formControlProperties)\n\n const onChangeStartRef = useCallbackRef(onChangeStartProp)\n const onChangeEndRef = useCallbackRef(onChangeEndProp)\n const { supported: eyeDropperSupported, onOpen } = useEyeDropper()\n const [value, setValue] = useControllableState({\n defaultValue: defaultValue ?? fallbackValue,\n value: valueProp,\n onChange: onChangeProp,\n })\n const format = useMemo(\n () => formatProp ?? calcFormat(value || \"#ffffff\"),\n [value, formatProp],\n )\n const resolvedValue = convertColor(value, \"#ffffff\")(format) as string\n const timeoutId = useRef<any>(undefined)\n const isDraggingRef = useRef<boolean>(false)\n const [parsedValue, setParsedValue] = useState<Hsva>(\n convertHsva(resolvedValue, fallbackValue),\n )\n const { a, h, s, v } = parsedValue\n const withAlpha = format.endsWith(\"a\")\n const isInteractive = !(disabled || readOnly)\n\n const channels: Channel[] = useMemo(() => {\n if (resolvedValue.startsWith(\"hsl\")) {\n const { a, h, l, s } = convertHsla(resolvedValue, fallbackValue)\n\n let channels: Channel[] = [\n { label: \"H\", max: 360, min: 0, space: \"h\", value: Math.round(h) },\n {\n label: \"S(%)\",\n max: 100,\n min: 0,\n space: \"s\",\n value: Math.round(s * 100),\n },\n {\n label: \"L(%)\",\n max: 100,\n min: 0,\n space: \"l\",\n value: Math.round(l * 100),\n },\n ]\n\n if (withAlpha) {\n channels = [\n ...channels,\n {\n label: \"A(%)\",\n max: 100,\n min: 0,\n space: \"a\",\n value: Math.round(a * 100),\n },\n ]\n }\n\n return channels\n } else {\n const { a, b, g, r } = convertRgba(resolvedValue, fallbackValue)\n\n let channels: Channel[] = [\n { label: \"R\", max: 255, min: 0, space: \"r\", value: Math.round(r) },\n { label: \"G\", max: 255, min: 0, space: \"g\", value: Math.round(g) },\n { label: \"B\", max: 255, min: 0, space: \"b\", value: Math.round(b) },\n ]\n\n if (withAlpha) {\n channels = [\n ...channels,\n {\n label: \"A(%)\",\n max: 100,\n min: 0,\n space: \"a\",\n value: Math.round(a * 100),\n },\n ]\n }\n\n return channels\n }\n }, [resolvedValue, withAlpha, fallbackValue])\n\n const onChange = useCallback(\n (value: Partial<Hsva> | string) => {\n if (isString(value)) {\n setParsedValue(convertHsva(value, fallbackValue))\n } else {\n setParsedValue((prev) => ({ ...prev, ...value }))\n }\n },\n [fallbackValue],\n )\n\n const onChangeStart = useCallback(\n (value: Partial<Hsva>) => {\n window.clearTimeout(timeoutId.current)\n\n isDraggingRef.current = true\n\n const { a, h, s, v } = { ...parsedValue, ...value }\n\n const nextValue = hsvTo([h, s, v, a], fallbackValue)(format)\n\n if (nextValue) onChangeStartRef(nextValue)\n },\n [onChangeStartRef, fallbackValue, parsedValue, format],\n )\n\n const onChangeEnd = useCallback(\n (value: Partial<Hsva> | string) => {\n window.clearTimeout(timeoutId.current)\n\n timeoutId.current = window.setTimeout(() => {\n isDraggingRef.current = false\n }, 200)\n\n let nextValue: string | undefined\n\n if (isString(value)) {\n nextValue = convertColor(value, fallbackValue)(format)\n } else {\n const { a, h, s, v } = { ...parsedValue, ...value }\n\n nextValue = hsvTo([h, s, v, a], fallbackValue)(format)\n }\n\n if (nextValue) onChangeEndRef(nextValue)\n },\n [onChangeEndRef, fallbackValue, parsedValue, format],\n )\n\n const onChannelChange = useCallback(\n (ev: ChangeEvent<HTMLInputElement>, space: Space) => {\n let n = Math.floor(parseFloat(ev.target.value))\n\n if (isNaN(n)) n = 0\n\n if ([\"a\", \"l\", \"s\"].includes(space)) n = n / 100\n\n let nextValue: string | undefined\n\n if (resolvedValue.startsWith(\"hsl\")) {\n const { a, h, l, s } = Object.assign(\n convertHsla(resolvedValue, fallbackValue),\n { [space]: n },\n )\n\n nextValue = hslaTo([h, s, l, a], fallbackValue)(format)\n } else {\n const { a, b, g, r } = Object.assign(\n convertRgba(resolvedValue, fallbackValue),\n { [space]: n },\n )\n\n nextValue = rgbaTo([r, g, b, a], fallbackValue)(format)\n }\n\n if (!nextValue) return\n\n onChange(nextValue)\n onChangeEnd(nextValue)\n },\n [resolvedValue, onChange, onChangeEnd, fallbackValue, format],\n )\n\n const onEyeDropperClick = useCallback(async () => {\n try {\n const { sRGBHex } = (await onOpen()) ?? {}\n\n if (!sRGBHex) return\n\n onChange(sRGBHex)\n onChangeEnd(sRGBHex)\n } catch {}\n }, [onOpen, onChange, onChangeEnd])\n\n useUpdateEffect(() => {\n const nextValue = hsvTo([h, s, v, a], fallbackValue)(format)\n\n if (nextValue) setValue(nextValue)\n }, [h, s, v, a])\n\n useUpdateEffect(() => {\n if (isDraggingRef.current) return\n\n if (valueProp) setParsedValue(convertHsva(valueProp, fallbackValue))\n }, [valueProp])\n\n useUpdateEffect(() => {\n if (!value) return\n\n const nextValue = convertColor(value, fallbackValue)(format)\n\n if (nextValue) setValue(nextValue)\n }, [format])\n\n const getContainerProps: PropGetter = useCallback(\n (props = {}, ref = null) => ({\n ...props,\n ref,\n ...formControlProps,\n ...containerProps,\n }),\n [containerProps, formControlProps],\n )\n\n const getInputProps: PropGetter<\"input\"> = useCallback(\n (props = {}, ref = null) => ({\n ...formControlProps,\n \"aria-readonly\": ariaReadonly,\n ...props,\n id,\n ref,\n type: \"hidden\",\n name,\n disabled,\n readOnly,\n required,\n value: resolvedValue,\n }),\n [\n formControlProps,\n ariaReadonly,\n id,\n name,\n resolvedValue,\n required,\n disabled,\n readOnly,\n ],\n )\n\n const getSaturationSliderProps: PropGetter<SaturationSliderProps> =\n useCallback(\n (props = {}, ref = null) => ({\n disabled,\n isInvalid,\n readOnly,\n required,\n ...props,\n ref,\n value: [h, s, v],\n onChange: handlerAll(props.onChange, ([, s, v]) => onChange({ s, v })),\n onChangeEnd: handlerAll(props.onChangeEnd, ([, s, v]) =>\n onChangeEnd({ s, v }),\n ),\n onChangeStart: handlerAll(props.onChangeStart, ([, s, v]) =>\n onChangeStart({ s, v }),\n ),\n }),\n [\n required,\n disabled,\n readOnly,\n isInvalid,\n h,\n s,\n v,\n onChange,\n onChangeStart,\n onChangeEnd,\n ],\n )\n\n const getHueSliderProps: PropGetter<HueSliderProps> = useCallback(\n (props = {}, ref = null) => ({\n disabled,\n isInvalid,\n readOnly,\n required,\n ...props,\n ref,\n value: h,\n onChange: handlerAll(props.onChange, (h) => onChange({ h })),\n onChangeEnd: handlerAll(props.onChangeEnd, (h) => onChangeEnd({ h })),\n onChangeStart: handlerAll(props.onChangeStart, (h) =>\n onChangeStart({ h }),\n ),\n }),\n [\n required,\n disabled,\n readOnly,\n isInvalid,\n h,\n onChange,\n onChangeStart,\n onChangeEnd,\n ],\n )\n\n const getAlphaSliderProps: PropGetter<AlphaSliderProps> = useCallback(\n (props = {}, ref = null) => ({\n disabled,\n isInvalid,\n readOnly,\n required,\n ...props,\n ref,\n color: hsvTo([h, s, v, a], fallbackValue)(format),\n value: a,\n onChange: handlerAll(props.onChange, (a) => onChange({ a })),\n onChangeEnd: handlerAll(props.onChangeEnd, (a) => onChangeEnd({ a })),\n onChangeStart: handlerAll(props.onChangeStart, (a) =>\n onChangeStart({ a }),\n ),\n }),\n [\n fallbackValue,\n required,\n disabled,\n readOnly,\n isInvalid,\n format,\n h,\n s,\n v,\n a,\n onChange,\n onChangeStart,\n onChangeEnd,\n ],\n )\n\n const getChannelProps: RequiredPropGetter<\n { space: Space } & InputProps,\n InputProps\n > = useCallback(\n ({ space, ...props }, ref = null) => {\n return {\n disabled,\n isInvalid,\n readOnly,\n required,\n ...props,\n ref,\n type: \"number\",\n step: 1,\n onChange: handlerAll(props.onChange, (ev) =>\n onChannelChange(ev, space),\n ),\n } as Dict\n },\n [required, disabled, readOnly, isInvalid, onChannelChange],\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 onClick: handlerAll(props.onClick, onEyeDropperClick),\n }),\n [disabled, onEyeDropperClick],\n )\n\n const getSwatchProps: PropGetter<ColorSwatchProps> = useCallback(\n ({ color, ...props } = {}, ref = null) => ({\n \"aria-label\": `Select ${color} as the color`,\n disabled,\n readOnly,\n ...props,\n ref,\n color,\n onClick: handlerAll(props.onClick, () => {\n if (!isString(color)) return\n\n onSwatchClick?.(color)\n onChange(color)\n onChangeEnd(color)\n }),\n }),\n [disabled, readOnly, onSwatchClick, onChange, onChangeEnd],\n )\n\n return {\n channels,\n disabled,\n eyeDropperSupported,\n isInteractive,\n readOnly,\n value: resolvedValue,\n withAlpha,\n getAlphaSliderProps,\n getChannelProps,\n getContainerProps,\n getEyeDropperProps,\n getHueSliderProps,\n getInputProps,\n getSaturationSliderProps,\n getSwatchProps,\n onChange,\n }\n}\n\nexport type UseColorSelectorReturn = ReturnType<typeof useColorSelector>\n","import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport type { ForwardedRef } from \"react\"\nimport type { AlphaSliderProps } from \"./alpha-slider\"\nimport type { HueSliderProps } from \"./hue-slider\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { AlphaSlider } from \"./alpha-slider\"\nimport { HueSlider } from \"./hue-slider\"\nimport { useColorSelectorContext } from \"./use-color-selector\"\n\ninterface ColorSelectorSlidersOptions {\n /**\n * Ref for the alpha slider component.\n */\n alphaSliderRef?: ForwardedRef<HTMLInputElement>\n /**\n * Ref for the hue slider component.\n */\n hueSliderRef?: ForwardedRef<HTMLInputElement>\n /**\n * Props for the alpha slider component.\n */\n alphaSliderProps?: Omit<AlphaSliderProps, \"defaultValue\" | \"value\">\n /**\n * Props for the hue slider component.\n */\n hueSliderProps?: Omit<HueSliderProps, \"defaultValue\" | \"value\">\n}\n\nexport interface ColorSelectorSlidersProps\n extends Omit<HTMLUIProps, \"children\">,\n ColorSelectorSlidersOptions {}\n\nexport const ColorSelectorSliders = forwardRef<\n ColorSelectorSlidersProps,\n \"div\"\n>(\n (\n {\n className,\n alphaSliderRef,\n hueSliderRef,\n alphaSliderProps,\n hueSliderProps,\n ...rest\n },\n ref,\n ) => {\n let { size, styles, withAlpha, getAlphaSliderProps, getHueSliderProps } =\n useColorSelectorContext()\n\n if (size === \"full\") size = \"lg\"\n\n const css: CSSUIObject = {\n display: \"flex\",\n flexDirection: \"column\",\n ...styles.sliders,\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-color-selector__sliders\", className)}\n __css={css}\n {...rest}\n >\n <HueSlider\n className=\"ui-color-selector__hue-slider\"\n size={size}\n __css={{ ...styles.hueSlider }}\n {...getHueSliderProps(hueSliderProps, hueSliderRef)}\n />\n\n {withAlpha ? (\n <AlphaSlider\n className=\"ui-color-selector__alpha-slider\"\n size={size}\n __css={{ ...styles.alphaSlider }}\n {...getAlphaSliderProps(alphaSliderProps, alphaSliderRef)}\n />\n ) : null}\n </ui.div>\n )\n },\n)\n\nColorSelectorSliders.displayName = \"ColorSelectorSliders\"\nColorSelectorSliders.__ui__ = \"ColorSelectorSliders\"\n","import type { CSSUIObject, HTMLUIProps, ThemeProps } from \"@yamada-ui/core\"\nimport type { UseColorSliderProps } from \"./use-color-slider\"\nimport {\n forwardRef,\n omitThemeProps,\n ui,\n useComponentMultiStyle,\n} from \"@yamada-ui/core\"\nimport { createContext, cx } from \"@yamada-ui/utils\"\nimport { useColorSlider } from \"./use-color-slider\"\n\ninterface HueSliderContext {\n styles: { [key: string]: CSSUIObject | undefined }\n}\n\nconst [HueSliderProvider, useHueSlider] = createContext<HueSliderContext>({\n name: \"SliderContext\",\n errorMessage: `useSliderContext returned is 'undefined'. Seems you forgot to wrap the components in \"<HueSlider />\" `,\n})\n\nconst defaultOverlays = (\n min: number,\n max: number,\n withShadow: boolean,\n): HTMLUIProps[] => {\n let overlays: HTMLUIProps[] = [\n {\n bgGradient: `linear(to-r, ${[...Array(7)]\n .map(\n (_, index) =>\n `hsl(${Math.round(min + ((max - min) / 6) * index)}, 100%, 50%)`,\n )\n .join(\", \")})`,\n },\n ]\n\n if (withShadow)\n overlays = [\n ...overlays,\n {\n boxShadow: `rgba(0, 0, 0, .1) 0 0 0 1px inset, rgb(0, 0, 0, .15) 0 0 4px inset`,\n },\n ]\n\n return overlays\n}\n\ninterface HueSliderOptions {\n /**\n * The maximum allowed value of the slider. Cannot be less than min.\n *\n * @default 360\n */\n max?: number\n /**\n * The minimum allowed value of the slider. Cannot be greater than max.\n *\n * @default 0\n */\n min?: number\n /**\n * The overlay used for the slider.\n */\n overlays?: HTMLUIProps[]\n /**\n * The step in which increments or decrements have to be made.\n *\n * @default 1\n */\n step?: number\n /**\n * If `true`, the slider has an inner `box-shadow`.\n *\n * @default true\n */\n withShadow?: boolean\n /**\n * Props for slider input element.\n */\n inputProps?: HTMLUIProps<\"input\">\n /**\n * Props for slider thumb element.\n */\n thumbProps?: HTMLUIProps\n /**\n * Props for slider track element.\n */\n trackProps?: HTMLUIProps\n}\n\nexport interface HueSliderProps\n extends ThemeProps<\"HueSlider\">,\n Partial<Omit<UseColorSliderProps, \"channel\">>,\n HueSliderOptions {}\n\n/**\n * `HueSlider` is a component used to allow the user to select a color hue.\n *\n * @see Docs https://yamada-ui.com/components/forms/hue-slider\n */\nexport const HueSlider = forwardRef<HueSliderProps, \"input\">((props, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\"HueSlider\", props)\n const {\n className,\n max = 360,\n min = 0,\n withShadow = true,\n overlays = defaultOverlays(min, max, withShadow),\n inputProps,\n thumbProps,\n trackProps,\n __css,\n ...computedProps\n } = omitThemeProps(mergedProps)\n const { getContainerProps, getInputProps, getThumbProps, getTrackProps } =\n useColorSlider({ max, min, step: 1, ...computedProps, channel: \"hue\" })\n\n const css: CSSUIObject = {\n position: \"relative\",\n ...styles.container,\n ...__css,\n }\n\n return (\n <HueSliderProvider value={{ styles }}>\n <ui.div\n className={cx(\"ui-hue-slider\", className)}\n __css={css}\n {...getContainerProps()}\n >\n <ui.input {...getInputProps(inputProps, ref)} />\n\n {overlays.map((props, index) => (\n <HueSliderOverlay key={index} {...props} />\n ))}\n\n <HueSliderTrack {...getTrackProps(trackProps)}>\n <HueSliderThumb {...getThumbProps(thumbProps)} />\n </HueSliderTrack>\n </ui.div>\n </HueSliderProvider>\n )\n})\n\nHueSlider.displayName = \"HueSlider\"\nHueSlider.__ui__ = \"HueSlider\"\n\ninterface HueSliderOverlayProps extends HTMLUIProps {}\n\nconst HueSliderOverlay = forwardRef<HueSliderOverlayProps, \"div\">(\n ({ className, ...rest }, ref) => {\n const { styles } = useHueSlider()\n\n const css: CSSUIObject = {\n bottom: 0,\n left: 0,\n position: \"absolute\",\n right: 0,\n top: 0,\n ...styles.overlay,\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-hue-slider__overlay\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nHueSliderOverlay.displayName = \"HueSliderOverlay\"\nHueSliderOverlay.__ui__ = \"HueSliderOverlay\"\n\ninterface HueSliderTrackProps extends HTMLUIProps {}\n\nconst HueSliderTrack = forwardRef<HueSliderTrackProps, \"div\">(\n ({ className, ...rest }, ref) => {\n const { styles } = useHueSlider()\n\n const css: CSSUIObject = {\n h: \"100%\",\n position: \"relative\",\n w: \"100%\",\n ...styles.track,\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-hue-slider__track\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nHueSliderTrack.displayName = \"HueSliderTrack\"\nHueSliderTrack.__ui__ = \"HueSliderTrack\"\n\ninterface HueSliderThumbProps extends HTMLUIProps {}\n\nconst HueSliderThumb = forwardRef<HueSliderThumbProps, \"div\">(\n ({ className, ...rest }, ref) => {\n const { styles } = useHueSlider()\n\n const css: CSSUIObject = { ...styles.thumb }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-hue-slider__thumb\", className)}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nHueSliderThumb.displayName = \"HueSliderThumb\"\nHueSliderThumb.__ui__ = \"HueSliderThumb\"\n","import type {\n CSSUIObject,\n CSSUIProps,\n HTMLUIProps,\n ThemeProps,\n} from \"@yamada-ui/core\"\nimport {\n forwardRef,\n omitThemeProps,\n ui,\n useComponentMultiStyle,\n} from \"@yamada-ui/core\"\nimport { cx } from \"@yamada-ui/utils\"\n\nconst defaultOverlays = (\n background: CSSUIProps[\"color\"],\n withShadow: boolean,\n): HTMLUIProps[] => {\n let overlays: HTMLUIProps[] = [\n {\n bgImage:\n \"linear-gradient(45deg, $checkers 25%, transparent 25%), linear-gradient(-45deg, $checkers 25%, transparent 25%), linear-gradient(45deg, transparent 75%, $checkers 75%), linear-gradient(-45deg, $body 75%, $checkers 75%)\",\n bgPosition: `0 0, 0 4px, 4px -4px, -4px 0`,\n bgSize: `8px 8px`,\n vars: [\n {\n name: \"checkers\",\n token: \"colors\",\n value: [\"blackAlpha.300\", \"whiteAlpha.300\"],\n },\n {\n name: \"body\",\n token: \"colors\",\n value: [\"whiteAlpha.500\", \"blackAlpha.500\"],\n },\n ],\n },\n { background },\n ]\n\n if (withShadow)\n overlays = [\n ...overlays,\n {\n boxShadow: `rgba(0, 0, 0, .1) 0 0 0 1px inset, rgb(0, 0, 0, .15) 0 0 4px inset`,\n },\n ]\n\n return overlays\n}\n\ninterface ColorSwatchOptions {\n /**\n * The color used for the swatch element.\n *\n * @default \"#ffffff00\"\n */\n color?: CSSUIProps[\"color\"]\n /**\n * If `true`, the color swatch will be perfectly round. Else, it'll be slightly round.\n *\n * @default false\n */\n isRounded?: boolean\n /**\n * The overlay used for the swatch element.\n */\n overlays?: HTMLUIProps[]\n /**\n * If `true`, the swatch element has an inner `box-shadow`.\n *\n * @default true\n */\n withShadow?: boolean\n}\n\nexport interface ColorSwatchProps\n extends Omit<HTMLUIProps, \"color\">,\n ThemeProps<\"ColorSwatch\">,\n ColorSwatchOptions {}\n\n/**\n * `ColorSwatch` is a component that displays color samples.\n *\n * @see Docs https://yamada-ui.com/components/data-display/color-swatch\n */\nexport const ColorSwatch = forwardRef<ColorSwatchProps, \"div\">((props, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\"ColorSwatch\", props)\n const {\n className,\n color = \"#ffffff00\",\n isRounded,\n withShadow = true,\n overlays = defaultOverlays(color, withShadow),\n __css,\n ...rest\n } = omitThemeProps(mergedProps)\n\n const css: CSSUIObject = {\n \"& > *\": {\n alignItems: \"center\",\n bottom: \"0\",\n display: \"flex\",\n h: \"100%\",\n justifyContent: \"center\",\n left: \"0\",\n overflow: \"hidden\",\n position: \"absolute\",\n right: \"0\",\n top: \"0\",\n w: \"100%\",\n },\n position: \"relative\",\n _before: {\n content: `\"\"`,\n display: \"block\",\n h: 0,\n pb: \"100%\",\n },\n ...styles.container,\n ...__css,\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-color-swatch\", className)}\n {...(isRounded ? { rounded: \"fallback(full, 9999px)\" } : {})}\n __css={css}\n {...rest}\n >\n <ui.div {...(isRounded ? { rounded: \"fallback(full, 9999px)\" } : {})}>\n {overlays.map((props, index) => (\n <ui.div\n key={index}\n __css={{\n bottom: 0,\n left: 0,\n position: \"absolute\",\n right: 0,\n top: 0,\n ...styles.overlay,\n }}\n {...(isRounded ? { rounded: \"fallback(full, 9999px)\" } : {})}\n {...props}\n />\n ))}\n </ui.div>\n </ui.div>\n )\n})\n\nColorSwatch.displayName = \"ColorSwatch\"\nColorSwatch.__ui__ = \"ColorSwatch\"\n","import type { CSSUIObject, HTMLUIProps } from \"@yamada-ui/core\"\nimport type { InputProps } from \"@yamada-ui/input\"\nimport type { ReactNode } from \"react\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { Input } from \"@yamada-ui/input\"\nimport { cx } from \"@yamada-ui/utils\"\nimport { useId } from \"react\"\nimport { useColorSelectorContext } from \"./use-color-selector\"\n\ninterface ColorSelectorChannelsOptions {\n /**\n * Props for the chancel component.\n */\n channelProps?: Omit<ColorSelectorChannelProps, \"channelLabel\">\n}\n\nexport interface ColorSelectorChannelsProps\n extends Omit<HTMLUIProps, \"children\">,\n ColorSelectorChannelsOptions {}\n\nexport const ColorSelectorChannels = forwardRef<\n ColorSelectorChannelsProps,\n \"div\"\n>(({ className, channelProps, ...rest }, ref) => {\n const { channels, styles, withAlpha, getChannelProps } =\n useColorSelectorContext()\n\n const css: CSSUIObject = {\n display: \"grid\",\n gridTemplateColumns: `repeat(${withAlpha ? \"4\" : \"3\"}, 1fr)`,\n ...styles.channels,\n }\n\n return (\n <ui.div\n ref={ref}\n className={cx(\"ui-color-selector__channels\", className)}\n __css={css}\n {...rest}\n >\n {channels.map(({ label, max, min, space, value }) => (\n <ColorSelectorChannel\n key={label}\n channelLabel={label}\n {...getChannelProps({ ...channelProps, max, min, space, value })}\n />\n ))}\n </ui.div>\n )\n})\n\nColorSelectorChannels.displayName = \"ColorSelectorChannels\"\nColorSelectorChannels.__ui__ = \"ColorSelectorChannels\"\n\ninterface ColorSelectorChannelOptions {\n channelLabel?: ReactNode\n}\n\nexport type ColorSelectorChannelProps = ColorSelectorChannelOptions &\n Omit<\n InputProps,\n \"defaultValue\" | \"max\" | \"min\" | \"pattern\" | \"type\" | \"value\"\n >\n\nexport const ColorSelectorChannel = forwardRef<\n ColorSelectorChannelProps,\n \"input\"\n>(({ className, channelLabel, ...rest }, ref) => {\n const id = useId()\n let { size, disabled, readOnly, styles } = useColorSelectorContext()\n\n if (size === \"full\") size = \"lg\"\n\n const css: CSSUIObject = { ...styles.channel }\n\n return (\n <ui.div className={cx(\"ui-color-selector__channel\", className)}>\n {channelLabel ? (\n <ui.label\n htmlFor={id}\n style={{ cursor: disabled ? \"not-allowed\" : undefined }}\n __css={{\n display: \"block\",\n pointerEvents: readOnly ? \"none\" : undefined,\n ...styles.channelLabel,\n }}\n >\n {channelLabel}\n </ui.label>\n ) : null}\n\n <Input id={id} ref={ref} size={size} __css={css} {...rest} />\n </ui.div>\n )\n})\n\nColorSelectorChannel.displayName = \"ColorSelectorChannel\"\nColorSelectorChannel.__ui__ = \"ColorSelectorChannel\"\n","import type { CSSUIObject, HTMLUIProps, Token } from \"@yamada-ui/core\"\nimport type { ReactNode } from \"react\"\nimport type { ColorSwatchProps } from \"./color-swatch\"\nimport { forwardRef, ui } from \"@yamada-ui/core\"\nimport { cx, replaceObject } from \"@yamada-ui/utils\"\nimport { ColorSwatch } from \"./color-swatch\"\nimport { useColorSelectorContext } from \"./use-color-selector\"\n\ninterface ColorSelectorSwatchesOptions {\n /**\n * An array of colors in one of the supported formats.\n * Used to render swatches list below the color selector.\n */\n swatches?: string[]\n /**\n * Number of swatches grid columns.\n *\n * @default 7\n */\n swatchesColumns?: Token<number>\n /**\n * The swatches label to use.\n */\n swatchesLabel?: ReactNode\n /**\n * Props for the swatches container element.\n */\n swatchesContainerProps?: Omit<HTMLUIProps, \"children\">\n /**\n * Props for the color swatch component.\n */\n swatchProps?: ColorSwatchProps\n}\n\nexport interface ColorSelectorSwatchesProps\n extends Omit<HTMLUIProps, \"children\">,\n ColorSelectorSwatchesOptions {}\n\nexport const ColorSelectorSwatches = forwardRef<\n ColorSelectorSwatchesProps,\n \"div\"\n>(\n (\n {\n className,\n swatches,\n swatchesColumns,\n swatchesLabel,\n swatchesContainerProps,\n swatchProps,\n ...rest\n },\n ref,\n ) => {\n const { readOnly, styles, getSwatchProps } = useColorSelectorContext()\n\n const css: CSSUIObject = {\n display: \"grid\",\n gridTemplateColumns: replaceObject(swatchesColumns, (value) =>\n value != null ? `repeat(${value}, minmax(0, 1fr))` : undefined,\n ) as CSSUIObject[\"gridTemplateColumns\"],\n ...styles.swatches,\n }\n\n return swatches?.length ? (\n <ui.div {...swatchesContainerProps}>\n {swatchesLabel ? (\n <ui.p\n className=\"ui-color-selector__swatches__label\"\n __css={{ ...styles.swatchesLabel }}\n >\n {swatchesLabel}\n </ui.p>\n ) : null}\n\n <ui.div\n ref={ref}\n className={cx(\"ui-color-selector__swatches\", className)}\n __css={css}\n {...rest}\n >\n {swatches.map((color) => (\n <ColorSwatch\n key={color}\n as=\"button\"\n __css={{\n boxSize: \"100%\",\n pointerEvents: readOnly ? \"none\" : undefined,\n ...styles.swatch,\n }}\n {...getSwatchProps({ color, ...swatchProps })}\n />\n ))}\n </ui.div>\n </ui.div>\n ) : null\n },\n)\n\nColorSelectorSwatches.displayName = \"ColorSelectorSwatches\"\nColorSelectorSwatches.__ui__ = \"ColorSelectorSwatches\"\n","import type {\n CSSUIObject,\n HTMLUIProps,\n ThemeProps,\n Token,\n} from \"@yamada-ui/core\"\nimport type { UseSaturationSliderProps } from \"./use-saturation-slider\"\nimport {\n forwardRef,\n omitThemeProps,\n ui,\n useComponentMultiStyle,\n} from \"@yamada-ui/core\"\nimport { cx, replaceObject } from \"@yamada-ui/utils\"\nimport { useSaturationSlider } from \"./use-saturation-slider\"\n\ninterface SaturationSliderOptions {\n /**\n * The aspect ratio of the saturation slider.\n *\n * @default '16 / 9'\n */\n ratio?: Token<number>\n /**\n * Props for saturation slider inner element.\n */\n innerProps?: HTMLUIProps\n /**\n * Props for saturation slider input element.\n */\n inputProps?: HTMLUIProps<\"input\">\n /**\n * Props for saturation slider thumb element.\n */\n thumbProps?: HTMLUIProps\n /**\n * Props for saturation slider track element.\n */\n trackProps?: HTMLUIProps\n}\n\nexport interface SaturationSliderProps\n extends ThemeProps<\"SaturationSlider\">,\n UseSaturationSliderProps,\n SaturationSliderOptions {}\n\n/**\n * `SaturationSlider` is a component used to allow the user to select a color saturation.\n *\n * @see Docs https://yamada-ui.com/components/forms/saturation-slider\n */\nexport const SaturationSlider = forwardRef<SaturationSliderProps, \"input\">(\n (props, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\n \"SaturationSlider\",\n props,\n )\n const {\n className,\n ratio = 16 / 9,\n innerProps,\n inputProps,\n thumbProps,\n trackProps,\n __css,\n ...computedProps\n } = omitThemeProps(mergedProps)\n const {\n overlays,\n getContainerProps,\n getInnerProps,\n getInputProps,\n getThumbProps,\n getTrackProps,\n } = useSaturationSlider(computedProps)\n\n const css: CSSUIObject = {\n \"& > *\": {\n alignItems: \"center\",\n bottom: \"0\",\n display: \"flex\",\n h: \"100%\",\n justifyContent: \"center\",\n left: \"0\",\n position: \"absolute\",\n right: \"0\",\n top: \"0\",\n w: \"100%\",\n },\n position: \"relative\",\n _before: {\n content: `\"\"`,\n display: \"block\",\n h: 0,\n pb: replaceObject(ratio, (r) => `${(1 / r) * 100}%`),\n },\n ...styles.container,\n ...__css,\n }\n\n return (\n <ui.div\n className={cx(\"ui-saturation-slider\", className)}\n __css={css}\n {...getContainerProps()}\n >\n <ui.div\n className={cx(\"ui-saturation-slider__inner\", className)}\n __css={{ ...styles.inner }}\n {...getInnerProps(innerProps)}\n >\n <ui.input {...getInputProps(inputProps, ref)} />\n\n {overlays.map((props, index) => (\n <ui.div\n key={index}\n className=\"ui-saturation-slider__overlay\"\n __css={{\n bottom: 0,\n left: 0,\n position: \"absolute\",\n right: 0,\n top: 0,\n ...styles.overlay,\n }}\n {...props}\n />\n ))}\n\n <ui.div\n className=\"ui-saturation-slider__track\"\n __css={{\n h: \"100%\",\n position: \"relative\",\n w: \"100%\",\n ...styles.track,\n }}\n {...getTrackProps(trackProps)}\n >\n <ui.div\n className=\"ui-saturation-slider__thumb\"\n __css={{ ...styles.thumb }}\n {...getThumbProps(thumbProps)}\n />\n </ui.div>\n </ui.div>\n </ui.div>\n )\n },\n)\n\nSaturationSlider.displayName = \"SaturationSlider\"\nSaturationSlider.__ui__ = \"SaturationSlider\"\n","import type { CSSUIProps, HTMLUIProps, PropGetter } from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\nimport type { CSSProperties, KeyboardEvent, KeyboardEventHandler } from \"react\"\nimport {\n formControlProperties,\n useFormControlProps,\n} from \"@yamada-ui/form-control\"\nimport { useControllableState } from \"@yamada-ui/use-controllable-state\"\nimport { useLatestRef } from \"@yamada-ui/use-latest-ref\"\nimport { usePanEvent } from \"@yamada-ui/use-pan-event\"\nimport { useSize } from \"@yamada-ui/use-size\"\nimport {\n clampNumber,\n dataAttr,\n handlerAll,\n hsvTo,\n mergeRefs,\n roundNumberToStep,\n runIfFunc,\n splitObject,\n useCallbackRef,\n useUpdateEffect,\n} from \"@yamada-ui/utils\"\nimport { useCallback, useMemo, useRef, useState } from \"react\"\n\nexport type Hsv = [number, number, number]\ntype Overlay = ((value: Hsv) => HTMLUIProps) | HTMLUIProps\n\nconst defaultOverlays = (withShadow: boolean): Overlay[] => {\n let overlays: Overlay[] = [\n ([h]) => ({\n bg: `hsl(${h}, 100%, 50%)`,\n bgImage:\n \"linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, transparent)\",\n }),\n ]\n\n if (withShadow)\n overlays = [\n ...overlays,\n {\n boxShadow: `rgba(0, 0, 0, .1) 0 0 0 1px inset, rgb(0, 0, 0, .15) 0 0 4px inset`,\n },\n ]\n\n return overlays\n}\n\ninterface UseSaturationSliderOptions {\n /**\n * The base `id` to use for the saturation slider.\n */\n id?: string\n /**\n * The name attribute of the hidden `input` field.\n * This is particularly useful in forms.\n */\n name?: string\n /**\n * The initial value of the saturation slider.\n *\n * @default \"[0, 0, 1]\"\n */\n defaultValue?: Hsv\n /**\n * If `false`, the saturation slider handle will not capture focus when value changes.\n *\n * @default true\n */\n focusThumbOnChange?: boolean\n /**\n * The overlay used for the saturation slider.\n */\n overlays?: Overlay[]\n /**\n * The step in which increments or decrements have to be made.\n *\n * @default 0.01\n */\n step?: number\n /**\n * The CSS `background` property. Used in `background` of thumb element.\n */\n thumbColor?: CSSUIProps[\"bg\"]\n /**\n * The value of the saturation slider.\n */\n value?: Hsv\n /**\n * If `true`, the slider has an inner `box-shadow`.\n *\n * @default true\n */\n withShadow?: boolean\n /**\n * Function called whenever the saturation slider value changes.\n */\n onChange?: (value: Hsv) => void\n /**\n * Function called when the user is done selecting a new value.\n */\n onChangeEnd?: (value: Hsv) => void\n /**\n * Function called when the user starts selecting a new value.\n */\n onChangeStart?: (value: Hsv) => void\n}\n\nexport interface UseSaturationSliderProps\n extends Omit<HTMLUIProps, \"defaultValue\" | \"onChange\">,\n UseSaturationSliderOptions,\n FormControlOptions {}\n\nexport const useSaturationSlider = ({\n focusThumbOnChange = true,\n ...props\n}: UseSaturationSliderProps) => {\n if (!focusThumbOnChange) props.isReadOnly = true\n\n let {\n id,\n name,\n defaultValue = [0, 0, 1],\n withShadow = true,\n overlays: overlaysProp = defaultOverlays(withShadow),\n step = 0.01,\n thumbColor,\n value: valueProp,\n onChange: onChangeProp,\n onChangeEnd: onChangeEndProp,\n onChangeStart: onChangeStartProp,\n ...rest\n } = useFormControlProps(props)\n const [\n {\n \"aria-readonly\": _ariaReadonly,\n disabled,\n readOnly,\n required,\n ...formControlProps\n },\n containerProps,\n ] = splitObject(rest, formControlProperties)\n\n const onChangeStart = useCallbackRef(onChangeStartProp)\n const onChangeEnd = useCallbackRef(onChangeEndProp)\n\n const [value, setValue] = useControllableState({\n defaultValue,\n value: valueProp,\n onChange: onChangeProp,\n })\n const [isDragging, setDragging] = useState(false)\n const isInteractive = !(disabled || readOnly)\n let [h, s, v] = value\n\n s = clampNumber(s, 0, 1)\n v = clampNumber(v, 0, 1)\n\n const containerRef = useRef<HTMLElement>(null)\n const trackRef = useRef<HTMLElement>(null)\n const thumbRef = useRef<HTMLElement>(null)\n const latestRef = useLatestRef({\n eventSource: null as \"keyboard\" | \"pointer\" | null,\n focusThumbOnChange,\n isInteractive,\n step,\n value,\n })\n\n const thumbSize = useSize(thumbRef)\n\n const overlays = useMemo(\n () => overlaysProp.map((propsOrFunc) => runIfFunc(propsOrFunc, [h, s, v])),\n [overlaysProp, h, s, v],\n )\n\n const getValueFromPointer = useCallback(\n (ev: any) => {\n if (!trackRef.current) return []\n\n const { step } = latestRef.current\n\n latestRef.current.eventSource = \"pointer\"\n\n const { bottom, height, left, width } =\n trackRef.current.getBoundingClientRect()\n const { clientX, clientY } = ev.touches?.[0] ?? ev\n\n let s = clampNumber((clientX - left) / width, 0, 1)\n let v = clampNumber((bottom - clientY) / height, 0, 1)\n\n if (step) {\n s = parseFloat(roundNumberToStep(s, 0, step))\n v = parseFloat(roundNumberToStep(v, 0, step))\n }\n\n return [s, v]\n },\n [latestRef],\n )\n\n const setValueFromPointer = (ev: MouseEvent | PointerEvent | TouchEvent) => {\n const { value } = latestRef.current\n const [nextS, nextV] = getValueFromPointer(ev)\n\n if (nextS == null || nextV == null) return\n\n const [, s, v] = value\n\n if (nextS !== s || nextV !== v) setValue(([h]) => [h, nextS, nextV])\n }\n\n const focusThumb = useCallback(() => {\n const { focusThumbOnChange } = latestRef.current\n\n if (focusThumbOnChange) setTimeout(() => thumbRef.current?.focus())\n }, [latestRef])\n\n const constrain = useCallback(\n ([s, v]: [number, number]) => {\n const { isInteractive } = latestRef.current\n\n if (!isInteractive) return\n\n s = clampNumber(s, 0, 1)\n v = clampNumber(v, 0, 1)\n\n setValue(([h]) => [h, s, v])\n },\n [latestRef, setValue],\n )\n\n const onKeyDown = useCallback(\n (ev: KeyboardEvent<HTMLElement>) => {\n const actions: { [key: string]: KeyboardEventHandler } = {\n ArrowDown: () => constrain([s, v - step]),\n ArrowLeft: () => constrain([s - step, v]),\n ArrowRight: () => constrain([s + step, v]),\n ArrowUp: () => constrain([s, v + step]),\n }\n\n const action = actions[ev.key]\n\n if (!action) return\n\n ev.preventDefault()\n ev.stopPropagation()\n\n action(ev)\n\n latestRef.current.eventSource = \"keyboard\"\n },\n [latestRef, constrain, s, v, step],\n )\n\n usePanEvent(containerRef, {\n onMove: (ev) => {\n const { isInteractive } = latestRef.current\n\n if (!isInteractive) return\n\n setValueFromPointer(ev)\n },\n onSessionEnd: () => {\n const { isInteractive, value } = latestRef.current\n\n if (!isInteractive) return\n\n setDragging(false)\n onChangeEnd(value)\n },\n onSessionStart: (ev) => {\n const { isInteractive, value } = latestRef.current\n\n if (!isInteractive) return\n\n setDragging(true)\n focusThumb()\n setValueFromPointer(ev)\n onChangeStart(value)\n },\n })\n\n useUpdateEffect(() => {\n const { eventSource, value } = latestRef.current\n\n if (eventSource === \"keyboard\") onChangeEnd(value)\n }, [value, onChangeEnd])\n\n const getContainerProps: PropGetter = useCallback(\n (props = {}, ref = null) => ({\n ...props,\n ...containerProps,\n ...formControlProps,\n ref: mergeRefs(ref, containerRef),\n tabIndex: -1,\n }),\n [containerProps, formControlProps],\n )\n\n const getInnerProps: PropGetter = useCallback(\n (props = {}, ref = null) => {\n const { width: w } = thumbSize ?? { width: 0 }\n\n const style: CSSProperties = {\n ...props.style,\n ...rest.style,\n padding: `${w / 2}px`,\n }\n\n return {\n ...props,\n ref,\n style,\n }\n },\n [rest, thumbSize],\n )\n\n const getInputProps: PropGetter<\"input\"> = useCallback(\n (props = {}, ref = null) => ({\n ...formControlProps,\n ...props,\n id,\n ref,\n type: \"hidden\",\n name,\n disabled,\n readOnly,\n required,\n value: [h, s, v].toString(),\n }),\n [formControlProps, id, name, h, s, v, required, disabled, readOnly],\n )\n\n const getTrackProps: PropGetter = useCallback(\n (props = {}, ref = null) => ({\n ...formControlProps,\n ...props,\n ref: mergeRefs(ref, trackRef),\n }),\n [formControlProps],\n )\n\n const getThumbProps: PropGetter = useCallback(\n (props = {}, ref = null) => {\n const { height, width } = thumbSize ?? { height: 0, width: 0 }\n const x = s * 100\n const y = v * 100\n\n const style: CSSProperties = {\n ...props.style,\n bottom: `calc(${y}% - ${height / 2}px)`,\n left: `calc(${x}% - ${width / 2}px)`,\n position: \"absolute\",\n touchAction: \"none\",\n userSelect: \"none\",\n }\n\n return {\n \"aria-label\": \"Saturation and brightness thumb\",\n \"aria-roledescription\": \"2D slider\",\n bg: thumbColor ?? hsvTo([h, s, v])(),\n ...formControlProps,\n ...props,\n ref: mergeRefs(ref, thumbRef),\n style,\n \"aria-valuemax\": 100,\n \"aria-valuemin\": 0,\n \"aria-valuenow\": s,\n \"aria-valuetext\": `saturation ${s}, brightness ${v}`,\n \"data-active\": dataAttr(isDragging && focusThumbOnChange),\n role: \"slider\",\n tabIndex: isInteractive && focusThumbOnChange ? 0 : undefined,\n onBlur: handlerAll(props.onBlur, rest.onBlur),\n onFocus: handlerAll(props.onFocus, rest.onFocus),\n onKeyDown: handlerAll(props.onKeyDown, onKeyDown),\n }\n },\n [\n thumbSize,\n s,\n v,\n thumbColor,\n h,\n formControlProps,\n isInteractive,\n focusThumbOnChange,\n isDragging,\n onKeyDown,\n rest,\n ],\n )\n\n return {\n overlays,\n value,\n getContainerProps,\n getInnerProps,\n getInputProps,\n getThumbProps,\n getTrackProps,\n }\n}\n\nexport type UseSaturationSliderReturn = ReturnType<typeof useSaturationSlider>\n","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":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,kBAKO;AACP,IAAAA,gBAA4D;;;ACL5D,0BAGO;AACP,oCAAqC;AACrC,4BAA6B;AAC7B,2BAA4B;AAC5B,sBAAwB;AACxB,mBAWO;AACP,mBAA8C;AAqEvC,IAAM,iBAAiB,CAAC;AAAA,EAC7B,qBAAqB;AAAA,EACrB,GAAG;AACL,MAA2B;AACzB,MAAI,CAAC,mBAAoB,OAAM,aAAa;AAE5C,QAAM;AAA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,EAAE,OAAO,IAAI,sBAAsB;AAEzC,UAAM,MAAmB;AAAA,MACvB,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,gBAAgB;AAAA,MAChB,UAAU;AAAA,MACV,KAAK;AAAA,MACL,WAAW;AAAA,MACX,QAAQ;AAAA,MACR,GAAG,OAAO;AAAA,IACZ;AAEA,UAAM,oBAAgB,iCAAiB,QAAQ;AAE/C,UAAM,gBAAgB,cAAc;AAAA,MAAI,CAAC,cACvC,4BAAa,OAAO;AAAA,QAClB,OAAO;AAAA,UACL,OAAO;AAAA,UACP,WAAW;AAAA,UACX,UAAU;AAAA,QACZ;AAAA,QACA,eAAe;AAAA,QACf,WAAW;AAAA,MACb,CAAC;AAAA,IACH;AAEA,WACE;AAAA,MAAC,iBAAG;AAAA,MAAH;AAAA,QACC;AAAA,QACA,eAAW,mBAAG,gCAAgC,SAAS;AAAA,QACvD,OAAO;AAAA,QACN,GAAG;AAAA,QAEH,6CAAe,QAAQ,IACtB,gBAEA,8CAAC,kBAAe,WAAU,sCAAqC;AAAA;AAAA,IAEnE;AAAA,EAEJ;AACF;AAEA,sBAAsB,cAAc;AACpC,sBAAsB,SAAS;","names":["import_utils","max","min","step","value","focusThumbOnChange","isInteractive","props","props","import_core","import_utils","import_react","import_core","import_utils","import_core","import_utils","import_core","import_utils","import_form_control","import_use_controllable_state","import_utils","import_react","a","h","s","channels","value","v","props","import_jsx_runtime","import_core","import_utils","import_core","import_utils","import_jsx_runtime","defaultOverlays","props","import_jsx_runtime","import_core","import_utils","import_jsx_runtime","defaultOverlays","props","import_jsx_runtime","import_core","import_utils","import_react","import_jsx_runtime","import_core","import_utils","import_jsx_runtime","import_core","import_utils","import_form_control","import_use_controllable_state","import_use_latest_ref","import_use_pan_event","import_use_size","import_utils","import_react","defaultOverlays","step","s","v","value","h","focusThumbOnChange","isInteractive","props","import_jsx_runtime","props","import_jsx_runtime","import_core","import_form_control","import_use_controllable_state","import_use_eye_dropper","import_utils","import_react","value","props","import_jsx_runtime"]}
|