@gooddata/sdk-ui-kit 11.55.0-alpha.1 → 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.
Files changed (60) hide show
  1. package/esm/@ui/@types/icon.d.ts +1 -1
  2. package/esm/@ui/@types/icon.d.ts.map +1 -1
  3. package/esm/@ui/UiChip/ChipActionButton.d.ts +3 -0
  4. package/esm/@ui/UiChip/ChipActionButton.d.ts.map +1 -0
  5. package/esm/@ui/UiChip/ChipActionButton.js +8 -0
  6. package/esm/@ui/UiChip/ChipContent.d.ts +1 -1
  7. package/esm/@ui/UiChip/ChipContent.d.ts.map +1 -1
  8. package/esm/@ui/UiChip/ChipContent.js +6 -4
  9. package/esm/@ui/UiChip/ChipDeleteButton.d.ts +1 -1
  10. package/esm/@ui/UiChip/ChipDeleteButton.d.ts.map +1 -1
  11. package/esm/@ui/UiChip/ChipDeleteButton.js +2 -2
  12. package/esm/@ui/UiChip/UiChip.d.ts +1 -1
  13. package/esm/@ui/UiChip/UiChip.d.ts.map +1 -1
  14. package/esm/@ui/UiChip/UiChip.js +8 -5
  15. package/esm/@ui/UiChip/types.d.ts +19 -1
  16. package/esm/@ui/UiChip/types.d.ts.map +1 -1
  17. package/esm/@ui/UiColorPicker/UiColorPicker.d.ts +6 -0
  18. package/esm/@ui/UiColorPicker/UiColorPicker.d.ts.map +1 -0
  19. package/esm/@ui/UiColorPicker/UiColorPicker.js +49 -0
  20. package/esm/@ui/UiColorPicker/colorValue.d.ts +58 -0
  21. package/esm/@ui/UiColorPicker/colorValue.d.ts.map +1 -0
  22. package/esm/@ui/UiColorPicker/colorValue.js +90 -0
  23. package/esm/@ui/UiColorPicker/components/UiColorSlider.d.ts +19 -0
  24. package/esm/@ui/UiColorPicker/components/UiColorSlider.d.ts.map +1 -0
  25. package/esm/@ui/UiColorPicker/components/UiColorSlider.js +35 -0
  26. package/esm/@ui/UiColorPicker/components/UiColorValueField.d.ts +12 -0
  27. package/esm/@ui/UiColorPicker/components/UiColorValueField.d.ts.map +1 -0
  28. package/esm/@ui/UiColorPicker/components/UiColorValueField.js +40 -0
  29. package/esm/@ui/UiColorPicker/components/UiColorWheel.d.ts +9 -0
  30. package/esm/@ui/UiColorPicker/components/UiColorWheel.d.ts.map +1 -0
  31. package/esm/@ui/UiColorPicker/components/UiColorWheel.js +43 -0
  32. package/esm/@ui/UiColorPicker/types.d.ts +70 -0
  33. package/esm/@ui/UiColorPicker/types.d.ts.map +1 -0
  34. package/esm/@ui/UiColorPicker/types.js +2 -0
  35. package/esm/@ui/UiFloatingElement/UiFloatingElement.d.ts +1 -1
  36. package/esm/@ui/UiFloatingElement/UiFloatingElement.d.ts.map +1 -1
  37. package/esm/@ui/UiFloatingElement/UiFloatingElement.js +3 -1
  38. package/esm/@ui/UiFloatingElement/types.d.ts +19 -0
  39. package/esm/@ui/UiFloatingElement/types.d.ts.map +1 -1
  40. package/esm/@ui/UiFloatingElement/types.js +1 -1
  41. package/esm/@ui/UiFloatingElement/useFloatingPosition.d.ts +1 -1
  42. package/esm/@ui/UiFloatingElement/useFloatingPosition.d.ts.map +1 -1
  43. package/esm/@ui/UiFloatingElement/useFloatingPosition.js +17 -4
  44. package/esm/@ui/UiIcon/icons.d.ts.map +1 -1
  45. package/esm/@ui/UiIcon/icons.js +27 -0
  46. package/esm/@ui/hooks/useCloseOnOutsideClick.d.ts.map +1 -1
  47. package/esm/@ui/hooks/useCloseOnOutsideClick.js +2 -1
  48. package/esm/@ui/hooks/usePointerTrack.d.ts +23 -0
  49. package/esm/@ui/hooks/usePointerTrack.d.ts.map +1 -0
  50. package/esm/@ui/hooks/usePointerTrack.js +45 -0
  51. package/esm/index.d.ts +3 -0
  52. package/esm/index.d.ts.map +1 -1
  53. package/esm/index.js +2 -0
  54. package/esm/sdk-ui-kit.d.ts +136 -5
  55. package/package.json +13 -15
  56. package/src/@ui/UiChip/UiChip.scss +110 -15
  57. package/src/@ui/UiColorPicker/UiColorPicker.scss +120 -0
  58. package/src/@ui/index.scss +1 -0
  59. package/styles/css/main.css +167 -13
  60. package/styles/css/main.css.map +1 -1
@@ -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,YA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AwB,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,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,G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Z,QAAQ,GACR,SAAS,GACT,WAAW,GACX,KAAK,GACL,OAAO,GACP,cAAc,GACd,UAAU,GACV,UAAU,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { type IChipActionButtonProps } from "./types.js";
2
+ export declare function ChipActionButton({ onAction, onActionKeyDown, actionAriaLabel, actionAriaDescribedBy, actionIcon, dataTestId }: IChipActionButtonProps): import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=ChipActionButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChipActionButton.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiChip/ChipActionButton.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAIzD,wBAAgB,gBAAgB,CAAC,EAC7B,QAAQ,EACR,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,UAA+B,EAC/B,UAAU,EACb,EAAE,sBAAsB,2CAexB"}
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ // (C) 2025-2026 GoodData Corporation
3
+ import { bem } from "../@utils/bem.js";
4
+ import { UiIcon } from "../UiIcon/UiIcon.js";
5
+ const { e } = bem("gd-ui-kit-chip");
6
+ export function ChipActionButton({ onAction, onActionKeyDown, actionAriaLabel, actionAriaDescribedBy, actionIcon = "ellipsisVertical", dataTestId, }) {
7
+ return (_jsx("button", { "data-testid": dataTestId ? `${dataTestId}-action-button` : undefined, "aria-label": actionAriaLabel, "aria-describedby": actionAriaDescribedBy, className: e("action"), onClick: onAction, onKeyDown: onActionKeyDown, children: _jsx("span", { className: e("icon-action"), children: _jsx(UiIcon, { type: actionIcon, color: "complementary-6", size: 14 }) }) }));
8
+ }
@@ -1,3 +1,3 @@
1
1
  import { type IChipContentProps } from "./types.js";
2
- export declare function ChipContent({ label, tag, iconBefore, iconAfter, iconColor, onClick, onKeyDown, isActive, isLocked, isExpandable, isDisabled, isDeletable, accessibilityConfig, dataTestId, buttonRef, styleObj }: IChipContentProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function ChipContent({ label, tag, iconBefore, iconAfter, iconColor, variant, onClick, onKeyDown, isActive, isLocked, isExpandable, isDisabled, isDeletable, isActionable, accessibilityConfig, dataTestId, buttonRef, styleObj }: IChipContentProps): import("react/jsx-runtime").JSX.Element;
3
3
  //# sourceMappingURL=ChipContent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChipContent.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiChip/ChipContent.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAMpD,wBAAgB,WAAW,CAAC,EACxB,KAAK,EACL,GAAG,EACH,UAAU,EACV,SAAS,EACT,SAAqB,EACrB,OAAO,EACP,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,WAAW,EACX,mBAAmB,EACnB,UAAU,EACV,SAAS,EACT,QAAQ,EACX,EAAE,iBAAiB,2CA6EnB"}
1
+ {"version":3,"file":"ChipContent.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiChip/ChipContent.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAMpD,wBAAgB,WAAW,CAAC,EACxB,KAAK,EACL,GAAG,EACH,UAAU,EACV,SAAS,EACT,SAAqB,EACrB,OAAkB,EAClB,OAAO,EACP,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,UAAU,EACV,SAAS,EACT,QAAQ,EACX,EAAE,iBAAiB,2CAuFnB"}
@@ -4,8 +4,8 @@ import { bem } from "../@utils/bem.js";
4
4
  import { UiIcon } from "../UiIcon/UiIcon.js";
5
5
  const { e } = bem("gd-ui-kit-chip");
6
6
  const ICON_SIZE = 14;
7
- export function ChipContent({ label, tag, iconBefore, iconAfter, iconColor = "primary", onClick, onKeyDown, isActive, isLocked, isExpandable, isDisabled, isDeletable, accessibilityConfig, dataTestId, buttonRef, styleObj, }) {
8
- const { isExpanded, popupId, popupType, ariaHaspopup, ariaLabel, ariaLabelledBy, ariaControls, iconBeforeAriaLabel, } = accessibilityConfig ?? {};
7
+ export function ChipContent({ label, tag, iconBefore, iconAfter, iconColor = "primary", variant = "normal", onClick, onKeyDown, isActive, isLocked, isExpandable, isDisabled, isDeletable, isActionable, accessibilityConfig, dataTestId, buttonRef, styleObj, }) {
8
+ const { isExpanded, popupId, popupType, ariaHaspopup, ariaLabel, ariaLabelledBy, ariaControls, iconBeforeAriaLabel, iconAfterAriaLabel, } = accessibilityConfig ?? {};
9
9
  const isDropdownTrigger = isExpandable || isExpanded !== undefined || popupId !== undefined;
10
10
  const ariaDropdownProps = isDropdownTrigger
11
11
  ? {
@@ -16,9 +16,11 @@ export function ChipContent({ label, tag, iconBefore, iconAfter, iconColor = "pr
16
16
  }
17
17
  : {};
18
18
  return (_jsxs("button", { "data-testid": dataTestId, className: e("trigger", {
19
+ variant,
20
+ isActive,
19
21
  isDeletable,
22
+ isActionable,
20
23
  hasIconAfter: !!iconAfter,
21
- isActive,
22
24
  isLocked: isLocked || isDisabled,
23
- }), disabled: isDisabled, onClick: isLocked ? undefined : onClick, onKeyDown: onKeyDown, style: { ...styleObj }, ref: buttonRef, "aria-disabled": isLocked || isDisabled, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...ariaDropdownProps, children: [iconBefore ? (_jsx("span", { className: e("icon-before"), children: _jsx(UiIcon, { type: iconBefore, color: iconColor, size: ICON_SIZE, accessibilityConfig: iconBeforeAriaLabel ? { ariaLabel: iconBeforeAriaLabel } : undefined }) })) : null, _jsx("span", { className: e("label"), children: label }), tag ? _jsx("span", { className: e("tag"), children: tag }) : null, isDisabled ? null : (_jsx(_Fragment, { children: isLocked ? (_jsx("span", { className: e("icon-lock"), children: _jsx(UiIcon, { type: "lock", color: "complementary-6", size: 14 }) })) : isExpandable ? (_jsx("span", { className: e("icon-chevron", { isActive }), children: _jsx(UiIcon, { type: isActive ? "chevronUp" : "chevronDown", color: "complementary-7", size: 8 }) })) : iconAfter ? (_jsx("span", { className: e("icon-after"), children: _jsx(UiIcon, { type: iconAfter, color: iconColor, size: ICON_SIZE }) })) : null }))] }));
25
+ }), disabled: isDisabled, onClick: isLocked ? undefined : onClick, onKeyDown: onKeyDown, style: { ...styleObj }, ref: buttonRef, "aria-disabled": isLocked || isDisabled, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...ariaDropdownProps, children: [iconBefore ? (_jsx("span", { className: e("icon-before"), children: _jsx(UiIcon, { type: iconBefore, color: iconColor, size: ICON_SIZE, accessibilityConfig: iconBeforeAriaLabel ? { ariaLabel: iconBeforeAriaLabel } : undefined }) })) : null, _jsx("span", { className: e("label"), children: label }), tag ? _jsx("span", { className: e("tag"), children: tag }) : null, isDisabled ? null : (_jsx(_Fragment, { children: isLocked ? (_jsx("span", { className: e("icon-lock"), children: _jsx(UiIcon, { type: "lock", color: "complementary-6", size: 14 }) })) : isExpandable ? (_jsx("span", { className: e("icon-chevron", { isActive }), children: _jsx(UiIcon, { type: isActive ? "chevronUp" : "chevronDown", color: "complementary-7", size: 8 }) })) : iconAfter ? (_jsx("span", { className: e("icon-after"), children: _jsx(UiIcon, { type: iconAfter, color: iconColor, size: ICON_SIZE, accessibilityConfig: iconAfterAriaLabel ? { ariaLabel: iconAfterAriaLabel } : undefined }) })) : null }))] }));
24
26
  }
@@ -1,3 +1,3 @@
1
1
  import { type IChipDeleteButtonProps } from "./types.js";
2
- export declare function ChipDeleteButton({ onDelete, onDeleteKeyDown, deleteAriaLabel, dataTestId }: IChipDeleteButtonProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function ChipDeleteButton({ onDelete, onDeleteKeyDown, deleteAriaLabel, deleteAriaDescribedBy, dataTestId }: IChipDeleteButtonProps): import("react/jsx-runtime").JSX.Element;
3
3
  //# sourceMappingURL=ChipDeleteButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChipDeleteButton.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiChip/ChipDeleteButton.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAIzD,wBAAgB,gBAAgB,CAAC,EAC7B,QAAQ,EACR,eAAe,EACf,eAAe,EACf,UAAU,EACb,EAAE,sBAAsB,2CAcxB"}
1
+ {"version":3,"file":"ChipDeleteButton.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiChip/ChipDeleteButton.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAIzD,wBAAgB,gBAAgB,CAAC,EAC7B,QAAQ,EACR,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,UAAU,EACb,EAAE,sBAAsB,2CAexB"}
@@ -3,6 +3,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { bem } from "../@utils/bem.js";
4
4
  import { UiIcon } from "../UiIcon/UiIcon.js";
5
5
  const { e } = bem("gd-ui-kit-chip");
6
- export function ChipDeleteButton({ onDelete, onDeleteKeyDown, deleteAriaLabel, dataTestId, }) {
7
- return (_jsx("button", { "data-testid": dataTestId ? `${dataTestId}-delete-button` : undefined, "aria-label": deleteAriaLabel, className: e("delete"), onClick: onDelete, onKeyDown: onDeleteKeyDown, children: _jsx("span", { className: e("icon-delete"), children: _jsx(UiIcon, { type: "cross", color: "complementary-6", size: 14 }) }) }));
6
+ export function ChipDeleteButton({ onDelete, onDeleteKeyDown, deleteAriaLabel, deleteAriaDescribedBy, dataTestId, }) {
7
+ return (_jsx("button", { "data-testid": dataTestId ? `${dataTestId}-delete-button` : undefined, "aria-label": deleteAriaLabel, "aria-describedby": deleteAriaDescribedBy, className: e("delete"), onClick: onDelete, onKeyDown: onDeleteKeyDown, children: _jsx("span", { className: e("icon-delete"), children: _jsx(UiIcon, { type: "cross", color: "complementary-6", size: 14 }) }) }));
8
8
  }
@@ -2,5 +2,5 @@ import { type IUiChipProps } from "./types.js";
2
2
  /**
3
3
  * @internal
4
4
  */
5
- export declare function UiChip({ label, tag, isDeletable, isActive, isLocked, isExpandable, isDisabled, maxWidth, iconBefore, iconAfter, iconColor, onClick, onDelete, onKeyDown, onDeleteKeyDown, accessibilityConfig, dataTestId, buttonRef, renderChipContent, renderDeleteButton }: IUiChipProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function UiChip({ label, tag, isDeletable, isActionable, isActive, isLocked, isExpandable, isDisabled, maxWidth, iconBefore, iconAfter, iconColor, onClick, onKeyDown, onDelete, onDeleteKeyDown, onAction, onActionKeyDown, accessibilityConfig, dataTestId, buttonRef, iconAction, variant, renderChipContent, renderActionButton }: IUiChipProps): import("react/jsx-runtime").JSX.Element;
6
6
  //# sourceMappingURL=UiChip.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UiChip.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiChip/UiChip.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAI/C;;GAEG;AACH,wBAAgB,MAAM,CAAC,EACnB,KAAK,EACL,GAAG,EACH,WAAmB,EACnB,QAAgB,EAChB,QAAgB,EAChB,YAAmB,EACnB,UAAkB,EAClB,QAAQ,EACR,UAAU,EACV,SAAS,EACT,SAAqB,EACrB,OAAO,EACP,QAAQ,EACR,SAAS,EACT,eAAe,EACf,mBAAmB,EACnB,UAAU,EACV,SAAS,EACT,iBAAiB,EACjB,kBAAkB,EACrB,EAAE,YAAY,2CAsDd"}
1
+ {"version":3,"file":"UiChip.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiChip/UiChip.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAI/C;;GAEG;AACH,wBAAgB,MAAM,CAAC,EACnB,KAAK,EACL,GAAG,EACH,WAAmB,EACnB,YAAoB,EACpB,QAAgB,EAChB,QAAgB,EAChB,YAAmB,EACnB,UAAkB,EAClB,QAAQ,EACR,UAAU,EACV,SAAS,EACT,SAAqB,EACrB,OAAO,EACP,SAAS,EACT,QAAQ,EACR,eAAe,EACf,QAAQ,EACR,eAAe,EACf,mBAAmB,EACnB,UAAU,EACV,SAAS,EACT,UAAU,EACV,OAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EACrB,EAAE,YAAY,2CAuEd"}
@@ -2,13 +2,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  // (C) 2025-2026 GoodData Corporation
3
3
  import { useLayoutEffect, useRef, useState } from "react";
4
4
  import { bem } from "../@utils/bem.js";
5
+ import { ChipActionButton } from "./ChipActionButton.js";
5
6
  import { ChipContent } from "./ChipContent.js";
6
7
  import { ChipDeleteButton } from "./ChipDeleteButton.js";
7
8
  const { b } = bem("gd-ui-kit-chip");
8
9
  /**
9
10
  * @internal
10
11
  */
11
- export function UiChip({ label, tag, isDeletable = false, isActive = false, isLocked = false, isExpandable = true, isDisabled = false, maxWidth, iconBefore, iconAfter, iconColor = "primary", onClick, onDelete, onKeyDown, onDeleteKeyDown, accessibilityConfig, dataTestId, buttonRef, renderChipContent, renderDeleteButton, }) {
12
+ export function UiChip({ label, tag, isDeletable = false, isActionable = false, isActive = false, isLocked = false, isExpandable = true, isDisabled = false, maxWidth, iconBefore, iconAfter, iconColor = "primary", onClick, onKeyDown, onDelete, onDeleteKeyDown, onAction, onActionKeyDown, accessibilityConfig, dataTestId, buttonRef, iconAction, variant = "normal", renderChipContent, renderActionButton, }) {
12
13
  const [styleObj, setStyleObj] = useState();
13
14
  const defaultButtonRef = useRef(null);
14
15
  const effectiveButtonRef = buttonRef || defaultButtonRef;
@@ -20,8 +21,10 @@ export function UiChip({ label, tag, isDeletable = false, isActive = false, isLo
20
21
  setStyleObj({ width });
21
22
  }
22
23
  }, [label, tag, effectiveButtonRef]);
23
- const { deleteAriaLabel, deleteAriaDescribedBy } = accessibilityConfig ?? {};
24
- const chipContent = (_jsx(ChipContent, { label: label, tag: tag, iconBefore: iconBefore, iconAfter: iconAfter, iconColor: iconColor, onClick: onClick, onKeyDown: onKeyDown, isActive: isActive, isLocked: isLocked, isExpandable: isExpandable, isDisabled: isDisabled, isDeletable: isDeletable, maxWidth: maxWidth, accessibilityConfig: accessibilityConfig, dataTestId: dataTestId, buttonRef: effectiveButtonRef, styleObj: styleObj }));
25
- const deleteButton = isDeletable ? (_jsx(ChipDeleteButton, { onDelete: onDelete, onDeleteKeyDown: onDeleteKeyDown, deleteAriaLabel: deleteAriaLabel, deleteAriaDescribedBy: deleteAriaDescribedBy, dataTestId: dataTestId })) : null;
26
- return (_jsxs("div", { className: b(), style: { maxWidth }, children: [renderChipContent ? renderChipContent(chipContent) : chipContent, deleteButton && renderDeleteButton ? renderDeleteButton(deleteButton) : deleteButton] }));
24
+ const { deleteAriaLabel, deleteAriaDescribedBy, actionAriaLabel, actionAriaDescribedBy } = accessibilityConfig ?? {};
25
+ const chipContent = (_jsx(ChipContent, { label: label, tag: tag, variant: variant, iconBefore: iconBefore, iconAfter: iconAfter, iconColor: iconColor, onClick: onClick, onKeyDown: onKeyDown, isActive: isActive, isLocked: isLocked, isExpandable: isExpandable, isDisabled: isDisabled, isDeletable: isDeletable, isActionable: isActionable, maxWidth: maxWidth, accessibilityConfig: accessibilityConfig, dataTestId: dataTestId, buttonRef: effectiveButtonRef, styleObj: styleObj }));
26
+ const actionButton = isDeletable ? (_jsx(ChipDeleteButton, { onDelete: onDelete, onDeleteKeyDown: onDeleteKeyDown, deleteAriaLabel: deleteAriaLabel, deleteAriaDescribedBy: deleteAriaDescribedBy, dataTestId: dataTestId })) : isActionable ? (_jsx(ChipActionButton, { onAction: onAction, onActionKeyDown: onActionKeyDown, actionIcon: iconAction, actionAriaLabel: actionAriaLabel, actionAriaDescribedBy: actionAriaDescribedBy, dataTestId: dataTestId })) : null;
27
+ return (_jsxs("div", { className: b({
28
+ variant,
29
+ }), style: { maxWidth }, children: [renderChipContent ? renderChipContent(chipContent) : chipContent, actionButton && renderActionButton ? renderActionButton(actionButton) : actionButton] }));
27
30
  }
@@ -10,6 +10,9 @@ export interface IUiChipAccessibilityConfig extends IAccessibilityConfigBase, ID
10
10
  deleteAriaLabel?: string;
11
11
  deleteAriaDescribedBy?: string;
12
12
  iconBeforeAriaLabel?: string;
13
+ iconAfterAriaLabel?: string;
14
+ actionAriaLabel?: string;
15
+ actionAriaDescribedBy?: string;
13
16
  }
14
17
  /**
15
18
  * @internal
@@ -18,23 +21,28 @@ export interface IUiChipProps {
18
21
  label: string;
19
22
  tag?: string;
20
23
  isDeletable?: boolean;
24
+ isActionable?: boolean;
21
25
  isActive?: boolean;
22
26
  isLocked?: boolean;
23
27
  isExpandable?: boolean;
24
28
  isDisabled?: boolean;
25
29
  maxWidth?: number;
30
+ iconAction?: IconType;
26
31
  iconBefore?: IconType;
27
32
  iconAfter?: IconType;
28
33
  iconColor?: ThemeColor | "currentColor";
34
+ variant?: "normal" | "inactive";
29
35
  onClick?: () => void;
30
36
  onDelete?: () => void;
31
37
  onKeyDown?: KeyboardEventHandler<HTMLButtonElement>;
32
38
  onDeleteKeyDown?: KeyboardEventHandler<HTMLButtonElement>;
39
+ onAction?: () => void;
40
+ onActionKeyDown?: KeyboardEventHandler<HTMLButtonElement>;
33
41
  accessibilityConfig?: IUiChipAccessibilityConfig;
34
42
  dataTestId?: string;
35
43
  buttonRef?: MutableRefObject<HTMLButtonElement>;
36
44
  renderChipContent?: (content: ReactNode) => ReactNode;
37
- renderDeleteButton?: (button: ReactNode) => ReactNode;
45
+ renderActionButton?: (button: ReactNode) => ReactNode;
38
46
  }
39
47
  export interface IChipContentProps {
40
48
  label: string;
@@ -50,6 +58,8 @@ export interface IChipContentProps {
50
58
  isDisabled: boolean;
51
59
  maxWidth?: number;
52
60
  isDeletable: boolean;
61
+ isActionable: boolean;
62
+ variant?: "normal" | "inactive";
53
63
  accessibilityConfig?: IUiChipAccessibilityConfig;
54
64
  dataTestId?: string;
55
65
  buttonRef: MutableRefObject<HTMLButtonElement> | RefObject<HTMLButtonElement | null>;
@@ -62,4 +72,12 @@ export interface IChipDeleteButtonProps {
62
72
  deleteAriaDescribedBy?: string;
63
73
  dataTestId?: string;
64
74
  }
75
+ export interface IChipActionButtonProps {
76
+ onAction?: () => void;
77
+ onActionKeyDown?: KeyboardEventHandler<HTMLButtonElement>;
78
+ actionAriaLabel?: string;
79
+ actionAriaDescribedBy?: string;
80
+ actionIcon?: IconType;
81
+ dataTestId?: string;
82
+ }
65
83
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/@ui/UiChip/types.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,SAAS,EACjB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,KAAK,kCAAkC,EAAE,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,0BACb,SAAQ,wBAAwB,EAAE,kCAAkC;IACpE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO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U,CAAC,EAAE,MAAM,CAAC;CACvB"}
@@ -0,0 +1,6 @@
1
+ import { type IUiColorPickerProps } from "./types.js";
2
+ /**
3
+ * @internal
4
+ */
5
+ export declare function UiColorPicker(props: IUiColorPickerProps): import("react/jsx-runtime").JSX.Element;
6
+ //# sourceMappingURL=UiColorPicker.d.ts.map
@@ -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"}