@progress/kendo-react-inputs 13.4.0-develop.5 → 14.0.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.
@@ -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 xe=require("react"),r=require("prop-types"),n=require("@progress/kendo-react-common"),ke=require("../package-metadata.js"),qe=require("./Picker.js"),Ve=require("./ColorGradient.js"),Q=require("./ColorPalette.js"),N=require("./FlatColorPicker.js"),Me=require("@progress/kendo-react-buttons"),He=require("@progress/kendo-svg-icons"),d=require("../messages/index.js"),We=require("@progress/kendo-react-intl"),Ue=require("../common/AdaptiveMode.js"),je=require("@progress/kendo-react-layout");function Ge(g){const T=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(g){for(const P in g)if(P!=="default"){const F=Object.getOwnPropertyDescriptor(g,P);Object.defineProperty(T,P,F.get?F:{enumerable:!0,get:()=>g[P]})}}return T.default=g,Object.freeze(T)}const t=Ge(xe),Ke={opacity:!0},$e={palette:Q.DEFAULT_PRESET,tileSize:Q.DEFAULT_TILE_SIZE},J=g=>g!==void 0,me=n.createPropsContext(),X=t.forwardRef((g,T)=>{var ue,de;const P=!n.validatePackage(ke.packageMetadata,{component:"ColorPicker"}),F=n.getLicenseMessage(ke.packageMetadata),l=n.usePropsContext(me,g),_=We.useLocalization(),Y=n.useAdaptiveModeContext(),{size:p=w.size,rounded:C=w.rounded,fillMode:x=w.fillMode,gradientSettings:y=w.gradientSettings,paletteSettings:h=w.paletteSettings,flatColorPickerSettings:R,view:f=l.views?void 0:w.view,views:s=f?void 0:w.views,activeView:ee,popupSettings:b,valid:Ce,disabled:q,tabIndex:be,icon:V,svgIcon:M,iconClassName:B,onChange:H,onFocus:W,onBlur:U,onActiveColorClick:j,className:Ee,adaptive:we,adaptiveTitle:te=_.toLanguageString(d.colorPickerAdaptiveTitle,d.messages[d.colorPickerAdaptiveTitle]),adaptiveSubtitle:ne}=l,u=t.useRef(null),A=t.useRef(null),O=t.useRef(null),m=t.useRef(null),S=t.useRef(void 0),Pe=t.useRef(null),[ye,ae]=t.useState(!1),[Se,Te]=t.useState(l.defaultValue||void 0),[_e,he]=t.useState(!1),[D,Re]=t.useState(),G=J(l.value),E=J(l.open),i=G?l.value:Se,v=E?l.open:_e,oe=t.useRef(i),re=t.useCallback(()=>{u.current&&u.current.focus()},[]);t.useImperativeHandle(T,()=>({element:u.current,actionElement:Pe.current,value:i,focus:re}),[i,re]);const K=!!(D&&Y&&D<=Y.medium&&we);t.useEffect(()=>{const e=n.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(ze.bind(void 0));return document!=null&&document.body&&e&&e.observe(document.body),()=>{document!=null&&document.body&&e&&e.disconnect()}},[]);const o=t.useCallback((e,c)=>{E||(!e&&!c&&u&&u.current&&u.current.focus(),he(e))},[E]),le=t.useMemo(()=>new n.Navigation({root:u,selectors:[".k-colorpicker",".k-color-picker-popup"],tabIndex:0,keyboardEvents:{keydown:{Escape:(e,c,a)=>{o(!1)},Enter:(e,c,a)=>{!E&&e===u.current&&(a.preventDefault(),a.stopPropagation(),o(!0))},ArrowDown:(e,c,a)=>{a.altKey&&(a.preventDefault(),a.stopPropagation(),o(!0))},ArrowUp:(e,c,a)=>{a.altKey&&(a.preventDefault(),a.stopPropagation(),o(!1))},Tab:(e,c,a)=>{var I,pe,ge;if(n.getActiveElement(document)!==u.current){const fe=(I=O.current)==null?void 0:I.wrapperRef.current,z=(pe=A.current)==null?void 0:pe.wrapperRef.current,ve=(ge=m.current)==null?void 0:ge.element;f==="palette"&&fe?n.keepFocusInContainer(a,fe):f==="gradient"&&z?n.keepFocusInContainer(a,z):f==="combo"&&z?n.keepFocusInContainer(a,z.parentElement):s&&ve&&n.keepFocusInContainer(a,ve)}}}}}),[o,E]),Ae=t.useCallback(le.triggerKeyboardEvent.bind(le),[]),Ie=t.useCallback(()=>{E||(A.current&&A.current.wrapperRef.current?n.focusFirstFocusableChild(A.current.wrapperRef.current):O.current?O.current.focus():m.current&&m.current.element&&n.focusFirstFocusableChild(m.current.element))},[E]),L=e=>oe.current=e,ie=t.useCallback(e=>{const c={value:oe.current,nativeEvent:e.nativeEvent,syntheticEvent:e};k(c),o(!v,!0)},[v]),$=t.useCallback(()=>{o(!1,!0)},[o]),Fe=t.useCallback(e=>{j&&j.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:i,target:{element:u.current,value:i}})},[j,i]),Be=t.useCallback(e=>{S.current?(clearTimeout(S.current),S.current=void 0):(ae(!0),K&&!v&&o(!0)),W&&W.call(void 0,{nativeEvent:e.nativeEvent,syntheticEvent:e})},[K,W,v,o]),Oe=t.useCallback(()=>{o(!1,!0),ae(!1),S.current=void 0},[]),De=t.useCallback(e=>{clearTimeout(S.current),S.current=window.setTimeout(Oe),U&&U.call(void 0,{nativeEvent:e.nativeEvent,syntheticEvent:e})},[U]),k=t.useCallback((e,c)=>{var I;const a=c?e.rgbaValue||"":(I=e.value)!=null?I:"";G||Te(a),H&&H.call(void 0,{value:a,nativeEvent:e.nativeEvent,syntheticEvent:e.syntheticEvent,target:{element:u.current,value:a}}),o(!1)},[G,H]),ce=t.useCallback(e=>k(e,!0),[J,k]),Z=t.useCallback(e=>t.createElement(t.Fragment,null,(f==="combo"||f==="gradient")&&t.createElement(Ve.ColorGradient,{...y,_adaptive:e,ref:A,isInsidePopup:!0,size:e?"large":p,value:i,onChange:k}),(f==="combo"||f==="palette")&&t.createElement(Q.ColorPalette,{...h,ref:O,size:e?"large":p,value:i,onChange:ce}),s&&s[0]==="gradient"&&s[1]==="palette"&&t.createElement(N.FlatColorPicker,{...R,_paletteSettings:h,_gradientSettings:{_adaptive:e,...y},ref:m,size:e?"large":p,rounded:C,views:["gradient","palette"],activeView:ee,setOpen:o,showButtons:!e,value:i,onChange:k,setAdaptiveModeValue:L}),s&&s[0]==="palette"&&s[1]==="gradient"&&t.createElement(N.FlatColorPicker,{...R,_paletteSettings:h,_gradientSettings:{_adaptive:e,...y},ref:m,size:e?"large":p,rounded:C,views:["palette","gradient"],setOpen:o,showButtons:!e,value:i,onChange:k,setAdaptiveModeValue:L}),s&&s.includes("gradient")&&!s.includes("palette")&&t.createElement(N.FlatColorPicker,{...R,_gradientSettings:{_adaptive:e,...y},ref:m,size:e?"large":p,rounded:C,views:["gradient"],showButtons:!e,setOpen:o,value:i,onChange:k,setAdaptiveModeValue:L}),s&&s.includes("palette")&&!s.includes("gradient")&&t.createElement(N.FlatColorPicker,{...R,_paletteSettings:h,_gradientSettings:{_adaptive:e,...y},ref:m,size:e?"large":p,rounded:C,views:["palette"],showButtons:!e,setOpen:o,value:i,onChange:k,setAdaptiveModeValue:L}),P&&t.createElement(n.WatermarkOverlay,{message:F})),[ee,x,R,y,k,ce,h,o,p,i,f,s]),Le=t.useCallback(()=>{var c;const e={animation:!!((c=b==null?void 0:b.animate)==null||c),title:te,subTitle:ne,expand:v,onClose:$,windowWidth:D,footer:{cancelText:_.toLanguageString(d.flatColorPickerCancelBtn,d.messages[d.flatColorPickerCancelBtn]),onCancel:$,applyText:_.toLanguageString(d.flatColorPickerApplyBtn,d.messages[d.flatColorPickerApplyBtn]),onApply:ie}};return t.createElement(Ue.AdaptiveMode,{...e},t.createElement(je.ActionSheetContent,null,Z(!0)))},[b==null?void 0:b.animate,te,ne,v,$,D,_,ie,Z]),ze=t.useCallback(e=>{for(const c of e)Re(c.target.clientWidth)},[]),se=n.useDir(u,l.dir),Ne=Ce!==!1;return t.createElement("span",{id:l.id,role:"combobox","aria-label":l.ariaLabel,"aria-labelledby":l.ariaLabelledBy,"aria-describedby":l.ariaDescribedBy,"aria-haspopup":"dialog","aria-expanded":v,"aria-controls":`k-colorpicker-popup-${(ue=l.id)!=null?ue:0}`,"aria-disabled":q?"true":void 0,className:n.classNames("k-colorpicker","k-picker","k-icon-picker",{[`k-picker-${n.kendoThemeMaps.sizeMap[p]||p}`]:p,[`k-picker-${x}`]:x,[`k-rounded-${n.kendoThemeMaps.roundedMap[C]||C}`]:C,"k-invalid":!Ne,"k-disabled":q,"k-focus":ye,className:Ee}),ref:u,tabIndex:n.getTabIndex(be,q),title:l.title,onKeyDown:Ae,onFocus:Be,onBlur:De,dir:se},t.createElement(qe.Picker,{dir:se,open:v,onOpen:Ie,popupAnchor:u.current||void 0,popupSettings:{id:`k-colorpicker-popup-${(de=l.id)!=null?de:0}`,...b},input:t.createElement("span",{onClick:Fe,className:"k-input-inner"},t.createElement("span",{className:n.classNames("k-value-icon","k-color-preview",{"k-no-color":!i,"k-icon-color-preview":V||M||B})},B&&t.createElement("span",{className:n.classNames("k-color-preview-icon",B)}),!B&&(V||M)&&t.createElement(n.IconWrap,{name:V,icon:M}),t.createElement("span",{className:"k-color-preview-mask",style:{backgroundColor:i}}))),button:t.createElement(Me.Button,{tabIndex:-1,type:"button",onClick:()=>o(!v),className:"k-input-button",icon:"caret-alt-down",svgIcon:He.caretAltDownIcon,"aria-label":_.toLanguageString(d.colorPickerDropdownButtonAriaLabel,d.messages[d.colorPickerDropdownButtonAriaLabel])}),content:Z(!1),_mobileMode:K,_actionSheet:Le()}))});X.propTypes={value:r.string,defaultValue:r.string,disabled:r.bool,view:r.oneOf(["gradient","palette","combo"]),views:r.arrayOf(r.oneOf(["gradient","palette"])),dir:r.string,id:r.string,icon:r.string,svgIcon:n.svgIconPropType,ariaLabelledBy:r.string,ariaDescribedBy:r.string,size:r.oneOf(["small","medium","large"]),rounded:r.oneOf(["small","medium","large","full","none"]),fillMode:r.oneOf(["solid","flat","outline"]),className:r.string,adaptive:r.bool,adaptiveTitle:r.string,adaptiveSubtitle:r.string};const w={size:void 0,rounded:void 0,fillMode:void 0,view:"palette",views:["gradient","palette"],gradientSettings:Ke,paletteSettings:$e};X.displayName="KendoColorPicker";exports.ColorPicker=X;exports.ColorPickerPropsContext=me;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const xe=require("react"),r=require("prop-types"),n=require("@progress/kendo-react-common"),ke=require("../package-metadata.js"),qe=require("./Picker.js"),Ve=require("./ColorGradient.js"),Q=require("./ColorPalette.js"),N=require("./FlatColorPicker.js"),Me=require("@progress/kendo-react-buttons"),He=require("@progress/kendo-svg-icons"),d=require("../messages/index.js"),We=require("@progress/kendo-react-intl"),Ue=require("../common/AdaptiveMode.js"),je=require("@progress/kendo-react-layout");function Ge(g){const T=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(g){for(const P in g)if(P!=="default"){const F=Object.getOwnPropertyDescriptor(g,P);Object.defineProperty(T,P,F.get?F:{enumerable:!0,get:()=>g[P]})}}return T.default=g,Object.freeze(T)}const t=Ge(xe),Ke={opacity:!0},$e={palette:Q.DEFAULT_PRESET,tileSize:Q.DEFAULT_TILE_SIZE},J=g=>g!==void 0,me=n.createPropsContext(),X=t.forwardRef((g,T)=>{var ue,de;const P=!n.validatePackage(ke.packageMetadata,{component:"ColorPicker"}),F=n.getLicenseMessage(ke.packageMetadata),l=n.usePropsContext(me,g),_=We.useLocalization(),Y=n.useAdaptiveModeContext(),{size:p=w.size,rounded:C=w.rounded,fillMode:x=w.fillMode,gradientSettings:y=w.gradientSettings,paletteSettings:h=w.paletteSettings,flatColorPickerSettings:R,view:f=l.views?void 0:w.view,views:s=f?void 0:w.views,activeView:ee,popupSettings:b,valid:Ce,disabled:q,tabIndex:be,icon:V,svgIcon:M,iconClassName:B,onChange:H,onFocus:W,onBlur:U,onActiveColorClick:j,className:Ee,adaptive:we,adaptiveTitle:te=_.toLanguageString(d.colorPickerAdaptiveTitle,d.messages[d.colorPickerAdaptiveTitle]),adaptiveSubtitle:ne}=l,u=t.useRef(null),A=t.useRef(null),O=t.useRef(null),m=t.useRef(null),S=t.useRef(void 0),Pe=t.useRef(null),[ye,ae]=t.useState(!1),[Se,Te]=t.useState(l.defaultValue||void 0),[_e,he]=t.useState(!1),[D,Re]=t.useState(),G=J(l.value),E=J(l.open),i=G?l.value:Se,v=E?l.open:_e,oe=t.useRef(i),re=t.useCallback(()=>{u.current&&u.current.focus()},[]);t.useImperativeHandle(T,()=>({element:u.current,actionElement:Pe.current,value:i,focus:re}),[i,re]);const K=!!(D&&Y&&D<=Y.medium&&we);t.useEffect(()=>{const e=n.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(ze.bind(void 0));return document!=null&&document.body&&e&&e.observe(document.body),()=>{document!=null&&document.body&&e&&e.disconnect()}},[]);const o=t.useCallback((e,c)=>{E||(!e&&!c&&u&&u.current&&u.current.focus(),he(e))},[E]),le=t.useMemo(()=>new n.Navigation({root:u,selectors:[".k-colorpicker",".k-color-picker-popup"],tabIndex:0,keyboardEvents:{keydown:{Escape:(e,c,a)=>{o(!1)},Enter:(e,c,a)=>{!E&&e===u.current&&(a.preventDefault(),a.stopPropagation(),o(!0))},ArrowDown:(e,c,a)=>{a.altKey&&(a.preventDefault(),a.stopPropagation(),o(!0))},ArrowUp:(e,c,a)=>{a.altKey&&(a.preventDefault(),a.stopPropagation(),o(!1))},Tab:(e,c,a)=>{var I,pe,ge;if(n.getActiveElement(document)!==u.current){const fe=(I=O.current)==null?void 0:I.wrapperRef.current,z=(pe=A.current)==null?void 0:pe.wrapperRef.current,ve=(ge=m.current)==null?void 0:ge.element;f==="palette"&&fe?n.keepFocusInContainer(a,fe):f==="gradient"&&z?n.keepFocusInContainer(a,z):f==="combo"&&z?n.keepFocusInContainer(a,z.parentElement):s&&ve&&n.keepFocusInContainer(a,ve)}}}}}),[o,E]),Ae=t.useCallback(le.triggerKeyboardEvent.bind(le),[]),Ie=t.useCallback(()=>{E||(A.current&&A.current.wrapperRef.current?n.focusFirstFocusableChild(A.current.wrapperRef.current):O.current?O.current.focus():m.current&&m.current.element&&n.focusFirstFocusableChild(m.current.element))},[E]),L=e=>oe.current=e,ie=t.useCallback(e=>{const c={value:oe.current,nativeEvent:e.nativeEvent,syntheticEvent:e};k(c),o(!v,!0)},[v]),$=t.useCallback(()=>{o(!1,!0)},[o]),Fe=t.useCallback(e=>{j&&j.call(void 0,{syntheticEvent:e,nativeEvent:e.nativeEvent,value:i,target:{element:u.current,value:i}})},[j,i]),Be=t.useCallback(e=>{S.current?(clearTimeout(S.current),S.current=void 0):(ae(!0),K&&!v&&o(!0)),W&&W.call(void 0,{nativeEvent:e.nativeEvent,syntheticEvent:e})},[K,W,v,o]),Oe=t.useCallback(()=>{o(!1,!0),ae(!1),S.current=void 0},[]),De=t.useCallback(e=>{clearTimeout(S.current),S.current=window.setTimeout(Oe),U&&U.call(void 0,{nativeEvent:e.nativeEvent,syntheticEvent:e})},[U]),k=t.useCallback((e,c)=>{var I;const a=c?e.rgbaValue||"":(I=e.value)!=null?I:"";G||Te(a),H&&H.call(void 0,{value:a,nativeEvent:e.nativeEvent,syntheticEvent:e.syntheticEvent,target:{element:u.current,value:a}}),o(!1)},[G,H]),ce=t.useCallback(e=>k(e,!0),[J,k]),Z=t.useCallback(e=>t.createElement(t.Fragment,null,(f==="combo"||f==="gradient")&&t.createElement(Ve.ColorGradient,{...y,_adaptive:e,ref:A,isInsidePopup:!0,size:e?"large":p,value:i,onChange:k}),(f==="combo"||f==="palette")&&t.createElement(Q.ColorPalette,{...h,ref:O,size:e?"large":p,value:i,onChange:ce}),s&&s[0]==="gradient"&&s[1]==="palette"&&t.createElement(N.FlatColorPicker,{...R,_paletteSettings:h,_gradientSettings:{_adaptive:e,...y},ref:m,size:e?"large":p,rounded:C,views:["gradient","palette"],activeView:ee,setOpen:o,showButtons:!e,value:i,onChange:k,setAdaptiveModeValue:L}),s&&s[0]==="palette"&&s[1]==="gradient"&&t.createElement(N.FlatColorPicker,{...R,_paletteSettings:h,_gradientSettings:{_adaptive:e,...y},ref:m,size:e?"large":p,rounded:C,views:["palette","gradient"],setOpen:o,showButtons:!e,value:i,onChange:k,setAdaptiveModeValue:L}),s&&s.includes("gradient")&&!s.includes("palette")&&t.createElement(N.FlatColorPicker,{...R,_gradientSettings:{_adaptive:e,...y},ref:m,size:e?"large":p,rounded:C,views:["gradient"],showButtons:!e,setOpen:o,value:i,onChange:k,setAdaptiveModeValue:L}),s&&s.includes("palette")&&!s.includes("gradient")&&t.createElement(N.FlatColorPicker,{...R,_paletteSettings:h,_gradientSettings:{_adaptive:e,...y},ref:m,size:e?"large":p,rounded:C,views:["palette"],showButtons:!e,setOpen:o,value:i,onChange:k,setAdaptiveModeValue:L}),P&&t.createElement(n.WatermarkOverlay,{message:F})),[ee,x,R,y,k,ce,h,o,p,i,f,s]),Le=t.useCallback(()=>{var c;const e={animation:!!((c=b==null?void 0:b.animate)==null||c),title:te,subTitle:ne,expand:v,onClose:$,windowWidth:D,footer:{cancelText:_.toLanguageString(d.flatColorPickerCancelBtn,d.messages[d.flatColorPickerCancelBtn]),onCancel:$,applyText:_.toLanguageString(d.flatColorPickerApplyBtn,d.messages[d.flatColorPickerApplyBtn]),onApply:ie}};return t.createElement(Ue.AdaptiveMode,{...e},t.createElement(je.ActionSheetContent,null,Z(!0)))},[b==null?void 0:b.animate,te,ne,v,$,D,_,ie,Z]),ze=t.useCallback(e=>{for(const c of e)Re(c.target.clientWidth)},[]),se=n.useDir(u,l.dir),Ne=Ce!==!1;return t.createElement("span",{id:l.id,role:"combobox","aria-label":l.ariaLabel,"aria-labelledby":l.ariaLabelledBy,"aria-describedby":l.ariaDescribedBy,"aria-haspopup":"dialog","aria-expanded":v,"aria-controls":`k-colorpicker-popup-${(ue=l.id)!=null?ue:0}`,"aria-disabled":q?"true":void 0,className:n.classNames("k-colorpicker","k-picker","k-icon-picker",{[`k-picker-${n.kendoThemeMaps.sizeMap[p]||p}`]:p,[`k-picker-${x}`]:x,[`k-rounded-${n.kendoThemeMaps.roundedMap[C]||C}`]:C,"k-invalid":!Ne,"k-disabled":q,"k-focus":ye,className:Ee}),ref:u,tabIndex:n.getTabIndex(be,q),title:l.title,onKeyDown:Ae,onFocus:Be,onBlur:De,dir:se},t.createElement(qe.Picker,{dir:se,open:v,onOpen:Ie,popupAnchor:u.current||void 0,popupSettings:{id:`k-colorpicker-popup-${(de=l.id)!=null?de:0}`,...b},input:t.createElement("span",{onClick:Fe,className:"k-input-inner"},t.createElement("span",{className:n.classNames("k-value-icon","k-color-preview",{"k-no-color":!i,"k-icon-color-preview":V||M||B})},B&&t.createElement("span",{className:n.classNames("k-color-preview-icon",B)}),!B&&(V||M)&&t.createElement(n.IconWrap,{name:V,icon:M}),t.createElement("span",{className:"k-color-preview-mask",style:{backgroundColor:i}}))),button:t.createElement(Me.Button,{tabIndex:-1,type:"button",onClick:()=>o(!v),className:"k-input-button",icon:"caret-alt-down",svgIcon:He.caretAltDownIcon,size:p,"aria-label":_.toLanguageString(d.colorPickerDropdownButtonAriaLabel,d.messages[d.colorPickerDropdownButtonAriaLabel])}),content:Z(!1),_mobileMode:K,_actionSheet:Le()}))});X.propTypes={value:r.string,defaultValue:r.string,disabled:r.bool,view:r.oneOf(["gradient","palette","combo"]),views:r.arrayOf(r.oneOf(["gradient","palette"])),dir:r.string,id:r.string,icon:r.string,svgIcon:n.svgIconPropType,ariaLabelledBy:r.string,ariaDescribedBy:r.string,size:r.oneOf(["small","medium","large"]),rounded:r.oneOf(["small","medium","large","full","none"]),fillMode:r.oneOf(["solid","flat","outline"]),className:r.string,adaptive:r.bool,adaptiveTitle:r.string,adaptiveSubtitle:r.string};const w={size:void 0,rounded:void 0,fillMode:void 0,view:"palette",views:["gradient","palette"],gradientSettings:Ke,paletteSettings:$e};X.displayName="KendoColorPicker";exports.ColorPicker=X;exports.ColorPickerPropsContext=me;
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import * as t from "react";
9
9
  import r from "prop-types";
10
- import { createPropsContext as Ke, validatePackage as $e, getLicenseMessage as Ge, usePropsContext as Me, useAdaptiveModeContext as Ze, canUseDOM as je, Navigation as qe, getActiveElement as Je, keepFocusInContainer as z, focusFirstFocusableChild as pe, WatermarkOverlay as Qe, useDir as Xe, getTabIndex as Ye, classNames as Z, kendoThemeMaps as fe, IconWrap as et, svgIconPropType as tt } from "@progress/kendo-react-common";
10
+ import { validatePackage as Ke, getLicenseMessage as $e, usePropsContext as Ge, useAdaptiveModeContext as Me, canUseDOM as Ze, Navigation as je, getActiveElement as qe, keepFocusInContainer as z, focusFirstFocusableChild as pe, WatermarkOverlay as Je, useDir as Qe, getTabIndex as Xe, classNames as Z, kendoThemeMaps as fe, IconWrap as Ye, createPropsContext as et, svgIconPropType as tt } from "@progress/kendo-react-common";
11
11
  import { packageMetadata as me } from "../package-metadata.mjs";
12
12
  import { Picker as nt } from "./Picker.mjs";
13
13
  import { ColorGradient as at } from "./ColorGradient.mjs";
@@ -24,9 +24,9 @@ const pt = {
24
24
  }, ft = {
25
25
  palette: ot,
26
26
  tileSize: rt
27
- }, j = (D) => D !== void 0, mt = Ke(), Ee = t.forwardRef((D, be) => {
27
+ }, j = (D) => D !== void 0, mt = et(), Ee = t.forwardRef((D, be) => {
28
28
  var ie, le;
29
- const we = !$e(me, { component: "ColorPicker" }), Se = Ge(me), o = Me(mt, D), w = st(), q = Ze(), {
29
+ const we = !Ke(me, { component: "ColorPicker" }), Se = $e(me), o = Ge(mt, D), w = st(), q = Me(), {
30
30
  size: u = C.size,
31
31
  rounded: v = C.rounded,
32
32
  fillMode: x = C.fillMode,
@@ -67,7 +67,7 @@ const pt = {
67
67
  );
68
68
  const $ = !!(R && q && R <= q.medium && Te);
69
69
  t.useEffect(() => {
70
- const e = je && window.ResizeObserver && new window.ResizeObserver(We.bind(void 0));
70
+ const e = Ze && window.ResizeObserver && new window.ResizeObserver(We.bind(void 0));
71
71
  return document != null && document.body && e && e.observe(document.body), () => {
72
72
  document != null && document.body && e && e.disconnect();
73
73
  };
@@ -77,7 +77,7 @@ const pt = {
77
77
  k || (!e && !l && s && s.current && s.current.focus(), Be(e));
78
78
  },
79
79
  [k]
80
- ), ne = t.useMemo(() => new qe({
80
+ ), ne = t.useMemo(() => new je({
81
81
  root: s,
82
82
  selectors: [".k-colorpicker", ".k-color-picker-popup"],
83
83
  tabIndex: 0,
@@ -97,7 +97,7 @@ const pt = {
97
97
  },
98
98
  Tab: (e, l, n) => {
99
99
  var h, ce, se;
100
- if (Je(document) !== s.current) {
100
+ if (qe(document) !== s.current) {
101
101
  const ue = (h = P.current) == null ? void 0 : h.wrapperRef.current, I = (ce = _.current) == null ? void 0 : ce.wrapperRef.current, de = (se = m.current) == null ? void 0 : se.element;
102
102
  d === "palette" && ue ? z(n, ue) : d === "gradient" && I ? z(n, I) : d === "combo" && I ? z(n, I.parentElement) : c && de && z(n, de);
103
103
  }
@@ -252,7 +252,7 @@ const pt = {
252
252
  onChange: f,
253
253
  setAdaptiveModeValue: A
254
254
  }
255
- ), we && /* @__PURE__ */ t.createElement(Qe, { message: Se })),
255
+ ), we && /* @__PURE__ */ t.createElement(Je, { message: Se })),
256
256
  [
257
257
  J,
258
258
  x,
@@ -297,7 +297,7 @@ const pt = {
297
297
  ]), We = t.useCallback((e) => {
298
298
  for (const l of e)
299
299
  Le(l.target.clientWidth);
300
- }, []), oe = Xe(s, o.dir), Ue = ye !== !1;
300
+ }, []), oe = Qe(s, o.dir), Ue = ye !== !1;
301
301
  return /* @__PURE__ */ t.createElement(
302
302
  "span",
303
303
  {
@@ -320,7 +320,7 @@ const pt = {
320
320
  className: he
321
321
  }),
322
322
  ref: s,
323
- tabIndex: Ye(_e, N),
323
+ tabIndex: Xe(_e, N),
324
324
  title: o.title,
325
325
  onKeyDown: De,
326
326
  onFocus: Oe,
@@ -344,7 +344,7 @@ const pt = {
344
344
  })
345
345
  },
346
346
  T && /* @__PURE__ */ t.createElement("span", { className: Z("k-color-preview-icon", T) }),
347
- !T && (O || F) && /* @__PURE__ */ t.createElement(et, { name: O, icon: F }),
347
+ !T && (O || F) && /* @__PURE__ */ t.createElement(Ye, { name: O, icon: F }),
348
348
  /* @__PURE__ */ t.createElement("span", { className: "k-color-preview-mask", style: { backgroundColor: i } })
349
349
  )),
350
350
  button: /* @__PURE__ */ t.createElement(
@@ -356,6 +356,7 @@ const pt = {
356
356
  className: "k-input-button",
357
357
  icon: "caret-alt-down",
358
358
  svgIcon: ct,
359
+ size: u,
359
360
  "aria-label": w.toLanguageString(
360
361
  Ce,
361
362
  L[Ce]
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import * as a from "react";
9
9
  import l from "prop-types";
10
- import { validatePackage as le, getLicenseMessage as ne, Navigation as oe, getActiveElement as B, disableNavigatableContainer as K, focusFirstFocusableChild as ie, enableNavigatableContainer as re, keepFocusInContainer as ce, classNames as M, getTabIndex as se, kendoThemeMaps as de, WatermarkOverlay as ve } from "@progress/kendo-react-common";
10
+ import { validatePackage as le, getLicenseMessage as ne, Navigation as oe, getActiveElement as B, disableNavigatableContainer as K, focusFirstFocusableChild as ie, enableNavigatableContainer as re, keepFocusInContainer as ce, classNames as M, kendoThemeMaps as se, getTabIndex as de, WatermarkOverlay as ve } from "@progress/kendo-react-common";
11
11
  import { ButtonGroup as L, Button as d } from "@progress/kendo-react-buttons";
12
12
  import { dropletSliderIcon as V, paletteIcon as G, dropletSlashIcon as ue } from "@progress/kendo-svg-icons";
13
13
  import { ColorPalette as ge } from "./ColorPalette.mjs";
@@ -155,11 +155,11 @@ const D = a.forwardRef((e, H) => {
155
155
  "aria-disabled": e.disabled ? "true" : void 0,
156
156
  style: { position: "relative", ...e.style },
157
157
  ref: y,
158
- tabIndex: se(e.tabIndex, e.disabled),
158
+ tabIndex: de(e.tabIndex, e.disabled),
159
159
  className: M(
160
160
  "k-flatcolorpicker k-coloreditor",
161
161
  {
162
- [`k-coloreditor-${de.sizeMap[o] || o}`]: o,
162
+ [`k-coloreditor-${se.sizeMap[o] || o}`]: o,
163
163
  "k-disabled": e.disabled
164
164
  },
165
165
  e.className
@@ -6,11 +6,11 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import { BaseEvent } from '@progress/kendo-react-common';
9
- import { ColorPalette } from '../ColorPalette.js';
9
+ import { ColorPaletteHandle } from './ColorPaletteHandle.js';
10
10
  /**
11
11
  * The arguments for the `onChange` ColorPalette event.
12
12
  */
13
- export interface ColorPaletteChangeEvent extends BaseEvent<ColorPalette> {
13
+ export interface ColorPaletteChangeEvent extends BaseEvent<ColorPaletteHandle> {
14
14
  /**
15
15
  * The current value of the ColorPalette.
16
16
  */
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import * as React from 'react';
9
+ /**
10
+ * Represents the imperative handle exposed by the ColorPalette component through ref.
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * const paletteRef = useRef<ColorPaletteHandle>(null);
15
+ *
16
+ * // Focus the palette programmatically
17
+ * paletteRef.current?.focus();
18
+ *
19
+ * // Access the wrapper element
20
+ * const width = paletteRef.current?.wrapperRef.current?.offsetWidth;
21
+ *
22
+ * <ColorPalette ref={paletteRef} palette="basic" />
23
+ * ```
24
+ */
25
+ export interface ColorPaletteHandle {
26
+ /**
27
+ * Programmatically focuses the ColorPalette component.
28
+ *
29
+ * When called:
30
+ * - The root div element receives DOM focus
31
+ * - The first color tile (or previously selected tile) is focused for keyboard navigation
32
+ * - The component's `onFocus` callback is triggered
33
+ */
34
+ focus: () => void;
35
+ /**
36
+ * A React ref to the root wrapper element of the ColorPalette.
37
+ *
38
+ * This ref can be used to access the underlying DOM element for scenarios such as:
39
+ * - Measuring the component dimensions
40
+ * - Integrating with non-React libraries
41
+ * - Programmatic scrolling or focus management
42
+ *
43
+ * The ref is populated after the component mounts and will be `null` before that.
44
+ */
45
+ wrapperRef: React.RefObject<HTMLDivElement | null>;
46
+ }