@progress/kendo-react-layout 14.5.0-develop.9 → 15.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.
Files changed (72) hide show
  1. package/MenuMcpWrapper.d.ts +17 -0
  2. package/MenuMcpWrapper.js +8 -0
  3. package/MenuMcpWrapper.mjs +18 -0
  4. package/README.md +4 -4
  5. package/actionsheet/ActionSheet.js +1 -1
  6. package/actionsheet/ActionSheet.mjs +18 -19
  7. package/actionsheet/ActionSheetItem.js +1 -1
  8. package/actionsheet/ActionSheetItem.mjs +1 -3
  9. package/bottomnavigation/BottomNavigation.js +1 -1
  10. package/bottomnavigation/BottomNavigation.mjs +85 -69
  11. package/bottomnavigation/BottomNavigationItem.js +1 -1
  12. package/bottomnavigation/BottomNavigationItem.mjs +34 -33
  13. package/bottomnavigation/messages/index.d.ts +17 -0
  14. package/bottomnavigation/messages/index.js +8 -0
  15. package/bottomnavigation/messages/index.mjs +14 -0
  16. package/breadcrumb/Breadcrumb.js +1 -1
  17. package/breadcrumb/Breadcrumb.mjs +30 -28
  18. package/breadcrumb/BreadcrumbLink.js +1 -1
  19. package/breadcrumb/BreadcrumbLink.mjs +26 -26
  20. package/breadcrumb/messages/index.d.ts +17 -0
  21. package/breadcrumb/messages/index.js +8 -0
  22. package/breadcrumb/messages/index.mjs +14 -0
  23. package/dist/cdn/js/kendo-react-layout.js +1 -1
  24. package/drawer/Drawer.js +1 -1
  25. package/drawer/Drawer.mjs +63 -63
  26. package/drawer/DrawerItem.js +1 -1
  27. package/drawer/DrawerItem.mjs +22 -23
  28. package/drawer/interfaces/DrawerProps.d.ts +8 -0
  29. package/expansionpanel/ExpansionPanel.js +1 -1
  30. package/expansionpanel/ExpansionPanel.mjs +50 -50
  31. package/expansionpanel/ExpansionPanelContent.js +1 -1
  32. package/expansionpanel/ExpansionPanelContent.mjs +7 -4
  33. package/index.d.mts +1 -2
  34. package/index.d.ts +1 -2
  35. package/index.js +1 -1
  36. package/index.mjs +128 -130
  37. package/menu/MenuProps.d.ts +6 -0
  38. package/package-metadata.js +1 -1
  39. package/package-metadata.mjs +2 -2
  40. package/package.json +8 -8
  41. package/panelbar/PanelBar.js +1 -1
  42. package/panelbar/PanelBar.mjs +94 -91
  43. package/panelbar/PanelBarItem.js +1 -1
  44. package/panelbar/PanelBarItem.mjs +13 -15
  45. package/panelbar/interfaces/PanelBarProps.d.ts +8 -0
  46. package/panelbar/interfaces/RenderPanelBarItem.d.ts +1 -0
  47. package/panelbar/util.d.ts +1 -1
  48. package/panelbar/util.js +1 -1
  49. package/panelbar/util.mjs +62 -59
  50. package/splitter/SplitterBar.d.ts +1 -0
  51. package/splitter/SplitterBar.js +1 -1
  52. package/splitter/SplitterBar.mjs +64 -56
  53. package/stepper/Step.js +1 -1
  54. package/stepper/Step.mjs +79 -85
  55. package/stepper/Stepper.js +1 -1
  56. package/stepper/Stepper.mjs +134 -133
  57. package/stepper/interfaces/StepperProps.d.ts +8 -1
  58. package/stepper/messages/index.d.ts +12 -2
  59. package/stepper/messages/index.js +1 -1
  60. package/stepper/messages/index.mjs +8 -4
  61. package/tabstrip/TabStrip.d.ts +8 -1
  62. package/tabstrip/TabStrip.js +1 -1
  63. package/tabstrip/TabStrip.mjs +126 -125
  64. package/tilelayout/InternalTile.js +1 -1
  65. package/tilelayout/InternalTile.mjs +119 -115
  66. package/tilelayout/TileLayout.js +1 -1
  67. package/tilelayout/TileLayout.mjs +58 -58
  68. package/timeline/TimelineCard.d.ts +2 -0
  69. package/timeline/TimelineCard.js +1 -1
  70. package/timeline/TimelineCard.mjs +16 -15
  71. package/timeline/TimelineHorizontal.js +1 -1
  72. package/timeline/TimelineHorizontal.mjs +105 -101
package/stepper/Step.mjs CHANGED
@@ -7,127 +7,121 @@
7
7
  */
8
8
  import * as e from "react";
9
9
  import a from "prop-types";
10
- import { StepperContext as Y } from "./context/StepperContext.mjs";
11
- import { focusFirstFocusableChild as Z, dispatchEvent as M, classNames as ee, IconWrap as T, toIconName as te } from "@progress/kendo-react-common";
12
- import { useLocalization as ae } from "@progress/kendo-react-intl";
13
- import { checkIcon as se, exclamationCircleIcon as oe } from "@progress/kendo-svg-icons";
14
- import { DEFAULT_ANIMATION_DURATION as ne, NO_ANIMATION as ce } from "./contants.mjs";
15
- import { messages as le, optionalText as ie } from "./messages/index.mjs";
16
- const L = e.forwardRef((O, R) => {
10
+ import { StepperContext as te } from "./context/StepperContext.mjs";
11
+ import { focusFirstFocusableChild as ae, dispatchEvent as O, classNames as se, IconWrap as R, toIconName as oe } from "@progress/kendo-react-common";
12
+ import { useLocalization as ne } from "@progress/kendo-react-intl";
13
+ import { checkIcon as le, exclamationCircleIcon as ce } from "@progress/kendo-svg-icons";
14
+ import { DEFAULT_ANIMATION_DURATION as ie, NO_ANIMATION as re } from "./contants.mjs";
15
+ import { messages as me, optionalText as pe, stepAriaLabel as de } from "./messages/index.mjs";
16
+ const V = e.forwardRef((D, $) => {
17
17
  const {
18
18
  // content
19
- children: V,
20
- className: g,
21
- current: d,
19
+ children: z,
20
+ className: h,
21
+ current: b,
22
22
  disabled: o,
23
- focused: E,
24
- icon: r,
25
- svgIcon: h,
23
+ focused: y,
24
+ icon: l,
25
+ svgIcon: k,
26
26
  index: s,
27
27
  isValid: t,
28
28
  label: n,
29
29
  optional: m,
30
- style: C,
31
- tabIndex: me = re.tabIndex,
32
- text: y,
33
- ...z
34
- } = O, {
35
- animationDuration: u,
36
- isVertical: k,
37
- item: D,
38
- linear: H,
39
- mode: S,
30
+ style: S,
31
+ tabIndex: be = ue.tabIndex,
32
+ text: p,
33
+ ...H
34
+ } = D, {
35
+ animationDuration: f,
36
+ isVertical: v,
37
+ item: _,
38
+ linear: w,
39
+ mode: A,
40
40
  numOfSteps: c,
41
- value: l,
42
- onChange: b,
43
- onFocus: f,
44
- successIcon: _,
45
- errorIcon: w,
46
- successSVGIcon: B,
47
- errorSVGIcon: G
48
- } = e.useContext(Y), p = e.useRef(null), F = e.useCallback(() => {
49
- p.current && Z(p.current);
50
- }, []), v = e.useCallback(
41
+ value: i,
42
+ onChange: I,
43
+ onFocus: N,
44
+ successIcon: B,
45
+ errorIcon: G,
46
+ successSVGIcon: P,
47
+ errorSVGIcon: U
48
+ } = e.useContext(te), d = e.useRef(null), F = e.useCallback(() => {
49
+ d.current && ae(d.current);
50
+ }, []), x = e.useCallback(
51
51
  () => ({
52
- element: p.current,
52
+ element: d.current,
53
53
  focus: F
54
54
  }),
55
55
  [F]
56
56
  );
57
- e.useImperativeHandle(R, v);
58
- const I = !H || s === l - 1 || s === l || s === l + 1, N = S === "labels" || !!r && !!n, P = ae(), U = ((i) => P.toLanguageString(i, le[i]))(ie), W = typeof u == "number" ? u : u !== !1 ? ne : ce, $ = e.useCallback(
59
- (i) => {
60
- b && !o && M(b, i, v(), { value: s });
57
+ e.useImperativeHandle($, x);
58
+ const g = !w || s === i - 1 || s === i || s === i + 1, E = A === "labels" || !!l && !!n, W = ne(), L = (r) => W.toLanguageString(r, me[r]), j = L(pe), K = typeof f == "number" ? f : f !== !1 ? ie : re, q = e.useCallback(
59
+ (r) => {
60
+ I && !o && O(I, r, x(), { value: s });
61
61
  },
62
- [b, l, o]
63
- ), j = e.useCallback(
64
- (i) => {
65
- f && !o && M(f, i, v(), void 0);
62
+ [I, i, o]
63
+ ), J = e.useCallback(
64
+ (r) => {
65
+ N && !o && O(N, r, x(), void 0);
66
66
  },
67
- [f, o]
68
- ), K = e.useMemo(
69
- () => ee(
67
+ [N, o]
68
+ ), Q = e.useMemo(
69
+ () => se(
70
70
  "k-step",
71
71
  {
72
72
  "k-step-first": s === 0,
73
73
  "k-step-last": c && s === c - 1,
74
- "k-step-done": s < l,
75
- "k-step-current": d,
74
+ "k-step-done": s < i,
75
+ "k-step-current": b,
76
76
  "k-step-optional": m,
77
77
  "k-step-error": t !== void 0 && !t,
78
78
  "k-step-success": t,
79
79
  "k-disabled": o,
80
- "k-focus": E
80
+ "k-focus": y
81
81
  },
82
- g
82
+ h
83
83
  ),
84
- [s, c, l, d, m, o, E, t, g]
85
- ), q = e.useMemo(
84
+ [s, c, i, b, m, o, y, t, h]
85
+ ), X = e.useMemo(
86
86
  () => ({
87
- maxWidth: k ? void 0 : `calc(100% / ${c})`,
88
- maxHeight: k ? `calc(100% / ${c})` : void 0,
89
- pointerEvents: I ? void 0 : "none",
90
- ...C
87
+ maxWidth: v ? void 0 : `calc(100% / ${c})`,
88
+ maxHeight: v ? `calc(100% / ${c})` : void 0,
89
+ pointerEvents: g ? void 0 : "none",
90
+ ...S
91
91
  }),
92
- [k, c, C, I]
93
- ), A = t ? _ : w, x = A ? /* @__PURE__ */ e.createElement("span", { className: "k-step-indicator-icon " + A, "aria-hidden": "true" }) : /* @__PURE__ */ e.createElement(
94
- T,
92
+ [v, c, S, g]
93
+ ), M = t ? B : G, C = M ? /* @__PURE__ */ e.createElement("span", { className: "k-step-indicator-icon " + M, "aria-hidden": "true" }) : /* @__PURE__ */ e.createElement(
94
+ R,
95
95
  {
96
96
  className: "k-step-indicator-icon",
97
97
  name: t ? "check-circle" : "exclamation-circle",
98
- icon: t ? B || se : G || oe
98
+ icon: t ? P || le : U || ce
99
99
  }
100
- ), J = /* @__PURE__ */ e.createElement(e.Fragment, null, S !== "labels" ? /* @__PURE__ */ e.createElement(
101
- "span",
100
+ ), Y = /* @__PURE__ */ e.createElement(e.Fragment, null, A !== "labels" ? /* @__PURE__ */ e.createElement("span", { className: "k-step-indicator", style: { transitionDuration: K + "ms" } }, l || k ? !E && t !== void 0 ? C : /* @__PURE__ */ e.createElement(
101
+ R,
102
102
  {
103
- className: "k-step-indicator",
104
- "aria-hidden": !0,
105
- style: { transitionDuration: W + "ms" }
106
- },
107
- r || h ? !N && t !== void 0 ? x : /* @__PURE__ */ e.createElement(
108
- T,
109
- {
110
- className: "k-step-indicator-icon",
111
- name: r && te(r),
112
- icon: h
113
- }
114
- ) : t !== void 0 ? x : /* @__PURE__ */ e.createElement("span", { className: "k-step-indicator-text" }, y || s + 1)
115
- ) : null), Q = (n || N || m) && /* @__PURE__ */ e.createElement("span", { className: "k-step-label" }, n && /* @__PURE__ */ e.createElement("span", { className: "k-step-text" }, n), N && t !== void 0 && x, m && /* @__PURE__ */ e.createElement("span", { className: "k-step-label-optional" }, U)), X = /* @__PURE__ */ e.createElement(e.Fragment, null, J, Q);
116
- return /* @__PURE__ */ e.createElement("li", { ref: p, className: K, style: q, ...z }, /* @__PURE__ */ e.createElement(
103
+ className: "k-step-indicator-icon",
104
+ name: l && oe(l),
105
+ icon: k
106
+ }
107
+ ) : t !== void 0 ? C : /* @__PURE__ */ e.createElement("span", { className: "k-step-indicator-text" }, p || s + 1)) : null), Z = (n || E || m) && /* @__PURE__ */ e.createElement("span", { className: "k-step-label" }, n && /* @__PURE__ */ e.createElement("span", { className: "k-step-text" }, n), E && t !== void 0 && C, m && /* @__PURE__ */ e.createElement("span", { className: "k-step-label-optional" }, j)), ee = /* @__PURE__ */ e.createElement(e.Fragment, null, Y, Z), T = L(de);
108
+ let u = n;
109
+ return u || (p ? u = `${T} ${p}` : (l || k) && (u = T)), /* @__PURE__ */ e.createElement("li", { ref: d, className: Q, style: X, ...H }, /* @__PURE__ */ e.createElement(
117
110
  "a",
118
111
  {
119
112
  className: "k-step-link",
120
113
  title: n || void 0,
121
- onClick: $,
122
- onFocus: j,
123
- "aria-current": d ? "step" : void 0,
124
- "aria-disabled": o || !I || void 0,
125
- "aria-invalid": t !== void 0 && !t || void 0
114
+ onClick: q,
115
+ onFocus: J,
116
+ "aria-current": b ? "step" : void 0,
117
+ "aria-disabled": o || !g || void 0,
118
+ "aria-invalid": t !== void 0 && !t || void 0,
119
+ "aria-label": u
126
120
  },
127
- D ? V : X
121
+ _ ? z : ee
128
122
  ));
129
123
  });
130
- L.propTypes = {
124
+ V.propTypes = {
131
125
  children: a.any,
132
126
  className: a.string,
133
127
  // content: PropTypes.any,
@@ -142,10 +136,10 @@ L.propTypes = {
142
136
  tabIndex: a.number,
143
137
  text: a.string
144
138
  };
145
- const re = {
139
+ const ue = {
146
140
  tabIndex: 0
147
141
  };
148
- L.displayName = "KendoStep";
142
+ V.displayName = "KendoStep";
149
143
  export {
150
- L as Step
144
+ V as Step
151
145
  };
@@ -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 te=require("react"),o=require("prop-types"),ne=require("./context/StepperContext.js"),p=require("@progress/kendo-react-common"),se=require("./Step.js"),oe=require("@progress/kendo-react-progressbars"),z=require("./contants.js"),re=require("@progress/kendo-react-intl"),R=require("./messages/index.js");function ie(m){const k=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(m){for(const d in m)if(d!=="default"){const h=Object.getOwnPropertyDescriptor(m,d);Object.defineProperty(k,d,h.get?h:{enumerable:!0,get:()=>m[d]})}}return k.default=m,Object.freeze(k)}const e=ie(te),O=e.forwardRef((m,k)=>{const{animationDuration:d,children:h,className:T,disabled:g,errorIcon:V,errorSVGIcon:j,item:w,items:b,linear:y,mode:_,orientation:S,selectOnFocus:E,style:P,successIcon:K,successSVGIcon:G,value:a=0,onChange:C,onFocus:N}=m,B=re.useLocalization().toLanguageString(R.progBarAriaLabel,R.messages[R.progBarAriaLabel]),v=e.useRef(null),q=e.useCallback(()=>{v.current&&p.focusFirstFocusableChild(v.current)},[]),x=e.useCallback(()=>({element:v.current,focus:q}),[q]);e.useImperativeHandle(k,x);const[H,u]=e.useState(a),f=b?b.length:0,s=S==="vertical",D=p.useDir(v,m.dir),U=typeof d=="number"?d:d!==!1?z.DEFAULT_ANIMATION_DURATION:z.NO_ANIMATION;e.useEffect(()=>{u(a)},[a]);const F=e.useCallback((c,r)=>{const t=r===a-1,n=r===a,i=r===a+1;a!==r&&C&&!g&&(!y||t||n||i)&&(p.dispatchEvent(C,c,x(),{value:r}),u(r))},[a,y,C,g,u]),J=e.useCallback(c=>{const r=c.value,t=c.syntheticEvent;F(t,r)},[F]),Q=e.useCallback(c=>{N&&!g&&p.dispatchEvent(N,c.syntheticEvent,x(),void 0)},[N,g]),I=e.useMemo(()=>{const c=D==="rtl",r=b.length-1;return new p.Navigation({root:v,selectors:["ol.k-step-list li.k-step a.k-step-link"],tabIndex:0,keyboardEvents:{keydown:{Tab:(t,n,i)=>{const l=n.elements.indexOf(t),M=n.previous(t).children[0],A=n.next(t).children[0];i.shiftKey?!c&&l>0?(i.preventDefault(),n.focusPrevious(t),u(l-1),E&&M.click()):c&&l<r&&(i.preventDefault(),n.focusNext(t),u(l+1),E&&A.click()):!c&&l<r?(i.preventDefault(),n.focusNext(t),u(l+1),E&&A.click()):c&&l>0&&(i.preventDefault(),n.focusPrevious(t),u(l-1),E&&M.click())},Home:(t,n,i)=>{i.preventDefault(),n.focusElement(n.first,t),u(0)},End:(t,n,i)=>{i.preventDefault(),n.focusElement(n.last,t),u(r)},Space:(t,n,i)=>{i.preventDefault(),t.children[0].click()},Enter:(t,n,i)=>{i.preventDefault(),t.children[0].click()}}}})},[D,b.length,u,E]);e.useEffect(()=>(I.initializeRovingTab(a),()=>I.removeFocusListener()),[]);const W=e.useCallback(I.triggerKeyboardEvent.bind(I),[]),X=e.useMemo(()=>p.classNames("k-stepper",{"k-stepper-linear":y},T),[y,T]),Y=e.useMemo(()=>({display:"grid",gridTemplateColumns:s?void 0:"repeat("+f*2+", 1fr)",gridTemplateRows:s?"repeat("+f+", 1fr)":void 0,...P}),[s,f,P]),Z=e.useMemo(()=>p.classNames("k-step-list",{"k-step-list-horizontal":!s,"k-step-list-vertical":s}),[s]),$=e.useMemo(()=>({gridColumnStart:s?void 0:1,gridColumnEnd:s?void 0:-1,gridRowStart:s?1:void 0,gridRowEnd:s?-1:void 0}),[s]),ee=e.useMemo(()=>({gridColumnStart:s?void 0:2,gridColumnEnd:s?void 0:f*2,gridRowStart:s?1:void 0,gridRowEnd:s?f:void 0,top:s?17:void 0}),[s,f]),L=b&&b.map((c,r)=>{const t={index:r,disabled:g||c.disabled,focused:r===H,current:r===a,...c},n=w||se.Step;return e.createElement(n,{key:r,...t})});return e.createElement(ne.StepperContext.Provider,{value:{animationDuration:d,isVertical:s,item:w,linear:y,mode:_,numOfSteps:f,value:a,successIcon:K,successSVGIcon:G,errorIcon:V,errorSVGIcon:j,onChange:J,onFocus:Q}},e.createElement("nav",{className:X,style:Y,dir:D,role:"navigation",ref:v,onKeyDown:W},e.createElement("ol",{className:Z,style:$},L||h),e.createElement(oe.ProgressBar,{style:ee,labelPlacement:"start",animation:{duration:U},ariaLabel:B,"aria-hidden":!0,max:f-1,labelVisible:!1,orientation:S,reverse:S==="vertical",value:a,disabled:g,tabIndex:-1})))});O.propTypes={animationDuration:o.oneOfType([o.bool,o.number]),children:o.any,className:o.string,dir:o.string,disabled:o.bool,errorIcon:o.string,errorSVGIcon:p.svgIconPropType,item:o.any,items:o.any,linear:o.bool,mode:o.oneOf(["steps","labels"]),orientation:o.oneOf(["horizontal","vertical"]),style:o.object,successIcon:o.string,successSVGIcon:p.svgIconPropType,value:o.number.isRequired,onChange:o.func,onFocus:o.func};O.displayName="KendoStepper";exports.Stepper=O;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const oe=require("react"),o=require("prop-types"),re=require("./context/StepperContext.js"),p=require("@progress/kendo-react-common"),ae=require("./Step.js"),ie=require("@progress/kendo-react-progressbars"),z=require("./contants.js"),ce=require("@progress/kendo-react-intl"),k=require("./messages/index.js");function le(u){const y=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(u){for(const m in u)if(m!=="default"){const I=Object.getOwnPropertyDescriptor(u,m);Object.defineProperty(y,m,I.get?I:{enumerable:!0,get:()=>u[m]})}}return y.default=u,Object.freeze(y)}const e=le(oe),O=e.forwardRef((u,y)=>{const{animationDuration:m,children:I,className:T,disabled:g,errorIcon:_,errorSVGIcon:H,item:w,items:b,linear:E,mode:K,orientation:R,selectOnFocus:h,style:L,successIcon:G,successSVGIcon:B,value:c=0,onChange:N,onFocus:D}=u,M=ce.useLocalization(),U=M.toLanguageString(k.progressBarAriaLabel,k.messages[k.progressBarAriaLabel]),W=M.toLanguageString(k.ariaLabel,k.messages[k.ariaLabel]),v=e.useRef(null),P=e.useRef(null);p.useWebMcpRegister("stepper",P,u,u.webMcp);const q=e.useCallback(()=>{v.current&&p.focusFirstFocusableChild(v.current)},[]),S=e.useCallback(()=>({element:v.current,focus:q}),[q]);e.useImperativeHandle(y,S),e.useImperativeHandle(P,S);const[J,d]=e.useState(c),f=b?b.length:0,s=R==="vertical",x=p.useDir(v,u.dir),Q=typeof m=="number"?m:m!==!1?z.DEFAULT_ANIMATION_DURATION:z.NO_ANIMATION;e.useEffect(()=>{d(c)},[c]);const A=e.useCallback((i,r)=>{const t=r===c-1,n=r===c,a=r===c+1;c!==r&&N&&!g&&(!E||t||n||a)&&(p.dispatchEvent(N,i,S(),{value:r}),d(r))},[c,E,N,g,d]),X=e.useCallback(i=>{const r=i.value,t=i.syntheticEvent;A(t,r)},[A]),Y=e.useCallback(i=>{D&&!g&&p.dispatchEvent(D,i.syntheticEvent,S(),void 0)},[D,g]),C=e.useMemo(()=>{const i=x==="rtl",r=b.length-1;return new p.Navigation({root:v,selectors:["ol.k-step-list li.k-step a.k-step-link"],tabIndex:0,keyboardEvents:{keydown:{Tab:(t,n,a)=>{const l=n.elements.indexOf(t),V=n.previous(t).children[0],j=n.next(t).children[0];a.shiftKey?!i&&l>0?(a.preventDefault(),n.focusPrevious(t),d(l-1),h&&V.click()):i&&l<r&&(a.preventDefault(),n.focusNext(t),d(l+1),h&&j.click()):!i&&l<r?(a.preventDefault(),n.focusNext(t),d(l+1),h&&j.click()):i&&l>0&&(a.preventDefault(),n.focusPrevious(t),d(l-1),h&&V.click())},Home:(t,n,a)=>{a.preventDefault(),n.focusElement(n.first,t),d(0)},End:(t,n,a)=>{a.preventDefault(),n.focusElement(n.last,t),d(r)},Space:(t,n,a)=>{a.preventDefault(),t.children[0].click()},Enter:(t,n,a)=>{a.preventDefault(),t.children[0].click()}}}})},[x,b.length,d,h]);e.useEffect(()=>(C.initializeRovingTab(c),()=>C.removeFocusListener()),[]);const Z=e.useCallback(C.triggerKeyboardEvent.bind(C),[]),$=e.useMemo(()=>p.classNames("k-stepper",{"k-stepper-linear":E},T),[E,T]),ee=e.useMemo(()=>({display:"grid",gridTemplateColumns:s?void 0:"repeat("+f*2+", 1fr)",gridTemplateRows:s?"repeat("+f+", 1fr)":void 0,...L}),[s,f,L]),te=e.useMemo(()=>p.classNames("k-step-list",{"k-step-list-horizontal":!s,"k-step-list-vertical":s}),[s]),ne=e.useMemo(()=>({gridColumnStart:s?void 0:1,gridColumnEnd:s?void 0:-1,gridRowStart:s?1:void 0,gridRowEnd:s?-1:void 0}),[s]),se=e.useMemo(()=>({gridColumnStart:s?void 0:2,gridColumnEnd:s?void 0:f*2,gridRowStart:s?1:void 0,gridRowEnd:s?f:void 0,top:s?17:void 0}),[s,f]),F=b&&b.map((i,r)=>{const t={index:r,disabled:g||i.disabled,focused:r===J,current:r===c,...i},n=w||ae.Step;return e.createElement(n,{key:r,...t})});return e.createElement(re.StepperContext.Provider,{value:{animationDuration:m,isVertical:s,item:w,linear:E,mode:K,numOfSteps:f,value:c,successIcon:G,successSVGIcon:B,errorIcon:_,errorSVGIcon:H,onChange:X,onFocus:Y}},e.createElement("nav",{className:$,style:ee,dir:x,ref:v,onKeyDown:Z,"aria-label":W},e.createElement("ol",{className:te,style:ne},F||I),e.createElement(ie.ProgressBar,{style:se,labelPlacement:"start",animation:{duration:Q},ariaLabel:U,"aria-hidden":!0,labelVisible:!1,orientation:R,reverse:R==="vertical",value:f>1?Math.round(c/(f-1)*100):0,disabled:g,tabIndex:-1})))});O.propTypes={animationDuration:o.oneOfType([o.bool,o.number]),children:o.any,className:o.string,dir:o.string,disabled:o.bool,errorIcon:o.string,errorSVGIcon:p.svgIconPropType,item:o.any,items:o.any,linear:o.bool,mode:o.oneOf(["steps","labels"]),orientation:o.oneOf(["horizontal","vertical"]),style:o.object,successIcon:o.string,successSVGIcon:p.svgIconPropType,value:o.number.isRequired,onChange:o.func,onFocus:o.func};O.displayName="KendoStepper";exports.Stepper=O;
@@ -6,194 +6,195 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import * as e from "react";
9
- import s from "prop-types";
10
- import { StepperContext as ne } from "./context/StepperContext.mjs";
11
- import { focusFirstFocusableChild as oe, useDir as se, dispatchEvent as L, Navigation as re, classNames as A, svgIconPropType as M } from "@progress/kendo-react-common";
12
- import { Step as ie } from "./Step.mjs";
13
- import { ProgressBar as le } from "@progress/kendo-react-progressbars";
14
- import { DEFAULT_ANIMATION_DURATION as ae, NO_ANIMATION as ce } from "./contants.mjs";
15
- import { useLocalization as ue } from "@progress/kendo-react-intl";
16
- import { progBarAriaLabel as P, messages as de } from "./messages/index.mjs";
17
- const V = e.forwardRef((S, z) => {
9
+ import o from "prop-types";
10
+ import { StepperContext as le } from "./context/StepperContext.mjs";
11
+ import { useWebMcpRegister as ae, focusFirstFocusableChild as ce, useDir as ue, dispatchEvent as A, Navigation as de, classNames as P, svgIconPropType as V } from "@progress/kendo-react-common";
12
+ import { Step as me } from "./Step.mjs";
13
+ import { ProgressBar as pe } from "@progress/kendo-react-progressbars";
14
+ import { DEFAULT_ANIMATION_DURATION as fe, NO_ANIMATION as ge } from "./contants.mjs";
15
+ import { useLocalization as be } from "@progress/kendo-react-intl";
16
+ import { progressBarAriaLabel as z, messages as H, ariaLabel as K } from "./messages/index.mjs";
17
+ const G = e.forwardRef((v, _) => {
18
18
  const {
19
- animationDuration: b,
20
- children: K,
21
- className: x,
19
+ animationDuration: k,
20
+ children: B,
21
+ className: N,
22
22
  disabled: m,
23
- errorIcon: G,
24
- errorSVGIcon: H,
25
- item: N,
23
+ errorIcon: U,
24
+ errorSVGIcon: j,
25
+ item: R,
26
26
  items: p,
27
27
  linear: g,
28
- mode: _,
29
- orientation: E,
30
- selectOnFocus: v,
31
- style: D,
32
- successIcon: B,
33
- successSVGIcon: U,
28
+ mode: q,
29
+ orientation: y,
30
+ selectOnFocus: b,
31
+ style: x,
32
+ successIcon: W,
33
+ successSVGIcon: J,
34
34
  value: a = 0,
35
- onChange: y,
36
- onFocus: h
37
- } = S, j = ue().toLanguageString(P, de[P]), f = e.useRef(null), R = e.useCallback(() => {
38
- f.current && oe(f.current);
39
- }, []), I = e.useCallback(
35
+ onChange: I,
36
+ onFocus: C
37
+ } = v, D = be(), Q = D.toLanguageString(z, H[z]), X = D.toLanguageString(K, H[K]), f = e.useRef(null), w = e.useRef(null);
38
+ ae("stepper", w, v, v.webMcp);
39
+ const L = e.useCallback(() => {
40
+ f.current && ce(f.current);
41
+ }, []), E = e.useCallback(
40
42
  () => ({
41
43
  element: f.current,
42
- focus: R
44
+ focus: L
43
45
  }),
44
- [R]
46
+ [L]
45
47
  );
46
- e.useImperativeHandle(z, I);
47
- const [q, u] = e.useState(a), d = p ? p.length : 0, o = E === "vertical", C = se(f, S.dir), J = typeof b == "number" ? b : b !== !1 ? ae : ce;
48
+ e.useImperativeHandle(_, E), e.useImperativeHandle(w, E);
49
+ const [Y, u] = e.useState(a), d = p ? p.length : 0, n = y === "vertical", S = ue(f, v.dir), Z = typeof k == "number" ? k : k !== !1 ? fe : ge;
48
50
  e.useEffect(() => {
49
51
  u(a);
50
52
  }, [a]);
51
- const w = e.useCallback(
53
+ const T = e.useCallback(
52
54
  (l, r) => {
53
- const t = r === a - 1, n = r === a, i = r === a + 1;
54
- a !== r && y && !m && (!g || t || n || i) && (L(y, l, I(), {
55
+ const t = r === a - 1, s = r === a, i = r === a + 1;
56
+ a !== r && I && !m && (!g || t || s || i) && (A(I, l, E(), {
55
57
  value: r
56
58
  }), u(r));
57
59
  },
58
- [a, g, y, m, u]
59
- ), Q = e.useCallback(
60
+ [a, g, I, m, u]
61
+ ), $ = e.useCallback(
60
62
  (l) => {
61
63
  const r = l.value, t = l.syntheticEvent;
62
- w(t, r);
64
+ T(t, r);
63
65
  },
64
- [w]
65
- ), W = e.useCallback(
66
+ [T]
67
+ ), ee = e.useCallback(
66
68
  (l) => {
67
- h && !m && L(
68
- h,
69
+ C && !m && A(
70
+ C,
69
71
  l.syntheticEvent,
70
- I(),
72
+ E(),
71
73
  void 0
72
74
  );
73
75
  },
74
- [h, m]
75
- ), k = e.useMemo(() => {
76
- const l = C === "rtl", r = p.length - 1;
77
- return new re({
76
+ [C, m]
77
+ ), h = e.useMemo(() => {
78
+ const l = S === "rtl", r = p.length - 1;
79
+ return new de({
78
80
  root: f,
79
81
  selectors: ["ol.k-step-list li.k-step a.k-step-link"],
80
82
  tabIndex: 0,
81
83
  keyboardEvents: {
82
84
  keydown: {
83
- Tab: (t, n, i) => {
84
- const c = n.elements.indexOf(t), F = n.previous(t).children[0], O = n.next(t).children[0];
85
- i.shiftKey ? !l && c > 0 ? (i.preventDefault(), n.focusPrevious(t), u(c - 1), v && F.click()) : l && c < r && (i.preventDefault(), n.focusNext(t), u(c + 1), v && O.click()) : !l && c < r ? (i.preventDefault(), n.focusNext(t), u(c + 1), v && O.click()) : l && c > 0 && (i.preventDefault(), n.focusPrevious(t), u(c - 1), v && F.click());
85
+ Tab: (t, s, i) => {
86
+ const c = s.elements.indexOf(t), F = s.previous(t).children[0], O = s.next(t).children[0];
87
+ i.shiftKey ? !l && c > 0 ? (i.preventDefault(), s.focusPrevious(t), u(c - 1), b && F.click()) : l && c < r && (i.preventDefault(), s.focusNext(t), u(c + 1), b && O.click()) : !l && c < r ? (i.preventDefault(), s.focusNext(t), u(c + 1), b && O.click()) : l && c > 0 && (i.preventDefault(), s.focusPrevious(t), u(c - 1), b && F.click());
86
88
  },
87
- Home: (t, n, i) => {
88
- i.preventDefault(), n.focusElement(n.first, t), u(0);
89
+ Home: (t, s, i) => {
90
+ i.preventDefault(), s.focusElement(s.first, t), u(0);
89
91
  },
90
- End: (t, n, i) => {
91
- i.preventDefault(), n.focusElement(n.last, t), u(r);
92
+ End: (t, s, i) => {
93
+ i.preventDefault(), s.focusElement(s.last, t), u(r);
92
94
  },
93
- Space: (t, n, i) => {
95
+ Space: (t, s, i) => {
94
96
  i.preventDefault(), t.children[0].click();
95
97
  },
96
- Enter: (t, n, i) => {
98
+ Enter: (t, s, i) => {
97
99
  i.preventDefault(), t.children[0].click();
98
100
  }
99
101
  }
100
102
  }
101
103
  });
102
- }, [C, p.length, u, v]);
103
- e.useEffect(() => (k.initializeRovingTab(a), () => k.removeFocusListener()), []);
104
- const X = e.useCallback(k.triggerKeyboardEvent.bind(k), []), Y = e.useMemo(
105
- () => A(
104
+ }, [S, p.length, u, b]);
105
+ e.useEffect(() => (h.initializeRovingTab(a), () => h.removeFocusListener()), []);
106
+ const te = e.useCallback(h.triggerKeyboardEvent.bind(h), []), se = e.useMemo(
107
+ () => P(
106
108
  "k-stepper",
107
109
  {
108
110
  "k-stepper-linear": g
109
111
  },
110
- x
112
+ N
111
113
  ),
112
- [g, x]
113
- ), Z = e.useMemo(
114
+ [g, N]
115
+ ), ne = e.useMemo(
114
116
  () => ({
115
117
  display: "grid",
116
- gridTemplateColumns: o ? void 0 : "repeat(" + d * 2 + ", 1fr)",
117
- gridTemplateRows: o ? "repeat(" + d + ", 1fr)" : void 0,
118
- ...D
118
+ gridTemplateColumns: n ? void 0 : "repeat(" + d * 2 + ", 1fr)",
119
+ gridTemplateRows: n ? "repeat(" + d + ", 1fr)" : void 0,
120
+ ...x
119
121
  }),
120
- [o, d, D]
121
- ), $ = e.useMemo(
122
- () => A("k-step-list", {
123
- "k-step-list-horizontal": !o,
124
- "k-step-list-vertical": o
122
+ [n, d, x]
123
+ ), oe = e.useMemo(
124
+ () => P("k-step-list", {
125
+ "k-step-list-horizontal": !n,
126
+ "k-step-list-vertical": n
125
127
  }),
126
- [o]
127
- ), ee = e.useMemo(
128
+ [n]
129
+ ), re = e.useMemo(
128
130
  () => ({
129
- gridColumnStart: o ? void 0 : 1,
130
- gridColumnEnd: o ? void 0 : -1,
131
- gridRowStart: o ? 1 : void 0,
132
- gridRowEnd: o ? -1 : void 0
131
+ gridColumnStart: n ? void 0 : 1,
132
+ gridColumnEnd: n ? void 0 : -1,
133
+ gridRowStart: n ? 1 : void 0,
134
+ gridRowEnd: n ? -1 : void 0
133
135
  }),
134
- [o]
135
- ), te = e.useMemo(
136
+ [n]
137
+ ), ie = e.useMemo(
136
138
  () => ({
137
- gridColumnStart: o ? void 0 : 2,
138
- gridColumnEnd: o ? void 0 : d * 2,
139
- gridRowStart: o ? 1 : void 0,
140
- gridRowEnd: o ? d : void 0,
141
- top: o ? 17 : void 0
139
+ gridColumnStart: n ? void 0 : 2,
140
+ gridColumnEnd: n ? void 0 : d * 2,
141
+ gridRowStart: n ? 1 : void 0,
142
+ gridRowEnd: n ? d : void 0,
143
+ top: n ? 17 : void 0
142
144
  }),
143
- [o, d]
144
- ), T = p && p.map((l, r) => {
145
+ [n, d]
146
+ ), M = p && p.map((l, r) => {
145
147
  const t = {
146
148
  index: r,
147
149
  disabled: m || l.disabled,
148
- focused: r === q,
150
+ focused: r === Y,
149
151
  current: r === a,
150
152
  ...l
151
- }, n = N || ie;
152
- return /* @__PURE__ */ e.createElement(n, { key: r, ...t });
153
+ }, s = R || me;
154
+ return /* @__PURE__ */ e.createElement(s, { key: r, ...t });
153
155
  });
154
156
  return /* @__PURE__ */ e.createElement(
155
- ne.Provider,
157
+ le.Provider,
156
158
  {
157
159
  value: {
158
- animationDuration: b,
159
- isVertical: o,
160
- item: N,
160
+ animationDuration: k,
161
+ isVertical: n,
162
+ item: R,
161
163
  linear: g,
162
- mode: _,
164
+ mode: q,
163
165
  numOfSteps: d,
164
166
  value: a,
165
- successIcon: B,
166
- successSVGIcon: U,
167
- errorIcon: G,
168
- errorSVGIcon: H,
169
- onChange: Q,
170
- onFocus: W
167
+ successIcon: W,
168
+ successSVGIcon: J,
169
+ errorIcon: U,
170
+ errorSVGIcon: j,
171
+ onChange: $,
172
+ onFocus: ee
171
173
  }
172
174
  },
173
175
  /* @__PURE__ */ e.createElement(
174
176
  "nav",
175
177
  {
176
- className: Y,
177
- style: Z,
178
- dir: C,
179
- role: "navigation",
178
+ className: se,
179
+ style: ne,
180
+ dir: S,
180
181
  ref: f,
181
- onKeyDown: X
182
+ onKeyDown: te,
183
+ "aria-label": X
182
184
  },
183
- /* @__PURE__ */ e.createElement("ol", { className: $, style: ee }, T || K),
185
+ /* @__PURE__ */ e.createElement("ol", { className: oe, style: re }, M || B),
184
186
  /* @__PURE__ */ e.createElement(
185
- le,
187
+ pe,
186
188
  {
187
- style: te,
189
+ style: ie,
188
190
  labelPlacement: "start",
189
- animation: { duration: J },
190
- ariaLabel: j,
191
+ animation: { duration: Z },
192
+ ariaLabel: Q,
191
193
  "aria-hidden": !0,
192
- max: d - 1,
193
194
  labelVisible: !1,
194
- orientation: E,
195
- reverse: E === "vertical",
196
- value: a,
195
+ orientation: y,
196
+ reverse: y === "vertical",
197
+ value: d > 1 ? Math.round(a / (d - 1) * 100) : 0,
197
198
  disabled: m,
198
199
  tabIndex: -1
199
200
  }
@@ -201,27 +202,27 @@ const V = e.forwardRef((S, z) => {
201
202
  )
202
203
  );
203
204
  });
204
- V.propTypes = {
205
- animationDuration: s.oneOfType([s.bool, s.number]),
206
- children: s.any,
207
- className: s.string,
208
- dir: s.string,
209
- disabled: s.bool,
210
- errorIcon: s.string,
211
- errorSVGIcon: M,
212
- item: s.any,
213
- items: s.any,
214
- linear: s.bool,
215
- mode: s.oneOf(["steps", "labels"]),
216
- orientation: s.oneOf(["horizontal", "vertical"]),
217
- style: s.object,
218
- successIcon: s.string,
219
- successSVGIcon: M,
220
- value: s.number.isRequired,
221
- onChange: s.func,
222
- onFocus: s.func
205
+ G.propTypes = {
206
+ animationDuration: o.oneOfType([o.bool, o.number]),
207
+ children: o.any,
208
+ className: o.string,
209
+ dir: o.string,
210
+ disabled: o.bool,
211
+ errorIcon: o.string,
212
+ errorSVGIcon: V,
213
+ item: o.any,
214
+ items: o.any,
215
+ linear: o.bool,
216
+ mode: o.oneOf(["steps", "labels"]),
217
+ orientation: o.oneOf(["horizontal", "vertical"]),
218
+ style: o.object,
219
+ successIcon: o.string,
220
+ successSVGIcon: V,
221
+ value: o.number.isRequired,
222
+ onChange: o.func,
223
+ onFocus: o.func
223
224
  };
224
- V.displayName = "KendoStepper";
225
+ G.displayName = "KendoStepper";
225
226
  export {
226
- V as Stepper
227
+ G as Stepper
227
228
  };
@@ -8,7 +8,7 @@
8
8
  import { StepProps } from './StepProps';
9
9
  import { StepperChangeEvent } from './StepperChangeEvent';
10
10
  import { StepperFocusEvent } from './StepperFocusEvent';
11
- import { SVGIcon } from '@progress/kendo-react-common';
11
+ import { SVGIcon, WebMcpProps } from '@progress/kendo-react-common';
12
12
  import * as React from 'react';
13
13
  /**
14
14
  * Represents the props of the [KendoReact Stepper component](https://www.telerik.com/kendo-react-ui/components/layout/stepper).
@@ -213,4 +213,11 @@ export interface StepperProps {
213
213
  * ```
214
214
  */
215
215
  onFocus?: (event: StepperFocusEvent) => void;
216
+ /**
217
+ * Enables Web MCP tool registration so AI agents can interact with this Stepper.
218
+ * Set to `true` to use the provider-level `dataName`, or pass a config object to override.
219
+ *
220
+ * Requires a `WebMcpProvider` ancestor from `@progress/kendo-react-webmcp`.
221
+ */
222
+ webMcp?: boolean | WebMcpProps;
216
223
  }