@lanaco/lnc-react-ui 4.0.103 → 4.0.104
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/IconButton.cjs +6 -6
- package/dist/IconButton.js +79 -78
- package/package.json +1 -1
package/dist/IconButton.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),B=require("react"),o=require("./index-BPVoEhTF.cjs"),b=require("./emotion-styled.browser.esm-BtEseadx.cjs"),t=require("./utils-BWzf4vLl.cjs"),F=require("./emotion-element-f0de968e.browser.esm-B7k6i6lC.cjs"),m=e=>`
|
|
2
2
|
outline: none;
|
|
3
3
|
display: inline-flex;
|
|
4
4
|
flex-direction: row;
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
|
|
14
14
|
min-width: ${t.getSizeValueWithUnits(e.theme,e.size)};
|
|
15
15
|
max-width: ${t.getSizeValueWithUnits(e.theme,e.size)};
|
|
16
|
-
`,
|
|
16
|
+
`,P=b.styled.i`
|
|
17
17
|
font-size: 1.125rem;
|
|
18
|
-
`,
|
|
18
|
+
`,C=b.styled.button`
|
|
19
19
|
${e=>m(e)}
|
|
20
20
|
|
|
21
21
|
${e=>t.getComponentTypographyCss(e.theme,"ButtonFilled",e.size,"enabled")};
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
background-color: ${e=>t.getColorRgbaValue(e.theme,"ButtonTinted","gray","disabled","background","backgroundOpacity")};
|
|
84
84
|
color: ${e=>t.getColorRgbaValue(e.theme,"ButtonTinted","gray","disabled","text")};
|
|
85
85
|
}
|
|
86
|
-
`,
|
|
86
|
+
`,f=b.styled.button`
|
|
87
87
|
${e=>m(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","gray","disabled","background","backgroundOpacity")};
|
|
118
118
|
}
|
|
119
|
-
`,w=b.styled(
|
|
119
|
+
`,w=b.styled(f)`
|
|
120
120
|
border: 1px solid
|
|
121
121
|
${e=>t.getColorRgbaValue(e.theme,"ButtonBasic",e.color,"enabled","border","borderOpacity")};
|
|
122
|
-
`,
|
|
122
|
+
`,k=B.forwardRef((e,i)=>{const{icon:h=null,iconStyle:V="solid",borderRadius:R="regular",btnType:a="filled",disabled:T=!1,tabIndex:j=0,onFocus:r=()=>{},onBlur:c=()=>{},onClick:u=()=>{},onKeyDown:d=()=>{},size:y="small",color:$="primary",className:x="",style:z={},...s}=e,l={theme:F.useTheme(),color:$,size:y,style:z,className:"lnc-ui-icon-button",disabled:T,borderRadius:R,btnType:a},v=()=>{var O=V==="solid"?"fas":"far";return`${O} fa-${h} fa-fw`},g=()=>B.isValidElement(h)?h:n.jsx(P,{className:v()});return a==="filled"?n.jsx(C,{ref:i,"data-type":"filled",...l,className:`${l==null?void 0:l.className} ${$}-${a}-lnc-btn ${x}`,onFocus:r,onBlur:c,onClick:u,onKeyDown:d,type:a,...s,children:g()}):a==="tinted"?n.jsx(S,{ref:i,"data-type":"tinted",...l,onFocus:r,onBlur:c,onClick:u,onKeyDown:d,...s,children:g()}):a==="outline"?n.jsx(w,{ref:i,"data-type":"outline",...l,onFocus:r,onBlur:c,onClick:u,onKeyDown:d,...s,children:g()}):a==="basic"?n.jsx(f,{ref:i,"data-type":"basic",...l,onFocus:r,onBlur:c,onClick:u,onKeyDown:d,...s,children:g()}):n.jsx(C,{ref:i,"data-type":"filled",size:y,...l,onFocus:r,onBlur:c,onClick:u,onKeyDown:d,...s,children:g()})});k.propTypes={icon:o.PropTypes.oneOfType([o.PropTypes.string,o.PropTypes.element]),iconStyle:o.PropTypes.oneOf(["regular","solid"]),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=k;
|
package/dist/IconButton.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as I, isValidElement as S } from "react";
|
|
3
3
|
import { P as o } from "./index-S5Cd7WrG.js";
|
|
4
4
|
import { s as h } from "./emotion-styled.browser.esm-BNN1dTl3.js";
|
|
5
|
-
import { c as $, b as t, d as
|
|
5
|
+
import { c as $, b as t, d as a, e as B, h as f, a as V } from "./utils-BXCGNjIy.js";
|
|
6
6
|
import { u as j } from "./emotion-element-f0de968e.browser.esm-CkCiQliQ.js";
|
|
7
7
|
const k = (e) => `
|
|
8
8
|
outline: none;
|
|
@@ -20,11 +20,11 @@ const k = (e) => `
|
|
|
20
20
|
e.borderRadius
|
|
21
21
|
)};
|
|
22
22
|
|
|
23
|
-
min-width: ${
|
|
24
|
-
max-width: ${
|
|
23
|
+
min-width: ${a(e.theme, e.size)};
|
|
24
|
+
max-width: ${a(e.theme, e.size)};
|
|
25
25
|
`, D = h.i`
|
|
26
26
|
font-size: 1.125rem;
|
|
27
|
-
`,
|
|
27
|
+
`, v = h.button`
|
|
28
28
|
${(e) => k(e)}
|
|
29
29
|
|
|
30
30
|
${(e) => $(
|
|
@@ -49,8 +49,8 @@ const k = (e) => `
|
|
|
49
49
|
"text"
|
|
50
50
|
)};
|
|
51
51
|
|
|
52
|
-
min-height: ${(e) =>
|
|
53
|
-
max-height: ${(e) =>
|
|
52
|
+
min-height: ${(e) => a(e.theme, e.size)};
|
|
53
|
+
max-height: ${(e) => a(e.theme, e.size)};
|
|
54
54
|
|
|
55
55
|
&:hover {
|
|
56
56
|
background-color: ${(e) => t(
|
|
@@ -123,7 +123,7 @@ const k = (e) => `
|
|
|
123
123
|
"text"
|
|
124
124
|
)};
|
|
125
125
|
}
|
|
126
|
-
`,
|
|
126
|
+
`, K = h.button`
|
|
127
127
|
${(e) => k(e)}
|
|
128
128
|
|
|
129
129
|
${(e) => $(
|
|
@@ -151,8 +151,8 @@ const k = (e) => `
|
|
|
151
151
|
"backgroundOpacity"
|
|
152
152
|
)};
|
|
153
153
|
|
|
154
|
-
min-height: ${(e) =>
|
|
155
|
-
max-height: ${(e) =>
|
|
154
|
+
min-height: ${(e) => a(e.theme, e.size)};
|
|
155
|
+
max-height: ${(e) => a(e.theme, e.size)};
|
|
156
156
|
|
|
157
157
|
&:hover {
|
|
158
158
|
background-color: ${(e) => e.disabled !== !0 && t(
|
|
@@ -227,7 +227,7 @@ const k = (e) => `
|
|
|
227
227
|
"text"
|
|
228
228
|
)};
|
|
229
229
|
}
|
|
230
|
-
`,
|
|
230
|
+
`, T = h.button`
|
|
231
231
|
${(e) => k(e)}
|
|
232
232
|
|
|
233
233
|
${(e) => $(
|
|
@@ -254,8 +254,8 @@ const k = (e) => `
|
|
|
254
254
|
"backgroundOpacity"
|
|
255
255
|
)};
|
|
256
256
|
|
|
257
|
-
min-height: ${(e) =>
|
|
258
|
-
max-height: ${(e) =>
|
|
257
|
+
min-height: ${(e) => a(e.theme, e.size)};
|
|
258
|
+
max-height: ${(e) => a(e.theme, e.size)};
|
|
259
259
|
|
|
260
260
|
&:hover {
|
|
261
261
|
background-color: ${(e) => t(
|
|
@@ -324,7 +324,7 @@ const k = (e) => `
|
|
|
324
324
|
"backgroundOpacity"
|
|
325
325
|
)};
|
|
326
326
|
}
|
|
327
|
-
`,
|
|
327
|
+
`, U = h(T)`
|
|
328
328
|
border: 1px solid
|
|
329
329
|
${(e) => t(
|
|
330
330
|
e.theme,
|
|
@@ -334,112 +334,113 @@ const k = (e) => `
|
|
|
334
334
|
"border",
|
|
335
335
|
"borderOpacity"
|
|
336
336
|
)};
|
|
337
|
-
`,
|
|
337
|
+
`, W = I((e, i) => {
|
|
338
338
|
const {
|
|
339
339
|
icon: g = null,
|
|
340
|
-
iconStyle:
|
|
341
|
-
borderRadius:
|
|
340
|
+
iconStyle: O = "solid",
|
|
341
|
+
borderRadius: z = "regular",
|
|
342
342
|
btnType: l = "filled",
|
|
343
|
-
disabled:
|
|
344
|
-
tabIndex:
|
|
343
|
+
disabled: F = !1,
|
|
344
|
+
tabIndex: E = 0,
|
|
345
345
|
//----------------
|
|
346
|
-
onFocus:
|
|
346
|
+
onFocus: d = () => {
|
|
347
347
|
},
|
|
348
|
-
onBlur:
|
|
348
|
+
onBlur: r = () => {
|
|
349
349
|
},
|
|
350
|
-
onClick:
|
|
350
|
+
onClick: u = () => {
|
|
351
351
|
},
|
|
352
|
-
onKeyDown:
|
|
352
|
+
onKeyDown: b = () => {
|
|
353
353
|
},
|
|
354
354
|
//----------------
|
|
355
355
|
size: y = "small",
|
|
356
|
-
color:
|
|
356
|
+
color: x = "primary",
|
|
357
357
|
className: w = "",
|
|
358
358
|
style: C = {},
|
|
359
|
-
...
|
|
360
|
-
} = e,
|
|
359
|
+
...s
|
|
360
|
+
} = e, n = {
|
|
361
361
|
theme: j(),
|
|
362
|
-
color:
|
|
362
|
+
color: x,
|
|
363
363
|
size: y,
|
|
364
364
|
style: C,
|
|
365
|
-
className: "lnc-ui-icon-button
|
|
366
|
-
disabled:
|
|
367
|
-
borderRadius:
|
|
365
|
+
className: "lnc-ui-icon-button",
|
|
366
|
+
disabled: F,
|
|
367
|
+
borderRadius: z,
|
|
368
368
|
btnType: l
|
|
369
|
-
},
|
|
370
|
-
var
|
|
371
|
-
return `${
|
|
372
|
-
}, m = () =>
|
|
373
|
-
return l === "filled" ? /* @__PURE__ */
|
|
374
|
-
|
|
369
|
+
}, N = () => {
|
|
370
|
+
var R = O === "solid" ? "fas" : "far";
|
|
371
|
+
return `${R} fa-${g} fa-fw`;
|
|
372
|
+
}, m = () => S(g) ? g : /* @__PURE__ */ c(D, { className: N() });
|
|
373
|
+
return l === "filled" ? /* @__PURE__ */ c(
|
|
374
|
+
v,
|
|
375
375
|
{
|
|
376
|
-
ref:
|
|
376
|
+
ref: i,
|
|
377
377
|
"data-type": "filled",
|
|
378
|
-
...
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
378
|
+
...n,
|
|
379
|
+
className: `${n == null ? void 0 : n.className} ${x}-${l}-lnc-btn ${w}`,
|
|
380
|
+
onFocus: d,
|
|
381
|
+
onBlur: r,
|
|
382
|
+
onClick: u,
|
|
383
|
+
onKeyDown: b,
|
|
383
384
|
type: l,
|
|
384
|
-
...
|
|
385
|
+
...s,
|
|
385
386
|
children: m()
|
|
386
387
|
}
|
|
387
|
-
) : l === "tinted" ? /* @__PURE__ */
|
|
388
|
-
|
|
388
|
+
) : l === "tinted" ? /* @__PURE__ */ c(
|
|
389
|
+
K,
|
|
389
390
|
{
|
|
390
|
-
ref:
|
|
391
|
+
ref: i,
|
|
391
392
|
"data-type": "tinted",
|
|
393
|
+
...n,
|
|
394
|
+
onFocus: d,
|
|
395
|
+
onBlur: r,
|
|
396
|
+
onClick: u,
|
|
397
|
+
onKeyDown: b,
|
|
392
398
|
...s,
|
|
393
|
-
onFocus: i,
|
|
394
|
-
onBlur: d,
|
|
395
|
-
onClick: r,
|
|
396
|
-
onKeyDown: u,
|
|
397
|
-
...b,
|
|
398
399
|
children: m()
|
|
399
400
|
}
|
|
400
|
-
) : l === "outline" ? /* @__PURE__ */
|
|
401
|
-
|
|
401
|
+
) : l === "outline" ? /* @__PURE__ */ c(
|
|
402
|
+
U,
|
|
402
403
|
{
|
|
403
|
-
ref:
|
|
404
|
+
ref: i,
|
|
404
405
|
"data-type": "outline",
|
|
406
|
+
...n,
|
|
407
|
+
onFocus: d,
|
|
408
|
+
onBlur: r,
|
|
409
|
+
onClick: u,
|
|
410
|
+
onKeyDown: b,
|
|
405
411
|
...s,
|
|
406
|
-
onFocus: i,
|
|
407
|
-
onBlur: d,
|
|
408
|
-
onClick: r,
|
|
409
|
-
onKeyDown: u,
|
|
410
|
-
...b,
|
|
411
412
|
children: m()
|
|
412
413
|
}
|
|
413
|
-
) : l === "basic" ? /* @__PURE__ */
|
|
414
|
-
|
|
414
|
+
) : l === "basic" ? /* @__PURE__ */ c(
|
|
415
|
+
T,
|
|
415
416
|
{
|
|
416
|
-
ref:
|
|
417
|
+
ref: i,
|
|
417
418
|
"data-type": "basic",
|
|
419
|
+
...n,
|
|
420
|
+
onFocus: d,
|
|
421
|
+
onBlur: r,
|
|
422
|
+
onClick: u,
|
|
423
|
+
onKeyDown: b,
|
|
418
424
|
...s,
|
|
419
|
-
onFocus: i,
|
|
420
|
-
onBlur: d,
|
|
421
|
-
onClick: r,
|
|
422
|
-
onKeyDown: u,
|
|
423
|
-
...b,
|
|
424
425
|
children: m()
|
|
425
426
|
}
|
|
426
|
-
) : /* @__PURE__ */
|
|
427
|
-
|
|
427
|
+
) : /* @__PURE__ */ c(
|
|
428
|
+
v,
|
|
428
429
|
{
|
|
429
|
-
ref:
|
|
430
|
+
ref: i,
|
|
430
431
|
"data-type": "filled",
|
|
431
432
|
size: y,
|
|
433
|
+
...n,
|
|
434
|
+
onFocus: d,
|
|
435
|
+
onBlur: r,
|
|
436
|
+
onClick: u,
|
|
437
|
+
onKeyDown: b,
|
|
432
438
|
...s,
|
|
433
|
-
onFocus: i,
|
|
434
|
-
onBlur: d,
|
|
435
|
-
onClick: r,
|
|
436
|
-
onKeyDown: u,
|
|
437
|
-
...b,
|
|
438
439
|
children: m()
|
|
439
440
|
}
|
|
440
441
|
);
|
|
441
442
|
});
|
|
442
|
-
|
|
443
|
+
W.propTypes = {
|
|
443
444
|
icon: o.oneOfType([o.string, o.element]),
|
|
444
445
|
iconStyle: o.oneOf(["regular", "solid"]),
|
|
445
446
|
borderRadius: o.oneOf([
|
|
@@ -476,5 +477,5 @@ U.propTypes = {
|
|
|
476
477
|
size: o.oneOf(["small", "medium", "large"])
|
|
477
478
|
};
|
|
478
479
|
export {
|
|
479
|
-
|
|
480
|
+
W as default
|
|
480
481
|
};
|