@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.
Files changed (218) hide show
  1. package/README.md +0 -3
  2. package/dist/Accordion.cjs +6 -0
  3. package/dist/Accordion.js +65 -0
  4. package/dist/AccordionDetails.cjs +7 -0
  5. package/dist/AccordionDetails.js +32 -0
  6. package/dist/AccordionSummary.cjs +12 -0
  7. package/dist/AccordionSummary.js +78 -0
  8. package/dist/ActionsToolbar.cjs +19 -0
  9. package/dist/ActionsToolbar.js +225 -0
  10. package/dist/Alert.cjs +40 -0
  11. package/dist/Alert.js +138 -0
  12. package/dist/Avatar.cjs +16 -0
  13. package/dist/Avatar.js +114 -0
  14. package/dist/Badge.cjs +17 -0
  15. package/dist/Badge.js +70 -0
  16. package/dist/Breadcrumbs.cjs +8 -0
  17. package/dist/Breadcrumbs.js +131 -0
  18. package/dist/Button.cjs +127 -0
  19. package/dist/Button.js +542 -0
  20. package/dist/ButtonGroup.cjs +44 -0
  21. package/dist/ButtonGroup.js +112 -0
  22. package/dist/CheckBoxInput.cjs +118 -0
  23. package/dist/CheckBoxInput.js +348 -0
  24. package/dist/Chip.cjs +27 -0
  25. package/dist/Chip.js +189 -0
  26. package/dist/ColorInput.cjs +60 -0
  27. package/dist/ColorInput.js +256 -0
  28. package/dist/ConfirmationForm.cjs +22 -0
  29. package/dist/ConfirmationForm.js +169 -0
  30. package/dist/Content.cjs +1 -0
  31. package/dist/Content.js +18 -0
  32. package/dist/CustomStyles-CqlCjTgU.cjs +8 -0
  33. package/dist/CustomStyles-nfD3J1mi.js +2881 -0
  34. package/dist/DataView.cjs +1 -0
  35. package/dist/DataView.js +62 -0
  36. package/dist/DateInput.cjs +296 -0
  37. package/dist/DateInput.js +7042 -0
  38. package/dist/DecimalInput.cjs +54 -0
  39. package/dist/DecimalInput.js +697 -0
  40. package/dist/DetailsView.cjs +18 -0
  41. package/dist/DetailsView.js +243 -0
  42. package/dist/DoubleRangeSlider.cjs +114 -0
  43. package/dist/DoubleRangeSlider.js +289 -0
  44. package/dist/DragAndDropFile.cjs +31 -0
  45. package/dist/DragAndDropFile.js +2331 -0
  46. package/dist/DragDropFiles.cjs +14 -0
  47. package/dist/DragDropFiles.js +175 -0
  48. package/dist/Drawer.cjs +6 -0
  49. package/dist/Drawer.js +206 -0
  50. package/dist/Dropdown.cjs +1 -0
  51. package/dist/Dropdown.js +266 -0
  52. package/dist/DropdownItem.cjs +36 -0
  53. package/dist/DropdownItem.js +241 -0
  54. package/dist/DropdownLookup.cjs +1 -0
  55. package/dist/DropdownLookup.js +325 -0
  56. package/dist/DropdownMenu-B6qr13ik.cjs +19 -0
  57. package/dist/DropdownMenu-DZi3TJ8Q.js +1547 -0
  58. package/dist/DropdownMenu.cjs +1 -0
  59. package/dist/DropdownMenu.js +12 -0
  60. package/dist/EditableTable.cjs +21 -0
  61. package/dist/EditableTable.js +462 -0
  62. package/dist/FileInput.cjs +47 -0
  63. package/dist/FileInput.js +206 -0
  64. package/dist/FlexBox.cjs +9 -0
  65. package/dist/FlexBox.js +97 -0
  66. package/dist/FlexGrid.cjs +1 -0
  67. package/dist/FlexGrid.js +78 -0
  68. package/dist/FlexGridItem.cjs +7 -0
  69. package/dist/FlexGridItem.js +97 -0
  70. package/dist/Footer.cjs +1 -0
  71. package/dist/Footer.js +18 -0
  72. package/dist/FormField.cjs +11 -0
  73. package/dist/FormField.js +65 -0
  74. package/dist/FormView.cjs +13 -0
  75. package/dist/FormView.js +354 -0
  76. package/dist/Grid.cjs +13 -0
  77. package/dist/Grid.js +62 -0
  78. package/dist/GridItem.cjs +15 -0
  79. package/dist/GridItem.js +72 -0
  80. package/dist/Header.cjs +1 -0
  81. package/dist/Header.js +18 -0
  82. package/dist/Icon.cjs +8 -0
  83. package/dist/Icon.js +59 -0
  84. package/dist/IconButton.cjs +122 -0
  85. package/dist/IconButton.js +481 -0
  86. package/dist/Kanban.cjs +85 -0
  87. package/dist/Kanban.js +4793 -0
  88. package/dist/KanbanActionsToolbar.cjs +19 -0
  89. package/dist/KanbanActionsToolbar.js +152 -0
  90. package/dist/KanbanCard-ConTmu3w.cjs +30 -0
  91. package/dist/KanbanCard-D9OhU8C6.js +175 -0
  92. package/dist/KanbanCard.cjs +1 -0
  93. package/dist/KanbanCard.js +12 -0
  94. package/dist/KanbanFooter.cjs +5 -0
  95. package/dist/KanbanFooter.js +84 -0
  96. package/dist/KanbanHeader.cjs +15 -0
  97. package/dist/KanbanHeader.js +127 -0
  98. package/dist/KanbanView.cjs +8 -0
  99. package/dist/KanbanView.js +255 -0
  100. package/dist/Link.cjs +15 -0
  101. package/dist/Link.js +62 -0
  102. package/dist/MenuItem.cjs +36 -0
  103. package/dist/MenuItem.js +230 -0
  104. package/dist/Modal.cjs +84 -0
  105. package/dist/Modal.js +372 -0
  106. package/dist/MultiSelectDropdown.cjs +1 -0
  107. package/dist/MultiSelectDropdown.js +261 -0
  108. package/dist/MultiSelectDropdownLookup.cjs +1 -0
  109. package/dist/MultiSelectDropdownLookup.js +274 -0
  110. package/dist/NestedDropdownItem.cjs +6 -0
  111. package/dist/NestedDropdownItem.js +102 -0
  112. package/dist/NestedMenuItem.cjs +6 -0
  113. package/dist/NestedMenuItem.js +115 -0
  114. package/dist/Notification.cjs +83 -0
  115. package/dist/Notification.js +1079 -0
  116. package/dist/NumberInput.cjs +45 -0
  117. package/dist/NumberInput.js +241 -0
  118. package/dist/PageLayout.cjs +26 -0
  119. package/dist/PageLayout.js +92 -0
  120. package/dist/PasswordInput.cjs +47 -0
  121. package/dist/PasswordInput.js +230 -0
  122. package/dist/ProgressBar.cjs +22 -0
  123. package/dist/ProgressBar.js +92 -0
  124. package/dist/RadioGroup.cjs +7 -0
  125. package/dist/RadioGroup.js +104 -0
  126. package/dist/RadioInput.cjs +117 -0
  127. package/dist/RadioInput.js +362 -0
  128. package/dist/RangeSlider.cjs +72 -0
  129. package/dist/RangeSlider.js +253 -0
  130. package/dist/SearchBar.cjs +100 -0
  131. package/dist/SearchBar.js +994 -0
  132. package/dist/Separator.cjs +6 -0
  133. package/dist/Separator.js +37 -0
  134. package/dist/Sidebar.cjs +39 -0
  135. package/dist/Sidebar.js +123 -0
  136. package/dist/Spinner.cjs +38 -0
  137. package/dist/Spinner.js +114 -0
  138. package/dist/Surface.cjs +7 -0
  139. package/dist/Surface.js +60 -0
  140. package/dist/SwipeableDrawer.cjs +33 -0
  141. package/dist/SwipeableDrawer.js +213 -0
  142. package/dist/Table.cjs +170 -0
  143. package/dist/Table.js +1408 -0
  144. package/dist/TableView-Cj5_fbSR.js +481 -0
  145. package/dist/TableView-D8ex512p.cjs +19 -0
  146. package/dist/TableView.cjs +1 -0
  147. package/dist/TableView.js +11 -0
  148. package/dist/Tabs.cjs +7 -0
  149. package/dist/Tabs.js +72 -0
  150. package/dist/TextAreaInput.cjs +33 -0
  151. package/dist/TextAreaInput.js +320 -0
  152. package/dist/TextInput.cjs +45 -0
  153. package/dist/TextInput.js +227 -0
  154. package/dist/ThemeProvider.cjs +113 -0
  155. package/dist/ThemeProvider.js +1340 -0
  156. package/dist/TimeInput.cjs +31 -0
  157. package/dist/TimeInput.js +133 -0
  158. package/dist/Toggle.cjs +151 -0
  159. package/dist/Toggle.js +421 -0
  160. package/dist/TreeMenu.cjs +15 -0
  161. package/dist/TreeMenu.js +108 -0
  162. package/dist/TreeMenuSeparator.cjs +6 -0
  163. package/dist/TreeMenuSeparator.js +40 -0
  164. package/dist/UploadedFile.cjs +39 -0
  165. package/dist/UploadedFile.js +192 -0
  166. package/dist/defineProperty-BHpTtkhC.js +110 -0
  167. package/dist/defineProperty-DHvxLH8G.cjs +1 -0
  168. package/dist/emotion-element-5486c51c.browser.esm-CSejtOeT.js +886 -0
  169. package/dist/emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs +1 -0
  170. package/dist/emotion-is-prop-valid.esm-BzFBwmJz.js +10 -0
  171. package/dist/emotion-is-prop-valid.esm-CMrshNb7.cjs +1 -0
  172. package/dist/emotion-react.browser.esm-DQBL7Wls.cjs +1 -0
  173. package/dist/emotion-react.browser.esm-OWM-uG8Q.js +94 -0
  174. package/dist/emotion-styled.browser.esm-BZSYYThs.js +210 -0
  175. package/dist/emotion-styled.browser.esm-Cbp_XsK4.cjs +1 -0
  176. package/dist/floating-ui.dom-1F2mTXOe.cjs +1 -0
  177. package/dist/floating-ui.dom-BdUovkEr.js +938 -0
  178. package/dist/hoist-non-react-statics.cjs-B8r9S_ak.cjs +15 -0
  179. package/dist/hoist-non-react-statics.cjs-Drf1aBlk.js +235 -0
  180. package/dist/index-BLQWNy78.js +109 -0
  181. package/dist/index-BP5r5zGN.cjs +1 -0
  182. package/dist/index-B_da1uvD.js +451 -0
  183. package/dist/index-BjdOz5Ok.cjs +1 -0
  184. package/dist/index-BklgDeu4.js +42 -0
  185. package/dist/index-C29T0m2a.cjs +174 -0
  186. package/dist/index-CZJEA84h.js +19069 -0
  187. package/dist/index-Cdkz-XH-.js +127 -0
  188. package/dist/index-D5vEbKUT.js +81 -0
  189. package/dist/index-DXnSjbfJ.cjs +20 -0
  190. package/dist/index-Ds9PUTwb.js +667 -0
  191. package/dist/index-Dzkd2i4n.cjs +1 -0
  192. package/dist/index-IO9v6o0I.cjs +5 -0
  193. package/dist/index-P-naJISQ.cjs +1 -0
  194. package/dist/index.cjs +26 -0
  195. package/dist/index.js +378 -0
  196. package/dist/motion-CtkUpWEn.js +3785 -0
  197. package/dist/motion-Oud-wpUz.cjs +1 -0
  198. package/dist/objectWithoutPropertiesLoose-Bz3hwpmU.cjs +1 -0
  199. package/dist/objectWithoutPropertiesLoose-DwEN6RBQ.js +12 -0
  200. package/dist/setPrototypeOf-4aSEnBDm.cjs +1 -0
  201. package/dist/setPrototypeOf-a891FLQJ.js +13 -0
  202. package/dist/style.css +5 -0
  203. package/dist/tslib.es6-ZNVz5r_T.js +90 -0
  204. package/dist/tslib.es6-fPwcSa2V.cjs +1 -0
  205. package/dist/use-isomorphic-layout-effect.browser.esm-CkGv31zs.cjs +1 -0
  206. package/dist/use-isomorphic-layout-effect.browser.esm-DERp5kr6.js +5 -0
  207. package/dist/useUpdateEffect-BtMgpgIV.cjs +1 -0
  208. package/dist/useUpdateEffect-CuYWz7EA.js +15 -0
  209. package/dist/utils-DEke8iwo.js +10196 -0
  210. package/dist/utils-hdRGTsQ7.cjs +13 -0
  211. package/eslint.config.js +38 -0
  212. package/package.json +137 -58
  213. package/vite.config.js +135 -0
  214. package/jest.config.js +0 -7
  215. package/lib/index.esm.js +0 -84028
  216. package/lib/index.js +0 -84165
  217. package/rc1 +0 -0
  218. package/test/jest/__mocks__/styleMock.js +0 -1
@@ -0,0 +1,14 @@
1
+ "use strict";const l=require("react/jsx-runtime"),p=require("react"),e=require("./index-DXnSjbfJ.cjs"),$=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),E=require("./DragAndDropFile.cjs"),G=require("./UploadedFile.cjs"),T=require("./utils-hdRGTsQ7.cjs"),M=require("./FlexGrid.cjs"),g=require("./FlexGridItem.cjs"),U=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs"),V=$.newStyled.div`
2
+ display: flex;
3
+ flex-direction: column;
4
+ gap: 1rem;
5
+
6
+ border: ${n=>`1px solid ${T.getColorRgbaValue(n.theme,"DragDropFiles",n.color,"enabled","border")}`};
7
+ border-radius: ${n=>T.getBorderRadiusValueWithUnits(n.theme,"regular")};
8
+ padding: 1.25rem 2.5rem;
9
+
10
+ & .file-item-lnc {
11
+ padding: 0.5rem 0.813rem;
12
+ height: 100%;
13
+ }
14
+ `,P=p.forwardRef((n,h)=>{const{id:D="",disabled:x=!1,preventDefault:b=!1,acceptDropzone:F={},acceptInput:C,multiple:q=!0,selectFileText:j="Select file",dndFileText:w="Drag and drop file here or",control:z,showFileSize:d=!0,files:u=[],onChange:y=()=>{},onFocus:S=()=>{},onBlur:A=()=>{},onDropAccepted:m=()=>{},onDrop:f=()=>{},fileClick:R=()=>{},onCancel:O=()=>{},className:W="",style:H={},color:i="primary",size:c="small",dragAndDropFileProps:k,uploadedFileProps:t,...v}=n;var N={theme:U.useTheme(),size:c,color:i};const[o,a]=p.useState([]);p.useEffect(()=>{a(u)},[u]);const I=p.useCallback((r,s)=>{f&&f(r,s)},[]),_=p.useCallback(r=>{m&&m(r)},[]),B=r=>{var s;(s=r.target)!=null&&s.files?a([...o,...r.target.files]):r&&a([...o,...r]),y&&y(r)};return l.jsx(V,{ref:h,...N,...v,children:l.jsxs(M,{direction:"RowReverse",children:[l.jsx(g,{M:(o==null?void 0:o.length)>0?6:12,children:l.jsx(E,{id:D,disabled:x,preventDefault:b,acceptDropzone:F,acceptInput:C,multiple:q,selectFileText:j,dndFileText:w,control:z,showFileSize:d,showDnD:!((o==null?void 0:o.length)>0),onChange:B,onFocus:S,onBlur:A,onDrop:I,onDropAccepted:_,color:i,size:c,...k})}),o==null?void 0:o.map((r,s)=>l.jsx(g,{M:6,children:l.jsx(G,{fileName:r.name,fileSize:r.size,showFileSize:d,color:i,size:c,onFileClick:R,onCancel:O,...t,className:"file-item-lnc "+(t==null?void 0:t.className)},s)},s))]})})});P.propTypes={id:e.PropTypes.any,disabled:e.PropTypes.bool,preventDefault:e.PropTypes.bool,acceptDropzone:e.PropTypes.object,acceptInput:e.PropTypes.string,multiple:e.PropTypes.bool,selectFileText:e.PropTypes.string,dndFileText:e.PropTypes.oneOfType([e.PropTypes.string,e.PropTypes.element]),control:e.PropTypes.element,showFileSize:e.PropTypes.bool,files:e.PropTypes.array,onChange:e.PropTypes.func,onFocus:e.PropTypes.func,onBlur:e.PropTypes.func,onDropAccepted:e.PropTypes.func,onDrop:e.PropTypes.func,fileClick:e.PropTypes.func,onCancel: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"]),dragAndDropFileProps:e.PropTypes.any,uploadedFileProps:e.PropTypes.any};module.exports=P;
@@ -0,0 +1,175 @@
1
+ import { jsx as t, jsxs as $ } from "react/jsx-runtime";
2
+ import G, { useState as M, useEffect as U, useCallback as g } from "react";
3
+ import { P as e } from "./index-Ds9PUTwb.js";
4
+ import { n as V } from "./emotion-styled.browser.esm-BZSYYThs.js";
5
+ import _ from "./DragAndDropFile.js";
6
+ import E from "./UploadedFile.js";
7
+ import { b as W, c as q } from "./utils-DEke8iwo.js";
8
+ import H from "./FlexGrid.js";
9
+ import h from "./FlexGridItem.js";
10
+ import { u as J } from "./emotion-element-5486c51c.browser.esm-CSejtOeT.js";
11
+ const K = V.div`
12
+ display: flex;
13
+ flex-direction: column;
14
+ gap: 1rem;
15
+
16
+ border: ${(n) => `1px solid ${W(
17
+ n.theme,
18
+ "DragDropFiles",
19
+ n.color,
20
+ "enabled",
21
+ "border"
22
+ )}`};
23
+ border-radius: ${(n) => q(n.theme, "regular")};
24
+ padding: 1.25rem 2.5rem;
25
+
26
+ & .file-item-lnc {
27
+ padding: 0.5rem 0.813rem;
28
+ height: 100%;
29
+ }
30
+ `, L = G.forwardRef((n, D) => {
31
+ const {
32
+ id: y = "",
33
+ disabled: b = !1,
34
+ preventDefault: F = !1,
35
+ acceptDropzone: x = {},
36
+ acceptInput: C,
37
+ multiple: z = !0,
38
+ selectFileText: T = "Select file",
39
+ dndFileText: w = "Drag and drop file here or",
40
+ control: A,
41
+ showFileSize: d = !0,
42
+ files: p = [],
43
+ // ----------------------------------------
44
+ onChange: m = () => {
45
+ },
46
+ onFocus: S = () => {
47
+ },
48
+ onBlur: O = () => {
49
+ },
50
+ onDropAccepted: f = () => {
51
+ },
52
+ onDrop: u = () => {
53
+ },
54
+ fileClick: R = () => {
55
+ },
56
+ onCancel: v = () => {
57
+ },
58
+ // ----------------------------------------
59
+ className: Q = "",
60
+ style: X = {},
61
+ color: i = "primary",
62
+ size: s = "small",
63
+ dragAndDropFileProps: N,
64
+ uploadedFileProps: a,
65
+ ...P
66
+ } = n;
67
+ var j = { theme: J(), size: s, color: i };
68
+ const [r, c] = M([]);
69
+ U(() => {
70
+ c(p);
71
+ }, [p]);
72
+ const k = g((o, l) => {
73
+ u && u(o, l);
74
+ }, []), I = g((o) => {
75
+ f && f(o);
76
+ }, []), B = (o) => {
77
+ var l;
78
+ (l = o.target) != null && l.files ? c([...r, ...o.target.files]) : o && c([...r, ...o]), m && m(o);
79
+ };
80
+ return /* @__PURE__ */ t(K, { ref: D, ...j, ...P, children: /* @__PURE__ */ $(H, { direction: "RowReverse", children: [
81
+ /* @__PURE__ */ t(h, { M: (r == null ? void 0 : r.length) > 0 ? 6 : 12, children: /* @__PURE__ */ t(
82
+ _,
83
+ {
84
+ id: y,
85
+ disabled: b,
86
+ preventDefault: F,
87
+ acceptDropzone: x,
88
+ acceptInput: C,
89
+ multiple: z,
90
+ selectFileText: T,
91
+ dndFileText: w,
92
+ control: A,
93
+ showFileSize: d,
94
+ showDnD: !((r == null ? void 0 : r.length) > 0),
95
+ onChange: B,
96
+ onFocus: S,
97
+ onBlur: O,
98
+ onDrop: k,
99
+ onDropAccepted: I,
100
+ color: i,
101
+ size: s,
102
+ ...N
103
+ }
104
+ ) }),
105
+ r == null ? void 0 : r.map((o, l) => /* @__PURE__ */ t(h, { M: 6, children: /* @__PURE__ */ t(
106
+ E,
107
+ {
108
+ fileName: o.name,
109
+ fileSize: o.size,
110
+ showFileSize: d,
111
+ color: i,
112
+ size: s,
113
+ onFileClick: R,
114
+ onCancel: v,
115
+ ...a,
116
+ className: "file-item-lnc " + (a == null ? void 0 : a.className)
117
+ },
118
+ l
119
+ ) }, l))
120
+ ] }) });
121
+ });
122
+ L.propTypes = {
123
+ id: e.any,
124
+ disabled: e.bool,
125
+ preventDefault: e.bool,
126
+ /**
127
+ * Type of: { \[key: string]: string[] }
128
+ *
129
+ * Ex: {
130
+ *
131
+ * 'image/png': ['.png'],
132
+ *
133
+ * 'text/html': ['.html', '.htm']
134
+ *
135
+ * }
136
+ */
137
+ acceptDropzone: e.object,
138
+ acceptInput: e.string,
139
+ multiple: e.bool,
140
+ selectFileText: e.string,
141
+ dndFileText: e.oneOfType([e.string, e.element]),
142
+ /**
143
+ * Custom control which opens file explorer on click
144
+ */
145
+ control: e.element,
146
+ showFileSize: e.bool,
147
+ files: e.array,
148
+ //-------------------------
149
+ onChange: e.func,
150
+ onFocus: e.func,
151
+ onBlur: e.func,
152
+ onDropAccepted: e.func,
153
+ onDrop: e.func,
154
+ fileClick: e.func,
155
+ onCancel: e.func,
156
+ //-------------------------
157
+ className: e.string,
158
+ style: e.object,
159
+ size: e.oneOf(["small", "medium", "large"]),
160
+ color: e.oneOf([
161
+ "primary",
162
+ "secondary",
163
+ "success",
164
+ "danger",
165
+ "warning",
166
+ "information",
167
+ "neutral",
168
+ "gray"
169
+ ]),
170
+ dragAndDropFileProps: e.any,
171
+ uploadedFileProps: e.any
172
+ };
173
+ export {
174
+ L as default
175
+ };
@@ -0,0 +1,6 @@
1
+ "use strict";const $=require("react/jsx-runtime"),t=require("react"),r=require("./index-DXnSjbfJ.cjs"),q=require("./emotion-react.browser.esm-DQBL7Wls.cjs"),N=require("./utils-hdRGTsQ7.cjs"),j=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs");function k(){return k=Object.assign||function(l){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(l[a]=o[a])}return l},k.apply(this,arguments)}var B=function(e,o){var a={left:{top:0,left:0,transform:"translate3d(-100%, 0, 0)",width:o,height:"100vh"},right:{top:0,right:0,transform:"translate3d(100%, 0, 0)",width:o,height:"100vh"},bottom:{left:0,right:0,bottom:0,transform:"translate3d(0, 100%, 0)",width:"100%",height:o},top:{left:0,right:0,top:0,transform:"translate3d(0, -100%, 0)",width:"100%",height:o}};return a[e]},M=function(e){var o=e.open,a=e.onClose,w=a===void 0?function(){}:a,_=e.children,x=e.style,d=e.enableOverlay,u=d===void 0?!0:d,y=e.overlayColor,C=y===void 0?"#000":y,p=e.overlayOpacity,m=p===void 0?.4:p,v=e.zIndex,f=v===void 0?100:v,g=e.duration,O=g===void 0?500:g,D=e.direction,s=e.size,T=s===void 0?250:s,i=e.className,h=e.customIdSuffix,b=e.lockBackgroundScroll,P=b===void 0?!1:b,n=e.overlayClassName,E=n===void 0?"":n,S=t.useRef(null);t.useEffect(function(){var R=function(){S.current=window.document.querySelector("body"),S.current&&P&&(S.current.style.overflow=o?"hidden":"")};R()},[o]);var c=t.useMemo(function(){return h||(Math.random()+1).toString(36).substring(7)},[h]),Z={backgroundColor:C.toString(),opacity:m,zIndex:f},z=k({zIndex:f+1,transitionDuration:O+"ms"},B(D,T),x);return t.createElement("div",{id:"EZDrawer"+c,className:"EZDrawer"},t.createElement("input",{type:"checkbox",id:"EZDrawer__checkbox"+c,className:"EZDrawer__checkbox",onChange:w,checked:o}),t.createElement("nav",{role:"navigation",id:"EZDrawer__container"+c,style:z,className:"EZDrawer__container "+i},_),u&&t.createElement("label",{htmlFor:"EZDrawer__checkbox"+c,id:"EZDrawer__overlay"+c,className:"EZDrawer__overlay "+E,style:Z}))};const I=t.forwardRef((l,e)=>{const{direction:o="right",open:a=!1,duration:w=300,overlayOpacity:_=.4,enableOverlay:x=!0,zIndex:d=100,onClose:u=()=>{},onOpen:y=()=>{},className:C="",style:p={},color:m="neutral",size:v="small",overlayColor:f,width:g="unset",children:O,...D}=l,s=j.useTheme(),[T,i]=t.useState(!1);t.useImperativeHandle(e,()=>({open(){h()},close(){b()}}));const h=n=>{i(!0),y(n)},b=n=>{i(!1),u(n)},P=()=>{i(!1),u()};return $.jsx(q.ClassNames,{children:({css:n,cx:E})=>$.jsx(M,{open:T,onClose:P,direction:o,zIndex:d,duration:w,overlayOpacity:_,enableOverlay:x,size:g,className:E("drawer-lnc "+C,n`
2
+ padding: 20px;
3
+ background-color: ${N.getColorRgbaValue(s,"Drawer",m,"enabled","background")} !important;
4
+ color: ${N.getColorRgbaValue(s,"Drawer",m,"enabled","text")};
5
+ ${N.getComponentTypographyCss(s,"Drawer",v,"enabled")};
6
+ `),style:p,overlayColor:f,...D,children:O})})});I.propTypes={direction:r.PropTypes.oneOf(["top","right","left","bottom"]),open:r.PropTypes.bool,duration:r.PropTypes.number,overlayOpacity:r.PropTypes.number,enableOverlay:r.PropTypes.bool,zIndex:r.PropTypes.number,onClose:r.PropTypes.func,onOpen:r.PropTypes.func,className:r.PropTypes.string,style:r.PropTypes.object,overlayColor:r.PropTypes.string,width:r.PropTypes.oneOfType([r.PropTypes.number,r.PropTypes.string]),size:r.PropTypes.oneOf(["small","medium","large"]),color:r.PropTypes.oneOf(["primary","secondary","success","warning","danger","information","neutral","gray"])};module.exports=I;
package/dist/Drawer.js ADDED
@@ -0,0 +1,206 @@
1
+ import { jsx as I } from "react/jsx-runtime";
2
+ import c, { useRef as T, useEffect as j, useMemo as B, useState as M, useImperativeHandle as q } from "react";
3
+ import { P as r } from "./index-Ds9PUTwb.js";
4
+ import { C as F } from "./emotion-react.browser.esm-OWM-uG8Q.js";
5
+ import { b as Z, a as H } from "./utils-DEke8iwo.js";
6
+ import { u as V } from "./emotion-element-5486c51c.browser.esm-CSejtOeT.js";
7
+ function $() {
8
+ return $ = Object.assign || function(n) {
9
+ for (var e = 1; e < arguments.length; e++) {
10
+ var o = arguments[e];
11
+ for (var a in o)
12
+ Object.prototype.hasOwnProperty.call(o, a) && (n[a] = o[a]);
13
+ }
14
+ return n;
15
+ }, $.apply(this, arguments);
16
+ }
17
+ var A = function(e, o) {
18
+ var a = {
19
+ left: {
20
+ top: 0,
21
+ left: 0,
22
+ transform: "translate3d(-100%, 0, 0)",
23
+ width: o,
24
+ height: "100vh"
25
+ },
26
+ right: {
27
+ top: 0,
28
+ right: 0,
29
+ transform: "translate3d(100%, 0, 0)",
30
+ width: o,
31
+ height: "100vh"
32
+ },
33
+ bottom: {
34
+ left: 0,
35
+ right: 0,
36
+ bottom: 0,
37
+ transform: "translate3d(0, 100%, 0)",
38
+ width: "100%",
39
+ height: o
40
+ },
41
+ top: {
42
+ left: 0,
43
+ right: 0,
44
+ top: 0,
45
+ transform: "translate3d(0, -100%, 0)",
46
+ width: "100%",
47
+ height: o
48
+ }
49
+ };
50
+ return a[e];
51
+ }, G = function(e) {
52
+ var o = e.open, a = e.onClose, w = a === void 0 ? function() {
53
+ } : a, _ = e.children, C = e.style, d = e.enableOverlay, u = d === void 0 ? !0 : d, m = e.overlayColor, O = m === void 0 ? "#000" : m, f = e.overlayOpacity, y = f === void 0 ? 0.4 : f, v = e.zIndex, h = v === void 0 ? 100 : v, p = e.duration, D = p === void 0 ? 500 : p, x = e.direction, l = e.size, E = l === void 0 ? 250 : l, i = e.className, g = e.customIdSuffix, b = e.lockBackgroundScroll, S = b === void 0 ? !1 : b, t = e.overlayClassName, N = t === void 0 ? "" : t, k = T(null);
54
+ j(function() {
55
+ var R = function() {
56
+ k.current = window.document.querySelector("body"), k.current && S && (k.current.style.overflow = o ? "hidden" : "");
57
+ };
58
+ R();
59
+ }, [o]);
60
+ var s = B(function() {
61
+ return g || (Math.random() + 1).toString(36).substring(7);
62
+ }, [g]), z = {
63
+ backgroundColor: O.toString(),
64
+ opacity: y,
65
+ zIndex: h
66
+ }, P = $({
67
+ zIndex: h + 1,
68
+ transitionDuration: D + "ms"
69
+ }, A(x, E), C);
70
+ return c.createElement("div", {
71
+ id: "EZDrawer" + s,
72
+ className: "EZDrawer"
73
+ }, c.createElement("input", {
74
+ type: "checkbox",
75
+ id: "EZDrawer__checkbox" + s,
76
+ className: "EZDrawer__checkbox",
77
+ onChange: w,
78
+ checked: o
79
+ }), c.createElement("nav", {
80
+ role: "navigation",
81
+ id: "EZDrawer__container" + s,
82
+ style: P,
83
+ className: "EZDrawer__container " + i
84
+ }, _), u && c.createElement("label", {
85
+ htmlFor: "EZDrawer__checkbox" + s,
86
+ id: "EZDrawer__overlay" + s,
87
+ className: "EZDrawer__overlay " + N,
88
+ style: z
89
+ }));
90
+ };
91
+ const J = c.forwardRef((n, e) => {
92
+ const {
93
+ direction: o = "right",
94
+ open: a = !1,
95
+ duration: w = 300,
96
+ overlayOpacity: _ = 0.4,
97
+ enableOverlay: C = !0,
98
+ zIndex: d = 100,
99
+ //----------------
100
+ onClose: u = () => {
101
+ },
102
+ onOpen: m = () => {
103
+ },
104
+ //----------------
105
+ className: O = "",
106
+ style: f = {},
107
+ color: y = "neutral",
108
+ size: v = "small",
109
+ overlayColor: h,
110
+ width: p = "unset",
111
+ children: D,
112
+ ...x
113
+ } = n, l = V(), [E, i] = M(!1);
114
+ q(e, () => ({
115
+ open() {
116
+ g();
117
+ },
118
+ close() {
119
+ b();
120
+ }
121
+ }));
122
+ const g = (t) => {
123
+ i(!0), m(t);
124
+ }, b = (t) => {
125
+ i(!1), u(t);
126
+ }, S = () => {
127
+ i(!1), u();
128
+ };
129
+ return /* @__PURE__ */ I(F, { children: ({ css: t, cx: N }) => /* @__PURE__ */ I(
130
+ G,
131
+ {
132
+ open: E,
133
+ onClose: S,
134
+ direction: o,
135
+ zIndex: d,
136
+ duration: w,
137
+ overlayOpacity: _,
138
+ enableOverlay: C,
139
+ size: p,
140
+ className: N(
141
+ "drawer-lnc " + O,
142
+ t`
143
+ padding: 20px;
144
+ background-color: ${Z(
145
+ l,
146
+ "Drawer",
147
+ y,
148
+ "enabled",
149
+ "background"
150
+ )} !important;
151
+ color: ${Z(
152
+ l,
153
+ "Drawer",
154
+ y,
155
+ "enabled",
156
+ "text"
157
+ )};
158
+ ${H(l, "Drawer", v, "enabled")};
159
+ `
160
+ ),
161
+ style: f,
162
+ overlayColor: h,
163
+ ...x,
164
+ children: D
165
+ }
166
+ ) });
167
+ });
168
+ J.propTypes = {
169
+ direction: r.oneOf(["top", "right", "left", "bottom"]),
170
+ open: r.bool,
171
+ /**
172
+ * Duration of opening the drawer in ms
173
+ */
174
+ duration: r.number,
175
+ overlayOpacity: r.number,
176
+ /**
177
+ * Determines whether to show the overlay
178
+ */
179
+ enableOverlay: r.bool,
180
+ /**
181
+ * z-index of Drawer
182
+ */
183
+ zIndex: r.number,
184
+ //---------------------------------------------------------------
185
+ onClose: r.func,
186
+ onOpen: r.func,
187
+ //---------------------------------------------------------------
188
+ className: r.string,
189
+ style: r.object,
190
+ overlayColor: r.string,
191
+ width: r.oneOfType([r.number, r.string]),
192
+ size: r.oneOf(["small", "medium", "large"]),
193
+ color: r.oneOf([
194
+ "primary",
195
+ "secondary",
196
+ "success",
197
+ "warning",
198
+ "danger",
199
+ "information",
200
+ "neutral",
201
+ "gray"
202
+ ])
203
+ };
204
+ export {
205
+ J as default
206
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const O=require("react/jsx-runtime"),e=require("./index-DXnSjbfJ.cjs"),n=require("react"),t=require("./CustomStyles-CqlCjTgU.cjs"),a=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs");require("./index-C29T0m2a.cjs");const S=require("./index-BjdOz5Ok.cjs");function M(o){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const r in o)if(r!=="default"){const p=Object.getOwnPropertyDescriptor(o,r);Object.defineProperty(s,r,p.get?p:{enumerable:!0,get:()=>o[r]})}}return s.default=o,Object.freeze(s)}const h=M(n);var j=n.forwardRef(function(o,s){var r=t.useStateManager(o);return h.createElement(t.Select,a._extends({ref:s},r))}),x=j;const u=n.forwardRef((o,s)=>{const{styles:r,debounceTime:p=180,name:C,isSearchable:c=!0,isClearable:i=!0,onInputChange:l,size:y="small",color:T="primary",className:P="",style:b={},...m}=o,f=a.useTheme();return n.useCallback(S.debounce((d,g)=>{l==null||l(d,g)},p)),O.jsx(x,{ref:s,styles:r||t.customStyles,size:y,color:T,theme:f,isSearchable:c,isClearable:i,className:P,style:b,...m})});u.propTypes={options:e.PropTypes.array,styles:e.PropTypes.object,debounceTime:e.PropTypes.number,name:e.PropTypes.string,value:e.PropTypes.any,tabIndex:e.PropTypes.number,isSearchable:e.PropTypes.bool,isClearable:e.PropTypes.bool,isLoading:e.PropTypes.bool,isRtl:e.PropTypes.bool,isDisabled:e.PropTypes.bool,readOnly:e.PropTypes.bool,closeMenuOnSelect:e.PropTypes.bool,closeMenuOnScroll:e.PropTypes.oneOfType([e.PropTypes.bool,e.PropTypes.func]),escapeClearsValue:e.PropTypes.bool,filterOption:e.PropTypes.func,formatGroupLabel:e.PropTypes.func,formatOptionLabel:e.PropTypes.func,getOptionLabel:e.PropTypes.func,getOptionValue:e.PropTypes.func,hideSelectedOptions:e.PropTypes.bool,id:e.PropTypes.string,inputId:e.PropTypes.string,isOptionDisabled:e.PropTypes.func,isOptionSelected:e.PropTypes.func,loadingMessage:e.PropTypes.func,minMenuHeight:e.PropTypes.number,maxMenuHeight:e.PropTypes.number,menuPlacement:e.PropTypes.oneOf(["bottom","auto","top"]),menuPosition:e.PropTypes.oneOf(["absolute","fixed"]),menuShouldBlockScroll:e.PropTypes.bool,menuShouldScrollIntoView:e.PropTypes.bool,openMenuOnFocus:e.PropTypes.bool,openMenuOnClick:e.PropTypes.bool,autoFocus:e.PropTypes.bool,placeholder:e.PropTypes.any,noOptionsMessage:e.PropTypes.string,menuIsOpen:e.PropTypes.bool,components:e.PropTypes.object,defaultValue:e.PropTypes.any,defaultInputValue:e.PropTypes.string,defaultMenuIsOpen:e.PropTypes.bool,delimiter:e.PropTypes.string,onChange:e.PropTypes.func,onInputChange:e.PropTypes.func,onMenuOpen:e.PropTypes.func,onMenuClose:e.PropTypes.func,onFocus:e.PropTypes.func,onBlur:e.PropTypes.func,className:e.PropTypes.string,style:e.PropTypes.object,color:e.PropTypes.oneOf(["primary","secondary","success","warning","danger","information","neutral","gray"]),size:e.PropTypes.oneOf(["small","medium","large"])};exports.components=t.components;exports.default=u;
@@ -0,0 +1,266 @@
1
+ import { jsx as g } from "react/jsx-runtime";
2
+ import { P as e } from "./index-Ds9PUTwb.js";
3
+ import * as O from "react";
4
+ import S, { forwardRef as y, useCallback as M } from "react";
5
+ import { u as h, S as x, a as C } from "./CustomStyles-nfD3J1mi.js";
6
+ import { c as N } from "./CustomStyles-nfD3J1mi.js";
7
+ import { _ as I, u as T } from "./emotion-element-5486c51c.browser.esm-CSejtOeT.js";
8
+ import "./index-CZJEA84h.js";
9
+ import { d as w } from "./index-D5vEbKUT.js";
10
+ var P = /* @__PURE__ */ y(function(n, t) {
11
+ var o = h(n);
12
+ return /* @__PURE__ */ O.createElement(x, I({
13
+ ref: t
14
+ }, o));
15
+ }), R = P;
16
+ const V = S.forwardRef((n, t) => {
17
+ const {
18
+ // options,
19
+ styles: o,
20
+ debounceTime: l = 180,
21
+ name: j,
22
+ // hideSelectedOptions,
23
+ // id,
24
+ // inputId,
25
+ // value,
26
+ // readOnly,
27
+ // tabIndex,
28
+ isSearchable: s = !0,
29
+ isClearable: r = !0,
30
+ // isLoading,
31
+ // isRtl,
32
+ // isDisabled,
33
+ // closeMenuOnSelect,
34
+ // closeMenuOnScroll,
35
+ // escapeClearsValue,
36
+ // filterOption,
37
+ // formatGroupLabel,
38
+ // formatOptionLabel,
39
+ // getOptionLabel,
40
+ // getOptionValue,
41
+ // isOptionDisabled,
42
+ // isOptionSelected,
43
+ // loadingMessage,
44
+ // minMenuHeight,
45
+ // maxMenuHeight,
46
+ // menuPlacement,
47
+ // menuPosition,
48
+ // menuShouldBlockScroll,
49
+ // menuShouldScrollIntoView,
50
+ // openMenuOnFocus,
51
+ // openMenuOnClick,
52
+ // autoFocus,
53
+ // placeholder,
54
+ // noOptionsMessage,
55
+ // menuIsOpen,
56
+ // components,
57
+ // defaultValue,
58
+ // defaultInputValue,
59
+ // defaultMenuIsOpen,
60
+ // delimiter,
61
+ // onChange,
62
+ onInputChange: a,
63
+ // onMenuOpen,
64
+ // onMenuClose,
65
+ // onBlur,
66
+ // onFocus,
67
+ size: u = "small",
68
+ color: c = "primary",
69
+ className: i = "",
70
+ style: m = {},
71
+ // children,
72
+ ...f
73
+ } = n, p = T();
74
+ return M(
75
+ w((b, d) => {
76
+ a == null || a(b, d);
77
+ }, l)
78
+ ), /* @__PURE__ */ g(
79
+ R,
80
+ {
81
+ ref: t,
82
+ styles: o || C,
83
+ size: u,
84
+ color: c,
85
+ theme: p,
86
+ isSearchable: s,
87
+ isClearable: r,
88
+ className: i,
89
+ style: m,
90
+ ...f
91
+ }
92
+ );
93
+ });
94
+ V.propTypes = {
95
+ options: e.array,
96
+ styles: e.object,
97
+ debounceTime: e.number,
98
+ name: e.string,
99
+ value: e.any,
100
+ /**
101
+ * Sets the tabIndex attribute on the input
102
+ */
103
+ tabIndex: e.number,
104
+ /**
105
+ * Whether to enable search functionality
106
+ */
107
+ isSearchable: e.bool,
108
+ isClearable: e.bool,
109
+ /**
110
+ * Is the select in a state of loading (async)
111
+ */
112
+ isLoading: e.bool,
113
+ /**
114
+ * Is the select direction right-to-left
115
+ */
116
+ isRtl: e.bool,
117
+ isDisabled: e.bool,
118
+ readOnly: e.bool,
119
+ /**
120
+ * Close the select menu when the user selects an option
121
+ */
122
+ closeMenuOnSelect: e.bool,
123
+ /**
124
+ * If true, close the select menu when the user scrolls the document/body.
125
+ * If a function, takes a standard javascript ScrollEvent you return a boolean:
126
+ * true => The menu closes
127
+ * false => The menu stays open
128
+ * This is useful when you have a scrollable modal and want to portal the menu out, but want to avoid graphical issues.
129
+ */
130
+ closeMenuOnScroll: e.oneOfType([e.bool, e.func]),
131
+ /**
132
+ * Clear all values when the user presses escape AND the menu is closed
133
+ */
134
+ escapeClearsValue: e.bool,
135
+ /**
136
+ * Custom method to filter whether an option should be displayed in the menu. Type: `null` or `() => boolean`
137
+ */
138
+ filterOption: e.func,
139
+ /**
140
+ * Formats group labels in the menu as React components
141
+ */
142
+ formatGroupLabel: e.func,
143
+ /**
144
+ * Formats option labels in the menu and control as React components
145
+ */
146
+ formatOptionLabel: e.func,
147
+ /**
148
+ * Resolves option data to a string to be displayed as the label by components
149
+ * Note: Failure to resolve to a string type can interfere with filtering and screen reader support.
150
+ */
151
+ getOptionLabel: e.func,
152
+ /**
153
+ * Resolves option data to a string to compare options and specify value attributes
154
+ */
155
+ getOptionValue: e.func,
156
+ /**
157
+ * Hide the selected option from the menu
158
+ */
159
+ hideSelectedOptions: e.bool,
160
+ /**
161
+ * The id to set on the SelectContainer component
162
+ */
163
+ id: e.string,
164
+ /**
165
+ * The id of the search input
166
+ */
167
+ inputId: e.string,
168
+ /**
169
+ * Override the built-in logic to detect whether an option is disabled. `(...) => boolean`
170
+ */
171
+ isOptionDisabled: e.func,
172
+ /**
173
+ * Override the built-in logic to detect whether an option is selected. `(...) => boolean`
174
+ */
175
+ isOptionSelected: e.func,
176
+ /**
177
+ * Async: Text to display when loading options `(...) => ...`
178
+ */
179
+ loadingMessage: e.func,
180
+ /**
181
+ * Minimum height of the menu before flipping
182
+ */
183
+ minMenuHeight: e.number,
184
+ /**
185
+ * Maximum height of the menu before flipping
186
+ */
187
+ maxMenuHeight: e.number,
188
+ /**
189
+ * Default placement of the menu in relation to the control. 'auto' will flip when there isn't enough space below the control.
190
+ */
191
+ menuPlacement: e.oneOf(["bottom", "auto", "top"]),
192
+ /**
193
+ *The CSS position value of the menu, when "fixed" extra layout management is required.
194
+ */
195
+ menuPosition: e.oneOf(["absolute", "fixed"]),
196
+ /**
197
+ * Whether to block scroll events when the menu is open
198
+ */
199
+ menuShouldBlockScroll: e.bool,
200
+ /**
201
+ * Whether the menu should be scrolled into view when it opens
202
+ */
203
+ menuShouldScrollIntoView: e.bool,
204
+ /**
205
+ * Allows control of whether the menu is opened when the Select is focused
206
+ */
207
+ openMenuOnFocus: e.bool,
208
+ /**
209
+ * Allows control of whether the menu is opened when the Select is clicked
210
+ */
211
+ openMenuOnClick: e.bool,
212
+ //----
213
+ autoFocus: e.bool,
214
+ placeholder: e.any,
215
+ noOptionsMessage: e.string,
216
+ menuIsOpen: e.bool,
217
+ /**
218
+ * This complex object includes all the compositional components that are used in react-select. If you wish to overwrite a component, pass in an object with the appropriate namespace.
219
+ * If you only wish to restyle a component, we recommend using the styles prop instead.
220
+ */
221
+ components: e.object,
222
+ /**
223
+ * initial value of the control
224
+ */
225
+ defaultValue: e.any,
226
+ /**
227
+ * initial value of the search input
228
+ */
229
+ defaultInputValue: e.string,
230
+ /**
231
+ * initial open value of the menu
232
+ */
233
+ defaultMenuIsOpen: e.bool,
234
+ /**
235
+ * Delimiter used to join multiple values into a single HTML Input value
236
+ */
237
+ delimiter: e.string,
238
+ //---------------------------------------------------------------
239
+ onChange: e.func,
240
+ /**
241
+ * control the value of the search input (changing this will update the available options)
242
+ */
243
+ onInputChange: e.func,
244
+ onMenuOpen: e.func,
245
+ onMenuClose: e.func,
246
+ onFocus: e.func,
247
+ onBlur: e.func,
248
+ //---------------------------------------------------------------
249
+ className: e.string,
250
+ style: e.object,
251
+ color: e.oneOf([
252
+ "primary",
253
+ "secondary",
254
+ "success",
255
+ "warning",
256
+ "danger",
257
+ "information",
258
+ "neutral",
259
+ "gray"
260
+ ]),
261
+ size: e.oneOf(["small", "medium", "large"])
262
+ };
263
+ export {
264
+ N as components,
265
+ V as default
266
+ };