@lanaco/lnc-react-ui 4.0.18 → 4.0.20

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.
@@ -1,22 +1,30 @@
1
- "use strict";const t=require("react/jsx-runtime"),m=require("react"),r=require("./index-BIlhCoy2.cjs"),n=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),s=require("./utils-DTAPpJXU.cjs"),b=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs"),h=n.newStyled.div`
1
+ "use strict";const a=require("react/jsx-runtime"),i=require("react"),r=require("./index-BIlhCoy2.cjs"),l=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),o=require("./utils-DTAPpJXU.cjs"),P=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs"),f=l.newStyled.div`
2
2
  width: 100%;
3
3
  position: relative;
4
- background-color: ${e=>s.getColorRgbaValue(e.theme,"Progress",e.color,"enabled","unfilled")};
4
+ background-color: ${e=>o.getColorRgbaValue(e.theme,"Progress",e.color,"enabled","unfilled")};
5
5
  height: ${e=>e.theme.components.Progress.default.enabled.sizes[e.size]};
6
6
  border-radius: 5px;
7
7
  animation: progres 4s infinite linear;
8
- `,y=n.newStyled.div`
8
+ `,x=l.newStyled.div`
9
+ position: relative;
9
10
  height: 100%;
10
11
  width: ${e=>e.progressPercentage+"%"};
11
- background-color: ${e=>s.getColorRgbaValue(e.theme,"Progress",e.color,"enabled","background")};
12
- position absolute;
12
+ background-color: ${e=>o.getColorRgbaValue(e.theme,"Progress",e.color,"enabled","background")};
13
+ position: absolute;
13
14
  border-radius: ${e=>e.progressPercentage==100?"5px":"5px 0px 0px 5px"};
14
15
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
15
- `,P=n.newStyled.label`
16
- ${e=>s.getComponentTypographyCss(e.theme,"Progress",e.size,"enabled")};
16
+
17
+ & .progress-icon {
18
+ position: absolute;
19
+ right: 0;
20
+ top: 50%;
21
+ transform: translate(50%, -50%);
22
+ }
23
+ `,w=l.newStyled.label`
24
+ ${e=>o.getComponentTypographyCss(e.theme,"Progress",e.size,"enabled")};
17
25
  position: absolute;
18
26
  top: 50%;
19
27
  left: 50%;
20
28
  transform: translate(-50%, -50%);
21
- color: ${e=>s.getColorRgbaValue(e.theme,"Progress",e.color,"enabled","text")};
22
- `,c=m.forwardRef((e,f)=>{const{id:x="",showLabel:a=!1,progressPercentage:i=0,className:g="",style:d={},onChange:w=()=>{},size:l="small",color:p="primary",...u}=e,o=b.useTheme();return t.jsxs(h,{style:d,className:"lnc-ui-progress "+g,theme:o,size:l,showLabel:a,...u,children:[t.jsx(y,{progressPercentage:i,theme:o,color:p}),a&&t.jsxs(P,{theme:o,size:l,children:[i,"%"]})]})});c.propTypes={id:r.PropTypes.string,showLabel:r.PropTypes.bool,progressPercentage:r.PropTypes.number,onChange:r.PropTypes.func,className:r.PropTypes.string,style:r.PropTypes.object,size:r.PropTypes.oneOf(["small","medium","large"]),color:r.PropTypes.oneOf(["primary","secondary","success","danger","warning","disabled","information","neutral","gray"])};module.exports=c;
29
+ color: ${e=>o.getColorRgbaValue(e.theme,"Progress",e.color,"enabled","text")};
30
+ `,d=i.forwardRef((e,T)=>{const{id:$="",showLabel:c=!1,progressPercentage:t=0,className:m="",style:u={},onChange:C=()=>{},size:g="small",color:b="primary",progressBarEndComponent:s,...h}=e,n=P.useTheme(),y=()=>{var p;if(i.isValidElement(s))return i.cloneElement(s,{className:`progress-icon ${(p=s==null?void 0:s.props)==null?void 0:p.className}`})};return a.jsxs(f,{style:u,className:"lnc-ui-progress "+m,theme:n,size:g,showLabel:c,progressPercentage:t,...h,children:[a.jsx(x,{progressPercentage:t,theme:n,color:b,children:s!==null&&y()}),c&&a.jsxs(w,{theme:n,size:g,children:[t,"%"]})]})});d.propTypes={id:r.PropTypes.string,showLabel:r.PropTypes.bool,progressPercentage:r.PropTypes.number,onChange:r.PropTypes.func,className:r.PropTypes.string,style:r.PropTypes.object,size:r.PropTypes.oneOf(["small","medium","large"]),color:r.PropTypes.oneOf(["primary","secondary","success","danger","warning","disabled","information","neutral","gray"]),progressBarEndComponent:r.PropTypes.any};module.exports=d;
@@ -1,13 +1,13 @@
1
- import { jsxs as l, jsx as p } from "react/jsx-runtime";
2
- import { forwardRef as b } from "react";
1
+ import { jsxs as g, jsx as h } from "react/jsx-runtime";
2
+ import { forwardRef as f, isValidElement as P, cloneElement as y } from "react";
3
3
  import { P as r } from "./index-BYnWp42a.js";
4
- import { n as s } from "./emotion-styled.browser.esm-BiK8DcgW.js";
5
- import { a, g as h } from "./utils-C52T57HO.js";
6
- import { u } from "./emotion-element-5486c51c.browser.esm-Bb4VkP8U.js";
7
- const f = s.div`
4
+ import { n as t } from "./emotion-styled.browser.esm-BiK8DcgW.js";
5
+ import { a as n, g as x } from "./utils-C52T57HO.js";
6
+ import { u as w } from "./emotion-element-5486c51c.browser.esm-Bb4VkP8U.js";
7
+ const $ = t.div`
8
8
  width: 100%;
9
9
  position: relative;
10
- background-color: ${(e) => a(
10
+ background-color: ${(e) => n(
11
11
  e.theme,
12
12
  "Progress",
13
13
  e.color,
@@ -17,66 +17,83 @@ const f = s.div`
17
17
  height: ${(e) => e.theme.components.Progress.default.enabled.sizes[e.size]};
18
18
  border-radius: 5px;
19
19
  animation: progres 4s infinite linear;
20
- `, P = s.div`
20
+ `, z = t.div`
21
+ position: relative;
21
22
  height: 100%;
22
23
  width: ${(e) => e.progressPercentage + "%"};
23
- background-color: ${(e) => a(
24
+ background-color: ${(e) => n(
24
25
  e.theme,
25
26
  "Progress",
26
27
  e.color,
27
28
  "enabled",
28
29
  "background"
29
30
  )};
30
- position absolute;
31
+ position: absolute;
31
32
  border-radius: ${(e) => e.progressPercentage == 100 ? "5px" : "5px 0px 0px 5px"};
32
33
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
33
- `, y = s.label`
34
- ${(e) => h(e.theme, "Progress", e.size, "enabled")};
34
+
35
+ & .progress-icon {
36
+ position: absolute;
37
+ right: 0;
38
+ top: 50%;
39
+ transform: translate(50%, -50%);
40
+ }
41
+ `, C = t.label`
42
+ ${(e) => x(e.theme, "Progress", e.size, "enabled")};
35
43
  position: absolute;
36
44
  top: 50%;
37
45
  left: 50%;
38
46
  transform: translate(-50%, -50%);
39
- color: ${(e) => a(e.theme, "Progress", e.color, "enabled", "text")};
40
- `, x = b((e, w) => {
47
+ color: ${(e) => n(e.theme, "Progress", e.color, "enabled", "text")};
48
+ `, N = f((e, v) => {
41
49
  const {
42
- id: $ = "",
43
- showLabel: t = !1,
44
- progressPercentage: n = 0,
45
- className: c = "",
46
- style: g = {},
47
- onChange: z = () => {
50
+ id: T = "",
51
+ showLabel: i = !1,
52
+ progressPercentage: s = 0,
53
+ className: m = "",
54
+ style: d = {},
55
+ onChange: j = () => {
48
56
  },
49
- size: i = "small",
50
- color: m = "primary",
51
- ...d
52
- } = e, o = u();
53
- return /* @__PURE__ */ l(
54
- f,
57
+ size: l = "small",
58
+ color: p = "primary",
59
+ progressBarEndComponent: o,
60
+ ...b
61
+ } = e, a = w(), u = () => {
62
+ var c;
63
+ if (P(o))
64
+ return y(o, {
65
+ className: `progress-icon ${(c = o == null ? void 0 : o.props) == null ? void 0 : c.className}`
66
+ });
67
+ };
68
+ return /* @__PURE__ */ g(
69
+ $,
55
70
  {
56
- style: g,
57
- className: "lnc-ui-progress " + c,
58
- theme: o,
59
- size: i,
60
- showLabel: t,
61
- ...d,
71
+ style: d,
72
+ className: "lnc-ui-progress " + m,
73
+ theme: a,
74
+ size: l,
75
+ showLabel: i,
76
+ progressPercentage: s,
77
+ ...b,
62
78
  children: [
63
- /* @__PURE__ */ p(
64
- P,
79
+ /* @__PURE__ */ h(
80
+ z,
65
81
  {
66
- progressPercentage: n,
67
- theme: o,
68
- color: m
82
+ progressPercentage: s,
83
+ theme: a,
84
+ color: p,
85
+ children: o !== null && u()
69
86
  }
70
87
  ),
71
- t && /* @__PURE__ */ l(y, { theme: o, size: i, children: [
72
- n,
88
+ i && /* @__PURE__ */ g(C, { theme: a, size: l, children: [
89
+ s,
73
90
  "%"
74
91
  ] })
75
92
  ]
76
93
  }
77
94
  );
78
95
  });
79
- x.propTypes = {
96
+ N.propTypes = {
80
97
  id: r.string,
81
98
  showLabel: r.bool,
82
99
  progressPercentage: r.number,
@@ -96,8 +113,9 @@ x.propTypes = {
96
113
  "information",
97
114
  "neutral",
98
115
  "gray"
99
- ])
116
+ ]),
117
+ progressBarEndComponent: r.any
100
118
  };
101
119
  export {
102
- x as default
120
+ N as default
103
121
  };
package/dist/Tabs.cjs CHANGED
@@ -4,4 +4,4 @@
4
4
  justify-content: ${s=>s.fullWidth?"space-evenly":"none"};
5
5
  gap: ${s=>s.type=="pill"?"10px":"0"};
6
6
  box-sizing: border-box;
7
- `,p=r.forwardRef((s,d)=>{const{type:l="regular",fullWidth:t=!1,className:m="",style:u={},color:i="primary",size:c="small",children:a,...y}=s,h=q.useTheme(),[f,b]=r.useState(),g={theme:h,color:i,size:c,style:u,className:"lnc-ui-tabs "+m},T=n=>{b(n)},x=r.Children.map(a,(n,o)=>r.cloneElement(n,{type:l,first:o==0,last:o==r.Children.toArray(a).length-1,fullWidth:t,index:o,itemClick:T,activeIndex:f,color:i,size:c,fullWidth:t}));return P.jsx(w,{ref:d,type:l,fullWidth:t,...g,...y,children:x})});p.propTypes={type:e.PropTypes.oneOf(["regular","pill","underline"]),fullWidth:e.PropTypes.bool,className:e.PropTypes.string,style:e.PropTypes.object,color:e.PropTypes.oneOf(["primary","secondary","success","warning","danger","information","neutral","gray"]),size:e.PropTypes.oneOf(["small","medium","large"])};module.exports=p;
7
+ `,p=r.forwardRef((s,d)=>{const{type:o="regular",fullWidth:l=!1,className:m="",style:u={},color:i="primary",size:c="small",children:a,...y}=s,h=q.useTheme(),[f,b]=r.useState(),g={theme:h,color:i,size:c,style:u,className:"lnc-ui-tabs "+m},T=t=>{b(t)},x=r.Children.map(a,(t,n)=>r.cloneElement(t,{type:o,first:n==0,last:n==r.Children.toArray(a).length-1,fullWidth:l,index:n,itemClick:T,activeIndex:f,color:i,size:c}));return P.jsx(w,{ref:d,type:o,fullWidth:l,...g,...y,children:x})});p.propTypes={type:e.PropTypes.oneOf(["regular","pill","underline"]),fullWidth:e.PropTypes.bool,className:e.PropTypes.string,style:e.PropTypes.object,color:e.PropTypes.oneOf(["primary","secondary","success","warning","danger","information","neutral","gray"]),size:e.PropTypes.oneOf(["small","medium","large"])};module.exports=p;
package/dist/Tabs.js CHANGED
@@ -11,8 +11,8 @@ const w = W.div`
11
11
  box-sizing: border-box;
12
12
  `, z = j((t, m) => {
13
13
  const {
14
- type: o = "regular",
15
- fullWidth: r = !1,
14
+ type: l = "regular",
15
+ fullWidth: o = !1,
16
16
  //----------------
17
17
  className: p = "",
18
18
  style: d = {},
@@ -26,29 +26,28 @@ const w = W.div`
26
26
  size: a,
27
27
  style: d,
28
28
  className: "lnc-ui-tabs " + p
29
- }, b = (s) => {
30
- h(s);
29
+ }, b = (r) => {
30
+ h(r);
31
31
  }, x = c.map(
32
32
  i,
33
- (s, l) => P(s, {
34
- type: o,
35
- first: l == 0,
36
- last: l == c.toArray(i).length - 1,
37
- fullWidth: r,
38
- index: l,
33
+ (r, s) => P(r, {
34
+ type: l,
35
+ first: s == 0,
36
+ last: s == c.toArray(i).length - 1,
37
+ fullWidth: o,
38
+ index: s,
39
39
  itemClick: b,
40
40
  activeIndex: y,
41
41
  color: n,
42
- size: a,
43
- fullWidth: r
42
+ size: a
44
43
  })
45
44
  );
46
45
  return /* @__PURE__ */ T(
47
46
  w,
48
47
  {
49
48
  ref: m,
50
- type: o,
51
- fullWidth: r,
49
+ type: l,
50
+ fullWidth: o,
52
51
  ...g,
53
52
  ...f,
54
53
  children: x
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lanaco/lnc-react-ui",
3
- "version": "4.0.18",
3
+ "version": "4.0.20",
4
4
  "description": "React component library",
5
5
  "type": "module",
6
6
  "keywords": [