@lanaco/lnc-react-ui 3.11.35 → 4.0.2
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
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";const i=require("react/jsx-runtime"),l=require("react"),r=require("./index-DXnSjbfJ.cjs"),m=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),u=require("./utils-hdRGTsQ7.cjs"),p=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs"),d=m.newStyled.div`
|
|
2
|
+
height: 1px;
|
|
3
|
+
background-color: ${e=>u.getColorRgbaValue(e.theme,"MenuItem","default","enabled","separator")};
|
|
4
|
+
margin-left: -0.25rem;
|
|
5
|
+
margin-right: -0.25rem;
|
|
6
|
+
`,t=l.forwardRef((e,s)=>{const{className:o="",style:n={},...a}=e,c=p.useTheme();return i.jsx(d,{ref:s,theme:c,className:"lnc-ui-dropdown-separator "+o,style:n,...a})});t.propTypes={className:r.PropTypes.string,style:r.PropTypes.object};module.exports=t;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import l from "react";
|
|
3
|
+
import { P as r } from "./index-Ds9PUTwb.js";
|
|
4
|
+
import { n } from "./emotion-styled.browser.esm-BZSYYThs.js";
|
|
5
|
+
import { b as i } from "./utils-DEke8iwo.js";
|
|
6
|
+
import { u as c } from "./emotion-element-5486c51c.browser.esm-CSejtOeT.js";
|
|
7
|
+
const f = n.div`
|
|
8
|
+
height: 1px;
|
|
9
|
+
background-color: ${(e) => i(
|
|
10
|
+
e.theme,
|
|
11
|
+
"MenuItem",
|
|
12
|
+
"default",
|
|
13
|
+
"enabled",
|
|
14
|
+
"separator"
|
|
15
|
+
)};
|
|
16
|
+
margin-left: -0.25rem;
|
|
17
|
+
margin-right: -0.25rem;
|
|
18
|
+
`, d = l.forwardRef((e, t) => {
|
|
19
|
+
const { className: o = "", style: a = {}, ...s } = e, m = c();
|
|
20
|
+
return /* @__PURE__ */ p(
|
|
21
|
+
f,
|
|
22
|
+
{
|
|
23
|
+
ref: t,
|
|
24
|
+
theme: m,
|
|
25
|
+
className: "lnc-ui-dropdown-separator " + o,
|
|
26
|
+
style: a,
|
|
27
|
+
...s
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
});
|
|
31
|
+
d.propTypes = {
|
|
32
|
+
className: r.string,
|
|
33
|
+
style: r.object
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
d as default
|
|
37
|
+
};
|
package/dist/Sidebar.cjs
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),a=require("react"),i=require("./index-DXnSjbfJ.cjs"),l=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),x=require("./Icon.cjs"),g=require("./utils-hdRGTsQ7.cjs"),y=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs"),_=l.newStyled.aside`
|
|
2
|
+
direction: ${e=>e.placement=="right"?"rtl":"ltr"};
|
|
3
|
+
position: relative;
|
|
4
|
+
&& {
|
|
5
|
+
flex: ${e=>e.sidebarCollapsed?"0 0 0":`0 0 ${e.size}`};
|
|
6
|
+
}
|
|
7
|
+
transition: flex 0.6s ease-in-out;
|
|
8
|
+
}
|
|
9
|
+
`,C=l.newStyled.div`
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
width: ${e=>e.sidebarCollapsed?"0":e.size};
|
|
12
|
+
height: 100%;
|
|
13
|
+
transition: width 0.6s ease-in-out
|
|
14
|
+
${e=>e.sidebarCollapsed?"0s":"0.2s"};
|
|
15
|
+
`,w=l.newStyled.div`
|
|
16
|
+
display: flex;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
align-items: center;
|
|
19
|
+
width: 2rem;
|
|
20
|
+
height: 2rem;
|
|
21
|
+
background-color: ${e=>e.theme.palette[e.theme.colorContext.neutral][900]};
|
|
22
|
+
opacity: 0.7;
|
|
23
|
+
border-radius: ${e=>e.placement=="left"?"0 5px 5px 0":"5px 0 0 5px"};
|
|
24
|
+
position: absolute;
|
|
25
|
+
top: 5px;
|
|
26
|
+
right: ${e=>e.placement=="left"?"-2rem":"100%"};
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
|
|
29
|
+
&:hover {
|
|
30
|
+
opacity: 1;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
& > span {
|
|
34
|
+
& > .sidebar-icon-lnc {
|
|
35
|
+
transform: ${e=>e.sidebarCollapsed?"rotate(180deg)":"rotate(0)"};
|
|
36
|
+
transition: transform 0.6s ease;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
`,c=a.forwardRef((e,b)=>{const{placement:o,collapsed:n=void 0,hideCollapseButton:h=!1,size:d="15rem",children:f,className:p,__TYPE__:T="Sidebar",...S}=e,u=y.useTheme(),m=g.useScreenSize(),[s,r]=a.useState();return a.useEffect(()=>{n!=null?r(n):m=="XS"||m=="S"?r(!0):r(!1)},[n]),t.jsxs(_,{className:"lnc-sidebar-container "+(p||""),sidebarCollapsed:s,placement:o,size:d,theme:u,ref:b,...S,children:[!h&&t.jsx(w,{onClick:$=>r(!s),placement:o,sidebarCollapsed:s,theme:u,children:t.jsx("span",{children:t.jsx(x,{className:"sidebar-icon-lnc",icon:o=="right"?"angle-right":"angle-left",color:"neutral"})})}),t.jsx(C,{className:"lnc-sidebar-content",sidebarCollapsed:s,size:d,children:f})]})});c.propTypes={collapsed:i.PropTypes.bool,hideCollapseButton:i.PropTypes.bool,size:i.PropTypes.string,__TYPE__:i.PropTypes.string};c.displayName="Sidebar";module.exports=c;
|
package/dist/Sidebar.js
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { jsxs as g, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import S, { useState as x, useEffect as C } from "react";
|
|
3
|
+
import { P as s } from "./index-Ds9PUTwb.js";
|
|
4
|
+
import { n as l } from "./emotion-styled.browser.esm-BZSYYThs.js";
|
|
5
|
+
import _ from "./Icon.js";
|
|
6
|
+
import { u as y } from "./utils-DEke8iwo.js";
|
|
7
|
+
import { u as $ } from "./emotion-element-5486c51c.browser.esm-CSejtOeT.js";
|
|
8
|
+
const v = l.aside`
|
|
9
|
+
direction: ${(e) => e.placement == "right" ? "rtl" : "ltr"};
|
|
10
|
+
position: relative;
|
|
11
|
+
&& {
|
|
12
|
+
flex: ${(e) => e.sidebarCollapsed ? "0 0 0" : `0 0 ${e.size}`};
|
|
13
|
+
}
|
|
14
|
+
transition: flex 0.6s ease-in-out;
|
|
15
|
+
}
|
|
16
|
+
`, w = l.div`
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
width: ${(e) => e.sidebarCollapsed ? "0" : e.size};
|
|
19
|
+
height: 100%;
|
|
20
|
+
transition: width 0.6s ease-in-out
|
|
21
|
+
${(e) => e.sidebarCollapsed ? "0s" : "0.2s"};
|
|
22
|
+
`, z = l.div`
|
|
23
|
+
display: flex;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
align-items: center;
|
|
26
|
+
width: 2rem;
|
|
27
|
+
height: 2rem;
|
|
28
|
+
background-color: ${(e) => e.theme.palette[e.theme.colorContext.neutral][900]};
|
|
29
|
+
opacity: 0.7;
|
|
30
|
+
border-radius: ${(e) => e.placement == "left" ? "0 5px 5px 0" : "5px 0 0 5px"};
|
|
31
|
+
position: absolute;
|
|
32
|
+
top: 5px;
|
|
33
|
+
right: ${(e) => e.placement == "left" ? "-2rem" : "100%"};
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
|
|
36
|
+
&:hover {
|
|
37
|
+
opacity: 1;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
& > span {
|
|
41
|
+
& > .sidebar-icon-lnc {
|
|
42
|
+
transform: ${(e) => e.sidebarCollapsed ? "rotate(180deg)" : "rotate(0)"};
|
|
43
|
+
transition: transform 0.6s ease;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
`, m = S.forwardRef((e, f) => {
|
|
47
|
+
const {
|
|
48
|
+
placement: r,
|
|
49
|
+
collapsed: a = void 0,
|
|
50
|
+
hideCollapseButton: h = !1,
|
|
51
|
+
size: n = "15rem",
|
|
52
|
+
children: u,
|
|
53
|
+
className: d,
|
|
54
|
+
__TYPE__: T = "Sidebar",
|
|
55
|
+
...b
|
|
56
|
+
} = e, c = $(), p = y(), [t, i] = x();
|
|
57
|
+
return C(() => {
|
|
58
|
+
a != null ? i(a) : p == "XS" || p == "S" ? i(!0) : i(!1);
|
|
59
|
+
}, [a]), /* @__PURE__ */ g(
|
|
60
|
+
v,
|
|
61
|
+
{
|
|
62
|
+
className: "lnc-sidebar-container " + (d || ""),
|
|
63
|
+
sidebarCollapsed: t,
|
|
64
|
+
placement: r,
|
|
65
|
+
size: n,
|
|
66
|
+
theme: c,
|
|
67
|
+
ref: f,
|
|
68
|
+
...b,
|
|
69
|
+
children: [
|
|
70
|
+
!h && /* @__PURE__ */ o(
|
|
71
|
+
z,
|
|
72
|
+
{
|
|
73
|
+
onClick: (N) => i(!t),
|
|
74
|
+
placement: r,
|
|
75
|
+
sidebarCollapsed: t,
|
|
76
|
+
theme: c,
|
|
77
|
+
children: /* @__PURE__ */ o("span", { children: /* @__PURE__ */ o(
|
|
78
|
+
_,
|
|
79
|
+
{
|
|
80
|
+
className: "sidebar-icon-lnc",
|
|
81
|
+
icon: r == "right" ? "angle-right" : "angle-left",
|
|
82
|
+
color: "neutral"
|
|
83
|
+
}
|
|
84
|
+
) })
|
|
85
|
+
}
|
|
86
|
+
),
|
|
87
|
+
/* @__PURE__ */ o(
|
|
88
|
+
w,
|
|
89
|
+
{
|
|
90
|
+
className: "lnc-sidebar-content",
|
|
91
|
+
sidebarCollapsed: t,
|
|
92
|
+
size: n,
|
|
93
|
+
children: u
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
});
|
|
100
|
+
m.propTypes = {
|
|
101
|
+
/**
|
|
102
|
+
* Indicates if the sidebar is collapsed.
|
|
103
|
+
*/
|
|
104
|
+
collapsed: s.bool,
|
|
105
|
+
/**
|
|
106
|
+
* Hides the collapse button.
|
|
107
|
+
* Useful if you want control the sidebar with your own button via `collapsed` prop.
|
|
108
|
+
*/
|
|
109
|
+
hideCollapseButton: s.bool,
|
|
110
|
+
/**
|
|
111
|
+
* Controls the sidebar width.
|
|
112
|
+
*/
|
|
113
|
+
size: s.string,
|
|
114
|
+
/**
|
|
115
|
+
* Do not override this property.
|
|
116
|
+
* Should only be used as indicator for type if you are passing custom component.
|
|
117
|
+
*/
|
|
118
|
+
__TYPE__: s.string
|
|
119
|
+
};
|
|
120
|
+
m.displayName = "Sidebar";
|
|
121
|
+
export {
|
|
122
|
+
m as default
|
|
123
|
+
};
|
package/dist/Spinner.cjs
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";const s=require("react/jsx-runtime");require("react");const n=require("./index-DXnSjbfJ.cjs"),i=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),u=require("./emotion-react.browser.esm-DQBL7Wls.cjs"),t=require("./utils-hdRGTsQ7.cjs"),g=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs"),p={small:"0.6rem",medium:"0.7rem",large:"0.8rem"},b=(e,r)=>{if(e==="small")return`
|
|
2
|
+
width: ${r.sizes.small};
|
|
3
|
+
height: ${r.sizes.small};
|
|
4
|
+
`;if(e==="medium")return`
|
|
5
|
+
width: ${r.sizes.medium};
|
|
6
|
+
height: ${r.sizes.medium};
|
|
7
|
+
`;if(e==="large")return`
|
|
8
|
+
width: ${r.sizes.large};
|
|
9
|
+
height: ${r.sizes.large};
|
|
10
|
+
`},h=u.keyframes`
|
|
11
|
+
to {
|
|
12
|
+
transform: rotate(360deg);
|
|
13
|
+
}
|
|
14
|
+
`,y=i.newStyled.div`
|
|
15
|
+
position: relative;
|
|
16
|
+
height: max-content;
|
|
17
|
+
width: max-content;
|
|
18
|
+
display: flex;
|
|
19
|
+
& .label-text {
|
|
20
|
+
display: ${e=>e.label?"unset":"none"};
|
|
21
|
+
position: absolute;
|
|
22
|
+
top: 50%;
|
|
23
|
+
left: 50%;
|
|
24
|
+
transform: translate(-50%, -50%);
|
|
25
|
+
${e=>t.getComponentTypographyCss(e.theme,"Spinner",e.size,"enabled")};
|
|
26
|
+
font-size: ${e=>p[e.size]};
|
|
27
|
+
color: ${e=>t.getColorRgbaValue(e.theme,"Spinner",e.color,"enabled","text")};
|
|
28
|
+
}
|
|
29
|
+
`,$=i.newStyled.div`
|
|
30
|
+
display: inline-block;
|
|
31
|
+
${e=>b(e.size,e.theme)}
|
|
32
|
+
border: ${e=>`0.3125rem solid ${t.getColorRgbaValue(e.theme,"Spinner",e.color,"enabled","unfilled")}`};
|
|
33
|
+
border-radius: 50%;
|
|
34
|
+
border-top-color: ${e=>t.getColorRgbaValue(e.theme,"Spinner",e.color,"enabled","background")};
|
|
35
|
+
border-right-color: ${e=>t.getColorRgbaValue(e.theme,"Spinner",e.color,"enabled","background")};
|
|
36
|
+
|
|
37
|
+
animation: ${h} 0.8s ease-in-out infinite;
|
|
38
|
+
`,l=e=>{const{label:r,className:a="",style:m={},size:c="small",color:d="primary"}=e,o={theme:g.useTheme(),size:c,color:d};return s.jsxs(y,{...o,className:"lnc-ui-spinner "+a,style:m,label:r,children:[s.jsx($,{...o}),s.jsx("div",{className:"label-text",children:r})]})};l.propTypes={label:n.PropTypes.string,className:n.PropTypes.string,style:n.PropTypes.object,size:n.PropTypes.oneOf(["small","medium","large"]),color:n.PropTypes.oneOf(["primary","secondary","success","danger","warning","information","neutral","gray"])};module.exports=l;
|
package/dist/Spinner.js
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { jsxs as c, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { P as i } from "./index-Ds9PUTwb.js";
|
|
4
|
+
import { n as s } from "./emotion-styled.browser.esm-BZSYYThs.js";
|
|
5
|
+
import { k as p } from "./emotion-react.browser.esm-OWM-uG8Q.js";
|
|
6
|
+
import { a as g, b as n } from "./utils-DEke8iwo.js";
|
|
7
|
+
import { u as h } from "./emotion-element-5486c51c.browser.esm-CSejtOeT.js";
|
|
8
|
+
const u = {
|
|
9
|
+
small: "0.6rem",
|
|
10
|
+
medium: "0.7rem",
|
|
11
|
+
large: "0.8rem"
|
|
12
|
+
}, b = (e, r) => {
|
|
13
|
+
if (e === "small")
|
|
14
|
+
return `
|
|
15
|
+
width: ${r.sizes.small};
|
|
16
|
+
height: ${r.sizes.small};
|
|
17
|
+
`;
|
|
18
|
+
if (e === "medium")
|
|
19
|
+
return `
|
|
20
|
+
width: ${r.sizes.medium};
|
|
21
|
+
height: ${r.sizes.medium};
|
|
22
|
+
`;
|
|
23
|
+
if (e === "large")
|
|
24
|
+
return `
|
|
25
|
+
width: ${r.sizes.large};
|
|
26
|
+
height: ${r.sizes.large};
|
|
27
|
+
`;
|
|
28
|
+
}, f = p`
|
|
29
|
+
to {
|
|
30
|
+
transform: rotate(360deg);
|
|
31
|
+
}
|
|
32
|
+
`, y = s.div`
|
|
33
|
+
position: relative;
|
|
34
|
+
height: max-content;
|
|
35
|
+
width: max-content;
|
|
36
|
+
display: flex;
|
|
37
|
+
& .label-text {
|
|
38
|
+
display: ${(e) => e.label ? "unset" : "none"};
|
|
39
|
+
position: absolute;
|
|
40
|
+
top: 50%;
|
|
41
|
+
left: 50%;
|
|
42
|
+
transform: translate(-50%, -50%);
|
|
43
|
+
${(e) => g(e.theme, "Spinner", e.size, "enabled")};
|
|
44
|
+
font-size: ${(e) => u[e.size]};
|
|
45
|
+
color: ${(e) => n(
|
|
46
|
+
e.theme,
|
|
47
|
+
"Spinner",
|
|
48
|
+
e.color,
|
|
49
|
+
"enabled",
|
|
50
|
+
"text"
|
|
51
|
+
)};
|
|
52
|
+
}
|
|
53
|
+
`, $ = s.div`
|
|
54
|
+
display: inline-block;
|
|
55
|
+
${(e) => b(e.size, e.theme)}
|
|
56
|
+
border: ${(e) => `0.3125rem solid ${n(
|
|
57
|
+
e.theme,
|
|
58
|
+
"Spinner",
|
|
59
|
+
e.color,
|
|
60
|
+
"enabled",
|
|
61
|
+
"unfilled"
|
|
62
|
+
)}`};
|
|
63
|
+
border-radius: 50%;
|
|
64
|
+
border-top-color: ${(e) => n(
|
|
65
|
+
e.theme,
|
|
66
|
+
"Spinner",
|
|
67
|
+
e.color,
|
|
68
|
+
"enabled",
|
|
69
|
+
"background"
|
|
70
|
+
)};
|
|
71
|
+
border-right-color: ${(e) => n(
|
|
72
|
+
e.theme,
|
|
73
|
+
"Spinner",
|
|
74
|
+
e.color,
|
|
75
|
+
"enabled",
|
|
76
|
+
"background"
|
|
77
|
+
)};
|
|
78
|
+
|
|
79
|
+
animation: ${f} 0.8s ease-in-out infinite;
|
|
80
|
+
`, z = (e) => {
|
|
81
|
+
const { label: r, className: a = "", style: l = {}, size: m = "small", color: d = "primary" } = e, t = { theme: h(), size: m, color: d };
|
|
82
|
+
return /* @__PURE__ */ c(
|
|
83
|
+
y,
|
|
84
|
+
{
|
|
85
|
+
...t,
|
|
86
|
+
className: "lnc-ui-spinner " + a,
|
|
87
|
+
style: l,
|
|
88
|
+
label: r,
|
|
89
|
+
children: [
|
|
90
|
+
/* @__PURE__ */ o($, { ...t }),
|
|
91
|
+
/* @__PURE__ */ o("div", { className: "label-text", children: r })
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
};
|
|
96
|
+
z.propTypes = {
|
|
97
|
+
label: i.string,
|
|
98
|
+
className: i.string,
|
|
99
|
+
style: i.object,
|
|
100
|
+
size: i.oneOf(["small", "medium", "large"]),
|
|
101
|
+
color: i.oneOf([
|
|
102
|
+
"primary",
|
|
103
|
+
"secondary",
|
|
104
|
+
"success",
|
|
105
|
+
"danger",
|
|
106
|
+
"warning",
|
|
107
|
+
"information",
|
|
108
|
+
"neutral",
|
|
109
|
+
"gray"
|
|
110
|
+
])
|
|
111
|
+
};
|
|
112
|
+
export {
|
|
113
|
+
z as default
|
|
114
|
+
};
|
package/dist/Surface.cjs
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";const x=require("react/jsx-runtime");require("react");const c=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),r=require("./index-DXnSjbfJ.cjs"),s=require("./utils-hdRGTsQ7.cjs"),p=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs"),g=c.newStyled.div`
|
|
2
|
+
padding: ${e=>e.padding};
|
|
3
|
+
box-shadow: ${e=>s.getBoxShadowValue(e.theme,e.boxShadow)};
|
|
4
|
+
border-radius: ${e=>s.getBorderRadiusValueWithUnits(e.theme,e.borderRadius)};
|
|
5
|
+
width: ${e=>e.fullWidth?"100%":"fit-content"};
|
|
6
|
+
border-top: 1px solid rgba(0, 0, 0, 0.04);
|
|
7
|
+
`,o=({children:e,style:t={},className:d="",boxShadow:i="s",borderRadius:n="regular",padding:l="s",fullWidth:a=!1})=>{const u=p.useTheme(),m={xs:"0.25rem",s:"0.5rem",m:"0.75rem",l:"1rem",xl:"1.25rem",xxl:"1.5rem"};return x.jsx(g,{theme:u,style:t,className:"lnc-ui-surface "+d,borderRadius:n,boxShadow:i,padding:m[l],fullWidth:a,children:e})};o.propTypes={borderRadius:r.PropTypes.oneOf(["slight","regular","edged","curved","none"]),boxShadow:r.PropTypes.oneOf(["xs","s","m","l","xl","xxl"]),paddign:r.PropTypes.oneOf(["xs","s","m","l","xl","xxl"]),fullWidth:r.PropTypes.bool,className:r.PropTypes.string,style:r.PropTypes.object};module.exports=o;
|
package/dist/Surface.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { n as x } from "./emotion-styled.browser.esm-BZSYYThs.js";
|
|
4
|
+
import { P as r } from "./index-Ds9PUTwb.js";
|
|
5
|
+
import { m as u, c as p } from "./utils-DEke8iwo.js";
|
|
6
|
+
import { u as f } from "./emotion-element-5486c51c.browser.esm-CSejtOeT.js";
|
|
7
|
+
const c = x.div`
|
|
8
|
+
padding: ${(e) => e.padding};
|
|
9
|
+
box-shadow: ${(e) => u(e.theme, e.boxShadow)};
|
|
10
|
+
border-radius: ${(e) => p(e.theme, e.borderRadius)};
|
|
11
|
+
width: ${(e) => e.fullWidth ? "100%" : "fit-content"};
|
|
12
|
+
border-top: 1px solid rgba(0, 0, 0, 0.04);
|
|
13
|
+
`, g = ({
|
|
14
|
+
children: e,
|
|
15
|
+
style: o = {},
|
|
16
|
+
className: s = "",
|
|
17
|
+
boxShadow: a = "s",
|
|
18
|
+
borderRadius: d = "regular",
|
|
19
|
+
padding: t = "s",
|
|
20
|
+
fullWidth: i = !1
|
|
21
|
+
}) => {
|
|
22
|
+
const l = f(), m = {
|
|
23
|
+
xs: "0.25rem",
|
|
24
|
+
s: "0.5rem",
|
|
25
|
+
m: "0.75rem",
|
|
26
|
+
l: "1rem",
|
|
27
|
+
xl: "1.25rem",
|
|
28
|
+
xxl: "1.5rem"
|
|
29
|
+
};
|
|
30
|
+
return /* @__PURE__ */ n(
|
|
31
|
+
c,
|
|
32
|
+
{
|
|
33
|
+
theme: l,
|
|
34
|
+
style: o,
|
|
35
|
+
className: "lnc-ui-surface " + s,
|
|
36
|
+
borderRadius: d,
|
|
37
|
+
boxShadow: a,
|
|
38
|
+
padding: m[t],
|
|
39
|
+
fullWidth: i,
|
|
40
|
+
children: e
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
g.propTypes = {
|
|
45
|
+
borderRadius: r.oneOf([
|
|
46
|
+
"slight",
|
|
47
|
+
"regular",
|
|
48
|
+
"edged",
|
|
49
|
+
"curved",
|
|
50
|
+
"none"
|
|
51
|
+
]),
|
|
52
|
+
boxShadow: r.oneOf(["xs", "s", "m", "l", "xl", "xxl"]),
|
|
53
|
+
paddign: r.oneOf(["xs", "s", "m", "l", "xl", "xxl"]),
|
|
54
|
+
fullWidth: r.bool,
|
|
55
|
+
className: r.string,
|
|
56
|
+
style: r.object
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
g as default
|
|
60
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";const g=require("react/jsx-runtime"),u=require("react"),t=require("./index-DXnSjbfJ.cjs"),v=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),y=require("./utils-hdRGTsQ7.cjs"),V=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs"),X=(e,o,n,c,a)=>{if(e==="right"||e==="left"||o&&n)return"height: 100%;";if(!(o&&a===!0))return o?"height: "+c+";":"height: 0;"},Y=(e,o,n,c,a)=>{if(e==="top"||e==="bottom"||o&&n)return"width: 100%;";if(!(o&&a===!0))return o?"width: "+c+";":"width: 0;"},A=v.newStyled.div`
|
|
2
|
+
touch-action: none;
|
|
3
|
+
overflow: auto;
|
|
4
|
+
max-height: ${e=>e.isOpen||e.unsetHeight===!1?"100dvh":0};
|
|
5
|
+
${e=>X(e.direction,e.isOpen,e.isFullPage,e.drawerSize,e.unsetHeight)}
|
|
6
|
+
max-width: ${e=>e.isOpen||e.unsetWidth===!1?"100vw":0};
|
|
7
|
+
${e=>Y(e.direction,e.isOpen,e.isFullPage,e.drawerSize,e.unsetWidth)}
|
|
8
|
+
position: fixed;
|
|
9
|
+
z-index: ${e=>e.zIndex};
|
|
10
|
+
${e=>e.direction==="bottom"?"bottom: 0":"top: 0"};
|
|
11
|
+
${e=>e.direction==="right"?"right: 0":"left: 0"};
|
|
12
|
+
-webkit-transition: ${e=>`all ${e.duration}s`};
|
|
13
|
+
-moz-transition: ${e=>`all ${e.duration}s`};
|
|
14
|
+
-ms-transition: ${e=>`all ${e.duration}s`};
|
|
15
|
+
-o-transition: ${e=>`all ${e.duration}s`};
|
|
16
|
+
transition: ${e=>`all ${e.duration}s`};
|
|
17
|
+
padding: ${e=>e.isOpen===!0?"20px":0};
|
|
18
|
+
|
|
19
|
+
box-shadow: 0 0 10px 5px rgba(0, 0, 0, 0.1);
|
|
20
|
+
|
|
21
|
+
background-color: ${e=>y.getColorRgbaValue(e.theme,"Drawer",e.color,"enabled","background")};
|
|
22
|
+
color: ${e=>y.getColorRgbaValue(e.theme,"Drawer",e.color,"enabled","text")};
|
|
23
|
+
${e=>y.getComponentTypographyCss(e.theme,"Drawer",e.size,"enabled")};
|
|
24
|
+
`,B=v.newStyled.div`
|
|
25
|
+
z-index: ${e=>e.zIndex};
|
|
26
|
+
position: fixed;
|
|
27
|
+
top: 0;
|
|
28
|
+
left: 0;
|
|
29
|
+
|
|
30
|
+
height: ${e=>e.isOpen===!0&&e.enableOverlay===!0?"100dvh":0};
|
|
31
|
+
width: ${e=>e.isOpen===!0&&e.enableOverlay===!0?"100vw":0};
|
|
32
|
+
background-color: ${e=>e.overlayColor};
|
|
33
|
+
`,$=u.forwardRef((e,o)=>{const{direction:n="right",open:c=!1,duration:a=.8,enableOverlay:x=!0,zIndex:m=100,closeOnClickOutside:O=!0,closeOnSwipe:d=!0,isFullPage:P=!1,unsetHeight:S=!1,unsetWidth:z=!1,onClose:C=()=>{},onOpen:D=()=>{},className:k="",style:q={},color:H="neutral",overlayColor:I="rgba(123, 123, 123, 0.5)",size:j="small",drawerSize:E="12.5rem",children:F,...W}=e,M=V.useTheme(),i=u.useRef(),[p,b]=u.useState(!1);var h=null,f=null;function _(r){return r.touches||r.originalEvent.touches}function R(r){const l=_(r)[0];h=l.clientX,f=l.clientY}function L(r){if(!(!h||!f)){var l=r.touches[0].clientX,U=r.touches[0].clientY,w=h-l,T=f-U;Math.abs(w)>Math.abs(T)?w>0?d==!0&&n=="left"&&s():d==!0&&n=="right"&&s():T>0?d==!0&&n=="top"&&s():d==!0&&n=="bottom"&&s(),h=null,f=null}}u.useImperativeHandle(o,()=>({open(){N()},close(){s()},isOpen(){return p}}));const N=r=>{b(!0),D(r)},s=r=>{b(!1),C(r)};return u.useEffect(()=>{const r=l=>{i!=null&&i.current&&!(i!=null&&i.current.contains(l.target))&&O==!0&&s()};return document.addEventListener("click",r,!0),()=>{document.removeEventListener("click",r,!0)}},[]),g.jsx(g.Fragment,{children:g.jsx(B,{enableOverlay:x,overlayColor:I,isOpen:p,zIndex:m,children:g.jsx(A,{ref:i,zIndex:m,isOpen:p,direction:n,isFullPage:P,unsetHeight:S,unsetWidth:z,duration:a,color:H,theme:M,className:k,style:q,size:j,drawerSize:E,onTouchStart:R,onTouchMove:L,...W,children:F})})})});$.propTypes={direction:t.PropTypes.oneOf(["top","right","left","bottom"]),open:t.PropTypes.bool,duration:t.PropTypes.number,enableOverlay:t.PropTypes.bool,zIndex:t.PropTypes.number,closeOnClickOutside:t.PropTypes.bool,closeOnSwipe:t.PropTypes.bool,isFullPage:t.PropTypes.bool,unsetHeight:t.PropTypes.bool,unsetWidth:t.PropTypes.bool,onClose:t.PropTypes.func,onOpen:t.PropTypes.func,className:t.PropTypes.string,style:t.PropTypes.object,overlayColor:t.PropTypes.string,drawerSize:t.PropTypes.string,size:t.PropTypes.oneOf(["small","medium","large"]),color:t.PropTypes.oneOf(["primary","secondary","success","warning","danger","information","neutral","gray"])};module.exports=$;
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { jsx as g, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
+
import _, { useRef as R, useState as V, useImperativeHandle as q, useEffect as A } from "react";
|
|
3
|
+
import { P as t } from "./index-Ds9PUTwb.js";
|
|
4
|
+
import { n as y } from "./emotion-styled.browser.esm-BZSYYThs.js";
|
|
5
|
+
import { b as $, a as B } from "./utils-DEke8iwo.js";
|
|
6
|
+
import { u as G } from "./emotion-element-5486c51c.browser.esm-CSejtOeT.js";
|
|
7
|
+
const J = (e, r, o, u, s) => {
|
|
8
|
+
if (e === "right" || e === "left" || r && o) return "height: 100%;";
|
|
9
|
+
if (!(r && s === !0))
|
|
10
|
+
return r ? "height: " + u + ";" : "height: 0;";
|
|
11
|
+
}, K = (e, r, o, u, s) => {
|
|
12
|
+
if (e === "top" || e === "bottom" || r && o) return "width: 100%;";
|
|
13
|
+
if (!(r && s === !0))
|
|
14
|
+
return r ? "width: " + u + ";" : "width: 0;";
|
|
15
|
+
}, Q = y.div`
|
|
16
|
+
touch-action: none;
|
|
17
|
+
overflow: auto;
|
|
18
|
+
max-height: ${(e) => e.isOpen || e.unsetHeight === !1 ? "100dvh" : 0};
|
|
19
|
+
${(e) => J(
|
|
20
|
+
e.direction,
|
|
21
|
+
e.isOpen,
|
|
22
|
+
e.isFullPage,
|
|
23
|
+
e.drawerSize,
|
|
24
|
+
e.unsetHeight
|
|
25
|
+
)}
|
|
26
|
+
max-width: ${(e) => e.isOpen || e.unsetWidth === !1 ? "100vw" : 0};
|
|
27
|
+
${(e) => K(
|
|
28
|
+
e.direction,
|
|
29
|
+
e.isOpen,
|
|
30
|
+
e.isFullPage,
|
|
31
|
+
e.drawerSize,
|
|
32
|
+
e.unsetWidth
|
|
33
|
+
)}
|
|
34
|
+
position: fixed;
|
|
35
|
+
z-index: ${(e) => e.zIndex};
|
|
36
|
+
${(e) => e.direction === "bottom" ? "bottom: 0" : "top: 0"};
|
|
37
|
+
${(e) => e.direction === "right" ? "right: 0" : "left: 0"};
|
|
38
|
+
-webkit-transition: ${(e) => `all ${e.duration}s`};
|
|
39
|
+
-moz-transition: ${(e) => `all ${e.duration}s`};
|
|
40
|
+
-ms-transition: ${(e) => `all ${e.duration}s`};
|
|
41
|
+
-o-transition: ${(e) => `all ${e.duration}s`};
|
|
42
|
+
transition: ${(e) => `all ${e.duration}s`};
|
|
43
|
+
padding: ${(e) => e.isOpen === !0 ? "20px" : 0};
|
|
44
|
+
|
|
45
|
+
box-shadow: 0 0 10px 5px rgba(0, 0, 0, 0.1);
|
|
46
|
+
|
|
47
|
+
background-color: ${(e) => $(
|
|
48
|
+
e.theme,
|
|
49
|
+
"Drawer",
|
|
50
|
+
e.color,
|
|
51
|
+
"enabled",
|
|
52
|
+
"background"
|
|
53
|
+
)};
|
|
54
|
+
color: ${(e) => $(e.theme, "Drawer", e.color, "enabled", "text")};
|
|
55
|
+
${(e) => B(e.theme, "Drawer", e.size, "enabled")};
|
|
56
|
+
`, Z = y.div`
|
|
57
|
+
z-index: ${(e) => e.zIndex};
|
|
58
|
+
position: fixed;
|
|
59
|
+
top: 0;
|
|
60
|
+
left: 0;
|
|
61
|
+
|
|
62
|
+
height: ${(e) => e.isOpen === !0 && e.enableOverlay === !0 ? "100dvh" : 0};
|
|
63
|
+
width: ${(e) => e.isOpen === !0 && e.enableOverlay === !0 ? "100vw" : 0};
|
|
64
|
+
background-color: ${(e) => e.overlayColor};
|
|
65
|
+
`, ee = _.forwardRef((e, r) => {
|
|
66
|
+
const {
|
|
67
|
+
direction: o = "right",
|
|
68
|
+
open: u = !1,
|
|
69
|
+
duration: s = 0.8,
|
|
70
|
+
enableOverlay: O = !0,
|
|
71
|
+
zIndex: m = 100,
|
|
72
|
+
closeOnClickOutside: x = !0,
|
|
73
|
+
closeOnSwipe: c = !0,
|
|
74
|
+
isFullPage: p = !1,
|
|
75
|
+
unsetHeight: z = !1,
|
|
76
|
+
unsetWidth: S = !1,
|
|
77
|
+
//----------------
|
|
78
|
+
onClose: C = () => {
|
|
79
|
+
},
|
|
80
|
+
onOpen: D = () => {
|
|
81
|
+
},
|
|
82
|
+
//----------------
|
|
83
|
+
className: T = "",
|
|
84
|
+
style: k = {},
|
|
85
|
+
color: H = "neutral",
|
|
86
|
+
overlayColor: I = "rgba(123, 123, 123, 0.5)",
|
|
87
|
+
size: P = "small",
|
|
88
|
+
drawerSize: F = "12.5rem",
|
|
89
|
+
children: W,
|
|
90
|
+
...E
|
|
91
|
+
} = e, M = G(), i = R(), [f, b] = V(!1);
|
|
92
|
+
var d = null, h = null;
|
|
93
|
+
function j(n) {
|
|
94
|
+
return n.touches || n.originalEvent.touches;
|
|
95
|
+
}
|
|
96
|
+
function L(n) {
|
|
97
|
+
const a = j(n)[0];
|
|
98
|
+
d = a.clientX, h = a.clientY;
|
|
99
|
+
}
|
|
100
|
+
function N(n) {
|
|
101
|
+
if (!(!d || !h)) {
|
|
102
|
+
var a = n.touches[0].clientX, X = n.touches[0].clientY, w = d - a, v = h - X;
|
|
103
|
+
Math.abs(w) > Math.abs(v) ? w > 0 ? c == !0 && o == "left" && l() : c == !0 && o == "right" && l() : v > 0 ? c == !0 && o == "top" && l() : c == !0 && o == "bottom" && l(), d = null, h = null;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
q(r, () => ({
|
|
107
|
+
open() {
|
|
108
|
+
U();
|
|
109
|
+
},
|
|
110
|
+
close() {
|
|
111
|
+
l();
|
|
112
|
+
},
|
|
113
|
+
isOpen() {
|
|
114
|
+
return f;
|
|
115
|
+
}
|
|
116
|
+
}));
|
|
117
|
+
const U = (n) => {
|
|
118
|
+
b(!0), D(n);
|
|
119
|
+
}, l = (n) => {
|
|
120
|
+
b(!1), C(n);
|
|
121
|
+
};
|
|
122
|
+
return A(() => {
|
|
123
|
+
const n = (a) => {
|
|
124
|
+
i != null && i.current && !(i != null && i.current.contains(a.target)) && x == !0 && l();
|
|
125
|
+
};
|
|
126
|
+
return document.addEventListener("click", n, !0), () => {
|
|
127
|
+
document.removeEventListener("click", n, !0);
|
|
128
|
+
};
|
|
129
|
+
}, []), /* @__PURE__ */ g(Y, { children: /* @__PURE__ */ g(
|
|
130
|
+
Z,
|
|
131
|
+
{
|
|
132
|
+
enableOverlay: O,
|
|
133
|
+
overlayColor: I,
|
|
134
|
+
isOpen: f,
|
|
135
|
+
zIndex: m,
|
|
136
|
+
children: /* @__PURE__ */ g(
|
|
137
|
+
Q,
|
|
138
|
+
{
|
|
139
|
+
ref: i,
|
|
140
|
+
zIndex: m,
|
|
141
|
+
isOpen: f,
|
|
142
|
+
direction: o,
|
|
143
|
+
isFullPage: p,
|
|
144
|
+
unsetHeight: z,
|
|
145
|
+
unsetWidth: S,
|
|
146
|
+
duration: s,
|
|
147
|
+
color: H,
|
|
148
|
+
theme: M,
|
|
149
|
+
className: T,
|
|
150
|
+
style: k,
|
|
151
|
+
size: P,
|
|
152
|
+
drawerSize: F,
|
|
153
|
+
onTouchStart: L,
|
|
154
|
+
onTouchMove: N,
|
|
155
|
+
...E,
|
|
156
|
+
children: W
|
|
157
|
+
}
|
|
158
|
+
)
|
|
159
|
+
}
|
|
160
|
+
) });
|
|
161
|
+
});
|
|
162
|
+
ee.propTypes = {
|
|
163
|
+
direction: t.oneOf(["top", "right", "left", "bottom"]),
|
|
164
|
+
open: t.bool,
|
|
165
|
+
/**
|
|
166
|
+
* Duration of opening the drawer in ms
|
|
167
|
+
*/
|
|
168
|
+
duration: t.number,
|
|
169
|
+
/**
|
|
170
|
+
* Determines whether to show the overlay
|
|
171
|
+
*/
|
|
172
|
+
enableOverlay: t.bool,
|
|
173
|
+
/**
|
|
174
|
+
* z-index of Drawer
|
|
175
|
+
*/
|
|
176
|
+
zIndex: t.number,
|
|
177
|
+
closeOnClickOutside: t.bool,
|
|
178
|
+
closeOnSwipe: t.bool,
|
|
179
|
+
/**
|
|
180
|
+
* Determines whether drawer takes up the whole page
|
|
181
|
+
*/
|
|
182
|
+
isFullPage: t.bool,
|
|
183
|
+
unsetHeight: t.bool,
|
|
184
|
+
unsetWidth: t.bool,
|
|
185
|
+
//---------------------------------------------------------------
|
|
186
|
+
onClose: t.func,
|
|
187
|
+
onOpen: t.func,
|
|
188
|
+
//---------------------------------------------------------------
|
|
189
|
+
className: t.string,
|
|
190
|
+
style: t.object,
|
|
191
|
+
overlayColor: t.string,
|
|
192
|
+
/**
|
|
193
|
+
* Determines drawer's height or width depending on direction
|
|
194
|
+
*/
|
|
195
|
+
drawerSize: t.string,
|
|
196
|
+
/**
|
|
197
|
+
* Determines font size
|
|
198
|
+
*/
|
|
199
|
+
size: t.oneOf(["small", "medium", "large"]),
|
|
200
|
+
color: t.oneOf([
|
|
201
|
+
"primary",
|
|
202
|
+
"secondary",
|
|
203
|
+
"success",
|
|
204
|
+
"warning",
|
|
205
|
+
"danger",
|
|
206
|
+
"information",
|
|
207
|
+
"neutral",
|
|
208
|
+
"gray"
|
|
209
|
+
])
|
|
210
|
+
};
|
|
211
|
+
export {
|
|
212
|
+
ee as default
|
|
213
|
+
};
|