mimir-ui-kit 1.35.4 → 1.36.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. package/dist/{Input-B-gKQ9FT.js → Input-DlGNMuUD.js} +67 -64
  2. package/dist/assets/Input.css +1 -1
  3. package/dist/assets/ListPhotos.css +1 -1
  4. package/dist/assets/MultiSelectSearch.css +1 -0
  5. package/dist/assets/SelectSearch.css +1 -1
  6. package/dist/combobox-CDU06zJj.js +2855 -0
  7. package/dist/components/Accordion/Accordion.js +168 -166
  8. package/dist/components/Button/Button.d.ts +36 -0
  9. package/dist/components/Button/Button.js +44 -43
  10. package/dist/components/CheckboxMimir/CheckboxMimir.d.ts +2 -0
  11. package/dist/components/CheckboxMimir/CheckboxMimir.js +37 -30
  12. package/dist/components/Chip/Chip.d.ts +5 -1
  13. package/dist/components/Chip/Chip.js +23 -22
  14. package/dist/components/DatePicker/DatePicker.js +1 -1
  15. package/dist/components/Input/Input.js +1 -1
  16. package/dist/components/Input/index.js +1 -1
  17. package/dist/components/InputPassword/InputPassword.js +1 -1
  18. package/dist/components/InputPhoneNumber/InputPhoneNumber.js +1 -1
  19. package/dist/components/ListPhotos/ListPhotos.js +4 -4
  20. package/dist/components/MultiSelectSearch/MultiSelectSearch.d.ts +22 -0
  21. package/dist/components/MultiSelectSearch/MultiSelectSearch.js +318 -0
  22. package/dist/components/MultiSelectSearch/constants.d.ts +4 -0
  23. package/dist/components/MultiSelectSearch/constants.js +4 -0
  24. package/dist/components/MultiSelectSearch/index.d.ts +3 -0
  25. package/dist/components/MultiSelectSearch/index.js +6 -0
  26. package/dist/components/MultiSelectSearch/types.d.ts +60 -0
  27. package/dist/components/MultiSelectSearch/utils.d.ts +8 -0
  28. package/dist/components/MultiSelectSearch/utils.js +19 -0
  29. package/dist/components/OtpInput/OtpInput.js +1 -1
  30. package/dist/components/SelectSearch/SelectSearch.js +172 -3017
  31. package/dist/components/SelectSearch/utils.d.ts +5 -0
  32. package/dist/components/SelectSearch/utils.js +17 -0
  33. package/dist/components/Switcher/Switcher.js +48 -48
  34. package/dist/components/TabTrail/TabTrail.js +171 -171
  35. package/dist/components/TextArea/TextArea.js +1 -1
  36. package/dist/components/index.d.ts +3 -0
  37. package/dist/components/index.js +48 -44
  38. package/dist/index.js +50 -46
  39. package/dist/open-closed-CdldUPoq.js +86 -0
  40. package/dist/use-resolve-button-type-DhFdPxnv.js +12 -0
  41. package/package.json +3 -2
  42. package/dist/open-closed-Cy6VDfYc.js +0 -93
  43. package/dist/use-resolve-button-type-BAxjHhds.js +0 -19
@@ -0,0 +1,5 @@
1
+ import { ESelectSearchSize } from './constants';
2
+ import { EInputSize } from '../Input';
3
+
4
+ export declare const mapSizeToInputSize: (size: ESelectSearchSize) => EInputSize;
5
+ export declare const getDropdownArrowIcon: (isOpen: boolean, size: ESelectSearchSize) => "DropdownArrowBottom16px" | "DropdownArrowUp24px" | "DropdownArrowDown24px" | "DropdownArrowUp16px";
@@ -0,0 +1,17 @@
1
+ import { ESelectSearchSize as r } from "./constants.js";
2
+ import "../../Input-DlGNMuUD.js";
3
+ import { EInputSize as t } from "../Input/constants.js";
4
+ const c = (o) => {
5
+ switch (o) {
6
+ case r.M:
7
+ return t.M;
8
+ case r.L:
9
+ return t.L;
10
+ default:
11
+ return t.M;
12
+ }
13
+ }, i = (o, p) => o ? p === r.L ? "DropdownArrowUp24px" : "DropdownArrowUp16px" : p === r.L ? "DropdownArrowDown24px" : "DropdownArrowBottom16px";
14
+ export {
15
+ i as getDropdownArrowIcon,
16
+ c as mapSizeToInputSize
17
+ };
@@ -1,56 +1,56 @@
1
- import { jsxs as N, jsx as H } from "react/jsx-runtime";
2
- import { H as Z } from "../../field-FJ34aSs4.js";
3
- import { K as L, w as ee, z as te, U as re, u as se, a as ae, b as ce, T as le, I as oe, G as ie, j as ne, p as ue } from "../../label-y3ANLTNC.js";
4
- import { W as he, H as j, y as me, p as de, o as g, $ as pe, b as fe, D as be, c as I } from "../../keyboard-B0lm_zyn.js";
5
- import u, { createContext as we, useState as G, useMemo as K, useId as _e, useContext as ge, useRef as ve, useCallback as $e, Fragment as ke, forwardRef as xe } from "react";
6
- import { w as ye } from "../../use-active-press-86hajhdd.js";
7
- import { T as Pe } from "../../use-resolve-button-type-BAxjHhds.js";
8
- import { r as Te } from "../../bugs-diTMAGNw.js";
9
- import { c as v } from "../../index-DIxK0V-G.js";
10
- import { ELabelPositions as Ce } from "./constants.js";
11
- import '../../assets/Switcher.css';let x = we(null);
12
- x.displayName = "GroupContext";
13
- let De = ke;
14
- function Ee(s) {
1
+ import { jsxs as L, jsx as N } from "react/jsx-runtime";
2
+ import { H as te } from "../../field-FJ34aSs4.js";
3
+ import { K as I, w as re, z as se, U as ae, u as ce, a as le, b as oe, T as ie, I as ne, G as ue, j as he, p as me } from "../../label-y3ANLTNC.js";
4
+ import { W as de, H as j, y as pe, p as fe, o as $, $ as be, b as we, D as _e, c as H } from "../../keyboard-B0lm_zyn.js";
5
+ import u, { createContext as $e, useState as x, useMemo as G, useId as ge, useContext as ve, useRef as ke, useCallback as xe, Fragment as ye, forwardRef as Pe } from "react";
6
+ import { w as Ce } from "../../use-active-press-86hajhdd.js";
7
+ import { e as De } from "../../use-resolve-button-type-DhFdPxnv.js";
8
+ import { r as Fe } from "../../bugs-diTMAGNw.js";
9
+ import { c as g } from "../../index-DIxK0V-G.js";
10
+ import { ELabelPositions as Ee } from "./constants.js";
11
+ import '../../assets/Switcher.css';let y = $e(null);
12
+ y.displayName = "GroupContext";
13
+ let Se = ye;
14
+ function Te(s) {
15
15
  var l;
16
- let [e, n] = G(null), [h, m] = te(), [d, t] = re(), a = K(() => ({ switch: e, setSwitch: n }), [e, n]), c = {}, p = s;
16
+ let [e, n] = x(null), [h, m] = se(), [d, t] = ae(), a = G(() => ({ switch: e, setSwitch: n }), [e, n]), c = {}, p = s;
17
17
  return u.createElement(t, { name: "Switch.Description", value: d }, u.createElement(m, { name: "Switch.Label", value: h, props: { htmlFor: (l = a.switch) == null ? void 0 : l.id, onClick(o) {
18
18
  e && (o.currentTarget instanceof HTMLLabelElement && o.preventDefault(), e.click(), e.focus({ preventScroll: !0 }));
19
- } } }, u.createElement(x.Provider, { value: a }, j({ ourProps: c, theirProps: p, slot: {}, defaultTag: De, name: "Switch.Group" }))));
19
+ } } }, u.createElement(y.Provider, { value: a }, j({ ourProps: c, theirProps: p, slot: {}, defaultTag: Se, name: "Switch.Group" }))));
20
20
  }
21
- let Fe = "button";
22
- function Se(s, l) {
21
+ let Le = "button";
22
+ function Ne(s, l) {
23
23
  var e;
24
- let n = _e(), h = se(), m = ae(), { id: d = h || `headlessui-switch-${n}`, disabled: t = m || !1, checked: a, defaultChecked: c, onChange: p, name: o, value: $, form: k, autoFocus: _ = !1, ...R } = s, y = ge(x), P = ve(null), M = me(P, l, y === null ? null : y.setSwitch), f = ce(c), [b, w] = le(a, p, f ?? !1), U = de(), [T, C] = G(!1), D = g(() => {
25
- C(!0), w == null || w(!b), U.nextFrame(() => {
26
- C(!1);
24
+ let n = ge(), h = ce(), m = le(), { id: d = h || `headlessui-switch-${n}`, disabled: t = m || !1, checked: a, defaultChecked: c, onChange: p, name: o, value: v, form: k, autoFocus: _ = !1, ...K } = s, P = ve(y), [R, M] = x(null), U = ke(null), O = pe(U, l, P === null ? null : P.setSwitch, M), f = oe(c), [b, w] = ie(a, p, f ?? !1), V = fe(), [C, D] = x(!1), F = $(() => {
25
+ D(!0), w == null || w(!b), V.nextFrame(() => {
26
+ D(!1);
27
27
  });
28
- }), O = g((r) => {
29
- if (Te(r.currentTarget)) return r.preventDefault();
30
- r.preventDefault(), D();
31
- }), V = g((r) => {
32
- r.key === I.Space ? (r.preventDefault(), D()) : r.key === I.Enter && ue(r.currentTarget);
33
- }), W = g((r) => r.preventDefault()), q = oe(), z = ie(), { isFocusVisible: E, focusProps: B } = pe({ autoFocus: _ }), { isHovered: F, hoverProps: J } = fe({ isDisabled: t }), { pressed: S, pressProps: X } = ye({ disabled: t }), A = K(() => ({ checked: b, disabled: t, hover: F, focus: E, active: S, autofocus: _, changing: T }), [b, F, E, S, t, T, _]), Q = be({ id: d, ref: M, role: "switch", type: Pe(s, P), tabIndex: s.tabIndex === -1 ? 0 : (e = s.tabIndex) != null ? e : 0, "aria-checked": b, "aria-labelledby": q, "aria-describedby": z, disabled: t || void 0, autoFocus: _, onClick: O, onKeyUp: V, onKeyPress: W }, B, J, X), Y = $e(() => {
28
+ }), W = $((r) => {
29
+ if (Fe(r.currentTarget)) return r.preventDefault();
30
+ r.preventDefault(), F();
31
+ }), q = $((r) => {
32
+ r.key === H.Space ? (r.preventDefault(), F()) : r.key === H.Enter && me(r.currentTarget);
33
+ }), z = $((r) => r.preventDefault()), A = ne(), B = ue(), { isFocusVisible: E, focusProps: J } = be({ autoFocus: _ }), { isHovered: S, hoverProps: Q } = we({ isDisabled: t }), { pressed: T, pressProps: X } = Ce({ disabled: t }), Y = G(() => ({ checked: b, disabled: t, hover: S, focus: E, active: T, autofocus: _, changing: C }), [b, S, E, T, t, C, _]), Z = _e({ id: d, ref: O, role: "switch", type: De(s, R), tabIndex: s.tabIndex === -1 ? 0 : (e = s.tabIndex) != null ? e : 0, "aria-checked": b, "aria-labelledby": A, "aria-describedby": B, disabled: t || void 0, autoFocus: _, onClick: W, onKeyUp: q, onKeyPress: z }, J, Q, X), ee = xe(() => {
34
34
  if (f !== void 0) return w == null ? void 0 : w(f);
35
35
  }, [w, f]);
36
- return u.createElement(u.Fragment, null, o != null && u.createElement(ne, { disabled: t, data: { [o]: $ || "on" }, overrides: { type: "checkbox", checked: b }, form: k, onReset: Y }), j({ ourProps: Q, theirProps: R, slot: A, defaultTag: Fe, name: "Switch" }));
36
+ return u.createElement(u.Fragment, null, o != null && u.createElement(he, { disabled: t, data: { [o]: v || "on" }, overrides: { type: "checkbox", checked: b }, form: k, onReset: ee }), j({ ourProps: Z, theirProps: K, slot: Y, defaultTag: Le, name: "Switch" }));
37
37
  }
38
- let Ne = he(Se), He = Ee, Ie = L, Le = ee, je = Object.assign(Ne, { Group: He, Label: Ie, Description: Le });
39
- const Ge = "_left_gu0m2_14", Ke = "_right_gu0m2_17", Re = "_label_gu0m2_21", Me = "_switcher_gu0m2_2", i = {
38
+ let He = de(Ne), Ie = Te, je = I, Ge = re, Ke = Object.assign(He, { Group: Ie, Label: je, Description: Ge });
39
+ const Re = "_left_gu0m2_14", Me = "_right_gu0m2_17", Ue = "_label_gu0m2_21", Oe = "_switcher_gu0m2_2", i = {
40
40
  "switcher-wrapper": "_switcher-wrapper_gu0m2_2",
41
- left: Ge,
42
- right: Ke,
43
- label: Re,
44
- switcher: Me,
41
+ left: Re,
42
+ right: Me,
43
+ label: Ue,
44
+ switcher: Oe,
45
45
  "switcher-checked": "_switcher-checked_gu0m2_45",
46
46
  "switcher-thumb": "_switcher-thumb_gu0m2_55",
47
47
  "switcher-checked-thumb": "_switcher-checked-thumb_gu0m2_65"
48
- }, Qe = xe(
48
+ }, Ze = Pe(
49
49
  ({
50
50
  id: s,
51
51
  label: l,
52
52
  hasLabel: e = !1,
53
- labelPosition: n = Ce.LEFT,
53
+ labelPosition: n = Ee.LEFT,
54
54
  className: h,
55
55
  labelClassName: m,
56
56
  switcherThumbClassName: d,
@@ -59,33 +59,33 @@ const Ge = "_left_gu0m2_14", Ke = "_right_gu0m2_17", Re = "_label_gu0m2_21", Me
59
59
  checked: c,
60
60
  ...p
61
61
  }, o) => {
62
- const $ = (k) => typeof a == "function" ? a({ ...k, checked: c }) : a;
63
- return /* @__PURE__ */ N(
64
- Z,
62
+ const v = (k) => typeof a == "function" ? a({ ...k, checked: c }) : a;
63
+ return /* @__PURE__ */ L(
64
+ te,
65
65
  {
66
- className: v(
66
+ className: g(
67
67
  i["switcher-wrapper"],
68
68
  t,
69
69
  i[n]
70
70
  ),
71
71
  children: [
72
- l && e && /* @__PURE__ */ H(L, { className: v(i.label, m), htmlFor: s, children: l }),
73
- /* @__PURE__ */ N(
74
- je,
72
+ l && e && /* @__PURE__ */ N(I, { className: g(i.label, m), htmlFor: s, children: l }),
73
+ /* @__PURE__ */ L(
74
+ Ke,
75
75
  {
76
76
  ...p,
77
77
  id: s,
78
78
  ref: o,
79
- className: v(i.switcher, h, {
79
+ className: g(i.switcher, h, {
80
80
  [i["switcher-checked"]]: c
81
81
  }),
82
82
  children: [
83
- $({ checked: c }),
84
- /* @__PURE__ */ H(
83
+ v({ checked: c }),
84
+ /* @__PURE__ */ N(
85
85
  "span",
86
86
  {
87
87
  "aria-hidden": "true",
88
- className: v(
88
+ className: g(
89
89
  i["switcher-thumb"],
90
90
  d,
91
91
  {
@@ -103,5 +103,5 @@ const Ge = "_left_gu0m2_14", Ke = "_right_gu0m2_17", Re = "_label_gu0m2_21", Me
103
103
  }
104
104
  );
105
105
  export {
106
- Qe as Switcher
106
+ Ze as Switcher
107
107
  };