@pismo/marola 0.0.1-alpha.1 → 0.0.1-alpha.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/README.md +17 -5
  2. package/dist/Button-B1umG8kJ.js +131 -0
  3. package/dist/ClickAwayListener-HI1G6ob9.js +107 -0
  4. package/dist/Dialog.module-CGVM5V_D.js +15 -0
  5. package/dist/Popup-DFJQc_jn.js +1249 -0
  6. package/dist/Portal-D__zvwbZ.js +73 -0
  7. package/dist/SelectButton-DWtqAiwt.js +45 -0
  8. package/dist/Tabs.module-jkH1Qjn7.js +22 -0
  9. package/dist/_commonjsHelpers-CT_km90n.js +30 -0
  10. package/dist/assets/Advice.css +1 -0
  11. package/dist/assets/Button.css +1 -0
  12. package/dist/assets/Checkbox.css +1 -0
  13. package/dist/assets/Dialog.css +1 -1
  14. package/dist/assets/IconButton.css +1 -0
  15. package/dist/assets/Input.css +1 -0
  16. package/dist/assets/InputSearch.css +1 -0
  17. package/dist/assets/LoadingSpinner.css +1 -1
  18. package/dist/assets/PageHeader.css +1 -0
  19. package/dist/assets/Pagination.css +1 -0
  20. package/dist/assets/SelectButton.css +1 -0
  21. package/dist/assets/Skeleton.css +1 -0
  22. package/dist/assets/Snackbar.css +1 -0
  23. package/dist/assets/SortTooltip.css +1 -0
  24. package/dist/assets/Stepper.css +1 -0
  25. package/dist/assets/Table.css +1 -0
  26. package/dist/assets/Tabs.css +1 -0
  27. package/dist/assets/Toggle.css +1 -0
  28. package/dist/assets/Tooltip.css +1 -0
  29. package/dist/assets/Typography.css +1 -1
  30. package/dist/assets/global.css +1 -0
  31. package/dist/combineHooksSlotProps-BHqhiBfc.js +81 -0
  32. package/dist/components/Advice/Advice.d.ts +16 -0
  33. package/dist/components/Advice/Advice.js +25 -0
  34. package/dist/components/Button/Button.d.ts +29 -0
  35. package/dist/components/Button/Button.js +70 -0
  36. package/dist/components/Button/Button.stories.d.ts +60 -0
  37. package/dist/components/Button/Button.stories.js +41 -0
  38. package/dist/components/Checkbox/Checkbox.d.ts +19 -0
  39. package/dist/components/Checkbox/Checkbox.js +56 -0
  40. package/dist/components/Dialog/Actions.js +1 -1
  41. package/dist/components/Dialog/Backdrop.d.ts +1 -1
  42. package/dist/components/Dialog/Backdrop.js +2 -9
  43. package/dist/components/Dialog/CloseIconButton.js +11 -10
  44. package/dist/components/Dialog/Dialog.d.ts +5 -4
  45. package/dist/components/Dialog/Dialog.js +420 -20077
  46. package/dist/components/Dialog/Dialog.stories.d.ts +343 -0
  47. package/dist/components/Dialog/Dialog.stories.js +60 -0
  48. package/dist/components/Dialog/Title.js +22 -7
  49. package/dist/components/Icon/Icon.d.ts +18 -0
  50. package/dist/components/Icon/Icon.js +95 -0
  51. package/dist/components/IconButton/IconButton.d.ts +22 -0
  52. package/dist/components/IconButton/IconButton.js +68 -0
  53. package/dist/components/Input/Input.d.ts +44 -0
  54. package/dist/components/Input/Input.js +497 -0
  55. package/dist/components/Input/Input.stories.d.ts +43 -0
  56. package/dist/components/Input/Input.stories.js +106 -0
  57. package/dist/components/InputSearch/InputSearch.d.ts +11 -0
  58. package/dist/components/InputSearch/InputSearch.js +29 -0
  59. package/dist/components/InputSearch/InputSearch.stories.d.ts +22 -0
  60. package/dist/components/InputSearch/InputSearch.stories.js +36 -0
  61. package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +2 -0
  62. package/dist/components/LoadingSpinner/LoadingSpinner.js +12 -13
  63. package/dist/components/LoadingSpinner/LoadingSpinner.stories.d.ts +14 -0
  64. package/dist/components/LoadingSpinner/LoadingSpinner.stories.js +39 -0
  65. package/dist/components/PageHeader/PageHeader.d.ts +36 -0
  66. package/dist/components/PageHeader/PageHeader.js +51 -0
  67. package/dist/components/PageHeader/PageHeader.stories.d.ts +43 -0
  68. package/dist/components/PageHeader/PageHeader.stories.js +49 -0
  69. package/dist/components/Pagination/Pagination.d.ts +36 -0
  70. package/dist/components/Pagination/Pagination.js +219 -0
  71. package/dist/components/Select/Select.d.ts +25 -0
  72. package/dist/components/Select/Select.js +860 -0
  73. package/dist/components/Select/Select.stories.d.ts +31 -0
  74. package/dist/components/Select/Select.stories.js +66 -0
  75. package/dist/components/Select/SelectButton.d.ts +13 -0
  76. package/dist/components/Select/SelectButton.js +8 -0
  77. package/dist/components/Skeleton/Skeleton.d.ts +18 -0
  78. package/dist/components/Skeleton/Skeleton.js +26 -0
  79. package/dist/components/Snackbar/Snackbar.d.ts +13 -0
  80. package/dist/components/Snackbar/Snackbar.js +623 -0
  81. package/dist/components/SortTooltip/SortTooltip.d.ts +26 -0
  82. package/dist/components/SortTooltip/SortTooltip.js +67 -0
  83. package/dist/components/Stepper/Stepper.d.ts +16 -0
  84. package/dist/components/Stepper/Stepper.js +33 -0
  85. package/dist/components/Table/Table.d.ts +39 -0
  86. package/dist/components/Table/Table.js +122 -0
  87. package/dist/components/Table/TableContext.d.ts +19 -0
  88. package/dist/components/Table/TableContext.js +21 -0
  89. package/dist/components/Tabs/Tab.d.ts +9 -0
  90. package/dist/components/Tabs/Tab.js +182 -0
  91. package/dist/components/Tabs/TabPanel.d.ts +8 -0
  92. package/dist/components/Tabs/TabPanel.js +119 -0
  93. package/dist/components/Tabs/Tabs.d.ts +11 -0
  94. package/dist/components/Tabs/Tabs.js +402 -0
  95. package/dist/components/Toggle/Toggle.d.ts +11 -0
  96. package/dist/components/Toggle/Toggle.js +252 -0
  97. package/dist/components/Toggle/Toggle.stories.d.ts +21 -0
  98. package/dist/components/Toggle/Toggle.stories.js +33 -0
  99. package/dist/components/Tooltip/Tooltip.d.ts +17 -0
  100. package/dist/components/Tooltip/Tooltip.js +127 -0
  101. package/dist/components/Typography/Typography.d.ts +15 -6
  102. package/dist/components/Typography/Typography.js +75 -67
  103. package/dist/components/Typography/Typography.stories.d.ts +31 -0
  104. package/dist/components/Typography/Typography.stories.js +31 -0
  105. package/dist/components/Typography/typography.test.d.ts +1 -0
  106. package/dist/components/Typography/typography.test.js +11358 -0
  107. package/dist/index-BJ8HbRCy.js +19585 -0
  108. package/dist/index-CqjC7P5Y.js +814 -0
  109. package/dist/magic-string.es-O_8lTkE3.js +738 -0
  110. package/dist/main.d.ts +19 -2
  111. package/dist/main.js +60 -15
  112. package/dist/objectWithoutPropertiesLoose-D7Cp0Pg_.js +26 -0
  113. package/dist/test-utils/assertStyles.d.ts +1 -0
  114. package/dist/test-utils/assertStyles.js +11 -0
  115. package/dist/types/helpers.d.ts +14 -7
  116. package/dist/useButton-Bc8IAgyk.js +106 -0
  117. package/dist/useCompoundItem-D1iRfg8D.js +84 -0
  118. package/dist/useControlled-CCMYYdCM.js +31 -0
  119. package/dist/useEnhancedEffect-CJGo-L3B.js +5 -0
  120. package/dist/useEventCallback-vAfOD-oT.js +45 -0
  121. package/dist/useIsFocusVisible-BH4IAdcw.js +69 -0
  122. package/dist/useList-ByMguSS_.js +437 -0
  123. package/dist/useTimeout-DxF9kiZL.js +36 -0
  124. package/dist/utils/styleStrings.d.ts +6 -0
  125. package/dist/utils/styleStrings.js +10 -0
  126. package/dist/utils/styleStrings.test.d.ts +1 -0
  127. package/dist/utils/styleStrings.test.js +41 -0
  128. package/dist/vi.Y_w82WR8-Df0JUamG.js +9860 -0
  129. package/package.json +53 -10
  130. package/dist/Button-REznN-RP.js +0 -1139
  131. package/dist/Dialog.module-BO0mdB7d.js +0 -15
  132. package/dist/assets/CallToActionButton.css +0 -1
  133. package/dist/assets/main.css +0 -1
  134. package/dist/components/CallToActionButton/CallToActionButton.d.ts +0 -23
  135. package/dist/components/CallToActionButton/CallToActionButton.js +0 -57
  136. package/src/playground/Playground.tsx +0 -58
@@ -0,0 +1,68 @@
1
+ import '../../assets/IconButton.css';
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";
5
+ import { LoadingSpinner as m } from "../LoadingSpinner/LoadingSpinner.js";
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
+ h2: p,
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",
31
+ form__input: B,
32
+ form__hint: j,
33
+ form__label: C,
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",
39
+ table__header: L,
40
+ table__body: M,
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",
46
+ button: R,
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
+ });
65
+ export {
66
+ E as IconButton,
67
+ E as default
68
+ };
@@ -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' | 'search';
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 q, jsx as V } from "react/jsx-runtime";
3
+ import * as m 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 fe } from "../../objectWithoutPropertiesLoose-D7Cp0Pg_.js";
8
+ import { g as me, 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__ */ m.createContext(void 0);
16
+ process.env.NODE_ENV !== "production" && (X.displayName = "FormControlContext");
17
+ function we() {
18
+ return m.useContext(X);
19
+ }
20
+ const Z = "Input";
21
+ function ve(s) {
22
+ return me(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: U
36
+ } = s, n = we();
37
+ let E, f, y, w, g;
38
+ if (n) {
39
+ var I, d, O;
40
+ if (E = void 0, f = (I = n.disabled) != null ? I : !1, y = (d = n.error) != null ? d : !1, w = (O = n.required) != null ? O : !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, f = a, y = h, w = x, g = C;
47
+ const {
48
+ current: M
49
+ } = m.useRef(g != null), k = m.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 = m.useRef(null), T = he(v, U, k), [N, R] = m.useState(!1);
53
+ m.useEffect(() => {
54
+ !n && f && N && (R(!1), u == null || u());
55
+ }, [n, f, N, u]);
56
+ const A = (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
+ }, D = (t) => (r) => {
68
+ var o;
69
+ (o = t.onBlur) == null || o.call(t, r), n && n.onBlur ? n.onBlur() : R(!1);
70
+ }, S = (t) => (r, ...o) => {
71
+ var c, H;
72
+ if (!M && (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), (H = t.onChange) == null || H.call(t, r, ...o);
75
+ }, j = (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: f,
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: D(o),
91
+ onChange: S(o),
92
+ onFocus: A(o)
93
+ });
94
+ return _({}, c, {
95
+ "aria-invalid": y || void 0,
96
+ defaultValue: E,
97
+ value: g,
98
+ required: w,
99
+ disabled: f
100
+ }, t, {
101
+ ref: T
102
+ }, c);
103
+ },
104
+ getRootProps: (t = {}) => {
105
+ const r = z(s, ["onBlur", "onChange", "onFocus"]), o = _({}, r, z(t));
106
+ return _({}, t, o, {
107
+ onClick: j(o)
108
+ });
109
+ },
110
+ inputRef: T,
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__ */ m.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: U,
136
+ autoFocus: n,
137
+ className: E,
138
+ defaultValue: f,
139
+ disabled: y,
140
+ endAdornment: w,
141
+ error: g,
142
+ id: I,
143
+ multiline: d = !1,
144
+ name: O,
145
+ onClick: M,
146
+ onChange: k,
147
+ onKeyDown: v,
148
+ onKeyUp: T,
149
+ onFocus: N,
150
+ onBlur: R,
151
+ placeholder: A,
152
+ readOnly: D,
153
+ required: S,
154
+ startAdornment: j,
155
+ value: p,
156
+ type: B,
157
+ rows: t,
158
+ slotProps: r = {},
159
+ slots: o = {},
160
+ minRows: c,
161
+ maxRows: H
162
+ } = l, Y = fe(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: f,
172
+ error: g,
173
+ onBlur: R,
174
+ onClick: M,
175
+ onChange: k,
176
+ onFocus: N,
177
+ required: S,
178
+ value: p
179
+ }), W = d ? void 0 : B ?? "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: U,
191
+ autoFocus: n,
192
+ id: I,
193
+ onKeyDown: v,
194
+ onKeyUp: T,
195
+ name: O,
196
+ placeholder: A,
197
+ readOnly: D,
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 || H
218
+ }),
219
+ ownerState: $,
220
+ className: G.input
221
+ });
222
+ return process.env.NODE_ENV !== "production" && d && t && (c || H) && console.warn("MUI: You can not use the `minRows` or `maxRows` props when the input `rows` prop is set."), /* @__PURE__ */ q(J, _({}, ie, {
223
+ children: [j, /* @__PURE__ */ V(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__ */ m.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__ */ m.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__label_f2das_1", Fe = "_input_f2das_1", i = {
382
+ input__label: Re,
383
+ "input__input-el-wrapper": "_input__input-el-wrapper_f2das_6",
384
+ "input__input-el": "_input__input-el_f2das_6",
385
+ "input__left-icon": "_input__left-icon_f2das_27",
386
+ "input__right-icon": "_input__right-icon_f2das_30",
387
+ "input__messages-wrapper": "_input__messages-wrapper_f2das_33",
388
+ "input__info-message": "_input__info-message_f2das_41",
389
+ "input__error-message": "_input__error-message_f2das_41",
390
+ "input__chars-counter": "_input__chars-counter_f2das_52",
391
+ "input--disabled": "_input--disabled_f2das_56",
392
+ input: Fe,
393
+ "input--focused": "_input--focused_f2das_62",
394
+ "input--error": "_input--error_f2das_65"
395
+ }, Ue = ({
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: U = !1,
406
+ onChange: n,
407
+ classNameWrapper: E,
408
+ classNameLabel: f,
409
+ classNameInput: y,
410
+ classNameInfoMessage: w,
411
+ classNameErrorMessage: g,
412
+ classNameCharsCounter: I,
413
+ "data-testid-wrapper": d,
414
+ "data-testid-label": O,
415
+ "data-testid-input": M,
416
+ "data-testid-infoMessage": k,
417
+ "data-testid-errorMessage": v,
418
+ "data-testid-charsCounter": T,
419
+ ...N
420
+ }) => {
421
+ const [R, A] = pe(0), D = ce(), S = b || `input_${D}`;
422
+ Object.assign(N, { "data-testid": M });
423
+ const j = (p) => {
424
+ var B, t;
425
+ A((t = (B = p == null ? void 0 : p.target) == null ? void 0 : B.value) == null ? void 0 : t.length), n && n(p);
426
+ };
427
+ return /* @__PURE__ */ q("div", { className: F(i.input, E), "data-testid": d, children: [
428
+ s && /* @__PURE__ */ V(
429
+ L,
430
+ {
431
+ element: "label",
432
+ variant: "form-label",
433
+ elementProps: { htmlFor: S },
434
+ className: F(i.input__label, f),
435
+ "data-testid": O,
436
+ children: s
437
+ }
438
+ ),
439
+ /* @__PURE__ */ V(
440
+ ee,
441
+ {
442
+ id: S,
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: j,
459
+ ...N
460
+ }
461
+ },
462
+ startAdornment: h && /* @__PURE__ */ V("span", { className: i["input__left-icon"], children: h }),
463
+ endAdornment: u && /* @__PURE__ */ V("span", { className: i["input__right-icon"], children: u })
464
+ }
465
+ ),
466
+ /* @__PURE__ */ q("div", { className: i["input__messages-wrapper"], children: [
467
+ (a || l) && /* @__PURE__ */ q(
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 : k,
473
+ children: [
474
+ /* @__PURE__ */ V(Ee, {}),
475
+ a || l
476
+ ]
477
+ }
478
+ ),
479
+ C && !U && /* @__PURE__ */ q(
480
+ L,
481
+ {
482
+ variant: "form-hint",
483
+ className: F(i["input__chars-counter"], I),
484
+ "data-testid": T,
485
+ children: [
486
+ R,
487
+ " / ",
488
+ C
489
+ ]
490
+ }
491
+ )
492
+ ] })
493
+ ] });
494
+ };
495
+ export {
496
+ Ue as Input
497
+ };
@@ -0,0 +1,43 @@
1
+ import { StoryObj } from '@storybook/react';
2
+
3
+ declare const meta: {
4
+ title: string;
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;
26
+ tags: string[];
27
+ parameters: {
28
+ layout: string;
29
+ };
30
+ };
31
+ export default meta;
32
+ type Story = StoryObj<typeof meta>;
33
+ export declare const Simple: Story;
34
+ export declare const WithLabel: Story;
35
+ export declare const WithPlaceholder: Story;
36
+ export declare const Disabled: Story;
37
+ export declare const WithMaxLength: Story;
38
+ export declare const WithMaxLengthAndHideCharsCounter: Story;
39
+ export declare const WithLeftIcon: Story;
40
+ export declare const WithRightIconAndClickEvent: Story;
41
+ export declare const WithBothIcons: Story;
42
+ export declare const WithInfoMessage: Story;
43
+ export declare const WithErrorMessage: Story;