@progress/kendo-react-labels 8.3.0-develop.4 → 8.3.0-develop.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Error.js CHANGED
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),r=require("prop-types"),c=require("@progress/kendo-react-common"),i=require("./package-metadata.js");function l(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const o=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(e,a,o.get?o:{enumerable:!0,get:()=>t[a]})}}return e.default=t,Object.freeze(e)}const d=l(s),n=t=>{const e={direction:"start",...t};c.validatePackage(i.packageMetadata);const a=c.classNames({"k-form-error":!0,"k-text-start":e.direction==="start","k-text-end":e.direction==="end"},e.className);return d.createElement("div",{id:e.id,role:"alert",style:e.style,className:a},e.children)};n.propTypes={id:r.string,direction:r.oneOf(["start","end"]),children:r.oneOfType([r.element,r.node]),style:r.object,className:r.string};n.displayName="KendoReactError";exports.Error=n;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),o=require("prop-types"),n=require("@progress/kendo-react-common"),d=require("./package-metadata.js");function u(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,a.get?a:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const c=u(l),s=t=>{const e={direction:"start",...t};n.validatePackage(d.packageMetadata);const r=n.useUnstyled(),a=r&&r.uError,i=c.useMemo(()=>n.classNames(n.uError.wrapper({c:a,direction:e.direction}),e.className),[a,e.direction,e.className]);return c.createElement("div",{id:e.id,role:"alert",style:e.style,className:i},e.children)};s.propTypes={id:o.string,direction:o.oneOf(["start","end"]),children:o.oneOfType([o.element,o.node]),style:o.object,className:o.string};s.displayName="KendoReactError";exports.Error=s;
package/Error.mjs CHANGED
@@ -6,46 +6,45 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import * as s from "react";
10
- import e from "prop-types";
11
- import { validatePackage as i, classNames as n } from "@progress/kendo-react-common";
12
- import { packageMetadata as c } from "./package-metadata.mjs";
13
- const t = (o) => {
14
- const r = {
9
+ import * as o from "react";
10
+ import r from "prop-types";
11
+ import { validatePackage as n, useUnstyled as l, classNames as d, uError as m } from "@progress/kendo-react-common";
12
+ import { packageMetadata as p } from "./package-metadata.mjs";
13
+ const a = (c) => {
14
+ const e = {
15
15
  direction: "start",
16
- ...o
16
+ ...c
17
17
  };
18
- i(c);
19
- const a = n(
20
- {
21
- "k-form-error": !0,
22
- "k-text-start": r.direction === "start",
23
- "k-text-end": r.direction === "end"
24
- },
25
- r.className
18
+ n(p);
19
+ const s = l(), t = s && s.uError, i = o.useMemo(
20
+ () => d(m.wrapper({
21
+ c: t,
22
+ direction: e.direction
23
+ }), e.className),
24
+ [t, e.direction, e.className]
26
25
  );
27
- return /* @__PURE__ */ s.createElement(
26
+ return /* @__PURE__ */ o.createElement(
28
27
  "div",
29
28
  {
30
- id: r.id,
29
+ id: e.id,
31
30
  role: "alert",
32
- style: r.style,
33
- className: a
31
+ style: e.style,
32
+ className: i
34
33
  },
35
- r.children
34
+ e.children
36
35
  );
37
36
  };
38
- t.propTypes = {
39
- id: e.string,
40
- direction: e.oneOf(["start", "end"]),
41
- children: e.oneOfType([
42
- e.element,
43
- e.node
37
+ a.propTypes = {
38
+ id: r.string,
39
+ direction: r.oneOf(["start", "end"]),
40
+ children: r.oneOfType([
41
+ r.element,
42
+ r.node
44
43
  ]),
45
- style: e.object,
46
- className: e.string
44
+ style: r.object,
45
+ className: r.string
47
46
  };
48
- t.displayName = "KendoReactError";
47
+ a.displayName = "KendoReactError";
49
48
  export {
50
- t as Error
49
+ a as Error
51
50
  };
package/FloatingLabel.js CHANGED
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("react"),e=require("prop-types"),i=require("@progress/kendo-react-common"),g=require("@progress/kendo-react-intl"),n=require("./messages/index.js"),v=require("./package-metadata.js");function C(a){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const s in a)if(s!=="default"){const o=Object.getOwnPropertyDescriptor(a,s);Object.defineProperty(t,s,o.get?o:{enumerable:!0,get:()=>a[s]})}}return t.default=a,Object.freeze(t)}const l=C(q),c=class c extends l.Component{constructor(t){super(t),this.state={focused:!1},this.handleFocus=s=>{this.setState({focused:!0})},this.handleBlur=s=>{this.setState({focused:!1})},i.validatePackage(v.packageMetadata)}render(){const{label:t,editorId:s,className:o,labelClassName:f,editorValue:d,editorPlaceholder:k,editorValid:N,editorDisabled:u,style:y,id:p,optional:O,...S}=this.props,P=g.provideLocalizationService(this),m=O?P.toLanguageString(n.labelsOptional,n.messages[n.labelsOptional]):"",b=m&&l.createElement("span",{className:"k-label-optional"},m),j=i.classNames({"k-floating-label-container":!0,"k-focus":this.state.focused,"k-empty":!k&&!d&&d!==0,"k-text-disabled":u,"k-rtl":this.props.dir==="rtl"},o),h=i.classNames({"k-floating-label":!0,"k-text-error":N===!1,"k-text-disabled":u},f);return l.createElement("span",{...S,id:this.props.id,className:j,onFocus:this.handleFocus,onBlur:this.handleBlur,style:y,dir:this.props.dir},this.props.children,t?s?l.createElement("label",{id:p,htmlFor:s,className:h},t,b):l.createElement("span",{id:p,className:h},t,b):null)}};c.propTypes={label:e.string,editorId:e.string,editorValue:e.oneOfType([e.string,e.bool,e.number]),editorPlaceholder:e.string,editorValid:e.bool,editorDisabled:e.bool,id:e.string,style:e.object,className:e.string,labelClassName:e.string,optional:e.bool};let r=c;g.registerForLocalization(r);exports.FloatingLabel=r;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react"),e=require("prop-types"),l=require("@progress/kendo-react-common"),N=require("@progress/kendo-react-intl"),n=require("./messages/index.js"),q=require("./package-metadata.js");function L(a){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const s in a)if(s!=="default"){const i=Object.getOwnPropertyDescriptor(a,s);Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>a[s]})}}return t.default=a,Object.freeze(t)}const o=L(j),c=class c extends o.Component{constructor(t){super(t),this.state={focused:!1},this.handleFocus=s=>{this.setState({focused:!0})},this.handleBlur=s=>{this.setState({focused:!1})},l.validatePackage(q.packageMetadata)}render(){const{label:t,editorId:s,className:i,labelClassName:y,editorValue:d,editorPlaceholder:O,editorValid:S,editorDisabled:u,style:k,id:p,optional:v,unstyled:b,...C}=this.props,F=N.provideLocalizationService(this),m=v?F.toLanguageString(n.labelsOptional,n.messages[n.labelsOptional]):"",g=m&&o.createElement("span",{className:"k-label-optional"},m),h=b&&b.uFloatingLabel,P=l.classNames(l.uFloatingLabel.wrapper({c:h,focused:this.state.focused,empty:!O&&!d&&d!==0,disabled:u,isRtl:this.props.dir==="rtl"}),i),f=l.classNames(l.uFloatingLabel.label({c:h,invalid:S===!1,disabled:u}),y);return o.createElement("span",{...C,id:this.props.id,className:P,onFocus:this.handleFocus,onBlur:this.handleBlur,style:k,dir:this.props.dir},this.props.children,t?s?o.createElement("label",{id:p,htmlFor:s,className:f},t,g):o.createElement("span",{id:p,className:f},t,g):null)}};c.propTypes={label:e.string,editorId:e.string,editorValue:e.oneOfType([e.string,e.bool,e.number]),editorPlaceholder:e.string,editorValid:e.bool,editorDisabled:e.bool,id:e.string,style:e.object,className:e.string,labelClassName:e.string,optional:e.bool};let r=c;N.registerForLocalization(r);exports.FloatingLabel=r;
package/FloatingLabel.mjs CHANGED
@@ -6,60 +6,58 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import * as s from "react";
9
+ import * as t from "react";
10
10
  import e from "prop-types";
11
- import { validatePackage as E, classNames as m } from "@progress/kendo-react-common";
12
- import { provideLocalizationService as S, registerForLocalization as v } from "@progress/kendo-react-intl";
13
- import { labelsOptional as h, messages as z } from "./messages/index.mjs";
14
- import { packageMetadata as P } from "./package-metadata.mjs";
15
- const l = class l extends s.Component {
16
- constructor(t) {
17
- super(t), this.state = {
11
+ import { validatePackage as L, classNames as u, uFloatingLabel as b } from "@progress/kendo-react-common";
12
+ import { provideLocalizationService as P, registerForLocalization as V } from "@progress/kendo-react-intl";
13
+ import { labelsOptional as f, messages as k } from "./messages/index.mjs";
14
+ import { packageMetadata as B } from "./package-metadata.mjs";
15
+ const o = class o extends t.Component {
16
+ constructor(s) {
17
+ super(s), this.state = {
18
18
  focused: !1
19
19
  }, this.handleFocus = (a) => {
20
20
  this.setState({ focused: !0 });
21
21
  }, this.handleBlur = (a) => {
22
22
  this.setState({ focused: !1 });
23
- }, E(P);
23
+ }, L(B);
24
24
  }
25
25
  /**
26
26
  * @hidden
27
27
  */
28
28
  render() {
29
- const { label: t, editorId: a, className: u, labelClassName: b, editorValue: r, editorPlaceholder: f, editorValid: g, editorDisabled: i, style: k, id: n, optional: N, ...y } = this.props, x = S(this), c = N ? x.toLanguageString(h, z[h]) : "", d = c && /* @__PURE__ */ s.createElement("span", { className: "k-label-optional" }, c), C = m(
29
+ const { label: s, editorId: a, className: g, labelClassName: N, editorValue: i, editorPlaceholder: y, editorValid: C, editorDisabled: r, style: v, id: n, optional: E, unstyled: d, ...F } = this.props, S = P(this), c = E ? S.toLanguageString(f, k[f]) : "", p = c && /* @__PURE__ */ t.createElement("span", { className: "k-label-optional" }, c), m = d && d.uFloatingLabel, z = u(b.wrapper(
30
30
  {
31
- "k-floating-label-container": !0,
32
- "k-focus": this.state.focused,
33
- "k-empty": !f && !r && r !== 0,
34
- "k-text-disabled": i,
35
- "k-rtl": this.props.dir === "rtl"
36
- },
37
- u
38
- ), p = m(
31
+ c: m,
32
+ focused: this.state.focused,
33
+ empty: !y && !i && i !== 0,
34
+ disabled: r,
35
+ isRtl: this.props.dir === "rtl"
36
+ }
37
+ ), g), h = u(b.label(
39
38
  {
40
- "k-floating-label": !0,
41
- "k-text-error": g === !1,
42
- "k-text-disabled": i
43
- },
44
- b
45
- );
46
- return /* @__PURE__ */ s.createElement(
39
+ c: m,
40
+ invalid: C === !1,
41
+ disabled: r
42
+ }
43
+ ), N);
44
+ return /* @__PURE__ */ t.createElement(
47
45
  "span",
48
46
  {
49
- ...y,
47
+ ...F,
50
48
  id: this.props.id,
51
- className: C,
49
+ className: z,
52
50
  onFocus: this.handleFocus,
53
51
  onBlur: this.handleBlur,
54
- style: k,
52
+ style: v,
55
53
  dir: this.props.dir
56
54
  },
57
55
  this.props.children,
58
- t ? a ? /* @__PURE__ */ s.createElement("label", { id: n, htmlFor: a, className: p }, t, d) : /* @__PURE__ */ s.createElement("span", { id: n, className: p }, t, d) : null
56
+ s ? a ? /* @__PURE__ */ t.createElement("label", { id: n, htmlFor: a, className: h }, s, p) : /* @__PURE__ */ t.createElement("span", { id: n, className: h }, s, p) : null
59
57
  );
60
58
  }
61
59
  };
62
- l.propTypes = {
60
+ o.propTypes = {
63
61
  label: e.string,
64
62
  editorId: e.string,
65
63
  editorValue: e.oneOfType([e.string, e.bool, e.number]),
@@ -72,8 +70,8 @@ l.propTypes = {
72
70
  labelClassName: e.string,
73
71
  optional: e.bool
74
72
  };
75
- let o = l;
76
- v(o);
73
+ let l = o;
74
+ V(l);
77
75
  export {
78
- o as FloatingLabel
76
+ l as FloatingLabel
79
77
  };
package/Hint.js CHANGED
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),t=require("prop-types"),o=require("@progress/kendo-react-common"),c=require("./package-metadata.js");function d(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const a in n)if(a!=="default"){const i=Object.getOwnPropertyDescriptor(n,a);Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>n[a]})}}return e.default=n,Object.freeze(e)}const l=d(s),r=n=>{const e={direction:"start",...n};o.validatePackage(c.packageMetadata);const a=o.classNames({"k-form-hint":!0,"k-text-start":e.direction==="start","k-text-end":e.direction==="end","k-text-disabled":e.editorDisabled===!0},e.className);return l.createElement("div",{id:e.id,style:e.style,className:a},e.children)};r.propTypes={id:t.string,direction:t.oneOf(["start","end"]),children:t.oneOfType([t.element,t.node]),style:t.object,className:t.string,editorDisabled:t.bool};r.displayName="KendoReactHint";exports.Hint=r;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),t=require("prop-types"),i=require("@progress/kendo-react-common"),l=require("./package-metadata.js");function u(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const a in n)if(a!=="default"){const s=Object.getOwnPropertyDescriptor(n,a);Object.defineProperty(e,a,s.get?s:{enumerable:!0,get:()=>n[a]})}}return e.default=n,Object.freeze(e)}const o=u(d),r=n=>{const e={direction:"start",...n};i.validatePackage(l.packageMetadata);const a=i.useUnstyled(),s=a&&a.uHint,c=o.useMemo(()=>i.classNames(i.uHint.wrapper({c:s,direction:e.direction,disabled:e.editorDisabled===!0}),e.className),[s,e.direction,e.editorDisabled,e.className]);return o.createElement("div",{id:e.id,style:e.style,className:c},e.children)};r.propTypes={id:t.string,direction:t.oneOf(["start","end"]),children:t.oneOfType([t.element,t.node]),style:t.object,className:t.string,editorDisabled:t.bool};r.displayName="KendoReactHint";exports.Hint=r;
package/Hint.mjs CHANGED
@@ -6,47 +6,46 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import * as s from "react";
10
- import e from "prop-types";
11
- import { validatePackage as o, classNames as n } from "@progress/kendo-react-common";
12
- import { packageMetadata as d } from "./package-metadata.mjs";
13
- const i = (a) => {
14
- const t = {
9
+ import * as a from "react";
10
+ import t from "prop-types";
11
+ import { validatePackage as d, useUnstyled as c, classNames as l, uHint as m } from "@progress/kendo-react-common";
12
+ import { packageMetadata as p } from "./package-metadata.mjs";
13
+ const o = (n) => {
14
+ const e = {
15
15
  direction: "start",
16
- ...a
16
+ ...n
17
17
  };
18
- o(d);
19
- const r = n(
20
- {
21
- "k-form-hint": !0,
22
- "k-text-start": t.direction === "start",
23
- "k-text-end": t.direction === "end",
24
- "k-text-disabled": t.editorDisabled === !0
25
- },
26
- t.className
18
+ d(p);
19
+ const s = c(), i = s && s.uHint, r = a.useMemo(
20
+ () => l(m.wrapper({
21
+ c: i,
22
+ direction: e.direction,
23
+ disabled: e.editorDisabled === !0
24
+ }), e.className),
25
+ [i, e.direction, e.editorDisabled, e.className]
27
26
  );
28
- return /* @__PURE__ */ s.createElement(
27
+ return /* @__PURE__ */ a.createElement(
29
28
  "div",
30
29
  {
31
- id: t.id,
32
- style: t.style,
30
+ id: e.id,
31
+ style: e.style,
33
32
  className: r
34
33
  },
35
- t.children
34
+ e.children
36
35
  );
37
36
  };
38
- i.propTypes = {
39
- id: e.string,
40
- direction: e.oneOf(["start", "end"]),
41
- children: e.oneOfType([
42
- e.element,
43
- e.node
37
+ o.propTypes = {
38
+ id: t.string,
39
+ direction: t.oneOf(["start", "end"]),
40
+ children: t.oneOfType([
41
+ t.element,
42
+ t.node
44
43
  ]),
45
- style: e.object,
46
- className: e.string,
47
- editorDisabled: e.bool
44
+ style: t.object,
45
+ className: t.string,
46
+ editorDisabled: t.bool
48
47
  };
49
- i.displayName = "KendoReactHint";
48
+ o.displayName = "KendoReactHint";
50
49
  export {
51
- i as Hint
50
+ o as Hint
52
51
  };
package/Label.js CHANGED
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react"),e=require("prop-types"),b=require("@progress/kendo-react-common"),n=require("./messages/index.js"),q=require("@progress/kendo-react-intl"),v=require("./package-metadata.js");function D(a){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const o in a)if(o!=="default"){const t=Object.getOwnPropertyDescriptor(a,o);Object.defineProperty(l,o,t.get?t:{enumerable:!0,get:()=>a[o]})}}return l.default=a,Object.freeze(l)}const r=D(j),c=a=>{b.validatePackage(v.packageMetadata);const{id:l,editorId:o,editorRef:t,editorDisabled:i,children:s,editorValid:f,style:m,className:g,optional:k}=a,y=q.useLocalization(),d=k?y.toLanguageString(n.labelsOptional,n.messages[n.labelsOptional]):"",O=d&&r.createElement("span",{className:"k-label-optional"},d),N=r.useCallback(u=>{if(t&&t.current&&!i){t.current.focus&&(u.preventDefault(),t.current.focus());const p=t.current.actionElement;p&&(u.preventDefault(),p.click())}},[t]),R=b.classNames({"k-label":!0,"k-label-empty":!s,"k-text-error":f===!1,"k-text-disabled":i===!0},g);return r.createElement("label",{id:l,htmlFor:o,onClick:N,style:m,className:R},s,O)};c.propTypes={id:e.string,editorId:e.string,editorRef:e.oneOfType([e.func,e.shape({current:e.any})]),editorValid:e.bool,editorDisabled:e.bool,style:e.object,className:e.string,optional:e.bool};c.displayName="KendoReactLabel";exports.Label=c;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("react"),e=require("prop-types"),n=require("@progress/kendo-react-common"),i=require("./messages/index.js"),q=require("@progress/kendo-react-intl"),C=require("./package-metadata.js");function D(a){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const l in a)if(l!=="default"){const t=Object.getOwnPropertyDescriptor(a,l);Object.defineProperty(o,l,t.get?t:{enumerable:!0,get:()=>a[l]})}}return o.default=a,Object.freeze(o)}const c=D(j),u=a=>{n.validatePackage(C.packageMetadata);const{id:o,editorId:l,editorRef:t,editorDisabled:s,children:r,editorValid:d,style:k,className:b,optional:O}=a,L=q.useLocalization(),p=O?L.toLanguageString(i.labelsOptional,i.messages[i.labelsOptional]):"",N=p&&c.createElement("span",{className:"k-label-optional"},p),m=n.useUnstyled(),f=m&&m.uLabel,v=c.useCallback(g=>{if(t&&t.current&&!s){t.current.focus&&(g.preventDefault(),t.current.focus());const y=t.current.actionElement;y&&(g.preventDefault(),y.click())}},[t]),R=c.useMemo(()=>n.classNames(n.uLabel.label({c:f,empty:!r,invalid:d===!1,disabled:s===!0}),b),[f,r,d,s,b]);return c.createElement("label",{id:o,htmlFor:l,onClick:v,style:k,className:R},r,N)};u.propTypes={id:e.string,editorId:e.string,editorRef:e.oneOfType([e.func,e.shape({current:e.any})]),editorValid:e.bool,editorDisabled:e.bool,style:e.object,className:e.string,optional:e.bool};u.displayName="KendoReactLabel";exports.Label=u;
package/Label.mjs CHANGED
@@ -8,44 +8,44 @@
8
8
  "use client";
9
9
  import * as a from "react";
10
10
  import e from "prop-types";
11
- import { validatePackage as L, classNames as v } from "@progress/kendo-react-common";
12
- import { labelsOptional as s, messages as C } from "./messages/index.mjs";
13
- import { useLocalization as D } from "@progress/kendo-react-intl";
14
- import { packageMetadata as R } from "./package-metadata.mjs";
15
- const c = (m) => {
16
- L(R);
17
- const { id: p, editorId: d, editorRef: t, editorDisabled: o, children: l, editorValid: f, style: b, className: u, optional: k } = m, g = D(), r = k ? g.toLanguageString(s, C[s]) : "", y = r && /* @__PURE__ */ a.createElement("span", { className: "k-label-optional" }, r), N = a.useCallback(
18
- (i) => {
11
+ import { validatePackage as E, useUnstyled as D, classNames as R, uLabel as h } from "@progress/kendo-react-common";
12
+ import { labelsOptional as p, messages as z } from "./messages/index.mjs";
13
+ import { useLocalization as O } from "@progress/kendo-react-intl";
14
+ import { packageMetadata as T } from "./package-metadata.mjs";
15
+ const u = (b) => {
16
+ E(T);
17
+ const { id: f, editorId: y, editorRef: t, editorDisabled: o, children: l, editorValid: s, style: g, className: i, optional: k } = b, L = O(), n = k ? L.toLanguageString(p, z[p]) : "", N = n && /* @__PURE__ */ a.createElement("span", { className: "k-label-optional" }, n), r = D(), c = r && r.uLabel, v = a.useCallback(
18
+ (d) => {
19
19
  if (t && t.current && !o) {
20
- t.current.focus && (i.preventDefault(), t.current.focus());
21
- const n = t.current.actionElement;
22
- n && (i.preventDefault(), n.click());
20
+ t.current.focus && (d.preventDefault(), t.current.focus());
21
+ const m = t.current.actionElement;
22
+ m && (d.preventDefault(), m.click());
23
23
  }
24
24
  },
25
25
  [t]
26
- ), E = v(
27
- {
28
- "k-label": !0,
29
- "k-label-empty": !l,
30
- "k-text-error": f === !1,
31
- "k-text-disabled": o === !0
32
- },
33
- u
26
+ ), C = a.useMemo(
27
+ () => R(h.label({
28
+ c,
29
+ empty: !l,
30
+ invalid: s === !1,
31
+ disabled: o === !0
32
+ }), i),
33
+ [c, l, s, o, i]
34
34
  );
35
35
  return /* @__PURE__ */ a.createElement(
36
36
  "label",
37
37
  {
38
- id: p,
39
- htmlFor: d,
40
- onClick: N,
41
- style: b,
42
- className: E
38
+ id: f,
39
+ htmlFor: y,
40
+ onClick: v,
41
+ style: g,
42
+ className: C
43
43
  },
44
44
  l,
45
- y
45
+ N
46
46
  );
47
47
  };
48
- c.propTypes = {
48
+ u.propTypes = {
49
49
  id: e.string,
50
50
  editorId: e.string,
51
51
  editorRef: e.oneOfType([
@@ -58,7 +58,7 @@ c.propTypes = {
58
58
  className: e.string,
59
59
  optional: e.bool
60
60
  };
61
- c.displayName = "KendoReactLabel";
61
+ u.displayName = "KendoReactLabel";
62
62
  export {
63
- c as Label
63
+ u as Label
64
64
  };
@@ -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
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-react-intl")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-react-intl"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactLabels={},e.React,e.PropTypes,e.KendoReactCommon,e.KendoReactIntl)}(this,(function(e,t,s,a,r){"use strict";function o(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var a=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,a.get?a:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}var l=o(t);const i="labels.optional",n={[i]:"(Optional)"},c={name:"@progress/kendo-react-labels",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},d=e=>{a.validatePackage(c);const{id:t,editorId:s,editorRef:o,editorDisabled:d,children:p,editorValid:m,style:u,className:b,optional:f}=e,g=r.useLocalization(),y=f?g.toLanguageString(i,n[i]):"",h=y&&l.createElement("span",{className:"k-label-optional"},y),k=l.useCallback((e=>{if(o&&o.current&&!d){o.current.focus&&(e.preventDefault(),o.current.focus());const t=o.current.actionElement;t&&(e.preventDefault(),t.click())}}),[o]),N=a.classNames({"k-label":!0,"k-label-empty":!p,"k-text-error":!1===m,"k-text-disabled":!0===d},b);return l.createElement("label",{id:t,htmlFor:s,onClick:k,style:u,className:N},p,h)};d.propTypes={id:s.string,editorId:s.string,editorRef:s.oneOfType([s.func,s.shape({current:s.any})]),editorValid:s.bool,editorDisabled:s.bool,style:s.object,className:s.string,optional:s.bool},d.displayName="KendoReactLabel";const p=e=>{const t={direction:"start",...e};a.validatePackage(c);const s=a.classNames({"k-form-error":!0,"k-text-start":"start"===t.direction,"k-text-end":"end"===t.direction},t.className);return l.createElement("div",{id:t.id,role:"alert",style:t.style,className:s},t.children)};p.propTypes={id:s.string,direction:s.oneOf(["start","end"]),children:s.oneOfType([s.element,s.node]),style:s.object,className:s.string},p.displayName="KendoReactError";const m=e=>{const t={direction:"start",...e};a.validatePackage(c);const s=a.classNames({"k-form-hint":!0,"k-text-start":"start"===t.direction,"k-text-end":"end"===t.direction,"k-text-disabled":!0===t.editorDisabled},t.className);return l.createElement("div",{id:t.id,style:t.style,className:s},t.children)};m.propTypes={id:s.string,direction:s.oneOf(["start","end"]),children:s.oneOfType([s.element,s.node]),style:s.object,className:s.string,editorDisabled:s.bool},m.displayName="KendoReactHint";const u=class extends l.Component{constructor(e){super(e),this.state={focused:!1},this.handleFocus=e=>{this.setState({focused:!0})},this.handleBlur=e=>{this.setState({focused:!1})},a.validatePackage(c)}render(){const{label:e,editorId:t,className:s,labelClassName:o,editorValue:c,editorPlaceholder:d,editorValid:p,editorDisabled:m,style:u,id:b,optional:f,...g}=this.props,y=r.provideLocalizationService(this),h=f?y.toLanguageString(i,n[i]):"",k=h&&l.createElement("span",{className:"k-label-optional"},h),N=a.classNames({"k-floating-label-container":!0,"k-focus":this.state.focused,"k-empty":!d&&!c&&0!==c,"k-text-disabled":m,"k-rtl":"rtl"===this.props.dir},s),E=a.classNames({"k-floating-label":!0,"k-text-error":!1===p,"k-text-disabled":m},o);return l.createElement("span",{...g,id:this.props.id,className:N,onFocus:this.handleFocus,onBlur:this.handleBlur,style:u,dir:this.props.dir},this.props.children,e?t?l.createElement("label",{id:b,htmlFor:t,className:E},e,k):l.createElement("span",{id:b,className:E},e,k):null)}};u.propTypes={label:s.string,editorId:s.string,editorValue:s.oneOfType([s.string,s.bool,s.number]),editorPlaceholder:s.string,editorValid:s.bool,editorDisabled:s.bool,id:s.string,style:s.object,className:s.string,labelClassName:s.string,optional:s.bool};let b=u;r.registerForLocalization(b),e.Error=p,e.FloatingLabel=b,e.Hint=m,e.Label=d}));
8
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("@progress/kendo-react-intl")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","@progress/kendo-react-intl"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactLabels={},e.React,e.PropTypes,e.KendoReactCommon,e.KendoReactIntl)}(this,(function(e,t,s,a,o){"use strict";function r(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var a=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,a.get?a:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}var l=r(t);const i="labels.optional",n={[i]:"(Optional)"},c={name:"@progress/kendo-react-labels",productName:"KendoReact",productCodes:["KENDOUIREACT","KENDOUICOMPLETE"],publishDate:0,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"},d=e=>{a.validatePackage(c);const{id:t,editorId:s,editorRef:r,editorDisabled:d,children:p,editorValid:u,style:m,className:b,optional:f}=e,y=o.useLocalization(),g=f?y.toLanguageString(i,n[i]):"",h=g&&l.createElement("span",{className:"k-label-optional"},g),N=a.useUnstyled(),E=N&&N.uLabel,k=l.useCallback((e=>{if(r&&r.current&&!d){r.current.focus&&(e.preventDefault(),r.current.focus());const t=r.current.actionElement;t&&(e.preventDefault(),t.click())}}),[r]),v=l.useMemo((()=>a.classNames(a.uLabel.label({c:E,empty:!p,invalid:!1===u,disabled:!0===d}),b)),[E,p,u,d,b]);return l.createElement("label",{id:t,htmlFor:s,onClick:k,style:m,className:v},p,h)};d.propTypes={id:s.string,editorId:s.string,editorRef:s.oneOfType([s.func,s.shape({current:s.any})]),editorValid:s.bool,editorDisabled:s.bool,style:s.object,className:s.string,optional:s.bool},d.displayName="KendoReactLabel";const p=e=>{const t={direction:"start",...e};a.validatePackage(c);const s=a.useUnstyled(),o=s&&s.uError,r=l.useMemo((()=>a.classNames(a.uError.wrapper({c:o,direction:t.direction}),t.className)),[o,t.direction,t.className]);return l.createElement("div",{id:t.id,role:"alert",style:t.style,className:r},t.children)};p.propTypes={id:s.string,direction:s.oneOf(["start","end"]),children:s.oneOfType([s.element,s.node]),style:s.object,className:s.string},p.displayName="KendoReactError";const u=e=>{const t={direction:"start",...e};a.validatePackage(c);const s=a.useUnstyled(),o=s&&s.uHint,r=l.useMemo((()=>a.classNames(a.uHint.wrapper({c:o,direction:t.direction,disabled:!0===t.editorDisabled}),t.className)),[o,t.direction,t.editorDisabled,t.className]);return l.createElement("div",{id:t.id,style:t.style,className:r},t.children)};u.propTypes={id:s.string,direction:s.oneOf(["start","end"]),children:s.oneOfType([s.element,s.node]),style:s.object,className:s.string,editorDisabled:s.bool},u.displayName="KendoReactHint";const m=class extends l.Component{constructor(e){super(e),this.state={focused:!1},this.handleFocus=e=>{this.setState({focused:!0})},this.handleBlur=e=>{this.setState({focused:!1})},a.validatePackage(c)}render(){const{label:e,editorId:t,className:s,labelClassName:r,editorValue:c,editorPlaceholder:d,editorValid:p,editorDisabled:u,style:m,id:b,optional:f,unstyled:y,...g}=this.props,h=o.provideLocalizationService(this),N=f?h.toLanguageString(i,n[i]):"",E=N&&l.createElement("span",{className:"k-label-optional"},N),k=y&&y.uFloatingLabel,v=a.classNames(a.uFloatingLabel.wrapper({c:k,focused:this.state.focused,empty:!d&&!c&&0!==c,disabled:u,isRtl:"rtl"===this.props.dir}),s),O=a.classNames(a.uFloatingLabel.label({c:k,invalid:!1===p,disabled:u}),r);return l.createElement("span",{...g,id:this.props.id,className:v,onFocus:this.handleFocus,onBlur:this.handleBlur,style:m,dir:this.props.dir},this.props.children,e?t?l.createElement("label",{id:b,htmlFor:t,className:O},e,E):l.createElement("span",{id:b,className:O},e,E):null)}};m.propTypes={label:s.string,editorId:s.string,editorValue:s.oneOfType([s.string,s.bool,s.number]),editorPlaceholder:s.string,editorValid:s.bool,editorDisabled:s.bool,id:s.string,style:s.object,className:s.string,labelClassName:s.string,optional:s.bool};let b=m;o.registerForLocalization(b),e.Error=p,e.FloatingLabel=b,e.Hint=u,e.Label=d}));
package/index.d.mts CHANGED
@@ -7,6 +7,7 @@
7
7
  */
8
8
  import { JSX as JSX_2 } from 'react/jsx-runtime';
9
9
  import { KendoReactComponentBaseProps } from '@progress/kendo-react-common';
10
+ import { LabelsClassStructure } from '@progress/kendo-react-common';
10
11
  import PropTypes from 'prop-types';
11
12
  import * as React_2 from 'react';
12
13
 
@@ -56,6 +57,10 @@ export declare interface ErrorProps {
56
57
  * Sets a class of the Error DOM element.
57
58
  */
58
59
  className?: string;
60
+ /**
61
+ * @hidden
62
+ */
63
+ unstyled?: LabelsClassStructure;
59
64
  }
60
65
 
61
66
  /**
@@ -172,6 +177,10 @@ export declare interface FloatingLabelProps extends KendoReactComponentBaseProps
172
177
  * If enabled, marks the label as optional.
173
178
  */
174
179
  optional?: boolean;
180
+ /**
181
+ * @hidden
182
+ */
183
+ unstyled?: LabelsClassStructure;
175
184
  }
176
185
 
177
186
  /**
@@ -231,6 +240,10 @@ export declare interface HintProps {
231
240
  * Specifies if the editor is disabled.
232
241
  */
233
242
  editorDisabled?: boolean;
243
+ /**
244
+ * @hidden
245
+ */
246
+ unstyled?: LabelsClassStructure;
234
247
  }
235
248
 
236
249
  /**
@@ -326,6 +339,10 @@ export declare interface LabelProps {
326
339
  * Sets a class of the Label DOM element.
327
340
  */
328
341
  className?: string;
342
+ /**
343
+ * @hidden
344
+ */
345
+ unstyled?: LabelsClassStructure;
329
346
  }
330
347
 
331
348
  export { }
package/index.d.ts CHANGED
@@ -7,6 +7,7 @@
7
7
  */
8
8
  import { JSX as JSX_2 } from 'react/jsx-runtime';
9
9
  import { KendoReactComponentBaseProps } from '@progress/kendo-react-common';
10
+ import { LabelsClassStructure } from '@progress/kendo-react-common';
10
11
  import PropTypes from 'prop-types';
11
12
  import * as React_2 from 'react';
12
13
 
@@ -56,6 +57,10 @@ export declare interface ErrorProps {
56
57
  * Sets a class of the Error DOM element.
57
58
  */
58
59
  className?: string;
60
+ /**
61
+ * @hidden
62
+ */
63
+ unstyled?: LabelsClassStructure;
59
64
  }
60
65
 
61
66
  /**
@@ -172,6 +177,10 @@ export declare interface FloatingLabelProps extends KendoReactComponentBaseProps
172
177
  * If enabled, marks the label as optional.
173
178
  */
174
179
  optional?: boolean;
180
+ /**
181
+ * @hidden
182
+ */
183
+ unstyled?: LabelsClassStructure;
175
184
  }
176
185
 
177
186
  /**
@@ -231,6 +240,10 @@ export declare interface HintProps {
231
240
  * Specifies if the editor is disabled.
232
241
  */
233
242
  editorDisabled?: boolean;
243
+ /**
244
+ * @hidden
245
+ */
246
+ unstyled?: LabelsClassStructure;
234
247
  }
235
248
 
236
249
  /**
@@ -326,6 +339,10 @@ export declare interface LabelProps {
326
339
  * Sets a class of the Label DOM element.
327
340
  */
328
341
  className?: string;
342
+ /**
343
+ * @hidden
344
+ */
345
+ unstyled?: LabelsClassStructure;
329
346
  }
330
347
 
331
348
  export { }
@@ -10,7 +10,7 @@ const e = {
10
10
  name: "@progress/kendo-react-labels",
11
11
  productName: "KendoReact",
12
12
  productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
13
- publishDate: 1723622279,
13
+ publishDate: 1724316070,
14
14
  version: "",
15
15
  licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
16
16
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-labels",
3
- "version": "8.3.0-develop.4",
3
+ "version": "8.3.0-develop.6",
4
4
  "description": "React Labels package provides components for labelling form editors. KendoReact Labels package",
5
5
  "author": "Progress",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -23,8 +23,8 @@
23
23
  "sideEffects": false,
24
24
  "peerDependencies": {
25
25
  "@progress/kendo-licensing": "^1.3.4",
26
- "@progress/kendo-react-common": "8.3.0-develop.4",
27
- "@progress/kendo-react-intl": "8.3.0-develop.4",
26
+ "@progress/kendo-react-common": "8.3.0-develop.6",
27
+ "@progress/kendo-react-intl": "8.3.0-develop.6",
28
28
  "react": "^16.8.2 || ^17.0.0 || ^18.0.0",
29
29
  "react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
30
30
  },