@pismo/marola 1.0.0-beta.69 → 1.0.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Button-BAljjMv3.js → Button-DiLqcAJG.js} +2 -2
- package/dist/{ClickAwayListener-DbEYZpyh.js → ClickAwayListener-BaJ-OV_7.js} +3 -3
- package/dist/Dialog.module-DFEmFdYT.js +30 -0
- package/dist/Group-B3p31ftp.js +26 -0
- package/dist/Input.module-iOYlI_1w.js +405 -0
- package/dist/{Popup-Ck3XlWMq.js → Popup-lLWZt2wk.js} +3 -3
- package/dist/{Portal-oY3enyAm.js → Portal-B_Es6eUL.js} +2 -2
- package/dist/SelectButton-K3OIfR5m.js +61 -0
- package/dist/{Tabs.module-BGGTkDc5.js → Tabs.module-jkH1Qjn7.js} +7 -7
- package/dist/Toggle-BSvvbKBp.js +175 -0
- package/dist/assets/Advice.css +1 -1
- package/dist/assets/Autocomplete.css +1 -1
- package/dist/assets/Button.css +1 -1
- package/dist/assets/Checkbox.css +1 -1
- package/dist/assets/Dialog.css +1 -1
- package/dist/assets/EllipsisTooltip.css +1 -1
- package/dist/assets/Group.css +1 -1
- package/dist/assets/IconButton.css +1 -1
- package/dist/assets/Input.css +1 -1
- package/dist/assets/PageHeader.css +1 -1
- package/dist/assets/Pagination.css +1 -1
- package/dist/assets/SelectButton.css +1 -1
- package/dist/assets/Skeleton.css +1 -1
- package/dist/assets/Snackbar.css +1 -1
- package/dist/assets/SortTooltip.css +1 -1
- package/dist/assets/Stepper.css +1 -1
- package/dist/assets/Table.css +1 -1
- package/dist/assets/Tabs.css +1 -1
- package/dist/assets/Toggle.css +1 -1
- package/dist/assets/Toggle2.css +1 -1
- package/dist/assets/Typography.css +1 -1
- package/dist/{combineHooksSlotProps-C-zYvfnF.js → combineHooksSlotProps-BtBYUV_B.js} +1 -1
- package/dist/components/Adornment/Adornment.d.ts +2 -11
- package/dist/components/Adornment/Adornment.js +6 -6
- package/dist/components/Advice/Advice.d.ts +17 -32
- package/dist/components/Advice/Advice.js +40 -39
- package/dist/components/Advice/Advice.stories.d.ts +3 -4
- package/dist/components/Autocomplete/Autocomplete.d.ts +42 -12
- package/dist/components/Autocomplete/Autocomplete.js +435 -425
- package/dist/components/Autocomplete/Autocomplete.stories.d.ts +25 -3
- package/dist/components/Button/Button.d.ts +0 -2
- package/dist/components/Button/Button.js +49 -51
- package/dist/components/Checkbox/Checkbox.js +52 -52
- package/dist/components/Chip/Chip.d.ts +4 -6
- package/dist/components/Chip/Chip.js +6 -10
- package/dist/components/Chip/Chip.stories.d.ts +15 -6
- package/dist/components/Dialog/Actions.js +1 -1
- package/dist/components/Dialog/Backdrop.d.ts +3 -3
- package/dist/components/Dialog/Backdrop.js +7 -8
- package/dist/components/Dialog/CloseIconButton.d.ts +2 -1
- package/dist/components/Dialog/CloseIconButton.js +18 -15
- package/dist/components/Dialog/Dialog.d.ts +10 -16
- package/dist/components/Dialog/Dialog.js +167 -167
- package/dist/components/Dialog/Dialog.stories.d.ts +69 -75
- package/dist/components/Dialog/DialogTitle.d.ts +2 -5
- package/dist/components/Dialog/DialogTitle.js +16 -22
- package/dist/components/EllipsisTooltip/EllipsisTooltip.js +17 -30
- package/dist/components/EllipsisTooltip/EllipsisTooltip.stories.d.ts +1 -2
- package/dist/components/Icon/Icon.js +51 -331
- package/dist/components/Icon/types.d.ts +1 -1
- package/dist/components/IconButton/IconButton.js +42 -42
- package/dist/components/Input/Input.d.ts +5 -26
- package/dist/components/Input/Input.js +102 -514
- package/dist/components/Input/Input.stories.d.ts +21 -2
- package/dist/components/InputSearch/InputSearch.d.ts +7 -37
- package/dist/components/InputSearch/InputSearch.js +29 -27
- package/dist/components/InputSearch/InputSearch.stories.d.ts +3 -15
- package/dist/components/LoadingSpinner/LoadingSpinner.stories.d.ts +1 -1
- package/dist/components/PageHeader/PageHeader.d.ts +2 -6
- package/dist/components/PageHeader/PageHeader.js +71 -78
- package/dist/components/PageHeader/PageHeader.stories.d.ts +1 -3
- package/dist/components/Pagination/Pagination.d.ts +1 -5
- package/dist/components/Pagination/Pagination.js +91 -90
- package/dist/components/Pagination/Pagination.stories.d.ts +1 -1
- package/dist/components/RowItem/RowItem.d.ts +2 -2
- package/dist/components/RowItem/RowItem.js +5 -9
- package/dist/components/Select/Select.d.ts +0 -22
- package/dist/components/Select/Select.js +414 -476
- package/dist/components/Select/SelectButton.d.ts +0 -2
- package/dist/components/Select/SelectButton.js +2 -3
- package/dist/components/Skeleton/Skeleton.d.ts +1 -3
- package/dist/components/Skeleton/Skeleton.js +14 -20
- package/dist/components/Skeleton/SkeletonTable.stories.d.ts +1 -1
- package/dist/components/Snackbar/Snackbar.js +93 -93
- package/dist/components/Snackbar/Snackbar.stories.d.ts +1 -1
- package/dist/components/SortTooltip/SortTooltip.js +46 -46
- package/dist/components/Stepper/Stepper.js +35 -35
- package/dist/components/Table/Table.d.ts +1 -3
- package/dist/components/Table/Table.js +99 -87
- package/dist/components/Table/Table.stories.d.ts +1 -1
- package/dist/components/Tabs/Tab.d.ts +3 -5
- package/dist/components/Tabs/Tab.js +35 -36
- package/dist/components/Tabs/TabPanel.d.ts +2 -4
- package/dist/components/Tabs/TabPanel.js +38 -48
- package/dist/components/Tabs/Tabs.d.ts +4 -6
- package/dist/components/Tabs/Tabs.js +112 -115
- package/dist/components/TextDisplay/TextDisplay.d.ts +3 -7
- package/dist/components/TextDisplay/TextDisplay.js +37 -44
- package/dist/components/TextDisplay/TextDisplay.stories.d.ts +1 -2
- package/dist/components/Toggle/Toggle.js +55 -55
- package/dist/components/ToggleGroup/Group.d.ts +0 -2
- package/dist/components/ToggleGroup/Group.js +2 -4
- package/dist/components/ToggleGroup/Toggle.d.ts +0 -2
- package/dist/components/ToggleGroup/Toggle.js +4 -8
- package/dist/components/ToggleGroup/ToggleGroup.js +2 -2
- package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts +1 -3
- package/dist/components/Tooltip/Tooltip.d.ts +1 -3
- package/dist/components/Tooltip/Tooltip.js +4 -4
- package/dist/components/Tooltip/Tooltip.stories.d.ts +1 -2
- package/dist/components/Typography/Typography.js +47 -47
- package/dist/components/Typography/Typography.stories.d.ts +1 -1
- package/dist/contexts/SnackbarProvider/SnackbarProvider.js +30 -34
- package/dist/contexts/SnackbarProvider/SnackbarProvider.stories.d.ts +1 -1
- package/dist/{index-bQFToy-I.js → index-D3Wj0eid.js} +1 -1
- package/dist/main.d.ts +0 -8
- package/dist/main.js +79 -95
- package/dist/marola.css +1 -1
- package/dist/{ownerDocument-YGhwAnr1.js → ownerDocument-B61GUaFs.js} +1 -1
- package/dist/test-utils/assertStyles.d.ts +1 -1
- package/dist/{useButton-DcihopJG.js → useButton-Bn3MNH8I.js} +1 -1
- package/dist/{useList-B9C55YB7.js → useList-BpJT77u3.js} +2 -2
- package/dist/{useSlotProps-C_I1kEHr.js → useSlotProps-kRhf7Gil.js} +72 -73
- package/package.json +13 -22
- package/dist/Dialog.module-W7UCXlf3.js +0 -29
- package/dist/Group-DspH8hyO.js +0 -30
- package/dist/Popover.module-B4boCutS.js +0 -10
- package/dist/SelectButton-B38avP9u.js +0 -75
- package/dist/Toggle-MfR7l8Wn.js +0 -190
- package/dist/assets/Alert.css +0 -1
- package/dist/assets/Avatar.css +0 -1
- package/dist/assets/Description.css +0 -1
- package/dist/assets/Popover.css +0 -1
- package/dist/assets/RadioButton.css +0 -1
- package/dist/assets/ResultWithChips.css +0 -1
- package/dist/assets/StepperNavigator.css +0 -1
- package/dist/components/Adornment/Adornment.stories.d.ts +0 -14
- package/dist/components/Adornment/adornment.test.d.ts +0 -1
- package/dist/components/Alert/Alert.d.ts +0 -11
- package/dist/components/Alert/Alert.js +0 -46
- package/dist/components/Alert/Alert.stories.d.ts +0 -24
- package/dist/components/Alert/Alert.test.d.ts +0 -1
- package/dist/components/Avatar/Avatar.d.ts +0 -15
- package/dist/components/Avatar/Avatar.js +0 -51
- package/dist/components/Avatar/Avatar.stories.d.ts +0 -25
- package/dist/components/ConfirmationDialog/ConfirmationDialog.d.ts +0 -14
- package/dist/components/ConfirmationDialog/ConfirmationDialog.js +0 -37
- package/dist/components/ConfirmationDialog/ConfirmationDialog.stories.d.ts +0 -23
- package/dist/components/ConfirmationDialog/ConfirmationModal.test.d.ts +0 -1
- package/dist/components/Description/Description.d.ts +0 -21
- package/dist/components/Description/Description.js +0 -66
- package/dist/components/Description/Description.stories.d.ts +0 -22
- package/dist/components/Description/Description.test.d.ts +0 -1
- package/dist/components/PageHeader/PageHeader.test.d.ts +0 -1
- package/dist/components/Popover/Popover.d.ts +0 -32
- package/dist/components/Popover/Popover.js +0 -24
- package/dist/components/Popover/Popover.stories.d.ts +0 -34
- package/dist/components/Popover/PopoverBody.d.ts +0 -6
- package/dist/components/Popover/PopoverBody.js +0 -6
- package/dist/components/Popover/PopoverFooter.d.ts +0 -6
- package/dist/components/Popover/PopoverFooter.js +0 -6
- package/dist/components/Popover/PopoverHeader.d.ts +0 -6
- package/dist/components/Popover/PopoverHeader.js +0 -6
- package/dist/components/RadioButton/RadioButton.d.ts +0 -19
- package/dist/components/RadioButton/RadioButton.js +0 -37
- package/dist/components/RadioButton/RadioButton.stories.d.ts +0 -24
- package/dist/components/RadioButton/RadioButton.test.d.ts +0 -1
- package/dist/components/ResultWithChips/ResultWithChips.d.ts +0 -12
- package/dist/components/ResultWithChips/ResultWithChips.js +0 -33
- package/dist/components/RowItem/RowItem.stories.d.ts +0 -17
- package/dist/components/RowItem/rowItem.test.d.ts +0 -1
- package/dist/components/StepperNavigator/StepperNavigator.d.ts +0 -58
- package/dist/components/StepperNavigator/StepperNavigator.js +0 -115
- package/dist/components/StepperNavigator/StepperNavigator.stories.d.ts +0 -18
- package/dist/components/StepperNavigator/StepperNavigator.test.d.ts +0 -1
|
@@ -1,523 +1,111 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
`));
|
|
44
|
-
}
|
|
45
|
-
} else
|
|
46
|
-
E = i, _ = d, g = u, b = P, y = v;
|
|
47
|
-
const {
|
|
48
|
-
current: A
|
|
49
|
-
} = x.useRef(y != null), D = x.useCallback((n) => {
|
|
50
|
-
process.env.NODE_ENV !== "production" && n && n.nodeName !== "INPUT" && !n.focus && console.error(["MUI: You have provided a `slots.input` to the input component", "that does not correctly handle the `ref` prop.", "Make sure the `ref` prop is called with a HTMLInputElement."].join(`
|
|
51
|
-
`));
|
|
52
|
-
}, []), C = x.useRef(null), B = ge(C, R, D), [F, I] = x.useState(!1);
|
|
53
|
-
x.useEffect(() => {
|
|
54
|
-
!t && _ && F && (I(!1), c == null || c());
|
|
55
|
-
}, [t, _, F, c]);
|
|
56
|
-
const s = (n) => (r) => {
|
|
57
|
-
var o;
|
|
58
|
-
if (t != null && t.disabled) {
|
|
59
|
-
r.stopPropagation();
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
if ((o = n.onFocus) == null || o.call(n, r), t && t.onFocus) {
|
|
63
|
-
var a;
|
|
64
|
-
t == null || (a = t.onFocus) == null || a.call(t);
|
|
65
|
-
} else
|
|
66
|
-
I(!0);
|
|
67
|
-
}, M = (n) => (r) => {
|
|
68
|
-
var o;
|
|
69
|
-
(o = n.onBlur) == null || o.call(n, r), t && t.onBlur ? t.onBlur() : I(!1);
|
|
70
|
-
}, H = (n) => (r, ...o) => {
|
|
71
|
-
var a, w;
|
|
72
|
-
if (!A && (r.target || C.current) == null)
|
|
73
|
-
throw new Error(process.env.NODE_ENV !== "production" ? "MUI: Expected valid input target. Did you use a custom `slots.input` and forget to forward refs? See https://mui.com/r/input-component-ref-interface for more info." : Ne(17));
|
|
74
|
-
t == null || (a = t.onChange) == null || a.call(t, r), (w = n.onChange) == null || w.call(n, r, ...o);
|
|
75
|
-
}, q = (n) => (r) => {
|
|
76
|
-
var o;
|
|
77
|
-
C.current && r.currentTarget === r.target && C.current.focus(), (o = n.onClick) == null || o.call(n, r);
|
|
1
|
+
import { jsxs as n, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import * as g from "react";
|
|
3
|
+
import { useState as V, useId as k } from "react";
|
|
4
|
+
import { c as a } from "../../clsx-DB4S2d7J.js";
|
|
5
|
+
import { Typography as c } from "../Typography/Typography.js";
|
|
6
|
+
import { s as t, I as q } from "../../Input.module-iOYlI_1w.js";
|
|
7
|
+
const D = (s) => /* @__PURE__ */ g.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", "data-waves-icon": "fa/solid/circle-exclamation", fill: "currentColor", color: "currentColor", width: "1em", height: "1em", style: {
|
|
8
|
+
fill: "currentcolor",
|
|
9
|
+
color: "currentcolor",
|
|
10
|
+
width: "1em",
|
|
11
|
+
height: "1em"
|
|
12
|
+
}, ...s }, /* @__PURE__ */ g.createElement("path", { d: "M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM232 152C232 138.8 242.8 128 256 128s24 10.75 24 24v128c0 13.25-10.75 24-24 24S232 293.3 232 280V152zM256 400c-17.36 0-31.44-14.08-31.44-31.44c0-17.36 14.07-31.44 31.44-31.44s31.44 14.08 31.44 31.44C287.4 385.9 273.4 400 256 400z" })), M = ({
|
|
13
|
+
label: s,
|
|
14
|
+
infoMessage: d,
|
|
15
|
+
errorMessage: i,
|
|
16
|
+
leftIcon: o,
|
|
17
|
+
rightIcon: p,
|
|
18
|
+
id: w,
|
|
19
|
+
disabled: C,
|
|
20
|
+
type: N = "text",
|
|
21
|
+
maxLength: l,
|
|
22
|
+
hideCharsCounter: x = !1,
|
|
23
|
+
onChange: m,
|
|
24
|
+
classNameWrapper: b,
|
|
25
|
+
classNameLabel: v,
|
|
26
|
+
classNameInput: y,
|
|
27
|
+
classNameInfoMessage: I,
|
|
28
|
+
classNameErrorMessage: j,
|
|
29
|
+
classNameCharsCounter: z,
|
|
30
|
+
"data-testid-wrapper": E,
|
|
31
|
+
"data-testid-label": A,
|
|
32
|
+
"data-testid-input": P,
|
|
33
|
+
"data-testid-infoMessage": S,
|
|
34
|
+
"data-testid-errorMessage": $,
|
|
35
|
+
"data-testid-charsCounter": B,
|
|
36
|
+
...u
|
|
37
|
+
}) => {
|
|
38
|
+
const [F, O] = V(0), R = k(), h = w || `input_${R}`;
|
|
39
|
+
Object.assign(u, { "data-testid": P });
|
|
40
|
+
const T = (e) => {
|
|
41
|
+
var _, f;
|
|
42
|
+
O((f = (_ = e == null ? void 0 : e.target) == null ? void 0 : _.value) == null ? void 0 : f.length), m && m(e);
|
|
78
43
|
};
|
|
79
|
-
return {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
const Ee = ["aria-describedby", "aria-label", "aria-labelledby", "autoComplete", "autoFocus", "className", "defaultValue", "disabled", "endAdornment", "error", "id", "multiline", "name", "onClick", "onChange", "onKeyDown", "onKeyUp", "onFocus", "onBlur", "placeholder", "readOnly", "required", "startAdornment", "value", "type", "rows", "slotProps", "slots", "minRows", "maxRows"], Fe = (l) => {
|
|
116
|
-
const {
|
|
117
|
-
disabled: i,
|
|
118
|
-
error: d,
|
|
119
|
-
focused: u,
|
|
120
|
-
formControlContext: c,
|
|
121
|
-
multiline: m,
|
|
122
|
-
startAdornment: N,
|
|
123
|
-
endAdornment: P
|
|
124
|
-
} = l;
|
|
125
|
-
return we({
|
|
126
|
-
root: ["root", i && "disabled", d && "error", u && "focused", !!c && "formControl", m && "multiline", !!N && "adornedStart", !!P && "adornedEnd"],
|
|
127
|
-
input: ["input", i && "disabled", m && "multiline"]
|
|
128
|
-
}, xe(Pe));
|
|
129
|
-
}, oe = /* @__PURE__ */ x.forwardRef(function(i, d) {
|
|
130
|
-
var u, c, m;
|
|
131
|
-
const {
|
|
132
|
-
"aria-describedby": N,
|
|
133
|
-
"aria-label": P,
|
|
134
|
-
"aria-labelledby": v,
|
|
135
|
-
autoComplete: R,
|
|
136
|
-
autoFocus: t,
|
|
137
|
-
className: E,
|
|
138
|
-
defaultValue: _,
|
|
139
|
-
disabled: g,
|
|
140
|
-
endAdornment: b,
|
|
141
|
-
error: y,
|
|
142
|
-
id: k,
|
|
143
|
-
multiline: h = !1,
|
|
144
|
-
name: S,
|
|
145
|
-
onClick: A,
|
|
146
|
-
onChange: D,
|
|
147
|
-
onKeyDown: C,
|
|
148
|
-
onKeyUp: B,
|
|
149
|
-
onFocus: F,
|
|
150
|
-
onBlur: I,
|
|
151
|
-
placeholder: s,
|
|
152
|
-
readOnly: M,
|
|
153
|
-
required: H,
|
|
154
|
-
startAdornment: q,
|
|
155
|
-
value: L,
|
|
156
|
-
type: U,
|
|
157
|
-
rows: n,
|
|
158
|
-
slotProps: r = {},
|
|
159
|
-
slots: o = {},
|
|
160
|
-
minRows: a,
|
|
161
|
-
maxRows: w
|
|
162
|
-
} = i, $ = be(i, Ee), {
|
|
163
|
-
getRootProps: O,
|
|
164
|
-
getInputProps: Y,
|
|
165
|
-
focused: V,
|
|
166
|
-
formControlContext: re,
|
|
167
|
-
error: ae,
|
|
168
|
-
disabled: se
|
|
169
|
-
} = Re({
|
|
170
|
-
disabled: g,
|
|
171
|
-
defaultValue: _,
|
|
172
|
-
error: y,
|
|
173
|
-
onBlur: I,
|
|
174
|
-
onClick: A,
|
|
175
|
-
onChange: D,
|
|
176
|
-
onFocus: F,
|
|
177
|
-
required: H,
|
|
178
|
-
value: L
|
|
179
|
-
}), Q = h ? void 0 : U ?? "text", W = f({}, i, {
|
|
180
|
-
disabled: se,
|
|
181
|
-
error: ae,
|
|
182
|
-
focused: V,
|
|
183
|
-
formControlContext: re,
|
|
184
|
-
multiline: h,
|
|
185
|
-
type: Q
|
|
186
|
-
}), X = Fe(W), le = {
|
|
187
|
-
"aria-describedby": N,
|
|
188
|
-
"aria-label": P,
|
|
189
|
-
"aria-labelledby": v,
|
|
190
|
-
autoComplete: R,
|
|
191
|
-
autoFocus: t,
|
|
192
|
-
id: k,
|
|
193
|
-
onKeyDown: C,
|
|
194
|
-
onKeyUp: B,
|
|
195
|
-
name: S,
|
|
196
|
-
placeholder: s,
|
|
197
|
-
readOnly: M,
|
|
198
|
-
type: Q
|
|
199
|
-
}, Z = (u = o.root) != null ? u : "div", ie = ee({
|
|
200
|
-
elementType: Z,
|
|
201
|
-
getSlotProps: O,
|
|
202
|
-
externalSlotProps: r.root,
|
|
203
|
-
externalForwardedProps: $,
|
|
204
|
-
additionalProps: {
|
|
205
|
-
ref: d
|
|
206
|
-
},
|
|
207
|
-
ownerState: W,
|
|
208
|
-
className: [X.root, E]
|
|
209
|
-
}), z = h ? (c = o.textarea) != null ? c : "textarea" : (m = o.input) != null ? m : "input", ue = ee({
|
|
210
|
-
elementType: z,
|
|
211
|
-
getSlotProps: (pe) => Y(f({}, le, pe)),
|
|
212
|
-
externalSlotProps: r.input,
|
|
213
|
-
additionalProps: f({
|
|
214
|
-
rows: h ? n : void 0
|
|
215
|
-
}, h && !Ce(z) && {
|
|
216
|
-
minRows: n || a,
|
|
217
|
-
maxRows: n || w
|
|
218
|
-
}),
|
|
219
|
-
ownerState: W,
|
|
220
|
-
className: X.input
|
|
221
|
-
});
|
|
222
|
-
return process.env.NODE_ENV !== "production" && h && n && (a || w) && console.warn("MUI: You can not use the `minRows` or `maxRows` props when the input `rows` prop is set."), /* @__PURE__ */ K(Z, f({}, ie, {
|
|
223
|
-
children: [q, /* @__PURE__ */ j(z, f({}, ue)), b]
|
|
224
|
-
}));
|
|
225
|
-
});
|
|
226
|
-
process.env.NODE_ENV !== "production" && (oe.propTypes = {
|
|
227
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
228
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
229
|
-
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
230
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
231
|
-
/**
|
|
232
|
-
* @ignore
|
|
233
|
-
*/
|
|
234
|
-
"aria-describedby": e.string,
|
|
235
|
-
/**
|
|
236
|
-
* @ignore
|
|
237
|
-
*/
|
|
238
|
-
"aria-label": e.string,
|
|
239
|
-
/**
|
|
240
|
-
* @ignore
|
|
241
|
-
*/
|
|
242
|
-
"aria-labelledby": e.string,
|
|
243
|
-
/**
|
|
244
|
-
* This prop helps users to fill forms faster, especially on mobile devices.
|
|
245
|
-
* The name can be confusing, as it's more like an autofill.
|
|
246
|
-
* You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).
|
|
247
|
-
*/
|
|
248
|
-
autoComplete: e.string,
|
|
249
|
-
/**
|
|
250
|
-
* If `true`, the `input` element is focused during the first mount.
|
|
251
|
-
*/
|
|
252
|
-
autoFocus: e.bool,
|
|
253
|
-
/**
|
|
254
|
-
* Class name applied to the root element.
|
|
255
|
-
*/
|
|
256
|
-
className: e.string,
|
|
257
|
-
/**
|
|
258
|
-
* The default value. Use when the component is not controlled.
|
|
259
|
-
*/
|
|
260
|
-
defaultValue: e.any,
|
|
261
|
-
/**
|
|
262
|
-
* If `true`, the component is disabled.
|
|
263
|
-
* The prop defaults to the value (`false`) inherited from the parent FormControl component.
|
|
264
|
-
*/
|
|
265
|
-
disabled: e.bool,
|
|
266
|
-
/**
|
|
267
|
-
* Trailing adornment for this input.
|
|
268
|
-
*/
|
|
269
|
-
endAdornment: e.node,
|
|
270
|
-
/**
|
|
271
|
-
* If `true`, the `input` will indicate an error by setting the `aria-invalid` attribute on the input and the `baseui--error` class on the root element.
|
|
272
|
-
* The prop defaults to the value (`false`) inherited from the parent FormControl component.
|
|
273
|
-
*/
|
|
274
|
-
error: e.bool,
|
|
275
|
-
/**
|
|
276
|
-
* The id of the `input` element.
|
|
277
|
-
*/
|
|
278
|
-
id: e.string,
|
|
279
|
-
/**
|
|
280
|
-
* @ignore
|
|
281
|
-
*/
|
|
282
|
-
inputRef: e.oneOfType([e.func, e.shape({
|
|
283
|
-
current: e.object
|
|
284
|
-
})]),
|
|
285
|
-
/**
|
|
286
|
-
* Maximum number of rows to display when multiline option is set to true.
|
|
287
|
-
*/
|
|
288
|
-
maxRows: e.number,
|
|
289
|
-
/**
|
|
290
|
-
* Minimum number of rows to display when multiline option is set to true.
|
|
291
|
-
*/
|
|
292
|
-
minRows: e.number,
|
|
293
|
-
/**
|
|
294
|
-
* If `true`, a `textarea` element is rendered.
|
|
295
|
-
* @default false
|
|
296
|
-
*/
|
|
297
|
-
multiline: e.bool,
|
|
298
|
-
/**
|
|
299
|
-
* Name attribute of the `input` element.
|
|
300
|
-
*/
|
|
301
|
-
name: e.string,
|
|
302
|
-
/**
|
|
303
|
-
* @ignore
|
|
304
|
-
*/
|
|
305
|
-
onBlur: e.func,
|
|
306
|
-
/**
|
|
307
|
-
* @ignore
|
|
308
|
-
*/
|
|
309
|
-
onChange: e.func,
|
|
310
|
-
/**
|
|
311
|
-
* @ignore
|
|
312
|
-
*/
|
|
313
|
-
onClick: e.func,
|
|
314
|
-
/**
|
|
315
|
-
* @ignore
|
|
316
|
-
*/
|
|
317
|
-
onFocus: e.func,
|
|
318
|
-
/**
|
|
319
|
-
* @ignore
|
|
320
|
-
*/
|
|
321
|
-
onKeyDown: e.func,
|
|
322
|
-
/**
|
|
323
|
-
* @ignore
|
|
324
|
-
*/
|
|
325
|
-
onKeyUp: e.func,
|
|
326
|
-
/**
|
|
327
|
-
* The short hint displayed in the `input` before the user enters a value.
|
|
328
|
-
*/
|
|
329
|
-
placeholder: e.string,
|
|
330
|
-
/**
|
|
331
|
-
* It prevents the user from changing the value of the field
|
|
332
|
-
* (not from interacting with the field).
|
|
333
|
-
*/
|
|
334
|
-
readOnly: e.bool,
|
|
335
|
-
/**
|
|
336
|
-
* If `true`, the `input` element is required.
|
|
337
|
-
* The prop defaults to the value (`false`) inherited from the parent FormControl component.
|
|
338
|
-
*/
|
|
339
|
-
required: e.bool,
|
|
340
|
-
/**
|
|
341
|
-
* Number of rows to display when multiline option is set to true.
|
|
342
|
-
*/
|
|
343
|
-
rows: e.number,
|
|
344
|
-
/**
|
|
345
|
-
* The props used for each slot inside the Input.
|
|
346
|
-
* @default {}
|
|
347
|
-
*/
|
|
348
|
-
slotProps: e.shape({
|
|
349
|
-
input: e.oneOfType([e.func, e.object]),
|
|
350
|
-
root: e.oneOfType([e.func, e.object])
|
|
351
|
-
}),
|
|
352
|
-
/**
|
|
353
|
-
* The components used for each slot inside the InputBase.
|
|
354
|
-
* Either a string to use a HTML element or a component.
|
|
355
|
-
* @default {}
|
|
356
|
-
*/
|
|
357
|
-
slots: e.shape({
|
|
358
|
-
input: e.elementType,
|
|
359
|
-
root: e.elementType,
|
|
360
|
-
textarea: e.elementType
|
|
361
|
-
}),
|
|
362
|
-
/**
|
|
363
|
-
* Leading adornment for this input.
|
|
364
|
-
*/
|
|
365
|
-
startAdornment: e.node,
|
|
366
|
-
/**
|
|
367
|
-
* Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types).
|
|
368
|
-
* @default 'text'
|
|
369
|
-
*/
|
|
370
|
-
type: e.oneOf(["button", "checkbox", "color", "date", "datetime-local", "email", "file", "hidden", "image", "month", "number", "password", "radio", "range", "reset", "search", "submit", "tel", "text", "time", "url", "week"]),
|
|
371
|
-
/**
|
|
372
|
-
* The value of the `input` element, required for a controlled component.
|
|
373
|
-
*/
|
|
374
|
-
value: e.any
|
|
375
|
-
});
|
|
376
|
-
const Ie = "_input_3n32h_57", Oe = "_input__label_3n32h_84", p = {
|
|
377
|
-
"u-typography-h1": "_u-typography-h1_3n32h_1",
|
|
378
|
-
"u-typography-h2": "_u-typography-h2_3n32h_8",
|
|
379
|
-
"u-typography-h3": "_u-typography-h3_3n32h_15",
|
|
380
|
-
"u-typography-h4": "_u-typography-h4_3n32h_22",
|
|
381
|
-
"u-typography-h5": "_u-typography-h5_3n32h_29",
|
|
382
|
-
"u-typography-h6": "_u-typography-h6_3n32h_36",
|
|
383
|
-
"u-typography-base": "_u-typography-base_3n32h_43",
|
|
384
|
-
"u-typography-base--xxl": "_u-typography-base--xxl_3n32h_49",
|
|
385
|
-
"u-typography-base--xl": "_u-typography-base--xl_3n32h_53",
|
|
386
|
-
"u-typography-base--lg": "_u-typography-base--lg_3n32h_57",
|
|
387
|
-
"input__input-el": "_input__input-el_3n32h_57",
|
|
388
|
-
"u-typography-base--sm": "_u-typography-base--sm_3n32h_61",
|
|
389
|
-
"u-typography-base--bold": "_u-typography-base--bold_3n32h_65",
|
|
390
|
-
"u-typography-base--strikethrough": "_u-typography-base--strikethrough_3n32h_68",
|
|
391
|
-
"u-typography-base--underlined": "_u-typography-base--underlined_3n32h_71",
|
|
392
|
-
"u-typography-base--strikethrough-underlined": "_u-typography-base--strikethrough-underlined_3n32h_74",
|
|
393
|
-
input: Ie,
|
|
394
|
-
"input__messages-wrapper": "_input__messages-wrapper_3n32h_81",
|
|
395
|
-
input__label: Oe,
|
|
396
|
-
"input__input-el-wrapper": "_input__input-el-wrapper_3n32h_89",
|
|
397
|
-
"input__left-icon": "_input__left-icon_3n32h_108",
|
|
398
|
-
"input__right-icon": "_input__right-icon_3n32h_108",
|
|
399
|
-
"input__info-message": "_input__info-message_3n32h_134",
|
|
400
|
-
"input__error-message": "_input__error-message_3n32h_134",
|
|
401
|
-
"input__chars-counter": "_input__chars-counter_3n32h_145",
|
|
402
|
-
"input--disabled": "_input--disabled_3n32h_150",
|
|
403
|
-
"input--focused": "_input--focused_3n32h_156",
|
|
404
|
-
"input--error": "_input--error_3n32h_159"
|
|
405
|
-
}, je = de(
|
|
406
|
-
({
|
|
407
|
-
label: l,
|
|
408
|
-
infoMessage: i,
|
|
409
|
-
error: d,
|
|
410
|
-
errorMessage: u,
|
|
411
|
-
leftIcon: c,
|
|
412
|
-
rightIcon: m,
|
|
413
|
-
id: N,
|
|
414
|
-
disabled: P,
|
|
415
|
-
type: v = "text",
|
|
416
|
-
maxLength: R,
|
|
417
|
-
decimalLength: t = 10,
|
|
418
|
-
hideCharsCounter: E = !1,
|
|
419
|
-
onChange: _,
|
|
420
|
-
classNameWrapper: g,
|
|
421
|
-
classNameLabel: b,
|
|
422
|
-
classNameInput: y,
|
|
423
|
-
classNameInfoMessage: k,
|
|
424
|
-
classNameErrorMessage: h,
|
|
425
|
-
classNameCharsCounter: S,
|
|
426
|
-
"data-testid-wrapper": A,
|
|
427
|
-
"data-testid-label": D,
|
|
428
|
-
"data-testid-input": C,
|
|
429
|
-
"data-testid-infoMessage": B,
|
|
430
|
-
"data-testid-errorMessage": F,
|
|
431
|
-
"data-testid-charsCounter": I,
|
|
432
|
-
...s
|
|
433
|
-
}, M) => {
|
|
434
|
-
const [H, q] = ce(0), L = _e(), U = N || `input_${L}`;
|
|
435
|
-
Object.assign(s, { "data-testid": C });
|
|
436
|
-
const n = R && !E, r = (a) => {
|
|
437
|
-
var w, $;
|
|
438
|
-
if (v === "number") {
|
|
439
|
-
let O = String(a.target.value);
|
|
440
|
-
const [Y, V] = O.split(".");
|
|
441
|
-
O !== "" && (V != null && V.length ? O = [Number(Y), V.slice(0, t)].join(".") : O = String(Number(Y))), a.target.value = O;
|
|
44
|
+
return /* @__PURE__ */ n("div", { className: a(t.input, b), "data-testid": E, children: [
|
|
45
|
+
s && /* @__PURE__ */ r(
|
|
46
|
+
c,
|
|
47
|
+
{
|
|
48
|
+
element: "label",
|
|
49
|
+
elementProps: { htmlFor: h },
|
|
50
|
+
className: a(t.input__label, v),
|
|
51
|
+
"data-testid": A,
|
|
52
|
+
children: s
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
/* @__PURE__ */ r(
|
|
56
|
+
q,
|
|
57
|
+
{
|
|
58
|
+
id: h,
|
|
59
|
+
type: N,
|
|
60
|
+
disabled: C,
|
|
61
|
+
error: !!i,
|
|
62
|
+
"aria-label": s,
|
|
63
|
+
slotProps: {
|
|
64
|
+
root: (e) => ({
|
|
65
|
+
className: a(t["input__input-el-wrapper"], {
|
|
66
|
+
[t["input--disabled"]]: e.disabled,
|
|
67
|
+
[t["input--focused"]]: e.focused,
|
|
68
|
+
[t["input--error"]]: e.error
|
|
69
|
+
})
|
|
70
|
+
}),
|
|
71
|
+
input: {
|
|
72
|
+
className: a(t["input__input-el"], y),
|
|
73
|
+
maxLength: l,
|
|
74
|
+
onChange: T,
|
|
75
|
+
...u
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
startAdornment: o && /* @__PURE__ */ r("span", { className: t["input__left-icon"], children: o }),
|
|
79
|
+
endAdornment: p && /* @__PURE__ */ r("span", { className: t["input__right-icon"], children: p })
|
|
442
80
|
}
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
} : {
|
|
448
|
-
type: void 0,
|
|
449
|
-
multiline: s.multiline,
|
|
450
|
-
rows: (s == null ? void 0 : s.rows) || 5,
|
|
451
|
-
minRows: s == null ? void 0 : s.minRows,
|
|
452
|
-
maxRows: s == null ? void 0 : s.maxRows
|
|
453
|
-
}, [s]);
|
|
454
|
-
return /* @__PURE__ */ K("div", { className: T(p.input, g), "data-testid": A, children: [
|
|
455
|
-
l && /* @__PURE__ */ j(
|
|
456
|
-
G,
|
|
81
|
+
),
|
|
82
|
+
/* @__PURE__ */ n("div", { className: t["input__messages-wrapper"], children: [
|
|
83
|
+
(i || d) && /* @__PURE__ */ n(
|
|
84
|
+
c,
|
|
457
85
|
{
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
86
|
+
className: i ? a(t["input__error-message"], j) : a(t["input__info-message"], I),
|
|
87
|
+
"data-testid": i ? $ : S,
|
|
88
|
+
children: [
|
|
89
|
+
/* @__PURE__ */ r(D, {}),
|
|
90
|
+
i || d
|
|
91
|
+
]
|
|
463
92
|
}
|
|
464
93
|
),
|
|
465
|
-
/* @__PURE__ */
|
|
466
|
-
|
|
94
|
+
l && !x && /* @__PURE__ */ n(
|
|
95
|
+
c,
|
|
467
96
|
{
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
[p["input--disabled"]]: a.disabled,
|
|
476
|
-
[p["input--focused"]]: a.focused,
|
|
477
|
-
[p["input--error"]]: a.error
|
|
478
|
-
})
|
|
479
|
-
}),
|
|
480
|
-
input: {
|
|
481
|
-
ref: M,
|
|
482
|
-
className: T(p["input__input-el"], y),
|
|
483
|
-
maxLength: R,
|
|
484
|
-
onChange: r,
|
|
485
|
-
...s
|
|
486
|
-
}
|
|
487
|
-
},
|
|
488
|
-
startAdornment: c && /* @__PURE__ */ j("span", { className: p["input__left-icon"], children: c }),
|
|
489
|
-
endAdornment: m && /* @__PURE__ */ j("span", { className: p["input__right-icon"], children: m }),
|
|
490
|
-
...o
|
|
97
|
+
className: a(t["input__chars-counter"], z),
|
|
98
|
+
"data-testid": B,
|
|
99
|
+
children: [
|
|
100
|
+
F,
|
|
101
|
+
" / ",
|
|
102
|
+
l
|
|
103
|
+
]
|
|
491
104
|
}
|
|
492
|
-
)
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
{
|
|
497
|
-
className: u ? T(p["input__error-message"], h) : T(p["input__info-message"], k),
|
|
498
|
-
"data-testid": u ? F : B,
|
|
499
|
-
children: [
|
|
500
|
-
/* @__PURE__ */ j(me, { icon: u ? "circle-exclamation" : "circle-info" }),
|
|
501
|
-
u || i
|
|
502
|
-
]
|
|
503
|
-
}
|
|
504
|
-
),
|
|
505
|
-
n && /* @__PURE__ */ K(
|
|
506
|
-
G,
|
|
507
|
-
{
|
|
508
|
-
className: T(p["input__chars-counter"], S),
|
|
509
|
-
"data-testid": I,
|
|
510
|
-
children: [
|
|
511
|
-
H,
|
|
512
|
-
" / ",
|
|
513
|
-
R
|
|
514
|
-
]
|
|
515
|
-
}
|
|
516
|
-
)
|
|
517
|
-
] })
|
|
518
|
-
] });
|
|
519
|
-
}
|
|
520
|
-
);
|
|
105
|
+
)
|
|
106
|
+
] })
|
|
107
|
+
] });
|
|
108
|
+
};
|
|
521
109
|
export {
|
|
522
|
-
|
|
110
|
+
M as Input
|
|
523
111
|
};
|
|
@@ -2,7 +2,27 @@ import { StoryObj } from '@storybook/react';
|
|
|
2
2
|
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component:
|
|
5
|
+
component: ({ label, infoMessage, errorMessage, leftIcon, rightIcon, id, disabled, type, maxLength, hideCharsCounter, onChange, classNameWrapper, classNameLabel, classNameInput, classNameInfoMessage, classNameErrorMessage, classNameCharsCounter, "data-testid-wrapper": testIdWrapper, "data-testid-label": testIdLabel, "data-testid-input": testIdInput, "data-testid-infoMessage": testIdInfoMessage, "data-testid-errorMessage": testIdErrorMessage, "data-testid-charsCounter": testIdCharsCounter, ...rest }: import('react').InputHTMLAttributes<HTMLInputElement> & {
|
|
6
|
+
label?: string | undefined;
|
|
7
|
+
infoMessage?: string | undefined;
|
|
8
|
+
errorMessage?: string | undefined;
|
|
9
|
+
leftIcon?: import('react').ReactNode;
|
|
10
|
+
rightIcon?: import('react').ReactNode;
|
|
11
|
+
type?: "search" | "text" | "password" | undefined;
|
|
12
|
+
hideCharsCounter?: boolean | undefined;
|
|
13
|
+
classNameWrapper?: string | undefined;
|
|
14
|
+
classNameLabel?: string | undefined;
|
|
15
|
+
classNameInput?: string | undefined;
|
|
16
|
+
classNameInfoMessage?: string | undefined;
|
|
17
|
+
classNameErrorMessage?: string | undefined;
|
|
18
|
+
classNameCharsCounter?: string | undefined;
|
|
19
|
+
'data-testid-wrapper'?: string | undefined;
|
|
20
|
+
'data-testid-label'?: string | undefined;
|
|
21
|
+
'data-testid-input'?: string | undefined;
|
|
22
|
+
'data-testid-infoMessage'?: string | undefined;
|
|
23
|
+
'data-testid-errorMessage'?: string | undefined;
|
|
24
|
+
'data-testid-charsCounter'?: string | undefined;
|
|
25
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
26
|
tags: string[];
|
|
7
27
|
parameters: {
|
|
8
28
|
layout: string;
|
|
@@ -21,4 +41,3 @@ export declare const WithRightIconAndClickEvent: Story;
|
|
|
21
41
|
export declare const WithBothIcons: Story;
|
|
22
42
|
export declare const WithInfoMessage: Story;
|
|
23
43
|
export declare const WithErrorMessage: Story;
|
|
24
|
-
export declare const Textarea: Story;
|