@yamada-ui/color-picker 1.4.10-next-20241114172614 → 1.4.10-next-20241117114930
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{chunk-YU3KOEL7.mjs → chunk-AJTCPCFF.mjs} +2 -2
- package/dist/{chunk-RW7HCRPR.mjs → chunk-ASZZSRFB.mjs} +2 -2
- package/dist/{chunk-XCHWCHHP.mjs → chunk-LEN56PPD.mjs} +4 -4
- package/dist/chunk-LEN56PPD.mjs.map +1 -0
- package/dist/{chunk-TED6IK5W.mjs → chunk-QWG3QE6A.mjs} +2 -2
- package/dist/color-picker.js +3 -3
- package/dist/color-picker.js.map +1 -1
- package/dist/color-picker.mjs +4 -4
- package/dist/color-selector.js +3 -3
- package/dist/color-selector.js.map +1 -1
- package/dist/color-selector.mjs +3 -3
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/dist/saturation-slider.js +3 -3
- package/dist/saturation-slider.js.map +1 -1
- package/dist/saturation-slider.mjs +2 -2
- package/dist/use-saturation-slider.js +3 -3
- package/dist/use-saturation-slider.js.map +1 -1
- package/dist/use-saturation-slider.mjs +1 -1
- package/package.json +3 -3
- package/dist/chunk-XCHWCHHP.mjs.map +0 -1
- /package/dist/{chunk-YU3KOEL7.mjs.map → chunk-AJTCPCFF.mjs.map} +0 -0
- /package/dist/{chunk-RW7HCRPR.mjs.map → chunk-ASZZSRFB.mjs.map} +0 -0
- /package/dist/{chunk-TED6IK5W.mjs.map → chunk-QWG3QE6A.mjs.map} +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
useSaturationSlider
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-LEN56PPD.mjs";
|
5
5
|
|
6
6
|
// src/saturation-slider.tsx
|
7
7
|
import {
|
@@ -123,4 +123,4 @@ SaturationSlider.__ui__ = "SaturationSlider";
|
|
123
123
|
export {
|
124
124
|
SaturationSlider
|
125
125
|
};
|
126
|
-
//# sourceMappingURL=chunk-
|
126
|
+
//# sourceMappingURL=chunk-AJTCPCFF.mjs.map
|
@@ -6,7 +6,7 @@ import {
|
|
6
6
|
} from "./chunk-Z2KAER2U.mjs";
|
7
7
|
import {
|
8
8
|
ColorSelector
|
9
|
-
} from "./chunk-
|
9
|
+
} from "./chunk-QWG3QE6A.mjs";
|
10
10
|
import {
|
11
11
|
EyeDropperIcon
|
12
12
|
} from "./chunk-6XIZXZXV.mjs";
|
@@ -256,4 +256,4 @@ ColorPickerEyeDropper.__ui__ = "ColorPickerEyeDropper";
|
|
256
256
|
export {
|
257
257
|
ColorPicker
|
258
258
|
};
|
259
|
-
//# sourceMappingURL=chunk-
|
259
|
+
//# sourceMappingURL=chunk-ASZZSRFB.mjs.map
|
@@ -43,7 +43,7 @@ var useSaturationSlider = ({
|
|
43
43
|
...props
|
44
44
|
}) => {
|
45
45
|
if (!focusThumbOnChange) props.isReadOnly = true;
|
46
|
-
|
46
|
+
const {
|
47
47
|
id,
|
48
48
|
name,
|
49
49
|
defaultValue = [0, 0, 1],
|
@@ -250,8 +250,8 @@ var useSaturationSlider = ({
|
|
250
250
|
style,
|
251
251
|
"aria-valuemax": 100,
|
252
252
|
"aria-valuemin": 0,
|
253
|
-
"aria-valuenow": s,
|
254
|
-
"aria-valuetext": `
|
253
|
+
"aria-valuenow": s * 100,
|
254
|
+
"aria-valuetext": `Saturation ${s * 100}%, Brightness ${v * 100}%`,
|
255
255
|
"data-active": dataAttr(isDragging && focusThumbOnChange),
|
256
256
|
role: "slider",
|
257
257
|
tabIndex: isInteractive && focusThumbOnChange ? 0 : void 0,
|
@@ -288,4 +288,4 @@ var useSaturationSlider = ({
|
|
288
288
|
export {
|
289
289
|
useSaturationSlider
|
290
290
|
};
|
291
|
-
//# sourceMappingURL=chunk-
|
291
|
+
//# sourceMappingURL=chunk-LEN56PPD.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/use-saturation-slider.ts"],"sourcesContent":["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 const {\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 * 100,\n \"aria-valuetext\": `Saturation ${s * 100}%, Brightness ${v * 100}%`,\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"],"mappings":";;;AAGA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,4BAA4B;AACrC,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAC5B,SAAS,eAAe;AACxB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,aAAa,SAAS,QAAQ,gBAAgB;AAKvD,IAAM,kBAAkB,CAAC,eAAmC;AAC1D,MAAI,WAAsB;AAAA,IACxB,CAAC,CAAC,CAAC,OAAO;AAAA,MACR,IAAI,OAAO,CAAC;AAAA,MACZ,SACE;AAAA,IACJ;AAAA,EACF;AAEA,MAAI;AACF,eAAW;AAAA,MACT,GAAG;AAAA,MACH;AAAA,QACE,WAAW;AAAA,MACb;AAAA,IACF;AAEF,SAAO;AACT;A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AAS;AAAA,MAClD;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["step","s","v","value","h","focusThumbOnChange","isInteractive","props"]}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use client"
|
2
2
|
import {
|
3
3
|
SaturationSlider
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-AJTCPCFF.mjs";
|
5
5
|
import {
|
6
6
|
ColorSelectorBody
|
7
7
|
} from "./chunk-XSZZBWND.mjs";
|
@@ -129,4 +129,4 @@ ColorSelector.__ui__ = "ColorSelector";
|
|
129
129
|
export {
|
130
130
|
ColorSelector
|
131
131
|
};
|
132
|
-
//# sourceMappingURL=chunk-
|
132
|
+
//# sourceMappingURL=chunk-QWG3QE6A.mjs.map
|
package/dist/color-picker.js
CHANGED
@@ -1429,7 +1429,7 @@ var useSaturationSlider = ({
|
|
1429
1429
|
...props
|
1430
1430
|
}) => {
|
1431
1431
|
if (!focusThumbOnChange) props.isReadOnly = true;
|
1432
|
-
|
1432
|
+
const {
|
1433
1433
|
id,
|
1434
1434
|
name,
|
1435
1435
|
defaultValue = [0, 0, 1],
|
@@ -1636,8 +1636,8 @@ var useSaturationSlider = ({
|
|
1636
1636
|
style,
|
1637
1637
|
"aria-valuemax": 100,
|
1638
1638
|
"aria-valuemin": 0,
|
1639
|
-
"aria-valuenow": s,
|
1640
|
-
"aria-valuetext": `
|
1639
|
+
"aria-valuenow": s * 100,
|
1640
|
+
"aria-valuetext": `Saturation ${s * 100}%, Brightness ${v * 100}%`,
|
1641
1641
|
"data-active": (0, import_utils11.dataAttr)(isDragging && focusThumbOnChange),
|
1642
1642
|
role: "slider",
|
1643
1643
|
tabIndex: isInteractive && focusThumbOnChange ? 0 : void 0,
|