@lanaco/lnc-react-ui 4.0.144 → 4.0.145
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 +9 -9
- package/dist/Button.js +49 -45
- package/dist/IconButton.cjs +5 -5
- package/dist/IconButton.js +8 -7
- package/package.json +1 -1
package/dist/Button.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),w=require("react"),l=require("./index-BpbMKBf_.cjs"),f=require("./index-DA7SIHV1.cjs"),d=require("./emotion-styled.browser.esm-BtEseadx.cjs"),t=require("./utils-Dl9xPH4c.cjs"),O=require("./Icon.cjs"),P=require("./emotion-element-f0de968e.browser.esm-B7k6i6lC.cjs"),k={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"}},T=e=>`
|
|
2
2
|
outline: none;
|
|
3
3
|
display: inline-flex;
|
|
4
4
|
flex-direction: row;
|
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
|
|
12
12
|
border-radius: ${t.getBorderRadiusValueWithUnits(e.theme,e.borderRadius)};
|
|
13
13
|
|
|
14
|
-
padding-left: ${e.hasLeadingIcon?
|
|
15
|
-
padding-right: ${e.hasTrailingIcon?
|
|
14
|
+
padding-left: ${e.hasLeadingIcon?k[e.size].icon:k[e.size].regular};
|
|
15
|
+
padding-right: ${e.hasTrailingIcon?k[e.size].icon:k[e.size].regular};
|
|
16
16
|
`,W=d.styled.span`
|
|
17
17
|
padding-right: ${e=>e.size==="small"?"0.25rem":"0.5rem"};
|
|
18
18
|
`,D=d.styled.span`
|
|
19
19
|
padding-left: ${e=>e.size==="small"?"0.25rem":"0.5rem"};
|
|
20
|
-
`,
|
|
20
|
+
`,I=d.styled.button`
|
|
21
21
|
${e=>T(e)}
|
|
22
22
|
|
|
23
23
|
${e=>t.getComponentTypographyCss(e.theme,"ButtonFilled",e.size,"enabled")};
|
|
@@ -31,23 +31,23 @@
|
|
|
31
31
|
&:disabled {
|
|
32
32
|
${e=>e.disabled===!0&&t.getDisabledStateCss(e.theme)};
|
|
33
33
|
cursor: default;
|
|
34
|
-
background-color: ${e=>t.getColorRgbaValue(e.theme,"ButtonFilled",e.color,"disabled","background")};
|
|
34
|
+
background-color: ${e=>t.getColorRgbaValue(e.theme,"ButtonFilled",e.color,"disabled","background","backgroundOpacity")};
|
|
35
35
|
color: ${e=>t.getColorRgbaValue(e.theme,"ButtonFilled",e.color,"disabled","text")};
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
&:hover {
|
|
39
|
-
background-color: ${e=>e.disabled===!1&&t.getColorRgbaValue(e.theme,"ButtonFilled",e.color,"hover","background")};
|
|
39
|
+
background-color: ${e=>e.disabled===!1&&t.getColorRgbaValue(e.theme,"ButtonFilled",e.color,"hover","background","backgroundOpacity")};
|
|
40
40
|
color: ${e=>e.disabled===!1&&t.getColorRgbaValue(e.theme,"ButtonFilled",e.color,"hover","text")};
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
&:focus {
|
|
44
|
-
background-color: ${e=>!e.disabled&&t.getColorRgbaValue(e.theme,"ButtonFilled",e.color,"focus","background")};
|
|
44
|
+
background-color: ${e=>!e.disabled&&t.getColorRgbaValue(e.theme,"ButtonFilled",e.color,"focus","background","backgroundOpacity")};
|
|
45
45
|
color: ${e=>e.disabled===!1&&t.getColorRgbaValue(e.theme,"ButtonFilled",e.color,"focus","text")};
|
|
46
46
|
${e=>!e.disabled&&t.getOutlineCss(e.theme)};
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
&:active {
|
|
50
|
-
background-color: ${e=>e.disabled===!1&&t.getColorRgbaValue(e.theme,"ButtonFilled",e.color,"active","background")};
|
|
50
|
+
background-color: ${e=>e.disabled===!1&&t.getColorRgbaValue(e.theme,"ButtonFilled",e.color,"active","background","backgroundOpacity")};
|
|
51
51
|
color: ${e=>e.disabled===!1&&t.getColorRgbaValue(e.theme,"ButtonFilled",e.color,"active","text")};
|
|
52
52
|
}
|
|
53
53
|
`,E=d.styled.button`
|
|
@@ -126,4 +126,4 @@
|
|
|
126
126
|
`,L=d.styled(v)`
|
|
127
127
|
border: 1px solid
|
|
128
128
|
${e=>t.getColorRgbaValue(e.theme,"ButtonBasic",e.color,"enabled","border","borderOpacity")};
|
|
129
|
-
`,j=w.forwardRef((e,u)=>{const{text:x="",iconStyle:R="solid",leadingIcon:V=null,trailingIcon:z=null,borderRadius:F="regular",btnType:
|
|
129
|
+
`,j=w.forwardRef((e,u)=>{const{text:x="",iconStyle:R="solid",leadingIcon:V=null,trailingIcon:z=null,borderRadius:F="regular",btnType:a="filled",disabled:N=!1,tabIndex:s=0,onFocus:g,onBlur:b,onClick:m,onKeyDown:h,onLeadingIconClick:_,onTrailingIconClick:K,size:C="small",color:i="primary",className:$="",style:S={},children:U,...y}=e,o={theme:P.useTheme(),color:i,size:C,style:S,disabled:N,borderRadius:F,btnType:a,className:"lnc-ui-button "},c=!f.isEmpty(V),r=!f.isEmpty(z),q=!f.isEmpty(x),B=()=>n.jsxs(n.Fragment,{children:[c&&n.jsx(W,{size:C,children:n.jsx(O,{icon:V,sizeInUnits:"1.125rem",iconStyle:R})}),x,U,r&&n.jsx(D,{size:C,children:n.jsx(O,{icon:z,sizeInUnits:"1.125rem",iconStyle:R})})]});return a==="filled"?n.jsx(I,{ref:u,"data-type":"filled",...o,className:`${o==null?void 0:o.className} ${i}-${a}-lnc-btn ${$}`,hasLeadingIcon:c,hasTrailingIcon:r,onFocus:g,onBlur:b,onClick:m,onKeyDown:h,tabIndex:s,btnType:a,...y,children:B()}):a==="tinted"?n.jsx(E,{ref:u,"data-type":"tinted",...o,className:`${o==null?void 0:o.className} ${i}-${a}-lnc-btn ${$}`,hasLeadingIcon:c,hasTrailingIcon:r,onFocus:g,onBlur:b,onClick:m,onKeyDown:h,tabIndex:s,btnType:a,...y,children:B()}):a==="outline"?n.jsx(L,{ref:u,"data-type":"outline",...o,className:`${o==null?void 0:o.className} ${i}-${a}-lnc-btn ${$}`,hasLeadingIcon:c,hasTrailingIcon:r,onFocus:g,onBlur:b,onClick:m,onKeyDown:h,tabIndex:s,btnType:a,...y,children:B()}):a==="basic"?n.jsx(v,{ref:u,"data-type":"basic",...o,className:`${o==null?void 0:o.className} ${i}-${a}-lnc-btn ${$}`,hasLeadingIcon:c,hasTrailingIcon:r,onFocus:g,onBlur:b,onClick:m,onKeyDown:h,tabIndex:s,btnType:a,...y,children:B()}):n.jsx(I,{ref:u,"data-type":"filled",size:C,...o,className:`${o==null?void 0:o.className} ${i}-${a}-lnc-btn ${$}`,hasLeadingIcon:c,hasTrailingIcon:r,onFocus:g,onBlur:b,onClick:m,onKeyDown:h,hasText:q,tabIndex:s,btnType:a,...y,children:B()})});j.propTypes={text:l.PropTypes.string,iconStyle:l.PropTypes.oneOf(["regular","solid"]),leadingIcon:l.PropTypes.string,trailingIcon:l.PropTypes.string,borderRadius:l.PropTypes.oneOf(["slight","regular","edged","curved","none"]),btnType:l.PropTypes.oneOf(["filled","tinted","outline","basic"]),disabled:l.PropTypes.bool,tabIndex:l.PropTypes.number,onBlur:l.PropTypes.func,onFocus:l.PropTypes.func,onClick:l.PropTypes.func,onKeyDown:l.PropTypes.func,className:l.PropTypes.string,style:l.PropTypes.object,color:l.PropTypes.oneOf(["primary","secondary","success","warning","danger","information","neutral","gray"]),size:l.PropTypes.oneOf(["small","medium","large"])};module.exports=j;
|
package/dist/Button.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as c, jsxs as W, Fragment as E } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as q } from "react";
|
|
3
3
|
import { P as n } from "./index-CblbdqjE.js";
|
|
4
4
|
import { i as T } from "./index-6RFrSPs_.js";
|
|
5
5
|
import { s as u } from "./emotion-styled.browser.esm-BNN1dTl3.js";
|
|
6
|
-
import { c as
|
|
6
|
+
import { c as O, b as t, d as r, h as z, e as I, a as A } from "./utils-BdsZgOUE.js";
|
|
7
7
|
import w from "./Icon.js";
|
|
8
8
|
import { u as G } from "./emotion-element-f0de968e.browser.esm-CkCiQliQ.js";
|
|
9
9
|
const x = {
|
|
@@ -22,7 +22,7 @@ const x = {
|
|
|
22
22
|
icon: "1rem",
|
|
23
23
|
justIcon: "0.5rem"
|
|
24
24
|
}
|
|
25
|
-
},
|
|
25
|
+
}, v = (e) => `
|
|
26
26
|
outline: none;
|
|
27
27
|
display: inline-flex;
|
|
28
28
|
flex-direction: row;
|
|
@@ -45,9 +45,9 @@ const x = {
|
|
|
45
45
|
`, J = u.span`
|
|
46
46
|
padding-left: ${(e) => e.size === "small" ? "0.25rem" : "0.5rem"};
|
|
47
47
|
`, R = u.button`
|
|
48
|
-
${(e) =>
|
|
48
|
+
${(e) => v(e)}
|
|
49
49
|
|
|
50
|
-
${(e) =>
|
|
50
|
+
${(e) => O(
|
|
51
51
|
e.theme,
|
|
52
52
|
"ButtonFilled",
|
|
53
53
|
e.size,
|
|
@@ -73,14 +73,15 @@ const x = {
|
|
|
73
73
|
max-height: ${(e) => r(e.theme, e.size)};
|
|
74
74
|
|
|
75
75
|
&:disabled {
|
|
76
|
-
${(e) => e.disabled === !0 &&
|
|
76
|
+
${(e) => e.disabled === !0 && z(e.theme)};
|
|
77
77
|
cursor: default;
|
|
78
78
|
background-color: ${(e) => t(
|
|
79
79
|
e.theme,
|
|
80
80
|
"ButtonFilled",
|
|
81
81
|
e.color,
|
|
82
82
|
"disabled",
|
|
83
|
-
"background"
|
|
83
|
+
"background",
|
|
84
|
+
"backgroundOpacity"
|
|
84
85
|
)};
|
|
85
86
|
color: ${(e) => t(
|
|
86
87
|
e.theme,
|
|
@@ -97,7 +98,8 @@ const x = {
|
|
|
97
98
|
"ButtonFilled",
|
|
98
99
|
e.color,
|
|
99
100
|
"hover",
|
|
100
|
-
"background"
|
|
101
|
+
"background",
|
|
102
|
+
"backgroundOpacity"
|
|
101
103
|
)};
|
|
102
104
|
color: ${(e) => e.disabled === !1 && t(
|
|
103
105
|
e.theme,
|
|
@@ -114,7 +116,8 @@ const x = {
|
|
|
114
116
|
"ButtonFilled",
|
|
115
117
|
e.color,
|
|
116
118
|
"focus",
|
|
117
|
-
"background"
|
|
119
|
+
"background",
|
|
120
|
+
"backgroundOpacity"
|
|
118
121
|
)};
|
|
119
122
|
color: ${(e) => e.disabled === !1 && t(
|
|
120
123
|
e.theme,
|
|
@@ -123,7 +126,7 @@ const x = {
|
|
|
123
126
|
"focus",
|
|
124
127
|
"text"
|
|
125
128
|
)};
|
|
126
|
-
${(e) => !e.disabled &&
|
|
129
|
+
${(e) => !e.disabled && I(e.theme)};
|
|
127
130
|
}
|
|
128
131
|
|
|
129
132
|
&:active {
|
|
@@ -132,7 +135,8 @@ const x = {
|
|
|
132
135
|
"ButtonFilled",
|
|
133
136
|
e.color,
|
|
134
137
|
"active",
|
|
135
|
-
"background"
|
|
138
|
+
"background",
|
|
139
|
+
"backgroundOpacity"
|
|
136
140
|
)};
|
|
137
141
|
color: ${(e) => e.disabled === !1 && t(
|
|
138
142
|
e.theme,
|
|
@@ -143,11 +147,11 @@ const x = {
|
|
|
143
147
|
)};
|
|
144
148
|
}
|
|
145
149
|
`, M = u.button`
|
|
146
|
-
${(e) =>
|
|
150
|
+
${(e) => v(e)}
|
|
147
151
|
|
|
148
152
|
min-height: ${(e) => r(e.theme, e.size)};
|
|
149
153
|
max-height: ${(e) => r(e.theme, e.size)};
|
|
150
|
-
${(e) =>
|
|
154
|
+
${(e) => O(
|
|
151
155
|
e.theme,
|
|
152
156
|
"ButtonTinted",
|
|
153
157
|
e.size,
|
|
@@ -208,7 +212,7 @@ const x = {
|
|
|
208
212
|
"focus",
|
|
209
213
|
"text"
|
|
210
214
|
)};
|
|
211
|
-
${(e) => e.disabled === !1 &&
|
|
215
|
+
${(e) => e.disabled === !1 && I(e.theme)};
|
|
212
216
|
}
|
|
213
217
|
|
|
214
218
|
&:active {
|
|
@@ -231,7 +235,7 @@ const x = {
|
|
|
231
235
|
}
|
|
232
236
|
|
|
233
237
|
&:disabled {
|
|
234
|
-
/* ${(e) => e.disabled === !0 &&
|
|
238
|
+
/* ${(e) => e.disabled === !0 && z(e.theme)};
|
|
235
239
|
*/
|
|
236
240
|
color: ${(e) => t(
|
|
237
241
|
e.theme,
|
|
@@ -251,9 +255,9 @@ const x = {
|
|
|
251
255
|
)};
|
|
252
256
|
}
|
|
253
257
|
`, L = u.button`
|
|
254
|
-
${(e) =>
|
|
258
|
+
${(e) => v(e)}
|
|
255
259
|
|
|
256
|
-
${(e) =>
|
|
260
|
+
${(e) => O(
|
|
257
261
|
e.theme,
|
|
258
262
|
"ButtonTinted",
|
|
259
263
|
e.size,
|
|
@@ -316,7 +320,7 @@ const x = {
|
|
|
316
320
|
"text"
|
|
317
321
|
)};
|
|
318
322
|
|
|
319
|
-
${(e) => !e.disabled &&
|
|
323
|
+
${(e) => !e.disabled && I(e.theme)};
|
|
320
324
|
}
|
|
321
325
|
|
|
322
326
|
&:active {
|
|
@@ -338,7 +342,7 @@ const x = {
|
|
|
338
342
|
}
|
|
339
343
|
|
|
340
344
|
&:disabled {
|
|
341
|
-
${(e) => e.disabled === !0 &&
|
|
345
|
+
${(e) => e.disabled === !0 && z(e.theme)};
|
|
342
346
|
cursor: default;
|
|
343
347
|
background-color: ${(e) => t(
|
|
344
348
|
e.theme,
|
|
@@ -368,9 +372,9 @@ const x = {
|
|
|
368
372
|
borderRadius: S = "regular",
|
|
369
373
|
btnType: a = "filled",
|
|
370
374
|
disabled: U = !1,
|
|
371
|
-
tabIndex:
|
|
375
|
+
tabIndex: b = 0,
|
|
372
376
|
//----------------
|
|
373
|
-
onFocus:
|
|
377
|
+
onFocus: m,
|
|
374
378
|
onBlur: g,
|
|
375
379
|
onClick: h,
|
|
376
380
|
onKeyDown: $,
|
|
@@ -378,14 +382,14 @@ const x = {
|
|
|
378
382
|
onTrailingIconClick: Z,
|
|
379
383
|
//----------------
|
|
380
384
|
size: y = "small",
|
|
381
|
-
color:
|
|
385
|
+
color: l = "primary",
|
|
382
386
|
className: f = "",
|
|
383
387
|
style: D = {},
|
|
384
388
|
children: V,
|
|
385
389
|
...B
|
|
386
390
|
} = e, o = {
|
|
387
391
|
theme: G(),
|
|
388
|
-
color:
|
|
392
|
+
color: l,
|
|
389
393
|
size: y,
|
|
390
394
|
style: D,
|
|
391
395
|
disabled: U,
|
|
@@ -393,7 +397,7 @@ const x = {
|
|
|
393
397
|
btnType: a,
|
|
394
398
|
className: "lnc-ui-button "
|
|
395
399
|
}, i = !T(N), d = !T(j), K = !T(F), k = () => /* @__PURE__ */ W(E, { children: [
|
|
396
|
-
i && /* @__PURE__ */
|
|
400
|
+
i && /* @__PURE__ */ c(H, { size: y, children: /* @__PURE__ */ c(
|
|
397
401
|
w,
|
|
398
402
|
{
|
|
399
403
|
icon: N,
|
|
@@ -403,7 +407,7 @@ const x = {
|
|
|
403
407
|
) }),
|
|
404
408
|
F,
|
|
405
409
|
V,
|
|
406
|
-
d && /* @__PURE__ */
|
|
410
|
+
d && /* @__PURE__ */ c(J, { size: y, children: /* @__PURE__ */ c(
|
|
407
411
|
w,
|
|
408
412
|
{
|
|
409
413
|
icon: j,
|
|
@@ -412,94 +416,94 @@ const x = {
|
|
|
412
416
|
}
|
|
413
417
|
) })
|
|
414
418
|
] });
|
|
415
|
-
return a === "filled" ? /* @__PURE__ */
|
|
419
|
+
return a === "filled" ? /* @__PURE__ */ c(
|
|
416
420
|
R,
|
|
417
421
|
{
|
|
418
422
|
ref: s,
|
|
419
423
|
"data-type": "filled",
|
|
420
424
|
...o,
|
|
421
|
-
className: `${o == null ? void 0 : o.className} ${
|
|
425
|
+
className: `${o == null ? void 0 : o.className} ${l}-${a}-lnc-btn ${f}`,
|
|
422
426
|
hasLeadingIcon: i,
|
|
423
427
|
hasTrailingIcon: d,
|
|
424
|
-
onFocus:
|
|
428
|
+
onFocus: m,
|
|
425
429
|
onBlur: g,
|
|
426
430
|
onClick: h,
|
|
427
431
|
onKeyDown: $,
|
|
428
|
-
tabIndex:
|
|
432
|
+
tabIndex: b,
|
|
429
433
|
btnType: a,
|
|
430
434
|
...B,
|
|
431
435
|
children: k()
|
|
432
436
|
}
|
|
433
|
-
) : a === "tinted" ? /* @__PURE__ */
|
|
437
|
+
) : a === "tinted" ? /* @__PURE__ */ c(
|
|
434
438
|
M,
|
|
435
439
|
{
|
|
436
440
|
ref: s,
|
|
437
441
|
"data-type": "tinted",
|
|
438
442
|
...o,
|
|
439
|
-
className: `${o == null ? void 0 : o.className} ${
|
|
443
|
+
className: `${o == null ? void 0 : o.className} ${l}-${a}-lnc-btn ${f}`,
|
|
440
444
|
hasLeadingIcon: i,
|
|
441
445
|
hasTrailingIcon: d,
|
|
442
|
-
onFocus:
|
|
446
|
+
onFocus: m,
|
|
443
447
|
onBlur: g,
|
|
444
448
|
onClick: h,
|
|
445
449
|
onKeyDown: $,
|
|
446
|
-
tabIndex:
|
|
450
|
+
tabIndex: b,
|
|
447
451
|
btnType: a,
|
|
448
452
|
...B,
|
|
449
453
|
children: k()
|
|
450
454
|
}
|
|
451
|
-
) : a === "outline" ? /* @__PURE__ */
|
|
455
|
+
) : a === "outline" ? /* @__PURE__ */ c(
|
|
452
456
|
Q,
|
|
453
457
|
{
|
|
454
458
|
ref: s,
|
|
455
459
|
"data-type": "outline",
|
|
456
460
|
...o,
|
|
457
|
-
className: `${o == null ? void 0 : o.className} ${
|
|
461
|
+
className: `${o == null ? void 0 : o.className} ${l}-${a}-lnc-btn ${f}`,
|
|
458
462
|
hasLeadingIcon: i,
|
|
459
463
|
hasTrailingIcon: d,
|
|
460
|
-
onFocus:
|
|
464
|
+
onFocus: m,
|
|
461
465
|
onBlur: g,
|
|
462
466
|
onClick: h,
|
|
463
467
|
onKeyDown: $,
|
|
464
|
-
tabIndex:
|
|
468
|
+
tabIndex: b,
|
|
465
469
|
btnType: a,
|
|
466
470
|
...B,
|
|
467
471
|
children: k()
|
|
468
472
|
}
|
|
469
|
-
) : a === "basic" ? /* @__PURE__ */
|
|
473
|
+
) : a === "basic" ? /* @__PURE__ */ c(
|
|
470
474
|
L,
|
|
471
475
|
{
|
|
472
476
|
ref: s,
|
|
473
477
|
"data-type": "basic",
|
|
474
478
|
...o,
|
|
475
|
-
className: `${o == null ? void 0 : o.className} ${
|
|
479
|
+
className: `${o == null ? void 0 : o.className} ${l}-${a}-lnc-btn ${f}`,
|
|
476
480
|
hasLeadingIcon: i,
|
|
477
481
|
hasTrailingIcon: d,
|
|
478
|
-
onFocus:
|
|
482
|
+
onFocus: m,
|
|
479
483
|
onBlur: g,
|
|
480
484
|
onClick: h,
|
|
481
485
|
onKeyDown: $,
|
|
482
|
-
tabIndex:
|
|
486
|
+
tabIndex: b,
|
|
483
487
|
btnType: a,
|
|
484
488
|
...B,
|
|
485
489
|
children: k()
|
|
486
490
|
}
|
|
487
|
-
) : /* @__PURE__ */
|
|
491
|
+
) : /* @__PURE__ */ c(
|
|
488
492
|
R,
|
|
489
493
|
{
|
|
490
494
|
ref: s,
|
|
491
495
|
"data-type": "filled",
|
|
492
496
|
size: y,
|
|
493
497
|
...o,
|
|
494
|
-
className: `${o == null ? void 0 : o.className} ${
|
|
498
|
+
className: `${o == null ? void 0 : o.className} ${l}-${a}-lnc-btn ${f}`,
|
|
495
499
|
hasLeadingIcon: i,
|
|
496
500
|
hasTrailingIcon: d,
|
|
497
|
-
onFocus:
|
|
501
|
+
onFocus: m,
|
|
498
502
|
onBlur: g,
|
|
499
503
|
onClick: h,
|
|
500
504
|
onKeyDown: $,
|
|
501
505
|
hasText: K,
|
|
502
|
-
tabIndex:
|
|
506
|
+
tabIndex: b,
|
|
503
507
|
btnType: a,
|
|
504
508
|
...B,
|
|
505
509
|
children: k()
|
package/dist/IconButton.cjs
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
max-width: ${t.getSizeValueWithUnits(e.theme,e.size)};
|
|
16
16
|
`,S=h.styled.i`
|
|
17
17
|
font-size: 1.125rem;
|
|
18
|
-
`,
|
|
18
|
+
`,k=h.styled.button`
|
|
19
19
|
${e=>y(e)}
|
|
20
20
|
|
|
21
21
|
${e=>t.getComponentTypographyCss(e.theme,"ButtonFilled",e.size,"enabled")};
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
&:disabled {
|
|
47
47
|
${e=>e.disabled===!0&&t.getDisabledStateCss(e.theme)};
|
|
48
48
|
cursor: default;
|
|
49
|
-
background-color: ${e=>t.getColorRgbaValue(e.theme,"ButtonFilled",e.color,"disabled","background")};
|
|
49
|
+
background-color: ${e=>t.getColorRgbaValue(e.theme,"ButtonFilled",e.color,"disabled","background","backgroundOpacity")};
|
|
50
50
|
color: ${e=>t.getColorRgbaValue(e.theme,"ButtonFilled",e.color,"disabled","text")};
|
|
51
51
|
}
|
|
52
52
|
`,N=h.styled.button`
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
background-color: ${e=>t.getColorRgbaValue(e.theme,"ButtonTinted",e.color,"disabled","background","backgroundOpacity")};
|
|
84
84
|
color: ${e=>t.getColorRgbaValue(e.theme,"ButtonTinted",e.color,"disabled","text")};
|
|
85
85
|
}
|
|
86
|
-
`,
|
|
86
|
+
`,f=h.styled.button`
|
|
87
87
|
${e=>y(e)}
|
|
88
88
|
|
|
89
89
|
${e=>t.getComponentTypographyCss(e.theme,"ButtonTinted",e.size,"enabled")};
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
cursor: default;
|
|
117
117
|
background-color: ${e=>t.getColorRgbaValue(e.theme,"ButtonBasic",e.color,"disabled","background","backgroundOpacity")};
|
|
118
118
|
}
|
|
119
|
-
`,w=h.styled(
|
|
119
|
+
`,w=h.styled(f)`
|
|
120
120
|
border: 1px solid
|
|
121
121
|
${e=>t.getColorRgbaValue(e.theme,"ButtonBasic",e.color,"enabled","border","borderOpacity")};
|
|
122
|
-
`,V=C.forwardRef((e,i)=>{const{icon:$=null,iconStyle:R="solid",borderRadius:T="regular",btnType:a="filled",disabled:x=!1,tabIndex:j=0,onFocus:r=()=>{},onBlur:u=()=>{},onClick:d=()=>{},onKeyDown:s=()=>{},size:B="small",color:n="primary",className:g="",style:z={},...b}=e,o={theme:F.useTheme(),color:n,size:B,style:z,className:"lnc-ui-icon-button",disabled:x,borderRadius:T,btnType:a},
|
|
122
|
+
`,V=C.forwardRef((e,i)=>{const{icon:$=null,iconStyle:R="solid",borderRadius:T="regular",btnType:a="filled",disabled:x=!1,tabIndex:j=0,onFocus:r=()=>{},onBlur:u=()=>{},onClick:d=()=>{},onKeyDown:s=()=>{},size:B="small",color:n="primary",className:g="",style:z={},...b}=e,o={theme:F.useTheme(),color:n,size:B,style:z,className:"lnc-ui-icon-button",disabled:x,borderRadius:T,btnType:a},O=()=>{var v=R==="solid"?"fas":"far";return`${v} fa-${$} fa-fw`},m=()=>C.isValidElement($)?$:c.jsx(S,{className:O()});return a==="filled"?c.jsx(k,{ref:i,"data-type":"filled",...o,className:`${o==null?void 0:o.className} ${n}-${a}-lnc-btn ${g}`,onFocus:r,onBlur:u,onClick:d,onKeyDown:s,type:a,...b,children:m()}):a==="tinted"?c.jsx(N,{ref:i,"data-type":"tinted",...o,className:`${o==null?void 0:o.className} ${n}-${a}-lnc-btn ${g}`,onFocus:r,onBlur:u,onClick:d,onKeyDown:s,...b,children:m()}):a==="outline"?c.jsx(w,{ref:i,"data-type":"outline",...o,className:`${o==null?void 0:o.className} ${n}-${a}-lnc-btn ${g}`,onFocus:r,onBlur:u,onClick:d,onKeyDown:s,...b,children:m()}):a==="basic"?c.jsx(f,{ref:i,"data-type":"basic",...o,className:`${o==null?void 0:o.className} ${n}-${a}-lnc-btn ${g}`,onFocus:r,onBlur:u,onClick:d,onKeyDown:s,...b,children:m()}):c.jsx(k,{ref:i,"data-type":"filled",size:B,...o,className:`${o==null?void 0:o.className} ${n}-${a}-lnc-btn ${g}`,onFocus:r,onBlur:u,onClick:d,onKeyDown:s,...b,children:m()})});V.propTypes={icon:l.PropTypes.oneOfType([l.PropTypes.string,l.PropTypes.element]),iconStyle:l.PropTypes.oneOf(["regular","solid"]),borderRadius:l.PropTypes.oneOf(["slight","regular","edged","curved","none"]),btnType:l.PropTypes.oneOf(["filled","tinted","outline","basic"]),disabled:l.PropTypes.bool,tabIndex:l.PropTypes.number,onBlur:l.PropTypes.func,onFocus:l.PropTypes.func,onClick:l.PropTypes.func,onKeyDown:l.PropTypes.func,className:l.PropTypes.string,style:l.PropTypes.object,color:l.PropTypes.oneOf(["primary","secondary","success","warning","danger","information","neutral","gray"]),size:l.PropTypes.oneOf(["small","medium","large"])};module.exports=V;
|
package/dist/IconButton.js
CHANGED
|
@@ -24,7 +24,7 @@ const x = (e) => `
|
|
|
24
24
|
max-width: ${c(e.theme, e.size)};
|
|
25
25
|
`, D = g.i`
|
|
26
26
|
font-size: 1.125rem;
|
|
27
|
-
`,
|
|
27
|
+
`, O = g.button`
|
|
28
28
|
${(e) => x(e)}
|
|
29
29
|
|
|
30
30
|
${(e) => f(
|
|
@@ -113,7 +113,8 @@ const x = (e) => `
|
|
|
113
113
|
"ButtonFilled",
|
|
114
114
|
e.color,
|
|
115
115
|
"disabled",
|
|
116
|
-
"background"
|
|
116
|
+
"background",
|
|
117
|
+
"backgroundOpacity"
|
|
117
118
|
)};
|
|
118
119
|
color: ${(e) => t(
|
|
119
120
|
e.theme,
|
|
@@ -227,7 +228,7 @@ const x = (e) => `
|
|
|
227
228
|
"text"
|
|
228
229
|
)};
|
|
229
230
|
}
|
|
230
|
-
`,
|
|
231
|
+
`, T = g.button`
|
|
231
232
|
${(e) => x(e)}
|
|
232
233
|
|
|
233
234
|
${(e) => f(
|
|
@@ -324,7 +325,7 @@ const x = (e) => `
|
|
|
324
325
|
"backgroundOpacity"
|
|
325
326
|
)};
|
|
326
327
|
}
|
|
327
|
-
`, U = g(
|
|
328
|
+
`, U = g(T)`
|
|
328
329
|
border: 1px solid
|
|
329
330
|
${(e) => t(
|
|
330
331
|
e.theme,
|
|
@@ -371,7 +372,7 @@ const x = (e) => `
|
|
|
371
372
|
return `${R} fa-${B} fa-fw`;
|
|
372
373
|
}, $ = () => S(B) ? B : /* @__PURE__ */ i(D, { className: C() });
|
|
373
374
|
return l === "filled" ? /* @__PURE__ */ i(
|
|
374
|
-
|
|
375
|
+
O,
|
|
375
376
|
{
|
|
376
377
|
ref: d,
|
|
377
378
|
"data-type": "filled",
|
|
@@ -414,7 +415,7 @@ const x = (e) => `
|
|
|
414
415
|
children: $()
|
|
415
416
|
}
|
|
416
417
|
) : l === "basic" ? /* @__PURE__ */ i(
|
|
417
|
-
|
|
418
|
+
T,
|
|
418
419
|
{
|
|
419
420
|
ref: d,
|
|
420
421
|
"data-type": "basic",
|
|
@@ -428,7 +429,7 @@ const x = (e) => `
|
|
|
428
429
|
children: $()
|
|
429
430
|
}
|
|
430
431
|
) : /* @__PURE__ */ i(
|
|
431
|
-
|
|
432
|
+
O,
|
|
432
433
|
{
|
|
433
434
|
ref: d,
|
|
434
435
|
"data-type": "filled",
|