@tpc-mare/mare-ui-components-react 0.1.11 → 0.1.13
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.
- package/dist/accordion/index.js +1 -1
- package/dist/banner/index.js +1 -1
- package/dist/breadcrumbs/Breadcrumbs.d.ts +2 -0
- package/dist/breadcrumbs/Breadcrumbs.types.d.ts +11 -0
- package/dist/breadcrumbs/index.d.ts +2 -0
- package/dist/breadcrumbs/index.js +4 -0
- package/dist/checkbox/index.js +1 -1
- package/dist/combobox/index.js +1 -1
- package/dist/counter/Counter.d.ts +2 -0
- package/dist/counter/Counter.types.d.ts +23 -0
- package/dist/counter/index.d.ts +2 -0
- package/dist/counter/index.js +4 -0
- package/dist/date-picker/index.js +1 -1
- package/dist/dialog/index.js +1 -1
- package/dist/drawer/index.js +1 -1
- package/dist/image-slider/index.js +1 -1
- package/dist/index/index.d.ts +4 -0
- package/dist/index/index.js +67 -63
- package/dist/paginator/index.js +1 -1
- package/dist/panel-menu/index.js +1 -1
- package/dist/password/index.js +1 -1
- package/dist/search-field/index.js +1 -1
- package/dist/select-field/index.js +1 -1
- package/dist/shared/{Accordion-Dhs7EeM6.js → Accordion-BLQ1mWZZ.js} +1 -1
- package/dist/shared/{Banner-B41NQS5P.js → Banner-DXftmx9P.js} +1 -1
- package/dist/shared/Breadcrumbs-Cqr3Jitd.js +77 -0
- package/dist/shared/{Checkbox-B7vM1mxP.js → Checkbox-BXnSN2vK.js} +10 -9
- package/dist/shared/{Combobox-oSS0Rlbv.js → Combobox-SkrEe5He.js} +44 -41
- package/dist/shared/Counter-D4Al7Yme.js +94 -0
- package/dist/shared/{DatePicker-GYH3uorm.js → DatePicker-CwAISvNc.js} +140 -137
- package/dist/shared/{DialogHeader-CZ5OrC8_.js → DialogHeader-RzfQm-pi.js} +14 -14
- package/dist/shared/{DrawerFooter-OFrTFvy2.js → DrawerFooter-BxOEFQ-W.js} +3 -3
- package/dist/shared/IconCheck-DzZA6b2U.js +5 -0
- package/dist/shared/IconChevronDown-ev2ML7Ex.js +5 -0
- package/dist/shared/IconChevronRight-DEIDRsvg.js +7 -0
- package/dist/shared/IconMinus-fS_GL0Et.js +5 -0
- package/dist/shared/IconSearch-CgM6jEUh.js +5 -0
- package/dist/shared/IconX-CpPADKjZ.js +5 -0
- package/dist/shared/{ImageSlider-CdBVmAYC.js → ImageSlider-Bgb1kNQ4.js} +1 -1
- package/dist/shared/{Paginator-BndcA6Ax.js → Paginator-Bp2nghqW.js} +48 -46
- package/dist/shared/{PanelMenu-Bz-fg6px.js → PanelMenu-BpjNM7O_.js} +2 -2
- package/dist/shared/Password-BMKy8dAy.js +95 -0
- package/dist/shared/SearchField-DjJHDaR4.js +64 -0
- package/dist/shared/{SelectField-CGbdf8C2.js → SelectField-CvKaukCG.js} +27 -25
- package/dist/shared/{Stepper-BpKdB3ip.js → Stepper-By8M5bs0.js} +13 -12
- package/dist/shared/{TagChip-BNszVayi.js → TagChip-Bs7srjIL.js} +1 -1
- package/dist/shared/createReactComponent-Cb6Pzf10.js +48 -0
- package/dist/stepper/index.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/tag-chip/index.js +1 -1
- package/package.json +2 -1
- package/dist/shared/Password-cqTK9OlT.js +0 -94
- package/dist/shared/SearchField-CgZV2Am-.js +0 -63
- package/dist/shared/icons-BFOFrum4.js +0 -55
- package/dist/shared/icons.d.ts +0 -15
|
@@ -1,31 +1,34 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as m, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { useState as T, useMemo as b } from "react";
|
|
3
|
-
import { createListCollection as V, ComboboxRoot as _, ComboboxLabel as j, ComboboxControl as
|
|
4
|
-
import {
|
|
5
|
-
|
|
3
|
+
import { createListCollection as V, ComboboxRoot as _, ComboboxLabel as j, ComboboxControl as z, ComboboxTrigger as $, ComboboxClearTrigger as q, ComboboxPositioner as D, ComboboxContent as E, ComboboxInput as M, ComboboxEmpty as O, ComboboxItem as P, ComboboxItemText as Q, ComboboxItemIndicator as R } from "@ark-ui/react/combobox";
|
|
4
|
+
import { I as X } from "./IconX-CpPADKjZ.js";
|
|
5
|
+
import { I as A } from "./IconChevronDown-ev2ML7Ex.js";
|
|
6
|
+
import { I as B } from "./IconSearch-CgM6jEUh.js";
|
|
7
|
+
import { I as F } from "./IconCheck-DzZA6b2U.js";
|
|
8
|
+
const G = {
|
|
6
9
|
small: "mare:h-10",
|
|
7
10
|
medium: "mare:h-12"
|
|
8
11
|
}, f = {
|
|
9
12
|
small: "mare:tpc-typography-body-s",
|
|
10
13
|
medium: "mare:tpc-typography-body-m"
|
|
11
|
-
},
|
|
14
|
+
}, H = (r) => `
|
|
12
15
|
mare:relative mare:flex mare:items-center mare:gap-2
|
|
13
|
-
${
|
|
16
|
+
${G[r]}
|
|
14
17
|
mare:px-3 mare:rounded-input mare:border mare:border-strong mare:bg-default
|
|
15
18
|
mare:focus-within:outline-solid mare:focus-within:outline-2 mare:focus-within:outline-accent mare:focus-within:-outline-offset-2
|
|
16
19
|
mare:ark-disabled:text-disabled mare:ark-disabled:border-disabled-default mare:ark-disabled:cursor-not-allowed
|
|
17
20
|
mare:data-[invalid]:outline-solid mare:data-[invalid]:outline-2 mare:data-[invalid]:outline-danger mare:data-[invalid]:-outline-offset-2
|
|
18
|
-
`, p = "mare:flex mare:items-center mare:shrink-0 mare:text-weak mare:[&>svg]:size-5",
|
|
21
|
+
`, p = "mare:flex mare:items-center mare:shrink-0 mare:text-weak mare:[&>svg]:size-5", J = (r) => `
|
|
19
22
|
mare:flex-auto mare:flex mare:items-center mare:cursor-pointer
|
|
20
23
|
mare:bg-transparent mare:text-left mare:truncate mare:text-default ${f[r]}
|
|
21
|
-
`,
|
|
24
|
+
`, K = `
|
|
22
25
|
mare:flex mare:items-center mare:gap-2 mare:mb-1 mare:px-3 mare:h-10
|
|
23
26
|
mare:rounded-input mare:border mare:border-strong mare:bg-default
|
|
24
27
|
mare:focus-within:outline-solid mare:focus-within:outline-2 mare:focus-within:outline-accent mare:focus-within:-outline-offset-2
|
|
25
|
-
`,
|
|
28
|
+
`, U = (r) => `
|
|
26
29
|
mare:flex-auto mare:bg-transparent mare:outline-none mare:text-default
|
|
27
30
|
mare:placeholder:text-weak ${f[r]}
|
|
28
|
-
`,
|
|
31
|
+
`, W = "mare:flex mare:items-center mare:shrink-0 mare:text-base mare:cursor-pointer mare:text-default mare:hover:text-weak", Y = "mare:flex mare:items-center mare:shrink-0 mare:text-lg mare:transition-transform mare:ark-open:rotate-180 mare:text-default", Z = `
|
|
29
32
|
mare:flex mare:flex-col mare:gap-0.5 mare:p-1
|
|
30
33
|
mare:rounded-input mare:border mare:border-default mare:bg-raised
|
|
31
34
|
mare:shadow-[0_2px_6px_0_rgba(0,0,0,0.16)]
|
|
@@ -39,29 +42,29 @@ const H = {
|
|
|
39
42
|
mare:ark-highlighted:bg-hover
|
|
40
43
|
mare:ark-selected:bg-accent-weak mare:ark-selected:text-accent
|
|
41
44
|
mare:ark-disabled:text-disabled mare:ark-disabled:cursor-not-allowed
|
|
42
|
-
`, ae = "mare:flex mare:items-center mare:text-accent", re = "mare:py-2 mare:px-3 mare:tpc-typography-body-s mare:text-weak",
|
|
43
|
-
function
|
|
45
|
+
`, ae = "mare:flex mare:items-center mare:text-accent", re = "mare:py-2 mare:px-3 mare:tpc-typography-body-s mare:text-weak", me = "mare:tpc-typography-label-s mare:text-weak mare:mb-1.5 mare:block";
|
|
46
|
+
function de({
|
|
44
47
|
value: r = null,
|
|
45
48
|
onValueChange: h,
|
|
46
|
-
options:
|
|
49
|
+
options: t,
|
|
47
50
|
placeholder: x = "Select…",
|
|
48
51
|
searchPlaceholder: g = "",
|
|
49
52
|
size: o = "small",
|
|
50
|
-
disabled:
|
|
51
|
-
invalid:
|
|
53
|
+
disabled: w = !1,
|
|
54
|
+
invalid: C = !1,
|
|
52
55
|
clearable: k = !1,
|
|
53
56
|
emptyText: y = "Sin resultados",
|
|
54
57
|
label: i,
|
|
55
58
|
leadingIcon: s,
|
|
56
59
|
triggerIcon: v,
|
|
57
|
-
checkIcon:
|
|
58
|
-
clearIcon:
|
|
60
|
+
checkIcon: I,
|
|
61
|
+
clearIcon: N,
|
|
59
62
|
renderOption: c
|
|
60
63
|
}) {
|
|
61
64
|
const [l, d] = T(""), n = b(() => {
|
|
62
65
|
const e = l.trim().toLowerCase();
|
|
63
|
-
return e ?
|
|
64
|
-
}, [l,
|
|
66
|
+
return e ? t.filter((S) => S.label.toLowerCase().includes(e)) : t;
|
|
67
|
+
}, [l, t]), L = b(
|
|
65
68
|
() => V({
|
|
66
69
|
items: n,
|
|
67
70
|
itemToValue: (e) => e.value,
|
|
@@ -69,14 +72,14 @@ function ie({
|
|
|
69
72
|
isItemDisabled: (e) => !!e.disabled
|
|
70
73
|
}),
|
|
71
74
|
[n]
|
|
72
|
-
), u =
|
|
73
|
-
return /* @__PURE__ */
|
|
75
|
+
), u = t.find((e) => e.value === r)?.label ?? null;
|
|
76
|
+
return /* @__PURE__ */ m(
|
|
74
77
|
_,
|
|
75
78
|
{
|
|
76
|
-
collection:
|
|
79
|
+
collection: L,
|
|
77
80
|
value: r == null ? [] : [r],
|
|
78
|
-
disabled:
|
|
79
|
-
invalid:
|
|
81
|
+
disabled: w,
|
|
82
|
+
invalid: C,
|
|
80
83
|
openOnClick: !0,
|
|
81
84
|
inputValue: l,
|
|
82
85
|
onValueChange: (e) => h?.(e.value[0] ?? null),
|
|
@@ -87,37 +90,37 @@ function ie({
|
|
|
87
90
|
e.open || d("");
|
|
88
91
|
},
|
|
89
92
|
children: [
|
|
90
|
-
i && /* @__PURE__ */ a(j, { className:
|
|
91
|
-
/* @__PURE__ */
|
|
93
|
+
i && /* @__PURE__ */ a(j, { className: me, children: i }),
|
|
94
|
+
/* @__PURE__ */ m(z, { className: H(o), children: [
|
|
92
95
|
s && /* @__PURE__ */ a("span", { className: p, children: s }),
|
|
93
|
-
/* @__PURE__ */ a(
|
|
94
|
-
k && /* @__PURE__ */ a(
|
|
95
|
-
/* @__PURE__ */ a("span", { className: Y, children: v ?? /* @__PURE__ */ a(
|
|
96
|
+
/* @__PURE__ */ a($, { className: J(o), children: u ? /* @__PURE__ */ a("span", { children: u }) : /* @__PURE__ */ a("span", { className: "mare:text-weak", children: x }) }),
|
|
97
|
+
k && /* @__PURE__ */ a(q, { className: W, children: N ?? /* @__PURE__ */ a(X, { size: "1em" }) }),
|
|
98
|
+
/* @__PURE__ */ a("span", { className: Y, children: v ?? /* @__PURE__ */ a(A, { size: "1em" }) })
|
|
96
99
|
] }),
|
|
97
|
-
/* @__PURE__ */ a(
|
|
98
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ a(D, { children: /* @__PURE__ */ m(E, { className: Z, children: [
|
|
101
|
+
/* @__PURE__ */ m("div", { className: K, children: [
|
|
99
102
|
/* @__PURE__ */ a(
|
|
100
|
-
|
|
103
|
+
M,
|
|
101
104
|
{
|
|
102
105
|
placeholder: g,
|
|
103
|
-
className:
|
|
106
|
+
className: U(o)
|
|
104
107
|
}
|
|
105
108
|
),
|
|
106
|
-
/* @__PURE__ */ a("span", { className: p, children: /* @__PURE__ */ a(
|
|
109
|
+
/* @__PURE__ */ a("span", { className: p, children: /* @__PURE__ */ a(B, {}) })
|
|
107
110
|
] }),
|
|
108
|
-
/* @__PURE__ */ a(
|
|
109
|
-
n.map((e) => /* @__PURE__ */
|
|
110
|
-
|
|
111
|
+
/* @__PURE__ */ a(O, { className: re, children: y }),
|
|
112
|
+
n.map((e) => /* @__PURE__ */ m(
|
|
113
|
+
P,
|
|
111
114
|
{
|
|
112
115
|
item: e,
|
|
113
116
|
className: ee,
|
|
114
117
|
children: [
|
|
115
|
-
/* @__PURE__ */ a(
|
|
118
|
+
/* @__PURE__ */ a(Q, { children: c ? c(e) : e.label }),
|
|
116
119
|
/* @__PURE__ */ a(
|
|
117
|
-
|
|
120
|
+
R,
|
|
118
121
|
{
|
|
119
122
|
className: ae,
|
|
120
|
-
children:
|
|
123
|
+
children: I ?? /* @__PURE__ */ a(F, { size: "1em" })
|
|
121
124
|
}
|
|
122
125
|
)
|
|
123
126
|
]
|
|
@@ -130,5 +133,5 @@ function ie({
|
|
|
130
133
|
);
|
|
131
134
|
}
|
|
132
135
|
export {
|
|
133
|
-
|
|
136
|
+
de as C
|
|
134
137
|
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { jsxs as h, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { NumberInput as t } from "@ark-ui/react/number-input";
|
|
3
|
+
import { B as i } from "./Button-AfMqNCme.js";
|
|
4
|
+
import { I as x } from "./IconMinus-fS_GL0Et.js";
|
|
5
|
+
import { c as I } from "./createReactComponent-Cb6Pzf10.js";
|
|
6
|
+
const v = [["path", { d: "M12 5l0 14", key: "svg-0" }], ["path", { d: "M5 12l14 0", key: "svg-1" }]], C = I("outline", "plus", "Plus", v), N = {
|
|
7
|
+
small: "mare:w-28",
|
|
8
|
+
medium: "mare:w-32",
|
|
9
|
+
large: "mare:w-43"
|
|
10
|
+
}, k = (e, a) => `
|
|
11
|
+
mare:inline-flex mare:items-center
|
|
12
|
+
${N[e]}
|
|
13
|
+
${a === "expandable" ? "mare:h-12 mare:rounded-full mare:border mare:border-default" : ""}
|
|
14
|
+
`, w = {
|
|
15
|
+
small: "mare:tpc-typography-body-m",
|
|
16
|
+
medium: "mare:tpc-typography-body-m",
|
|
17
|
+
large: "mare:tpc-typography-body-l"
|
|
18
|
+
}, M = (e) => `
|
|
19
|
+
mare:w-full mare:text-center
|
|
20
|
+
mare:text-default mare:disabled:text-disabled
|
|
21
|
+
mare:outline-none mare:caret-transparent
|
|
22
|
+
${w[e]}
|
|
23
|
+
`, O = (e) => e === "default" ? "secondary" : "ghost", S = {
|
|
24
|
+
small: "xsmall",
|
|
25
|
+
medium: "small",
|
|
26
|
+
large: "medium"
|
|
27
|
+
}, $ = (e) => S[e];
|
|
28
|
+
function T({
|
|
29
|
+
value: e = null,
|
|
30
|
+
onValueChange: a,
|
|
31
|
+
size: l = "small",
|
|
32
|
+
variant: m = "default",
|
|
33
|
+
disabled: n = !1,
|
|
34
|
+
disabledIncrement: c = !1,
|
|
35
|
+
disabledDecrement: d = !1,
|
|
36
|
+
step: p = 1,
|
|
37
|
+
id: y,
|
|
38
|
+
name: f,
|
|
39
|
+
min: g,
|
|
40
|
+
max: b
|
|
41
|
+
}) {
|
|
42
|
+
const o = O(m), s = $(l);
|
|
43
|
+
return /* @__PURE__ */ h(
|
|
44
|
+
t.Root,
|
|
45
|
+
{
|
|
46
|
+
value: e == null ? "" : String(e),
|
|
47
|
+
min: g,
|
|
48
|
+
max: b,
|
|
49
|
+
step: p,
|
|
50
|
+
disabled: n,
|
|
51
|
+
name: f,
|
|
52
|
+
className: k(l, m),
|
|
53
|
+
onValueChange: (u) => a?.(
|
|
54
|
+
u.value === "" ? null : u.valueAsNumber
|
|
55
|
+
),
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ r(t.DecrementTrigger, { asChild: !0, children: /* @__PURE__ */ r(
|
|
58
|
+
i,
|
|
59
|
+
{
|
|
60
|
+
severity: o,
|
|
61
|
+
size: s,
|
|
62
|
+
iconOnly: !0,
|
|
63
|
+
icon: /* @__PURE__ */ r(x, { stroke: 1.5 }),
|
|
64
|
+
disabled: n || d,
|
|
65
|
+
"aria-label": "Decrement"
|
|
66
|
+
}
|
|
67
|
+
) }),
|
|
68
|
+
/* @__PURE__ */ r(
|
|
69
|
+
t.Input,
|
|
70
|
+
{
|
|
71
|
+
id: y,
|
|
72
|
+
className: M(l),
|
|
73
|
+
readOnly: !0,
|
|
74
|
+
inputMode: "none"
|
|
75
|
+
}
|
|
76
|
+
),
|
|
77
|
+
/* @__PURE__ */ r(t.IncrementTrigger, { asChild: !0, children: /* @__PURE__ */ r(
|
|
78
|
+
i,
|
|
79
|
+
{
|
|
80
|
+
severity: o,
|
|
81
|
+
size: s,
|
|
82
|
+
iconOnly: !0,
|
|
83
|
+
icon: /* @__PURE__ */ r(C, { stroke: 1.5 }),
|
|
84
|
+
disabled: n || c,
|
|
85
|
+
"aria-label": "Increment"
|
|
86
|
+
}
|
|
87
|
+
) })
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
export {
|
|
93
|
+
T as C
|
|
94
|
+
};
|