mimir-ui-kit 1.37.8 → 1.37.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- ._textarea-wrapper_ta2xa_2 ._textarea_ta2xa_2{min-height:var(--textarea-height);padding-top:var(--textarea-space)!important;padding-bottom:var(--textarea-space);resize:none}._textarea-wrapper_ta2xa_2 ._textarea_ta2xa_2._has-label_ta2xa_8{padding-top:var(--textarea-top-space)!important}._textarea-wrapper_ta2xa_2 ._required-mark_ta2xa_11{display:block;flex:0 0 var(--input-required-mark-size);align-self:flex-start;width:var(--input-required-mark-size);height:var(--input-required-mark-size);margin-top:var(--required-mark-margin);margin-left:var(--mimir-space-m);background-color:var(--citrine-normal);border-radius:50%}._textarea-wrapper_ta2xa_2 ._label_ta2xa_22{position:absolute;top:calc(var(--input-height) / 2 - var(--input-font-size) / 2);left:var(--mimir-space-m);z-index:1;display:flex;color:var(--label-color);font-size:var(--input-font-size);white-space:nowrap;-moz-column-gap:var(--mimir-space-xs);column-gap:var(--mimir-space-xs);transform-origin:left center;transition:transform .15s ease-out,font-size .15s ease-out,left .15s ease-out,color .15s ease-out;-webkit-appearance:none;-moz-appearance:none;appearance:none;pointer-events:none}._textarea-wrapper_ta2xa_2 ._label_ta2xa_22._has-left-slot_ta2xa_37{left:calc(var(--mimir-space-m) + var(--icon-size) + var(--clear-button-mg))}._textarea-wrapper_ta2xa_2 ._label_ta2xa_22._active-label_ta2xa_40{font-size:var(--label-font-size-active);transform:var(--active-label-transform)}._textarea-wrapper_ta2xa_2 ._label_ta2xa_22._active-label_ta2xa_40._has-left-slot_ta2xa_37{left:var(--mimir-space-m)}._textarea-wrapper_ta2xa_2 ._label_ta2xa_22._active-label_ta2xa_40 ._required-mark_ta2xa_11{align-self:center;margin-top:0;margin-left:0}._s_ta2xa_53{--textarea-space: var(--mimir-space-2s);--required-mark-margin: var(--mimir-space-2s);--textarea-top-space: var(--mimir-space-l);--textarea-height: 76px;--textarea-padding: var(--mimir-space-xs) var(--mimir-space-s);--active-label-transform: translate( 0, calc(var(--label-font-size-active) * -1) )}._m_ta2xa_65{--textarea-space: var(--mimir-space-2s);--required-mark-margin: var(--mimir-space-2s);--textarea-top-space: var(--mimir-space-l);--textarea-height: 88px;--textarea-padding: var(--mimir-space-xs) var(--mimir-space-s);--active-label-transform: translate( 0, calc(var(--label-font-size-active) * -1) )}._l_ta2xa_22{--textarea-space: var(--mimir-space-2m);--required-mark-margin: var(--mimir-space-2m);--textarea-top-space: 25px;--textarea-height: 120px;--textarea-padding: var(--mimir-space-2m);--active-label-transform: translate( 0, calc(var(--label-font-size-active) * -1) )}._input-s_ta2xa_89{--textarea-height: var(--mimir-space-xxl) !important;--textarea-space: var(--mimir-space-1xs) !important;--textarea-top-space: calc(var(--mimir-space-l) - 1px) !important;--active-label-transform: translate(0, calc(var(--mimir-space-xs) * -1));--required-mark-margin: var(--mimir-space-2m)}._input-m_ta2xa_97{--textarea-height: var(--mimir-space-4xl) !important;--textarea-space: var(--mimir-space-2xs) !important;--textarea-top-space: calc(var(--mimir-space-l) + 1px) !important;--active-label-transform: translate(0, calc(var(--mimir-space-xss) * -1));--required-mark-margin: var(--mimir-space-l)}._input-l_ta2xa_105{--textarea-height: var(--mimir-space-4xxl) !important;--textarea-space: var(--mimir-space-2xs) !important;--required-mark-margin: var(--mimir-space-1xl)}
1
+ ._textarea-wrapper_rk5xe_2 ._textarea_rk5xe_2{min-height:var(--textarea-height);padding-top:var(--textarea-space)!important;padding-bottom:var(--textarea-space);resize:none}._textarea-wrapper_rk5xe_2 ._textarea_rk5xe_2._has-label_rk5xe_8{padding-top:var(--textarea-top-space)!important}._textarea-wrapper_rk5xe_2 ._clear_rk5xe_11{align-self:flex-start!important;margin-top:var(--textarea-clear-margin-top)}._textarea-wrapper_rk5xe_2 ._required-mark_rk5xe_15{display:block;flex:0 0 var(--input-required-mark-size);align-self:flex-start;width:var(--input-required-mark-size);height:var(--input-required-mark-size);margin-top:var(--required-mark-margin);margin-left:var(--mimir-space-m);background-color:var(--citrine-normal);border-radius:50%}._textarea-wrapper_rk5xe_2 ._label_rk5xe_26{position:absolute;top:calc(var(--input-height) / 2 - var(--input-font-size) / 2);left:var(--mimir-space-m);z-index:1;display:flex;max-width:calc(100% - var(--textarea-space));color:var(--label-color);font-size:var(--input-font-size);white-space:nowrap;-moz-column-gap:var(--mimir-space-xs);column-gap:var(--mimir-space-xs);transform-origin:left center;transition:transform .15s ease-out,font-size .15s ease-out,left .15s ease-out,color .15s ease-out;-webkit-appearance:none;-moz-appearance:none;appearance:none;pointer-events:none}._textarea-wrapper_rk5xe_2 ._label-text_rk5xe_42{overflow:hidden;text-overflow:ellipsis}._textarea-wrapper_rk5xe_2 ._label_rk5xe_26._has-right-slot_rk5xe_46{max-width:calc(100% - var(--textarea-space) - var(--mimir-space-2xl))}._textarea-wrapper_rk5xe_2 ._label_rk5xe_26._has-right-slot_rk5xe_46._has-required_rk5xe_49{max-width:calc(100% - var(--textarea-space) - var(--mimir-space-2xl) - var(--mimir-space-xl))}._textarea-wrapper_rk5xe_2 ._label_rk5xe_26._has-required_rk5xe_49{max-width:calc(100% - var(--textarea-space) - var(--mimir-space-2xl))}._textarea-wrapper_rk5xe_2 ._label_rk5xe_26._has-left-slot_rk5xe_55{left:calc(var(--mimir-space-m) + var(--icon-size) + var(--clear-button-mg))}._textarea-wrapper_rk5xe_2 ._label_rk5xe_26._active-label_rk5xe_58{font-size:var(--label-font-size-active);transform:var(--active-label-transform)}._textarea-wrapper_rk5xe_2 ._label_rk5xe_26._active-label_rk5xe_58._has-left-slot_rk5xe_55{left:var(--mimir-space-m)}._textarea-wrapper_rk5xe_2 ._label_rk5xe_26._active-label_rk5xe_58 ._required-mark_rk5xe_15{align-self:center;margin-top:0;margin-left:0}._s_rk5xe_71{--textarea-space: var(--mimir-space-2s);--required-mark-margin: var(--mimir-space-2s);--textarea-top-space: var(--mimir-space-l);--textarea-height: 76px;--textarea-padding: var(--mimir-space-xs) var(--mimir-space-s);--active-label-transform: translate( 0, calc(var(--label-font-size-active) * -1) );--textarea-clear-margin-top: var(--mimir-space-m)}._m_rk5xe_84{--textarea-space: var(--mimir-space-2s);--required-mark-margin: var(--mimir-space-2s);--textarea-top-space: var(--mimir-space-l);--textarea-height: 88px;--textarea-padding: var(--mimir-space-xs) var(--mimir-space-s);--active-label-transform: translate( 0, calc(var(--label-font-size-active) * -1) );--textarea-clear-margin-top: var(--mimir-space-m)}._l_rk5xe_26{--textarea-space: var(--mimir-space-2m);--required-mark-margin: var(--mimir-space-2m);--textarea-top-space: 25px;--textarea-height: 120px;--textarea-padding: var(--mimir-space-2m);--active-label-transform: translate( 0, calc(var(--label-font-size-active) * -1) );--textarea-clear-margin-top: var(--mimir-space-xl)}._input-s_rk5xe_110{--textarea-height: var(--mimir-space-xxl) !important;--textarea-space: var(--mimir-space-1xs) !important;--textarea-top-space: calc(var(--mimir-space-l) - 1px) !important;--active-label-transform: translate(0, calc(var(--mimir-space-xs) * -1));--required-mark-margin: var(--mimir-space-2m)}._input-m_rk5xe_118{--textarea-height: var(--mimir-space-4xl) !important;--textarea-space: var(--mimir-space-2xs) !important;--textarea-top-space: calc(var(--mimir-space-l) + 1px) !important;--active-label-transform: translate(0, calc(var(--mimir-space-xss) * -1));--required-mark-margin: var(--mimir-space-l)}._input-l_rk5xe_126{--textarea-height: var(--mimir-space-4xxl) !important;--textarea-space: var(--mimir-space-2xs) !important;--required-mark-margin: var(--mimir-space-1xl)}
@@ -1,7 +1,7 @@
1
1
  import { EMultiSelectSearchSize as t } from "./constants.js";
2
2
  import "../../Input-BYrIS5GU.js";
3
3
  import { EInputSize as e } from "../Input/constants.js";
4
- const c = (r) => {
4
+ const w = (r) => {
5
5
  switch (r) {
6
6
  case t.M:
7
7
  return e.M;
@@ -10,10 +10,10 @@ const c = (r) => {
10
10
  default:
11
11
  return e.M;
12
12
  }
13
- }, u = (r, o) => r ? o === t.L ? "DropdownArrowUp24px" : "DropdownArrowUp16px" : o === t.L ? "DropdownArrowDown24px" : "DropdownArrowBottom16px", m = (r, o) => r && r.length > 0 ? r.map((n) => n[o]).join(", ") + (r.length > 1 ? ", " : "") : "", d = (r, o) => r.map((n) => n[o]).join(", ") + (r.length > 1 ? ", " : "");
13
+ }, c = (r, o) => r ? o === t.L ? "DropdownArrowUp24px" : "DropdownArrowUp16px" : o === t.L ? "DropdownArrowDown24px" : "DropdownArrowBottom16px", m = (r, o) => r && r.length > 0 ? r.map((n) => n[o]).join(", ") : "", a = (r, o) => r.map((n) => n[o]).join(", ");
14
14
  export {
15
- u as getDropdownArrowIcon,
15
+ c as getDropdownArrowIcon,
16
16
  m as getInitialInputValue,
17
- d as joinSelectedItems,
18
- c as mapSizeToInputSize
17
+ a as joinSelectedItems,
18
+ w as mapSizeToInputSize
19
19
  };
@@ -1,165 +1,171 @@
1
- import { jsxs as B, jsx as n } from "react/jsx-runtime";
2
- import { c as i } from "../../index-DIxK0V-G.js";
1
+ import { jsxs as B, jsx as r } from "react/jsx-runtime";
2
+ import { c as o } from "../../index-DIxK0V-G.js";
3
3
  import { memo as Q, forwardRef as U, useState as F, useRef as X, useEffect as Y } from "react";
4
4
  import { useAutoResizeTextArea as Z } from "./hooks.js";
5
5
  import { useMergeRefs as $ } from "../../hooks/useMergeRefs/useMergeRefs.js";
6
6
  import { Icon as ee } from "../../icons/Icon.js";
7
- import { Button as ae } from "../Button/Button.js";
7
+ import { Button as te } from "../Button/Button.js";
8
8
  import { c as e } from "../../Input-BYrIS5GU.js";
9
- import { EInputVariant as te } from "../Input/constants.js";
10
- import '../../assets/TextArea.css';const se = "_textarea_ta2xa_2", re = "_label_ta2xa_22", le = "_s_ta2xa_53", ne = "_m_ta2xa_65", oe = "_l_ta2xa_22", a = {
11
- "textarea-wrapper": "_textarea-wrapper_ta2xa_2",
12
- textarea: se,
13
- "has-label": "_has-label_ta2xa_8",
14
- "required-mark": "_required-mark_ta2xa_11",
15
- label: re,
16
- "has-left-slot": "_has-left-slot_ta2xa_37",
17
- "active-label": "_active-label_ta2xa_40",
18
- s: le,
19
- m: ne,
20
- l: oe,
21
- "input-s": "_input-s_ta2xa_89",
22
- "input-m": "_input-m_ta2xa_97",
23
- "input-l": "_input-l_ta2xa_105"
24
- }, j = (t) => {
25
- var _, o;
26
- if (!t)
9
+ import { EInputVariant as ae } from "../Input/constants.js";
10
+ import '../../assets/TextArea.css';const re = "_textarea_rk5xe_2", se = "_clear_rk5xe_11", le = "_label_rk5xe_26", ne = "_s_rk5xe_71", oe = "_m_rk5xe_84", ce = "_l_rk5xe_26", t = {
11
+ "textarea-wrapper": "_textarea-wrapper_rk5xe_2",
12
+ textarea: re,
13
+ "has-label": "_has-label_rk5xe_8",
14
+ clear: se,
15
+ "required-mark": "_required-mark_rk5xe_15",
16
+ label: le,
17
+ "label-text": "_label-text_rk5xe_42",
18
+ "has-right-slot": "_has-right-slot_rk5xe_46",
19
+ "has-required": "_has-required_rk5xe_49",
20
+ "has-left-slot": "_has-left-slot_rk5xe_55",
21
+ "active-label": "_active-label_rk5xe_58",
22
+ s: ne,
23
+ m: oe,
24
+ l: ce,
25
+ "input-s": "_input-s_rk5xe_110",
26
+ "input-m": "_input-m_rk5xe_118",
27
+ "input-l": "_input-l_rk5xe_126"
28
+ }, j = (a) => {
29
+ var p, c;
30
+ if (!a)
27
31
  return null;
28
- switch (t.addonType) {
32
+ switch (a.addonType) {
29
33
  case "icon": {
30
- const f = (_ = t.addonContent) == null ? void 0 : _.includes("16px"), b = (o = t.addonContent) == null ? void 0 : o.includes("24px");
31
- return /* @__PURE__ */ n(
34
+ const x = (p = a.addonContent) == null ? void 0 : p.includes("16px"), N = (c = a.addonContent) == null ? void 0 : c.includes("24px");
35
+ return /* @__PURE__ */ r(
32
36
  ee,
33
37
  {
34
38
  style: {
35
- "--icon-size": i({
36
- "16px": f,
37
- "24px": b
39
+ "--icon-size": o({
40
+ "16px": x,
41
+ "24px": N
38
42
  })
39
43
  },
40
44
  className: e["addon-icon"],
41
- iconName: t.addonContent
45
+ iconName: a.addonContent
42
46
  }
43
47
  );
44
48
  }
45
49
  case "text":
46
- return t.addonContent;
50
+ return a.addonContent;
47
51
  default:
48
52
  return null;
49
53
  }
50
- }, ce = Q(
54
+ }, ie = Q(
51
55
  U(
52
- (t, _) => {
56
+ (a, p) => {
53
57
  const {
54
- value: o,
55
- className: f,
56
- wrapperClassName: b,
57
- variant: R = te.DefaultGray,
58
- autofocus: N,
58
+ value: c,
59
+ className: x,
60
+ wrapperClassName: N,
61
+ variant: R = ae.DefaultGray,
62
+ autofocus: g,
59
63
  readonly: s,
60
64
  status: T,
61
65
  id: I,
62
- onFocus: g,
63
- onBlur: C,
66
+ onFocus: C,
67
+ onBlur: q,
64
68
  label: u,
65
- onChange: c,
69
+ onChange: i,
66
70
  withClearButton: E,
67
71
  disabled: d,
68
72
  rightAddon: L,
69
73
  leftAddon: S,
70
74
  size: m = "m",
71
75
  inputSize: v,
72
- required: A,
76
+ required: h,
73
77
  ...D
74
- } = t, [p, w] = F(N), [x, y] = F(!!o), r = X(null), G = $(r, _);
78
+ } = a, [_, A] = F(g), [f, w] = F(!!c), l = X(null), G = $(l, p);
75
79
  Y(() => {
76
- N && w(!0);
77
- }, [N]);
80
+ g && A(!0);
81
+ }, [g]);
78
82
  const V = Z(
79
- r.current,
83
+ l.current,
80
84
  v
81
- ), M = (l) => {
82
- const z = l.currentTarget.value;
83
- C == null || C(l), w(!1), y(!!z);
84
- }, O = (l) => {
85
- s || (w(!0), g == null || g(l));
85
+ ), M = (n) => {
86
+ const z = n.currentTarget.value;
87
+ q == null || q(n), A(!1), w(!!z);
88
+ }, O = (n) => {
89
+ s || (A(!0), C == null || C(n));
86
90
  }, P = () => {
87
- r != null && r.current && (r.current.value = "", r.current.focus(), y(!1), V(), c == null || c({
91
+ l != null && l.current && (l.current.value = "", l.current.focus(), w(!1), V(), i == null || i({
88
92
  target: { value: "" }
89
93
  }));
90
- }, W = (l) => {
91
- const z = l.target.value;
92
- y(!!z), V(), c == null || c(l);
93
- }, h = j(S), k = j(L), H = {
94
+ }, W = (n) => {
95
+ const z = n.target.value;
96
+ w(!!z), V(), i == null || i(n);
97
+ }, b = j(S), k = j(L), H = {
94
98
  [e.readonly]: d || s,
95
- [e.focused]: p,
99
+ [e.focused]: _,
96
100
  [e.disabled]: d || s,
97
- [e["has-left-slot"]]: !!h,
101
+ [e["has-left-slot"]]: !!b,
98
102
  [e["has-right-slot"]]: !!k,
99
- [a["has-label"]]: !!u
100
- }, q = p || x || !!o, J = i(
103
+ [t["has-label"]]: !!u
104
+ }, y = _ || f || !!c, J = o(
101
105
  e.label,
102
- a.label,
106
+ t.label,
103
107
  {
104
- [a["active-label"]]: q,
108
+ [t["active-label"]]: y,
105
109
  [e.disabled]: d || s,
106
- [a["has-left-slot"]]: !!h
110
+ [t["has-left-slot"]]: !!b,
111
+ [t["has-right-slot"]]: !!k,
112
+ [t["has-required"]]: h
107
113
  },
108
- f,
114
+ x,
109
115
  e[m]
110
- ), K = i(
111
- a.textarea,
116
+ ), K = o(
117
+ t.textarea,
112
118
  e.input,
113
119
  H,
114
- f,
120
+ x,
115
121
  [
116
122
  e[R],
117
- a[m],
123
+ t[m],
118
124
  e[m],
119
- a[v ?? ""],
125
+ t[v ?? ""],
120
126
  e[T ?? ""]
121
127
  ]
122
128
  );
123
129
  return /* @__PURE__ */ B(
124
130
  "div",
125
131
  {
126
- className: i(
132
+ className: o(
127
133
  e["input-wrapper"],
128
- a["textarea-wrapper"],
134
+ t["textarea-wrapper"],
129
135
  e[R],
130
136
  e[T ?? ""],
131
- a[m],
137
+ t[m],
132
138
  e[m],
133
- a[v ?? ""],
139
+ t[v ?? ""],
134
140
  {
135
141
  [e.disabled]: d || s,
136
- [e.focused]: p
142
+ [e.focused]: _
137
143
  },
138
- b
144
+ N
139
145
  ),
140
146
  children: [
141
147
  u && /* @__PURE__ */ B("label", { htmlFor: I, className: J, children: [
142
- u,
143
- A && (x || p) && /* @__PURE__ */ n(
148
+ /* @__PURE__ */ r("span", { className: t["label-text"], children: u }),
149
+ h && (f || _) && /* @__PURE__ */ r(
144
150
  "span",
145
151
  {
146
- className: a["required-mark"],
152
+ className: t["required-mark"],
147
153
  "data-testid": "required-mark"
148
154
  }
149
155
  )
150
156
  ] }),
151
- h && /* @__PURE__ */ n(
157
+ b && /* @__PURE__ */ r(
152
158
  "span",
153
159
  {
154
- className: i(e["left-slot"], {
155
- [e.focused]: q,
160
+ className: o(e["left-slot"], {
161
+ [e.focused]: y,
156
162
  [e["has-label"]]: !!u
157
163
  }),
158
164
  "data-testid": "left-addon",
159
- children: h
165
+ children: b
160
166
  }
161
167
  ),
162
- /* @__PURE__ */ n(
168
+ /* @__PURE__ */ r(
163
169
  "textarea",
164
170
  {
165
171
  ref: G,
@@ -168,35 +174,35 @@ import '../../assets/TextArea.css';const se = "_textarea_ta2xa_2", re = "_label_
168
174
  onFocus: O,
169
175
  onBlur: M,
170
176
  readOnly: s,
171
- value: o,
177
+ value: c,
172
178
  onChange: W,
173
- required: A,
179
+ required: h,
174
180
  ...D
175
181
  }
176
182
  ),
177
- k && /* @__PURE__ */ n(
183
+ k && /* @__PURE__ */ r(
178
184
  "span",
179
185
  {
180
- className: i(e["right-slot"], {
181
- [e.focused]: q,
186
+ className: o(e["right-slot"], {
187
+ [e.focused]: y,
182
188
  [e["has-label"]]: !!u
183
189
  }),
184
190
  "data-testid": "right-addon",
185
191
  children: k
186
192
  }
187
193
  ),
188
- A && !x && !p && /* @__PURE__ */ n(
194
+ h && !f && !_ && /* @__PURE__ */ r(
189
195
  "span",
190
196
  {
191
- className: a["required-mark"],
197
+ className: t["required-mark"],
192
198
  "data-testid": "required-mark"
193
199
  }
194
200
  ),
195
- E && x && /* @__PURE__ */ n(
196
- ae,
201
+ E && f && /* @__PURE__ */ r(
202
+ te,
197
203
  {
198
204
  tabIndex: -1,
199
- className: e.clear,
205
+ className: o(e.clear, t.clear),
200
206
  isIconButton: !0,
201
207
  iconName: "Close16px",
202
208
  size: "m-s",
@@ -212,7 +218,7 @@ import '../../assets/TextArea.css';const se = "_textarea_ta2xa_2", re = "_label_
212
218
  }
213
219
  )
214
220
  );
215
- ce.displayName = "TextArea";
221
+ ie.displayName = "TextArea";
216
222
  export {
217
- ce as TextArea
223
+ ie as TextArea
218
224
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mimir-ui-kit",
3
3
  "private": false,
4
- "version": "1.37.8",
4
+ "version": "1.37.10",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {