@progress/kendo-react-inputs 15.1.1-develop.3 → 15.2.0-develop.2

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 (42) hide show
  1. package/checkbox/Checkbox.js +1 -1
  2. package/checkbox/Checkbox.mjs +72 -70
  3. package/colors/ColorContrastLabels.js +1 -1
  4. package/colors/ColorContrastLabels.mjs +2 -2
  5. package/colors/ColorGradient.js +1 -1
  6. package/colors/ColorGradient.mjs +51 -52
  7. package/colors/ColorPalette.js +1 -1
  8. package/colors/ColorPalette.mjs +71 -72
  9. package/colors/ColorPicker.js +1 -1
  10. package/colors/ColorPicker.mjs +203 -195
  11. package/colors/FlatColorPicker.d.ts +4 -4
  12. package/colors/FlatColorPicker.js +1 -1
  13. package/colors/FlatColorPicker.mjs +30 -26
  14. package/colors/interfaces/ColorPaletteProps.d.ts +7 -0
  15. package/colors/interfaces/ColorPickerPaletteSettings.d.ts +5 -0
  16. package/dist/cdn/js/kendo-react-inputs.js +1 -1
  17. package/maskedtextbox/MaskedTextBox.d.ts +1 -0
  18. package/maskedtextbox/MaskedTextBox.js +1 -1
  19. package/maskedtextbox/MaskedTextBox.mjs +26 -23
  20. package/maskedtextbox/MaskedTextBoxProps.d.ts +7 -0
  21. package/numerictextbox/NumericTextBox.js +1 -1
  22. package/numerictextbox/NumericTextBox.mjs +2 -2
  23. package/otpinput/OTPInput.js +1 -1
  24. package/otpinput/OTPInput.mjs +141 -143
  25. package/package-metadata.js +1 -1
  26. package/package-metadata.mjs +2 -2
  27. package/package.json +10 -10
  28. package/radiobutton/RadioButton.js +1 -1
  29. package/radiobutton/RadioButton.mjs +32 -30
  30. package/range-slider/RangeSlider.js +11 -11
  31. package/range-slider/RangeSlider.mjs +54 -54
  32. package/rating/Rating.d.ts +12 -0
  33. package/rating/Rating.js +2 -2
  34. package/rating/Rating.mjs +91 -92
  35. package/slider/Slider.d.ts +12 -0
  36. package/slider/Slider.js +1 -1
  37. package/slider/Slider.mjs +69 -64
  38. package/switch/Switch.d.ts +15 -0
  39. package/switch/Switch.js +1 -1
  40. package/switch/Switch.mjs +87 -82
  41. package/textarea/TextArea.js +1 -1
  42. package/textarea/TextArea.mjs +11 -12
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const X=require("react"),o=require("prop-types"),n=require("@progress/kendo-react-common"),s=require("@progress/kendo-react-buttons"),m=require("@progress/kendo-svg-icons"),Y=require("./ColorPalette.js"),Z=require("./ColorGradient.js"),x=require("../package-metadata.js"),p=require("@progress/kendo-react-intl"),l=require("../messages/index.js");function ee(e){const b=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const f in e)if(f!=="default"){const B=Object.getOwnPropertyDescriptor(e,f);Object.defineProperty(b,f,B.get?B:{enumerable:!0,get:()=>e[f]})}}return b.default=e,Object.freeze(b)}const t=ee(X),_=t.forwardRef((e,b)=>{const f=!n.validatePackage(x.packageMetadata,{component:"FlatColorPicker"}),B=n.getLicenseMessage(x.packageMetadata),h=t.useRef(null),w=t.useRef(null),F=t.useRef(null),{defaultValue:P,showButtons:N=!0,showPreview:z=!0,showClearButton:T=!0,view:E=e.views?void 0:"ColorGradient",views:d=E?void 0:["gradient","palette"],activeView:S="gradient",size:i=void 0,rounded:j=void 0}=e,[C,D]=t.useState((E||"ColorGradient")==="ColorGradient"),[v,V]=t.useState((d!=null?d:[])[0]==="gradient"&&S==="gradient"),[c,y]=t.useState(e.value||P||void 0),[k,M]=t.useState(e.value||P||void 0),L=e.value!==void 0?e.value:void 0;t.useEffect(()=>{y(e.value)},[e.value]);const g=p.useLocalization(),A=t.useCallback(()=>{h.current&&h.current.focus()},[h]);t.useImperativeHandle(h,()=>({element:w.current,focus:A,props:e,value:L}),[L,A,e]),t.useImperativeHandle(b,()=>h.current);const R=t.useCallback(a=>{(a==="ColorGradient"&&!C||a==="ColorPalette"&&C)&&D(!C)},[C]),I=t.useCallback(a=>{a==="gradient"&&!v||a==="palette"&&v||a==="palette"&&S==="gradient"?V(!v):a==="gradient"&&S==="palette"&&V(!0)},[S,v]),K=t.useCallback(a=>{var u;const r=P||void 0;if(y(r),M(r),(u=e._gradientSettings)!=null&&u._adaptive&&e.setAdaptiveModeValue&&e.setAdaptiveModeValue(r),e.onPreviewChange){const G={value:r,nativeEvent:a.nativeEvent,syntheticEvent:a};e.onPreviewChange.call(void 0,G)}},[P,e.onPreviewChange]),q=t.useCallback(a=>{var r;if(y(a.value),e.onPreviewChange){const u={value:a.value,nativeEvent:a.nativeEvent,syntheticEvent:a.syntheticEvent};e.onPreviewChange.call(void 0,u)}(r=e._gradientSettings)!=null&&r._adaptive&&e.setAdaptiveModeValue&&e.setAdaptiveModeValue(a.value)},[e.onPreviewChange]),H=t.useCallback(a=>{if(c!==void 0&&M(c),e.onChange){const r={value:c,nativeEvent:a.nativeEvent,syntheticEvent:a};e.onChange.call(void 0,r)}},[c,e.onChange]),W=t.useCallback(()=>{y(k),e.setOpen&&e.setOpen(!1)},[k]),$=t.useCallback(a=>{if(y(k),e.onPreviewChange){const r={value:k,nativeEvent:a.nativeEvent,syntheticEvent:a};e.onPreviewChange.call(void 0,r)}},[k,e.onPreviewChange]),J=t.useCallback(a=>{var u,G;if((!a.relatedTarget||!((u=w.current)!=null&&u.contains(a.relatedTarget)))&&!((G=e._gradientSettings)!=null&&G._adaptive)&&(!N&&c!==void 0&&M(c),!N&&e.onChange)){const U={value:c,nativeEvent:a.nativeEvent,syntheticEvent:a};e.onChange.call(void 0,U)}},[c,N,e.onChange]),O=t.useMemo(()=>new n.Navigation({root:w,selectors:[".k-coloreditor"],tabIndex:0,keyboardEvents:{keydown:{Tab:(a,r,u)=>{n.getActiveElement(document)===a?n.disableNavigatableContainer(a):n.keepFocusInContainer(u,a)},Enter:(a,r,u)=>{n.getActiveElement(document)===a&&(n.focusFirstFocusableChild(a),n.enableNavigatableContainer(a))},Escape:(a,r,u)=>{n.getActiveElement(document)!==a&&(a.focus(),n.disableNavigatableContainer(a))}}}}),[]),Q=t.useCallback(O.triggerKeyboardEvent.bind(O),[]);return t.createElement("div",{id:e.id,role:"textbox","aria-label":e.ariaLabel||g.toLanguageString(l.flatColorPickerAriaLabel,l.messages[l.flatColorPickerAriaLabel]),"aria-labelledby":e.ariaLabelledBy,"aria-disabled":e.disabled?"true":void 0,style:{position:"relative",...e.style},ref:w,tabIndex:n.getTabIndex(e.tabIndex,e.disabled),className:n.classNames("k-flatcolorpicker k-coloreditor",{[`k-coloreditor-${n.kendoThemeMaps.sizeMap[i]||i}`]:i,"k-disabled":e.disabled},e.className),onBlur:J,onKeyDown:Q},e.header||t.createElement("div",{className:"k-coloreditor-header k-hstack"},t.createElement("div",{className:"k-coloreditor-header-actions k-hstack"},d&&d[0]==="gradient"&&d[1]==="palette"&&t.createElement(s.ButtonGroup,{className:"k-button-group-flat"},t.createElement(s.Button,{type:"button","aria-label":g.toLanguageString(l.flatColorPickerColorGradientBtn,l.messages[l.flatColorPickerColorGradientBtn]),size:i,fillMode:"flat",svgIcon:m.dropletSliderIcon,className:v?"k-selected":void 0,onClick:()=>I("gradient")}),t.createElement(s.Button,{type:"button","aria-label":g.toLanguageString(l.flatColorPickerColorPaletteBtn,l.messages[l.flatColorPickerColorPaletteBtn]),size:i,fillMode:"flat",svgIcon:m.paletteIcon,className:v?void 0:"k-selected",onClick:()=>I("palette")})),d&&d[0]==="palette"&&d[1]==="gradient"&&t.createElement(s.ButtonGroup,{className:"k-button-group-flat"},t.createElement(s.Button,{type:"button","aria-label":g.toLanguageString(l.flatColorPickerColorPaletteBtn,l.messages[l.flatColorPickerColorPaletteBtn]),fillMode:"flat",size:i,svgIcon:m.paletteIcon,className:v?void 0:"k-selected",onClick:()=>I("palette")}),t.createElement(s.Button,{type:"button","aria-label":g.toLanguageString(l.flatColorPickerColorGradientBtn,l.messages[l.flatColorPickerColorGradientBtn]),fillMode:"flat",size:i,svgIcon:m.dropletSliderIcon,className:v?"k-selected":void 0,onClick:()=>I("gradient")})),E&&t.createElement(s.ButtonGroup,{className:"k-button-group-flat"},t.createElement(s.Button,{type:"button","aria-label":g.toLanguageString(l.flatColorPickerColorGradientBtn,l.messages[l.flatColorPickerColorGradientBtn]),fillMode:"flat",size:i,className:C?"k-selected":void 0,onClick:()=>R("ColorGradient"),icon:"droplet-slider",svgIcon:m.dropletSliderIcon}),t.createElement(s.Button,{type:"button","aria-label":g.toLanguageString(l.flatColorPickerColorPaletteBtn,l.messages[l.flatColorPickerColorPaletteBtn]),fillMode:"flat",size:i,className:C?void 0:"k-selected",onClick:()=>R("ColorPalette"),icon:"palette",svgIcon:m.paletteIcon}))),t.createElement("div",{className:"k-spacer"}),t.createElement("div",{className:"k-coloreditor-header-actions k-hstack"},T&&t.createElement(s.Button,{type:"button",fillMode:"flat",size:i,onClick:K,"aria-label":g.toLanguageString(l.flatColorPickerClearBtn,l.messages[l.flatColorPickerClearBtn]),icon:"droplet-slash",svgIcon:m.dropletSlashIcon}),z&&t.createElement("div",{className:"k-coloreditor-preview k-vstack"},t.createElement("span",{className:n.classNames("k-coloreditor-preview-color","k-color-preview",{"k-no-color":L===void 0})},t.createElement("span",{className:"k-color-preview-mask",style:{background:c||void 0}})),t.createElement("span",{className:n.classNames("k-coloreditor-current-color","k-color-preview",{"k-no-color":k===void 0}),onClick:$},t.createElement("span",{className:"k-color-preview-mask",style:{background:k||void 0}})))),f&&t.createElement(n.WatermarkOverlay,{message:B})),t.createElement("div",{className:"k-coloreditor-views k-vstack"},(E&&C||d&&v)&&t.createElement(Z.ColorGradient,{ref:F,role:"none",ariaLabel:void 0,value:c,onChange:q,opacity:e.opacity,format:e.format,size:i,rounded:j,_adaptive:e._gradientSettings?e._gradientSettings._adaptive:void 0,...e._gradientSettings}),(E&&!C||d&&!v)&&t.createElement(Y.ColorPalette,{value:c,onChange:q,size:i,...e._paletteSettings})),N&&t.createElement("div",{className:"k-coloreditor-footer k-actions k-actions-start k-actions-horizontal"},t.createElement(s.Button,{type:"button",themeColor:"primary",className:"k-coloreditor-apply",onClick:H},g.toLanguageString(l.flatColorPickerApplyBtn,l.messages[l.flatColorPickerApplyBtn])),t.createElement(s.Button,{type:"button",className:"k-coloreditor-cancel",onClick:W},g.toLanguageString(l.flatColorPickerCancelBtn,l.messages[l.flatColorPickerCancelBtn]))))}),te={id:o.string,style:o.any,className:o.string,value:o.string,defaultValue:o.string,onPreviewChange:o.func,onChange:o.func,opacity:o.bool,format:o.any,tabIndex:o.number,ariaLabel:o.string,ariaLabelledBy:o.string,disabled:o.bool,view:o.any,header:o.any,showClearButton:o.bool,showPreview:o.bool,showButtons:o.bool,views:o.array,size:o.oneOf(["small","medium","large"])};_.displayName="KendoFlatColorPicker";_.propTypes=te;exports.FlatColorPicker=_;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const X=require("react"),o=require("prop-types"),n=require("@progress/kendo-react-common"),s=require("@progress/kendo-react-buttons"),m=require("@progress/kendo-svg-icons"),Y=require("./ColorPalette.js"),Z=require("./ColorGradient.js"),x=require("../package-metadata.js"),p=require("@progress/kendo-react-intl"),l=require("../messages/index.js");function ee(e){const b=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const f in e)if(f!=="default"){const B=Object.getOwnPropertyDescriptor(e,f);Object.defineProperty(b,f,B.get?B:{enumerable:!0,get:()=>e[f]})}}return b.default=e,Object.freeze(b)}const t=ee(X),V=t.forwardRef((e,b)=>{const f=!n.validatePackage(x.packageMetadata,{component:"FlatColorPicker"}),B=n.getLicenseMessage(x.packageMetadata),h=t.useRef(null),w=t.useRef(null),F=t.useRef(null),{defaultValue:P,showButtons:N=!0,showPreview:z=!0,showClearButton:T=!0,view:E=e.views?void 0:"ColorGradient",views:d=E?void 0:["gradient","palette"],activeView:S="gradient",size:i=void 0,rounded:j=void 0}=e,[C,D]=t.useState((E||"ColorGradient")==="ColorGradient"),[v,_]=t.useState((d!=null?d:[])[0]==="gradient"&&S==="gradient"),[c,y]=t.useState(e.value||P||void 0),[k,L]=t.useState(e.value||P||void 0),M=e.value!==void 0?e.value:void 0;t.useEffect(()=>{y(e.value)},[e.value]);const g=p.useLocalization(),A=t.useCallback(()=>{h.current&&h.current.focus()},[h]);t.useImperativeHandle(h,()=>({element:w.current,focus:A,props:e,value:M}),[M,A,e]),t.useImperativeHandle(b,()=>h.current);const R=t.useCallback(a=>{(a==="ColorGradient"&&!C||a==="ColorPalette"&&C)&&D(!C)},[C]),I=t.useCallback(a=>{a==="gradient"&&!v||a==="palette"&&v||a==="palette"&&S==="gradient"?_(!v):a==="gradient"&&S==="palette"&&_(!0)},[S,v]),K=t.useCallback(a=>{var u;const r=P||void 0;if(y(r),L(r),(u=e.gradientSettings)!=null&&u._adaptive&&e.setAdaptiveModeValue&&e.setAdaptiveModeValue(r),e.onPreviewChange){const G={value:r,nativeEvent:a.nativeEvent,syntheticEvent:a};e.onPreviewChange.call(void 0,G)}},[P,e.onPreviewChange]),q=t.useCallback(a=>{var r;if(y(a.value),e.onPreviewChange){const u={value:a.value,nativeEvent:a.nativeEvent,syntheticEvent:a.syntheticEvent};e.onPreviewChange.call(void 0,u)}(r=e.gradientSettings)!=null&&r._adaptive&&e.setAdaptiveModeValue&&e.setAdaptiveModeValue(a.value)},[e.onPreviewChange]),H=t.useCallback(a=>{if(c!==void 0&&L(c),e.onChange){const r={value:c,nativeEvent:a.nativeEvent,syntheticEvent:a};e.onChange.call(void 0,r)}},[c,e.onChange]),W=t.useCallback(()=>{y(k),e.setOpen&&e.setOpen(!1)},[k]),$=t.useCallback(a=>{if(y(k),e.onPreviewChange){const r={value:k,nativeEvent:a.nativeEvent,syntheticEvent:a};e.onPreviewChange.call(void 0,r)}},[k,e.onPreviewChange]),J=t.useCallback(a=>{var u,G;if((!a.relatedTarget||!((u=w.current)!=null&&u.contains(a.relatedTarget)))&&!((G=e.gradientSettings)!=null&&G._adaptive)&&(!N&&c!==void 0&&L(c),!N&&e.onChange)){const U={value:c,nativeEvent:a.nativeEvent,syntheticEvent:a};e.onChange.call(void 0,U)}},[c,N,e.onChange]),O=t.useMemo(()=>new n.Navigation({root:w,selectors:[".k-coloreditor"],tabIndex:0,keyboardEvents:{keydown:{Tab:(a,r,u)=>{n.getActiveElement(document)===a?n.disableNavigatableContainer(a):n.keepFocusInContainer(u,a)},Enter:(a,r,u)=>{n.getActiveElement(document)===a&&(n.focusFirstFocusableChild(a),n.enableNavigatableContainer(a))},Escape:(a,r,u)=>{n.getActiveElement(document)!==a&&(a.focus(),n.disableNavigatableContainer(a))}}}}),[]),Q=t.useCallback(O.triggerKeyboardEvent.bind(O),[]);return t.createElement("div",{id:e.id,role:"textbox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledBy,"aria-disabled":e.disabled?"true":void 0,style:{position:"relative",...e.style},ref:w,tabIndex:n.getTabIndex(e.tabIndex,e.disabled),className:n.classNames("k-flatcolorpicker k-coloreditor",{[`k-coloreditor-${n.kendoThemeMaps.sizeMap[i]||i}`]:i,"k-disabled":e.disabled},e.className),onBlur:J,onKeyDown:Q},e.header||t.createElement("div",{className:"k-coloreditor-header k-hstack"},t.createElement("div",{className:"k-coloreditor-header-actions k-hstack"},d&&d[0]==="gradient"&&d[1]==="palette"&&t.createElement(s.ButtonGroup,{className:"k-button-group-flat"},t.createElement(s.Button,{type:"button","aria-label":g.toLanguageString(l.flatColorPickerColorGradientBtn,l.messages[l.flatColorPickerColorGradientBtn]),size:i,fillMode:"flat",svgIcon:m.dropletSliderIcon,className:v?"k-selected":void 0,onClick:()=>I("gradient")}),t.createElement(s.Button,{type:"button","aria-label":g.toLanguageString(l.flatColorPickerColorPaletteBtn,l.messages[l.flatColorPickerColorPaletteBtn]),size:i,fillMode:"flat",svgIcon:m.paletteIcon,className:v?void 0:"k-selected",onClick:()=>I("palette")})),d&&d[0]==="palette"&&d[1]==="gradient"&&t.createElement(s.ButtonGroup,{className:"k-button-group-flat"},t.createElement(s.Button,{type:"button","aria-label":g.toLanguageString(l.flatColorPickerColorPaletteBtn,l.messages[l.flatColorPickerColorPaletteBtn]),fillMode:"flat",size:i,svgIcon:m.paletteIcon,className:v?void 0:"k-selected",onClick:()=>I("palette")}),t.createElement(s.Button,{type:"button","aria-label":g.toLanguageString(l.flatColorPickerColorGradientBtn,l.messages[l.flatColorPickerColorGradientBtn]),fillMode:"flat",size:i,svgIcon:m.dropletSliderIcon,className:v?"k-selected":void 0,onClick:()=>I("gradient")})),E&&t.createElement(s.ButtonGroup,{className:"k-button-group-flat"},t.createElement(s.Button,{type:"button","aria-label":g.toLanguageString(l.flatColorPickerColorGradientBtn,l.messages[l.flatColorPickerColorGradientBtn]),fillMode:"flat",size:i,className:C?"k-selected":void 0,onClick:()=>R("ColorGradient"),icon:"droplet-slider",svgIcon:m.dropletSliderIcon}),t.createElement(s.Button,{type:"button","aria-label":g.toLanguageString(l.flatColorPickerColorPaletteBtn,l.messages[l.flatColorPickerColorPaletteBtn]),fillMode:"flat",size:i,className:C?void 0:"k-selected",onClick:()=>R("ColorPalette"),icon:"palette",svgIcon:m.paletteIcon}))),t.createElement("div",{className:"k-spacer"}),t.createElement("div",{className:"k-coloreditor-header-actions k-hstack"},T&&t.createElement(s.Button,{type:"button",fillMode:"flat",size:i,onClick:K,"aria-label":g.toLanguageString(l.flatColorPickerClearBtn,l.messages[l.flatColorPickerClearBtn]),icon:"droplet-slash",svgIcon:m.dropletSlashIcon}),z&&t.createElement("div",{className:"k-coloreditor-preview k-vstack"},t.createElement("span",{className:n.classNames("k-coloreditor-preview-color","k-color-preview",{"k-no-color":M===void 0})},t.createElement("span",{className:"k-color-preview-mask",style:{background:c||void 0}})),t.createElement("span",{className:n.classNames("k-coloreditor-current-color","k-color-preview",{"k-no-color":k===void 0}),onClick:$},t.createElement("span",{className:"k-color-preview-mask",style:{background:k||void 0}})))),f&&t.createElement(n.WatermarkOverlay,{message:B})),t.createElement("div",{className:"k-coloreditor-views k-vstack"},(E&&C||d&&v)&&t.createElement(Z.ColorGradient,{ref:F,role:"none",ariaLabel:void 0,value:c,onChange:q,opacity:e.opacity,format:e.format,size:i,rounded:j,_adaptive:e.gradientSettings?e.gradientSettings._adaptive:void 0,...e.gradientSettings}),(E&&!C||d&&!v)&&t.createElement(Y.ColorPalette,{value:c,onChange:q,size:i,ariaLabel:g.toLanguageString(l.colorPaletteAriaLabel,l.messages[l.colorPaletteAriaLabel]),...e.paletteSettings})),N&&t.createElement("div",{className:"k-coloreditor-footer k-actions k-actions-start k-actions-horizontal"},t.createElement(s.Button,{type:"button",themeColor:"primary",className:"k-coloreditor-apply",onClick:H},g.toLanguageString(l.flatColorPickerApplyBtn,l.messages[l.flatColorPickerApplyBtn])),t.createElement(s.Button,{type:"button",className:"k-coloreditor-cancel",onClick:W},g.toLanguageString(l.flatColorPickerCancelBtn,l.messages[l.flatColorPickerCancelBtn]))))}),te={id:o.string,style:o.any,className:o.string,value:o.string,defaultValue:o.string,onPreviewChange:o.func,onChange:o.func,opacity:o.bool,format:o.any,tabIndex:o.number,ariaLabel:o.string,ariaLabelledBy:o.string,disabled:o.bool,view:o.any,header:o.any,showClearButton:o.bool,showPreview:o.bool,showButtons:o.bool,views:o.array,size:o.oneOf(["small","medium","large"])};V.displayName="KendoFlatColorPicker";V.propTypes=te;exports.FlatColorPicker=V;
@@ -8,13 +8,13 @@
8
8
  import * as a from "react";
9
9
  import l from "prop-types";
10
10
  import { validatePackage as ie, getLicenseMessage as re, Navigation as ce, getActiveElement as B, disableNavigatableContainer as K, focusFirstFocusableChild as se, enableNavigatableContainer as de, keepFocusInContainer as ve, classNames as M, kendoThemeMaps as ue, getTabIndex as ge, WatermarkOverlay as me } from "@progress/kendo-react-common";
11
- import { ButtonGroup as _, Button as u } from "@progress/kendo-react-buttons";
12
- import { dropletSliderIcon as V, paletteIcon as G, dropletSlashIcon as ke } from "@progress/kendo-svg-icons";
11
+ import { ButtonGroup as V, Button as u } from "@progress/kendo-react-buttons";
12
+ import { dropletSliderIcon as G, paletteIcon as _, dropletSlashIcon as ke } from "@progress/kendo-svg-icons";
13
13
  import { ColorPalette as Ce } from "./ColorPalette.mjs";
14
14
  import { ColorGradient as fe } from "./ColorGradient.mjs";
15
15
  import { packageMetadata as O } from "../package-metadata.mjs";
16
16
  import { useLocalization as be } from "@progress/kendo-react-intl";
17
- import { flatColorPickerAriaLabel as T, messages as v, flatColorPickerColorGradientBtn as k, flatColorPickerColorPaletteBtn as C, flatColorPickerClearBtn as D, flatColorPickerApplyBtn as H, flatColorPickerCancelBtn as W } from "../messages/index.mjs";
17
+ import { flatColorPickerColorGradientBtn as k, messages as v, flatColorPickerColorPaletteBtn as C, flatColorPickerClearBtn as T, colorPaletteAriaLabel as D, flatColorPickerApplyBtn as H, flatColorPickerCancelBtn as W } from "../messages/index.mjs";
18
18
  const $ = a.forwardRef((e, j) => {
19
19
  const q = !ie(O, { component: "FlatColorPicker" }), J = re(O), f = a.useRef(null), y = a.useRef(null), Q = a.useRef(null), {
20
20
  defaultValue: b,
@@ -30,7 +30,7 @@ const $ = a.forwardRef((e, j) => {
30
30
  (h || "ColorGradient") === "ColorGradient"
31
31
  ), [s, x] = a.useState(
32
32
  (r != null ? r : [])[0] === "gradient" && P === "gradient"
33
- ), [i, E] = a.useState(e.value || b || void 0), [m, I] = a.useState(e.value || b || void 0), L = e.value !== void 0 ? e.value : void 0;
33
+ ), [i, E] = a.useState(e.value || b || void 0), [m, L] = a.useState(e.value || b || void 0), I = e.value !== void 0 ? e.value : void 0;
34
34
  a.useEffect(() => {
35
35
  E(e.value);
36
36
  }, [e.value]);
@@ -43,9 +43,9 @@ const $ = a.forwardRef((e, j) => {
43
43
  element: y.current,
44
44
  focus: A,
45
45
  props: e,
46
- value: L
46
+ value: I
47
47
  }),
48
- [L, A, e]
48
+ [I, A, e]
49
49
  ), a.useImperativeHandle(j, () => f.current);
50
50
  const R = a.useCallback(
51
51
  (t) => {
@@ -61,7 +61,7 @@ const $ = a.forwardRef((e, j) => {
61
61
  (t) => {
62
62
  var c;
63
63
  const n = b || void 0;
64
- if (E(n), I(n), (c = e._gradientSettings) != null && c._adaptive && e.setAdaptiveModeValue && e.setAdaptiveModeValue(n), e.onPreviewChange) {
64
+ if (E(n), L(n), (c = e.gradientSettings) != null && c._adaptive && e.setAdaptiveModeValue && e.setAdaptiveModeValue(n), e.onPreviewChange) {
65
65
  const S = {
66
66
  value: n,
67
67
  nativeEvent: t.nativeEvent,
@@ -82,12 +82,12 @@ const $ = a.forwardRef((e, j) => {
82
82
  };
83
83
  e.onPreviewChange.call(void 0, c);
84
84
  }
85
- (n = e._gradientSettings) != null && n._adaptive && e.setAdaptiveModeValue && e.setAdaptiveModeValue(t.value);
85
+ (n = e.gradientSettings) != null && n._adaptive && e.setAdaptiveModeValue && e.setAdaptiveModeValue(t.value);
86
86
  },
87
87
  [e.onPreviewChange]
88
88
  ), ee = a.useCallback(
89
89
  (t) => {
90
- if (i !== void 0 && I(i), e.onChange) {
90
+ if (i !== void 0 && L(i), e.onChange) {
91
91
  const n = {
92
92
  value: i,
93
93
  nativeEvent: t.nativeEvent,
@@ -114,7 +114,7 @@ const $ = a.forwardRef((e, j) => {
114
114
  ), le = a.useCallback(
115
115
  (t) => {
116
116
  var c, S;
117
- if ((!t.relatedTarget || !((c = y.current) != null && c.contains(t.relatedTarget))) && !((S = e._gradientSettings) != null && S._adaptive) && (!w && i !== void 0 && I(i), !w && e.onChange)) {
117
+ if ((!t.relatedTarget || !((c = y.current) != null && c.contains(t.relatedTarget))) && !((S = e.gradientSettings) != null && S._adaptive) && (!w && i !== void 0 && L(i), !w && e.onChange)) {
118
118
  const oe = {
119
119
  value: i,
120
120
  nativeEvent: t.nativeEvent,
@@ -150,7 +150,7 @@ const $ = a.forwardRef((e, j) => {
150
150
  {
151
151
  id: e.id,
152
152
  role: "textbox",
153
- "aria-label": e.ariaLabel || d.toLanguageString(T, v[T]),
153
+ "aria-label": e.ariaLabel,
154
154
  "aria-labelledby": e.ariaLabelledBy,
155
155
  "aria-disabled": e.disabled ? "true" : void 0,
156
156
  style: { position: "relative", ...e.style },
@@ -167,7 +167,7 @@ const $ = a.forwardRef((e, j) => {
167
167
  onBlur: le,
168
168
  onKeyDown: ne
169
169
  },
170
- e.header || /* @__PURE__ */ a.createElement("div", { className: "k-coloreditor-header k-hstack" }, /* @__PURE__ */ a.createElement("div", { className: "k-coloreditor-header-actions k-hstack" }, r && r[0] === "gradient" && r[1] === "palette" && /* @__PURE__ */ a.createElement(_, { className: "k-button-group-flat" }, /* @__PURE__ */ a.createElement(
170
+ e.header || /* @__PURE__ */ a.createElement("div", { className: "k-coloreditor-header k-hstack" }, /* @__PURE__ */ a.createElement("div", { className: "k-coloreditor-header-actions k-hstack" }, r && r[0] === "gradient" && r[1] === "palette" && /* @__PURE__ */ a.createElement(V, { className: "k-button-group-flat" }, /* @__PURE__ */ a.createElement(
171
171
  u,
172
172
  {
173
173
  type: "button",
@@ -177,7 +177,7 @@ const $ = a.forwardRef((e, j) => {
177
177
  ),
178
178
  size: o,
179
179
  fillMode: "flat",
180
- svgIcon: V,
180
+ svgIcon: G,
181
181
  className: s ? "k-selected" : void 0,
182
182
  onClick: () => N("gradient")
183
183
  }
@@ -191,11 +191,11 @@ const $ = a.forwardRef((e, j) => {
191
191
  ),
192
192
  size: o,
193
193
  fillMode: "flat",
194
- svgIcon: G,
194
+ svgIcon: _,
195
195
  className: s ? void 0 : "k-selected",
196
196
  onClick: () => N("palette")
197
197
  }
198
- )), r && r[0] === "palette" && r[1] === "gradient" && /* @__PURE__ */ a.createElement(_, { className: "k-button-group-flat" }, /* @__PURE__ */ a.createElement(
198
+ )), r && r[0] === "palette" && r[1] === "gradient" && /* @__PURE__ */ a.createElement(V, { className: "k-button-group-flat" }, /* @__PURE__ */ a.createElement(
199
199
  u,
200
200
  {
201
201
  type: "button",
@@ -205,7 +205,7 @@ const $ = a.forwardRef((e, j) => {
205
205
  ),
206
206
  fillMode: "flat",
207
207
  size: o,
208
- svgIcon: G,
208
+ svgIcon: _,
209
209
  className: s ? void 0 : "k-selected",
210
210
  onClick: () => N("palette")
211
211
  }
@@ -219,11 +219,11 @@ const $ = a.forwardRef((e, j) => {
219
219
  ),
220
220
  fillMode: "flat",
221
221
  size: o,
222
- svgIcon: V,
222
+ svgIcon: G,
223
223
  className: s ? "k-selected" : void 0,
224
224
  onClick: () => N("gradient")
225
225
  }
226
- )), h && /* @__PURE__ */ a.createElement(_, { className: "k-button-group-flat" }, /* @__PURE__ */ a.createElement(
226
+ )), h && /* @__PURE__ */ a.createElement(V, { className: "k-button-group-flat" }, /* @__PURE__ */ a.createElement(
227
227
  u,
228
228
  {
229
229
  type: "button",
@@ -236,7 +236,7 @@ const $ = a.forwardRef((e, j) => {
236
236
  className: g ? "k-selected" : void 0,
237
237
  onClick: () => R("ColorGradient"),
238
238
  icon: "droplet-slider",
239
- svgIcon: V
239
+ svgIcon: G
240
240
  }
241
241
  ), /* @__PURE__ */ a.createElement(
242
242
  u,
@@ -251,7 +251,7 @@ const $ = a.forwardRef((e, j) => {
251
251
  className: g ? void 0 : "k-selected",
252
252
  onClick: () => R("ColorPalette"),
253
253
  icon: "palette",
254
- svgIcon: G
254
+ svgIcon: _
255
255
  }
256
256
  ))), /* @__PURE__ */ a.createElement("div", { className: "k-spacer" }), /* @__PURE__ */ a.createElement("div", { className: "k-coloreditor-header-actions k-hstack" }, X && /* @__PURE__ */ a.createElement(
257
257
  u,
@@ -261,8 +261,8 @@ const $ = a.forwardRef((e, j) => {
261
261
  size: o,
262
262
  onClick: p,
263
263
  "aria-label": d.toLanguageString(
264
- D,
265
- v[D]
264
+ T,
265
+ v[T]
266
266
  ),
267
267
  icon: "droplet-slash",
268
268
  svgIcon: ke
@@ -271,7 +271,7 @@ const $ = a.forwardRef((e, j) => {
271
271
  "span",
272
272
  {
273
273
  className: M("k-coloreditor-preview-color", "k-color-preview", {
274
- "k-no-color": L === void 0
274
+ "k-no-color": I === void 0
275
275
  })
276
276
  },
277
277
  /* @__PURE__ */ a.createElement(
@@ -309,8 +309,8 @@ const $ = a.forwardRef((e, j) => {
309
309
  format: e.format,
310
310
  size: o,
311
311
  rounded: Y,
312
- _adaptive: e._gradientSettings ? e._gradientSettings._adaptive : void 0,
313
- ...e._gradientSettings
312
+ _adaptive: e.gradientSettings ? e.gradientSettings._adaptive : void 0,
313
+ ...e.gradientSettings
314
314
  }
315
315
  ), (h && !g || r && !s) && /* @__PURE__ */ a.createElement(
316
316
  Ce,
@@ -318,7 +318,11 @@ const $ = a.forwardRef((e, j) => {
318
318
  value: i,
319
319
  onChange: F,
320
320
  size: o,
321
- ...e._paletteSettings
321
+ ariaLabel: d.toLanguageString(
322
+ D,
323
+ v[D]
324
+ ),
325
+ ...e.paletteSettings
322
326
  }
323
327
  )),
324
328
  w && /* @__PURE__ */ a.createElement("div", { className: "k-coloreditor-footer k-actions k-actions-start k-actions-horizontal" }, /* @__PURE__ */ a.createElement(
@@ -90,6 +90,13 @@ export interface ColorPaletteProps {
90
90
  * This property is related to accessibility.
91
91
  */
92
92
  ariaLabelledBy?: string;
93
+ /**
94
+ * Sets the `aria-label` attribute on the ColorPalette.
95
+ *
96
+ * @remarks
97
+ * This property is related to accessibility.
98
+ */
99
+ ariaLabel?: string;
93
100
  /**
94
101
  * @hidden
95
102
  */
@@ -36,4 +36,9 @@ export interface ColorPickerPaletteSettings {
36
36
  * * `{ width: number, height: number }`
37
37
  */
38
38
  tileSize?: number | TileSize;
39
+ /**
40
+ * Sets the `aria-label` attribute of the color palette grid.
41
+ * Use this to provide an accessible name when the palette is embedded inside another component.
42
+ */
43
+ ariaLabel?: string;
39
44
  }