@tpc-mare/mare-ui-components-react 0.1.0
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/.storybook/main.d.ts +3 -0
- package/dist/.storybook/manager.d.ts +1 -0
- package/dist/.storybook/preview.d.ts +3 -0
- package/dist/button/Button.d.ts +2 -0
- package/dist/button/Button.types.d.ts +18 -0
- package/dist/button/index.d.ts +2 -0
- package/dist/button/index.js +4 -0
- package/dist/checkbox/Checkbox.d.ts +2 -0
- package/dist/checkbox/Checkbox.types.d.ts +69 -0
- package/dist/checkbox/index.d.ts +2 -0
- package/dist/checkbox/index.js +4 -0
- package/dist/combobox/Combobox.d.ts +13 -0
- package/dist/combobox/Combobox.types.d.ts +16 -0
- package/dist/combobox/index.d.ts +2 -0
- package/dist/combobox/index.js +4 -0
- package/dist/dialog/Dialog.d.ts +2 -0
- package/dist/dialog/Dialog.types.d.ts +55 -0
- package/dist/dialog/DialogFooter.d.ts +2 -0
- package/dist/dialog/DialogHeader.d.ts +2 -0
- package/dist/dialog/index.d.ts +4 -0
- package/dist/dialog/index.js +6 -0
- package/dist/index/index.d.ts +24 -0
- package/dist/index/index.js +33 -0
- package/dist/input-number/InputNumber.d.ts +2 -0
- package/dist/input-number/InputNumber.types.d.ts +30 -0
- package/dist/input-number/index.d.ts +2 -0
- package/dist/input-number/index.js +4 -0
- package/dist/input-text/CharacterCount.d.ts +5 -0
- package/dist/input-text/FloatLabel.d.ts +6 -0
- package/dist/input-text/FormField.d.ts +8 -0
- package/dist/input-text/HelperText.d.ts +4 -0
- package/dist/input-text/IconField.d.ts +7 -0
- package/dist/input-text/InputText.d.ts +2 -0
- package/dist/input-text/InputText.types.d.ts +14 -0
- package/dist/input-text/field-layout.d.ts +6 -0
- package/dist/input-text/index.d.ts +11 -0
- package/dist/input-text/index.js +9 -0
- package/dist/progress-spinner/ProgressSpinner.d.ts +10 -0
- package/dist/progress-spinner/index.d.ts +2 -0
- package/dist/progress-spinner/index.js +4 -0
- package/dist/radio-group/RadioGroup.d.ts +2 -0
- package/dist/radio-group/RadioGroup.types.d.ts +62 -0
- package/dist/radio-group/index.d.ts +2 -0
- package/dist/radio-group/index.js +4 -0
- package/dist/select-field/SelectField.d.ts +14 -0
- package/dist/select-field/SelectField.types.d.ts +11 -0
- package/dist/select-field/index.d.ts +2 -0
- package/dist/select-field/index.js +4 -0
- package/dist/shared/Button-AfMqNCme.js +177 -0
- package/dist/shared/Checkbox-DsM70wQl.js +134 -0
- package/dist/shared/Combobox-DeUG_muZ.js +134 -0
- package/dist/shared/DialogFooter-DLWy6Mln.js +154 -0
- package/dist/shared/HelperText-D656H0Lf.js +103 -0
- package/dist/shared/InputNumber-D1KL6s55.js +62 -0
- package/dist/shared/ProgressSpinner-B-lrS-tu.js +35 -0
- package/dist/shared/RadioGroup-lw27DCoV.js +133 -0
- package/dist/shared/SelectField-BSTmWjYy.js +118 -0
- package/dist/shared/Switch-D6E2OmgE.js +104 -0
- package/dist/shared/Tabs-BqIorZYD.js +66 -0
- package/dist/shared/Textarea-0XAczkH1.js +40 -0
- package/dist/shared/field-layout-BXKpp5E_.js +49 -0
- package/dist/shared/icons-DeVfnVLm.js +37 -0
- package/dist/shared/icons.d.ts +7 -0
- package/dist/switch/Switch.d.ts +2 -0
- package/dist/switch/Switch.types.d.ts +59 -0
- package/dist/switch/index.d.ts +2 -0
- package/dist/switch/index.js +4 -0
- package/dist/tabs/Tabs.d.ts +10 -0
- package/dist/tabs/Tabs.types.d.ts +7 -0
- package/dist/tabs/index.d.ts +2 -0
- package/dist/tabs/index.js +4 -0
- package/dist/textarea/Textarea.d.ts +2 -0
- package/dist/textarea/Textarea.types.d.ts +15 -0
- package/dist/textarea/index.d.ts +2 -0
- package/dist/textarea/index.js +4 -0
- package/dist/themes/baglioni-resorts.css +1 -0
- package/dist/themes/baglioni.css +1 -0
- package/dist/themes/le-blanc.css +1 -0
- package/dist/themes/palace.css +1 -0
- package/dist/themes/the-palace-company.css +1 -0
- package/dist/vite.config.d.ts +2 -0
- package/package.json +73 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { jsx as r, jsxs as c, Fragment as v } from "react/jsx-runtime";
|
|
2
|
+
import { useFieldContext as s, FieldInput as L, FieldRoot as u, FieldLabel as N, FieldErrorText as w, FieldHelperText as C } from "@ark-ui/react/field";
|
|
3
|
+
import { u as h, d as S, x as I, g as T, F as f, p, f as H, h as P } from "./field-layout-BXKpp5E_.js";
|
|
4
|
+
function $({
|
|
5
|
+
value: e = "",
|
|
6
|
+
onValueChange: a,
|
|
7
|
+
size: t = "medium",
|
|
8
|
+
rounded: l = !1,
|
|
9
|
+
invalid: n = !1,
|
|
10
|
+
disabled: d = !1,
|
|
11
|
+
placeholder: o,
|
|
12
|
+
...g
|
|
13
|
+
}) {
|
|
14
|
+
const i = h(), F = !s(), y = S({
|
|
15
|
+
size: t,
|
|
16
|
+
rounded: l,
|
|
17
|
+
hasFloatLabel: i?.hasFloatLabel ?? !1,
|
|
18
|
+
iconSide: i?.iconSide ?? null
|
|
19
|
+
}), x = i?.hasFloatLabel ? " " : o, m = /* @__PURE__ */ r(
|
|
20
|
+
L,
|
|
21
|
+
{
|
|
22
|
+
...g,
|
|
23
|
+
className: y,
|
|
24
|
+
placeholder: x,
|
|
25
|
+
value: e,
|
|
26
|
+
onChange: (b) => a?.(b.target.value)
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
return F ? /* @__PURE__ */ r(
|
|
30
|
+
u,
|
|
31
|
+
{
|
|
32
|
+
invalid: n,
|
|
33
|
+
disabled: d,
|
|
34
|
+
className: "mare:w-full",
|
|
35
|
+
children: m
|
|
36
|
+
}
|
|
37
|
+
) : m;
|
|
38
|
+
}
|
|
39
|
+
function k({ value: e, max: a }) {
|
|
40
|
+
const l = s()?.disabled ?? !1;
|
|
41
|
+
return /* @__PURE__ */ c("span", { className: I(l), children: [
|
|
42
|
+
e.length,
|
|
43
|
+
"/",
|
|
44
|
+
a
|
|
45
|
+
] });
|
|
46
|
+
}
|
|
47
|
+
function B({
|
|
48
|
+
invalid: e = !1,
|
|
49
|
+
disabled: a = !1,
|
|
50
|
+
required: t = !1,
|
|
51
|
+
children: l
|
|
52
|
+
}) {
|
|
53
|
+
return /* @__PURE__ */ r(
|
|
54
|
+
u,
|
|
55
|
+
{
|
|
56
|
+
invalid: e,
|
|
57
|
+
disabled: a,
|
|
58
|
+
required: t,
|
|
59
|
+
className: T,
|
|
60
|
+
children: l
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
const j = "mare:pointer-events-none mare:absolute mare:left-3 mare:origin-[0] mare:transition-all mare:duration-150 mare:tpc-typography-body-m mare:text-weak mare:top-1/2 mare:-translate-y-1/2 mare:group-focus-within:top-2 mare:group-focus-within:translate-y-0 mare:group-focus-within:tpc-typography-body-xs mare:group-has-[:is(input,textarea):not(:placeholder-shown)]:top-2 mare:group-has-[:is(input,textarea):not(:placeholder-shown)]:translate-y-0 mare:group-has-[:is(input,textarea):not(:placeholder-shown)]:tpc-typography-body-xs";
|
|
65
|
+
function R({ label: e, children: a }) {
|
|
66
|
+
const t = { hasFloatLabel: !0, iconSide: null }, l = `${j} mare:group-has-[.mare-icon-left_svg]:left-10 mare:group-has-[textarea]:top-2 mare:group-has-[textarea]:translate-y-0`, n = /* @__PURE__ */ c(v, { children: [
|
|
67
|
+
a,
|
|
68
|
+
/* @__PURE__ */ r(N, { className: l, children: e })
|
|
69
|
+
] }), o = !s() ? /* @__PURE__ */ r(u, { className: p, children: n }) : /* @__PURE__ */ r("div", { className: p, children: n });
|
|
70
|
+
return /* @__PURE__ */ r(f.Provider, { value: t, children: o });
|
|
71
|
+
}
|
|
72
|
+
function q({
|
|
73
|
+
icon: e,
|
|
74
|
+
position: a = "left",
|
|
75
|
+
children: t
|
|
76
|
+
}) {
|
|
77
|
+
const n = {
|
|
78
|
+
hasFloatLabel: h()?.hasFloatLabel ?? !1,
|
|
79
|
+
iconSide: a
|
|
80
|
+
};
|
|
81
|
+
return /* @__PURE__ */ r(f.Provider, { value: n, children: /* @__PURE__ */ c(
|
|
82
|
+
"div",
|
|
83
|
+
{
|
|
84
|
+
className: `mare:relative mare:w-full mare:group ${a === "left" ? "mare-icon-left" : "mare-icon-right"}`,
|
|
85
|
+
children: [
|
|
86
|
+
t,
|
|
87
|
+
/* @__PURE__ */ r("span", { className: H(a), children: e })
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
) });
|
|
91
|
+
}
|
|
92
|
+
function z({ children: e }) {
|
|
93
|
+
const t = s()?.invalid ?? !1, l = P(t);
|
|
94
|
+
return t ? /* @__PURE__ */ r(w, { className: l, children: e }) : /* @__PURE__ */ r(C, { className: l, children: e });
|
|
95
|
+
}
|
|
96
|
+
export {
|
|
97
|
+
k as C,
|
|
98
|
+
R as F,
|
|
99
|
+
z as H,
|
|
100
|
+
q as I,
|
|
101
|
+
B as a,
|
|
102
|
+
$ as b
|
|
103
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { NumberInput as t } from "@ark-ui/react/number-input";
|
|
3
|
+
import { useFieldContext as C } from "@ark-ui/react/field";
|
|
4
|
+
import { u as g, d as y } from "./field-layout-BXKpp5E_.js";
|
|
5
|
+
function R({
|
|
6
|
+
value: l = null,
|
|
7
|
+
onValueChange: n,
|
|
8
|
+
size: u = "medium",
|
|
9
|
+
rounded: s = !1,
|
|
10
|
+
invalid: r,
|
|
11
|
+
disabled: i,
|
|
12
|
+
readOnly: m,
|
|
13
|
+
step: c = 1,
|
|
14
|
+
clampValueOnBlur: d = !0,
|
|
15
|
+
placeholder: f,
|
|
16
|
+
id: p,
|
|
17
|
+
name: h,
|
|
18
|
+
min: b,
|
|
19
|
+
max: v,
|
|
20
|
+
formatOptions: F,
|
|
21
|
+
locale: N,
|
|
22
|
+
allowMouseWheel: I
|
|
23
|
+
}) {
|
|
24
|
+
const e = g(), L = !C(), S = y({
|
|
25
|
+
size: u,
|
|
26
|
+
rounded: s,
|
|
27
|
+
hasFloatLabel: e?.hasFloatLabel ?? !1,
|
|
28
|
+
iconSide: e?.iconSide ?? null
|
|
29
|
+
}), x = e?.hasFloatLabel ? " " : f;
|
|
30
|
+
return /* @__PURE__ */ o(
|
|
31
|
+
t.Root,
|
|
32
|
+
{
|
|
33
|
+
value: l == null ? "" : String(l),
|
|
34
|
+
min: b,
|
|
35
|
+
max: v,
|
|
36
|
+
step: c,
|
|
37
|
+
formatOptions: F,
|
|
38
|
+
locale: N,
|
|
39
|
+
allowMouseWheel: I,
|
|
40
|
+
clampValueOnBlur: d,
|
|
41
|
+
disabled: i,
|
|
42
|
+
readOnly: m,
|
|
43
|
+
name: h,
|
|
44
|
+
invalid: L ? r : void 0,
|
|
45
|
+
className: "mare:w-full",
|
|
46
|
+
onValueChange: (a) => n?.(
|
|
47
|
+
a.value === "" ? null : a.valueAsNumber
|
|
48
|
+
),
|
|
49
|
+
children: /* @__PURE__ */ o(
|
|
50
|
+
t.Input,
|
|
51
|
+
{
|
|
52
|
+
id: p,
|
|
53
|
+
className: S,
|
|
54
|
+
placeholder: x
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
export {
|
|
61
|
+
R as I
|
|
62
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
function n({
|
|
3
|
+
circleClass: r,
|
|
4
|
+
className: i
|
|
5
|
+
}) {
|
|
6
|
+
return /* @__PURE__ */ e(
|
|
7
|
+
"span",
|
|
8
|
+
{
|
|
9
|
+
className: `mare:inline-block mare:[animation:spin_2s_linear_infinite] ${i ?? ""}`,
|
|
10
|
+
"aria-hidden": "true",
|
|
11
|
+
children: /* @__PURE__ */ e(
|
|
12
|
+
"svg",
|
|
13
|
+
{
|
|
14
|
+
className: "mare:size-full",
|
|
15
|
+
viewBox: "0 0 50 50",
|
|
16
|
+
children: /* @__PURE__ */ e(
|
|
17
|
+
"circle",
|
|
18
|
+
{
|
|
19
|
+
className: `mare:fill-none mare:[stroke-dashoffset:0] mare:[animation:mare-spinner-dash_1.5s_ease-in-out_infinite] ${r ?? ""}`,
|
|
20
|
+
stroke: "var(--color-fg-default)",
|
|
21
|
+
cx: "25",
|
|
22
|
+
cy: "25",
|
|
23
|
+
r: "20",
|
|
24
|
+
strokeWidth: "4",
|
|
25
|
+
strokeLinecap: "round"
|
|
26
|
+
}
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
n as P
|
|
35
|
+
};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { jsx as e, jsxs as k } from "react/jsx-runtime";
|
|
2
|
+
import { RadioGroup as r } from "@ark-ui/react/radio-group";
|
|
3
|
+
const g = `
|
|
4
|
+
mare:flex mare:gap-4
|
|
5
|
+
mare:ark-vertical:flex-col
|
|
6
|
+
mare:ark-horizontal:flex-row
|
|
7
|
+
mare:ark-disabled:cursor-default
|
|
8
|
+
`, z = `
|
|
9
|
+
mare:relative mare:inline-flex mare:items-center mare:gap-2
|
|
10
|
+
mare:select-none mare:cursor-pointer
|
|
11
|
+
mare:ark-disabled:cursor-default
|
|
12
|
+
mare:data-size-small:gap-1.5
|
|
13
|
+
mare:data-size-medium:gap-2
|
|
14
|
+
mare:data-size-large:gap-2.5
|
|
15
|
+
`, f = `
|
|
16
|
+
mare:relative mare:inline-flex mare:items-center mare:justify-center mare:shrink-0
|
|
17
|
+
mare:rounded-full mare:border mare:border-strong mare:bg-transparent
|
|
18
|
+
mare:shadow-[0_1px_2px_0_rgba(18,18,23,0.05)]
|
|
19
|
+
mare:transition-[border-width,border-color] mare:duration-200
|
|
20
|
+
mare:overflow-hidden
|
|
21
|
+
|
|
22
|
+
mare:data-size-small:w-4.5 mare:data-size-small:h-4.5
|
|
23
|
+
mare:data-size-medium:w-6 mare:data-size-medium:h-6
|
|
24
|
+
mare:data-size-large:w-8 mare:data-size-large:h-8
|
|
25
|
+
|
|
26
|
+
mare:not-ark-disabled:hover:border-accent
|
|
27
|
+
|
|
28
|
+
mare:ark-checked:border-accent
|
|
29
|
+
mare:data-size-small:ark-checked:border-[6px]
|
|
30
|
+
mare:data-size-medium:ark-checked:border-[8px]
|
|
31
|
+
mare:data-size-large:ark-checked:border-[11px]
|
|
32
|
+
mare:not-ark-disabled:ark-checked:hover:border-accent-hover
|
|
33
|
+
|
|
34
|
+
mare:ark-disabled:border-disabled!
|
|
35
|
+
|
|
36
|
+
mare:ark-invalid:border-danger!
|
|
37
|
+
`, v = `
|
|
38
|
+
mare:invisible mare:rounded-full mare:bg-[var(--color-fg-on-accent)]
|
|
39
|
+
|
|
40
|
+
mare:data-size-small:w-2 mare:data-size-small:h-2
|
|
41
|
+
mare:data-size-medium:w-2.5 mare:data-size-medium:h-2.5
|
|
42
|
+
mare:data-size-large:w-3 mare:data-size-large:h-3
|
|
43
|
+
|
|
44
|
+
mare:ark-checked:visible
|
|
45
|
+
mare:ark-disabled:ark-checked:bg-disabled!
|
|
46
|
+
mare:ark-invalid:ark-checked:bg-[var(--color-fg-on-danger)]!
|
|
47
|
+
`, x = `
|
|
48
|
+
mare:text-default
|
|
49
|
+
mare:data-size-small:tpc-typography-body-s
|
|
50
|
+
mare:data-size-medium:tpc-typography-body-m
|
|
51
|
+
mare:data-size-large:tpc-typography-body-l
|
|
52
|
+
mare:ark-disabled:text-disabled
|
|
53
|
+
`, y = `
|
|
54
|
+
mare:sr-only
|
|
55
|
+
`;
|
|
56
|
+
function I({
|
|
57
|
+
items: m,
|
|
58
|
+
value: l,
|
|
59
|
+
defaultValue: s,
|
|
60
|
+
onValueChange: i,
|
|
61
|
+
size: d = "small",
|
|
62
|
+
orientation: t = "vertical",
|
|
63
|
+
disabled: o = !1,
|
|
64
|
+
invalid: c = !1,
|
|
65
|
+
readOnly: n = !1,
|
|
66
|
+
required: b = !1,
|
|
67
|
+
name: u,
|
|
68
|
+
form: h,
|
|
69
|
+
id: p
|
|
70
|
+
}) {
|
|
71
|
+
return /* @__PURE__ */ e(
|
|
72
|
+
r.Root,
|
|
73
|
+
{
|
|
74
|
+
value: l,
|
|
75
|
+
defaultValue: s,
|
|
76
|
+
onValueChange: (a) => {
|
|
77
|
+
a.value && i?.(a.value);
|
|
78
|
+
},
|
|
79
|
+
orientation: t,
|
|
80
|
+
disabled: o,
|
|
81
|
+
invalid: c,
|
|
82
|
+
readOnly: n,
|
|
83
|
+
required: b,
|
|
84
|
+
name: u,
|
|
85
|
+
form: h,
|
|
86
|
+
id: p,
|
|
87
|
+
className: g,
|
|
88
|
+
children: m.map((a) => /* @__PURE__ */ k(
|
|
89
|
+
r.Item,
|
|
90
|
+
{
|
|
91
|
+
value: a.value,
|
|
92
|
+
disabled: a.disabled,
|
|
93
|
+
className: z,
|
|
94
|
+
"data-size": d,
|
|
95
|
+
children: [
|
|
96
|
+
/* @__PURE__ */ e(
|
|
97
|
+
r.ItemControl,
|
|
98
|
+
{
|
|
99
|
+
className: f,
|
|
100
|
+
"data-size": d,
|
|
101
|
+
children: /* @__PURE__ */ e(
|
|
102
|
+
"span",
|
|
103
|
+
{
|
|
104
|
+
className: v,
|
|
105
|
+
"data-size": d
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
}
|
|
109
|
+
),
|
|
110
|
+
/* @__PURE__ */ e(
|
|
111
|
+
r.ItemText,
|
|
112
|
+
{
|
|
113
|
+
className: x,
|
|
114
|
+
"data-size": d,
|
|
115
|
+
children: a.label
|
|
116
|
+
}
|
|
117
|
+
),
|
|
118
|
+
/* @__PURE__ */ e(
|
|
119
|
+
r.ItemHiddenInput,
|
|
120
|
+
{
|
|
121
|
+
className: y
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
]
|
|
125
|
+
},
|
|
126
|
+
a.value
|
|
127
|
+
))
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
export {
|
|
132
|
+
I as R
|
|
133
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as w } from "react";
|
|
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";
|
|
5
|
+
const R = {
|
|
6
|
+
small: "mare:h-10",
|
|
7
|
+
medium: "mare:h-12"
|
|
8
|
+
}, q = {
|
|
9
|
+
small: "mare:tpc-typography-body-s",
|
|
10
|
+
medium: "mare:tpc-typography-body-m"
|
|
11
|
+
}, A = (r) => `
|
|
12
|
+
mare:group mare:w-full mare:flex mare:items-center mare:justify-between mare:gap-3
|
|
13
|
+
${R[r]}
|
|
14
|
+
mare:px-3 mare:cursor-pointer
|
|
15
|
+
mare:rounded-input mare:border mare:border-strong mare:bg-default
|
|
16
|
+
mare:text-default ${q[r]}
|
|
17
|
+
mare:ark-open:outline-solid mare:ark-open:outline-2 mare:ark-open:outline-accent mare:ark-open:-outline-offset-2
|
|
18
|
+
mare:ark-disabled:text-disabled mare:ark-disabled:border-disabled-default mare:ark-disabled:cursor-not-allowed
|
|
19
|
+
mare:data-[invalid]:outline-solid mare:data-[invalid]:outline-2 mare:data-[invalid]:outline-danger mare:data-[invalid]:-outline-offset-2
|
|
20
|
+
`, l = "mare:flex-auto mare:text-left mare:truncate mare:data-[placeholder-shown]:text-weak", B = "mare:flex mare:items-center mare:shrink-0 mare:text-lg mare:transition-transform mare:ark-open:rotate-180 mare:text-default", E = "mare:flex mare:items-center mare:shrink-0 mare:text-base mare:cursor-pointer mare:text-default mare:hover:text-weak", G = "mare:flex mare:items-center mare:shrink-0 mare:text-weak mare:[&>svg]:size-5", H = `
|
|
21
|
+
mare:flex mare:flex-col mare:gap-0.5 mare:p-1
|
|
22
|
+
mare:rounded-input mare:border mare:border-default mare:bg-raised
|
|
23
|
+
mare:shadow-[0_2px_6px_0_rgba(0,0,0,0.16)]
|
|
24
|
+
mare:max-h-72 mare:overflow-y-auto
|
|
25
|
+
mare:min-w-[var(--reference-width)]
|
|
26
|
+
mare:z-50
|
|
27
|
+
`, J = `
|
|
28
|
+
mare:group/option mare:flex mare:items-center mare:justify-between mare:gap-2
|
|
29
|
+
mare:w-full mare:min-h-8 mare:py-2 mare:px-3 mare:cursor-pointer mare:rounded-menu-item
|
|
30
|
+
mare:tpc-typography-body-s mare:text-default
|
|
31
|
+
mare:ark-highlighted:bg-hover
|
|
32
|
+
mare:ark-selected:bg-accent-weak mare:ark-selected:text-accent
|
|
33
|
+
mare:ark-disabled:text-disabled mare:ark-disabled:cursor-not-allowed
|
|
34
|
+
`, K = "mare:flex mare:items-center mare:text-accent", Q = "mare:tpc-typography-label-s mare:text-default mare:mb-1.5 mare:block";
|
|
35
|
+
function Z({
|
|
36
|
+
value: r = null,
|
|
37
|
+
onValueChange: d,
|
|
38
|
+
options: t,
|
|
39
|
+
placeholder: o = "Select…",
|
|
40
|
+
size: u = "small",
|
|
41
|
+
disabled: p = !1,
|
|
42
|
+
invalid: f = !1,
|
|
43
|
+
clearable: h = !1,
|
|
44
|
+
label: n,
|
|
45
|
+
leadingIcon: s,
|
|
46
|
+
indicator: x,
|
|
47
|
+
clearIcon: b,
|
|
48
|
+
checkIcon: g,
|
|
49
|
+
renderValue: c,
|
|
50
|
+
renderOption: i
|
|
51
|
+
}) {
|
|
52
|
+
const k = w(
|
|
53
|
+
() => S({
|
|
54
|
+
items: t,
|
|
55
|
+
itemToValue: (a) => a.value,
|
|
56
|
+
itemToString: (a) => a.label,
|
|
57
|
+
isItemDisabled: (a) => !!a.disabled
|
|
58
|
+
}),
|
|
59
|
+
[t]
|
|
60
|
+
);
|
|
61
|
+
return /* @__PURE__ */ m(
|
|
62
|
+
y,
|
|
63
|
+
{
|
|
64
|
+
collection: k,
|
|
65
|
+
value: r == null ? [] : [r],
|
|
66
|
+
disabled: p,
|
|
67
|
+
invalid: f,
|
|
68
|
+
onValueChange: (a) => d?.(a.value[0] ?? null),
|
|
69
|
+
children: [
|
|
70
|
+
n && /* @__PURE__ */ e(v, { className: Q, children: n }),
|
|
71
|
+
/* @__PURE__ */ e(N, { children: /* @__PURE__ */ m(C, { className: A(u), children: [
|
|
72
|
+
s && /* @__PURE__ */ e("span", { className: G, children: s }),
|
|
73
|
+
c ? /* @__PURE__ */ e(I, { children: (a) => a.selectedItems.length > 0 ? /* @__PURE__ */ e("span", { className: l, children: c(
|
|
74
|
+
a.selectedItems[0]
|
|
75
|
+
) }) : /* @__PURE__ */ e(
|
|
76
|
+
"span",
|
|
77
|
+
{
|
|
78
|
+
className: l,
|
|
79
|
+
style: {
|
|
80
|
+
color: "var(--color-fg-weak)"
|
|
81
|
+
},
|
|
82
|
+
children: o
|
|
83
|
+
}
|
|
84
|
+
) }) : /* @__PURE__ */ e(
|
|
85
|
+
T,
|
|
86
|
+
{
|
|
87
|
+
className: l,
|
|
88
|
+
placeholder: o
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
h && /* @__PURE__ */ e(j, { className: E, children: b ?? /* @__PURE__ */ e(F, {}) }),
|
|
92
|
+
/* @__PURE__ */ e(_, { className: B, children: x ?? /* @__PURE__ */ e(M, {}) })
|
|
93
|
+
] }) }),
|
|
94
|
+
/* @__PURE__ */ e(z, { children: /* @__PURE__ */ e(D, { className: H, children: t.map((a) => /* @__PURE__ */ m(
|
|
95
|
+
L,
|
|
96
|
+
{
|
|
97
|
+
item: a,
|
|
98
|
+
className: J,
|
|
99
|
+
children: [
|
|
100
|
+
/* @__PURE__ */ e(V, { children: i ? i(a) : a.label }),
|
|
101
|
+
/* @__PURE__ */ e(
|
|
102
|
+
$,
|
|
103
|
+
{
|
|
104
|
+
className: K,
|
|
105
|
+
children: g ?? /* @__PURE__ */ e(P, {})
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
a.value
|
|
111
|
+
)) }) })
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
export {
|
|
117
|
+
Z as S
|
|
118
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { jsxs as p, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Switch as a } from "@ark-ui/react/switch";
|
|
3
|
+
const z = `
|
|
4
|
+
mare:inline-flex mare:items-center mare:gap-2
|
|
5
|
+
mare:select-none mare:cursor-pointer
|
|
6
|
+
mare:ark-disabled:cursor-default
|
|
7
|
+
`, g = `
|
|
8
|
+
mare:inline-flex mare:shrink-0 mare:items-center mare:px-0.5
|
|
9
|
+
mare:rounded-full mare:border mare:border-transparent
|
|
10
|
+
mare:bg-neutral
|
|
11
|
+
mare:shadow-[0_1px_2px_0_rgba(18,18,23,0.05)]
|
|
12
|
+
mare:transition-colors mare:duration-200
|
|
13
|
+
|
|
14
|
+
mare:data-size-small:w-9 mare:data-size-small:h-5.5
|
|
15
|
+
mare:data-size-medium:w-13 mare:data-size-medium:h-8
|
|
16
|
+
mare:data-size-large:w-16 mare:data-size-large:h-9
|
|
17
|
+
|
|
18
|
+
mare:ark-checked:bg-accent
|
|
19
|
+
mare:not-ark-disabled:ark-checked:hover:bg-accent-hover
|
|
20
|
+
|
|
21
|
+
mare:ark-disabled:bg-disabled!
|
|
22
|
+
|
|
23
|
+
mare:ark-invalid:border-danger
|
|
24
|
+
`, k = `
|
|
25
|
+
mare:rounded-full mare:bg-default
|
|
26
|
+
mare:transition-transform mare:duration-300
|
|
27
|
+
|
|
28
|
+
mare:data-size-small:w-4.5 mare:data-size-small:h-4.5
|
|
29
|
+
mare:data-size-medium:w-7 mare:data-size-medium:h-7
|
|
30
|
+
mare:data-size-large:w-8 mare:data-size-large:h-8
|
|
31
|
+
|
|
32
|
+
mare:data-size-small:ark-checked:translate-x-3.5
|
|
33
|
+
mare:data-size-medium:ark-checked:translate-x-5
|
|
34
|
+
mare:data-size-large:ark-checked:translate-x-7
|
|
35
|
+
`, f = `
|
|
36
|
+
mare:text-default
|
|
37
|
+
mare:data-size-small:tpc-typography-body-s
|
|
38
|
+
mare:data-size-medium:tpc-typography-body-m
|
|
39
|
+
mare:data-size-large:tpc-typography-body-l
|
|
40
|
+
mare:ark-disabled:text-disabled
|
|
41
|
+
`, x = `
|
|
42
|
+
mare:sr-only
|
|
43
|
+
`;
|
|
44
|
+
function N({
|
|
45
|
+
checked: t,
|
|
46
|
+
defaultChecked: s,
|
|
47
|
+
onCheckedChange: d,
|
|
48
|
+
children: m,
|
|
49
|
+
size: r = "small",
|
|
50
|
+
disabled: l = !1,
|
|
51
|
+
invalid: i = !1,
|
|
52
|
+
readOnly: n = !1,
|
|
53
|
+
required: o = !1,
|
|
54
|
+
name: c,
|
|
55
|
+
value: h = "on",
|
|
56
|
+
id: u
|
|
57
|
+
}) {
|
|
58
|
+
return /* @__PURE__ */ p(
|
|
59
|
+
a.Root,
|
|
60
|
+
{
|
|
61
|
+
checked: t,
|
|
62
|
+
defaultChecked: s,
|
|
63
|
+
onCheckedChange: (b) => {
|
|
64
|
+
d?.(b.checked);
|
|
65
|
+
},
|
|
66
|
+
disabled: l,
|
|
67
|
+
invalid: i,
|
|
68
|
+
readOnly: n,
|
|
69
|
+
required: o,
|
|
70
|
+
name: c,
|
|
71
|
+
value: h,
|
|
72
|
+
id: u,
|
|
73
|
+
className: z,
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ e(
|
|
76
|
+
a.Control,
|
|
77
|
+
{
|
|
78
|
+
className: g,
|
|
79
|
+
"data-size": r,
|
|
80
|
+
children: /* @__PURE__ */ e(
|
|
81
|
+
a.Thumb,
|
|
82
|
+
{
|
|
83
|
+
className: k,
|
|
84
|
+
"data-size": r
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
m && /* @__PURE__ */ e(
|
|
90
|
+
a.Label,
|
|
91
|
+
{
|
|
92
|
+
className: f,
|
|
93
|
+
"data-size": r,
|
|
94
|
+
children: m
|
|
95
|
+
}
|
|
96
|
+
),
|
|
97
|
+
/* @__PURE__ */ e(a.HiddenInput, { className: x })
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
export {
|
|
103
|
+
N as S
|
|
104
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsxs as o, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { TabsRoot as c, TabList as u, TabTrigger as b, TabIndicator as p, TabContent as f } from "@ark-ui/react/tabs";
|
|
3
|
+
const d = {
|
|
4
|
+
small: "mare:tpc-typography-label-s",
|
|
5
|
+
medium: "mare:tpc-typography-label-m"
|
|
6
|
+
}, v = "mare:w-full", h = (a) => `
|
|
7
|
+
mare:relative mare:flex ${a ? "mare:w-full" : "mare:w-fit"}
|
|
8
|
+
mare:border-b mare:border-default
|
|
9
|
+
`, x = (a, r) => `
|
|
10
|
+
mare:group/tab mare:relative mare:cursor-pointer mare:select-none mare:whitespace-nowrap
|
|
11
|
+
mare:h-12 mare:px-4 mare:flex mare:items-center mare:justify-center mare:gap-2
|
|
12
|
+
${r ? "mare:flex-1" : ""}
|
|
13
|
+
${d[a]}
|
|
14
|
+
mare:text-weak mare:hover:text-default
|
|
15
|
+
mare:ark-active:text-accent
|
|
16
|
+
mare:ark-disabled:opacity-60 mare:ark-disabled:pointer-events-none
|
|
17
|
+
mare:focus-visible:outline mare:focus-visible:outline-1 mare:focus-visible:outline-accent mare:focus-visible:-outline-offset-1
|
|
18
|
+
`, g = `
|
|
19
|
+
mare:absolute mare:bottom-0 mare:h-0.5 mare:bg-accent
|
|
20
|
+
mare:transition-[left,width] mare:duration-200 mare:ease-[cubic-bezier(0.35,0,0.25,1)]
|
|
21
|
+
`, w = "mare:pt-3.5 mare:pb-4.5 mare:px-4.5 mare:text-default mare:focus-visible:outline-none";
|
|
22
|
+
function N({
|
|
23
|
+
value: a,
|
|
24
|
+
onValueChange: r,
|
|
25
|
+
items: m,
|
|
26
|
+
size: i = "small",
|
|
27
|
+
fluid: t = !1,
|
|
28
|
+
renderTab: s,
|
|
29
|
+
renderPanel: n
|
|
30
|
+
}) {
|
|
31
|
+
return /* @__PURE__ */ o(
|
|
32
|
+
c,
|
|
33
|
+
{
|
|
34
|
+
value: a,
|
|
35
|
+
className: v,
|
|
36
|
+
onValueChange: (e) => r?.(e.value),
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ o(u, { className: h(t), children: [
|
|
39
|
+
m.map((e) => /* @__PURE__ */ l(
|
|
40
|
+
b,
|
|
41
|
+
{
|
|
42
|
+
value: e.value,
|
|
43
|
+
disabled: e.disabled,
|
|
44
|
+
className: x(i, t),
|
|
45
|
+
children: s ? s(e) : e.label
|
|
46
|
+
},
|
|
47
|
+
e.value
|
|
48
|
+
)),
|
|
49
|
+
/* @__PURE__ */ l(p, { className: g })
|
|
50
|
+
] }),
|
|
51
|
+
m.map((e) => /* @__PURE__ */ l(
|
|
52
|
+
f,
|
|
53
|
+
{
|
|
54
|
+
value: e.value,
|
|
55
|
+
className: w,
|
|
56
|
+
children: n?.(e)
|
|
57
|
+
},
|
|
58
|
+
e.value
|
|
59
|
+
))
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
N as T
|
|
66
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useFieldContext as x, FieldTextarea as F, FieldRoot as p } from "@ark-ui/react/field";
|
|
3
|
+
import { u as L, a as b } from "./field-layout-BXKpp5E_.js";
|
|
4
|
+
function v({
|
|
5
|
+
value: l = "",
|
|
6
|
+
onValueChange: o,
|
|
7
|
+
size: s = "medium",
|
|
8
|
+
invalid: r = !1,
|
|
9
|
+
disabled: n = !1,
|
|
10
|
+
autoresize: i = !1,
|
|
11
|
+
placeholder: c,
|
|
12
|
+
...f
|
|
13
|
+
}) {
|
|
14
|
+
const e = L(), u = !x(), m = b({
|
|
15
|
+
size: s,
|
|
16
|
+
hasFloatLabel: e?.hasFloatLabel ?? !1
|
|
17
|
+
}), d = e?.hasFloatLabel ? " " : c, a = /* @__PURE__ */ t(
|
|
18
|
+
F,
|
|
19
|
+
{
|
|
20
|
+
...f,
|
|
21
|
+
autoresize: i,
|
|
22
|
+
className: m,
|
|
23
|
+
placeholder: d,
|
|
24
|
+
value: l,
|
|
25
|
+
onChange: (h) => o?.(h.target.value)
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
return u ? /* @__PURE__ */ t(
|
|
29
|
+
p,
|
|
30
|
+
{
|
|
31
|
+
invalid: r,
|
|
32
|
+
disabled: n,
|
|
33
|
+
className: "mare:w-full",
|
|
34
|
+
children: a
|
|
35
|
+
}
|
|
36
|
+
) : a;
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
v as T
|
|
40
|
+
};
|