@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,320 @@
|
|
|
1
|
+
import { jsx as W } from "react/jsx-runtime";
|
|
2
|
+
import { P as o } from "./index-Ds9PUTwb.js";
|
|
3
|
+
import * as v from "react";
|
|
4
|
+
import Y, { useRef as D, useCallback as _, useState as H, useEffect as $ } from "react";
|
|
5
|
+
import { d as X } from "./index-D5vEbKUT.js";
|
|
6
|
+
import { n as Z } from "./emotion-styled.browser.esm-BZSYYThs.js";
|
|
7
|
+
import { a as q, f as J, b as z, c as K, h as Q, g as ee } from "./utils-DEke8iwo.js";
|
|
8
|
+
import { _ as te, u as re } from "./emotion-element-5486c51c.browser.esm-CSejtOeT.js";
|
|
9
|
+
import { _ as ne } from "./objectWithoutPropertiesLoose-DwEN6RBQ.js";
|
|
10
|
+
import { i as ae } from "./use-isomorphic-layout-effect.browser.esm-DERp5kr6.js";
|
|
11
|
+
const oe = Z.div`
|
|
12
|
+
& textarea {
|
|
13
|
+
${(e) => q(e.theme, "Input", e.size, "enabled")}
|
|
14
|
+
min-height: ${(e) => J(e.theme, e.size)};
|
|
15
|
+
background-color: ${(e) => z(
|
|
16
|
+
e.theme,
|
|
17
|
+
"Input",
|
|
18
|
+
e.color,
|
|
19
|
+
"enabled",
|
|
20
|
+
"background"
|
|
21
|
+
)};
|
|
22
|
+
border: 1px solid
|
|
23
|
+
${(e) => z(
|
|
24
|
+
e.theme,
|
|
25
|
+
"Input",
|
|
26
|
+
e.focused === !0 ? "primary" : e.color,
|
|
27
|
+
e.disabled === !0 ? "disabled" : "enabled",
|
|
28
|
+
"border"
|
|
29
|
+
)};
|
|
30
|
+
border-radius: ${(e) => K(e.theme, "regular")};
|
|
31
|
+
color: ${(e) => z(
|
|
32
|
+
e.theme,
|
|
33
|
+
"Input",
|
|
34
|
+
e.focused === !0 ? "primary" : e.color,
|
|
35
|
+
"enabled",
|
|
36
|
+
"text"
|
|
37
|
+
)};
|
|
38
|
+
caret-color: ${(e) => z(e.theme, "Input", e.color, "enabled", "caret")};
|
|
39
|
+
overflow: ${(e) => e.collapseOnBlur && e.focused === !1 ? "hidden" : "auto"};
|
|
40
|
+
transition: height 0.2s ease-out;
|
|
41
|
+
padding: 0.563rem 0.75rem;
|
|
42
|
+
min-width: 100%;
|
|
43
|
+
max-width: 100%;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
& textarea::placeholder {
|
|
47
|
+
color: ${(e) => z(
|
|
48
|
+
e.theme,
|
|
49
|
+
"Input",
|
|
50
|
+
e.color,
|
|
51
|
+
"enabled",
|
|
52
|
+
"placeholder"
|
|
53
|
+
)};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
& textarea:read-only {
|
|
57
|
+
cursor: default;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
& textarea:focus {
|
|
61
|
+
${(e) => e.readOnly !== !0 ? Q(e.theme) : "outline: none"}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
& textarea:disabled {
|
|
65
|
+
${(e) => ee(e.theme)}
|
|
66
|
+
}
|
|
67
|
+
`;
|
|
68
|
+
var ie = function(t) {
|
|
69
|
+
var r = v.useRef(t);
|
|
70
|
+
return ae(function() {
|
|
71
|
+
r.current = t;
|
|
72
|
+
}), r;
|
|
73
|
+
}, B = function(t, r) {
|
|
74
|
+
if (typeof t == "function") {
|
|
75
|
+
t(r);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
t.current = r;
|
|
79
|
+
}, de = function(t, r) {
|
|
80
|
+
var n = D();
|
|
81
|
+
return _(function(a) {
|
|
82
|
+
t.current = a, n.current && B(n.current, null), n.current = r, r && B(r, a);
|
|
83
|
+
}, [r]);
|
|
84
|
+
}, O = {
|
|
85
|
+
"min-height": "0",
|
|
86
|
+
"max-height": "none",
|
|
87
|
+
height: "0",
|
|
88
|
+
visibility: "hidden",
|
|
89
|
+
overflow: "hidden",
|
|
90
|
+
position: "absolute",
|
|
91
|
+
"z-index": "-1000",
|
|
92
|
+
top: "0",
|
|
93
|
+
right: "0",
|
|
94
|
+
display: "block"
|
|
95
|
+
}, ue = function(t) {
|
|
96
|
+
Object.keys(O).forEach(function(r) {
|
|
97
|
+
t.style.setProperty(r, O[r], "important");
|
|
98
|
+
});
|
|
99
|
+
}, k = ue, d = null, M = function(t, r) {
|
|
100
|
+
var n = t.scrollHeight;
|
|
101
|
+
return r.sizingStyle.boxSizing === "border-box" ? n + r.borderSize : n - r.paddingSize;
|
|
102
|
+
};
|
|
103
|
+
function se(e, t, r, n) {
|
|
104
|
+
r === void 0 && (r = 1), n === void 0 && (n = 1 / 0), d || (d = document.createElement("textarea"), d.setAttribute("tabindex", "-1"), d.setAttribute("aria-hidden", "true"), k(d)), d.parentNode === null && document.body.appendChild(d);
|
|
105
|
+
var a = e.paddingSize, h = e.borderSize, s = e.sizingStyle, S = s.boxSizing;
|
|
106
|
+
Object.keys(s).forEach(function(g) {
|
|
107
|
+
var m = g;
|
|
108
|
+
d.style[m] = s[m];
|
|
109
|
+
}), k(d), d.value = t;
|
|
110
|
+
var i = M(d, e);
|
|
111
|
+
d.value = t, i = M(d, e), d.value = "x";
|
|
112
|
+
var u = d.scrollHeight - a, l = u * r;
|
|
113
|
+
S === "border-box" && (l = l + a + h), i = Math.max(l, i);
|
|
114
|
+
var c = u * n;
|
|
115
|
+
return S === "border-box" && (c = c + a + h), i = Math.min(c, i), [i, u];
|
|
116
|
+
}
|
|
117
|
+
var V = function() {
|
|
118
|
+
}, le = function(t, r) {
|
|
119
|
+
return t.reduce(function(n, a) {
|
|
120
|
+
return n[a] = r[a], n;
|
|
121
|
+
}, {});
|
|
122
|
+
}, ce = [
|
|
123
|
+
"borderBottomWidth",
|
|
124
|
+
"borderLeftWidth",
|
|
125
|
+
"borderRightWidth",
|
|
126
|
+
"borderTopWidth",
|
|
127
|
+
"boxSizing",
|
|
128
|
+
"fontFamily",
|
|
129
|
+
"fontSize",
|
|
130
|
+
"fontStyle",
|
|
131
|
+
"fontWeight",
|
|
132
|
+
"letterSpacing",
|
|
133
|
+
"lineHeight",
|
|
134
|
+
"paddingBottom",
|
|
135
|
+
"paddingLeft",
|
|
136
|
+
"paddingRight",
|
|
137
|
+
"paddingTop",
|
|
138
|
+
// non-standard
|
|
139
|
+
"tabSize",
|
|
140
|
+
"textIndent",
|
|
141
|
+
// non-standard
|
|
142
|
+
"textRendering",
|
|
143
|
+
"textTransform",
|
|
144
|
+
"width",
|
|
145
|
+
"wordBreak",
|
|
146
|
+
"wordSpacing",
|
|
147
|
+
"scrollbarGutter"
|
|
148
|
+
], fe = !!document.documentElement.currentStyle, he = function(t) {
|
|
149
|
+
var r = window.getComputedStyle(t);
|
|
150
|
+
if (r === null)
|
|
151
|
+
return null;
|
|
152
|
+
var n = le(ce, r), a = n.boxSizing;
|
|
153
|
+
if (a === "")
|
|
154
|
+
return null;
|
|
155
|
+
fe && a === "border-box" && (n.width = parseFloat(n.width) + parseFloat(n.borderRightWidth) + parseFloat(n.borderLeftWidth) + parseFloat(n.paddingRight) + parseFloat(n.paddingLeft) + "px");
|
|
156
|
+
var h = parseFloat(n.paddingBottom) + parseFloat(n.paddingTop), s = parseFloat(n.borderBottomWidth) + parseFloat(n.borderTopWidth);
|
|
157
|
+
return {
|
|
158
|
+
sizingStyle: n,
|
|
159
|
+
paddingSize: h,
|
|
160
|
+
borderSize: s
|
|
161
|
+
};
|
|
162
|
+
}, ge = he;
|
|
163
|
+
function A(e, t, r) {
|
|
164
|
+
var n = ie(r);
|
|
165
|
+
v.useLayoutEffect(function() {
|
|
166
|
+
var a = function(s) {
|
|
167
|
+
return n.current(s);
|
|
168
|
+
};
|
|
169
|
+
if (e)
|
|
170
|
+
return e.addEventListener(t, a), function() {
|
|
171
|
+
return e.removeEventListener(t, a);
|
|
172
|
+
};
|
|
173
|
+
}, []);
|
|
174
|
+
}
|
|
175
|
+
var me = function(t) {
|
|
176
|
+
A(window, "resize", t);
|
|
177
|
+
}, be = function(t) {
|
|
178
|
+
A(document.fonts, "loadingdone", t);
|
|
179
|
+
}, pe = ["cacheMeasurements", "maxRows", "minRows", "onChange", "onHeightChange"], ve = function(t, r) {
|
|
180
|
+
var n = t.cacheMeasurements, a = t.maxRows, h = t.minRows, s = t.onChange, S = s === void 0 ? V : s, i = t.onHeightChange, u = i === void 0 ? V : i, l = ne(t, pe), c = l.value !== void 0, g = v.useRef(null), m = de(g, r), C = v.useRef(0), R = v.useRef(), x = function() {
|
|
181
|
+
var b = g.current, y = n && R.current ? R.current : ge(b);
|
|
182
|
+
if (y) {
|
|
183
|
+
R.current = y;
|
|
184
|
+
var T = se(y, b.value || b.placeholder || "x", h, a), p = T[0], L = T[1];
|
|
185
|
+
C.current !== p && (C.current = p, b.style.setProperty("height", p + "px", "important"), u(p, {
|
|
186
|
+
rowHeight: L
|
|
187
|
+
}));
|
|
188
|
+
}
|
|
189
|
+
}, I = function(b) {
|
|
190
|
+
c || x(), S(b);
|
|
191
|
+
};
|
|
192
|
+
return v.useLayoutEffect(x), me(x), be(x), /* @__PURE__ */ v.createElement("textarea", te({}, l, {
|
|
193
|
+
onChange: I,
|
|
194
|
+
ref: m
|
|
195
|
+
}));
|
|
196
|
+
}, xe = /* @__PURE__ */ v.forwardRef(ve);
|
|
197
|
+
const ye = Y.forwardRef((e, t) => {
|
|
198
|
+
const {
|
|
199
|
+
disabled: r,
|
|
200
|
+
readOnly: n,
|
|
201
|
+
value: a,
|
|
202
|
+
defaultValue: h,
|
|
203
|
+
debounceTime: s = 180,
|
|
204
|
+
type: S = "textarea",
|
|
205
|
+
collapseOnBlur: i = !1,
|
|
206
|
+
minRows: u = 0,
|
|
207
|
+
maxRows: l,
|
|
208
|
+
//----------------
|
|
209
|
+
onChange: c,
|
|
210
|
+
onBlur: g,
|
|
211
|
+
onFocus: m,
|
|
212
|
+
//----------------
|
|
213
|
+
className: C = "",
|
|
214
|
+
style: R = {},
|
|
215
|
+
size: x = "small",
|
|
216
|
+
color: I = "primary",
|
|
217
|
+
...E
|
|
218
|
+
} = e, [b, y] = H(a || h || ""), T = re(), [p, L] = H(!1), [N, j] = H(u), [P, w] = H(
|
|
219
|
+
i ? u : l
|
|
220
|
+
);
|
|
221
|
+
$(() => {
|
|
222
|
+
a != null && y(a);
|
|
223
|
+
}, [a]), $(() => {
|
|
224
|
+
j(u), i && p === !1 && w(u);
|
|
225
|
+
}, [u, l]), $(() => {
|
|
226
|
+
w(i ? p === !0 ? l : u : l);
|
|
227
|
+
}, [i]);
|
|
228
|
+
const U = _(
|
|
229
|
+
X((f, F) => G(f, F), s),
|
|
230
|
+
[c]
|
|
231
|
+
), G = (f, F) => {
|
|
232
|
+
c && (c == null || c(f, F));
|
|
233
|
+
};
|
|
234
|
+
return /* @__PURE__ */ W(
|
|
235
|
+
oe,
|
|
236
|
+
{
|
|
237
|
+
style: R,
|
|
238
|
+
className: C,
|
|
239
|
+
theme: T,
|
|
240
|
+
color: I,
|
|
241
|
+
size: x,
|
|
242
|
+
focused: p,
|
|
243
|
+
disabled: r,
|
|
244
|
+
readOnly: n,
|
|
245
|
+
collapseOnBlur: i,
|
|
246
|
+
children: /* @__PURE__ */ W(
|
|
247
|
+
xe,
|
|
248
|
+
{
|
|
249
|
+
ref: t,
|
|
250
|
+
disabled: r,
|
|
251
|
+
value: b,
|
|
252
|
+
readOnly: n,
|
|
253
|
+
minRows: N,
|
|
254
|
+
maxRows: P,
|
|
255
|
+
onChange: (f) => {
|
|
256
|
+
y(f.target.value), U(f, f.target.value);
|
|
257
|
+
},
|
|
258
|
+
onFocus: (f) => {
|
|
259
|
+
L(!0), i && w(l), m == null || m(f);
|
|
260
|
+
},
|
|
261
|
+
onBlur: (f) => {
|
|
262
|
+
L(!1), i && w(u), g == null || g(f);
|
|
263
|
+
},
|
|
264
|
+
...E
|
|
265
|
+
}
|
|
266
|
+
)
|
|
267
|
+
}
|
|
268
|
+
);
|
|
269
|
+
});
|
|
270
|
+
ye.propTypes = {
|
|
271
|
+
id: o.string,
|
|
272
|
+
defaultValue: o.string,
|
|
273
|
+
value: o.string,
|
|
274
|
+
disabled: o.bool,
|
|
275
|
+
readOnly: o.bool,
|
|
276
|
+
debounceTime: o.number,
|
|
277
|
+
placeholder: o.string,
|
|
278
|
+
tabIndex: o.number,
|
|
279
|
+
/**
|
|
280
|
+
* Defines whether the textarea will collapse to its original size after it loses focus.
|
|
281
|
+
*/
|
|
282
|
+
collapseOnBlur: o.bool,
|
|
283
|
+
/**
|
|
284
|
+
* Minimum number of rows to show.
|
|
285
|
+
*/
|
|
286
|
+
minRows: o.number,
|
|
287
|
+
/**
|
|
288
|
+
* Maximum number of rows to be shown before scroller appears.
|
|
289
|
+
*/
|
|
290
|
+
maxRows: o.number,
|
|
291
|
+
/**
|
|
292
|
+
* `(event, value) => void`
|
|
293
|
+
*/
|
|
294
|
+
onChange: o.func,
|
|
295
|
+
/**
|
|
296
|
+
* `(event) => void`
|
|
297
|
+
*/
|
|
298
|
+
onBlur: o.func,
|
|
299
|
+
/**
|
|
300
|
+
* `(event) => void`
|
|
301
|
+
*/
|
|
302
|
+
onFocus: o.func,
|
|
303
|
+
//----------------
|
|
304
|
+
className: o.string,
|
|
305
|
+
style: o.object,
|
|
306
|
+
size: o.oneOf(["small", "medium", "large"]),
|
|
307
|
+
color: o.oneOf([
|
|
308
|
+
"primary",
|
|
309
|
+
"secondary",
|
|
310
|
+
"success",
|
|
311
|
+
"danger",
|
|
312
|
+
"warning",
|
|
313
|
+
"information",
|
|
314
|
+
"neutral",
|
|
315
|
+
"gray"
|
|
316
|
+
])
|
|
317
|
+
};
|
|
318
|
+
export {
|
|
319
|
+
ye as default
|
|
320
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";const d=require("react/jsx-runtime"),t=require("./index-DXnSjbfJ.cjs"),s=require("react"),B=require("./index-BjdOz5Ok.cjs"),c=require("./emotion-styled.browser.esm-Cbp_XsK4.cjs"),n=require("./utils-hdRGTsQ7.cjs"),F=require("./emotion-element-5486c51c.browser.esm-QRQ5FSjv.cjs"),D=c.newStyled.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
|
|
5
|
+
min-height: ${e=>n.getSizeValueWithUnits(e.theme,e.size)};
|
|
6
|
+
max-height: ${e=>n.getSizeValueWithUnits(e.theme,e.size)};
|
|
7
|
+
background-color: ${e=>n.getColorRgbaValue(e.theme,"Input",e.color,"enabled","background")};
|
|
8
|
+
border: 1px solid
|
|
9
|
+
${e=>n.getColorRgbaValue(e.theme,"Input",e.focused===!0?"primary":e.color,e.disabled===!0?"disabled":"enabled","border")};
|
|
10
|
+
border-radius: ${e=>n.getBorderRadiusValueWithUnits(e.theme,"regular")};
|
|
11
|
+
|
|
12
|
+
${e=>e.focused&&e.readOnly!==!0?n.getOutlineCss(e.theme):""}
|
|
13
|
+
${e=>e.disabled===!0?n.getDisabledStateCss(e.theme):""}
|
|
14
|
+
`,S=c.newStyled.span`
|
|
15
|
+
padding: 0 12px;
|
|
16
|
+
color: ${e=>n.getColorRgbaValue(e.theme,"Input",e.focused===!0?"primary":e.color,"enabled","prefix")};
|
|
17
|
+
`,E=c.newStyled(S)``,A=c.newStyled.input`
|
|
18
|
+
background: none;
|
|
19
|
+
border: none;
|
|
20
|
+
outline: none;
|
|
21
|
+
padding-top: 0.625rem;
|
|
22
|
+
padding-bottom: 0.625rem;
|
|
23
|
+
width: 100%;
|
|
24
|
+
|
|
25
|
+
${e=>n.getComponentTypographyCss(e.theme,"Input",e.size,"enabled")}
|
|
26
|
+
min-height: ${e=>n.getSizeValueWithUnits(e.theme,e.size)};
|
|
27
|
+
max-height: ${e=>n.getSizeValueWithUnits(e.theme,e.size)};
|
|
28
|
+
color: ${e=>n.getColorRgbaValue(e.theme,"Input",e.focused===!0?"primary":e.color,"enabled","text")};
|
|
29
|
+
caret-color: ${e=>n.getColorRgbaValue(e.theme,"Input",e.color,"enabled","caret")};
|
|
30
|
+
padding-right: ${e=>e.suffix?"0":"0.75rem"};
|
|
31
|
+
padding-left: ${e=>e.prefix?"0":"0.75rem"};
|
|
32
|
+
|
|
33
|
+
&::placeholder {
|
|
34
|
+
color: ${e=>n.getColorRgbaValue(e.theme,"Input",e.color,"enabled","placeholder")};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&:read-only {
|
|
38
|
+
cursor: default;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&:disabled {
|
|
42
|
+
${e=>n.getDisabledStateCss(e.theme)}
|
|
43
|
+
background: none;
|
|
44
|
+
}
|
|
45
|
+
`,$=s.forwardRef((e,C)=>{const{disabled:b,readOnly:f,defaultValue:V,value:o,debounceTime:I=180,type:z="text",placeholder:O,tabIndex:R,prefix:p,suffix:g,onChange:l,onBlur:m,onFocus:y,className:w="",style:q={},size:x="small",color:a="primary",...v}=e,i=F.useTheme(),[j,T]=s.useState(o||V||""),[u,P]=s.useState(!1);s.useEffect(()=>{o!=null&&T(o)},[o]);const W=s.useCallback(B.debounce((r,h)=>k(r,h),I),[l]),k=(r,h)=>{l&&(l==null||l(r,h))},U=r=>{T(r.target.value),W(r,r.target.value)},N=r=>{P(!0),y==null||y(r)},_=r=>{P(!1),m==null||m(r)};return d.jsxs(D,{style:q,className:w,theme:i,color:a,size:x,focused:u,disabled:b,readOnly:f,children:[p&&d.jsx(S,{theme:i,color:a,focused:u,className:"lnc-input-prefix",children:p}),d.jsx(A,{ref:C,type:z,theme:i,color:a,size:x,placeholder:O,prefix:p,suffix:g,disabled:b,readOnly:f,focused:u,onFocus:N,onBlur:_,onChange:U,tabIndex:R,value:j,...v}),g&&d.jsx(E,{theme:i,color:a,focused:u,className:"lnc-input-suffix",children:g})]})});$.propTypes={id:t.PropTypes.string,defaultValue:t.PropTypes.string,value:t.PropTypes.string,disabled:t.PropTypes.bool,readOnly:t.PropTypes.bool,debounceTime:t.PropTypes.number,placeholder:t.PropTypes.string,type:t.PropTypes.oneOf(["text","email"]),tabIndex:t.PropTypes.number,prefix:t.PropTypes.oneOfType([t.PropTypes.string,t.PropTypes.element]),suffix:t.PropTypes.oneOfType([t.PropTypes.string,t.PropTypes.element]),onChange:t.PropTypes.func,onBlur:t.PropTypes.func,onFocus:t.PropTypes.func,className:t.PropTypes.string,style:t.PropTypes.object,size:t.PropTypes.oneOf(["small","medium","large"]),color:t.PropTypes.oneOf(["primary","secondary","success","danger","warning","information","neutral","gray"])};module.exports=$;
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { jsxs as W, jsx as b } from "react/jsx-runtime";
|
|
2
|
+
import { P as t } from "./index-Ds9PUTwb.js";
|
|
3
|
+
import U, { useState as C, useEffect as _, useCallback as D } from "react";
|
|
4
|
+
import { d as E } from "./index-D5vEbKUT.js";
|
|
5
|
+
import { n as u } from "./emotion-styled.browser.esm-BZSYYThs.js";
|
|
6
|
+
import { f as s, b as a, c as q, h as A, g as O, a as G } from "./utils-DEke8iwo.js";
|
|
7
|
+
import { u as H } from "./emotion-element-5486c51c.browser.esm-CSejtOeT.js";
|
|
8
|
+
const J = u.div`
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
|
|
12
|
+
min-height: ${(e) => s(e.theme, e.size)};
|
|
13
|
+
max-height: ${(e) => s(e.theme, e.size)};
|
|
14
|
+
background-color: ${(e) => a(
|
|
15
|
+
e.theme,
|
|
16
|
+
"Input",
|
|
17
|
+
e.color,
|
|
18
|
+
"enabled",
|
|
19
|
+
"background"
|
|
20
|
+
)};
|
|
21
|
+
border: 1px solid
|
|
22
|
+
${(e) => a(
|
|
23
|
+
e.theme,
|
|
24
|
+
"Input",
|
|
25
|
+
e.focused === !0 ? "primary" : e.color,
|
|
26
|
+
e.disabled === !0 ? "disabled" : "enabled",
|
|
27
|
+
"border"
|
|
28
|
+
)};
|
|
29
|
+
border-radius: ${(e) => q(e.theme, "regular")};
|
|
30
|
+
|
|
31
|
+
${(e) => e.focused && e.readOnly !== !0 ? A(e.theme) : ""}
|
|
32
|
+
${(e) => e.disabled === !0 ? O(e.theme) : ""}
|
|
33
|
+
`, S = u.span`
|
|
34
|
+
padding: 0 12px;
|
|
35
|
+
color: ${(e) => a(
|
|
36
|
+
e.theme,
|
|
37
|
+
"Input",
|
|
38
|
+
e.focused === !0 ? "primary" : e.color,
|
|
39
|
+
"enabled",
|
|
40
|
+
"prefix"
|
|
41
|
+
)};
|
|
42
|
+
`, K = u(S)``, L = u.input`
|
|
43
|
+
background: none;
|
|
44
|
+
border: none;
|
|
45
|
+
outline: none;
|
|
46
|
+
padding-top: 0.625rem;
|
|
47
|
+
padding-bottom: 0.625rem;
|
|
48
|
+
width: 100%;
|
|
49
|
+
|
|
50
|
+
${(e) => G(e.theme, "Input", e.size, "enabled")}
|
|
51
|
+
min-height: ${(e) => s(e.theme, e.size)};
|
|
52
|
+
max-height: ${(e) => s(e.theme, e.size)};
|
|
53
|
+
color: ${(e) => a(
|
|
54
|
+
e.theme,
|
|
55
|
+
"Input",
|
|
56
|
+
e.focused === !0 ? "primary" : e.color,
|
|
57
|
+
"enabled",
|
|
58
|
+
"text"
|
|
59
|
+
)};
|
|
60
|
+
caret-color: ${(e) => a(e.theme, "Input", e.color, "enabled", "caret")};
|
|
61
|
+
padding-right: ${(e) => e.suffix ? "0" : "0.75rem"};
|
|
62
|
+
padding-left: ${(e) => e.prefix ? "0" : "0.75rem"};
|
|
63
|
+
|
|
64
|
+
&::placeholder {
|
|
65
|
+
color: ${(e) => a(
|
|
66
|
+
e.theme,
|
|
67
|
+
"Input",
|
|
68
|
+
e.color,
|
|
69
|
+
"enabled",
|
|
70
|
+
"placeholder"
|
|
71
|
+
)};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&:read-only {
|
|
75
|
+
cursor: default;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&:disabled {
|
|
79
|
+
${(e) => O(e.theme)}
|
|
80
|
+
background: none;
|
|
81
|
+
}
|
|
82
|
+
`, M = U.forwardRef((e, T) => {
|
|
83
|
+
const {
|
|
84
|
+
disabled: y,
|
|
85
|
+
readOnly: x,
|
|
86
|
+
defaultValue: V,
|
|
87
|
+
value: l,
|
|
88
|
+
debounceTime: z = 180,
|
|
89
|
+
type: v = "text",
|
|
90
|
+
placeholder: k,
|
|
91
|
+
tabIndex: w,
|
|
92
|
+
prefix: c,
|
|
93
|
+
suffix: m,
|
|
94
|
+
//----------------
|
|
95
|
+
onChange: r,
|
|
96
|
+
onBlur: f,
|
|
97
|
+
onFocus: h,
|
|
98
|
+
//----------------
|
|
99
|
+
className: B = "",
|
|
100
|
+
style: F = {},
|
|
101
|
+
size: p = "small",
|
|
102
|
+
color: o = "primary",
|
|
103
|
+
...N
|
|
104
|
+
} = e, d = H(), [R, $] = C(l || V || ""), [i, I] = C(!1);
|
|
105
|
+
_(() => {
|
|
106
|
+
l != null && $(l);
|
|
107
|
+
}, [l]);
|
|
108
|
+
const j = D(
|
|
109
|
+
E((n, g) => P(n, g), z),
|
|
110
|
+
[r]
|
|
111
|
+
), P = (n, g) => {
|
|
112
|
+
r && (r == null || r(n, g));
|
|
113
|
+
};
|
|
114
|
+
return /* @__PURE__ */ W(
|
|
115
|
+
J,
|
|
116
|
+
{
|
|
117
|
+
style: F,
|
|
118
|
+
className: B,
|
|
119
|
+
theme: d,
|
|
120
|
+
color: o,
|
|
121
|
+
size: p,
|
|
122
|
+
focused: i,
|
|
123
|
+
disabled: y,
|
|
124
|
+
readOnly: x,
|
|
125
|
+
children: [
|
|
126
|
+
c && /* @__PURE__ */ b(
|
|
127
|
+
S,
|
|
128
|
+
{
|
|
129
|
+
theme: d,
|
|
130
|
+
color: o,
|
|
131
|
+
focused: i,
|
|
132
|
+
className: "lnc-input-prefix",
|
|
133
|
+
children: c
|
|
134
|
+
}
|
|
135
|
+
),
|
|
136
|
+
/* @__PURE__ */ b(
|
|
137
|
+
L,
|
|
138
|
+
{
|
|
139
|
+
ref: T,
|
|
140
|
+
type: v,
|
|
141
|
+
theme: d,
|
|
142
|
+
color: o,
|
|
143
|
+
size: p,
|
|
144
|
+
placeholder: k,
|
|
145
|
+
prefix: c,
|
|
146
|
+
suffix: m,
|
|
147
|
+
disabled: y,
|
|
148
|
+
readOnly: x,
|
|
149
|
+
focused: i,
|
|
150
|
+
onFocus: (n) => {
|
|
151
|
+
I(!0), h == null || h(n);
|
|
152
|
+
},
|
|
153
|
+
onBlur: (n) => {
|
|
154
|
+
I(!1), f == null || f(n);
|
|
155
|
+
},
|
|
156
|
+
onChange: (n) => {
|
|
157
|
+
$(n.target.value), j(n, n.target.value);
|
|
158
|
+
},
|
|
159
|
+
tabIndex: w,
|
|
160
|
+
value: R,
|
|
161
|
+
...N
|
|
162
|
+
}
|
|
163
|
+
),
|
|
164
|
+
m && /* @__PURE__ */ b(
|
|
165
|
+
K,
|
|
166
|
+
{
|
|
167
|
+
theme: d,
|
|
168
|
+
color: o,
|
|
169
|
+
focused: i,
|
|
170
|
+
className: "lnc-input-suffix",
|
|
171
|
+
children: m
|
|
172
|
+
}
|
|
173
|
+
)
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
);
|
|
177
|
+
});
|
|
178
|
+
M.propTypes = {
|
|
179
|
+
id: t.string,
|
|
180
|
+
defaultValue: t.string,
|
|
181
|
+
value: t.string,
|
|
182
|
+
disabled: t.bool,
|
|
183
|
+
readOnly: t.bool,
|
|
184
|
+
/**
|
|
185
|
+
* Time in miliseconds before onChange event fires after it has been triggered.
|
|
186
|
+
*/
|
|
187
|
+
debounceTime: t.number,
|
|
188
|
+
placeholder: t.string,
|
|
189
|
+
type: t.oneOf(["text", "email"]),
|
|
190
|
+
tabIndex: t.number,
|
|
191
|
+
/**
|
|
192
|
+
* Reserved space before input. Intented to be used with plain text or `Icon` component.
|
|
193
|
+
*/
|
|
194
|
+
prefix: t.oneOfType([t.string, t.element]),
|
|
195
|
+
/**
|
|
196
|
+
* Reserved space after input. Intented to be used with plain text or `Icon` component.
|
|
197
|
+
*/
|
|
198
|
+
suffix: t.oneOfType([t.string, t.element]),
|
|
199
|
+
/**
|
|
200
|
+
* `(event, value) => void`
|
|
201
|
+
*/
|
|
202
|
+
onChange: t.func,
|
|
203
|
+
/**
|
|
204
|
+
* `(event) => void`
|
|
205
|
+
*/
|
|
206
|
+
onBlur: t.func,
|
|
207
|
+
/**
|
|
208
|
+
* `(event) => void`
|
|
209
|
+
*/
|
|
210
|
+
onFocus: t.func,
|
|
211
|
+
className: t.string,
|
|
212
|
+
style: t.object,
|
|
213
|
+
size: t.oneOf(["small", "medium", "large"]),
|
|
214
|
+
color: t.oneOf([
|
|
215
|
+
"primary",
|
|
216
|
+
"secondary",
|
|
217
|
+
"success",
|
|
218
|
+
"danger",
|
|
219
|
+
"warning",
|
|
220
|
+
"information",
|
|
221
|
+
"neutral",
|
|
222
|
+
"gray"
|
|
223
|
+
])
|
|
224
|
+
};
|
|
225
|
+
export {
|
|
226
|
+
M as default
|
|
227
|
+
};
|