@lanaco/lnc-react-ui 4.0.143 → 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 +11 -11
- package/dist/Button.js +75 -71
- package/dist/IconButton.cjs +9 -9
- package/dist/IconButton.js +35 -34
- package/package.json +1 -1
package/dist/Button.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const n=require("react/jsx-runtime"),w=require("react"),l=require("./index-BpbMKBf_.cjs"),
|
|
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",
|
|
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`
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
*/
|
|
87
87
|
color: ${e=>t.getColorRgbaValue(e.theme,"ButtonTinted",e.color,"disabled","text")};
|
|
88
88
|
cursor: default;
|
|
89
|
-
background-color: ${e=>t.getColorRgbaValue(e.theme,"ButtonTinted",
|
|
89
|
+
background-color: ${e=>t.getColorRgbaValue(e.theme,"ButtonTinted",e.color,"disabled","background","backgroundOpacity")};
|
|
90
90
|
}
|
|
91
91
|
`,v=d.styled.button`
|
|
92
92
|
${e=>T(e)}
|
|
@@ -121,9 +121,9 @@
|
|
|
121
121
|
&:disabled {
|
|
122
122
|
${e=>e.disabled===!0&&t.getDisabledStateCss(e.theme)};
|
|
123
123
|
cursor: default;
|
|
124
|
-
background-color: ${e=>t.getColorRgbaValue(e.theme,"ButtonBasic",
|
|
124
|
+
background-color: ${e=>t.getColorRgbaValue(e.theme,"ButtonBasic",e.color,"disabled","background","backgroundOpacity")};
|
|
125
125
|
}
|
|
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: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=!
|
|
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
|
-
import { P as
|
|
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,
|
|
@@ -244,16 +248,16 @@ const x = {
|
|
|
244
248
|
background-color: ${(e) => t(
|
|
245
249
|
e.theme,
|
|
246
250
|
"ButtonTinted",
|
|
247
|
-
|
|
251
|
+
e.color,
|
|
248
252
|
"disabled",
|
|
249
253
|
"background",
|
|
250
254
|
"backgroundOpacity"
|
|
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,12 +342,12 @@ 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,
|
|
345
349
|
"ButtonBasic",
|
|
346
|
-
|
|
350
|
+
e.color,
|
|
347
351
|
"disabled",
|
|
348
352
|
"background",
|
|
349
353
|
"backgroundOpacity"
|
|
@@ -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
|
-
} = e,
|
|
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
|
-
...
|
|
421
|
-
className: `${
|
|
424
|
+
...o,
|
|
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
|
-
...
|
|
439
|
-
className: `${
|
|
442
|
+
...o,
|
|
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
|
-
...
|
|
457
|
-
className: `${
|
|
460
|
+
...o,
|
|
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
|
-
...
|
|
475
|
-
className: `${
|
|
478
|
+
...o,
|
|
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
|
-
...
|
|
494
|
-
className: `${
|
|
497
|
+
...o,
|
|
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()
|
|
@@ -507,17 +511,17 @@ const x = {
|
|
|
507
511
|
);
|
|
508
512
|
});
|
|
509
513
|
X.propTypes = {
|
|
510
|
-
text:
|
|
511
|
-
iconStyle:
|
|
514
|
+
text: n.string,
|
|
515
|
+
iconStyle: n.oneOf(["regular", "solid"]),
|
|
512
516
|
/**
|
|
513
517
|
* Icon before the text
|
|
514
518
|
*/
|
|
515
|
-
leadingIcon:
|
|
519
|
+
leadingIcon: n.string,
|
|
516
520
|
/**
|
|
517
521
|
* Icon after the text
|
|
518
522
|
*/
|
|
519
|
-
trailingIcon:
|
|
520
|
-
borderRadius:
|
|
523
|
+
trailingIcon: n.string,
|
|
524
|
+
borderRadius: n.oneOf([
|
|
521
525
|
"slight",
|
|
522
526
|
"regular",
|
|
523
527
|
"edged",
|
|
@@ -527,18 +531,18 @@ X.propTypes = {
|
|
|
527
531
|
/**
|
|
528
532
|
* Different styles
|
|
529
533
|
*/
|
|
530
|
-
btnType:
|
|
531
|
-
disabled:
|
|
532
|
-
tabIndex:
|
|
534
|
+
btnType: n.oneOf(["filled", "tinted", "outline", "basic"]),
|
|
535
|
+
disabled: n.bool,
|
|
536
|
+
tabIndex: n.number,
|
|
533
537
|
//---------------------------------------------------------------
|
|
534
|
-
onBlur:
|
|
535
|
-
onFocus:
|
|
536
|
-
onClick:
|
|
537
|
-
onKeyDown:
|
|
538
|
+
onBlur: n.func,
|
|
539
|
+
onFocus: n.func,
|
|
540
|
+
onClick: n.func,
|
|
541
|
+
onKeyDown: n.func,
|
|
538
542
|
//---------------------------------------------------------------
|
|
539
|
-
className:
|
|
540
|
-
style:
|
|
541
|
-
color:
|
|
543
|
+
className: n.string,
|
|
544
|
+
style: n.object,
|
|
545
|
+
color: n.oneOf([
|
|
542
546
|
"primary",
|
|
543
547
|
"secondary",
|
|
544
548
|
"success",
|
|
@@ -548,7 +552,7 @@ X.propTypes = {
|
|
|
548
552
|
"neutral",
|
|
549
553
|
"gray"
|
|
550
554
|
]),
|
|
551
|
-
size:
|
|
555
|
+
size: n.oneOf(["small", "medium", "large"])
|
|
552
556
|
};
|
|
553
557
|
export {
|
|
554
558
|
X as default
|
package/dist/IconButton.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const c=require("react/jsx-runtime"),C=require("react"),l=require("./index-BpbMKBf_.cjs"),h=require("./emotion-styled.browser.esm-BtEseadx.cjs"),t=require("./utils-Dl9xPH4c.cjs"),F=require("./emotion-element-f0de968e.browser.esm-B7k6i6lC.cjs"),y=e=>`
|
|
2
2
|
outline: none;
|
|
3
3
|
display: inline-flex;
|
|
4
4
|
flex-direction: row;
|
|
@@ -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",
|
|
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`
|
|
@@ -80,10 +80,10 @@
|
|
|
80
80
|
&:disabled {
|
|
81
81
|
${e=>e.disabled===!0&&t.getDisabledStateCss(e.theme)};
|
|
82
82
|
cursor: default;
|
|
83
|
-
background-color: ${e=>t.getColorRgbaValue(e.theme,"ButtonTinted",
|
|
84
|
-
color: ${e=>t.getColorRgbaValue(e.theme,"ButtonTinted",
|
|
83
|
+
background-color: ${e=>t.getColorRgbaValue(e.theme,"ButtonTinted",e.color,"disabled","background","backgroundOpacity")};
|
|
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")};
|
|
@@ -114,9 +114,9 @@
|
|
|
114
114
|
&:disabled {
|
|
115
115
|
${e=>e.disabled===!0&&t.getDisabledStateCss(e.theme)};
|
|
116
116
|
cursor: default;
|
|
117
|
-
background-color: ${e=>t.getColorRgbaValue(e.theme,"ButtonBasic",
|
|
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,
|
|
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
|
@@ -2,7 +2,7 @@ import { jsx as i } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as I, isValidElement as S } from "react";
|
|
3
3
|
import { P as n } from "./index-CblbdqjE.js";
|
|
4
4
|
import { s as g } from "./emotion-styled.browser.esm-BNN1dTl3.js";
|
|
5
|
-
import { c as f, b as t, d as
|
|
5
|
+
import { c as f, b as t, d as c, e as k, h as y, a as V } from "./utils-BdsZgOUE.js";
|
|
6
6
|
import { u as j } from "./emotion-element-f0de968e.browser.esm-CkCiQliQ.js";
|
|
7
7
|
const x = (e) => `
|
|
8
8
|
outline: none;
|
|
@@ -20,11 +20,11 @@ const x = (e) => `
|
|
|
20
20
|
e.borderRadius
|
|
21
21
|
)};
|
|
22
22
|
|
|
23
|
-
min-width: ${
|
|
24
|
-
max-width: ${
|
|
23
|
+
min-width: ${c(e.theme, e.size)};
|
|
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(
|
|
@@ -49,8 +49,8 @@ const x = (e) => `
|
|
|
49
49
|
"text"
|
|
50
50
|
)};
|
|
51
51
|
|
|
52
|
-
min-height: ${(e) =>
|
|
53
|
-
max-height: ${(e) =>
|
|
52
|
+
min-height: ${(e) => c(e.theme, e.size)};
|
|
53
|
+
max-height: ${(e) => c(e.theme, e.size)};
|
|
54
54
|
|
|
55
55
|
&:hover {
|
|
56
56
|
background-color: ${(e) => t(
|
|
@@ -111,9 +111,10 @@ const x = (e) => `
|
|
|
111
111
|
background-color: ${(e) => t(
|
|
112
112
|
e.theme,
|
|
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,
|
|
@@ -151,8 +152,8 @@ const x = (e) => `
|
|
|
151
152
|
"backgroundOpacity"
|
|
152
153
|
)};
|
|
153
154
|
|
|
154
|
-
min-height: ${(e) =>
|
|
155
|
-
max-height: ${(e) =>
|
|
155
|
+
min-height: ${(e) => c(e.theme, e.size)};
|
|
156
|
+
max-height: ${(e) => c(e.theme, e.size)};
|
|
156
157
|
|
|
157
158
|
&:hover {
|
|
158
159
|
background-color: ${(e) => e.disabled !== !0 && t(
|
|
@@ -214,7 +215,7 @@ const x = (e) => `
|
|
|
214
215
|
background-color: ${(e) => t(
|
|
215
216
|
e.theme,
|
|
216
217
|
"ButtonTinted",
|
|
217
|
-
|
|
218
|
+
e.color,
|
|
218
219
|
"disabled",
|
|
219
220
|
"background",
|
|
220
221
|
"backgroundOpacity"
|
|
@@ -222,12 +223,12 @@ const x = (e) => `
|
|
|
222
223
|
color: ${(e) => t(
|
|
223
224
|
e.theme,
|
|
224
225
|
"ButtonTinted",
|
|
225
|
-
|
|
226
|
+
e.color,
|
|
226
227
|
"disabled",
|
|
227
228
|
"text"
|
|
228
229
|
)};
|
|
229
230
|
}
|
|
230
|
-
`,
|
|
231
|
+
`, T = g.button`
|
|
231
232
|
${(e) => x(e)}
|
|
232
233
|
|
|
233
234
|
${(e) => f(
|
|
@@ -254,8 +255,8 @@ const x = (e) => `
|
|
|
254
255
|
"backgroundOpacity"
|
|
255
256
|
)};
|
|
256
257
|
|
|
257
|
-
min-height: ${(e) =>
|
|
258
|
-
max-height: ${(e) =>
|
|
258
|
+
min-height: ${(e) => c(e.theme, e.size)};
|
|
259
|
+
max-height: ${(e) => c(e.theme, e.size)};
|
|
259
260
|
|
|
260
261
|
&:hover {
|
|
261
262
|
background-color: ${(e) => t(
|
|
@@ -318,13 +319,13 @@ const x = (e) => `
|
|
|
318
319
|
background-color: ${(e) => t(
|
|
319
320
|
e.theme,
|
|
320
321
|
"ButtonBasic",
|
|
321
|
-
|
|
322
|
+
e.color,
|
|
322
323
|
"disabled",
|
|
323
324
|
"background",
|
|
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,
|
|
@@ -339,7 +340,7 @@ const x = (e) => `
|
|
|
339
340
|
icon: B = null,
|
|
340
341
|
iconStyle: z = "solid",
|
|
341
342
|
borderRadius: F = "regular",
|
|
342
|
-
btnType:
|
|
343
|
+
btnType: l = "filled",
|
|
343
344
|
disabled: N = !1,
|
|
344
345
|
tabIndex: E = 0,
|
|
345
346
|
//----------------
|
|
@@ -353,45 +354,45 @@ const x = (e) => `
|
|
|
353
354
|
},
|
|
354
355
|
//----------------
|
|
355
356
|
size: v = "small",
|
|
356
|
-
color:
|
|
357
|
+
color: a = "primary",
|
|
357
358
|
className: m = "",
|
|
358
359
|
style: w = {},
|
|
359
360
|
...h
|
|
360
361
|
} = e, o = {
|
|
361
362
|
theme: j(),
|
|
362
|
-
color:
|
|
363
|
+
color: a,
|
|
363
364
|
size: v,
|
|
364
365
|
style: w,
|
|
365
366
|
className: "lnc-ui-icon-button",
|
|
366
367
|
disabled: N,
|
|
367
368
|
borderRadius: F,
|
|
368
|
-
btnType:
|
|
369
|
+
btnType: l
|
|
369
370
|
}, C = () => {
|
|
370
371
|
var R = z === "solid" ? "fas" : "far";
|
|
371
372
|
return `${R} fa-${B} fa-fw`;
|
|
372
373
|
}, $ = () => S(B) ? B : /* @__PURE__ */ i(D, { className: C() });
|
|
373
|
-
return
|
|
374
|
-
|
|
374
|
+
return l === "filled" ? /* @__PURE__ */ i(
|
|
375
|
+
O,
|
|
375
376
|
{
|
|
376
377
|
ref: d,
|
|
377
378
|
"data-type": "filled",
|
|
378
379
|
...o,
|
|
379
|
-
className: `${o == null ? void 0 : o.className} ${
|
|
380
|
+
className: `${o == null ? void 0 : o.className} ${a}-${l}-lnc-btn ${m}`,
|
|
380
381
|
onFocus: r,
|
|
381
382
|
onBlur: u,
|
|
382
383
|
onClick: b,
|
|
383
384
|
onKeyDown: s,
|
|
384
|
-
type:
|
|
385
|
+
type: l,
|
|
385
386
|
...h,
|
|
386
387
|
children: $()
|
|
387
388
|
}
|
|
388
|
-
) :
|
|
389
|
+
) : l === "tinted" ? /* @__PURE__ */ i(
|
|
389
390
|
K,
|
|
390
391
|
{
|
|
391
392
|
ref: d,
|
|
392
393
|
"data-type": "tinted",
|
|
393
394
|
...o,
|
|
394
|
-
className: `${o == null ? void 0 : o.className} ${
|
|
395
|
+
className: `${o == null ? void 0 : o.className} ${a}-${l}-lnc-btn ${m}`,
|
|
395
396
|
onFocus: r,
|
|
396
397
|
onBlur: u,
|
|
397
398
|
onClick: b,
|
|
@@ -399,13 +400,13 @@ const x = (e) => `
|
|
|
399
400
|
...h,
|
|
400
401
|
children: $()
|
|
401
402
|
}
|
|
402
|
-
) :
|
|
403
|
+
) : l === "outline" ? /* @__PURE__ */ i(
|
|
403
404
|
U,
|
|
404
405
|
{
|
|
405
406
|
ref: d,
|
|
406
407
|
"data-type": "outline",
|
|
407
408
|
...o,
|
|
408
|
-
className: `${o == null ? void 0 : o.className} ${
|
|
409
|
+
className: `${o == null ? void 0 : o.className} ${a}-${l}-lnc-btn ${m}`,
|
|
409
410
|
onFocus: r,
|
|
410
411
|
onBlur: u,
|
|
411
412
|
onClick: b,
|
|
@@ -413,13 +414,13 @@ const x = (e) => `
|
|
|
413
414
|
...h,
|
|
414
415
|
children: $()
|
|
415
416
|
}
|
|
416
|
-
) :
|
|
417
|
-
|
|
417
|
+
) : l === "basic" ? /* @__PURE__ */ i(
|
|
418
|
+
T,
|
|
418
419
|
{
|
|
419
420
|
ref: d,
|
|
420
421
|
"data-type": "basic",
|
|
421
422
|
...o,
|
|
422
|
-
className: `${o == null ? void 0 : o.className} ${
|
|
423
|
+
className: `${o == null ? void 0 : o.className} ${a}-${l}-lnc-btn ${m}`,
|
|
423
424
|
onFocus: r,
|
|
424
425
|
onBlur: u,
|
|
425
426
|
onClick: b,
|
|
@@ -428,13 +429,13 @@ 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",
|
|
435
436
|
size: v,
|
|
436
437
|
...o,
|
|
437
|
-
className: `${o == null ? void 0 : o.className} ${
|
|
438
|
+
className: `${o == null ? void 0 : o.className} ${a}-${l}-lnc-btn ${m}`,
|
|
438
439
|
onFocus: r,
|
|
439
440
|
onBlur: u,
|
|
440
441
|
onClick: b,
|