@tpc-mare/mare-ui-components-react 0.1.4 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/accordion/Accordion.d.ts +2 -0
  2. package/dist/accordion/Accordion.types.d.ts +20 -0
  3. package/dist/accordion/index.d.ts +2 -0
  4. package/dist/accordion/index.js +4 -0
  5. package/dist/banner/Banner.d.ts +2 -0
  6. package/dist/banner/Banner.types.d.ts +15 -0
  7. package/dist/banner/index.d.ts +2 -0
  8. package/dist/banner/index.js +4 -0
  9. package/dist/checkbox/index.js +1 -1
  10. package/dist/combobox/index.js +1 -1
  11. package/dist/date-picker/DatePicker.d.ts +3 -0
  12. package/dist/date-picker/DatePicker.types.d.ts +52 -0
  13. package/dist/date-picker/index.d.ts +2 -0
  14. package/dist/date-picker/index.js +4 -0
  15. package/dist/dialog/index.js +1 -1
  16. package/dist/drawer/index.js +1 -1
  17. package/dist/index/index.d.ts +18 -0
  18. package/dist/index/index.js +66 -46
  19. package/dist/input-otp/InputOtp.d.ts +2 -0
  20. package/dist/input-otp/InputOtp.types.d.ts +27 -0
  21. package/dist/input-otp/index.d.ts +2 -0
  22. package/dist/input-otp/index.js +4 -0
  23. package/dist/paginator/Paginator.d.ts +2 -0
  24. package/dist/paginator/Paginator.types.d.ts +21 -0
  25. package/dist/paginator/index.d.ts +2 -0
  26. package/dist/paginator/index.js +4 -0
  27. package/dist/panel-menu/PanelMenu.d.ts +2 -0
  28. package/dist/panel-menu/PanelMenu.types.d.ts +12 -0
  29. package/dist/panel-menu/index.d.ts +2 -0
  30. package/dist/panel-menu/index.js +4 -0
  31. package/dist/password/Password.d.ts +7 -0
  32. package/dist/password/Password.types.d.ts +39 -0
  33. package/dist/password/index.d.ts +2 -0
  34. package/dist/password/index.js +5 -0
  35. package/dist/search-field/index.js +1 -1
  36. package/dist/select-field/index.js +1 -1
  37. package/dist/shared/Accordion-Cbs8KQ5v.js +63 -0
  38. package/dist/shared/Banner-BWyV9K8e.js +52 -0
  39. package/dist/shared/{Checkbox-DsM70wQl.js → Checkbox-D17WWbSe.js} +1 -1
  40. package/dist/shared/{Combobox-DeUG_muZ.js → Combobox-CBa1lnAd.js} +1 -1
  41. package/dist/shared/DatePicker-BQulFC2D.js +856 -0
  42. package/dist/shared/{DialogFooter-DLWy6Mln.js → DialogFooter-0gaMdpXV.js} +1 -1
  43. package/dist/shared/{DrawerFooter-DvUgumx0.js → DrawerFooter-CpO7chLC.js} +1 -1
  44. package/dist/shared/InputOtp-CUXXVP2E.js +72 -0
  45. package/dist/shared/Paginator-Da0XKfF3.js +164 -0
  46. package/dist/shared/PanelMenu-CYbr6cvz.js +123 -0
  47. package/dist/shared/Password-vADi8ZJz.js +94 -0
  48. package/dist/shared/{SearchField-CgDz_s1O.js → SearchField-9bL2s8zj.js} +1 -1
  49. package/dist/shared/{SelectField-BSTmWjYy.js → SelectField-dNCMdSYU.js} +1 -1
  50. package/dist/shared/Snackbar-C29nLHO9.js +100 -0
  51. package/dist/shared/Stepper-DApoMP1U.js +110 -0
  52. package/dist/shared/icons-bQxPPV8R.js +55 -0
  53. package/dist/shared/icons.d.ts +8 -0
  54. package/dist/shared/useMediaQuery.d.ts +5 -0
  55. package/dist/snackbar/Snackbar.d.ts +3 -0
  56. package/dist/snackbar/Snackbar.types.d.ts +42 -0
  57. package/dist/snackbar/index.d.ts +2 -0
  58. package/dist/snackbar/index.js +5 -0
  59. package/dist/stepper/Stepper.d.ts +2 -0
  60. package/dist/stepper/Stepper.types.d.ts +18 -0
  61. package/dist/stepper/index.d.ts +2 -0
  62. package/dist/stepper/index.js +4 -0
  63. package/dist/styles.css +1 -1
  64. package/dist/theme.css +1 -0
  65. package/dist/utilities-standalone.css +1 -0
  66. package/package.json +5 -6
  67. package/dist/shared/icons-DeVfnVLm.js +0 -37
@@ -2,7 +2,7 @@ import { jsx as a, jsxs as i } from "react/jsx-runtime";
2
2
  import { Dialog as o } from "@ark-ui/react/dialog";
3
3
  import { Portal as w } from "@ark-ui/react/portal";
4
4
  import { B as n } from "./Button-AfMqNCme.js";
5
- import { c as _ } from "./icons-DeVfnVLm.js";
5
+ import { a as _ } from "./icons-bQxPPV8R.js";
6
6
  const k = (e) => `
7
7
  mare:fixed mare:inset-0 mare:z-40
8
8
  ${e ?? "mare:bg-overlay"}
@@ -2,7 +2,7 @@ import { jsx as r, jsxs as i } from "react/jsx-runtime";
2
2
  import { Dialog as t } from "@ark-ui/react/dialog";
3
3
  import { Portal as g } from "@ark-ui/react/portal";
4
4
  import { B as d } from "./Button-AfMqNCme.js";
5
- import { c as y } from "./icons-DeVfnVLm.js";
5
+ import { a as y } from "./icons-bQxPPV8R.js";
6
6
  const _ = (e) => {
7
7
  switch (e) {
8
8
  case "left":
@@ -0,0 +1,72 @@
1
+ import { jsxs as I, jsx as m } from "react/jsx-runtime";
2
+ import { PinInput as a } from "@ark-ui/react/pin-input";
3
+ const j = "mare:flex mare:items-center mare:gap-2", w = {
4
+ small: "mare:w-10 mare:h-10 mare:px-3",
5
+ medium: "mare:w-12 mare:h-12 mare:px-3.5",
6
+ large: "mare:w-14 mare:h-14 mare:px-3"
7
+ }, k = (e) => `
8
+ mare:text-center mare:tpc-typography-body-m
9
+ mare:appearance-none mare:rounded-input mare:outline-none
10
+ mare:text-default mare:placeholder:text-weak
11
+ mare:border mare:border-strong
12
+ mare:enabled:focus:border-2 mare:enabled:focus:border-accent
13
+ mare:disabled:text-disabled mare:disabled:border-disabled-default
14
+ mare:ark-invalid:border-2 mare:ark-invalid:border-danger
15
+ mare:transition-colors mare:duration-200
16
+ ${w[e]}
17
+ `, d = (e) => Array.from(e);
18
+ function V({
19
+ length: e = 4,
20
+ value: o,
21
+ defaultValue: t,
22
+ onValueChange: i,
23
+ onComplete: l,
24
+ size: s = "medium",
25
+ mask: u = !1,
26
+ integerOnly: p = !0,
27
+ placeholder: c = "",
28
+ invalid: b,
29
+ disabled: f,
30
+ readOnly: x,
31
+ required: h,
32
+ autoFocus: v,
33
+ name: y,
34
+ id: g
35
+ }) {
36
+ const C = k(s);
37
+ return /* @__PURE__ */ I(
38
+ a.Root,
39
+ {
40
+ id: g,
41
+ count: e,
42
+ value: o === void 0 ? void 0 : d(o),
43
+ defaultValue: t === void 0 ? void 0 : d(t),
44
+ otp: !0,
45
+ mask: u,
46
+ placeholder: c,
47
+ type: p ? "numeric" : "alphanumeric",
48
+ invalid: b,
49
+ disabled: f,
50
+ readOnly: x,
51
+ required: h,
52
+ autoFocus: v,
53
+ name: y,
54
+ onValueChange: (r) => i?.(r.value.join("")),
55
+ onValueComplete: (r) => l?.(r.value.join("")),
56
+ children: [
57
+ /* @__PURE__ */ m(a.Control, { className: j, children: Array.from({ length: e }, (r, n) => /* @__PURE__ */ m(
58
+ a.Input,
59
+ {
60
+ index: n,
61
+ className: C
62
+ },
63
+ n
64
+ )) }),
65
+ /* @__PURE__ */ m(a.HiddenInput, {})
66
+ ]
67
+ }
68
+ );
69
+ }
70
+ export {
71
+ V as I
72
+ };
@@ -0,0 +1,164 @@
1
+ import { jsxs as d, jsx as e } from "react/jsx-runtime";
2
+ import { useRef as P, useState as w, useEffect as R } from "react";
3
+ import { Pagination as c } from "@ark-ui/react/pagination";
4
+ import { B as h } from "./Button-AfMqNCme.js";
5
+ import { S as j } from "./SelectField-dNCMdSYU.js";
6
+ import { d as N, e as k, f as W, g as I } from "./icons-bQxPPV8R.js";
7
+ const O = (a) => `
8
+ mare:w-full mare:flex mare:flex-wrap mare:items-center mare:gap-2
9
+ ${a ? "mare:justify-between" : "mare:justify-center"}
10
+ `, T = "mare:flex mare:items-center mare:gap-2 mare:min-w-50", M = "mare:text-default mare:tpc-typography-body-s", q = "mare:max-w-20", A = "mare:flex mare:items-center mare:justify-center mare:gap-2 mare:min-w-3xs", B = "mare:flex mare:items-center mare:justify-center mare:gap-2", E = `
11
+ mare:shrink-0 mare:size-10 mare:flex mare:items-center mare:justify-center mare:truncate
12
+ mare:rounded-full mare:tpc-typography-label-s mare:text-default mare:cursor-pointer
13
+ mare:bg-transparent mare:border-none mare:hover:bg-hover
14
+ mare:ark-selected:bg-accent-weak! mare:ark-selected:text-accent! mare:ark-selected:hover:bg-accent-weak!
15
+ `, b = (a, n) => {
16
+ let i = (a + 2) * 40 + (a + 1) * 8;
17
+ return n && (i += 96), i;
18
+ }, V = ({
19
+ requestedPageLinkSize: a,
20
+ containerWidth: n,
21
+ rowsPerPageWidth: i,
22
+ showFirstLastLinks: o
23
+ }) => {
24
+ if (!n) return a;
25
+ let s = a, l = b(s, o) + i;
26
+ for (; l > n && s > 1; )
27
+ s -= 1, l = b(s, o) + i;
28
+ return s;
29
+ }, L = (a, n, i) => {
30
+ if (n <= 0) return [];
31
+ const o = Math.min(i, n), s = Math.max(1, Math.min(a - Math.floor((o - 1) / 2), n - o + 1));
32
+ return Array.from({ length: o }, (l, g) => s + g);
33
+ };
34
+ function J({
35
+ count: a,
36
+ page: n,
37
+ defaultPage: i,
38
+ onPageChange: o,
39
+ pageSize: s,
40
+ defaultPageSize: l,
41
+ onPageSizeChange: g,
42
+ pageLinkSize: u = 5,
43
+ showFirstLastLinks: m = !0,
44
+ rowsPerPageOptions: f,
45
+ rowsPerPageOptionsLabel: C = "Rows per page"
46
+ }) {
47
+ const p = !!f?.length, v = P(null), y = P(null), [S, z] = w(u);
48
+ return R(() => {
49
+ const r = v.current;
50
+ if (!r) return;
51
+ const t = () => {
52
+ z(
53
+ V({
54
+ requestedPageLinkSize: u,
55
+ containerWidth: r.clientWidth,
56
+ rowsPerPageWidth: y.current?.clientWidth ?? 0,
57
+ showFirstLastLinks: m
58
+ })
59
+ );
60
+ };
61
+ t();
62
+ const x = new ResizeObserver(t);
63
+ return x.observe(r), () => {
64
+ x.disconnect();
65
+ };
66
+ }, [u, m]), /* @__PURE__ */ d(
67
+ c.Root,
68
+ {
69
+ ref: v,
70
+ className: O(p),
71
+ count: a,
72
+ page: n,
73
+ defaultPage: i,
74
+ pageSize: s,
75
+ defaultPageSize: l,
76
+ onPageChange: (r) => o?.(r.page),
77
+ onPageSizeChange: (r) => g?.(r.pageSize),
78
+ children: [
79
+ p && /* @__PURE__ */ d(
80
+ "div",
81
+ {
82
+ ref: y,
83
+ className: T,
84
+ children: [
85
+ /* @__PURE__ */ e("span", { className: M, children: C }),
86
+ /* @__PURE__ */ e("span", { className: q, children: /* @__PURE__ */ e(c.Context, { children: (r) => /* @__PURE__ */ e(
87
+ j,
88
+ {
89
+ value: String(r.pageSize),
90
+ onValueChange: (t) => {
91
+ t && r.setPageSize(
92
+ Number(t)
93
+ );
94
+ },
95
+ options: f.map(
96
+ (t) => ({
97
+ value: String(t),
98
+ label: String(t)
99
+ })
100
+ )
101
+ }
102
+ ) }) })
103
+ ]
104
+ }
105
+ ),
106
+ /* @__PURE__ */ d("div", { className: A, children: [
107
+ m && /* @__PURE__ */ e(c.FirstTrigger, { asChild: !0, children: /* @__PURE__ */ e(
108
+ h,
109
+ {
110
+ severity: "ghost",
111
+ size: "small",
112
+ iconOnly: !0,
113
+ icon: /* @__PURE__ */ e(N, {})
114
+ }
115
+ ) }),
116
+ /* @__PURE__ */ e(c.PrevTrigger, { asChild: !0, children: /* @__PURE__ */ e(
117
+ h,
118
+ {
119
+ severity: "ghost",
120
+ size: "small",
121
+ iconOnly: !0,
122
+ icon: /* @__PURE__ */ e(k, {})
123
+ }
124
+ ) }),
125
+ /* @__PURE__ */ e("div", { className: B, children: /* @__PURE__ */ e(c.Context, { children: (r) => L(
126
+ r.page,
127
+ r.totalPages,
128
+ S
129
+ ).map((t) => /* @__PURE__ */ e(
130
+ c.Item,
131
+ {
132
+ type: "page",
133
+ value: t,
134
+ className: E,
135
+ children: t
136
+ },
137
+ t
138
+ )) }) }),
139
+ /* @__PURE__ */ e(c.NextTrigger, { asChild: !0, children: /* @__PURE__ */ e(
140
+ h,
141
+ {
142
+ severity: "ghost",
143
+ size: "small",
144
+ iconOnly: !0,
145
+ icon: /* @__PURE__ */ e(W, {})
146
+ }
147
+ ) }),
148
+ m && /* @__PURE__ */ e(c.LastTrigger, { asChild: !0, children: /* @__PURE__ */ e(
149
+ h,
150
+ {
151
+ severity: "ghost",
152
+ size: "small",
153
+ iconOnly: !0,
154
+ icon: /* @__PURE__ */ e(I, {})
155
+ }
156
+ ) })
157
+ ] })
158
+ ]
159
+ }
160
+ );
161
+ }
162
+ export {
163
+ J as P
164
+ };
@@ -0,0 +1,123 @@
1
+ import { jsx as a, jsxs as s, Fragment as u } from "react/jsx-runtime";
2
+ import { useMemo as x } from "react";
3
+ import { createTreeCollection as f, TreeView as n } from "@ark-ui/react/tree-view";
4
+ import { C as b } from "./icons-bQxPPV8R.js";
5
+ const g = "mare:flex mare:flex-col mare:gap-1", v = "mare:flex mare:flex-col mare:gap-1", k = `
6
+ mare:group mare:flex mare:items-center mare:gap-2 mare:min-h-10 mare:px-3 mare:py-2
7
+ mare:rounded-menu-item mare:cursor-pointer mare:select-none mare:outline-none
8
+ mare:tpc-typography-body-s mare:text-default
9
+ mare:hover:bg-hover mare:ark-open:bg-accent-weak mare:ark-open:text-accent
10
+ mare:ark-disabled:text-disabled mare:ark-disabled:cursor-not-allowed mare:ark-disabled:pointer-events-none
11
+ `, N = "mare:flex-1 mare:flex mare:items-center mare:gap-2", y = `
12
+ mare:flex mare:items-center mare:shrink-0 mare:text-default
13
+ mare:transition-transform mare:ark-open:rotate-180 mare:ark-open:text-accent
14
+ `, C = `
15
+ mare:flex mare:flex-col mare:gap-1 mare:ps-7 mare:overflow-hidden mare:empty:hidden
16
+ mare:ark-open:[animation:mare-panel-menu-branch-open_150ms_ease-out]
17
+ mare:ark-closed:[animation:mare-panel-menu-branch-close_150ms_ease-out]
18
+ `, _ = (e) => `
19
+ mare:flex mare:items-center mare:gap-2 mare:min-h-10 mare:px-3 mare:py-2
20
+ mare:rounded-menu-item mare:cursor-pointer mare:select-none mare:outline-none
21
+ mare:no-underline mare:text-inherit mare:tpc-typography-body-s
22
+ ${e.active ? "mare:bg-accent-weak mare:text-accent" : "mare:text-default mare:hover:bg-hover"}
23
+ mare:ark-disabled:text-disabled mare:ark-disabled:cursor-not-allowed mare:ark-disabled:pointer-events-none
24
+ `, d = "mare:flex-1 mare:flex mare:items-center mare:gap-2", w = "mare:flex mare:items-center mare:shrink-0 mare:[&>svg]:size-5";
25
+ function i(e, t) {
26
+ if (t) return t(e);
27
+ const m = e.icon;
28
+ return /* @__PURE__ */ s(u, { children: [
29
+ m ? /* @__PURE__ */ a("span", { className: w, children: m }) : null,
30
+ /* @__PURE__ */ a("span", { children: e.label })
31
+ ] });
32
+ }
33
+ function p({
34
+ node: e,
35
+ indexPath: t,
36
+ renderItem: m
37
+ }) {
38
+ if (e.items?.length)
39
+ return /* @__PURE__ */ a(
40
+ n.NodeProvider,
41
+ {
42
+ node: e,
43
+ indexPath: t,
44
+ children: /* @__PURE__ */ s(n.Branch, { className: v, children: [
45
+ /* @__PURE__ */ s(n.BranchControl, { className: k, children: [
46
+ /* @__PURE__ */ a(n.BranchText, { className: N, children: i(e, m) }),
47
+ /* @__PURE__ */ a(n.BranchIndicator, { className: y, children: /* @__PURE__ */ a(b, {}) })
48
+ ] }),
49
+ /* @__PURE__ */ a(n.BranchContent, { className: C, children: e.items.map((o, r) => /* @__PURE__ */ a(
50
+ p,
51
+ {
52
+ node: o,
53
+ indexPath: [...t, r],
54
+ renderItem: m
55
+ },
56
+ o.value
57
+ )) })
58
+ ] })
59
+ }
60
+ );
61
+ const l = e.href, c = _({ active: e.active });
62
+ return /* @__PURE__ */ a(
63
+ n.NodeProvider,
64
+ {
65
+ node: e,
66
+ indexPath: t,
67
+ children: l ? /* @__PURE__ */ a(
68
+ n.Item,
69
+ {
70
+ className: c,
71
+ asChild: !0,
72
+ children: /* @__PURE__ */ a(
73
+ "a",
74
+ {
75
+ href: l,
76
+ target: e.target,
77
+ children: /* @__PURE__ */ a("span", { className: d, children: i(e, m) })
78
+ }
79
+ )
80
+ }
81
+ ) : /* @__PURE__ */ a(n.Item, { className: c, children: /* @__PURE__ */ a("span", { className: d, children: i(e, m) }) })
82
+ }
83
+ );
84
+ }
85
+ function V({
86
+ items: e,
87
+ expandedValue: t,
88
+ defaultExpandedValue: m,
89
+ onExpandedChange: l,
90
+ renderItem: c
91
+ }) {
92
+ const o = x(
93
+ () => f({
94
+ rootNode: { value: "__root__", label: "", items: e },
95
+ nodeToValue: (r) => r.value,
96
+ nodeToString: (r) => r.label,
97
+ nodeToChildren: (r) => r.items ?? [],
98
+ isNodeDisabled: (r) => !!r.disabled
99
+ }),
100
+ [e]
101
+ );
102
+ return /* @__PURE__ */ a(
103
+ n.Root,
104
+ {
105
+ collection: o,
106
+ expandedValue: t,
107
+ defaultExpandedValue: m,
108
+ onExpandedChange: (r) => l?.(r.expandedValue),
109
+ children: /* @__PURE__ */ a(n.Tree, { className: g, children: o.rootNode.items?.map((r, h) => /* @__PURE__ */ a(
110
+ p,
111
+ {
112
+ node: r,
113
+ indexPath: [h],
114
+ renderItem: c
115
+ },
116
+ r.value
117
+ )) })
118
+ }
119
+ );
120
+ }
121
+ export {
122
+ V as P
123
+ };
@@ -0,0 +1,94 @@
1
+ import { jsxs as r, jsx as e, Fragment as k } from "react/jsx-runtime";
2
+ import { PasswordInput as l } from "@ark-ui/react/password-input";
3
+ import { useFieldContext as A } from "@ark-ui/react/field";
4
+ import { E as R, h as Z } from "./icons-bQxPPV8R.js";
5
+ import { u as $, m as j, d as D, f as O } from "./field-layout-D34MpDMB.js";
6
+ const T = "mare:relative mare:w-full mare:group", V = "mare:relative mare:w-full", W = `
7
+ mare:hidden mare:group-focus-within:flex mare:flex-col mare:gap-2
8
+ mare:absolute mare:top-full mare:left-0 mare:mt-2 mare:z-50 mare:w-full
9
+ mare:p-4 mare:rounded-input mare:border mare:border-default mare:bg-raised
10
+ mare:shadow-[0_2px_6px_0_rgba(0,0,0,0.16)]
11
+ `, q = "mare:tpc-typography-label-s mare:text-default", B = "mare:border-t mare:border-default", G = "mare:flex mare:flex-col mare:gap-2", H = "mare:h-1 mare:w-full mare:bg-neutral-weak mare:rounded-md mare:overflow-hidden", J = {
12
+ weak: "mare:w-1/3 mare:bg-danger",
13
+ medium: "mare:w-2/3 mare:bg-warning",
14
+ strong: "mare:w-full mare:bg-positive"
15
+ }, K = (a) => `mare:h-full mare:rounded-md mare:transition-[width] mare:duration-500 mare:ease-in-out ${a ? J[a] : "mare:w-0"}`, Q = "mare:tpc-typography-body-s mare:text-default", U = "mare:flex mare:flex-col mare:gap-1 mare:my-0 mare:pl-0 mare:list-none", X = "mare:tpc-typography-body-s mare:text-default", Y = "^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})", M = "^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})", ee = (a, s = Y, t = M) => a ? new RegExp(t).test(a) ? "strong" : new RegExp(s).test(a) ? "medium" : "weak" : null;
16
+ function te({
17
+ value: a = "",
18
+ onValueChange: s,
19
+ size: t = "medium",
20
+ rounded: h = !1,
21
+ invalid: g = !1,
22
+ disabled: b = !1,
23
+ toggleMask: i = !0,
24
+ showIcon: w = /* @__PURE__ */ e(R, {}),
25
+ hideIcon: v = /* @__PURE__ */ e(Z, {}),
26
+ feedback: d = !0,
27
+ header: n,
28
+ footer: c,
29
+ promptLabel: x = "Please enter a password",
30
+ weakLabel: y = "Weak",
31
+ mediumLabel: N = "Medium",
32
+ strongLabel: I = "Strong",
33
+ mediumRegex: F,
34
+ strongRegex: E,
35
+ ...u
36
+ }) {
37
+ const m = $(), f = A(), P = g || (f?.invalid ?? !1), p = b || (f?.disabled ?? !1), S = i ? j(m?.iconSide ?? null, "right") : m?.iconSide ?? null, L = D({
38
+ size: t,
39
+ rounded: h,
40
+ hasFloatLabel: m?.hasFloatLabel ?? !1,
41
+ iconSide: S
42
+ }), _ = m?.hasFloatLabel ? " " : u.placeholder, o = d ? ee(a, F, E) : null, z = o ? { weak: y, medium: N, strong: I }[o] : x;
43
+ return /* @__PURE__ */ r(
44
+ l.Root,
45
+ {
46
+ className: T,
47
+ invalid: P,
48
+ disabled: p,
49
+ visible: i ? void 0 : !1,
50
+ children: [
51
+ /* @__PURE__ */ r(l.Control, { className: V, children: [
52
+ /* @__PURE__ */ e(
53
+ l.Input,
54
+ {
55
+ ...u,
56
+ placeholder: _,
57
+ value: a,
58
+ onChange: (C) => s?.(C.target.value),
59
+ className: L
60
+ }
61
+ ),
62
+ i && /* @__PURE__ */ e(
63
+ l.VisibilityTrigger,
64
+ {
65
+ className: O("right", {
66
+ disabled: p,
67
+ interactive: !0
68
+ }),
69
+ children: /* @__PURE__ */ e(l.Indicator, { fallback: w, children: v })
70
+ }
71
+ )
72
+ ] }),
73
+ d && /* @__PURE__ */ r("div", { className: W, children: [
74
+ n && /* @__PURE__ */ e("div", { className: q, children: n }),
75
+ /* @__PURE__ */ r("div", { className: G, children: [
76
+ /* @__PURE__ */ e("div", { className: H, children: /* @__PURE__ */ e("div", { className: K(o) }) }),
77
+ /* @__PURE__ */ e("span", { className: Q, children: z })
78
+ ] }),
79
+ c && /* @__PURE__ */ r(k, { children: [
80
+ /* @__PURE__ */ e("div", { className: B }),
81
+ /* @__PURE__ */ e("ul", { className: U, children: c })
82
+ ] })
83
+ ] })
84
+ ]
85
+ }
86
+ );
87
+ }
88
+ function ie({ children: a }) {
89
+ return /* @__PURE__ */ e("li", { className: X, children: a });
90
+ }
91
+ export {
92
+ te as P,
93
+ ie as a
94
+ };
@@ -1,7 +1,7 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
2
  import { a as x, I as t } from "./IconField-Dh6j6SL1.js";
3
3
  import { P as I } from "./ProgressSpinner-B-lrS-tu.js";
4
- import { S as v, a as F } from "./icons-DeVfnVLm.js";
4
+ import { S as v, c as F } from "./icons-bQxPPV8R.js";
5
5
  const L = (o) => !!o.value && o.clearable, P = (o) => o.loading && !o.disabled;
6
6
  function B({
7
7
  value: o = "",
@@ -1,7 +1,7 @@
1
1
  import { jsxs as m, jsx as e } from "react/jsx-runtime";
2
2
  import { useMemo as w } from "react";
3
3
  import { createListCollection as S, SelectRoot as y, SelectLabel as v, SelectControl as N, SelectTrigger as C, SelectContext as I, SelectValueText as T, SelectClearTrigger as j, SelectIndicator as _, SelectPositioner as z, SelectContent as D, SelectItem as L, SelectItemText as V, SelectItemIndicator as $ } from "@ark-ui/react/select";
4
- import { a as F, b as M, C as P } from "./icons-DeVfnVLm.js";
4
+ import { c as F, C as M, b as P } from "./icons-bQxPPV8R.js";
5
5
  const R = {
6
6
  small: "mare:h-10",
7
7
  medium: "mare:h-12"
@@ -0,0 +1,100 @@
1
+ import { jsx as o, jsxs as p } from "react/jsx-runtime";
2
+ import { Portal as g } from "@ark-ui/react/portal";
3
+ import { Toaster as y, Toast as m, createToaster as u } from "@ark-ui/react/toast";
4
+ import { B as b } from "./Button-AfMqNCme.js";
5
+ const h = `
6
+ mare:group mare:w-full mare:min-w-[20rem] mare:max-w-[429px]
7
+ mare:relative mare:overflow-hidden mare:rounded-tpc-snackbar
8
+ mare:flex mare:items-center mare:gap-3 mare:p-3 mare:pr-4 mare:min-h-13
9
+ mare:shadow-[0px_10px_15px_-3px_rgba(0,0,0,0.10),0px_4px_6px_-2px_rgba(0,0,0,0.05)]
10
+ mare:outline-none
11
+ mare:[translate:var(--x)_var(--y)] mare:[scale:var(--scale)]
12
+ mare:[z-index:var(--z-index)] mare:[height:var(--height)]
13
+ mare:[opacity:var(--opacity)] mare:[will-change:translate,opacity,scale]
14
+ mare:[transition:translate_400ms,scale_400ms,opacity_400ms,height_400ms]
15
+ mare:ark-closed:[transition:translate_400ms,scale_400ms,opacity_200ms]
16
+ mare:ark-type-contrast:bg-inverse mare:ark-type-contrast:text-on-inverse
17
+ mare:ark-type-secondary:bg-raised mare:ark-type-secondary:text-default mare:ark-type-secondary:border mare:ark-type-secondary:border-default
18
+ mare:ark-type-error:bg-danger mare:ark-type-error:text-on-danger
19
+ `, k = `
20
+ mare:flex mare:max-w-13 mare:min-w-6 mare:aspect-square mare:shrink-0
21
+ mare:items-center mare:justify-center mare:rounded-tpc-container-s
22
+ `, x = (a) => `
23
+ mare:tpc-typography-body-s ${a ? "" : "mare:ps-1"}
24
+ `, f = "mare:ml-auto mare:shrink-0", _ = `
25
+ mare:absolute mare:bottom-0 mare:left-0 mare:h-1 mare:w-0
26
+ mare:[background-color:currentColor]
27
+ mare:[animation:mare-snackbar-progress_var(--mare-snackbar-life)_linear_forwards]
28
+ `, v = {
29
+ "top-left": "top-start",
30
+ "top-center": "top",
31
+ "top-right": "top-end",
32
+ "bottom-left": "bottom-start",
33
+ "bottom-center": "bottom",
34
+ "bottom-right": "bottom-end"
35
+ }, w = (a) => v[a], i = 3e3, c = (a) => Math.max(a ?? i, i), l = /* @__PURE__ */ new WeakMap(), B = {
36
+ error: [1, 2],
37
+ secondary: [3, 6],
38
+ contrast: [6, 8]
39
+ }, T = (a, t) => {
40
+ const [s, e] = B[a];
41
+ return t ? s : e;
42
+ };
43
+ function I(a = {}) {
44
+ const t = u({
45
+ placement: w(a.placement ?? "bottom-center")
46
+ }), s = {
47
+ show(e) {
48
+ const r = e.severity ?? "contrast";
49
+ return t.create({
50
+ description: e.detail,
51
+ type: r,
52
+ priority: T(r, !!e.action),
53
+ duration: c(e.life),
54
+ action: e.action,
55
+ meta: { leading: e.leading, progressBar: e.progressBar }
56
+ });
57
+ },
58
+ dismiss(e) {
59
+ t.dismiss(e);
60
+ },
61
+ update(e, r) {
62
+ const n = t.getVisibleToasts().find((d) => d.id === e);
63
+ t.update(e, {
64
+ description: r.detail ?? n?.description,
65
+ type: r.severity ?? n?.type,
66
+ duration: r.life != null ? c(r.life) : n?.duration,
67
+ action: r.action ?? n?.action,
68
+ meta: {
69
+ leading: r.leading ?? n?.meta?.leading,
70
+ progressBar: r.progressBar ?? n?.meta?.progressBar
71
+ }
72
+ });
73
+ }
74
+ };
75
+ return l.set(s, t), s;
76
+ }
77
+ function j({ controller: a, portalContainer: t }) {
78
+ const s = l.get(a);
79
+ if (!s)
80
+ throw new Error("Snackbar: controller was not created by createSnackbar().");
81
+ return /* @__PURE__ */ o(g, { container: t, children: /* @__PURE__ */ o(y, { toaster: s, children: (e) => {
82
+ const r = e.meta?.leading, n = !!e.meta?.progressBar;
83
+ return /* @__PURE__ */ p(m.Root, { className: h, children: [
84
+ r ? /* @__PURE__ */ o("div", { className: k, children: r }) : null,
85
+ /* @__PURE__ */ o(m.Description, { className: x(!!r), children: e.description }),
86
+ e.action ? /* @__PURE__ */ o("div", { className: f, children: /* @__PURE__ */ o(m.ActionTrigger, { asChild: !0, children: /* @__PURE__ */ o(b, { severity: "ghost", link: !0, size: "xsmall", children: e.action.label }) }) }) : null,
87
+ n ? /* @__PURE__ */ o(
88
+ "div",
89
+ {
90
+ className: _,
91
+ style: { "--mare-snackbar-life": `${e.duration}ms` }
92
+ }
93
+ ) : null
94
+ ] }, e.id);
95
+ } }) });
96
+ }
97
+ export {
98
+ j as S,
99
+ I as c
100
+ };