@lanaco/lnc-react-ui 4.0.97 → 4.0.98

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,20 +1,20 @@
1
- "use strict";const c=require("react/jsx-runtime"),t=require("./index-BPVoEhTF.cjs"),a=require("react"),M=require("./index-DaiUAQVF.cjs"),p=require("./emotion-styled.browser.esm-BtEseadx.cjs"),n=require("./utils-BOtq2mcF.cjs"),v=require("./emotion-element-f0de968e.browser.esm-B7k6i6lC.cjs"),K=p.styled.div`
1
+ "use strict";const c=require("react/jsx-runtime"),r=require("./index-BPVoEhTF.cjs"),l=require("react"),K=require("./index-DaiUAQVF.cjs"),p=require("./emotion-styled.browser.esm-BtEseadx.cjs"),o=require("./utils-BOtq2mcF.cjs"),X=require("./emotion-element-f0de968e.browser.esm-B7k6i6lC.cjs"),H=p.styled.div`
2
2
  display: flex;
3
3
  align-items: center;
4
4
 
5
- min-height: ${e=>n.getSizeValueWithUnits(e.theme,e.size)};
6
- max-height: ${e=>n.getSizeValueWithUnits(e.theme,e.size)};
7
- background-color: ${e=>n.getColorRgbaValue(e.theme,"Input",e.color,"enabled","background")};
5
+ min-height: ${e=>o.getSizeValueWithUnits(e.theme,e.size)};
6
+ max-height: ${e=>o.getSizeValueWithUnits(e.theme,e.size)};
7
+ background-color: ${e=>o.getColorRgbaValue(e.theme,"Input",e.color,"enabled","background")};
8
8
  border: 1px solid
9
- ${e=>n.getColorRgbaValue(e.theme,"Input",e.focused===!0?"primary":e.color,e.disabled===!0?"disabled":"enabled","border")};
10
- border-radius: ${e=>n.getBorderRadiusValueWithUnits(e.theme,"regular")};
9
+ ${e=>o.getColorRgbaValue(e.theme,"Input",e.focused===!0?"primary":e.color,e.disabled===!0?"disabled":"enabled","border")};
10
+ border-radius: ${e=>o.getBorderRadiusValueWithUnits(e.theme,"regular")};
11
11
 
12
- ${e=>e.focused&&e.readOnly!==!0?n.getOutlineCss(e.theme):""}
13
- ${e=>e.disabled===!0?n.getDisabledStateCss(e.theme):""}
14
- `,I=p.styled.span`
12
+ ${e=>e.focused&&e.readOnly!==!0?o.getOutlineCss(e.theme):""}
13
+ ${e=>e.disabled===!0?o.getDisabledStateCss(e.theme):""}
14
+ `,R=p.styled.span`
15
15
  padding: 0 12px;
16
- color: ${e=>n.getColorRgbaValue(e.theme,"Input",e.focused===!0?"primary":e.color,"enabled","prefix")};
17
- `,X=p.styled(I)``,H=p.styled.input`
16
+ color: ${e=>o.getColorRgbaValue(e.theme,"Input",e.focused===!0?"primary":e.color,"enabled","prefix")};
17
+ `,J=p.styled(R)``,L=p.styled.input`
18
18
  background: none;
19
19
  border: none;
20
20
  outline: none;
@@ -22,16 +22,16 @@
22
22
  padding-bottom: 0.625rem;
23
23
  width: 100%;
24
24
 
25
- ${e=>n.getComponentTypographyCss(e.theme,"Input",e.size,"enabled")}
26
- min-height: ${e=>n.getSizeValueWithUnits(e.theme,e.size)};
27
- max-height: ${e=>n.getSizeValueWithUnits(e.theme,e.size)};
28
- color: ${e=>n.getColorRgbaValue(e.theme,"Input",e.focused===!0?"primary":e.color,"enabled","text")};
29
- caret-color: ${e=>n.getColorRgbaValue(e.theme,"Input",e.color,"enabled","caret")};
25
+ ${e=>o.getComponentTypographyCss(e.theme,"Input",e.size,"enabled")}
26
+ min-height: ${e=>o.getSizeValueWithUnits(e.theme,e.size)};
27
+ max-height: ${e=>o.getSizeValueWithUnits(e.theme,e.size)};
28
+ color: ${e=>o.getColorRgbaValue(e.theme,"Input",e.focused===!0?"primary":e.color,"enabled","text")};
29
+ caret-color: ${e=>o.getColorRgbaValue(e.theme,"Input",e.color,"enabled","caret")};
30
30
  padding-right: ${e=>e.suffix?"0":"0.75rem"};
31
31
  padding-left: ${e=>e.prefix?"0":"0.75rem"};
32
32
 
33
33
  &::placeholder {
34
- color: ${e=>n.getColorRgbaValue(e.theme,"Input",e.color,"enabled","placeholder")};
34
+ color: ${e=>o.getColorRgbaValue(e.theme,"Input",e.color,"enabled","placeholder")};
35
35
  }
36
36
 
37
37
  &:read-only {
@@ -39,7 +39,7 @@
39
39
  }
40
40
 
41
41
  &:disabled {
42
- ${e=>n.getDisabledStateCss(e.theme)}
42
+ ${e=>o.getDisabledStateCss(e.theme)}
43
43
  background: none;
44
44
  }
45
- `,R=a.forwardRef((e,z)=>{const{disabled:T,readOnly:x,debounceTime:N=0,step:O=1,min:E=Number.MIN_SAFE_INTEGER,max:_=Number.MAX_SAFE_INTEGER,prefix:m,suffix:y,placeholder:k,value:o,defaultValue:P,onChange:l,onBlur:g,onFocus:b,onKeyDown:h,className:q="",style:j={},size:$="small",color:u="primary",...w}=e,i=v.useTheme(),d=a.useRef(o||P||""),[F,V]=a.useState(o||P||""),[f,C]=a.useState(!1);a.useEffect(()=>{o!=null&&(d.current=o,V(d.current))},[o]);const W=a.useCallback(M.debounce((r,s)=>U(r,s),N),[l]),U=(r,s)=>{l&&(l==null||l(r,s))},D=r=>{d.current=r.target.value,V(d.current),W(r,r.target.value)},A=r=>{C(!0),b==null||b(r)},B=r=>{C(!1),g==null||g(r)},G=r=>{var s,S;((S=(s=r==null?void 0:r.target)==null?void 0:s.value)==null?void 0:S.length)>0&&(r.key==="+"||r.key==="-")&&r.preventDefault(),h==null||h(r)};return c.jsxs(K,{style:j,className:q,theme:i,color:u,size:$,focused:f,disabled:T,readOnly:x,children:[m&&c.jsx(I,{theme:i,color:u,focused:f,className:"lnc-input-prefix",children:m}),c.jsx(H,{ref:z,type:"number",theme:i,color:u,size:$,placeholder:k,prefix:m,suffix:y,disabled:T,readOnly:x,step:O,min:E,max:_,value:F,onFocus:A,onBlur:B,onChange:D,onKeyDown:G,...w}),y&&c.jsx(X,{theme:i,color:u,focused:f,className:"lnc-input-suffix",children:y})]})});R.propTypes={id:t.PropTypes.any,value:t.PropTypes.any,defaultValue:t.PropTypes.any,disabled:t.PropTypes.bool,readOnly:t.PropTypes.bool,debounceTime:t.PropTypes.number,step:t.PropTypes.number,min:t.PropTypes.number,max:t.PropTypes.number,prefix:t.PropTypes.oneOfType([t.PropTypes.string,t.PropTypes.element]),suffix:t.PropTypes.oneOfType([t.PropTypes.string,t.PropTypes.element]),placeholder:t.PropTypes.string,tabIndex:t.PropTypes.number,onChange:t.PropTypes.func,onBlur:t.PropTypes.func,onFocus:t.PropTypes.func,className:t.PropTypes.string,style:t.PropTypes.object,size:t.PropTypes.oneOf(["small","medium","large"]),color:t.PropTypes.oneOf(["primary","secondary","success","danger","warning","information","neutral","gray"])};module.exports=R;
45
+ `,z=l.forwardRef((e,k)=>{const{disabled:T,readOnly:x,debounceTime:N=0,step:O=1,min:E=Number.MIN_SAFE_INTEGER,max:_=Number.MAX_SAFE_INTEGER,prefix:m,suffix:y,placeholder:q,value:n,defaultValue:P,onChange:s,onBlur:g,onFocus:b,onKeyDown:h,className:j="",style:w={},size:$="small",color:u="primary",...F}=e,i=X.useTheme(),d=l.useRef(n||P||""),[W,V]=l.useState(n||P||""),[f,C]=l.useState(!1);l.useEffect(()=>{n!=null&&(d.current=n,V(d.current))},[n]);const U=l.useCallback(K.debounce((t,a)=>D(t,a),N),[s]),D=(t,a)=>{s&&(s==null||s(t,a))},A=t=>{d.current=t.target.value,V(d.current),U(t,t.target.value)},B=t=>{C(!0),b==null||b(t)},G=t=>{C(!1),g==null||g(t)},M=t=>{var a,S,I;((S=(a=t==null?void 0:t.target)==null?void 0:a.value)==null?void 0:S.length)>0&&(t.key==="+"||t.key==="-")&&t.preventDefault(),((I=t==null?void 0:t.target)==null?void 0:I.value)===""&&(t.key==="+"||t.key==="-")&&(t.target.value=t.key),h==null||h(t)};return c.jsxs(H,{style:w,className:j,theme:i,color:u,size:$,focused:f,disabled:T,readOnly:x,children:[m&&c.jsx(R,{theme:i,color:u,focused:f,className:"lnc-input-prefix",children:m}),c.jsx(L,{ref:k,type:"number",theme:i,color:u,size:$,placeholder:q,prefix:m,suffix:y,disabled:T,readOnly:x,step:O,min:E,max:_,value:W,onFocus:B,onBlur:G,onChange:A,onKeyDown:M,...F}),y&&c.jsx(J,{theme:i,color:u,focused:f,className:"lnc-input-suffix",children:y})]})});z.propTypes={id:r.PropTypes.any,value:r.PropTypes.any,defaultValue:r.PropTypes.any,disabled:r.PropTypes.bool,readOnly:r.PropTypes.bool,debounceTime:r.PropTypes.number,step:r.PropTypes.number,min:r.PropTypes.number,max:r.PropTypes.number,prefix:r.PropTypes.oneOfType([r.PropTypes.string,r.PropTypes.element]),suffix:r.PropTypes.oneOfType([r.PropTypes.string,r.PropTypes.element]),placeholder:r.PropTypes.string,tabIndex:r.PropTypes.number,onChange:r.PropTypes.func,onBlur:r.PropTypes.func,onFocus: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","information","neutral","gray"])};module.exports=z;
@@ -1,16 +1,16 @@
1
- import { jsxs as G, jsx as p } from "react/jsx-runtime";
2
- import { P as n } from "./index-S5Cd7WrG.js";
3
- import { forwardRef as K, useRef as M, useState as V, useEffect as U, useCallback as v } from "react";
4
- import { d as X } from "./index-CkWvbrVT.js";
1
+ import { jsxs as K, jsx as p } from "react/jsx-runtime";
2
+ import { P as t } from "./index-S5Cd7WrG.js";
3
+ import { forwardRef as M, useRef as U, useState as V, useEffect as X, useCallback as q } from "react";
4
+ import { d as H } from "./index-CkWvbrVT.js";
5
5
  import { s as c } from "./emotion-styled.browser.esm-BNN1dTl3.js";
6
- import { d as i, b as l, a as q, e as H, h as O, c as J } from "./utils-WHYrEnYF.js";
7
- import { u as L } from "./emotion-element-f0de968e.browser.esm-CkCiQliQ.js";
8
- const Q = c.div`
6
+ import { d as s, b as l, a as J, e as L, h as O, c as Q } from "./utils-WHYrEnYF.js";
7
+ import { u as Y } from "./emotion-element-f0de968e.browser.esm-CkCiQliQ.js";
8
+ const Z = c.div`
9
9
  display: flex;
10
10
  align-items: center;
11
11
 
12
- min-height: ${(e) => i(e.theme, e.size)};
13
- max-height: ${(e) => i(e.theme, e.size)};
12
+ min-height: ${(e) => s(e.theme, e.size)};
13
+ max-height: ${(e) => s(e.theme, e.size)};
14
14
  background-color: ${(e) => l(
15
15
  e.theme,
16
16
  "Input",
@@ -26,9 +26,9 @@ const Q = c.div`
26
26
  e.disabled === !0 ? "disabled" : "enabled",
27
27
  "border"
28
28
  )};
29
- border-radius: ${(e) => q(e.theme, "regular")};
29
+ border-radius: ${(e) => J(e.theme, "regular")};
30
30
 
31
- ${(e) => e.focused && e.readOnly !== !0 ? H(e.theme) : ""}
31
+ ${(e) => e.focused && e.readOnly !== !0 ? L(e.theme) : ""}
32
32
  ${(e) => e.disabled === !0 ? O(e.theme) : ""}
33
33
  `, z = c.span`
34
34
  padding: 0 12px;
@@ -39,7 +39,7 @@ const Q = c.div`
39
39
  "enabled",
40
40
  "prefix"
41
41
  )};
42
- `, Y = c(z)``, Z = c.input`
42
+ `, v = c(z)``, ee = c.input`
43
43
  background: none;
44
44
  border: none;
45
45
  outline: none;
@@ -47,9 +47,9 @@ const Q = c.div`
47
47
  padding-bottom: 0.625rem;
48
48
  width: 100%;
49
49
 
50
- ${(e) => J(e.theme, "Input", e.size, "enabled")}
51
- min-height: ${(e) => i(e.theme, e.size)};
52
- max-height: ${(e) => i(e.theme, e.size)};
50
+ ${(e) => Q(e.theme, "Input", e.size, "enabled")}
51
+ min-height: ${(e) => s(e.theme, e.size)};
52
+ max-height: ${(e) => s(e.theme, e.size)};
53
53
  color: ${(e) => l(
54
54
  e.theme,
55
55
  "Input",
@@ -79,18 +79,18 @@ const Q = c.div`
79
79
  ${(e) => O(e.theme)}
80
80
  background: none;
81
81
  }
82
- `, ee = K((e, k) => {
82
+ `, ae = M((e, E) => {
83
83
  const {
84
84
  disabled: x,
85
85
  readOnly: $,
86
- debounceTime: E = 0,
87
- step: R = 1,
88
- min: F = Number.MIN_SAFE_INTEGER,
89
- max: w = Number.MAX_SAFE_INTEGER,
86
+ debounceTime: R = 0,
87
+ step: F = 1,
88
+ min: w = Number.MIN_SAFE_INTEGER,
89
+ max: B = Number.MAX_SAFE_INTEGER,
90
90
  prefix: m,
91
91
  suffix: f,
92
- placeholder: B,
93
- value: a,
92
+ placeholder: D,
93
+ value: n,
94
94
  defaultValue: I,
95
95
  //----------------
96
96
  onChange: o,
@@ -98,26 +98,26 @@ const Q = c.div`
98
98
  onFocus: b,
99
99
  onKeyDown: g,
100
100
  //----------------
101
- className: D = "",
102
- style: _ = {},
101
+ className: _ = "",
102
+ style: j = {},
103
103
  size: C = "small",
104
104
  color: u = "primary",
105
- ...j
106
- } = e, d = L(), s = M(a || I || ""), [A, N] = V(a || I || ""), [y, S] = V(!1);
107
- U(() => {
108
- a != null && (s.current = a, N(s.current));
109
- }, [a]);
110
- const P = v(
111
- X((t, r) => W(t, r), E),
105
+ ...A
106
+ } = e, d = Y(), i = U(n || I || ""), [P, k] = V(n || I || ""), [y, N] = V(!1);
107
+ X(() => {
108
+ n != null && (i.current = n, k(i.current));
109
+ }, [n]);
110
+ const W = q(
111
+ H((a, r) => G(a, r), R),
112
112
  [o]
113
- ), W = (t, r) => {
114
- o && (o == null || o(t, r));
113
+ ), G = (a, r) => {
114
+ o && (o == null || o(a, r));
115
115
  };
116
- return /* @__PURE__ */ G(
117
- Q,
116
+ return /* @__PURE__ */ K(
117
+ Z,
118
118
  {
119
- style: _,
120
- className: D,
119
+ style: j,
120
+ className: _,
121
121
  theme: d,
122
122
  color: u,
123
123
  size: C,
@@ -136,40 +136,40 @@ const Q = c.div`
136
136
  }
137
137
  ),
138
138
  /* @__PURE__ */ p(
139
- Z,
139
+ ee,
140
140
  {
141
- ref: k,
141
+ ref: E,
142
142
  type: "number",
143
143
  theme: d,
144
144
  color: u,
145
145
  size: C,
146
- placeholder: B,
146
+ placeholder: D,
147
147
  prefix: m,
148
148
  suffix: f,
149
149
  disabled: x,
150
150
  readOnly: $,
151
- step: R,
152
- min: F,
153
- max: w,
154
- value: A,
155
- onFocus: (t) => {
156
- S(!0), b == null || b(t);
151
+ step: F,
152
+ min: w,
153
+ max: B,
154
+ value: P,
155
+ onFocus: (a) => {
156
+ N(!0), b == null || b(a);
157
157
  },
158
- onBlur: (t) => {
159
- S(!1), h == null || h(t);
158
+ onBlur: (a) => {
159
+ N(!1), h == null || h(a);
160
160
  },
161
- onChange: (t) => {
162
- s.current = t.target.value, N(s.current), P(t, t.target.value);
161
+ onChange: (a) => {
162
+ i.current = a.target.value, k(i.current), W(a, a.target.value);
163
163
  },
164
- onKeyDown: (t) => {
165
- var r, T;
166
- ((T = (r = t == null ? void 0 : t.target) == null ? void 0 : r.value) == null ? void 0 : T.length) > 0 && (t.key === "+" || t.key === "-") && t.preventDefault(), g == null || g(t);
164
+ onKeyDown: (a) => {
165
+ var r, S, T;
166
+ ((S = (r = a == null ? void 0 : a.target) == null ? void 0 : r.value) == null ? void 0 : S.length) > 0 && (a.key === "+" || a.key === "-") && a.preventDefault(), ((T = a == null ? void 0 : a.target) == null ? void 0 : T.value) === "" && (a.key === "+" || a.key === "-") && (a.target.value = a.key), g == null || g(a);
167
167
  },
168
- ...j
168
+ ...A
169
169
  }
170
170
  ),
171
171
  f && /* @__PURE__ */ p(
172
- Y,
172
+ v,
173
173
  {
174
174
  theme: d,
175
175
  color: u,
@@ -182,55 +182,55 @@ const Q = c.div`
182
182
  }
183
183
  );
184
184
  });
185
- ee.propTypes = {
186
- id: n.any,
187
- value: n.any,
188
- defaultValue: n.any,
189
- disabled: n.bool,
190
- readOnly: n.bool,
185
+ ae.propTypes = {
186
+ id: t.any,
187
+ value: t.any,
188
+ defaultValue: t.any,
189
+ disabled: t.bool,
190
+ readOnly: t.bool,
191
191
  /**
192
192
  * Time in miliseconds before onChange event fires after it has been triggered.
193
193
  */
194
- debounceTime: n.number,
194
+ debounceTime: t.number,
195
195
  /**
196
196
  * The amount that is added to the current value in the input if its incremented using the arrows/spinners.
197
197
  */
198
- step: n.number,
198
+ step: t.number,
199
199
  /**
200
200
  * Minimum number value user can input.
201
201
  */
202
- min: n.number,
202
+ min: t.number,
203
203
  /**
204
204
  * Maximum number value user can input.
205
205
  */
206
- max: n.number,
206
+ max: t.number,
207
207
  /**
208
208
  * Reserved space before input. Intented to be used with plain text or `Icon` component.
209
209
  */
210
- prefix: n.oneOfType([n.string, n.element]),
210
+ prefix: t.oneOfType([t.string, t.element]),
211
211
  /**
212
212
  * Reserved space after input. Intented to be used with plain text or `Icon` component.
213
213
  */
214
- suffix: n.oneOfType([n.string, n.element]),
215
- placeholder: n.string,
216
- tabIndex: n.number,
214
+ suffix: t.oneOfType([t.string, t.element]),
215
+ placeholder: t.string,
216
+ tabIndex: t.number,
217
217
  /**
218
218
  * `(event, value) => void`
219
219
  */
220
- onChange: n.func,
220
+ onChange: t.func,
221
221
  /**
222
222
  * `(event) => void`
223
223
  */
224
- onBlur: n.func,
224
+ onBlur: t.func,
225
225
  /**
226
226
  * `(event) => void`
227
227
  */
228
- onFocus: n.func,
228
+ onFocus: t.func,
229
229
  //----------------
230
- className: n.string,
231
- style: n.object,
232
- size: n.oneOf(["small", "medium", "large"]),
233
- color: n.oneOf([
230
+ className: t.string,
231
+ style: t.object,
232
+ size: t.oneOf(["small", "medium", "large"]),
233
+ color: t.oneOf([
234
234
  "primary",
235
235
  "secondary",
236
236
  "success",
@@ -242,5 +242,5 @@ ee.propTypes = {
242
242
  ])
243
243
  };
244
244
  export {
245
- ee as default
245
+ ae as default
246
246
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lanaco/lnc-react-ui",
3
- "version": "4.0.97",
3
+ "version": "4.0.98",
4
4
  "description": "React component library",
5
5
  "type": "module",
6
6
  "keywords": [