@lanaco/lnc-react-ui 3.11.34 → 4.0.1
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/README.md +0 -3
- package/dist/Accordion.cjs +6 -0
- package/dist/Accordion.js +65 -0
- package/dist/AccordionDetails.cjs +7 -0
- package/dist/AccordionDetails.js +32 -0
- package/dist/AccordionSummary.cjs +12 -0
- package/dist/AccordionSummary.js +78 -0
- package/dist/ActionsToolbar.cjs +19 -0
- package/dist/ActionsToolbar.js +225 -0
- package/dist/Alert.cjs +40 -0
- package/dist/Alert.js +138 -0
- package/dist/Avatar.cjs +16 -0
- package/dist/Avatar.js +114 -0
- package/dist/Badge.cjs +17 -0
- package/dist/Badge.js +70 -0
- package/dist/Breadcrumbs.cjs +8 -0
- package/dist/Breadcrumbs.js +131 -0
- package/dist/Button.cjs +127 -0
- package/dist/Button.js +542 -0
- package/dist/ButtonGroup.cjs +44 -0
- package/dist/ButtonGroup.js +112 -0
- package/dist/CheckBoxInput.cjs +118 -0
- package/dist/CheckBoxInput.js +348 -0
- package/dist/Chip.cjs +27 -0
- package/dist/Chip.js +189 -0
- package/dist/ColorInput.cjs +60 -0
- package/dist/ColorInput.js +256 -0
- package/dist/ConfirmationForm.cjs +22 -0
- package/dist/ConfirmationForm.js +169 -0
- package/dist/Content.cjs +1 -0
- package/dist/Content.js +18 -0
- package/dist/CustomStyles-CqlCjTgU.cjs +8 -0
- package/dist/CustomStyles-nfD3J1mi.js +2881 -0
- package/dist/DataView.cjs +1 -0
- package/dist/DataView.js +62 -0
- package/dist/DateInput.cjs +296 -0
- package/dist/DateInput.js +7042 -0
- package/dist/DecimalInput.cjs +54 -0
- package/dist/DecimalInput.js +697 -0
- package/dist/DetailsView.cjs +18 -0
- package/dist/DetailsView.js +243 -0
- package/dist/DoubleRangeSlider.cjs +114 -0
- package/dist/DoubleRangeSlider.js +289 -0
- package/dist/DragAndDropFile.cjs +31 -0
- package/dist/DragAndDropFile.js +2331 -0
- package/dist/DragDropFiles.cjs +14 -0
- package/dist/DragDropFiles.js +175 -0
- package/dist/Drawer.cjs +6 -0
- package/dist/Drawer.js +206 -0
- package/dist/Dropdown.cjs +1 -0
- package/dist/Dropdown.js +266 -0
- package/dist/DropdownItem.cjs +36 -0
- package/dist/DropdownItem.js +241 -0
- package/dist/DropdownLookup.cjs +1 -0
- package/dist/DropdownLookup.js +325 -0
- package/dist/DropdownMenu-B6qr13ik.cjs +19 -0
- package/dist/DropdownMenu-DZi3TJ8Q.js +1547 -0
- package/dist/DropdownMenu.cjs +1 -0
- package/dist/DropdownMenu.js +12 -0
- package/dist/EditableTable.cjs +21 -0
- package/dist/EditableTable.js +462 -0
- package/dist/FileInput.cjs +47 -0
- package/dist/FileInput.js +206 -0
- package/dist/FlexBox.cjs +9 -0
- package/dist/FlexBox.js +97 -0
- package/dist/FlexGrid.cjs +1 -0
- package/dist/FlexGrid.js +78 -0
- package/dist/FlexGridItem.cjs +7 -0
- package/dist/FlexGridItem.js +97 -0
- package/dist/Footer.cjs +1 -0
- package/dist/Footer.js +18 -0
- package/dist/FormField.cjs +11 -0
- package/dist/FormField.js +65 -0
- package/dist/FormView.cjs +13 -0
- package/dist/FormView.js +354 -0
- package/dist/Grid.cjs +13 -0
- package/dist/Grid.js +62 -0
- package/dist/GridItem.cjs +15 -0
- package/dist/GridItem.js +72 -0
- package/dist/Header.cjs +1 -0
- package/dist/Header.js +18 -0
- package/dist/Icon.cjs +8 -0
- package/dist/Icon.js +59 -0
- package/dist/IconButton.cjs +122 -0
- package/dist/IconButton.js +481 -0
- package/dist/Kanban.cjs +85 -0
- package/dist/Kanban.js +4793 -0
- package/dist/KanbanActionsToolbar.cjs +19 -0
- package/dist/KanbanActionsToolbar.js +152 -0
- package/dist/KanbanCard-ConTmu3w.cjs +30 -0
- package/dist/KanbanCard-D9OhU8C6.js +175 -0
- package/dist/KanbanCard.cjs +1 -0
- package/dist/KanbanCard.js +12 -0
- package/dist/KanbanFooter.cjs +5 -0
- package/dist/KanbanFooter.js +84 -0
- package/dist/KanbanHeader.cjs +15 -0
- package/dist/KanbanHeader.js +127 -0
- package/dist/KanbanView.cjs +8 -0
- package/dist/KanbanView.js +255 -0
- package/dist/Link.cjs +15 -0
- package/dist/Link.js +62 -0
- package/dist/MenuItem.cjs +36 -0
- package/dist/MenuItem.js +230 -0
- package/dist/Modal.cjs +84 -0
- package/dist/Modal.js +372 -0
- package/dist/MultiSelectDropdown.cjs +1 -0
- package/dist/MultiSelectDropdown.js +261 -0
- package/dist/MultiSelectDropdownLookup.cjs +1 -0
- package/dist/MultiSelectDropdownLookup.js +274 -0
- package/dist/NestedDropdownItem.cjs +6 -0
- package/dist/NestedDropdownItem.js +102 -0
- package/dist/NestedMenuItem.cjs +6 -0
- package/dist/NestedMenuItem.js +115 -0
- package/dist/Notification.cjs +83 -0
- package/dist/Notification.js +1079 -0
- package/dist/NumberInput.cjs +45 -0
- package/dist/NumberInput.js +241 -0
- package/dist/PageLayout.cjs +26 -0
- package/dist/PageLayout.js +92 -0
- package/dist/PasswordInput.cjs +47 -0
- package/dist/PasswordInput.js +230 -0
- package/dist/ProgressBar.cjs +22 -0
- package/dist/ProgressBar.js +92 -0
- package/dist/RadioGroup.cjs +7 -0
- package/dist/RadioGroup.js +104 -0
- package/dist/RadioInput.cjs +117 -0
- package/dist/RadioInput.js +362 -0
- package/dist/RangeSlider.cjs +72 -0
- package/dist/RangeSlider.js +253 -0
- package/dist/SearchBar.cjs +100 -0
- package/dist/SearchBar.js +994 -0
- package/dist/Separator.cjs +6 -0
- package/dist/Separator.js +37 -0
- package/dist/Sidebar.cjs +39 -0
- package/dist/Sidebar.js +123 -0
- package/dist/Spinner.cjs +38 -0
- package/dist/Spinner.js +114 -0
- package/dist/Surface.cjs +7 -0
- package/dist/Surface.js +60 -0
- package/dist/SwipeableDrawer.cjs +33 -0
- package/dist/SwipeableDrawer.js +213 -0
- package/dist/Table.cjs +170 -0
- package/dist/Table.js +1408 -0
- package/dist/TableView-Cj5_fbSR.js +481 -0
- package/dist/TableView-D8ex512p.cjs +19 -0
- package/dist/TableView.cjs +1 -0
- package/dist/TableView.js +11 -0
- package/dist/Tabs.cjs +7 -0
- package/dist/Tabs.js +72 -0
- package/dist/TextAreaInput.cjs +33 -0
- package/dist/TextAreaInput.js +320 -0
- package/dist/TextInput.cjs +45 -0
- package/dist/TextInput.js +227 -0
- package/dist/ThemeProvider.cjs +113 -0
- package/dist/ThemeProvider.js +1340 -0
- package/dist/TimeInput.cjs +31 -0
- package/dist/TimeInput.js +133 -0
- package/dist/Toggle.cjs +151 -0
- package/dist/Toggle.js +421 -0
- package/dist/TreeMenu.cjs +15 -0
- package/dist/TreeMenu.js +108 -0
- package/dist/TreeMenuSeparator.cjs +6 -0
- package/dist/TreeMenuSeparator.js +40 -0
- package/dist/UploadedFile.cjs +39 -0
- package/dist/UploadedFile.js +192 -0
- package/dist/defineProperty-BHpTtkhC.js +110 -0
- package/dist/defineProperty-DHvxLH8G.cjs +1 -0
- package/dist/emotion-element-5486c51c.browser.esm-CSejtOeT.js +886 -0
- package/dist/emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs +1 -0
- package/dist/emotion-is-prop-valid.esm-BzFBwmJz.js +10 -0
- package/dist/emotion-is-prop-valid.esm-CMrshNb7.cjs +1 -0
- package/dist/emotion-react.browser.esm-DQBL7Wls.cjs +1 -0
- package/dist/emotion-react.browser.esm-OWM-uG8Q.js +94 -0
- package/dist/emotion-styled.browser.esm-BZSYYThs.js +210 -0
- package/dist/emotion-styled.browser.esm-Cbp_XsK4.cjs +1 -0
- package/dist/floating-ui.dom-1F2mTXOe.cjs +1 -0
- package/dist/floating-ui.dom-BdUovkEr.js +938 -0
- package/dist/hoist-non-react-statics.cjs-B8r9S_ak.cjs +15 -0
- package/dist/hoist-non-react-statics.cjs-Drf1aBlk.js +235 -0
- package/dist/index-BLQWNy78.js +109 -0
- package/dist/index-BP5r5zGN.cjs +1 -0
- package/dist/index-B_da1uvD.js +451 -0
- package/dist/index-BjdOz5Ok.cjs +1 -0
- package/dist/index-BklgDeu4.js +42 -0
- package/dist/index-C29T0m2a.cjs +174 -0
- package/dist/index-CZJEA84h.js +19069 -0
- package/dist/index-Cdkz-XH-.js +127 -0
- package/dist/index-D5vEbKUT.js +81 -0
- package/dist/index-DXnSjbfJ.cjs +20 -0
- package/dist/index-Ds9PUTwb.js +667 -0
- package/dist/index-Dzkd2i4n.cjs +1 -0
- package/dist/index-IO9v6o0I.cjs +5 -0
- package/dist/index-P-naJISQ.cjs +1 -0
- package/dist/index.cjs +26 -0
- package/dist/index.js +378 -0
- package/dist/motion-CtkUpWEn.js +3785 -0
- package/dist/motion-Oud-wpUz.cjs +1 -0
- package/dist/objectWithoutPropertiesLoose-Bz3hwpmU.cjs +1 -0
- package/dist/objectWithoutPropertiesLoose-DwEN6RBQ.js +12 -0
- package/dist/setPrototypeOf-4aSEnBDm.cjs +1 -0
- package/dist/setPrototypeOf-a891FLQJ.js +13 -0
- package/dist/style.css +5 -0
- package/dist/tslib.es6-ZNVz5r_T.js +90 -0
- package/dist/tslib.es6-fPwcSa2V.cjs +1 -0
- package/dist/use-isomorphic-layout-effect.browser.esm-CkGv31zs.cjs +1 -0
- package/dist/use-isomorphic-layout-effect.browser.esm-DERp5kr6.js +5 -0
- package/dist/useUpdateEffect-BtMgpgIV.cjs +1 -0
- package/dist/useUpdateEffect-CuYWz7EA.js +15 -0
- package/dist/utils-DEke8iwo.js +10196 -0
- package/dist/utils-hdRGTsQ7.cjs +13 -0
- package/eslint.config.js +38 -0
- package/package.json +137 -58
- package/vite.config.js +135 -0
- package/jest.config.js +0 -7
- package/lib/index.esm.js +0 -84028
- package/lib/index.js +0 -84165
- package/rc1 +0 -0
- package/test/jest/__mocks__/styleMock.js +0 -1
package/README.md
CHANGED
|
@@ -9,14 +9,12 @@ This library includes basic and advanced UI components used with ReactJS fronten
|
|
|
9
9
|
- [Contributing](#contributing)
|
|
10
10
|
- [License](#license)
|
|
11
11
|
|
|
12
|
-
|
|
13
12
|
## Installing
|
|
14
13
|
|
|
15
14
|
```
|
|
16
15
|
$ npm install @lanaco/lnc-react-ui
|
|
17
16
|
```
|
|
18
17
|
|
|
19
|
-
|
|
20
18
|
## Developing Locally
|
|
21
19
|
|
|
22
20
|
To see your changes to `@lanaco/lnc-react-ui` locally, all you need is to run storybook with `npm start` command
|
|
@@ -35,7 +33,6 @@ $ npm start
|
|
|
35
33
|
4. Test your changes by [running your local version](#requirements)
|
|
36
34
|
5. Push your branch and open a Pull Request
|
|
37
35
|
|
|
38
|
-
|
|
39
36
|
## License
|
|
40
37
|
|
|
41
38
|
This code is open source software licensed under the MIT License.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";const g=require("react/jsx-runtime"),t=require("react"),o=require("./index-DXnSjbfJ.cjs"),x=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),l=require("./utils-hdRGTsQ7.cjs"),R=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs"),S=require("./useUpdateEffect-BtMgpgIV.cjs"),N=x.newStyled.div`
|
|
2
|
+
color: ${s=>!s.disabled&&l.getColorRgbaValue(s.theme,"Accordion","primary","enabled","text")};
|
|
3
|
+
background-color: transparent;
|
|
4
|
+
${s=>l.getComponentTypographyCss(s.theme,"Accordion",s.size,"enabled")};
|
|
5
|
+
${s=>s.disabled===!0?l.getDisabledStateCss(s.theme):""}
|
|
6
|
+
`,u=t.forwardRef((s,y)=>{const{expanded:a=!1,disabled:i=!1,change:_=()=>{},size:c="small",className:C="",style:b={},children:p,...f}=s,E={theme:R.useTheme(),size:c,style:b,className:"lnc-ui-accordion "+C},[r,m]=t.useState(a);S.useUpdateEffect(()=>{m(a)},[a]);const d=e=>{_(!r,e),m(!r)},T=t.Children.map(p,e=>{var n;if(t.isValidElement(e)&&(e.props.__TYPE__=="ACCORDION_SUMMARY"||((n=e==null?void 0:e.type)==null?void 0:n.displayName)==="ACCORDION_SUMMARY"))return t.cloneElement(e,{size:c,onClick:d,onExpand:d,isExpanded:r,disabled:i})}),A=t.Children.map(p,e=>{var n;if(t.isValidElement(e)&&(e.props.__TYPE__=="ACCORDION_DETAILS"||((n=e==null?void 0:e.type)==null?void 0:n.displayName)==="ACCORDION_DETAILS"))return t.cloneElement(e,{size:c,isExpanded:r})});return g.jsxs(N,{ref:y,...E,disabled:i,...f,children:[T,A]})});u.propTypes={expanded:o.PropTypes.bool,disabled:o.PropTypes.bool,change:o.PropTypes.func,className:o.PropTypes.string,style:o.PropTypes.object,size:o.PropTypes.oneOf(["small","medium","large"])};module.exports=u;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsxs as E } from "react/jsx-runtime";
|
|
2
|
+
import a, { useState as g } from "react";
|
|
3
|
+
import { P as o } from "./index-Ds9PUTwb.js";
|
|
4
|
+
import { n as N } from "./emotion-styled.browser.esm-BZSYYThs.js";
|
|
5
|
+
import { b as O, a as R, g as S } from "./utils-DEke8iwo.js";
|
|
6
|
+
import { u as x } from "./emotion-element-5486c51c.browser.esm-CSejtOeT.js";
|
|
7
|
+
import { u as D } from "./useUpdateEffect-CuYWz7EA.js";
|
|
8
|
+
const T = N.div`
|
|
9
|
+
color: ${(t) => !t.disabled && O(t.theme, "Accordion", "primary", "enabled", "text")};
|
|
10
|
+
background-color: transparent;
|
|
11
|
+
${(t) => R(t.theme, "Accordion", t.size, "enabled")};
|
|
12
|
+
${(t) => t.disabled === !0 ? S(t.theme) : ""}
|
|
13
|
+
`, I = a.forwardRef((t, c) => {
|
|
14
|
+
const {
|
|
15
|
+
expanded: r = !1,
|
|
16
|
+
disabled: l = !1,
|
|
17
|
+
change: f = () => {
|
|
18
|
+
},
|
|
19
|
+
size: m = "small",
|
|
20
|
+
className: u = "",
|
|
21
|
+
style: C = {},
|
|
22
|
+
children: d,
|
|
23
|
+
...y
|
|
24
|
+
} = t, _ = { theme: x(), size: m, style: C, className: "lnc-ui-accordion " + u }, [n, p] = g(r);
|
|
25
|
+
D(() => {
|
|
26
|
+
p(r);
|
|
27
|
+
}, [r]);
|
|
28
|
+
const i = (e) => {
|
|
29
|
+
f(!n, e), p(!n);
|
|
30
|
+
}, b = a.Children.map(d, (e) => {
|
|
31
|
+
var s;
|
|
32
|
+
if (a.isValidElement(e) && (e.props.__TYPE__ == "ACCORDION_SUMMARY" || ((s = e == null ? void 0 : e.type) == null ? void 0 : s.displayName) === "ACCORDION_SUMMARY"))
|
|
33
|
+
return a.cloneElement(e, {
|
|
34
|
+
size: m,
|
|
35
|
+
onClick: i,
|
|
36
|
+
onExpand: i,
|
|
37
|
+
isExpanded: n,
|
|
38
|
+
disabled: l
|
|
39
|
+
});
|
|
40
|
+
}), A = a.Children.map(d, (e) => {
|
|
41
|
+
var s;
|
|
42
|
+
if (a.isValidElement(e) && (e.props.__TYPE__ == "ACCORDION_DETAILS" || ((s = e == null ? void 0 : e.type) == null ? void 0 : s.displayName) === "ACCORDION_DETAILS"))
|
|
43
|
+
return a.cloneElement(e, {
|
|
44
|
+
size: m,
|
|
45
|
+
isExpanded: n
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
return /* @__PURE__ */ E(T, { ref: c, ..._, disabled: l, ...y, children: [
|
|
49
|
+
b,
|
|
50
|
+
A
|
|
51
|
+
] });
|
|
52
|
+
});
|
|
53
|
+
I.propTypes = {
|
|
54
|
+
expanded: o.bool,
|
|
55
|
+
disabled: o.bool,
|
|
56
|
+
//--------------------------------------------------------------
|
|
57
|
+
change: o.func,
|
|
58
|
+
//---------------------------------------------------------------
|
|
59
|
+
className: o.string,
|
|
60
|
+
style: o.object,
|
|
61
|
+
size: o.oneOf(["small", "medium", "large"])
|
|
62
|
+
};
|
|
63
|
+
export {
|
|
64
|
+
I as default
|
|
65
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),d=require("react"),t=require("./index-DXnSjbfJ.cjs"),u=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),i=(e,r)=>r=="medium"?`${e?"0.4rem":"0"} 1.25rem ${e?"0.8rem":"0"} 1.25rem`:r=="large"?`${e?"0.6rem":"0"} 1.5rem ${e?"1rem":"0"} 1.5rem`:`${e?"0.2rem":"0"} 1rem ${e?"0.6rem":"0"} 1rem`,c=u.newStyled.div`
|
|
2
|
+
transform: ${e=>e.isExpanded?"scaleY(1)":"scaleY(0)"};
|
|
3
|
+
transform-origin: top;
|
|
4
|
+
transition: transform 0.25s ease;
|
|
5
|
+
max-height: ${e=>e.isExpanded?"auto":"0"};
|
|
6
|
+
padding: ${e=>i(e.isExpanded,e.size)};
|
|
7
|
+
`,s=d.forwardRef((e,r)=>{const{__TYPE__:_="ACCORDION_DETAILS",isExpanded:o,size:n="small",children:m,...a}=e;return l.jsx(c,{ref:r,size:n,isExpanded:o,...a,children:m})});s.propTypes={__TYPE__:t.PropTypes.string,className:t.PropTypes.string,style:t.PropTypes.object,size:t.PropTypes.oneOf(["small","medium","large"])};s.displayName="ACCORDION_DETAILS";exports.default=s;exports.getPadding=i;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import l from "react";
|
|
3
|
+
import { P as t } from "./index-Ds9PUTwb.js";
|
|
4
|
+
import { n as f } from "./emotion-styled.browser.esm-BZSYYThs.js";
|
|
5
|
+
const d = (r, e) => e == "medium" ? `${r ? "0.4rem" : "0"} 1.25rem ${r ? "0.8rem" : "0"} 1.25rem` : e == "large" ? `${r ? "0.6rem" : "0"} 1.5rem ${r ? "1rem" : "0"} 1.5rem` : `${r ? "0.2rem" : "0"} 1rem ${r ? "0.6rem" : "0"} 1rem`, c = f.div`
|
|
6
|
+
transform: ${(r) => r.isExpanded ? "scaleY(1)" : "scaleY(0)"};
|
|
7
|
+
transform-origin: top;
|
|
8
|
+
transition: transform 0.25s ease;
|
|
9
|
+
max-height: ${(r) => r.isExpanded ? "auto" : "0"};
|
|
10
|
+
padding: ${(r) => d(r.isExpanded, r.size)};
|
|
11
|
+
`, m = l.forwardRef((r, e) => {
|
|
12
|
+
const {
|
|
13
|
+
__TYPE__: _ = "ACCORDION_DETAILS",
|
|
14
|
+
isExpanded: s,
|
|
15
|
+
size: a = "small",
|
|
16
|
+
children: o,
|
|
17
|
+
...i
|
|
18
|
+
} = r;
|
|
19
|
+
return /* @__PURE__ */ n(c, { ref: e, size: a, isExpanded: s, ...i, children: o });
|
|
20
|
+
});
|
|
21
|
+
m.propTypes = {
|
|
22
|
+
__TYPE__: t.string,
|
|
23
|
+
//---------------------------------------------------------------
|
|
24
|
+
className: t.string,
|
|
25
|
+
style: t.object,
|
|
26
|
+
size: t.oneOf(["small", "medium", "large"])
|
|
27
|
+
};
|
|
28
|
+
m.displayName = "ACCORDION_DETAILS";
|
|
29
|
+
export {
|
|
30
|
+
m as default,
|
|
31
|
+
d as getPadding
|
|
32
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";const o=require("react/jsx-runtime"),f=require("react"),s=require("./index-DXnSjbfJ.cjs"),x=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),g=require("./Icon.cjs"),C=require("./utils-hdRGTsQ7.cjs"),P=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs"),h={small:"0.6rem 1rem",medium:"0.8rem 1.25rem",large:"1rem 1.5rem"},R=x.newStyled.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: space-between;
|
|
4
|
+
cursor: pointer;
|
|
5
|
+
color: ${e=>C.getColorRgbaValue(e.theme,"Accordion","primary","enabled","summaryText")};
|
|
6
|
+
|
|
7
|
+
padding: ${e=>h[e.size]};
|
|
8
|
+
& .accordion-icon-lnc {
|
|
9
|
+
transform: ${e=>e.isExpanded?"rotate(180deg)":"rotate(0)"};
|
|
10
|
+
transition: transform 0.25s ease;
|
|
11
|
+
}
|
|
12
|
+
`,r=f.forwardRef((e,t)=>{const{__TYPE__:b="ACCORDION_SUMMARY",disabled:i,isExpanded:c,onExpand:a,onClick:m=()=>{},size:l="small",className:d="",style:p={},children:u,...y}=e,_={theme:P.useTheme(),size:l,style:p,className:d},T=n=>{i==!1&&a(n),m(n)};return o.jsxs(R,{ref:t,..._,onClick:T,isExpanded:c,...y,children:[u,o.jsx(g,{icon:"angle-down",sizeInUnits:"1.125rem",className:"accordion-icon-lnc"})]})});r.propTypes={__TYPE__:s.PropTypes.string,onClick:s.PropTypes.func,className:s.PropTypes.string,style:s.PropTypes.object,size:s.PropTypes.oneOf(["small","medium","large"])};r.displayName="ACCORDION_SUMMARY";module.exports=r;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { jsxs as y, jsx as _ } from "react/jsx-runtime";
|
|
2
|
+
import C from "react";
|
|
3
|
+
import { P as o } from "./index-Ds9PUTwb.js";
|
|
4
|
+
import { n as g } from "./emotion-styled.browser.esm-BZSYYThs.js";
|
|
5
|
+
import h from "./Icon.js";
|
|
6
|
+
import { b as x } from "./utils-DEke8iwo.js";
|
|
7
|
+
import { u as A } from "./emotion-element-5486c51c.browser.esm-CSejtOeT.js";
|
|
8
|
+
const N = {
|
|
9
|
+
small: "0.6rem 1rem",
|
|
10
|
+
medium: "0.8rem 1.25rem",
|
|
11
|
+
large: "1rem 1.5rem"
|
|
12
|
+
}, O = g.div`
|
|
13
|
+
display: flex;
|
|
14
|
+
justify-content: space-between;
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
color: ${(e) => x(
|
|
17
|
+
e.theme,
|
|
18
|
+
"Accordion",
|
|
19
|
+
"primary",
|
|
20
|
+
"enabled",
|
|
21
|
+
"summaryText"
|
|
22
|
+
)};
|
|
23
|
+
|
|
24
|
+
padding: ${(e) => N[e.size]};
|
|
25
|
+
& .accordion-icon-lnc {
|
|
26
|
+
transform: ${(e) => e.isExpanded ? "rotate(180deg)" : "rotate(0)"};
|
|
27
|
+
transition: transform 0.25s ease;
|
|
28
|
+
}
|
|
29
|
+
`, s = C.forwardRef((e, n) => {
|
|
30
|
+
const {
|
|
31
|
+
__TYPE__: R = "ACCORDION_SUMMARY",
|
|
32
|
+
disabled: a,
|
|
33
|
+
isExpanded: t,
|
|
34
|
+
onExpand: m,
|
|
35
|
+
onClick: i = () => {
|
|
36
|
+
},
|
|
37
|
+
size: c = "small",
|
|
38
|
+
className: l = "",
|
|
39
|
+
style: d = {},
|
|
40
|
+
children: p,
|
|
41
|
+
...f
|
|
42
|
+
} = e, u = { theme: A(), size: c, style: d, className: l };
|
|
43
|
+
return /* @__PURE__ */ y(
|
|
44
|
+
O,
|
|
45
|
+
{
|
|
46
|
+
ref: n,
|
|
47
|
+
...u,
|
|
48
|
+
onClick: (r) => {
|
|
49
|
+
a == !1 && m(r), i(r);
|
|
50
|
+
},
|
|
51
|
+
isExpanded: t,
|
|
52
|
+
...f,
|
|
53
|
+
children: [
|
|
54
|
+
p,
|
|
55
|
+
/* @__PURE__ */ _(
|
|
56
|
+
h,
|
|
57
|
+
{
|
|
58
|
+
icon: "angle-down",
|
|
59
|
+
sizeInUnits: "1.125rem",
|
|
60
|
+
className: "accordion-icon-lnc"
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
});
|
|
67
|
+
s.propTypes = {
|
|
68
|
+
__TYPE__: o.string,
|
|
69
|
+
onClick: o.func,
|
|
70
|
+
//---------------------------------------------------------------
|
|
71
|
+
className: o.string,
|
|
72
|
+
style: o.object,
|
|
73
|
+
size: o.oneOf(["small", "medium", "large"])
|
|
74
|
+
};
|
|
75
|
+
s.displayName = "ACCORDION_SUMMARY";
|
|
76
|
+
export {
|
|
77
|
+
s as default
|
|
78
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";const o=require("react/jsx-runtime"),$=require("react"),e=require("./index-DXnSjbfJ.cjs"),B=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),M=require("./DropdownMenu-B6qr13ik.cjs"),i=require("./DropdownItem.cjs"),V=require("./Separator.cjs"),y=require("./Button.cjs"),b=require("./utils-hdRGTsQ7.cjs"),Y=require("./ThemeProvider.cjs"),Z=B.newStyled.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
border-radius: 8px;
|
|
5
|
+
padding: 6px;
|
|
6
|
+
margin-bottom: 12px;
|
|
7
|
+
font-weight: 700;
|
|
8
|
+
font-size: 0.875rem;
|
|
9
|
+
color: rgba(15, 23, 42, 100%);
|
|
10
|
+
background-color: ${t=>b.getColorRgbaValue(t.theme,"Toolbar",t.color,"enabled","background","backgroundOpacity")};
|
|
11
|
+
border: ${t=>`1px solid ${b.getColorRgbaValue(t.theme,"Toolbar",t.color,"enabled","border","borderOpacity")}`};
|
|
12
|
+
gap: 6px;
|
|
13
|
+
justify-content: space-between;
|
|
14
|
+
& > div {
|
|
15
|
+
display: flex;
|
|
16
|
+
gap: 0.5rem;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
`,c=$.forwardRef((t,T)=>{const{__TYPE__:F="ACTIONS_TOOLBAR",showCreate:u=!0,enableCreate:x=!0,createText:d="Create new item",showEdit:m=!0,enableEditOnSelection:g=!0,editText:P="Edit",showDelete:w=!0,enableDeleteOnSelection:h=!0,deleteText:C="Delete",showCopy:f=!0,enableCopyOnSelection:O=!0,copyText:j="Copy",actionsText:S="Actions",customActions:a,selectedRowsLength:n=0,readOnly:s=!1,actionDropdownProps:D,actionsDropdownZIndex:_,actionsDropdownPlacement:q,onCreate:E=()=>{},onEdit:R=()=>{},onDelete:k=()=>{},onCopy:v=()=>{},className:A="",style:I={},color:l="primary",size:p="small",...N}=t,{theme:z}=Y.useTheme();return o.jsxs(Z,{ref:T,theme:z,color:l,className:`lnc-table-view-actions-toolbar ${A}`,style:I,...N,children:[o.jsx("div",{children:u&&s==!1&&o.jsx(y,{leadingIcon:"plus",btnType:"outline",type:"button",color:l,size:p,title:d,disabled:!x,onClick:E,text:d})}),o.jsx("div",{children:o.jsxs(M.DropdownMenu,{className:"lnc-table-view-actions-toolbar-dropdown",color:l,size:p,zIndex:_,placement:q,...D,control:o.jsx(y,{text:S,btnType:"outline",trailingIcon:"angle-down",color:l,size:p,type:"button"}),children:[f&&s==!1&&o.jsx(i,{icon:"copy",disabled:!(O&&n>0),onClick:v,children:j}),m&&s==!1&&o.jsx(i,{icon:"pen",disabled:!(g&&n>0),onClick:R,children:P}),w&&s==!1&&o.jsx(i,{icon:"trash",disabled:!(h&&n>0),onClick:k,children:C}),o.jsx(V,{}),a==null?void 0:a.map((r,L)=>{if((r==null?void 0:r.show)!=!1)return o.jsx(i,{icon:r.icon,disabled:!(r.enableOnSelection==!0&&n>0||r.enable==!0&&r.enableOnSelection==!1),onClick:r.onAction,children:r.name},L)})]})})]})});c.propTypes={__TYPE__:e.PropTypes.string,showCreate:e.PropTypes.bool,enableCreate:e.PropTypes.bool,createText:e.PropTypes.string,showEdit:e.PropTypes.bool,enableEditOnSelection:e.PropTypes.bool,editText:e.PropTypes.string,showDelete:e.PropTypes.bool,enableDeleteOnSelection:e.PropTypes.bool,deleteText:e.PropTypes.string,showCopy:e.PropTypes.bool,enableCopyOnSelection:e.PropTypes.bool,copyText:e.PropTypes.string,actionsText:e.PropTypes.string,customActions:e.PropTypes.array,selectedRowsLength:e.PropTypes.number,readOnly:e.PropTypes.bool,onCreate:e.PropTypes.func,onEdit:e.PropTypes.func,onDelete:e.PropTypes.func,onCopy:e.PropTypes.func,className:e.PropTypes.string,style:e.PropTypes.object,size:e.PropTypes.oneOf(["small","medium","large"]),color:e.PropTypes.oneOf(["primary","secondary","success","danger","warning","information","neutral","gray"])};c.displayName="ACTIONS_TOOLBAR";module.exports=c;
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { jsxs as p, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import Y from "react";
|
|
3
|
+
import { P as e } from "./index-Ds9PUTwb.js";
|
|
4
|
+
import { n as M } from "./emotion-styled.browser.esm-BZSYYThs.js";
|
|
5
|
+
import { D as V } from "./DropdownMenu-DZi3TJ8Q.js";
|
|
6
|
+
import i from "./DropdownItem.js";
|
|
7
|
+
import Z from "./Separator.js";
|
|
8
|
+
import b from "./Button.js";
|
|
9
|
+
import { b as m } from "./utils-DEke8iwo.js";
|
|
10
|
+
import { useTheme as q } from "./ThemeProvider.js";
|
|
11
|
+
const F = M.div`
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
border-radius: 8px;
|
|
15
|
+
padding: 6px;
|
|
16
|
+
margin-bottom: 12px;
|
|
17
|
+
font-weight: 700;
|
|
18
|
+
font-size: 0.875rem;
|
|
19
|
+
color: rgba(15, 23, 42, 100%);
|
|
20
|
+
background-color: ${(n) => m(
|
|
21
|
+
n.theme,
|
|
22
|
+
"Toolbar",
|
|
23
|
+
n.color,
|
|
24
|
+
"enabled",
|
|
25
|
+
"background",
|
|
26
|
+
"backgroundOpacity"
|
|
27
|
+
)};
|
|
28
|
+
border: ${(n) => `1px solid ${m(
|
|
29
|
+
n.theme,
|
|
30
|
+
"Toolbar",
|
|
31
|
+
n.color,
|
|
32
|
+
"enabled",
|
|
33
|
+
"border",
|
|
34
|
+
"borderOpacity"
|
|
35
|
+
)}`};
|
|
36
|
+
gap: 6px;
|
|
37
|
+
justify-content: space-between;
|
|
38
|
+
& > div {
|
|
39
|
+
display: flex;
|
|
40
|
+
gap: 0.5rem;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
`, u = Y.forwardRef((n, f) => {
|
|
44
|
+
const {
|
|
45
|
+
__TYPE__: G = "ACTIONS_TOOLBAR",
|
|
46
|
+
showCreate: y = !0,
|
|
47
|
+
enableCreate: g = !0,
|
|
48
|
+
createText: c = "Create new item",
|
|
49
|
+
showEdit: w = !0,
|
|
50
|
+
enableEditOnSelection: h = !0,
|
|
51
|
+
editText: T = "Edit",
|
|
52
|
+
showDelete: x = !0,
|
|
53
|
+
enableDeleteOnSelection: C = !0,
|
|
54
|
+
deleteText: O = "Delete",
|
|
55
|
+
showCopy: D = !0,
|
|
56
|
+
enableCopyOnSelection: S = !0,
|
|
57
|
+
copyText: _ = "Copy",
|
|
58
|
+
actionsText: E = "Actions",
|
|
59
|
+
customActions: s,
|
|
60
|
+
selectedRowsLength: r = 0,
|
|
61
|
+
readOnly: l = !1,
|
|
62
|
+
actionDropdownProps: k,
|
|
63
|
+
actionsDropdownZIndex: A,
|
|
64
|
+
actionsDropdownPlacement: I,
|
|
65
|
+
//----------------
|
|
66
|
+
onCreate: N = () => {
|
|
67
|
+
},
|
|
68
|
+
onEdit: R = () => {
|
|
69
|
+
},
|
|
70
|
+
onDelete: v = () => {
|
|
71
|
+
},
|
|
72
|
+
onCopy: P = () => {
|
|
73
|
+
},
|
|
74
|
+
className: j = "",
|
|
75
|
+
style: z = {},
|
|
76
|
+
color: a = "primary",
|
|
77
|
+
size: d = "small",
|
|
78
|
+
...L
|
|
79
|
+
} = n, { theme: $ } = q();
|
|
80
|
+
return /* @__PURE__ */ p(
|
|
81
|
+
F,
|
|
82
|
+
{
|
|
83
|
+
ref: f,
|
|
84
|
+
theme: $,
|
|
85
|
+
color: a,
|
|
86
|
+
className: `lnc-table-view-actions-toolbar ${j}`,
|
|
87
|
+
style: z,
|
|
88
|
+
...L,
|
|
89
|
+
children: [
|
|
90
|
+
/* @__PURE__ */ t("div", { children: y && l == !1 && /* @__PURE__ */ t(
|
|
91
|
+
b,
|
|
92
|
+
{
|
|
93
|
+
leadingIcon: "plus",
|
|
94
|
+
btnType: "outline",
|
|
95
|
+
type: "button",
|
|
96
|
+
color: a,
|
|
97
|
+
size: d,
|
|
98
|
+
title: c,
|
|
99
|
+
disabled: !g,
|
|
100
|
+
onClick: N,
|
|
101
|
+
text: c
|
|
102
|
+
}
|
|
103
|
+
) }),
|
|
104
|
+
/* @__PURE__ */ t("div", { children: /* @__PURE__ */ p(
|
|
105
|
+
V,
|
|
106
|
+
{
|
|
107
|
+
className: "lnc-table-view-actions-toolbar-dropdown",
|
|
108
|
+
color: a,
|
|
109
|
+
size: d,
|
|
110
|
+
zIndex: A,
|
|
111
|
+
placement: I,
|
|
112
|
+
...k,
|
|
113
|
+
control: /* @__PURE__ */ t(
|
|
114
|
+
b,
|
|
115
|
+
{
|
|
116
|
+
text: E,
|
|
117
|
+
btnType: "outline",
|
|
118
|
+
trailingIcon: "angle-down",
|
|
119
|
+
color: a,
|
|
120
|
+
size: d,
|
|
121
|
+
type: "button"
|
|
122
|
+
}
|
|
123
|
+
),
|
|
124
|
+
children: [
|
|
125
|
+
D && l == !1 && /* @__PURE__ */ t(
|
|
126
|
+
i,
|
|
127
|
+
{
|
|
128
|
+
icon: "copy",
|
|
129
|
+
disabled: !(S && r > 0),
|
|
130
|
+
onClick: P,
|
|
131
|
+
children: _
|
|
132
|
+
}
|
|
133
|
+
),
|
|
134
|
+
w && l == !1 && /* @__PURE__ */ t(
|
|
135
|
+
i,
|
|
136
|
+
{
|
|
137
|
+
icon: "pen",
|
|
138
|
+
disabled: !(h && r > 0),
|
|
139
|
+
onClick: R,
|
|
140
|
+
children: T
|
|
141
|
+
}
|
|
142
|
+
),
|
|
143
|
+
x && l == !1 && /* @__PURE__ */ t(
|
|
144
|
+
i,
|
|
145
|
+
{
|
|
146
|
+
icon: "trash",
|
|
147
|
+
disabled: !(C && r > 0),
|
|
148
|
+
onClick: v,
|
|
149
|
+
children: O
|
|
150
|
+
}
|
|
151
|
+
),
|
|
152
|
+
/* @__PURE__ */ t(Z, {}),
|
|
153
|
+
s == null ? void 0 : s.map((o, B) => {
|
|
154
|
+
if ((o == null ? void 0 : o.show) != !1)
|
|
155
|
+
return /* @__PURE__ */ t(
|
|
156
|
+
i,
|
|
157
|
+
{
|
|
158
|
+
icon: o.icon,
|
|
159
|
+
disabled: !(o.enableOnSelection == !0 && r > 0 || o.enable == !0 && o.enableOnSelection == !1),
|
|
160
|
+
onClick: o.onAction,
|
|
161
|
+
children: o.name
|
|
162
|
+
},
|
|
163
|
+
B
|
|
164
|
+
);
|
|
165
|
+
})
|
|
166
|
+
]
|
|
167
|
+
}
|
|
168
|
+
) })
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
);
|
|
172
|
+
});
|
|
173
|
+
u.propTypes = {
|
|
174
|
+
/**
|
|
175
|
+
* This property determines where the component is rendered.
|
|
176
|
+
* Should not be overridden!
|
|
177
|
+
*/
|
|
178
|
+
__TYPE__: e.string,
|
|
179
|
+
showCreate: e.bool,
|
|
180
|
+
enableCreate: e.bool,
|
|
181
|
+
createText: e.string,
|
|
182
|
+
showEdit: e.bool,
|
|
183
|
+
enableEditOnSelection: e.bool,
|
|
184
|
+
editText: e.string,
|
|
185
|
+
showDelete: e.bool,
|
|
186
|
+
enableDeleteOnSelection: e.bool,
|
|
187
|
+
deleteText: e.string,
|
|
188
|
+
showCopy: e.bool,
|
|
189
|
+
enableCopyOnSelection: e.bool,
|
|
190
|
+
copyText: e.string,
|
|
191
|
+
actionsText: e.string,
|
|
192
|
+
/**
|
|
193
|
+
* Actions that will be shown in toolbar with existing actions
|
|
194
|
+
* customActions=[{name: `<string>`, show: `<bool>`, enable: `<bool>`, enableOnSelection: `<bool>`, onAction: `PropTypes.func`}, ...]
|
|
195
|
+
*/
|
|
196
|
+
customActions: e.array,
|
|
197
|
+
selectedRowsLength: e.number,
|
|
198
|
+
/**
|
|
199
|
+
* If `readOnly={true}` actions Delete, Edit and Copy won't be shown.
|
|
200
|
+
*/
|
|
201
|
+
readOnly: e.bool,
|
|
202
|
+
//-------------------------------------------------------------
|
|
203
|
+
onCreate: e.func,
|
|
204
|
+
onEdit: e.func,
|
|
205
|
+
onDelete: e.func,
|
|
206
|
+
onCopy: e.func,
|
|
207
|
+
//------------------------------------------------------------
|
|
208
|
+
className: e.string,
|
|
209
|
+
style: e.object,
|
|
210
|
+
size: e.oneOf(["small", "medium", "large"]),
|
|
211
|
+
color: e.oneOf([
|
|
212
|
+
"primary",
|
|
213
|
+
"secondary",
|
|
214
|
+
"success",
|
|
215
|
+
"danger",
|
|
216
|
+
"warning",
|
|
217
|
+
"information",
|
|
218
|
+
"neutral",
|
|
219
|
+
"gray"
|
|
220
|
+
])
|
|
221
|
+
};
|
|
222
|
+
u.displayName = "ACTIONS_TOOLBAR";
|
|
223
|
+
export {
|
|
224
|
+
u as default
|
|
225
|
+
};
|
package/dist/Alert.cjs
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";const o=require("react/jsx-runtime"),c=require("react"),r=require("./index-DXnSjbfJ.cjs"),x=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),T=require("./ThemeProvider.cjs"),t=require("./utils-hdRGTsQ7.cjs"),s=require("./Icon.cjs"),P=x.newStyled.div`
|
|
2
|
+
min-height: 3rem;
|
|
3
|
+
${e=>t.getComponentTypographyCss(e.theme,"Alert",e.size,"enabled")};
|
|
4
|
+
line-height: 1.25rem;
|
|
5
|
+
border-radius: ${e=>t.getBorderRadiusValueWithUnits(e.theme,"regular")};
|
|
6
|
+
background-color: ${e=>t.getColorRgbaValue(e.theme,"Alert",e.color,"enabled","background","backgroundOpacity")};
|
|
7
|
+
color: ${e=>t.getColorRgbaValue(e.theme,"Alert",e.color,"enabled","text")};
|
|
8
|
+
word-wrap: break-word;
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
padding: 0.875rem 1rem;
|
|
11
|
+
display: flex;
|
|
12
|
+
gap: 1rem;
|
|
13
|
+
& .alert-content {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
gap: 0.25rem;
|
|
17
|
+
}
|
|
18
|
+
& .alert-icon {
|
|
19
|
+
align-items: flex-start;
|
|
20
|
+
& i {
|
|
21
|
+
font-size: 1.25rem;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
& .alert-title {
|
|
25
|
+
font-weight: ${e=>t.getComponentPropValue(e.theme,"Alert",e.color,"enabled","fontWeightTitle")};
|
|
26
|
+
color: ${e=>t.getColorRgbaValue(e.theme,"Alert",e.color,"enabled","title")};
|
|
27
|
+
}
|
|
28
|
+
& .alert-actions {
|
|
29
|
+
display: ${e=>e.actions?"flex":"none"};
|
|
30
|
+
flex-wrap: wrap;
|
|
31
|
+
gap: 1rem;
|
|
32
|
+
padding-top: 0.5rem;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
& .alert-actions > * {
|
|
36
|
+
font-weight: ${e=>t.getComponentPropValue(e.theme,"Alert",e.color,"enabled","fontWeightAction")};
|
|
37
|
+
color: ${e=>t.getColorRgbaValue(e.theme,"Alert",e.color,"enabled","action")};
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
}
|
|
40
|
+
`,w=e=>e=="danger"?"times-circle":e=="warning"?"exclamation-triangle":e=="success"?"check-circle":"exclamation-circle",C=({statusIcon:e,color:n})=>typeof e=="boolean"&&e==!0?o.jsx(s,{className:"alert-icon",icon:w(n)}):typeof e=="string"&&e!==""?o.jsx(s,{className:"alert-icon",icon:e}):c.cloneElement(e,{className:"alert-icon "+(e==null?void 0:e.className)}),m=c.forwardRef((e,n)=>{const{className:d="",size:p="small",color:l="primary",title:g,actions:i,noIcon:u=!1,statusIcon:a=!0,children:y,...h}=e,{theme:f}=T.useTheme(),b={theme:f,size:p,color:l};return o.jsxs(P,{ref:n,...b,className:"lnc-ui-alert "+d,actions:i,...h,children:[u==!1&&a&&o.jsx(C,{color:l,statusIcon:a}),o.jsxs("div",{className:"alert-content",children:[o.jsx("div",{className:"alert-title",children:g}),y,o.jsx("div",{className:"alert-actions",children:i})]})]})});m.propTypes={title:r.PropTypes.oneOfType([r.PropTypes.string,r.PropTypes.element]),actions:r.PropTypes.element,statusIcon:r.PropTypes.oneOfType([r.PropTypes.string,r.PropTypes.element,r.PropTypes.bool]),noIcon:r.PropTypes.bool,className:r.PropTypes.string,size:r.PropTypes.oneOf(["small","medium","large"]),color:r.PropTypes.oneOf(["primary","secondary","success","danger","warning","information","neutral","gray"])};module.exports=m;
|
package/dist/Alert.js
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { jsxs as c, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import d from "react";
|
|
3
|
+
import { P as r } from "./index-Ds9PUTwb.js";
|
|
4
|
+
import { n as x } from "./emotion-styled.browser.esm-BZSYYThs.js";
|
|
5
|
+
import { useTheme as w } from "./ThemeProvider.js";
|
|
6
|
+
import { a as N, c as A, b as o, d as m } from "./utils-DEke8iwo.js";
|
|
7
|
+
import s from "./Icon.js";
|
|
8
|
+
const $ = x.div`
|
|
9
|
+
min-height: 3rem;
|
|
10
|
+
${(e) => N(e.theme, "Alert", e.size, "enabled")};
|
|
11
|
+
line-height: 1.25rem;
|
|
12
|
+
border-radius: ${(e) => A(e.theme, "regular")};
|
|
13
|
+
background-color: ${(e) => o(
|
|
14
|
+
e.theme,
|
|
15
|
+
"Alert",
|
|
16
|
+
e.color,
|
|
17
|
+
"enabled",
|
|
18
|
+
"background",
|
|
19
|
+
"backgroundOpacity"
|
|
20
|
+
)};
|
|
21
|
+
color: ${(e) => o(e.theme, "Alert", e.color, "enabled", "text")};
|
|
22
|
+
word-wrap: break-word;
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
padding: 0.875rem 1rem;
|
|
25
|
+
display: flex;
|
|
26
|
+
gap: 1rem;
|
|
27
|
+
& .alert-content {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
gap: 0.25rem;
|
|
31
|
+
}
|
|
32
|
+
& .alert-icon {
|
|
33
|
+
align-items: flex-start;
|
|
34
|
+
& i {
|
|
35
|
+
font-size: 1.25rem;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
& .alert-title {
|
|
39
|
+
font-weight: ${(e) => m(
|
|
40
|
+
e.theme,
|
|
41
|
+
"Alert",
|
|
42
|
+
e.color,
|
|
43
|
+
"enabled",
|
|
44
|
+
"fontWeightTitle"
|
|
45
|
+
)};
|
|
46
|
+
color: ${(e) => o(e.theme, "Alert", e.color, "enabled", "title")};
|
|
47
|
+
}
|
|
48
|
+
& .alert-actions {
|
|
49
|
+
display: ${(e) => e.actions ? "flex" : "none"};
|
|
50
|
+
flex-wrap: wrap;
|
|
51
|
+
gap: 1rem;
|
|
52
|
+
padding-top: 0.5rem;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
& .alert-actions > * {
|
|
56
|
+
font-weight: ${(e) => m(
|
|
57
|
+
e.theme,
|
|
58
|
+
"Alert",
|
|
59
|
+
e.color,
|
|
60
|
+
"enabled",
|
|
61
|
+
"fontWeightAction"
|
|
62
|
+
)};
|
|
63
|
+
color: ${(e) => o(
|
|
64
|
+
e.theme,
|
|
65
|
+
"Alert",
|
|
66
|
+
e.color,
|
|
67
|
+
"enabled",
|
|
68
|
+
"action"
|
|
69
|
+
)};
|
|
70
|
+
cursor: pointer;
|
|
71
|
+
}
|
|
72
|
+
`, T = (e) => e == "danger" ? "times-circle" : e == "warning" ? "exclamation-triangle" : e == "success" ? "check-circle" : "exclamation-circle", C = ({ statusIcon: e, color: n }) => typeof e == "boolean" && e == !0 ? /* @__PURE__ */ t(s, { className: "alert-icon", icon: T(n) }) : typeof e == "string" && e !== "" ? /* @__PURE__ */ t(s, { className: "alert-icon", icon: e }) : d.cloneElement(e, {
|
|
73
|
+
className: "alert-icon " + (e == null ? void 0 : e.className)
|
|
74
|
+
}), k = d.forwardRef((e, n) => {
|
|
75
|
+
const {
|
|
76
|
+
className: f = "",
|
|
77
|
+
size: g = "small",
|
|
78
|
+
color: l = "primary",
|
|
79
|
+
title: h,
|
|
80
|
+
actions: a,
|
|
81
|
+
noIcon: p = !1,
|
|
82
|
+
statusIcon: i = !0,
|
|
83
|
+
children: u,
|
|
84
|
+
...b
|
|
85
|
+
} = e, { theme: y } = w();
|
|
86
|
+
return /* @__PURE__ */ c(
|
|
87
|
+
$,
|
|
88
|
+
{
|
|
89
|
+
ref: n,
|
|
90
|
+
...{ theme: y, size: g, color: l },
|
|
91
|
+
className: "lnc-ui-alert " + f,
|
|
92
|
+
actions: a,
|
|
93
|
+
...b,
|
|
94
|
+
children: [
|
|
95
|
+
p == !1 && i && /* @__PURE__ */ t(C, { color: l, statusIcon: i }),
|
|
96
|
+
/* @__PURE__ */ c("div", { className: "alert-content", children: [
|
|
97
|
+
/* @__PURE__ */ t("div", { className: "alert-title", children: h }),
|
|
98
|
+
u,
|
|
99
|
+
/* @__PURE__ */ t("div", { className: "alert-actions", children: a })
|
|
100
|
+
] })
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
});
|
|
105
|
+
k.propTypes = {
|
|
106
|
+
title: r.oneOfType([r.string, r.element]),
|
|
107
|
+
actions: r.element,
|
|
108
|
+
/**
|
|
109
|
+
* Can be boolean (true - display default icon, false - don't display icon at all), string (display custom icon), element (display custom element as icon)
|
|
110
|
+
*/
|
|
111
|
+
statusIcon: r.oneOfType([
|
|
112
|
+
r.string,
|
|
113
|
+
r.element,
|
|
114
|
+
r.bool
|
|
115
|
+
]),
|
|
116
|
+
/**
|
|
117
|
+
* Disable display of status icon
|
|
118
|
+
*/
|
|
119
|
+
noIcon: r.bool,
|
|
120
|
+
className: r.string,
|
|
121
|
+
size: r.oneOf(["small", "medium", "large"]),
|
|
122
|
+
/**
|
|
123
|
+
* When `status` is not defined color of alert can be defined with `color` prop
|
|
124
|
+
*/
|
|
125
|
+
color: r.oneOf([
|
|
126
|
+
"primary",
|
|
127
|
+
"secondary",
|
|
128
|
+
"success",
|
|
129
|
+
"danger",
|
|
130
|
+
"warning",
|
|
131
|
+
"information",
|
|
132
|
+
"neutral",
|
|
133
|
+
"gray"
|
|
134
|
+
])
|
|
135
|
+
};
|
|
136
|
+
export {
|
|
137
|
+
k as default
|
|
138
|
+
};
|
package/dist/Avatar.cjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),T=require("react"),i=require("./index-DXnSjbfJ.cjs"),I=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs");;/* empty css */const s=require("./utils-hdRGTsQ7.cjs"),P=require("./Icon.cjs"),f=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs"),x=I.newStyled.div`
|
|
2
|
+
border-radius: ${e=>s.getBorderRadiusValueWithUnits(e.theme,e.borderRadius)};
|
|
3
|
+
color: white;
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
align-items: center;
|
|
7
|
+
height: ${e=>e.sizeInUnits?e.sizeInUnits:s.getSizeValueWithUnits(e.theme,e.size)};
|
|
8
|
+
width: ${e=>e.sizeInUnits?e.sizeInUnits:s.getSizeValueWithUnits(e.theme,e.size)};
|
|
9
|
+
${e=>e.disabled===!0&&s.getDisabledStateCss(e.theme)};
|
|
10
|
+
background-color: ${e=>!e.disabled&&s.getColorRgbaValue(e.theme,"Chip",e.color,"enabled","text")};
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
& img {
|
|
13
|
+
height: ${e=>e.sizeInUnits?e.sizeInUnits:s.getSizeValueWithUnits(e.theme,e.size)};
|
|
14
|
+
width: ${e=>e.sizeInUnits?e.sizeInUnits:s.getSizeValueWithUnits(e.theme,e.size)};
|
|
15
|
+
}
|
|
16
|
+
`,a=T.forwardRef((e,l)=>{const{image:r,icon:c="user",tabIndex:w,sizeInUnits:t,disabled:q=!1,borderRadius:u="curved",onFocus:d=()=>{},onBlur:m=()=>{},onClick:g=()=>{},size:o="small",color:h="primary",className:y="",style:z={},...b}=e,U={theme:f.useTheme(),color:h,style:z,size:o,sizeInUnits:t,className:"lnc-ui-avatar "+y};return n.jsx(x,{ref:l,...U,borderRadius:u,onClick:g,onFocus:d,onBlur:m,...b,children:r?n.jsx("img",{src:r}):n.jsx(P,{icon:c,size:o,sizeInUnits:t?`calc(${t} / 2)`:null})})});a.propTypes={image:i.PropTypes.string,icon:i.PropTypes.string,tabIndex:i.PropTypes.number,sizeInUnits:i.PropTypes.string,disabled:i.PropTypes.bool,borderRadius:i.PropTypes.oneOf(["slight","regular","edged","curved","none"]),onBlur:i.PropTypes.func,onFocus:i.PropTypes.func,onClick:i.PropTypes.func,className:i.PropTypes.string,style:i.PropTypes.object,size:i.PropTypes.oneOf(["small","medium","large"]),color:i.PropTypes.oneOf(["primary","secondary","success","warning","danger","information","neutral","gray"])};module.exports=a;
|