@pismo/marola 1.0.0-beta.29 → 1.0.0-beta.30

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.
@@ -1 +1 @@
1
- ._u-typography-h1_1lq2e_1{font-size:var(--heading-font-size-1);font-weight:var(--heading-font-weight);line-height:var(--heading-line-height-1);margin:0}._u-typography-h2_1lq2e_8{font-size:var(--heading-font-size-2);font-weight:var(--heading-font-weight);line-height:var(--heading-line-height-2);margin:0}._u-typography-h3_1lq2e_15{font-size:var(--heading-font-size-3);font-weight:var(--heading-font-weight);line-height:var(--heading-line-height-3);margin:0}._u-typography-h4_1lq2e_22{font-size:var(--heading-font-size-4);font-weight:var(--heading-font-weight);line-height:var(--heading-line-height-4);margin:0}._u-typography-h5_1lq2e_29{font-size:var(--heading-font-size-5);font-weight:var(--heading-font-weight);line-height:var(--heading-line-height-5);margin:0}._u-typography-h6_1lq2e_36{font-size:var(--heading-font-size-6);font-weight:var(--heading-font-weight);line-height:var(--heading-line-height-6);margin:0}._u-typography-base_1lq2e_43{margin:0;font-size:var(--base-font-size);font-weight:var(--base-weight);line-height:var(--base-line-height)}._u-typography-base--xxl_1lq2e_49{font-size:var(--base-font-size-xxl);line-height:var(--base-line-height-xxl)}._u-typography-base--xl_1lq2e_53{font-size:var(--base-font-size-xl);line-height:var(--base-line-height-xl)}._u-typography-base--lg_1lq2e_57,._input__input-el_1lq2e_57{font-size:var(--base-font-size-lg);line-height:var(--base-line-height-lg)}._u-typography-base--sm_1lq2e_61{font-size:var(--base-font-size-sm);line-height:var(--base-line-height-sm)}._u-typography-base--bold_1lq2e_65,._input__input-el_1lq2e_57{font-weight:var(--base-bold)}._u-typography-base--strikethrough_1lq2e_68{text-decoration:line-through}._u-typography-base--underlined_1lq2e_71{text-decoration:underline}._u-typography-base--strikethrough-underlined_1lq2e_74{text-decoration:underline line-through}._input__label_1lq2e_78{display:block;margin-bottom:.3125rem;color:var(--gray-75)}._input__input-el-wrapper_1lq2e_83{display:flex;align-items:center;border:solid .0625rem var(--gray-25);border-radius:.375rem;transition:all .3s}._input__input-el_1lq2e_57{all:unset;width:100%;height:2.5rem;padding:0 1rem;color:var(--gray-90);outline:none}._input__input-el_1lq2e_57::placeholder{color:var(--gray-50)}._input__left-icon_1lq2e_101,._input__right-icon_1lq2e_101{display:flex;align-items:center;justify-content:center;height:1rem}._input__left-icon_1lq2e_101{padding-left:1rem}._input__right-icon_1lq2e_101{padding-right:1rem}._input__messages-wrapper_1lq2e_113{display:flex;align-items:center;justify-content:space-between}._input__messages-wrapper_1lq2e_113:not(:empty){margin-top:.3125rem}._input__info-message_1lq2e_121,._input__error-message_1lq2e_121{display:flex;gap:.375rem;align-items:center}._input__info-message_1lq2e_121{color:var(--gray-75)}._input__error-message_1lq2e_121{color:var(--alert)}._input__chars-counter_1lq2e_132{margin-left:auto;color:var(--gray-75)}._input--disabled_1lq2e_136 ._input__input-el_1lq2e_57{color:var(--gray-50)}._input_1lq2e_57:has(._input--disabled_1lq2e_136) ._input__label_1lq2e_78{color:var(--gray-25)}._input--focused_1lq2e_142._input__input-el-wrapper_1lq2e_83{border-color:var(--accent)}._input--error_1lq2e_145._input__input-el-wrapper_1lq2e_83{border-color:var(--alert)}._input__input-el-wrapper_1lq2e_83:hover:not(._input--disabled_1lq2e_136,._input--focused_1lq2e_142,._input--error_1lq2e_145){border-color:var(--gray-75)}
1
+ ._u-typography-h1_1r054_1{font-size:var(--heading-font-size-1);font-weight:var(--heading-font-weight);line-height:var(--heading-line-height-1);margin:0}._u-typography-h2_1r054_8{font-size:var(--heading-font-size-2);font-weight:var(--heading-font-weight);line-height:var(--heading-line-height-2);margin:0}._u-typography-h3_1r054_15{font-size:var(--heading-font-size-3);font-weight:var(--heading-font-weight);line-height:var(--heading-line-height-3);margin:0}._u-typography-h4_1r054_22{font-size:var(--heading-font-size-4);font-weight:var(--heading-font-weight);line-height:var(--heading-line-height-4);margin:0}._u-typography-h5_1r054_29{font-size:var(--heading-font-size-5);font-weight:var(--heading-font-weight);line-height:var(--heading-line-height-5);margin:0}._u-typography-h6_1r054_36{font-size:var(--heading-font-size-6);font-weight:var(--heading-font-weight);line-height:var(--heading-line-height-6);margin:0}._u-typography-base_1r054_43{margin:0;font-size:var(--base-font-size);font-weight:var(--base-weight);line-height:var(--base-line-height)}._u-typography-base--xxl_1r054_49{font-size:var(--base-font-size-xxl);line-height:var(--base-line-height-xxl)}._u-typography-base--xl_1r054_53{font-size:var(--base-font-size-xl);line-height:var(--base-line-height-xl)}._u-typography-base--lg_1r054_57,._input__input-el_1r054_57{font-size:var(--base-font-size-lg);line-height:var(--base-line-height-lg)}._u-typography-base--sm_1r054_61{font-size:var(--base-font-size-sm);line-height:var(--base-line-height-sm)}._u-typography-base--bold_1r054_65,._input__input-el_1r054_57{font-weight:var(--base-bold)}._u-typography-base--strikethrough_1r054_68{text-decoration:line-through}._u-typography-base--underlined_1r054_71{text-decoration:underline}._u-typography-base--strikethrough-underlined_1r054_74{text-decoration:underline line-through}._input__label_1r054_78{display:block;margin-bottom:.3125rem;color:var(--gray-75)}._input__input-el-wrapper_1r054_83{display:flex;align-items:center;border:solid .0625rem var(--gray-25);border-radius:.375rem;transition:all .3s}._input__input-el_1r054_57{all:unset;width:100%;height:2.5rem;padding:0 1rem;color:var(--gray-90);outline:none}._input__input-el_1r054_57::placeholder{color:var(--gray-50)}._input__left-icon_1r054_101,._input__right-icon_1r054_101{display:flex;align-items:center;justify-content:center;height:1rem}._input__left-icon_1r054_101{padding-left:1rem}._input__right-icon_1r054_101{padding-right:1rem}._input__messages-wrapper_1r054_113{display:flex;align-items:center;justify-content:space-between}._input__messages-wrapper_1r054_113:not(:empty){margin-top:.3125rem}._input__info-message_1r054_121,._input__error-message_1r054_121{display:flex;gap:.375rem;align-items:center}._input__info-message_1r054_121{color:var(--gray-75)}._input__error-message_1r054_121{color:var(--alert)}._input__chars-counter_1r054_132{margin-left:auto;color:var(--gray-75)}._input--disabled_1r054_136 ._input__input-el_1r054_57{color:var(--gray-50)}._input_1r054_57:has(._input--disabled_1r054_136) ._input__label_1r054_78{color:var(--gray-25)}._input--focused_1r054_142._input__input-el-wrapper_1r054_83{border-color:var(--accent)}._input--error_1r054_145._input__input-el-wrapper_1r054_83{border-color:var(--alert)}._input__input-el-wrapper_1r054_83:hover:not(._input--disabled_1r054_136,._input--focused_1r054_142,._input--error_1r054_145){border-color:var(--gray-75)}textarea._input__input-el_1r054_57{resize:vertical;padding:.5rem 1rem;height:auto}
@@ -87,13 +87,13 @@ declare const meta: {
87
87
  content?: string | undefined;
88
88
  dir?: string | undefined;
89
89
  hidden?: boolean | undefined;
90
- id?: string | undefined;
91
90
  onChange?: import('react').FormEventHandler<HTMLDivElement> | undefined;
92
91
  accessKey?: string | undefined;
93
92
  autoFocus?: boolean | undefined;
94
93
  contentEditable?: "inherit" | (boolean | "true" | "false") | "plaintext-only" | undefined;
95
94
  contextMenu?: string | undefined;
96
95
  draggable?: (boolean | "true" | "false") | undefined;
96
+ id?: string | undefined;
97
97
  lang?: string | undefined;
98
98
  nonce?: string | undefined;
99
99
  spellCheck?: (boolean | "true" | "false") | undefined;
@@ -2,7 +2,7 @@ import { HTMLInputTypeAttribute, InputHTMLAttributes, ReactNode } from 'react';
2
2
 
3
3
  type ExcludedInputTypes = 'checkbox' | 'radio' | 'submit';
4
4
  type CustomInputTypeAttribute = Exclude<HTMLInputTypeAttribute, ExcludedInputTypes>;
5
- export type InputProps = InputHTMLAttributes<HTMLInputElement> & {
5
+ export type SingleInputProps = InputHTMLAttributes<HTMLInputElement> & {
6
6
  /** Label text */
7
7
  label?: string;
8
8
  /** Info message text */
@@ -11,6 +11,8 @@ export type InputProps = InputHTMLAttributes<HTMLInputElement> & {
11
11
  error?: boolean;
12
12
  /** Error message text, if has "errorMessage", the "error" props will be "true" */
13
13
  errorMessage?: string;
14
+ /** If "true", a "textarea" element is rendered. */
15
+ multiline?: false;
14
16
  /** Left icon element */
15
17
  leftIcon?: ReactNode;
16
18
  /** Right icon element */
@@ -44,46 +46,18 @@ export type InputProps = InputHTMLAttributes<HTMLInputElement> & {
44
46
  /** Id to be applied as `data-testid` on the chars counter element */
45
47
  'data-testid-charsCounter'?: string;
46
48
  };
47
- export declare const Input: import('react').ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & {
48
- /** Label text */
49
- label?: string | undefined;
50
- /** Info message text */
51
- infoMessage?: string | undefined;
52
- /** Show the field layout as an error */
53
- error?: boolean | undefined;
54
- /** Error message text, if has "errorMessage", the "error" props will be "true" */
55
- errorMessage?: string | undefined;
56
- /** Left icon element */
57
- leftIcon?: ReactNode;
58
- /** Right icon element */
59
- rightIcon?: ReactNode;
60
- /** Input type. Default: text */
61
- type?: CustomInputTypeAttribute | undefined;
62
- /** Hide the chars counter */
63
- hideCharsCounter?: boolean | undefined;
64
- /** CSS classes to be applied on the container element */
65
- classNameWrapper?: string | undefined;
66
- /** CSS classes to be applied on the label element */
67
- classNameLabel?: string | undefined;
68
- /** CSS classes to be applied on the input element */
69
- classNameInput?: string | undefined;
70
- /** CSS classes to be applied on the info message element */
71
- classNameInfoMessage?: string | undefined;
72
- /** CSS classes to be applied on the error message element */
73
- classNameErrorMessage?: string | undefined;
74
- /** CSS classes to be applied on the chars counter element */
75
- classNameCharsCounter?: string | undefined;
76
- /** Id to be applied as `data-testid` on the container element */
77
- 'data-testid-wrapper'?: string | undefined;
78
- /** Id to be applied as `data-testid` on the label element */
79
- 'data-testid-label'?: string | undefined;
80
- /** Id to be applied as `data-testid` on the input element */
81
- 'data-testid-input'?: string | undefined;
82
- /** Id to be applied as `data-testid` on the info message element */
83
- 'data-testid-infoMessage'?: string | undefined;
84
- /** Id to be applied as `data-testid` on the error message element */
85
- 'data-testid-errorMessage'?: string | undefined;
86
- /** Id to be applied as `data-testid` on the chars counter element */
87
- 'data-testid-charsCounter'?: string | undefined;
88
- } & import('react').RefAttributes<HTMLInputElement>>;
49
+ type MultilineInputProps = Omit<SingleInputProps, 'multiline'> & {
50
+ /** If "true", a "textarea" element is rendered. */
51
+ multiline: true;
52
+ /** Minimum number of rows to display when multiline option is set to true. */
53
+ minRows?: number;
54
+ /** Maximum number of rows to display when multiline option is set to true. */
55
+ maxRows?: number;
56
+ /** Number of rows to display when multiline option is set to true.
57
+ * The prop defaults to the value (5)
58
+ */
59
+ rows?: number;
60
+ };
61
+ export type InputProps = SingleInputProps | MultilineInputProps;
62
+ export declare const Input: import('react').ForwardRefExoticComponent<InputProps & import('react').RefAttributes<HTMLInputElement>>;
89
63
  export {};
@@ -1,225 +1,225 @@
1
1
  import '../../assets/Input.css';
2
- import { jsxs as H, jsx as T } from "react/jsx-runtime";
2
+ import { jsxs as q, jsx as S } from "react/jsx-runtime";
3
3
  import * as f from "react";
4
- import { forwardRef as de, useState as ce, useId as _e } from "react";
4
+ import { forwardRef as de, useState as ce, useId as _e, useMemo as me } from "react";
5
5
  import { c as E } from "../../clsx-DB4S2d7J.js";
6
6
  import { Typography as L } from "../Typography/Typography.js";
7
- import { g as he, a as fe, u as me, f as z, b as m, _ as ye, c as Q, i as ge, P as e, d as be, e as Ce } from "../../useSlotProps-C_I1kEHr.js";
8
- function we(a) {
9
- let s = "https://mui.com/production-error/?code=" + a;
10
- for (let u = 1; u < arguments.length; u += 1)
11
- s += "&args[]=" + encodeURIComponent(arguments[u]);
12
- return "Minified MUI error #" + a + "; visit " + s + " for the full message.";
7
+ import { g as he, a as fe, u as ye, f as z, b as y, _ as ge, c as Q, i as be, P as e, d as we, e as Ce } from "../../useSlotProps-C_I1kEHr.js";
8
+ function xe(s) {
9
+ let l = "https://mui.com/production-error/?code=" + s;
10
+ for (let p = 1; p < arguments.length; p += 1)
11
+ l += "&args[]=" + encodeURIComponent(arguments[p]);
12
+ return "Minified MUI error #" + s + "; visit " + l + " for the full message.";
13
13
  }
14
14
  const X = "Input";
15
- function ve(a) {
16
- return he(X, a);
15
+ function ve(s) {
16
+ return he(X, s);
17
17
  }
18
18
  fe(X, ["root", "formControl", "focused", "disabled", "error", "multiline", "input", "inputMultiline", "inputTypeSearch", "adornedStart", "adornedEnd"]);
19
19
  const Z = /* @__PURE__ */ f.createContext(void 0);
20
20
  process.env.NODE_ENV !== "production" && (Z.displayName = "FormControlContext");
21
- function xe() {
21
+ function Pe() {
22
22
  return f.useContext(Z);
23
23
  }
24
- function qe(a = {}) {
24
+ function Ne(s = {}) {
25
25
  const {
26
- defaultValue: s,
27
- disabled: u = !1,
28
- error: i = !1,
29
- onBlur: p,
30
- onChange: _,
31
- onFocus: x,
32
- required: q = !1,
33
- value: R,
26
+ defaultValue: l,
27
+ disabled: p = !1,
28
+ error: d = !1,
29
+ onBlur: c,
30
+ onChange: m,
31
+ onFocus: v,
32
+ required: P = !1,
33
+ value: F,
34
34
  inputRef: N
35
- } = a, o = xe();
36
- let g, h, b, C, y;
37
- if (o) {
38
- var F, d, I;
39
- if (g = void 0, h = (F = o.disabled) != null ? F : !1, b = (d = o.error) != null ? d : !1, C = (I = o.required) != null ? I : !1, y = o.value, process.env.NODE_ENV !== "production") {
40
- const t = ["defaultValue", "disabled", "error", "required", "value"].filter((r) => a[r] !== void 0);
35
+ } = s, n = Pe();
36
+ let b, h, w, C, g;
37
+ if (n) {
38
+ var I, _, O;
39
+ if (b = void 0, h = (I = n.disabled) != null ? I : !1, w = (_ = n.error) != null ? _ : !1, C = (O = n.required) != null ? O : !1, g = n.value, process.env.NODE_ENV !== "production") {
40
+ const t = ["defaultValue", "disabled", "error", "required", "value"].filter((o) => s[o] !== void 0);
41
41
  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(`
42
42
  `));
43
43
  }
44
44
  } else
45
- g = s, h = u, b = i, C = q, y = R;
45
+ b = l, h = p, w = d, C = P, g = F;
46
46
  const {
47
- current: S
48
- } = f.useRef(y != null), k = f.useCallback((t) => {
47
+ current: k
48
+ } = f.useRef(g != null), B = f.useCallback((t) => {
49
49
  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(`
50
50
  `));
51
- }, []), w = f.useRef(null), O = me(w, N, k), [P, v] = f.useState(!1);
51
+ }, []), x = f.useRef(null), T = ye(x, N, B), [R, a] = f.useState(!1);
52
52
  f.useEffect(() => {
53
- !o && h && P && (v(!1), p == null || p());
54
- }, [o, h, P, p]);
55
- const B = (t) => (r) => {
56
- var n;
57
- if (o != null && o.disabled) {
58
- r.stopPropagation();
53
+ !n && h && R && (a(!1), c == null || c());
54
+ }, [n, h, R, c]);
55
+ const V = (t) => (o) => {
56
+ var r;
57
+ if (n != null && n.disabled) {
58
+ o.stopPropagation();
59
59
  return;
60
60
  }
61
- if ((n = t.onFocus) == null || n.call(t, r), o && o.onFocus) {
62
- var c;
63
- o == null || (c = o.onFocus) == null || c.call(o);
61
+ if ((r = t.onFocus) == null || r.call(t, o), n && n.onFocus) {
62
+ var i;
63
+ n == null || (i = n.onFocus) == null || i.call(n);
64
64
  } else
65
- v(!0);
66
- }, V = (t) => (r) => {
67
- var n;
68
- (n = t.onBlur) == null || n.call(t, r), o && o.onBlur ? o.onBlur() : v(!1);
69
- }, U = (t) => (r, ...n) => {
70
- var c, j;
71
- if (!S && (r.target || w.current) == null)
72
- 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." : we(17));
73
- o == null || (c = o.onChange) == null || c.call(o, r), (j = t.onChange) == null || j.call(t, r, ...n);
74
- }, M = (t) => (r) => {
75
- var n;
76
- w.current && r.currentTarget === r.target && w.current.focus(), (n = t.onClick) == null || n.call(t, r);
65
+ a(!0);
66
+ }, M = (t) => (o) => {
67
+ var r;
68
+ (r = t.onBlur) == null || r.call(t, o), n && n.onBlur ? n.onBlur() : a(!1);
69
+ }, U = (t) => (o, ...r) => {
70
+ var i, H;
71
+ if (!k && (o.target || x.current) == null)
72
+ 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." : xe(17));
73
+ n == null || (i = n.onChange) == null || i.call(n, o), (H = t.onChange) == null || H.call(t, o, ...r);
74
+ }, A = (t) => (o) => {
75
+ var r;
76
+ x.current && o.currentTarget === o.target && x.current.focus(), (r = t.onClick) == null || r.call(t, o);
77
77
  };
78
78
  return {
79
79
  disabled: h,
80
- error: b,
81
- focused: P,
82
- formControlContext: o,
80
+ error: w,
81
+ focused: R,
82
+ formControlContext: n,
83
83
  getInputProps: (t = {}) => {
84
- const n = m({}, {
85
- onBlur: p,
86
- onChange: _,
87
- onFocus: x
88
- }, z(t)), c = m({}, n, {
89
- onBlur: V(n),
90
- onChange: U(n),
91
- onFocus: B(n)
84
+ const r = y({}, {
85
+ onBlur: c,
86
+ onChange: m,
87
+ onFocus: v
88
+ }, z(t)), i = y({}, r, {
89
+ onBlur: M(r),
90
+ onChange: U(r),
91
+ onFocus: V(r)
92
92
  });
93
- return m({}, c, {
94
- "aria-invalid": b || void 0,
95
- defaultValue: g,
96
- value: y,
93
+ return y({}, i, {
94
+ "aria-invalid": w || void 0,
95
+ defaultValue: b,
96
+ value: g,
97
97
  required: C,
98
98
  disabled: h
99
99
  }, t, {
100
- ref: O
101
- }, c);
100
+ ref: T
101
+ }, i);
102
102
  },
103
103
  getRootProps: (t = {}) => {
104
- const r = z(a, ["onBlur", "onChange", "onFocus"]), n = m({}, r, z(t));
105
- return m({}, t, n, {
106
- onClick: M(n)
104
+ const o = z(s, ["onBlur", "onChange", "onFocus"]), r = y({}, o, z(t));
105
+ return y({}, t, r, {
106
+ onClick: A(r)
107
107
  });
108
108
  },
109
- inputRef: O,
109
+ inputRef: T,
110
110
  required: C,
111
- value: y
111
+ value: g
112
112
  };
113
113
  }
114
- const Ne = ["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"], Pe = (a) => {
114
+ const Re = ["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"], Ee = (s) => {
115
115
  const {
116
- disabled: s,
117
- error: u,
118
- focused: i,
119
- formControlContext: p,
120
- multiline: _,
121
- startAdornment: x,
122
- endAdornment: q
123
- } = a;
124
- return be({
125
- root: ["root", s && "disabled", u && "error", i && "focused", !!p && "formControl", _ && "multiline", !!x && "adornedStart", !!q && "adornedEnd"],
126
- input: ["input", s && "disabled", _ && "multiline"]
116
+ disabled: l,
117
+ error: p,
118
+ focused: d,
119
+ formControlContext: c,
120
+ multiline: m,
121
+ startAdornment: v,
122
+ endAdornment: P
123
+ } = s;
124
+ return we({
125
+ root: ["root", l && "disabled", p && "error", d && "focused", !!c && "formControl", m && "multiline", !!v && "adornedStart", !!P && "adornedEnd"],
126
+ input: ["input", l && "disabled", m && "multiline"]
127
127
  }, Ce(ve));
128
- }, ee = /* @__PURE__ */ f.forwardRef(function(s, u) {
129
- var i, p, _;
128
+ }, ee = /* @__PURE__ */ f.forwardRef(function(l, p) {
129
+ var d, c, m;
130
130
  const {
131
- "aria-describedby": x,
132
- "aria-label": q,
133
- "aria-labelledby": R,
131
+ "aria-describedby": v,
132
+ "aria-label": P,
133
+ "aria-labelledby": F,
134
134
  autoComplete: N,
135
- autoFocus: o,
136
- className: g,
135
+ autoFocus: n,
136
+ className: b,
137
137
  defaultValue: h,
138
- disabled: b,
138
+ disabled: w,
139
139
  endAdornment: C,
140
- error: y,
141
- id: F,
142
- multiline: d = !1,
143
- name: I,
144
- onClick: S,
145
- onChange: k,
146
- onKeyDown: w,
147
- onKeyUp: O,
148
- onFocus: P,
149
- onBlur: v,
150
- placeholder: B,
151
- readOnly: V,
140
+ error: g,
141
+ id: I,
142
+ multiline: _ = !1,
143
+ name: O,
144
+ onClick: k,
145
+ onChange: B,
146
+ onKeyDown: x,
147
+ onKeyUp: T,
148
+ onFocus: R,
149
+ onBlur: a,
150
+ placeholder: V,
151
+ readOnly: M,
152
152
  required: U,
153
- startAdornment: M,
154
- value: A,
155
- type: D,
153
+ startAdornment: A,
154
+ value: D,
155
+ type: j,
156
156
  rows: t,
157
- slotProps: r = {},
158
- slots: n = {},
159
- minRows: c,
160
- maxRows: j
161
- } = s, Y = ye(s, Ne), {
157
+ slotProps: o = {},
158
+ slots: r = {},
159
+ minRows: i,
160
+ maxRows: H
161
+ } = l, Y = ge(l, Re), {
162
162
  getRootProps: te,
163
163
  getInputProps: oe,
164
164
  focused: ne,
165
165
  formControlContext: re,
166
166
  error: ae,
167
167
  disabled: se
168
- } = qe({
169
- disabled: b,
168
+ } = Ne({
169
+ disabled: w,
170
170
  defaultValue: h,
171
- error: y,
172
- onBlur: v,
173
- onClick: S,
174
- onChange: k,
175
- onFocus: P,
171
+ error: g,
172
+ onBlur: a,
173
+ onClick: k,
174
+ onChange: B,
175
+ onFocus: R,
176
176
  required: U,
177
- value: A
178
- }), W = d ? void 0 : D ?? "text", $ = m({}, s, {
177
+ value: D
178
+ }), W = _ ? void 0 : j ?? "text", $ = y({}, l, {
179
179
  disabled: se,
180
180
  error: ae,
181
181
  focused: ne,
182
182
  formControlContext: re,
183
- multiline: d,
183
+ multiline: _,
184
184
  type: W
185
- }), G = Pe($), le = {
186
- "aria-describedby": x,
187
- "aria-label": q,
188
- "aria-labelledby": R,
185
+ }), G = Ee($), le = {
186
+ "aria-describedby": v,
187
+ "aria-label": P,
188
+ "aria-labelledby": F,
189
189
  autoComplete: N,
190
- autoFocus: o,
191
- id: F,
192
- onKeyDown: w,
193
- onKeyUp: O,
194
- name: I,
195
- placeholder: B,
196
- readOnly: V,
190
+ autoFocus: n,
191
+ id: I,
192
+ onKeyDown: x,
193
+ onKeyUp: T,
194
+ name: O,
195
+ placeholder: V,
196
+ readOnly: M,
197
197
  type: W
198
- }, J = (i = n.root) != null ? i : "div", ue = Q({
198
+ }, J = (d = r.root) != null ? d : "div", ie = Q({
199
199
  elementType: J,
200
200
  getSlotProps: te,
201
- externalSlotProps: r.root,
201
+ externalSlotProps: o.root,
202
202
  externalForwardedProps: Y,
203
203
  additionalProps: {
204
- ref: u
204
+ ref: p
205
205
  },
206
206
  ownerState: $,
207
- className: [G.root, g]
208
- }), K = d ? (p = n.textarea) != null ? p : "textarea" : (_ = n.input) != null ? _ : "input", ie = Q({
207
+ className: [G.root, b]
208
+ }), K = _ ? (c = r.textarea) != null ? c : "textarea" : (m = r.input) != null ? m : "input", ue = Q({
209
209
  elementType: K,
210
- getSlotProps: (pe) => oe(m({}, le, pe)),
211
- externalSlotProps: r.input,
212
- additionalProps: m({
213
- rows: d ? t : void 0
214
- }, d && !ge(K) && {
215
- minRows: t || c,
216
- maxRows: t || j
210
+ getSlotProps: (pe) => oe(y({}, le, pe)),
211
+ externalSlotProps: o.input,
212
+ additionalProps: y({
213
+ rows: _ ? t : void 0
214
+ }, _ && !be(K) && {
215
+ minRows: t || i,
216
+ maxRows: t || H
217
217
  }),
218
218
  ownerState: $,
219
219
  className: G.input
220
220
  });
221
- 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, m({}, ue, {
222
- children: [M, /* @__PURE__ */ T(K, m({}, ie)), C]
221
+ return process.env.NODE_ENV !== "production" && _ && t && (i || H) && console.warn("MUI: You can not use the `minRows` or `maxRows` props when the input `rows` prop is set."), /* @__PURE__ */ q(J, y({}, ie, {
222
+ children: [A, /* @__PURE__ */ S(K, y({}, ue)), C]
223
223
  }));
224
224
  });
225
225
  process.env.NODE_ENV !== "production" && (ee.propTypes = {
@@ -372,132 +372,141 @@ process.env.NODE_ENV !== "production" && (ee.propTypes = {
372
372
  */
373
373
  value: e.any
374
374
  });
375
- const Ee = (a) => /* @__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: {
375
+ const Fe = (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: {
376
376
  fill: "currentcolor",
377
377
  color: "currentcolor",
378
378
  width: "1em",
379
379
  height: "1em"
380
- }, ...a }, /* @__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__label_1lq2e_78", Fe = "_input_1lq2e_57", l = {
381
- "u-typography-h1": "_u-typography-h1_1lq2e_1",
382
- "u-typography-h2": "_u-typography-h2_1lq2e_8",
383
- "u-typography-h3": "_u-typography-h3_1lq2e_15",
384
- "u-typography-h4": "_u-typography-h4_1lq2e_22",
385
- "u-typography-h5": "_u-typography-h5_1lq2e_29",
386
- "u-typography-h6": "_u-typography-h6_1lq2e_36",
387
- "u-typography-base": "_u-typography-base_1lq2e_43",
388
- "u-typography-base--xxl": "_u-typography-base--xxl_1lq2e_49",
389
- "u-typography-base--xl": "_u-typography-base--xl_1lq2e_53",
390
- "u-typography-base--lg": "_u-typography-base--lg_1lq2e_57",
391
- "input__input-el": "_input__input-el_1lq2e_57",
392
- "u-typography-base--sm": "_u-typography-base--sm_1lq2e_61",
393
- "u-typography-base--bold": "_u-typography-base--bold_1lq2e_65",
394
- "u-typography-base--strikethrough": "_u-typography-base--strikethrough_1lq2e_68",
395
- "u-typography-base--underlined": "_u-typography-base--underlined_1lq2e_71",
396
- "u-typography-base--strikethrough-underlined": "_u-typography-base--strikethrough-underlined_1lq2e_74",
397
- input__label: Re,
398
- "input__input-el-wrapper": "_input__input-el-wrapper_1lq2e_83",
399
- "input__left-icon": "_input__left-icon_1lq2e_101",
400
- "input__right-icon": "_input__right-icon_1lq2e_101",
401
- "input__messages-wrapper": "_input__messages-wrapper_1lq2e_113",
402
- "input__info-message": "_input__info-message_1lq2e_121",
403
- "input__error-message": "_input__error-message_1lq2e_121",
404
- "input__chars-counter": "_input__chars-counter_1lq2e_132",
405
- "input--disabled": "_input--disabled_1lq2e_136",
406
- input: Fe,
407
- "input--focused": "_input--focused_1lq2e_142",
408
- "input--error": "_input--error_1lq2e_145"
409
- }, Be = de(
380
+ }, ...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" })), Ie = "_input__label_1r054_78", Oe = "_input_1r054_57", u = {
381
+ "u-typography-h1": "_u-typography-h1_1r054_1",
382
+ "u-typography-h2": "_u-typography-h2_1r054_8",
383
+ "u-typography-h3": "_u-typography-h3_1r054_15",
384
+ "u-typography-h4": "_u-typography-h4_1r054_22",
385
+ "u-typography-h5": "_u-typography-h5_1r054_29",
386
+ "u-typography-h6": "_u-typography-h6_1r054_36",
387
+ "u-typography-base": "_u-typography-base_1r054_43",
388
+ "u-typography-base--xxl": "_u-typography-base--xxl_1r054_49",
389
+ "u-typography-base--xl": "_u-typography-base--xl_1r054_53",
390
+ "u-typography-base--lg": "_u-typography-base--lg_1r054_57",
391
+ "input__input-el": "_input__input-el_1r054_57",
392
+ "u-typography-base--sm": "_u-typography-base--sm_1r054_61",
393
+ "u-typography-base--bold": "_u-typography-base--bold_1r054_65",
394
+ "u-typography-base--strikethrough": "_u-typography-base--strikethrough_1r054_68",
395
+ "u-typography-base--underlined": "_u-typography-base--underlined_1r054_71",
396
+ "u-typography-base--strikethrough-underlined": "_u-typography-base--strikethrough-underlined_1r054_74",
397
+ input__label: Ie,
398
+ "input__input-el-wrapper": "_input__input-el-wrapper_1r054_83",
399
+ "input__left-icon": "_input__left-icon_1r054_101",
400
+ "input__right-icon": "_input__right-icon_1r054_101",
401
+ "input__messages-wrapper": "_input__messages-wrapper_1r054_113",
402
+ "input__info-message": "_input__info-message_1r054_121",
403
+ "input__error-message": "_input__error-message_1r054_121",
404
+ "input__chars-counter": "_input__chars-counter_1r054_132",
405
+ "input--disabled": "_input--disabled_1r054_136",
406
+ input: Oe,
407
+ "input--focused": "_input--focused_1r054_142",
408
+ "input--error": "_input--error_1r054_145"
409
+ }, Me = de(
410
410
  ({
411
- label: a,
412
- infoMessage: s,
413
- error: u,
414
- errorMessage: i,
415
- leftIcon: p,
416
- rightIcon: _,
417
- id: x,
418
- disabled: q,
419
- type: R = "text",
411
+ label: s,
412
+ infoMessage: l,
413
+ error: p,
414
+ errorMessage: d,
415
+ leftIcon: c,
416
+ rightIcon: m,
417
+ id: v,
418
+ disabled: P,
419
+ type: F = "text",
420
420
  maxLength: N,
421
- hideCharsCounter: o = !1,
422
- onChange: g,
421
+ hideCharsCounter: n = !1,
422
+ onChange: b,
423
423
  classNameWrapper: h,
424
- classNameLabel: b,
424
+ classNameLabel: w,
425
425
  classNameInput: C,
426
- classNameInfoMessage: y,
427
- classNameErrorMessage: F,
428
- classNameCharsCounter: d,
429
- "data-testid-wrapper": I,
430
- "data-testid-label": S,
431
- "data-testid-input": k,
432
- "data-testid-infoMessage": w,
433
- "data-testid-errorMessage": O,
434
- "data-testid-charsCounter": P,
435
- ...v
436
- }, B) => {
437
- const [V, U] = ce(0), M = _e(), A = x || `input_${M}`;
438
- Object.assign(v, { "data-testid": k });
439
- const D = (t) => {
440
- var r, n;
441
- U((n = (r = t == null ? void 0 : t.target) == null ? void 0 : r.value) == null ? void 0 : n.length), g && g(t);
442
- };
443
- return /* @__PURE__ */ H("div", { className: E(l.input, h), "data-testid": I, children: [
444
- a && /* @__PURE__ */ T(
426
+ classNameInfoMessage: g,
427
+ classNameErrorMessage: I,
428
+ classNameCharsCounter: _,
429
+ "data-testid-wrapper": O,
430
+ "data-testid-label": k,
431
+ "data-testid-input": B,
432
+ "data-testid-infoMessage": x,
433
+ "data-testid-errorMessage": T,
434
+ "data-testid-charsCounter": R,
435
+ ...a
436
+ }, V) => {
437
+ const [M, U] = ce(0), A = _e(), D = v || `input_${A}`;
438
+ Object.assign(a, { "data-testid": B });
439
+ const j = (o) => {
440
+ var r, i;
441
+ U((i = (r = o == null ? void 0 : o.target) == null ? void 0 : r.value) == null ? void 0 : i.length), b && b(o);
442
+ }, t = me(() => a.multiline !== !0 ? {
443
+ type: F,
444
+ multiline: a.multiline
445
+ } : {
446
+ type: void 0,
447
+ multiline: a.multiline,
448
+ rows: (a == null ? void 0 : a.rows) || 5,
449
+ minRows: a == null ? void 0 : a.minRows,
450
+ maxRows: a == null ? void 0 : a.maxRows
451
+ }, [a]);
452
+ return /* @__PURE__ */ q("div", { className: E(u.input, h), "data-testid": O, children: [
453
+ s && /* @__PURE__ */ S(
445
454
  L,
446
455
  {
447
456
  element: "label",
448
- elementProps: { htmlFor: A },
449
- className: E(l.input__label, b),
450
- "data-testid": S,
451
- children: a
457
+ elementProps: { htmlFor: D },
458
+ className: E(u.input__label, w),
459
+ "data-testid": k,
460
+ children: s
452
461
  }
453
462
  ),
454
- /* @__PURE__ */ T(
463
+ /* @__PURE__ */ S(
455
464
  ee,
456
465
  {
457
- id: A,
458
- type: R,
459
- disabled: q,
460
- error: typeof u == "boolean" ? u : !!i,
461
- "aria-label": a,
466
+ id: D,
467
+ disabled: P,
468
+ error: typeof p == "boolean" ? p : !!d,
469
+ "aria-label": s,
462
470
  slotProps: {
463
- root: (t) => ({
464
- className: E(l["input__input-el-wrapper"], {
465
- [l["input--disabled"]]: t.disabled,
466
- [l["input--focused"]]: t.focused,
467
- [l["input--error"]]: t.error
471
+ root: (o) => ({
472
+ className: E(u["input__input-el-wrapper"], {
473
+ [u["input--disabled"]]: o.disabled,
474
+ [u["input--focused"]]: o.focused,
475
+ [u["input--error"]]: o.error
468
476
  })
469
477
  }),
470
478
  input: {
471
- ref: B,
472
- className: E(l["input__input-el"], C),
479
+ ref: V,
480
+ className: E(u["input__input-el"], C),
473
481
  maxLength: N,
474
- onChange: D,
475
- ...v
482
+ onChange: j,
483
+ ...a
476
484
  }
477
485
  },
478
- startAdornment: p && /* @__PURE__ */ T("span", { className: l["input__left-icon"], children: p }),
479
- endAdornment: _ && /* @__PURE__ */ T("span", { className: l["input__right-icon"], children: _ })
486
+ startAdornment: c && /* @__PURE__ */ S("span", { className: u["input__left-icon"], children: c }),
487
+ endAdornment: m && /* @__PURE__ */ S("span", { className: u["input__right-icon"], children: m }),
488
+ ...t
480
489
  }
481
490
  ),
482
- /* @__PURE__ */ H("div", { className: l["input__messages-wrapper"], children: [
483
- (i || s) && /* @__PURE__ */ H(
491
+ /* @__PURE__ */ q("div", { className: u["input__messages-wrapper"], children: [
492
+ (d || l) && /* @__PURE__ */ q(
484
493
  L,
485
494
  {
486
- className: i ? E(l["input__error-message"], F) : E(l["input__info-message"], y),
487
- "data-testid": i ? O : w,
495
+ className: d ? E(u["input__error-message"], I) : E(u["input__info-message"], g),
496
+ "data-testid": d ? T : x,
488
497
  children: [
489
- /* @__PURE__ */ T(Ee, {}),
490
- i || s
498
+ /* @__PURE__ */ S(Fe, {}),
499
+ d || l
491
500
  ]
492
501
  }
493
502
  ),
494
- N && !o && /* @__PURE__ */ H(
503
+ N && !n && /* @__PURE__ */ q(
495
504
  L,
496
505
  {
497
- className: E(l["input__chars-counter"], d),
498
- "data-testid": P,
506
+ className: E(u["input__chars-counter"], _),
507
+ "data-testid": R,
499
508
  children: [
500
- V,
509
+ M,
501
510
  " / ",
502
511
  N
503
512
  ]
@@ -508,5 +517,5 @@ const Ee = (a) => /* @__PURE__ */ f.createElement("svg", { xmlns: "http://www.w3
508
517
  }
509
518
  );
510
519
  export {
511
- Be as Input
520
+ Me as Input
512
521
  };
@@ -2,28 +2,7 @@ import { StoryObj } from '@storybook/react';
2
2
 
3
3
  declare const meta: {
4
4
  title: string;
5
- component: import('react').ForwardRefExoticComponent<import('react').InputHTMLAttributes<HTMLInputElement> & {
6
- label?: string | undefined;
7
- infoMessage?: string | undefined;
8
- error?: boolean | undefined;
9
- errorMessage?: string | undefined;
10
- leftIcon?: import('react').ReactNode;
11
- rightIcon?: import('react').ReactNode;
12
- type?: ("number" | "url" | "file" | "color" | "search" | (string & {}) | "button" | "time" | "image" | "text" | "reset" | "tel" | "email" | "date" | "hidden" | "range" | "datetime-local" | "month" | "password" | "week") | undefined;
13
- hideCharsCounter?: boolean | undefined;
14
- classNameWrapper?: string | undefined;
15
- classNameLabel?: string | undefined;
16
- classNameInput?: string | undefined;
17
- classNameInfoMessage?: string | undefined;
18
- classNameErrorMessage?: string | undefined;
19
- classNameCharsCounter?: string | undefined;
20
- 'data-testid-wrapper'?: string | undefined;
21
- 'data-testid-label'?: string | undefined;
22
- 'data-testid-input'?: string | undefined;
23
- 'data-testid-infoMessage'?: string | undefined;
24
- 'data-testid-errorMessage'?: string | undefined;
25
- 'data-testid-charsCounter'?: string | undefined;
26
- } & import('react').RefAttributes<HTMLInputElement>>;
5
+ component: import('react').ForwardRefExoticComponent<import('./Input').InputProps & import('react').RefAttributes<HTMLInputElement>>;
27
6
  tags: string[];
28
7
  parameters: {
29
8
  layout: string;
@@ -42,3 +21,4 @@ export declare const WithRightIconAndClickEvent: Story;
42
21
  export declare const WithBothIcons: Story;
43
22
  export declare const WithInfoMessage: Story;
44
23
  export declare const WithErrorMessage: Story;
24
+ export declare const Textarea: Story;
@@ -4,28 +4,7 @@ declare const meta: {
4
4
  title: string;
5
5
  component: ({ classNameWrapper, triggerDelay, value, onChange, ...rest }: {
6
6
  triggerDelay?: number | undefined;
7
- } & import('react').InputHTMLAttributes<HTMLInputElement> & {
8
- label?: string | undefined;
9
- infoMessage?: string | undefined;
10
- error?: boolean | undefined;
11
- errorMessage?: string | undefined;
12
- leftIcon?: import('react').ReactNode;
13
- rightIcon?: import('react').ReactNode;
14
- type?: ("number" | "url" | "file" | "color" | "search" | (string & {}) | "button" | "time" | "image" | "text" | "reset" | "tel" | "email" | "date" | "hidden" | "range" | "datetime-local" | "month" | "password" | "week") | undefined;
15
- hideCharsCounter?: boolean | undefined;
16
- classNameWrapper?: string | undefined;
17
- classNameLabel?: string | undefined;
18
- classNameInput?: string | undefined;
19
- classNameInfoMessage?: string | undefined;
20
- classNameErrorMessage?: string | undefined;
21
- classNameCharsCounter?: string | undefined;
22
- 'data-testid-wrapper'?: string | undefined;
23
- 'data-testid-label'?: string | undefined;
24
- 'data-testid-input'?: string | undefined;
25
- 'data-testid-infoMessage'?: string | undefined;
26
- 'data-testid-errorMessage'?: string | undefined;
27
- 'data-testid-charsCounter'?: string | undefined;
28
- } & import('react').RefAttributes<HTMLInputElement>) => import("react/jsx-runtime").JSX.Element;
7
+ } & (import('../Input/Input').InputProps & import('react').RefAttributes<HTMLInputElement>)) => import("react/jsx-runtime").JSX.Element;
29
8
  tags: string[];
30
9
  parameters: {
31
10
  layout: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pismo/marola",
3
3
  "description": "CDX tribe component library",
4
- "version": "1.0.0-beta.29",
4
+ "version": "1.0.0-beta.30",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
7
7
  "types": "dist/main.d.ts",
@@ -60,8 +60,8 @@
60
60
  "@types/react-dom": "^18.2.22",
61
61
  "@typescript-eslint/eslint-plugin": "^7.6.0",
62
62
  "@typescript-eslint/parser": "^7.6.0",
63
- "@vitest/coverage-v8": "^1.4.0",
64
63
  "@vitejs/plugin-react": "^4.2.1",
64
+ "@vitest/coverage-v8": "^1.4.0",
65
65
  "clsx": "^2.1.0",
66
66
  "commitlint": "^19.2.1",
67
67
  "cypress": "^13.8.1",
@@ -97,4 +97,4 @@
97
97
  "@mui/base": "^5.0.0-beta.40",
98
98
  "@mui/material": "^5.15.15"
99
99
  }
100
- }
100
+ }