@lanaco/lnc-react-ui 4.0.100 → 4.0.101

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/dist/Button.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";const l=require("react/jsx-runtime"),w=require("react"),o=require("./index-BPVoEhTF.cjs"),C=require("./index-DAOBjHnD.cjs"),r=require("./emotion-styled.browser.esm-BtEseadx.cjs"),t=require("./utils-BWzf4vLl.cjs"),V=require("./Icon.cjs"),W=require("./emotion-element-f0de968e.browser.esm-B7k6i6lC.cjs"),B={small:{regular:"1rem",icon:"0.75rem",justIcon:"0.5rem"},medium:{regular:"1.5rem",icon:"1rem",justIcon:"0.5rem"},large:{regular:"1.5rem",icon:"1rem",justIcon:"0.5rem"}},f=e=>`
1
+ "use strict";const n=require("react/jsx-runtime"),w=require("react"),o=require("./index-BPVoEhTF.cjs"),C=require("./index-DAOBjHnD.cjs"),c=require("./emotion-styled.browser.esm-BtEseadx.cjs"),t=require("./utils-BWzf4vLl.cjs"),z=require("./Icon.cjs"),W=require("./emotion-element-f0de968e.browser.esm-B7k6i6lC.cjs"),B={small:{regular:"1rem",icon:"0.75rem",justIcon:"0.5rem"},medium:{regular:"1.5rem",icon:"1rem",justIcon:"0.5rem"},large:{regular:"1.5rem",icon:"1rem",justIcon:"0.5rem"}},f=e=>`
2
2
  outline: none;
3
3
  display: inline-flex;
4
4
  flex-direction: row;
@@ -13,11 +13,11 @@
13
13
 
14
14
  padding-left: ${e.hasLeadingIcon?B[e.size].icon:B[e.size].regular};
15
15
  padding-right: ${e.hasTrailingIcon?B[e.size].icon:B[e.size].regular};
16
- `,D=r.styled.span`
16
+ `,D=c.styled.span`
17
17
  padding-right: ${e=>e.size==="small"?"0.25rem":"0.5rem"};
18
- `,E=r.styled.span`
18
+ `,N=c.styled.span`
19
19
  padding-left: ${e=>e.size==="small"?"0.25rem":"0.5rem"};
20
- `,z=r.styled.button`
20
+ `,I=c.styled.button`
21
21
  ${e=>f(e)}
22
22
 
23
23
  ${e=>t.getComponentTypographyCss(e.theme,"ButtonFilled",e.size,"enabled")};
@@ -50,7 +50,7 @@
50
50
  background-color: ${e=>e.disabled===!1&&t.getColorRgbaValue(e.theme,"ButtonFilled",e.color,"active","background")};
51
51
  color: ${e=>e.disabled===!1&&t.getColorRgbaValue(e.theme,"ButtonFilled",e.color,"active","text")};
52
52
  }
53
- `,L=r.styled.button`
53
+ `,E=c.styled.button`
54
54
  ${e=>f(e)}
55
55
 
56
56
  min-height: ${e=>t.getSizeValueWithUnits(e.theme,e.size)};
@@ -86,7 +86,7 @@
86
86
  cursor: default;
87
87
  background-color: ${e=>t.getColorRgbaValue(e.theme,"ButtonTinted","gray","disabled","background")};
88
88
  }
89
- `,I=r.styled.button`
89
+ `,O=c.styled.button`
90
90
  ${e=>f(e)}
91
91
 
92
92
  ${e=>t.getComponentTypographyCss(e.theme,"ButtonTinted",e.size,"enabled")};
@@ -121,7 +121,7 @@
121
121
  cursor: default;
122
122
  background-color: ${e=>t.getColorRgbaValue(e.theme,"ButtonBasic","gray","disabled","background","backgroundOpacity")};
123
123
  }
124
- `,_=r.styled(I)`
124
+ `,L=c.styled(O)`
125
125
  border: 1px solid
126
126
  ${e=>t.getColorRgbaValue(e.theme,"ButtonBasic",e.color,"enabled","border","borderOpacity")};
127
- `,O=w.forwardRef((e,c)=>{const{text:k="",iconStyle:T="solid",leadingIcon:x=null,trailingIcon:R=null,borderRadius:v="regular",btnType:n="filled",disabled:P=!1,tabIndex:d=0,onFocus:u,onBlur:s,onClick:g,onKeyDown:b,onLeadingIconClick:N,onTrailingIconClick:K,size:$="small",color:j="primary",className:F="",style:S={},children:U,...m}=e,h={theme:W.useTheme(),color:j,size:$,style:S,disabled:P,borderRadius:v,btnType:n,className:"lnc-ui-button "+F},a=!C.isEmpty(x),i=!C.isEmpty(R),q=!C.isEmpty(k),y=()=>l.jsxs(l.Fragment,{children:[a&&l.jsx(D,{size:$,children:l.jsx(V,{icon:x,sizeInUnits:"1.125rem",iconStyle:T})}),k,U,i&&l.jsx(E,{size:$,children:l.jsx(V,{icon:R,sizeInUnits:"1.125rem",iconStyle:T})})]});return n==="filled"?l.jsx(z,{ref:c,"data-type":"filled",...h,hasLeadingIcon:a,hasTrailingIcon:i,onFocus:u,onBlur:s,onClick:g,onKeyDown:b,tabIndex:d,btnType:n,...m,children:y()}):n==="tinted"?l.jsx(L,{ref:c,"data-type":"tinted",...h,hasLeadingIcon:a,hasTrailingIcon:i,onFocus:u,onBlur:s,onClick:g,onKeyDown:b,tabIndex:d,btnType:n,...m,children:y()}):n==="outline"?l.jsx(_,{ref:c,"data-type":"outline",...h,hasLeadingIcon:a,hasTrailingIcon:i,onFocus:u,onBlur:s,onClick:g,onKeyDown:b,tabIndex:d,btnType:n,...m,children:y()}):n==="basic"?l.jsx(I,{ref:c,"data-type":"basic",...h,hasLeadingIcon:a,hasTrailingIcon:i,onFocus:u,onBlur:s,onClick:g,onKeyDown:b,tabIndex:d,btnType:n,...m,children:y()}):l.jsx(z,{ref:c,"data-type":"filled",size:$,...h,hasLeadingIcon:a,hasTrailingIcon:i,onFocus:u,onBlur:s,onClick:g,onKeyDown:b,hasText:q,tabIndex:d,btnType:n,...m,children:y()})});O.propTypes={text:o.PropTypes.string,iconStyle:o.PropTypes.oneOf(["regular","solid"]),leadingIcon:o.PropTypes.string,trailingIcon:o.PropTypes.string,borderRadius:o.PropTypes.oneOf(["slight","regular","edged","curved","none"]),btnType:o.PropTypes.oneOf(["filled","tinted","outline","basic"]),disabled:o.PropTypes.bool,tabIndex:o.PropTypes.number,onBlur:o.PropTypes.func,onFocus:o.PropTypes.func,onClick:o.PropTypes.func,onKeyDown:o.PropTypes.func,className:o.PropTypes.string,style:o.PropTypes.object,color:o.PropTypes.oneOf(["primary","secondary","success","warning","danger","information","neutral","gray"]),size:o.PropTypes.oneOf(["small","medium","large"])};module.exports=O;
127
+ `,v=w.forwardRef((e,d)=>{const{text:k="",iconStyle:T="solid",leadingIcon:x=null,trailingIcon:R=null,borderRadius:j="regular",btnType:l="filled",disabled:F=!1,tabIndex:u=0,onFocus:s,onBlur:g,onClick:b,onKeyDown:m,onLeadingIconClick:_,onTrailingIconClick:K,size:$="small",color:V="primary",className:P="",style:S={},children:U,...h}=e,a={theme:W.useTheme(),color:V,size:$,style:S,disabled:F,borderRadius:j,btnType:l,className:"lnc-ui-button "+P},i=!C.isEmpty(x),r=!C.isEmpty(R),q=!C.isEmpty(k),y=()=>n.jsxs(n.Fragment,{children:[i&&n.jsx(D,{size:$,children:n.jsx(z,{icon:x,sizeInUnits:"1.125rem",iconStyle:T})}),k,U,r&&n.jsx(N,{size:$,children:n.jsx(z,{icon:R,sizeInUnits:"1.125rem",iconStyle:T})})]});return l==="filled"?n.jsx(I,{ref:d,"data-type":"filled",...a,className:`${a==null?void 0:a.className} ${V}-${l}-lnc-btn`,hasLeadingIcon:i,hasTrailingIcon:r,onFocus:s,onBlur:g,onClick:b,onKeyDown:m,tabIndex:u,btnType:l,...h,children:y()}):l==="tinted"?n.jsx(E,{ref:d,"data-type":"tinted",...a,hasLeadingIcon:i,hasTrailingIcon:r,onFocus:s,onBlur:g,onClick:b,onKeyDown:m,tabIndex:u,btnType:l,...h,children:y()}):l==="outline"?n.jsx(L,{ref:d,"data-type":"outline",...a,hasLeadingIcon:i,hasTrailingIcon:r,onFocus:s,onBlur:g,onClick:b,onKeyDown:m,tabIndex:u,btnType:l,...h,children:y()}):l==="basic"?n.jsx(O,{ref:d,"data-type":"basic",...a,hasLeadingIcon:i,hasTrailingIcon:r,onFocus:s,onBlur:g,onClick:b,onKeyDown:m,tabIndex:u,btnType:l,...h,children:y()}):n.jsx(I,{ref:d,"data-type":"filled",size:$,...a,hasLeadingIcon:i,hasTrailingIcon:r,onFocus:s,onBlur:g,onClick:b,onKeyDown:m,hasText:q,tabIndex:u,btnType:l,...h,children:y()})});v.propTypes={text:o.PropTypes.string,iconStyle:o.PropTypes.oneOf(["regular","solid"]),leadingIcon:o.PropTypes.string,trailingIcon:o.PropTypes.string,borderRadius:o.PropTypes.oneOf(["slight","regular","edged","curved","none"]),btnType:o.PropTypes.oneOf(["filled","tinted","outline","basic"]),disabled:o.PropTypes.bool,tabIndex:o.PropTypes.number,onBlur:o.PropTypes.func,onFocus:o.PropTypes.func,onClick:o.PropTypes.func,onKeyDown:o.PropTypes.func,className:o.PropTypes.string,style:o.PropTypes.object,color:o.PropTypes.oneOf(["primary","secondary","success","warning","danger","information","neutral","gray"]),size:o.PropTypes.oneOf(["small","medium","large"])};module.exports=v;
package/dist/Button.js CHANGED
@@ -1,10 +1,10 @@
1
- import { jsx as i, jsxs as K, Fragment as W } from "react/jsx-runtime";
2
- import { forwardRef as E } from "react";
1
+ import { jsx as i, jsxs as W, Fragment as E } from "react/jsx-runtime";
2
+ import { forwardRef as P } from "react";
3
3
  import { P as o } from "./index-S5Cd7WrG.js";
4
4
  import { i as y } from "./index-BlxaTV-D.js";
5
- import { s as r } from "./emotion-styled.browser.esm-BNN1dTl3.js";
6
- import { c as x, b as t, d as c, h as T, e as z, a as q } from "./utils-BXCGNjIy.js";
7
- import j from "./Icon.js";
5
+ import { s as d } from "./emotion-styled.browser.esm-BNN1dTl3.js";
6
+ import { c as x, b as t, d as r, h as T, e as z, a as q } from "./utils-BXCGNjIy.js";
7
+ import w from "./Icon.js";
8
8
  import { u as A } from "./emotion-element-f0de968e.browser.esm-CkCiQliQ.js";
9
9
  const k = {
10
10
  small: {
@@ -40,11 +40,11 @@ const k = {
40
40
 
41
41
  padding-left: ${e.hasLeadingIcon ? k[e.size].icon : k[e.size].regular};
42
42
  padding-right: ${e.hasTrailingIcon ? k[e.size].icon : k[e.size].regular};
43
- `, G = r.span`
43
+ `, G = d.span`
44
44
  padding-right: ${(e) => e.size === "small" ? "0.25rem" : "0.5rem"};
45
- `, H = r.span`
45
+ `, H = d.span`
46
46
  padding-left: ${(e) => e.size === "small" ? "0.25rem" : "0.5rem"};
47
- `, w = r.button`
47
+ `, R = d.button`
48
48
  ${(e) => I(e)}
49
49
 
50
50
  ${(e) => x(
@@ -69,8 +69,8 @@ const k = {
69
69
  "text"
70
70
  )};
71
71
 
72
- min-height: ${(e) => c(e.theme, e.size)};
73
- max-height: ${(e) => c(e.theme, e.size)};
72
+ min-height: ${(e) => r(e.theme, e.size)};
73
+ max-height: ${(e) => r(e.theme, e.size)};
74
74
 
75
75
  &:disabled {
76
76
  ${(e) => e.disabled === !0 && T(e.theme)};
@@ -142,11 +142,11 @@ const k = {
142
142
  "text"
143
143
  )};
144
144
  }
145
- `, J = r.button`
145
+ `, J = d.button`
146
146
  ${(e) => I(e)}
147
147
 
148
- min-height: ${(e) => c(e.theme, e.size)};
149
- max-height: ${(e) => c(e.theme, e.size)};
148
+ min-height: ${(e) => r(e.theme, e.size)};
149
+ max-height: ${(e) => r(e.theme, e.size)};
150
150
  ${(e) => x(
151
151
  e.theme,
152
152
  "ButtonTinted",
@@ -241,7 +241,7 @@ const k = {
241
241
  "background"
242
242
  )};
243
243
  }
244
- `, R = r.button`
244
+ `, N = d.button`
245
245
  ${(e) => I(e)}
246
246
 
247
247
  ${(e) => x(
@@ -268,8 +268,8 @@ const k = {
268
268
  "backgroundOpacity"
269
269
  )};
270
270
 
271
- min-height: ${(e) => c(e.theme, e.size)};
272
- max-height: ${(e) => c(e.theme, e.size)};
271
+ min-height: ${(e) => r(e.theme, e.size)};
272
+ max-height: ${(e) => r(e.theme, e.size)};
273
273
 
274
274
  &:hover {
275
275
  background-color: ${(e) => t(
@@ -340,7 +340,7 @@ const k = {
340
340
  "backgroundOpacity"
341
341
  )};
342
342
  }
343
- `, M = r(R)`
343
+ `, M = d(N)`
344
344
  border: 1px solid
345
345
  ${(e) => t(
346
346
  e.theme,
@@ -350,7 +350,7 @@ const k = {
350
350
  "border",
351
351
  "borderOpacity"
352
352
  )};
353
- `, Q = E((e, d) => {
353
+ `, Q = P((e, u) => {
354
354
  const {
355
355
  text: v = "",
356
356
  iconStyle: O = "solid",
@@ -359,33 +359,33 @@ const k = {
359
359
  borderRadius: L = "regular",
360
360
  btnType: n = "filled",
361
361
  disabled: S = !1,
362
- tabIndex: u = 0,
362
+ tabIndex: s = 0,
363
363
  //----------------
364
- onFocus: s,
365
- onBlur: m,
366
- onClick: b,
367
- onKeyDown: g,
364
+ onFocus: m,
365
+ onBlur: b,
366
+ onClick: g,
367
+ onKeyDown: h,
368
368
  onLeadingIconClick: X,
369
369
  onTrailingIconClick: Y,
370
370
  //----------------
371
371
  size: B = "small",
372
- color: U = "primary",
373
- className: D = "",
374
- style: N = {},
375
- children: P,
376
- ...h
377
- } = e, f = {
372
+ color: j = "primary",
373
+ className: U = "",
374
+ style: D = {},
375
+ children: V,
376
+ ...$
377
+ } = e, a = {
378
378
  theme: A(),
379
- color: U,
379
+ color: j,
380
380
  size: B,
381
- style: N,
381
+ style: D,
382
382
  disabled: S,
383
383
  borderRadius: L,
384
384
  btnType: n,
385
- className: "lnc-ui-button " + D
386
- }, a = !y(F), l = !y(C), V = !y(v), $ = () => /* @__PURE__ */ K(W, { children: [
387
- a && /* @__PURE__ */ i(G, { size: B, children: /* @__PURE__ */ i(
388
- j,
385
+ className: "lnc-ui-button " + U
386
+ }, l = !y(F), c = !y(C), K = !y(v), f = () => /* @__PURE__ */ W(E, { children: [
387
+ l && /* @__PURE__ */ i(G, { size: B, children: /* @__PURE__ */ i(
388
+ w,
389
389
  {
390
390
  icon: F,
391
391
  sizeInUnits: "1.125rem",
@@ -393,9 +393,9 @@ const k = {
393
393
  }
394
394
  ) }),
395
395
  v,
396
- P,
397
- l && /* @__PURE__ */ i(H, { size: B, children: /* @__PURE__ */ i(
398
- j,
396
+ V,
397
+ c && /* @__PURE__ */ i(H, { size: B, children: /* @__PURE__ */ i(
398
+ w,
399
399
  {
400
400
  icon: C,
401
401
  sizeInUnits: "1.125rem",
@@ -404,91 +404,92 @@ const k = {
404
404
  ) })
405
405
  ] });
406
406
  return n === "filled" ? /* @__PURE__ */ i(
407
- w,
407
+ R,
408
408
  {
409
- ref: d,
409
+ ref: u,
410
410
  "data-type": "filled",
411
- ...f,
412
- hasLeadingIcon: a,
413
- hasTrailingIcon: l,
414
- onFocus: s,
415
- onBlur: m,
416
- onClick: b,
417
- onKeyDown: g,
418
- tabIndex: u,
411
+ ...a,
412
+ className: `${a == null ? void 0 : a.className} ${j}-${n}-lnc-btn`,
413
+ hasLeadingIcon: l,
414
+ hasTrailingIcon: c,
415
+ onFocus: m,
416
+ onBlur: b,
417
+ onClick: g,
418
+ onKeyDown: h,
419
+ tabIndex: s,
419
420
  btnType: n,
420
- ...h,
421
- children: $()
421
+ ...$,
422
+ children: f()
422
423
  }
423
424
  ) : n === "tinted" ? /* @__PURE__ */ i(
424
425
  J,
425
426
  {
426
- ref: d,
427
+ ref: u,
427
428
  "data-type": "tinted",
428
- ...f,
429
- hasLeadingIcon: a,
430
- hasTrailingIcon: l,
431
- onFocus: s,
432
- onBlur: m,
433
- onClick: b,
434
- onKeyDown: g,
435
- tabIndex: u,
429
+ ...a,
430
+ hasLeadingIcon: l,
431
+ hasTrailingIcon: c,
432
+ onFocus: m,
433
+ onBlur: b,
434
+ onClick: g,
435
+ onKeyDown: h,
436
+ tabIndex: s,
436
437
  btnType: n,
437
- ...h,
438
- children: $()
438
+ ...$,
439
+ children: f()
439
440
  }
440
441
  ) : n === "outline" ? /* @__PURE__ */ i(
441
442
  M,
442
443
  {
443
- ref: d,
444
+ ref: u,
444
445
  "data-type": "outline",
445
- ...f,
446
- hasLeadingIcon: a,
447
- hasTrailingIcon: l,
448
- onFocus: s,
449
- onBlur: m,
450
- onClick: b,
451
- onKeyDown: g,
452
- tabIndex: u,
446
+ ...a,
447
+ hasLeadingIcon: l,
448
+ hasTrailingIcon: c,
449
+ onFocus: m,
450
+ onBlur: b,
451
+ onClick: g,
452
+ onKeyDown: h,
453
+ tabIndex: s,
453
454
  btnType: n,
454
- ...h,
455
- children: $()
455
+ ...$,
456
+ children: f()
456
457
  }
457
458
  ) : n === "basic" ? /* @__PURE__ */ i(
458
- R,
459
+ N,
459
460
  {
460
- ref: d,
461
+ ref: u,
461
462
  "data-type": "basic",
462
- ...f,
463
- hasLeadingIcon: a,
464
- hasTrailingIcon: l,
465
- onFocus: s,
466
- onBlur: m,
467
- onClick: b,
468
- onKeyDown: g,
469
- tabIndex: u,
463
+ ...a,
464
+ hasLeadingIcon: l,
465
+ hasTrailingIcon: c,
466
+ onFocus: m,
467
+ onBlur: b,
468
+ onClick: g,
469
+ onKeyDown: h,
470
+ tabIndex: s,
470
471
  btnType: n,
471
- ...h,
472
- children: $()
472
+ ...$,
473
+ children: f()
473
474
  }
474
475
  ) : /* @__PURE__ */ i(
475
- w,
476
+ R,
476
477
  {
477
- ref: d,
478
+ ref: u,
478
479
  "data-type": "filled",
479
480
  size: B,
480
- ...f,
481
- hasLeadingIcon: a,
482
- hasTrailingIcon: l,
483
- onFocus: s,
484
- onBlur: m,
485
- onClick: b,
486
- onKeyDown: g,
487
- hasText: V,
488
- tabIndex: u,
481
+ ...a,
482
+ hasLeadingIcon: l,
483
+ hasTrailingIcon: c,
484
+ onFocus: m,
485
+ onBlur: b,
486
+ onClick: g,
487
+ onKeyDown: h,
488
+ hasText: K,
489
+ tabIndex: s,
489
490
  btnType: n,
490
- ...h,
491
- children: $()
491
+ ...$,
492
+ children: f()
492
493
  }
493
494
  );
494
495
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lanaco/lnc-react-ui",
3
- "version": "4.0.100",
3
+ "version": "4.0.101",
4
4
  "description": "React component library",
5
5
  "type": "module",
6
6
  "keywords": [