@gooddata/sdk-ui-kit 11.55.0-alpha.2 → 11.55.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/@ui/@types/icon.d.ts +1 -1
- package/esm/@ui/@types/icon.d.ts.map +1 -1
- package/esm/@ui/UiColorPicker/UiColorPicker.d.ts +6 -0
- package/esm/@ui/UiColorPicker/UiColorPicker.d.ts.map +1 -0
- package/esm/@ui/UiColorPicker/UiColorPicker.js +49 -0
- package/esm/@ui/UiColorPicker/colorValue.d.ts +58 -0
- package/esm/@ui/UiColorPicker/colorValue.d.ts.map +1 -0
- package/esm/@ui/UiColorPicker/colorValue.js +90 -0
- package/esm/@ui/UiColorPicker/components/UiColorSlider.d.ts +19 -0
- package/esm/@ui/UiColorPicker/components/UiColorSlider.d.ts.map +1 -0
- package/esm/@ui/UiColorPicker/components/UiColorSlider.js +35 -0
- package/esm/@ui/UiColorPicker/components/UiColorValueField.d.ts +12 -0
- package/esm/@ui/UiColorPicker/components/UiColorValueField.d.ts.map +1 -0
- package/esm/@ui/UiColorPicker/components/UiColorValueField.js +40 -0
- package/esm/@ui/UiColorPicker/components/UiColorWheel.d.ts +9 -0
- package/esm/@ui/UiColorPicker/components/UiColorWheel.d.ts.map +1 -0
- package/esm/@ui/UiColorPicker/components/UiColorWheel.js +43 -0
- package/esm/@ui/UiColorPicker/types.d.ts +70 -0
- package/esm/@ui/UiColorPicker/types.d.ts.map +1 -0
- package/esm/@ui/UiColorPicker/types.js +2 -0
- package/esm/@ui/UiFloatingElement/UiFloatingElement.d.ts +1 -1
- package/esm/@ui/UiFloatingElement/UiFloatingElement.d.ts.map +1 -1
- package/esm/@ui/UiFloatingElement/UiFloatingElement.js +3 -1
- package/esm/@ui/UiFloatingElement/types.d.ts +19 -0
- package/esm/@ui/UiFloatingElement/types.d.ts.map +1 -1
- package/esm/@ui/UiFloatingElement/types.js +1 -1
- package/esm/@ui/UiFloatingElement/useFloatingPosition.d.ts +1 -1
- package/esm/@ui/UiFloatingElement/useFloatingPosition.d.ts.map +1 -1
- package/esm/@ui/UiFloatingElement/useFloatingPosition.js +17 -4
- package/esm/@ui/UiIcon/icons.d.ts.map +1 -1
- package/esm/@ui/UiIcon/icons.js +27 -0
- package/esm/@ui/hooks/useCloseOnOutsideClick.d.ts.map +1 -1
- package/esm/@ui/hooks/useCloseOnOutsideClick.js +2 -1
- package/esm/@ui/hooks/usePointerTrack.d.ts +23 -0
- package/esm/@ui/hooks/usePointerTrack.d.ts.map +1 -0
- package/esm/@ui/hooks/usePointerTrack.js +45 -0
- package/esm/index.d.ts +3 -0
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +2 -0
- package/esm/sdk-ui-kit.d.ts +126 -3
- package/package.json +12 -12
- package/src/@ui/UiColorPicker/UiColorPicker.scss +120 -0
- package/src/@ui/index.scss +1 -0
- package/styles/css/main.css +81 -0
- package/styles/css/main.css.map +1 -1
package/esm/@ui/@types/icon.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @internal
|
|
3
3
|
*/
|
|
4
|
-
export type IconType = "aiAgent" | "aiAgentDisabled" | "brain" | "brainDisabled" | "check" | "checkCircle" | "certification" | "plus" | "plusCircle" | "sync" | "alert" | "alertPaused" | "close" | "cross" | "edit" | "crossCircle" | "question" | "chevronUp" | "chevronRight" | "chevronDown" | "chevronLeft" | "date" | "navigateUp" | "navigateDown" | "navigateRight" | "navigateLeft" | "download" | "slack" | "expand" | "exclamationCircle" | "infoCircle" | "book" | "visible" | "invisible" | "lock" | "unlock" | "ai" | "aiFill" | "drawer" | "drawerEmpty" | "prohibited" | "dropDown" | "dropRight" | "clock" | "clockPaused" | "questionMark" | "upload" | "expandRectangle" | "file" | "number" | "code" | "user" | "userPlus" | "users" | "magic" | "tab" | "pauseCircle" | "filter" | "timer" | "mail" | "envelope" | "copy" | "rain" | "earth" | "geoCollection" | "geoCollectionUpload" | "minimize" | "shrink" | "copyright" | "ellipsis" | "pencil" | "folder" | "folderSmall" | "folderPlus" | "trash" | "arrowUp" | "arrowRight" | "arrowDown" | "arrowLeft" | "undo" | "redo" | "trendDown" | "trendUp" | "save" | "minus" | "minusCircle" | "percent" | "enter" | "enterRight" | "money" | "ghost" | "warning" | "home" | "settings" | "search" | "university" | "building" | "printer" | "picture" | "visualization" | "dashboard" | "metric" | "fact" | "ldmAttribute" | "ldmKey" | "ldmLabel" | "sharp" | "attribute" | "horn" | "cw" | "ccw" | "table" | "directionColumn" | "directionRow" | "header" | "genai" | "genai2" | "explainai" | "hiddenForAi" | "box" | "ellipsisVertical" | "list" | "drillTo" | "hierarchy" | "history" | "history2" | "thumbsUp" | "thumbsDown" | "send" | "visualizationArea" | "visualizationTable" | "visualizationTreemap" | "visualizationScatter" | "visualizationDonut" | "visualizationHeadline" | "visualizationColumn" | "visualizationLine" | "visualizationPyramid" | "visualizationFunnel" | "visualizationHeatmap" | "visualizationBubble" | "visualizationPie" | "visualizationBar" | "visualizationCombo" | "visualizationBullet" | "visualizationWaterfall" | "visualizationDependencywheel" | "visualizationSankey" | "visualizationPushpin" | "visualizationRepeater" | "visualizationXirr" | "link" | "externalLink" | "click" | "fileXlsx" | "filePptx" | "filePdf" | "fileImage" | "fileCsvFormatted" | "fileCsvRaw" | "aiDocument" | "recommendation" | "streamUp" | "streamDown" | "stream" | "density" | "parameter" | "pin" | "unpin" | "speechBubble" | "pieChart" | "timezone";
|
|
4
|
+
export type IconType = "aiAgent" | "aiAgentDisabled" | "brain" | "brainDisabled" | "check" | "checkCircle" | "certification" | "plus" | "plusCircle" | "sync" | "alert" | "alertPaused" | "close" | "cross" | "edit" | "crossCircle" | "question" | "chevronUp" | "chevronRight" | "chevronDown" | "chevronLeft" | "date" | "navigateUp" | "navigateDown" | "navigateRight" | "navigateLeft" | "download" | "slack" | "expand" | "exclamationCircle" | "infoCircle" | "book" | "visible" | "invisible" | "lock" | "unlock" | "ai" | "aiFill" | "drawer" | "drawerEmpty" | "prohibited" | "dropDown" | "dropRight" | "clock" | "clockPaused" | "questionMark" | "upload" | "expandRectangle" | "file" | "number" | "code" | "user" | "userPlus" | "users" | "magic" | "tab" | "pauseCircle" | "filter" | "timer" | "mail" | "envelope" | "copy" | "rain" | "earth" | "geoCollection" | "geoCollectionUpload" | "minimize" | "shrink" | "copyright" | "ellipsis" | "pencil" | "folder" | "folderSmall" | "folderPlus" | "trash" | "arrowUp" | "arrowRight" | "arrowDown" | "arrowLeft" | "undo" | "redo" | "trendDown" | "trendUp" | "save" | "minus" | "minusCircle" | "percent" | "enter" | "enterRight" | "money" | "ghost" | "warning" | "home" | "settings" | "search" | "university" | "building" | "printer" | "picture" | "visualization" | "dashboard" | "metric" | "fact" | "ldmAttribute" | "ldmKey" | "ldmLabel" | "sharp" | "attribute" | "horn" | "cw" | "ccw" | "table" | "directionColumn" | "directionRow" | "alignLeft" | "alignCenter" | "alignRight" | "alignTop" | "alignMiddle" | "alignBottom" | "imageContain" | "imageCover" | "imageFill" | "header" | "genai" | "genai2" | "explainai" | "hiddenForAi" | "box" | "ellipsisVertical" | "list" | "drillTo" | "hierarchy" | "history" | "history2" | "thumbsUp" | "thumbsDown" | "send" | "visualizationArea" | "visualizationTable" | "visualizationTreemap" | "visualizationScatter" | "visualizationDonut" | "visualizationHeadline" | "visualizationColumn" | "visualizationLine" | "visualizationPyramid" | "visualizationFunnel" | "visualizationHeatmap" | "visualizationBubble" | "visualizationPie" | "visualizationBar" | "visualizationCombo" | "visualizationBullet" | "visualizationWaterfall" | "visualizationDependencywheel" | "visualizationSankey" | "visualizationPushpin" | "visualizationRepeater" | "visualizationXirr" | "link" | "externalLink" | "click" | "fileXlsx" | "filePptx" | "filePdf" | "fileImage" | "fileCsvFormatted" | "fileCsvRaw" | "aiDocument" | "recommendation" | "streamUp" | "streamDown" | "stream" | "density" | "parameter" | "pin" | "unpin" | "speechBubble" | "pieChart" | "timezone";
|
|
5
5
|
//# sourceMappingURL=icon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/@ui/@types/icon.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,QAAQ,GACd,SAAS,GACT,iBAAiB,GACjB,OAAO,GACP,eAAe,GACf,OAAO,GACP,aAAa,GACb,eAAe,GACf,MAAM,GACN,YAAY,GACZ,MAAM,GACN,OAAO,GACP,aAAa,GACb,OAAO,GACP,OAAO,GACP,MAAM,GACN,aAAa,GACb,UAAU,GACV,WAAW,GACX,cAAc,GACd,aAAa,GACb,aAAa,GACb,MAAM,GACN,YAAY,GACZ,cAAc,GACd,eAAe,GACf,cAAc,GACd,UAAU,GACV,OAAO,GACP,QAAQ,GACR,mBAAmB,GACnB,YAAY,GACZ,MAAM,GACN,SAAS,GACT,WAAW,GACX,MAAM,GACN,QAAQ,GACR,IAAI,GACJ,QAAQ,GACR,QAAQ,GACR,aAAa,GACb,YAAY,GACZ,UAAU,GACV,WAAW,GACX,OAAO,GACP,aAAa,GACb,cAAc,GACd,QAAQ,GACR,iBAAiB,GACjB,MAAM,GACN,QAAQ,GACR,MAAM,GACN,MAAM,GACN,UAAU,GACV,OAAO,GACP,OAAO,GACP,KAAK,GACL,aAAa,GACb,QAAQ,GACR,OAAO,GACP,MAAM,GACN,UAAU,GACV,MAAM,GACN,MAAM,GACN,OAAO,GACP,eAAe,GACf,qBAAqB,GACrB,UAAU,GACV,QAAQ,GACR,WAAW,GACX,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,aAAa,GACb,YAAY,GACZ,OAAO,GACP,SAAS,GACT,YAAY,GACZ,WAAW,GACX,WAAW,GACX,MAAM,GACN,MAAM,GACN,WAAW,GACX,SAAS,GACT,MAAM,GACN,OAAO,GACP,aAAa,GACb,SAAS,GACT,OAAO,GACP,YAAY,GACZ,OAAO,GACP,OAAO,GACP,SAAS,GACT,MAAM,GACN,UAAU,GACV,QAAQ,GACR,YAAY,GACZ,UAAU,GACV,SAAS,GACT,SAAS,GACT,eAAe,GACf,WAAW,GACX,QAAQ,GACR,MAAM,GACN,cAAc,GACd,QAAQ,GACR,UAAU,GACV,OAAO,GACP,WAAW,GACX,MAAM,GACN,IAAI,GACJ,KAAK,GACL,OAAO,GACP,iBAAiB,GACjB,cAAc,GACd,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,WAAW,GACX,aAAa,GACb,KAAK,GACL,kBAAkB,GAClB,MAAM,GACN,SAAS,GACT,WAAW,GACX,SAAS,GACT,UAAU,GACV,UAAU,GACV,YAAY,GACZ,MAAM,GACN,mBAAmB,GACnB,oBAAoB,GACpB,sBAAsB,GACtB,sBAAsB,GACtB,oBAAoB,GACpB,uBAAuB,GACvB,qBAAqB,GACrB,mBAAmB,GACnB,sBAAsB,GACtB,qBAAqB,GACrB,sBAAsB,GACtB,qBAAqB,GACrB,kBAAkB,GAClB,kBAAkB,GAClB,oBAAoB,GACpB,qBAAqB,GACrB,wBAAwB,GACxB,8BAA8B,GAC9B,qBAAqB,GACrB,sBAAsB,GACtB,uBAAuB,GACvB,mBAAmB,GACnB,MAAM,GACN,cAAc,GACd,OAAO,GACP,UAAU,GACV,UAAU,GACV,SAAS,GACT,WAAW,GACX,kBAAkB,GAClB,YAAY,GACZ,YAAY,GACZ,gBAAgB,GAChB,UAAU,GACV,YAAY,GACZ,QAAQ,GACR,SAAS,GACT,WAAW,GACX,KAAK,GACL,OAAO,GACP,cAAc,GACd,UAAU,GACV,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/@ui/@types/icon.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,QAAQ,GACd,SAAS,GACT,iBAAiB,GACjB,OAAO,GACP,eAAe,GACf,OAAO,GACP,aAAa,GACb,eAAe,GACf,MAAM,GACN,YAAY,GACZ,MAAM,GACN,OAAO,GACP,aAAa,GACb,OAAO,GACP,OAAO,GACP,MAAM,GACN,aAA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QAAQ,GACR,WAAW,GACX,aAAa,GACb,KAAK,GACL,kBAAkB,GAClB,MAAM,GACN,SAAS,GACT,WAAW,GACX,SAAS,GACT,UAAU,GACV,UAAU,GACV,YAAY,GACZ,MAAM,GACN,mBAAmB,GACnB,oBAAoB,GACpB,sBAAsB,GACtB,sBAAsB,GACtB,oBAAoB,GACpB,uBAAuB,GACvB,qBAAqB,GACrB,mBAAmB,GACnB,sBAAsB,GACtB,qBAAqB,GACrB,sBAAsB,GACtB,qBAAqB,GACrB,kBAAkB,GAClB,kBAAkB,GAClB,oBAAoB,GACpB,qBAAqB,GACrB,wBAAwB,GACxB,8BAA8B,GAC9B,qBAAqB,GACrB,sBAAsB,GACtB,uBAAuB,GACvB,mBAAmB,GACnB,MAAM,GACN,cAAc,GACd,OAAO,GACP,UAAU,GACV,UAAU,GACV,SAAS,GACT,WAAW,GACX,kBAAkB,GAClB,YAAY,GACZ,YAAY,GACZ,gBAAgB,GAChB,UAAU,GACV,YAAY,GACZ,QAAQ,GACR,SAAS,GACT,WAAW,GACX,KAAK,GACL,OAAO,GACP,cAAc,GACd,UAAU,GACV,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UiColorPicker.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiColorPicker/UiColorPicker.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAMtD;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,mBAAmB,2CAqFvD"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// (C) 2007-2026 GoodData Corporation
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { useIntl } from "react-intl";
|
|
5
|
+
import { UiButton } from "../UiButton/UiButton.js";
|
|
6
|
+
import { areColorPickerValuesEqual, colorPickerValueFromRgb, colorPickerValueToRgba, formatColorPickerValue, } from "./colorValue.js";
|
|
7
|
+
import { UiColorSlider } from "./components/UiColorSlider.js";
|
|
8
|
+
import { UiColorValueField } from "./components/UiColorValueField.js";
|
|
9
|
+
import { UiColorWheel } from "./components/UiColorWheel.js";
|
|
10
|
+
function hslTrack(value, lightness) {
|
|
11
|
+
return `hsl(${Math.round(value.h)}, ${Math.round(value.s * 100)}%, ${Math.round(lightness * 100)}%)`;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export function UiColorPicker(props) {
|
|
17
|
+
const { initialRgbColor, supportsAlpha = false, onChange, onSubmit } = props;
|
|
18
|
+
const intl = useIntl();
|
|
19
|
+
// Without a control to change it, an opacity would be one the caller cannot see and its consumer
|
|
20
|
+
// drops on the way out, so it is not carried at all.
|
|
21
|
+
const opaque = (color) => supportsAlpha ? color : { ...color, alpha: 1 };
|
|
22
|
+
const initial = opaque(colorPickerValueFromRgb(initialRgbColor));
|
|
23
|
+
const given = formatColorPickerValue(initial, "rgb");
|
|
24
|
+
const [notation, setNotation] = useState("hex");
|
|
25
|
+
// A color set from outside is followed - see IUiColorPickerBaseProps.initialRgbColor. The color
|
|
26
|
+
// and the one it was read from are held together so a change of one cannot be read against the
|
|
27
|
+
// other, and compared as text because the prop is a fresh object every render.
|
|
28
|
+
const [picked, setPicked] = useState({
|
|
29
|
+
value: initial,
|
|
30
|
+
given,
|
|
31
|
+
});
|
|
32
|
+
if (picked.given !== given) {
|
|
33
|
+
setPicked({ value: initial, given });
|
|
34
|
+
}
|
|
35
|
+
const value = picked.value;
|
|
36
|
+
const change = (next) => {
|
|
37
|
+
const kept = opaque(next);
|
|
38
|
+
setPicked({ value: kept, given });
|
|
39
|
+
onChange?.(colorPickerValueToRgba(kept));
|
|
40
|
+
};
|
|
41
|
+
const solid = hslTrack(value, value.l);
|
|
42
|
+
const current = formatColorPickerValue(value, "hsl");
|
|
43
|
+
return (_jsxs("div", { className: "gd-ui-kit-color-picker", "aria-label": "Color picker", children: [
|
|
44
|
+
_jsx(UiColorWheel, { value: value, onChange: change, label: intl.formatMessage({ id: "gs.ui-color-picker.wheel" }) }), _jsx(UiColorSlider, { label: intl.formatMessage({ id: "gs.ui-color-picker.lightness" }), value: value.l, onChange: (l) => change({ ...value, l }), trackStyle: {
|
|
45
|
+
background: `linear-gradient(to right, ${hslTrack(value, 0)}, ${hslTrack(value, 0.5)}, ${hslTrack(value, 1)})`,
|
|
46
|
+
}, thumbColor: solid, valueText: current }), supportsAlpha ? (_jsx(UiColorSlider, { label: intl.formatMessage({ id: "gs.ui-color-picker.opacity" }), value: value.alpha, onChange: (alpha) => change({ ...value, alpha }), trackStyle: { background: `linear-gradient(to right, transparent, ${solid})` }, thumbColor: current, valueText: `${Math.round(value.alpha * 100)}%` })) : null, _jsx(UiColorValueField, { value: value, onChange: change, notation: notation, onNotationChange: setNotation, label: intl.formatMessage({ id: "gs.ui-color-picker.value" }), notationLabel: intl.formatMessage({ id: "gs.ui-color-picker.notation" }) }), onSubmit ? (_jsxs("div", { className: "gd-ui-kit-color-picker__actions", children: [
|
|
47
|
+
_jsx(UiButton, { variant: "secondary", label: intl.formatMessage({ id: "gs.ui-color-picker.cancelButton" }), onClick: props.onCancel }), _jsx(UiButton, { variant: "primary", label: intl.formatMessage({ id: "gs.ui-color-picker.okButton" }), isDisabled: areColorPickerValuesEqual(initial, value), onClick: () => onSubmit(colorPickerValueToRgba(value)) })
|
|
48
|
+
] })) : null] }));
|
|
49
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type ColorFormats } from "tinycolor2";
|
|
2
|
+
export type ColorNotation = "hex" | "rgb" | "hsl";
|
|
3
|
+
export declare const COLOR_NOTATIONS: readonly ColorNotation[];
|
|
4
|
+
/**
|
|
5
|
+
* The picker's working color.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Held as hue, saturation and lightness because that is what the controls address. Kept as channels
|
|
9
|
+
* instead, turning the wheel at an extreme lightness would not come back to the hue it started from:
|
|
10
|
+
* every gray, black and white is the same hue once written as channels.
|
|
11
|
+
*/
|
|
12
|
+
export interface IColorPickerValue extends ColorFormats.HSL {
|
|
13
|
+
alpha: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A point on the wheel, as a fraction of its radius from the middle, in screen orientation.
|
|
17
|
+
*/
|
|
18
|
+
export interface IColorWheelPoint {
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
}
|
|
22
|
+
export declare function colorPickerValueFromRgb(rgb: ColorFormats.RGB | ColorFormats.RGBA): IColorPickerValue;
|
|
23
|
+
export declare function colorPickerValueToRgba(value: IColorPickerValue): ColorFormats.RGBA;
|
|
24
|
+
export declare function areColorPickerValuesEqual(left: IColorPickerValue, right: IColorPickerValue): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Writes the value in the given notation.
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* Opacity is written only where there is some, so an opaque color reads as the plain three-channel
|
|
30
|
+
* form.
|
|
31
|
+
*/
|
|
32
|
+
export declare function formatColorPickerValue(value: IColorPickerValue, notation: ColorNotation): string;
|
|
33
|
+
/**
|
|
34
|
+
* Whether text can be applied to the document as it stands, mid-typing.
|
|
35
|
+
*
|
|
36
|
+
* @remarks
|
|
37
|
+
* Text is applied as it is typed, so parsing is not enough: a parser reads three hex digits as a
|
|
38
|
+
* color, a fourth as opacity, and `hsl(210, 53%, 1` — closed or not — as white.
|
|
39
|
+
*/
|
|
40
|
+
export declare function canApplyColorPickerValueWhileTyping(text: string): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Reads a color from text.
|
|
43
|
+
*
|
|
44
|
+
* @remarks
|
|
45
|
+
* A gray states no hue, and a parser reports 0 for it, so the current hue is carried over. Taken
|
|
46
|
+
* literally the wheel would swing to red the moment someone typed a gray.
|
|
47
|
+
*/
|
|
48
|
+
export declare function parseColorPickerValue(text: string, current: IColorPickerValue): IColorPickerValue | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Reads a point on the wheel as a hue and a saturation.
|
|
51
|
+
*
|
|
52
|
+
* @remarks
|
|
53
|
+
* Past the rim the saturation clamps rather than the gesture being dropped, which keeps a drag live
|
|
54
|
+
* when the pointer leaves the wheel.
|
|
55
|
+
*/
|
|
56
|
+
export declare function colorPickerValueFromWheel(point: IColorWheelPoint, current: IColorPickerValue): IColorPickerValue;
|
|
57
|
+
export declare function colorPickerValueToWheel(value: IColorPickerValue): IColorWheelPoint;
|
|
58
|
+
//# sourceMappingURL=colorValue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colorValue.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiColorPicker/colorValue.ts"],"names":[],"mappings":"AAEA,OAAkB,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1D,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAElD,eAAO,MAAM,eAAe,EAAE,SAAS,aAAa,EAA0B,CAAC;AAE/E;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAkB,SAAQ,YAAY,CAAC,GAAG;IACvD,KAAK,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACb;AAUD,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,YAAY,CAAC,GAAG,GAAG,YAAY,CAAC,IAAI,GAAG,iBAAiB,CAGpG;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,iBAAiB,GAAG,YAAY,CAAC,IAAI,CAGlF;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAIpG;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,aAAa,GAAG,MAAM,CAUhG;AAOD;;;;;;GAMG;AACH,wBAAgB,mCAAmC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGzE;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACjC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,iBAAiB,GAC3B,iBAAiB,GAAG,SAAS,CAO/B;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACrC,KAAK,EAAE,gBAAgB,EACvB,OAAO,EAAE,iBAAiB,GAC3B,iBAAiB,CAQnB;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,iBAAiB,GAAG,gBAAgB,CAGlF"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
import tinycolor from "tinycolor2";
|
|
3
|
+
export const COLOR_NOTATIONS = ["hex", "rgb", "hsl"];
|
|
4
|
+
function clamp(value, min, max) {
|
|
5
|
+
return Math.min(max, Math.max(min, value));
|
|
6
|
+
}
|
|
7
|
+
function toTinyColor(value) {
|
|
8
|
+
return tinycolor({ h: value.h, s: value.s, l: value.l }).setAlpha(value.alpha);
|
|
9
|
+
}
|
|
10
|
+
export function colorPickerValueFromRgb(rgb) {
|
|
11
|
+
const { h, s, l, a } = tinycolor(rgb).toHsl();
|
|
12
|
+
return { h, s, l, alpha: a };
|
|
13
|
+
}
|
|
14
|
+
export function colorPickerValueToRgba(value) {
|
|
15
|
+
const { r, g, b } = toTinyColor(value).toRgb();
|
|
16
|
+
return { r, g, b, a: value.alpha };
|
|
17
|
+
}
|
|
18
|
+
export function areColorPickerValuesEqual(left, right) {
|
|
19
|
+
const a = colorPickerValueToRgba(left);
|
|
20
|
+
const b = colorPickerValueToRgba(right);
|
|
21
|
+
return a.r === b.r && a.g === b.g && a.b === b.b && a.a === b.a;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Writes the value in the given notation.
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* Opacity is written only where there is some, so an opaque color reads as the plain three-channel
|
|
28
|
+
* form.
|
|
29
|
+
*/
|
|
30
|
+
export function formatColorPickerValue(value, notation) {
|
|
31
|
+
const color = toTinyColor(value);
|
|
32
|
+
switch (notation) {
|
|
33
|
+
case "hex":
|
|
34
|
+
return value.alpha === 1 ? color.toHexString() : color.toHex8String();
|
|
35
|
+
case "rgb":
|
|
36
|
+
return color.toRgbString();
|
|
37
|
+
case "hsl":
|
|
38
|
+
return color.toHslString();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const APPLICABLE_WHILE_TYPING = [
|
|
42
|
+
/^#?(?:[0-9a-f]{6}|[0-9a-f]{8})$/i,
|
|
43
|
+
/^(?:rgb|hsl)a?\([^()]*\)$/i,
|
|
44
|
+
];
|
|
45
|
+
/**
|
|
46
|
+
* Whether text can be applied to the document as it stands, mid-typing.
|
|
47
|
+
*
|
|
48
|
+
* @remarks
|
|
49
|
+
* Text is applied as it is typed, so parsing is not enough: a parser reads three hex digits as a
|
|
50
|
+
* color, a fourth as opacity, and `hsl(210, 53%, 1` — closed or not — as white.
|
|
51
|
+
*/
|
|
52
|
+
export function canApplyColorPickerValueWhileTyping(text) {
|
|
53
|
+
const trimmed = text.trim();
|
|
54
|
+
return APPLICABLE_WHILE_TYPING.some((shape) => shape.test(trimmed));
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Reads a color from text.
|
|
58
|
+
*
|
|
59
|
+
* @remarks
|
|
60
|
+
* A gray states no hue, and a parser reports 0 for it, so the current hue is carried over. Taken
|
|
61
|
+
* literally the wheel would swing to red the moment someone typed a gray.
|
|
62
|
+
*/
|
|
63
|
+
export function parseColorPickerValue(text, current) {
|
|
64
|
+
const color = tinycolor(text.trim());
|
|
65
|
+
if (!color.isValid()) {
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
const { h, s, l, a } = color.toHsl();
|
|
69
|
+
return { h: s === 0 ? current.h : h, s, l, alpha: a };
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Reads a point on the wheel as a hue and a saturation.
|
|
73
|
+
*
|
|
74
|
+
* @remarks
|
|
75
|
+
* Past the rim the saturation clamps rather than the gesture being dropped, which keeps a drag live
|
|
76
|
+
* when the pointer leaves the wheel.
|
|
77
|
+
*/
|
|
78
|
+
export function colorPickerValueFromWheel(point, current) {
|
|
79
|
+
const saturation = clamp(Math.hypot(point.x, point.y), 0, 1);
|
|
80
|
+
// The exact middle points in no direction, so there is no hue to read from it.
|
|
81
|
+
if (saturation === 0) {
|
|
82
|
+
return { ...current, s: 0 };
|
|
83
|
+
}
|
|
84
|
+
const angle = (Math.atan2(point.y, point.x) * 180) / Math.PI;
|
|
85
|
+
return { ...current, h: (angle + 360) % 360, s: saturation };
|
|
86
|
+
}
|
|
87
|
+
export function colorPickerValueToWheel(value) {
|
|
88
|
+
const radians = (value.h * Math.PI) / 180;
|
|
89
|
+
return { x: Math.cos(radians) * value.s, y: Math.sin(radians) * value.s };
|
|
90
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type CSSProperties } from "react";
|
|
2
|
+
interface IColorSliderProps {
|
|
3
|
+
label: string;
|
|
4
|
+
/**
|
|
5
|
+
* Position along the track, from 0 at the left to 1 at the right.
|
|
6
|
+
*/
|
|
7
|
+
value: number;
|
|
8
|
+
onChange: (value: number) => void;
|
|
9
|
+
trackStyle: CSSProperties;
|
|
10
|
+
thumbColor: string;
|
|
11
|
+
/**
|
|
12
|
+
* The value as it should be read out: the fraction on its own says nothing about which channel
|
|
13
|
+
* this is.
|
|
14
|
+
*/
|
|
15
|
+
valueText: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function UiColorSlider({ label, value, onChange, trackStyle, thumbColor, valueText }: IColorSliderProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=UiColorSlider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UiColorSlider.d.ts","sourceRoot":"","sources":["../../../../src/@ui/UiColorPicker/components/UiColorSlider.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAsB,MAAM,OAAO,CAAC;AAM/D,UAAU,iBAAiB;IACvB,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAElC,UAAU,EAAE,aAAa,CAAC;IAE1B,UAAU,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,aAAa,CAAC,EAC1B,KAAK,EACL,KAAK,EACL,QAAQ,EACR,UAAU,EACV,UAAU,EACV,SAAS,EACZ,EAAE,iBAAiB,2CAoDnB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { usePointerTrack } from "../../hooks/usePointerTrack.js";
|
|
3
|
+
const KEY_STEP = 0.02;
|
|
4
|
+
export function UiColorSlider({ label, value, onChange, trackStyle, thumbColor, valueText, }) {
|
|
5
|
+
const track = usePointerTrack((event) => {
|
|
6
|
+
const rect = event.currentTarget.getBoundingClientRect();
|
|
7
|
+
const position = (event.clientX - rect.left) / rect.width;
|
|
8
|
+
onChange(Math.min(1, Math.max(0, position)));
|
|
9
|
+
});
|
|
10
|
+
const step = (delta) => onChange(Math.min(1, Math.max(0, value + delta)));
|
|
11
|
+
const onKeyDown = (event) => {
|
|
12
|
+
const moves = {
|
|
13
|
+
ArrowLeft: () => step(-KEY_STEP),
|
|
14
|
+
ArrowDown: () => step(-KEY_STEP),
|
|
15
|
+
ArrowRight: () => step(KEY_STEP),
|
|
16
|
+
ArrowUp: () => step(KEY_STEP),
|
|
17
|
+
Home: () => onChange(0),
|
|
18
|
+
End: () => onChange(1),
|
|
19
|
+
};
|
|
20
|
+
const move = moves[event.key];
|
|
21
|
+
if (move) {
|
|
22
|
+
event.preventDefault();
|
|
23
|
+
move();
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
return (_jsxs("div", { className: "gd-ui-kit-color-picker__slider", role: "slider", tabIndex: 0, "aria-label": label, "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": Math.round(value * 100), "aria-valuetext": valueText, onKeyDown: onKeyDown, ...track, children: [
|
|
27
|
+
_jsx("div", { className: "gd-ui-kit-color-picker__slider-track", style: trackStyle }), _jsx("div", { className: "gd-ui-kit-color-picker__slider-thumb",
|
|
28
|
+
// The stylesheet turns the fraction into a position, so the handle's own size is
|
|
29
|
+
// accounted for in the one place that states it.
|
|
30
|
+
style: {
|
|
31
|
+
"--color-picker-slider-position": value,
|
|
32
|
+
backgroundColor: thumbColor,
|
|
33
|
+
} })
|
|
34
|
+
] }));
|
|
35
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ColorNotation, type IColorPickerValue } from "../colorValue.js";
|
|
2
|
+
interface IColorValueFieldProps {
|
|
3
|
+
value: IColorPickerValue;
|
|
4
|
+
onChange: (value: IColorPickerValue) => void;
|
|
5
|
+
notation: ColorNotation;
|
|
6
|
+
onNotationChange: (notation: ColorNotation) => void;
|
|
7
|
+
label: string;
|
|
8
|
+
notationLabel: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function UiColorValueField({ value, onChange, notation, onNotationChange, label, notationLabel }: IColorValueFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=UiColorValueField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UiColorValueField.d.ts","sourceRoot":"","sources":["../../../../src/@ui/UiColorPicker/components/UiColorValueField.tsx"],"names":[],"mappings":"AAQA,OAAO,EAEH,KAAK,aAAa,EAClB,KAAK,iBAAiB,EAIzB,MAAM,kBAAkB,CAAC;AAE1B,UAAU,qBAAqB;IAC3B,KAAK,EAAE,iBAAiB,CAAC;IACzB,QAAQ,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC7C,QAAQ,EAAE,aAAa,CAAC;IACxB,gBAAgB,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,iBAAiB,CAAC,EAC9B,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,KAAK,EACL,aAAa,EAChB,EAAE,qBAAqB,2CAyEvB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// (C) 2026 GoodData Corporation
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { UiButton } from "../../UiButton/UiButton.js";
|
|
5
|
+
import { UiDropdown } from "../../UiDropdown/UiDropdown.js";
|
|
6
|
+
import { UiListbox } from "../../UiListbox/UiListbox.js";
|
|
7
|
+
import { UiTextInput } from "../../UiTextInput/UiTextInput.js";
|
|
8
|
+
import { COLOR_NOTATIONS, canApplyColorPickerValueWhileTyping, formatColorPickerValue, parseColorPickerValue, } from "../colorValue.js";
|
|
9
|
+
export function UiColorValueField({ value, onChange, notation, onNotationChange, label, notationLabel, }) {
|
|
10
|
+
// Held only while the field is being typed into: rendering the value it last parsed to would
|
|
11
|
+
// fight the typing character by character.
|
|
12
|
+
const [draft, setDraft] = useState();
|
|
13
|
+
const type = (text) => {
|
|
14
|
+
setDraft(text);
|
|
15
|
+
const parsed = parseColorPickerValue(text, value);
|
|
16
|
+
if (parsed && canApplyColorPickerValueWhileTyping(text)) {
|
|
17
|
+
onChange(parsed);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
// What was only typed through is applied once the typing stops.
|
|
21
|
+
const settle = () => {
|
|
22
|
+
const parsed = draft === undefined ? undefined : parseColorPickerValue(draft, value);
|
|
23
|
+
if (parsed) {
|
|
24
|
+
onChange(parsed);
|
|
25
|
+
}
|
|
26
|
+
setDraft(undefined);
|
|
27
|
+
};
|
|
28
|
+
const items = COLOR_NOTATIONS.map((option) => ({
|
|
29
|
+
type: "interactive",
|
|
30
|
+
id: option,
|
|
31
|
+
stringTitle: option.toUpperCase(),
|
|
32
|
+
data: option,
|
|
33
|
+
}));
|
|
34
|
+
return (_jsxs("div", { className: "gd-ui-kit-color-picker__value", children: [
|
|
35
|
+
_jsx(UiTextInput, { value: draft ?? formatColorPickerValue(value, notation), onChange: type, onBlur: settle, onKeyDown: (event) => {
|
|
36
|
+
if (event.key === "Enter") {
|
|
37
|
+
settle();
|
|
38
|
+
}
|
|
39
|
+
}, isError: draft !== undefined && parseColorPickerValue(draft, value) === undefined, accessibilityConfig: { ariaLabel: label }, dataTestId: "ui-color-picker-value" }), _jsx(UiDropdown, { closeOnEscape: true, width: "auto", accessibilityConfig: { triggerRole: "combobox", popupRole: "listbox" }, renderButton: ({ ref, isOpen, toggleDropdown, ariaAttributes }) => (_jsx(UiButton, { ref: ref, size: "small", variant: "secondary", label: notation.toUpperCase(), iconAfter: isOpen ? "navigateUp" : "navigateDown", disableIconAnimation: true, onClick: toggleDropdown, accessibilityConfig: { ariaLabel: notationLabel, ...ariaAttributes } })), renderBody: ({ closeDropdown, ariaAttributes }) => (_jsx(UiListbox, { items: items, selectedItemId: notation, ariaAttributes: { ...ariaAttributes, "aria-label": notationLabel }, isCompact: true, onSelect: (item) => onNotationChange(item.data), onClose: closeDropdown })) })] }));
|
|
40
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type IColorPickerValue } from "../colorValue.js";
|
|
2
|
+
interface IColorWheelProps {
|
|
3
|
+
value: IColorPickerValue;
|
|
4
|
+
onChange: (value: IColorPickerValue) => void;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function UiColorWheel({ value, onChange, label }: IColorWheelProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=UiColorWheel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UiColorWheel.d.ts","sourceRoot":"","sources":["../../../../src/@ui/UiColorPicker/components/UiColorWheel.tsx"],"names":[],"mappings":"AAKA,OAAO,EACH,KAAK,iBAAiB,EAIzB,MAAM,kBAAkB,CAAC;AAK1B,UAAU,gBAAgB;IACtB,KAAK,EAAE,iBAAiB,CAAC;IACzB,QAAQ,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC7C,KAAK,EAAE,MAAM,CAAC;CACjB;AAKD,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,gBAAgB,2CA+DxE"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { usePointerTrack } from "../../hooks/usePointerTrack.js";
|
|
3
|
+
import { colorPickerValueFromWheel, colorPickerValueToWheel, formatColorPickerValue, } from "../colorValue.js";
|
|
4
|
+
const HUE_KEY_STEP = 2;
|
|
5
|
+
const SATURATION_KEY_STEP = 0.02;
|
|
6
|
+
// Hue is the angle and saturation the distance from the middle; see `.gd-ui-kit-color-picker__wheel` for how the
|
|
7
|
+
// paint is held to the same convention.
|
|
8
|
+
export function UiColorWheel({ value, onChange, label }) {
|
|
9
|
+
const track = usePointerTrack((event) => {
|
|
10
|
+
const rect = event.currentTarget.getBoundingClientRect();
|
|
11
|
+
const radius = rect.width / 2;
|
|
12
|
+
onChange(colorPickerValueFromWheel({
|
|
13
|
+
x: (event.clientX - rect.left - radius) / radius,
|
|
14
|
+
y: (event.clientY - rect.top - radius) / radius,
|
|
15
|
+
}, value));
|
|
16
|
+
});
|
|
17
|
+
const step = (hue, saturation) => onChange({
|
|
18
|
+
...value,
|
|
19
|
+
h: (value.h + hue + 360) % 360,
|
|
20
|
+
s: Math.min(1, Math.max(0, value.s + saturation)),
|
|
21
|
+
});
|
|
22
|
+
const onKeyDown = (event) => {
|
|
23
|
+
const moves = {
|
|
24
|
+
ArrowLeft: () => step(-HUE_KEY_STEP, 0),
|
|
25
|
+
ArrowRight: () => step(HUE_KEY_STEP, 0),
|
|
26
|
+
ArrowUp: () => step(0, SATURATION_KEY_STEP),
|
|
27
|
+
ArrowDown: () => step(0, -SATURATION_KEY_STEP),
|
|
28
|
+
Home: () => onChange({ ...value, s: 0 }),
|
|
29
|
+
End: () => onChange({ ...value, s: 1 }),
|
|
30
|
+
};
|
|
31
|
+
const move = moves[event.key];
|
|
32
|
+
if (move) {
|
|
33
|
+
event.preventDefault();
|
|
34
|
+
move();
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const point = colorPickerValueToWheel(value);
|
|
38
|
+
return (_jsx("div", { className: "gd-ui-kit-color-picker__wheel", role: "slider", tabIndex: 0, "aria-label": label, "aria-valuemin": 0, "aria-valuemax": 360, "aria-valuenow": Math.round(value.h), "aria-valuetext": formatColorPickerValue(value, "hsl"), onKeyDown: onKeyDown, ...track, children: _jsx("div", { className: "gd-ui-kit-color-picker__wheel-thumb", style: {
|
|
39
|
+
left: `${((point.x + 1) / 2) * 100}%`,
|
|
40
|
+
top: `${((point.y + 1) / 2) * 100}%`,
|
|
41
|
+
backgroundColor: formatColorPickerValue(value, "hsl"),
|
|
42
|
+
} }) }));
|
|
43
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Channels, each 0 to 255.
|
|
3
|
+
*
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export interface IUiColorPickerRgb {
|
|
7
|
+
r: number;
|
|
8
|
+
g: number;
|
|
9
|
+
b: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Channels, each 0 to 255, with opacity from 0 (transparent) to 1 (opaque).
|
|
13
|
+
*
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export interface IUiColorPickerRgba extends IUiColorPickerRgb {
|
|
17
|
+
a: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* What every picker takes, whichever way it reports the color it gathers.
|
|
21
|
+
*
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
export interface IUiColorPickerBaseProps {
|
|
25
|
+
/**
|
|
26
|
+
* The color to start from. The picker follows it when it changes.
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* Never feed the picker the color it just reported: read in again it loses the hue that a gray,
|
|
30
|
+
* black or white cannot carry, and the handle jumps off the wheel mid-drag. A caller applying
|
|
31
|
+
* changes live should hold the color it seeds the picker with apart from the one it stores.
|
|
32
|
+
*/
|
|
33
|
+
initialRgbColor: IUiColorPickerRgb | IUiColorPickerRgba;
|
|
34
|
+
/**
|
|
35
|
+
* Adds an opacity control and lets the reported color carry one.
|
|
36
|
+
*
|
|
37
|
+
* @remarks
|
|
38
|
+
* Off by default: a consumer that stores a color without an opacity would drop the one the user
|
|
39
|
+
* had set, without saying so.
|
|
40
|
+
*/
|
|
41
|
+
supportsAlpha?: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* A picker that gathers a color and reports it once, when confirmed.
|
|
45
|
+
*
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
export interface IUiColorPickerCommitProps extends IUiColorPickerBaseProps {
|
|
49
|
+
onSubmit: (color: IUiColorPickerRgba) => void;
|
|
50
|
+
/**
|
|
51
|
+
* Dismisses the picker, leaving the color as it was.
|
|
52
|
+
*/
|
|
53
|
+
onCancel: () => void;
|
|
54
|
+
onChange?: never;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* A picker that reports every change as it is made, and so has nothing to confirm or take back: the
|
|
58
|
+
* color is already applied, and going back from it is the caller's to offer.
|
|
59
|
+
*
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
|
+
export interface IUiColorPickerLiveProps extends IUiColorPickerBaseProps {
|
|
63
|
+
onChange: (color: IUiColorPickerRgba) => void;
|
|
64
|
+
onSubmit?: never;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* @internal
|
|
68
|
+
*/
|
|
69
|
+
export type IUiColorPickerProps = IUiColorPickerCommitProps | IUiColorPickerLiveProps;
|
|
70
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiColorPicker/types.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAC9B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAmB,SAAQ,iBAAiB;IACzD,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACpC;;;;;;;OAOG;IACH,eAAe,EAAE,iBAAiB,GAAG,kBAAkB,CAAC;IAExD;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;;GAIG;AACH,MAAM,WAAW,yBAA0B,SAAQ,uBAAuB;IACtE,QAAQ,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAE9C;;OAEG;IACH,QAAQ,EAAE,MAAM,IAAI,CAAC;IAErB,QAAQ,CAAC,EAAE,KAAK,CAAC;CACpB;AAED;;;;;GAKG;AACH,MAAM,WAAW,uBAAwB,SAAQ,uBAAuB;IACpE,QAAQ,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAE9C,QAAQ,CAAC,EAAE,KAAK,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,yBAAyB,GAAG,uBAAuB,CAAC"}
|
|
@@ -16,5 +16,5 @@ import { type IUiFloatingElementProps } from "./types.js";
|
|
|
16
16
|
*
|
|
17
17
|
* @internal
|
|
18
18
|
*/
|
|
19
|
-
export declare function UiFloatingElement({ children, anchor, isOpen, onClose, placement, alignPoints, strategy, offset, autoFlip, closeOnOutsideClick, closeOnEscape, closeOnParentScroll, closeOnMouseDrag, ignoreClicksOn, shouldCloseOnClick, zIndex: zIndexProp, className, contentClassName, style, width, maxWidth, maxHeight, accessibilityConfig, onPlacementChange }: IUiFloatingElementProps): import("react/jsx-runtime").JSX.Element | null;
|
|
19
|
+
export declare function UiFloatingElement({ children, anchor, isOpen, onClose, placement, alignPoints, strategy, offset, autoFlip, allowOverlapAnchor, overflowBoundary, closeOnOutsideClick, closeOnEscape, closeOnParentScroll, closeOnMouseDrag, ignoreClicksOn, shouldCloseOnClick, zIndex: zIndexProp, className, contentClassName, style, width, maxWidth, maxHeight, accessibilityConfig, onPlacementChange }: IUiFloatingElementProps): import("react/jsx-runtime").JSX.Element | null;
|
|
20
20
|
//# sourceMappingURL=UiFloatingElement.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UiFloatingElement.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiFloatingElement/UiFloatingElement.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAS1D;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,iBAAiB,CAAC,EAC9B,QAAQ,EACR,MAAM,EACN,MAAM,EACN,OAAO,EACP,SAA0B,EAC1B,WAAW,EACX,QAAqB,EACrB,MAAM,EACN,QAAe,EACf,mBAA0B,EAC1B,aAAqB,EACrB,mBAA2B,EAC3B,gBAAwB,EACxB,cAAuC,EACvC,kBAAkB,EAClB,MAAM,EAAE,UAAU,EAClB,SAAS,EACT,gBAAgB,EAChB,KAAK,EACL,KAAc,EACd,QAAQ,EACR,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACpB,EAAE,uBAAuB,
|
|
1
|
+
{"version":3,"file":"UiFloatingElement.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiFloatingElement/UiFloatingElement.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAS1D;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,iBAAiB,CAAC,EAC9B,QAAQ,EACR,MAAM,EACN,MAAM,EACN,OAAO,EACP,SAA0B,EAC1B,WAAW,EACX,QAAqB,EACrB,MAAM,EACN,QAAe,EACf,kBAA0B,EAC1B,gBAAgB,EAChB,mBAA0B,EAC1B,aAAqB,EACrB,mBAA2B,EAC3B,gBAAwB,EACxB,cAAuC,EACvC,kBAAkB,EAClB,MAAM,EAAE,UAAU,EAClB,SAAS,EACT,gBAAgB,EAChB,KAAK,EACL,KAAc,EACd,QAAQ,EACR,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACpB,EAAE,uBAAuB,kDAiGzB"}
|
|
@@ -31,7 +31,7 @@ const EMPTY_IGNORE_CLICKS_ON = [];
|
|
|
31
31
|
*
|
|
32
32
|
* @internal
|
|
33
33
|
*/
|
|
34
|
-
export function UiFloatingElement({ children, anchor, isOpen, onClose, placement = "bottom-start", alignPoints, strategy = "absolute", offset, autoFlip = true, closeOnOutsideClick = true, closeOnEscape = false, closeOnParentScroll = false, closeOnMouseDrag = false, ignoreClicksOn = EMPTY_IGNORE_CLICKS_ON, shouldCloseOnClick, zIndex: zIndexProp, className, contentClassName, style, width = "auto", maxWidth, maxHeight, accessibilityConfig, onPlacementChange, }) {
|
|
34
|
+
export function UiFloatingElement({ children, anchor, isOpen, onClose, placement = "bottom-start", alignPoints, strategy = "absolute", offset, autoFlip = true, allowOverlapAnchor = false, overflowBoundary, closeOnOutsideClick = true, closeOnEscape = false, closeOnParentScroll = false, closeOnMouseDrag = false, ignoreClicksOn = EMPTY_IGNORE_CLICKS_ON, shouldCloseOnClick, zIndex: zIndexProp, className, contentClassName, style, width = "auto", maxWidth, maxHeight, accessibilityConfig, onPlacementChange, }) {
|
|
35
35
|
const [resolvedAnchor, setResolvedAnchor] = useState(() => resolveAnchor(anchor));
|
|
36
36
|
// Core positioning
|
|
37
37
|
const { refs, floatingStyles, placement: actualPlacement, zIndex, } = useFloatingPosition({
|
|
@@ -41,6 +41,8 @@ export function UiFloatingElement({ children, anchor, isOpen, onClose, placement
|
|
|
41
41
|
strategy,
|
|
42
42
|
offset,
|
|
43
43
|
autoFlip,
|
|
44
|
+
allowOverlapAnchor,
|
|
45
|
+
overflowBoundary,
|
|
44
46
|
maxWidth,
|
|
45
47
|
maxHeight,
|
|
46
48
|
zIndex: zIndexProp,
|
|
@@ -39,6 +39,23 @@ export interface IUiFloatingElementProps {
|
|
|
39
39
|
strategy?: Strategy;
|
|
40
40
|
offset?: OffsetOptions;
|
|
41
41
|
autoFlip?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Whether the floating element may slide over its anchor to stay in view.
|
|
44
|
+
*
|
|
45
|
+
* @remarks
|
|
46
|
+
* By default it only slides along the side it is placed on. An anchor taller than the viewport
|
|
47
|
+
* has room on neither side, which leaves the element off the screen.
|
|
48
|
+
*/
|
|
49
|
+
allowOverlapAnchor?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Element the floating element is kept inside of, instead of the window.
|
|
52
|
+
*
|
|
53
|
+
* @remarks
|
|
54
|
+
* The portal puts it outside whatever the anchor scrolls in, so by default only the window
|
|
55
|
+
* constrains it. Pass the element rather than its rect, so the position is measured again as
|
|
56
|
+
* the element moves.
|
|
57
|
+
*/
|
|
58
|
+
overflowBoundary?: Element;
|
|
42
59
|
closeOnOutsideClick?: boolean;
|
|
43
60
|
closeOnEscape?: boolean;
|
|
44
61
|
closeOnParentScroll?: boolean;
|
|
@@ -66,6 +83,8 @@ export interface IUseFloatingPositionOptions {
|
|
|
66
83
|
strategy?: Strategy;
|
|
67
84
|
offset?: OffsetOptions;
|
|
68
85
|
autoFlip?: boolean;
|
|
86
|
+
allowOverlapAnchor?: boolean;
|
|
87
|
+
overflowBoundary?: Element;
|
|
69
88
|
fallbackPlacements?: Placement[];
|
|
70
89
|
arrowRef?: RefObject<SVGSVGElement | null>;
|
|
71
90
|
customMiddleware?: Middleware[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiFloatingElement/types.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,gBAAgB,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAElG,OAAO,EACH,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,cAAc,EACtB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE/E;;;;;;;;;GASG;AACH,MAAM,WAAW,iBAAiB;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE;QACL,CAAC,CAAC,EAAE,MAAM,CAAC;QACX,CAAC,CAAC,EAAE,MAAM,CAAC;KACd,CAAC;CACL;AAED;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,cAAc,GAAG,MAAM,GAAG,IAAI,CAAC;AAE3G;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACpC,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,eAAe,CAAC;IACxB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,WAAW,CAAC,EAAE,iBAAiB,EAAE,CAAC;I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AC,CAAC;QACjC,QAAQ,EAAE,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;KAClD,CAAC;IACF,cAAc,EAAE,aAAa,CAAC;IAC9B,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,OAAO,EAAE,eAAe,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACvC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// (C) 2025 GoodData Corporation
|
|
1
|
+
// (C) 2025-2026 GoodData Corporation
|
|
2
2
|
export {};
|
|
@@ -4,5 +4,5 @@ import { type IUseFloatingPositionOptions, type IUseFloatingPositionResult } fro
|
|
|
4
4
|
*
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
7
|
-
export declare function useFloatingPosition({ isOpen, onOpenChange, placement: placementProp, alignPoints, strategy, offset: offsetProp, autoFlip, fallbackPlacements: fallbackPlacementsProp, arrowRef, customMiddleware, maxWidth, maxHeight, zIndex: zIndexProp, shiftPadding }: IUseFloatingPositionOptions): IUseFloatingPositionResult;
|
|
7
|
+
export declare function useFloatingPosition({ isOpen, onOpenChange, placement: placementProp, alignPoints, strategy, offset: offsetProp, autoFlip, allowOverlapAnchor, overflowBoundary, fallbackPlacements: fallbackPlacementsProp, arrowRef, customMiddleware, maxWidth, maxHeight, zIndex: zIndexProp, shiftPadding }: IUseFloatingPositionOptions): IUseFloatingPositionResult;
|
|
8
8
|
//# sourceMappingURL=useFloatingPosition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFloatingPosition.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiFloatingElement/useFloatingPosition.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useFloatingPosition.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiFloatingElement/useFloatingPosition.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,KAAK,2BAA2B,EAAE,KAAK,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAM/F;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,EAChC,MAAM,EACN,YAAY,EACZ,SAAS,EAAE,aAA8B,EACzC,WAAW,EACX,QAAqB,EACrB,MAAM,EAAE,UAAU,EAClB,QAAe,EACf,kBAA0B,EAC1B,gBAAgB,EAChB,kBAAkB,EAAE,sBAAsB,EAC1C,QAAQ,EACR,gBAAmC,EACnC,QAAQ,EACR,SAAS,EACT,MAAM,EAAE,UAAU,EAClB,YAAgB,EACnB,EAAE,2BAA2B,GAAG,0BAA0B,CAwI1D"}
|