@pismo/marola 0.0.1-alpha.5 → 0.0.1-alpha.7
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 +13 -2
- package/dist/{Button-D--uN90N.js → Button-B1umG8kJ.js} +3 -3
- package/dist/ClickAwayListener-BKznXF1d.js +106 -0
- package/dist/Dialog.module-CGVM5V_D.js +15 -0
- package/dist/Portal-BcdMtRGF.js +73 -0
- package/dist/{Tabs.module-BKlNuSPH.js → Tabs.module-BA-PC7fA.js} +13 -13
- package/dist/_commonjsHelpers-CT_km90n.js +30 -0
- package/dist/assets/Advice.css +1 -0
- package/dist/assets/Button.css +1 -1
- package/dist/assets/Checkbox.css +1 -0
- package/dist/assets/Dialog.css +1 -1
- package/dist/assets/IconButton.css +1 -1
- package/dist/assets/Input.css +1 -0
- package/dist/assets/Pagination.css +1 -1
- package/dist/assets/Skeleton.css +1 -0
- package/dist/assets/Snackbar.css +1 -0
- package/dist/assets/SortTooltip.css +1 -0
- package/dist/assets/Stepper.css +1 -0
- package/dist/assets/Table.css +1 -0
- package/dist/assets/Tabs.css +1 -1
- package/dist/assets/Toggle.css +1 -0
- package/dist/assets/Tooltip.css +1 -0
- package/dist/assets/Typography.css +1 -1
- package/dist/assets/{main.css → global.css} +1 -1
- package/dist/components/Advice/Advice.d.ts +16 -0
- package/dist/components/Advice/Advice.js +25 -0
- package/dist/components/Button/Button.d.ts +9 -1
- package/dist/components/Button/Button.js +54 -38
- package/dist/components/Button/Button.stories.d.ts +60 -0
- package/dist/components/Button/Button.stories.js +40 -0
- package/dist/components/Checkbox/Checkbox.d.ts +17 -0
- package/dist/components/Checkbox/Checkbox.js +48 -0
- package/dist/components/Dialog/Actions.js +1 -1
- package/dist/components/Dialog/Backdrop.d.ts +1 -1
- package/dist/components/Dialog/Backdrop.js +1 -1
- package/dist/components/Dialog/CloseIconButton.js +12 -124
- package/dist/components/Dialog/Dialog.d.ts +3 -2
- package/dist/components/Dialog/Dialog.js +418 -20072
- package/dist/components/Dialog/Dialog.stories.d.ts +343 -0
- package/dist/components/Dialog/Dialog.stories.js +59 -0
- package/dist/components/Dialog/Title.js +1 -1
- package/dist/components/Icon/Icon.d.ts +18 -0
- package/dist/components/Icon/Icon.js +95 -0
- package/dist/components/IconButton/IconButton.d.ts +3 -3
- package/dist/components/IconButton/IconButton.js +54 -65
- package/dist/components/Input/Input.d.ts +44 -0
- package/dist/components/Input/Input.js +497 -0
- package/dist/components/Input/Input.stories.d.ts +43 -0
- package/dist/components/Input/Input.stories.js +106 -0
- package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +2 -0
- package/dist/components/LoadingSpinner/LoadingSpinner.stories.d.ts +14 -0
- package/dist/components/LoadingSpinner/LoadingSpinner.stories.js +38 -0
- package/dist/components/PageHeader/PageHeader.d.ts +25 -15
- package/dist/components/PageHeader/PageHeader.js +32 -50
- package/dist/components/PageHeader/PageHeader.stories.d.ts +43 -0
- package/dist/components/PageHeader/PageHeader.stories.js +49 -0
- package/dist/components/Pagination/Pagination.d.ts +1 -1
- package/dist/components/Pagination/Pagination.js +47 -47
- package/dist/components/Skeleton/Skeleton.d.ts +18 -0
- package/dist/components/Skeleton/Skeleton.js +26 -0
- package/dist/components/Snackbar/Snackbar.d.ts +13 -0
- package/dist/components/Snackbar/Snackbar.js +622 -0
- package/dist/components/SortTooltip/SortTooltip.d.ts +26 -0
- package/dist/components/SortTooltip/SortTooltip.js +67 -1
- package/dist/components/Stepper/Stepper.d.ts +16 -0
- package/dist/components/Stepper/Stepper.js +33 -0
- package/dist/components/Table/Table.d.ts +39 -0
- package/dist/components/Table/Table.js +122 -1
- package/dist/components/Table/TableContext.d.ts +19 -0
- package/dist/components/Table/TableContext.js +21 -1
- package/dist/components/Tabs/Tab.d.ts +1 -1
- package/dist/components/Tabs/Tab.js +5 -5
- package/dist/components/Tabs/TabPanel.d.ts +1 -1
- package/dist/components/Tabs/TabPanel.js +4 -4
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/components/Tabs/Tabs.js +3 -3
- package/dist/components/Toggle/Toggle.d.ts +14 -0
- package/dist/components/Toggle/Toggle.js +256 -0
- package/dist/components/Tooltip/Tooltip.d.ts +17 -0
- package/dist/components/Tooltip/Tooltip.js +1366 -1
- package/dist/components/Typography/Typography.d.ts +14 -5
- package/dist/components/Typography/Typography.js +76 -59
- package/dist/components/Typography/Typography.stories.d.ts +31 -0
- package/dist/components/Typography/Typography.stories.js +30 -0
- package/dist/components/Typography/typography.test.d.ts +1 -0
- package/dist/components/Typography/typography.test.js +11357 -0
- package/dist/index-BNWbc5Kh.js +19628 -0
- package/dist/{index-BvA1HyDs.js → index-CqjC7P5Y.js} +91 -95
- package/dist/magic-string.es-O_8lTkE3.js +738 -0
- package/dist/main.d.ts +16 -7
- package/dist/main.js +50 -28
- package/dist/objectWithoutPropertiesLoose-D7Cp0Pg_.js +26 -0
- package/dist/test-utils/assertStyles.d.ts +1 -0
- package/dist/test-utils/assertStyles.js +11 -0
- package/dist/types/helpers.d.ts +8 -0
- package/dist/useButton-Bc8IAgyk.js +106 -0
- package/dist/{useCompoundItem-wTwXbURC.js → useCompoundItem-CTYi5M_E.js} +1 -1
- package/dist/useIsFocusVisible-BH4IAdcw.js +69 -0
- package/dist/useTimeout-DxF9kiZL.js +36 -0
- package/dist/utils/styleStrings.d.ts +6 -0
- package/dist/utils/styleStrings.js +10 -0
- package/dist/utils/styleStrings.test.d.ts +1 -0
- package/dist/utils/styleStrings.test.js +41 -0
- package/dist/vi.Y_w82WR8-Df0JUamG.js +9860 -0
- package/package.json +30 -9
- package/dist/Dialog.module-BKWFakxu.js +0 -15
- package/dist/objectWithoutPropertiesLoose-ClNcje2_.js +0 -22
- package/dist/useButton-abQpo0za.js +0 -187
|
@@ -1,78 +1,67 @@
|
|
|
1
1
|
import '../../assets/IconButton.css';
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { forwardRef as
|
|
2
|
+
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as q, useMemo as a } from "react";
|
|
4
|
+
import { c } from "../../clsx-DB4S2d7J.js";
|
|
4
5
|
import { LoadingSpinner as m } from "../LoadingSpinner/LoadingSpinner.js";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
h1:
|
|
9
|
-
"h1--bold": "_h1--bold_1v5kq_7",
|
|
6
|
+
import { B as g } from "../../Button-B1umG8kJ.js";
|
|
7
|
+
const k = "_h1_8qiyf_1", p = "_h2_8qiyf_11", w = "_h3_8qiyf_21", x = "_h4_8qiyf_31", N = "_body_8qiyf_41", v = "_quote_8qiyf_75", B = "_form__input_8qiyf_98", j = "_form__hint_8qiyf_103", C = "_form__label_8qiyf_108", I = "_form__dropdown_8qiyf_113", L = "_table__header_8qiyf_131", M = "_table__body_8qiyf_136", R = "_button_8qiyf_159", o = {
|
|
8
|
+
h1: k,
|
|
9
|
+
"h1--bold": "_h1--bold_8qiyf_7",
|
|
10
10
|
h2: p,
|
|
11
|
-
"h2--bold": "_h2--
|
|
12
|
-
h3:
|
|
13
|
-
"h3--bold": "_h3--
|
|
14
|
-
h4:
|
|
15
|
-
"h4--bold": "_h4--
|
|
16
|
-
body:
|
|
17
|
-
"body--large": "_body--
|
|
18
|
-
"body--medium": "_body--
|
|
19
|
-
"body--small": "_body--
|
|
20
|
-
"body--tiny": "_body--
|
|
21
|
-
"body--bold": "_body--
|
|
22
|
-
"body--strikethrough": "_body--
|
|
23
|
-
"body--underlined": "_body--
|
|
24
|
-
"body--strikethrough-underlined": "_body--strikethrough-
|
|
25
|
-
quote:
|
|
26
|
-
"quote--large": "_quote--
|
|
11
|
+
"h2--bold": "_h2--bold_8qiyf_17",
|
|
12
|
+
h3: w,
|
|
13
|
+
"h3--bold": "_h3--bold_8qiyf_27",
|
|
14
|
+
h4: x,
|
|
15
|
+
"h4--bold": "_h4--bold_8qiyf_37",
|
|
16
|
+
body: N,
|
|
17
|
+
"body--large": "_body--large_8qiyf_46",
|
|
18
|
+
"body--medium": "_body--medium_8qiyf_50",
|
|
19
|
+
"body--small": "_body--small_8qiyf_54",
|
|
20
|
+
"body--tiny": "_body--tiny_8qiyf_58",
|
|
21
|
+
"body--bold": "_body--bold_8qiyf_62",
|
|
22
|
+
"body--strikethrough": "_body--strikethrough_8qiyf_65",
|
|
23
|
+
"body--underlined": "_body--underlined_8qiyf_68",
|
|
24
|
+
"body--strikethrough-underlined": "_body--strikethrough-underlined_8qiyf_71",
|
|
25
|
+
quote: v,
|
|
26
|
+
"quote--large": "_quote--large_8qiyf_80",
|
|
27
|
+
"quote--bold": "_quote--bold_8qiyf_85",
|
|
28
|
+
"quote--strikethrough": "_quote--strikethrough_8qiyf_88",
|
|
29
|
+
"quote--underlined": "_quote--underlined_8qiyf_91",
|
|
30
|
+
"quote--strikethrough-underlined": "_quote--strikethrough-underlined_8qiyf_94",
|
|
27
31
|
form__input: B,
|
|
28
32
|
form__hint: j,
|
|
29
33
|
form__label: C,
|
|
30
34
|
form__dropdown: I,
|
|
35
|
+
"form--bold": "_form--bold_8qiyf_118",
|
|
36
|
+
"form--strikethrough": "_form--strikethrough_8qiyf_121",
|
|
37
|
+
"form--underlined": "_form--underlined_8qiyf_124",
|
|
38
|
+
"form--strikethrough-underlined": "_form--strikethrough-underlined_8qiyf_127",
|
|
31
39
|
table__header: L,
|
|
32
40
|
table__body: M,
|
|
33
|
-
"table__body--secondary": "_table__body--
|
|
41
|
+
"table__body--secondary": "_table__body--secondary_8qiyf_141",
|
|
42
|
+
"table--bold": "_table--bold_8qiyf_146",
|
|
43
|
+
"table--strikethrough": "_table--strikethrough_8qiyf_149",
|
|
44
|
+
"table--underlined": "_table--underlined_8qiyf_152",
|
|
45
|
+
"table--strikethrough-underlined": "_table--strikethrough-underlined_8qiyf_155",
|
|
34
46
|
button: R,
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
o["icon-button"],
|
|
54
|
-
o[`icon-button--${_}`],
|
|
55
|
-
t
|
|
56
|
-
]),
|
|
57
|
-
[t, _]
|
|
58
|
-
);
|
|
59
|
-
return /* @__PURE__ */ n(
|
|
60
|
-
y,
|
|
61
|
-
{
|
|
62
|
-
type: s,
|
|
63
|
-
href: i,
|
|
64
|
-
onClick: d,
|
|
65
|
-
disabled: c,
|
|
66
|
-
className: u,
|
|
67
|
-
ref: e,
|
|
68
|
-
children: /* @__PURE__ */ q("div", { className: o["icon-button__container"], children: [
|
|
69
|
-
l ? /* @__PURE__ */ n(m, { invert: !0 }) : b,
|
|
70
|
-
_ !== "square" && a
|
|
71
|
-
] })
|
|
72
|
-
}
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
);
|
|
47
|
+
"button--bold": "_button--bold_8qiyf_165",
|
|
48
|
+
"button--strikethrough": "_button--strikethrough_8qiyf_168",
|
|
49
|
+
"button--underlined": "_button--underlined_8qiyf_171",
|
|
50
|
+
"button--strikethrough-underlined": "_button--strikethrough-underlined_8qiyf_174",
|
|
51
|
+
"icon-button": "_icon-button_8qiyf_178",
|
|
52
|
+
"icon-button--primary": "_icon-button--primary_8qiyf_190",
|
|
53
|
+
"icon-button--square": "_icon-button--square_8qiyf_212",
|
|
54
|
+
"icon-button__container": "_icon-button__container_8qiyf_228"
|
|
55
|
+
}, E = q((i, r) => {
|
|
56
|
+
const { onClick: n, icon: d, link: u, loading: b, children: l, type: y = "button", disabled: f, className: t, variant: _ = "primary" } = i, h = a(
|
|
57
|
+
() => c([o["icon-button"], o[`icon-button--${_}`], t]),
|
|
58
|
+
[t, _]
|
|
59
|
+
);
|
|
60
|
+
return /* @__PURE__ */ e(g, { type: y, href: u, onClick: n, disabled: f, className: h, ref: r, children: /* @__PURE__ */ s("div", { className: o["icon-button__container"], children: [
|
|
61
|
+
b ? /* @__PURE__ */ e(m, { invert: !0 }) : d,
|
|
62
|
+
_ !== "square" && l
|
|
63
|
+
] }) });
|
|
64
|
+
});
|
|
76
65
|
export {
|
|
77
66
|
E as IconButton,
|
|
78
67
|
E as default
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
type InputProps = InputHTMLAttributes<HTMLInputElement> & {
|
|
4
|
+
/** Label text */
|
|
5
|
+
label?: string;
|
|
6
|
+
/** Info message text */
|
|
7
|
+
infoMessage?: string;
|
|
8
|
+
/** Error message text */
|
|
9
|
+
errorMessage?: string;
|
|
10
|
+
/** Left icon element */
|
|
11
|
+
leftIcon?: ReactNode;
|
|
12
|
+
/** Right icon element */
|
|
13
|
+
rightIcon?: ReactNode;
|
|
14
|
+
/** Input type. Default: text */
|
|
15
|
+
type?: 'text' | 'password';
|
|
16
|
+
/** Hide the chars counter. Default: false */
|
|
17
|
+
hideCharsCounter?: boolean;
|
|
18
|
+
/** CSS classes to be applied on the container element */
|
|
19
|
+
classNameWrapper?: string;
|
|
20
|
+
/** CSS classes to be applied on the label element */
|
|
21
|
+
classNameLabel?: string;
|
|
22
|
+
/** CSS classes to be applied on the input element */
|
|
23
|
+
classNameInput?: string;
|
|
24
|
+
/** CSS classes to be applied on the info message element */
|
|
25
|
+
classNameInfoMessage?: string;
|
|
26
|
+
/** CSS classes to be applied on the error message element */
|
|
27
|
+
classNameErrorMessage?: string;
|
|
28
|
+
/** CSS classes to be applied on the chars counter element */
|
|
29
|
+
classNameCharsCounter?: string;
|
|
30
|
+
/** Id to be applied as `data-testid` on the container element */
|
|
31
|
+
'data-testid-wrapper'?: string;
|
|
32
|
+
/** Id to be applied as `data-testid` on the label element */
|
|
33
|
+
'data-testid-label'?: string;
|
|
34
|
+
/** Id to be applied as `data-testid` on the input element */
|
|
35
|
+
'data-testid-input'?: string;
|
|
36
|
+
/** Id to be applied as `data-testid` on the info message element */
|
|
37
|
+
'data-testid-infoMessage'?: string;
|
|
38
|
+
/** Id to be applied as `data-testid` on the error message element */
|
|
39
|
+
'data-testid-errorMessage'?: string;
|
|
40
|
+
/** Id to be applied as `data-testid` on the chars counter element */
|
|
41
|
+
'data-testid-charsCounter'?: string;
|
|
42
|
+
};
|
|
43
|
+
export declare const Input: ({ 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 }: InputProps) => import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
import '../../assets/Input.css';
|
|
2
|
+
import { jsxs as H, jsx as B } from "react/jsx-runtime";
|
|
3
|
+
import * as f from "react";
|
|
4
|
+
import { useState as pe, useId as ce } from "react";
|
|
5
|
+
import { c as F } from "../../clsx-DB4S2d7J.js";
|
|
6
|
+
import { Typography as L } from "../Typography/Typography.js";
|
|
7
|
+
import { a as _, _ as me } from "../../objectWithoutPropertiesLoose-D7Cp0Pg_.js";
|
|
8
|
+
import { g as fe, a as _e, u as he, e as z, b as Q, i as be, P as e, c as ge, d as Ce } from "../../index-CqjC7P5Y.js";
|
|
9
|
+
function ye(s) {
|
|
10
|
+
let l = "https://mui.com/production-error/?code=" + s;
|
|
11
|
+
for (let a = 1; a < arguments.length; a += 1)
|
|
12
|
+
l += "&args[]=" + encodeURIComponent(arguments[a]);
|
|
13
|
+
return "Minified MUI error #" + s + "; visit " + l + " for the full message.";
|
|
14
|
+
}
|
|
15
|
+
const X = /* @__PURE__ */ f.createContext(void 0);
|
|
16
|
+
process.env.NODE_ENV !== "production" && (X.displayName = "FormControlContext");
|
|
17
|
+
function we() {
|
|
18
|
+
return f.useContext(X);
|
|
19
|
+
}
|
|
20
|
+
const Z = "Input";
|
|
21
|
+
function ve(s) {
|
|
22
|
+
return fe(Z, s);
|
|
23
|
+
}
|
|
24
|
+
_e(Z, ["root", "formControl", "focused", "disabled", "error", "multiline", "input", "inputMultiline", "inputTypeSearch", "adornedStart", "adornedEnd"]);
|
|
25
|
+
function Ne(s = {}) {
|
|
26
|
+
const {
|
|
27
|
+
defaultValue: l,
|
|
28
|
+
disabled: a = !1,
|
|
29
|
+
error: h = !1,
|
|
30
|
+
onBlur: u,
|
|
31
|
+
onChange: b,
|
|
32
|
+
onFocus: P,
|
|
33
|
+
required: x = !1,
|
|
34
|
+
value: C,
|
|
35
|
+
inputRef: V
|
|
36
|
+
} = s, n = we();
|
|
37
|
+
let E, m, y, w, g;
|
|
38
|
+
if (n) {
|
|
39
|
+
var I, d, q;
|
|
40
|
+
if (E = void 0, m = (I = n.disabled) != null ? I : !1, y = (d = n.error) != null ? d : !1, w = (q = n.required) != null ? q : !1, g = n.value, process.env.NODE_ENV !== "production") {
|
|
41
|
+
const t = ["defaultValue", "disabled", "error", "required", "value"].filter((r) => s[r] !== void 0);
|
|
42
|
+
t.length > 0 && console.warn(["MUI: You have set props on an input that is inside a FormControl.", "Set these props on a FormControl instead. Otherwise they will be ignored.", `Ignored props: ${t.join(", ")}`].join(`
|
|
43
|
+
`));
|
|
44
|
+
}
|
|
45
|
+
} else
|
|
46
|
+
E = l, m = a, y = h, w = x, g = C;
|
|
47
|
+
const {
|
|
48
|
+
current: U
|
|
49
|
+
} = f.useRef(g != null), M = f.useCallback((t) => {
|
|
50
|
+
process.env.NODE_ENV !== "production" && t && t.nodeName !== "INPUT" && !t.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
|
+
}, []), v = f.useRef(null), O = he(v, V, M), [N, R] = f.useState(!1);
|
|
53
|
+
f.useEffect(() => {
|
|
54
|
+
!n && m && N && (R(!1), u == null || u());
|
|
55
|
+
}, [n, m, N, u]);
|
|
56
|
+
const k = (t) => (r) => {
|
|
57
|
+
var o;
|
|
58
|
+
if (n != null && n.disabled) {
|
|
59
|
+
r.stopPropagation();
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
if ((o = t.onFocus) == null || o.call(t, r), n && n.onFocus) {
|
|
63
|
+
var c;
|
|
64
|
+
n == null || (c = n.onFocus) == null || c.call(n);
|
|
65
|
+
} else
|
|
66
|
+
R(!0);
|
|
67
|
+
}, A = (t) => (r) => {
|
|
68
|
+
var o;
|
|
69
|
+
(o = t.onBlur) == null || o.call(t, r), n && n.onBlur ? n.onBlur() : R(!1);
|
|
70
|
+
}, T = (t) => (r, ...o) => {
|
|
71
|
+
var c, j;
|
|
72
|
+
if (!U && (r.target || v.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." : ye(17));
|
|
74
|
+
n == null || (c = n.onChange) == null || c.call(n, r), (j = t.onChange) == null || j.call(t, r, ...o);
|
|
75
|
+
}, D = (t) => (r) => {
|
|
76
|
+
var o;
|
|
77
|
+
v.current && r.currentTarget === r.target && v.current.focus(), (o = t.onClick) == null || o.call(t, r);
|
|
78
|
+
};
|
|
79
|
+
return {
|
|
80
|
+
disabled: m,
|
|
81
|
+
error: y,
|
|
82
|
+
focused: N,
|
|
83
|
+
formControlContext: n,
|
|
84
|
+
getInputProps: (t = {}) => {
|
|
85
|
+
const o = _({}, {
|
|
86
|
+
onBlur: u,
|
|
87
|
+
onChange: b,
|
|
88
|
+
onFocus: P
|
|
89
|
+
}, z(t)), c = _({}, o, {
|
|
90
|
+
onBlur: A(o),
|
|
91
|
+
onChange: T(o),
|
|
92
|
+
onFocus: k(o)
|
|
93
|
+
});
|
|
94
|
+
return _({}, c, {
|
|
95
|
+
"aria-invalid": y || void 0,
|
|
96
|
+
defaultValue: E,
|
|
97
|
+
value: g,
|
|
98
|
+
required: w,
|
|
99
|
+
disabled: m
|
|
100
|
+
}, t, {
|
|
101
|
+
ref: O
|
|
102
|
+
}, c);
|
|
103
|
+
},
|
|
104
|
+
getRootProps: (t = {}) => {
|
|
105
|
+
const r = z(s, ["onBlur", "onChange", "onFocus"]), o = _({}, r, z(t));
|
|
106
|
+
return _({}, t, o, {
|
|
107
|
+
onClick: D(o)
|
|
108
|
+
});
|
|
109
|
+
},
|
|
110
|
+
inputRef: O,
|
|
111
|
+
required: w,
|
|
112
|
+
value: g
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
const Pe = ["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"], xe = (s) => {
|
|
116
|
+
const {
|
|
117
|
+
disabled: l,
|
|
118
|
+
error: a,
|
|
119
|
+
focused: h,
|
|
120
|
+
formControlContext: u,
|
|
121
|
+
multiline: b,
|
|
122
|
+
startAdornment: P,
|
|
123
|
+
endAdornment: x
|
|
124
|
+
} = s;
|
|
125
|
+
return ge({
|
|
126
|
+
root: ["root", l && "disabled", a && "error", h && "focused", !!u && "formControl", b && "multiline", !!P && "adornedStart", !!x && "adornedEnd"],
|
|
127
|
+
input: ["input", l && "disabled", b && "multiline"]
|
|
128
|
+
}, Ce(ve));
|
|
129
|
+
}, ee = /* @__PURE__ */ f.forwardRef(function(l, a) {
|
|
130
|
+
var h, u, b;
|
|
131
|
+
const {
|
|
132
|
+
"aria-describedby": P,
|
|
133
|
+
"aria-label": x,
|
|
134
|
+
"aria-labelledby": C,
|
|
135
|
+
autoComplete: V,
|
|
136
|
+
autoFocus: n,
|
|
137
|
+
className: E,
|
|
138
|
+
defaultValue: m,
|
|
139
|
+
disabled: y,
|
|
140
|
+
endAdornment: w,
|
|
141
|
+
error: g,
|
|
142
|
+
id: I,
|
|
143
|
+
multiline: d = !1,
|
|
144
|
+
name: q,
|
|
145
|
+
onClick: U,
|
|
146
|
+
onChange: M,
|
|
147
|
+
onKeyDown: v,
|
|
148
|
+
onKeyUp: O,
|
|
149
|
+
onFocus: N,
|
|
150
|
+
onBlur: R,
|
|
151
|
+
placeholder: k,
|
|
152
|
+
readOnly: A,
|
|
153
|
+
required: T,
|
|
154
|
+
startAdornment: D,
|
|
155
|
+
value: p,
|
|
156
|
+
type: S,
|
|
157
|
+
rows: t,
|
|
158
|
+
slotProps: r = {},
|
|
159
|
+
slots: o = {},
|
|
160
|
+
minRows: c,
|
|
161
|
+
maxRows: j
|
|
162
|
+
} = l, Y = me(l, Pe), {
|
|
163
|
+
getRootProps: te,
|
|
164
|
+
getInputProps: ne,
|
|
165
|
+
focused: oe,
|
|
166
|
+
formControlContext: re,
|
|
167
|
+
error: se,
|
|
168
|
+
disabled: ae
|
|
169
|
+
} = Ne({
|
|
170
|
+
disabled: y,
|
|
171
|
+
defaultValue: m,
|
|
172
|
+
error: g,
|
|
173
|
+
onBlur: R,
|
|
174
|
+
onClick: U,
|
|
175
|
+
onChange: M,
|
|
176
|
+
onFocus: N,
|
|
177
|
+
required: T,
|
|
178
|
+
value: p
|
|
179
|
+
}), W = d ? void 0 : S ?? "text", $ = _({}, l, {
|
|
180
|
+
disabled: ae,
|
|
181
|
+
error: se,
|
|
182
|
+
focused: oe,
|
|
183
|
+
formControlContext: re,
|
|
184
|
+
multiline: d,
|
|
185
|
+
type: W
|
|
186
|
+
}), G = xe($), le = {
|
|
187
|
+
"aria-describedby": P,
|
|
188
|
+
"aria-label": x,
|
|
189
|
+
"aria-labelledby": C,
|
|
190
|
+
autoComplete: V,
|
|
191
|
+
autoFocus: n,
|
|
192
|
+
id: I,
|
|
193
|
+
onKeyDown: v,
|
|
194
|
+
onKeyUp: O,
|
|
195
|
+
name: q,
|
|
196
|
+
placeholder: k,
|
|
197
|
+
readOnly: A,
|
|
198
|
+
type: W
|
|
199
|
+
}, J = (h = o.root) != null ? h : "div", ie = Q({
|
|
200
|
+
elementType: J,
|
|
201
|
+
getSlotProps: te,
|
|
202
|
+
externalSlotProps: r.root,
|
|
203
|
+
externalForwardedProps: Y,
|
|
204
|
+
additionalProps: {
|
|
205
|
+
ref: a
|
|
206
|
+
},
|
|
207
|
+
ownerState: $,
|
|
208
|
+
className: [G.root, E]
|
|
209
|
+
}), K = d ? (u = o.textarea) != null ? u : "textarea" : (b = o.input) != null ? b : "input", ue = Q({
|
|
210
|
+
elementType: K,
|
|
211
|
+
getSlotProps: (de) => ne(_({}, le, de)),
|
|
212
|
+
externalSlotProps: r.input,
|
|
213
|
+
additionalProps: _({
|
|
214
|
+
rows: d ? t : void 0
|
|
215
|
+
}, d && !be(K) && {
|
|
216
|
+
minRows: t || c,
|
|
217
|
+
maxRows: t || j
|
|
218
|
+
}),
|
|
219
|
+
ownerState: $,
|
|
220
|
+
className: G.input
|
|
221
|
+
});
|
|
222
|
+
return process.env.NODE_ENV !== "production" && d && t && (c || j) && console.warn("MUI: You can not use the `minRows` or `maxRows` props when the input `rows` prop is set."), /* @__PURE__ */ H(J, _({}, ie, {
|
|
223
|
+
children: [D, /* @__PURE__ */ B(K, _({}, ue)), w]
|
|
224
|
+
}));
|
|
225
|
+
});
|
|
226
|
+
process.env.NODE_ENV !== "production" && (ee.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 Ee = (s) => /* @__PURE__ */ f.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: {
|
|
377
|
+
fill: "currentcolor",
|
|
378
|
+
color: "currentcolor",
|
|
379
|
+
width: "1em",
|
|
380
|
+
height: "1em"
|
|
381
|
+
}, ...s }, /* @__PURE__ */ f.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" })), Re = "_input_hm5q2_1", Fe = "_input__label_hm5q2_4", i = {
|
|
382
|
+
input: Re,
|
|
383
|
+
input__label: Fe,
|
|
384
|
+
"input__input-el-wrapper": "_input__input-el-wrapper_hm5q2_9",
|
|
385
|
+
"input__input-el": "_input__input-el_hm5q2_9",
|
|
386
|
+
"input__left-icon": "_input__left-icon_hm5q2_30",
|
|
387
|
+
"input__right-icon": "_input__right-icon_hm5q2_33",
|
|
388
|
+
"input__messages-wrapper": "_input__messages-wrapper_hm5q2_36",
|
|
389
|
+
"input__info-message": "_input__info-message_hm5q2_44",
|
|
390
|
+
"input__error-message": "_input__error-message_hm5q2_44",
|
|
391
|
+
"input__chars-counter": "_input__chars-counter_hm5q2_55",
|
|
392
|
+
"input--disabled": "_input--disabled_hm5q2_59",
|
|
393
|
+
"input--focused": "_input--focused_hm5q2_65",
|
|
394
|
+
"input--error": "_input--error_hm5q2_68"
|
|
395
|
+
}, Ve = ({
|
|
396
|
+
label: s,
|
|
397
|
+
infoMessage: l,
|
|
398
|
+
errorMessage: a,
|
|
399
|
+
leftIcon: h,
|
|
400
|
+
rightIcon: u,
|
|
401
|
+
id: b,
|
|
402
|
+
disabled: P,
|
|
403
|
+
type: x = "text",
|
|
404
|
+
maxLength: C,
|
|
405
|
+
hideCharsCounter: V = !1,
|
|
406
|
+
onChange: n,
|
|
407
|
+
classNameWrapper: E,
|
|
408
|
+
classNameLabel: m,
|
|
409
|
+
classNameInput: y,
|
|
410
|
+
classNameInfoMessage: w,
|
|
411
|
+
classNameErrorMessage: g,
|
|
412
|
+
classNameCharsCounter: I,
|
|
413
|
+
"data-testid-wrapper": d,
|
|
414
|
+
"data-testid-label": q,
|
|
415
|
+
"data-testid-input": U,
|
|
416
|
+
"data-testid-infoMessage": M,
|
|
417
|
+
"data-testid-errorMessage": v,
|
|
418
|
+
"data-testid-charsCounter": O,
|
|
419
|
+
...N
|
|
420
|
+
}) => {
|
|
421
|
+
const [R, k] = pe(0), A = ce(), T = b || `input_${A}`;
|
|
422
|
+
Object.assign(N, { "data-testid": U });
|
|
423
|
+
const D = (p) => {
|
|
424
|
+
var S, t;
|
|
425
|
+
k((t = (S = p == null ? void 0 : p.target) == null ? void 0 : S.value) == null ? void 0 : t.length), n && n(p);
|
|
426
|
+
};
|
|
427
|
+
return /* @__PURE__ */ H("div", { className: F(i.input, E), "data-testid": d, children: [
|
|
428
|
+
s && /* @__PURE__ */ B(
|
|
429
|
+
L,
|
|
430
|
+
{
|
|
431
|
+
element: "label",
|
|
432
|
+
variant: "form-label",
|
|
433
|
+
elementProps: { htmlFor: T },
|
|
434
|
+
className: F(i.input__label, m),
|
|
435
|
+
"data-testid": q,
|
|
436
|
+
children: s
|
|
437
|
+
}
|
|
438
|
+
),
|
|
439
|
+
/* @__PURE__ */ B(
|
|
440
|
+
ee,
|
|
441
|
+
{
|
|
442
|
+
id: T,
|
|
443
|
+
type: x,
|
|
444
|
+
disabled: P,
|
|
445
|
+
error: !!a,
|
|
446
|
+
"aria-label": s,
|
|
447
|
+
slotProps: {
|
|
448
|
+
root: (p) => ({
|
|
449
|
+
className: F(i["input__input-el-wrapper"], {
|
|
450
|
+
[i["input--disabled"]]: p.disabled,
|
|
451
|
+
[i["input--focused"]]: p.focused,
|
|
452
|
+
[i["input--error"]]: p.error
|
|
453
|
+
})
|
|
454
|
+
}),
|
|
455
|
+
input: {
|
|
456
|
+
className: F(i["input__input-el"], y),
|
|
457
|
+
maxLength: C,
|
|
458
|
+
onChange: D,
|
|
459
|
+
...N
|
|
460
|
+
}
|
|
461
|
+
},
|
|
462
|
+
startAdornment: h && /* @__PURE__ */ B("span", { className: i["input__left-icon"], children: h }),
|
|
463
|
+
endAdornment: u && /* @__PURE__ */ B("span", { className: i["input__right-icon"], children: u })
|
|
464
|
+
}
|
|
465
|
+
),
|
|
466
|
+
/* @__PURE__ */ H("div", { className: i["input__messages-wrapper"], children: [
|
|
467
|
+
(a || l) && /* @__PURE__ */ H(
|
|
468
|
+
L,
|
|
469
|
+
{
|
|
470
|
+
variant: "form-hint",
|
|
471
|
+
className: a ? F(i["input__error-message"], g) : F(i["input__info-message"], w),
|
|
472
|
+
"data-testid": a ? v : M,
|
|
473
|
+
children: [
|
|
474
|
+
/* @__PURE__ */ B(Ee, {}),
|
|
475
|
+
a || l
|
|
476
|
+
]
|
|
477
|
+
}
|
|
478
|
+
),
|
|
479
|
+
C && !V && /* @__PURE__ */ H(
|
|
480
|
+
L,
|
|
481
|
+
{
|
|
482
|
+
variant: "form-hint",
|
|
483
|
+
className: F(i["input__chars-counter"], I),
|
|
484
|
+
"data-testid": O,
|
|
485
|
+
children: [
|
|
486
|
+
R,
|
|
487
|
+
" / ",
|
|
488
|
+
C
|
|
489
|
+
]
|
|
490
|
+
}
|
|
491
|
+
)
|
|
492
|
+
] })
|
|
493
|
+
] });
|
|
494
|
+
};
|
|
495
|
+
export {
|
|
496
|
+
Ve as Input
|
|
497
|
+
};
|