@tpc-mare/mare-ui-components-react 0.0.1
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/avatar/Avatar.d.ts +2 -0
- package/dist/avatar/Avatar.types.d.ts +26 -0
- package/dist/avatar/index.d.ts +2 -0
- package/dist/avatar/index.js +4 -0
- package/dist/badge/Badge.d.ts +2 -0
- package/dist/badge/Badge.types.d.ts +11 -0
- package/dist/badge/index.d.ts +2 -0
- package/dist/badge/index.js +4 -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/date-picker/DatePicker.d.ts +3 -0
- package/dist/date-picker/DatePicker.types.d.ts +52 -0
- package/dist/date-picker/index.d.ts +2 -0
- package/dist/date-picker/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/drawer/Drawer.d.ts +2 -0
- package/dist/drawer/Drawer.types.d.ts +53 -0
- package/dist/drawer/DrawerFooter.d.ts +2 -0
- package/dist/drawer/DrawerHeader.d.ts +2 -0
- package/dist/drawer/index.d.ts +4 -0
- package/dist/drawer/index.js +6 -0
- package/dist/index/index.d.ts +44 -0
- package/dist/index/index.js +57 -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 +16 -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 +12 -0
- package/dist/input-text/index.d.ts +11 -0
- package/dist/input-text/index.js +10 -0
- package/dist/menu/Menu.d.ts +2 -0
- package/dist/menu/Menu.types.d.ts +19 -0
- package/dist/menu/index.d.ts +2 -0
- package/dist/menu/index.js +4 -0
- package/dist/panel-menu/PanelMenu.d.ts +2 -0
- package/dist/panel-menu/PanelMenu.types.d.ts +12 -0
- package/dist/panel-menu/index.d.ts +2 -0
- package/dist/panel-menu/index.js +4 -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/search-field/SearchField.d.ts +2 -0
- package/dist/search-field/SearchField.types.d.ts +26 -0
- package/dist/search-field/index.d.ts +2 -0
- package/dist/search-field/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/Avatar-D3QlO3Tz.js +59 -0
- package/dist/shared/Badge-WC6my4Aw.js +35 -0
- package/dist/shared/Button-AfMqNCme.js +177 -0
- package/dist/shared/Checkbox-Ci1b59K1.js +134 -0
- package/dist/shared/Combobox-DZ5SgSv6.js +134 -0
- package/dist/shared/DatePicker-BMl0szfL.js +856 -0
- package/dist/shared/DialogFooter-Bg3hz6fh.js +154 -0
- package/dist/shared/DrawerFooter-COA137vD.js +172 -0
- package/dist/shared/HelperText-CVWWvLCI.js +46 -0
- package/dist/shared/IconField-Dh6j6SL1.js +78 -0
- package/dist/shared/InputNumber-D48wsE-o.js +62 -0
- package/dist/shared/Menu-Cv9dU1iA.js +104 -0
- package/dist/shared/PanelMenu-5A9LgcGR.js +123 -0
- package/dist/shared/ProgressSpinner-B-lrS-tu.js +35 -0
- package/dist/shared/RadioGroup-lw27DCoV.js +133 -0
- package/dist/shared/SearchField-CuQ0cXOZ.js +63 -0
- package/dist/shared/SelectField-D6OlgFYy.js +118 -0
- package/dist/shared/Snackbar-C29nLHO9.js +100 -0
- package/dist/shared/Stepper-BGKHXl-b.js +110 -0
- package/dist/shared/Switch-D6E2OmgE.js +104 -0
- package/dist/shared/Tabs-BqIorZYD.js +66 -0
- package/dist/shared/Tag-BtbmgIwL.js +36 -0
- package/dist/shared/Textarea-iJhYTZos.js +40 -0
- package/dist/shared/field-layout-D34MpDMB.js +53 -0
- package/dist/shared/icons-_QeAcImG.js +44 -0
- package/dist/shared/icons.d.ts +11 -0
- package/dist/shared/useMediaQuery.d.ts +5 -0
- package/dist/snackbar/Snackbar.d.ts +3 -0
- package/dist/snackbar/Snackbar.types.d.ts +42 -0
- package/dist/snackbar/index.d.ts +2 -0
- package/dist/snackbar/index.js +5 -0
- package/dist/stepper/Stepper.d.ts +2 -0
- package/dist/stepper/Stepper.types.d.ts +18 -0
- package/dist/stepper/index.d.ts +2 -0
- package/dist/stepper/index.js +4 -0
- package/dist/styles.css +1 -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/tag/Tag.d.ts +2 -0
- package/dist/tag/Tag.types.d.ts +11 -0
- package/dist/tag/index.d.ts +2 -0
- package/dist/tag/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 +70 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { jsx as a, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { Dialog as o } from "@ark-ui/react/dialog";
|
|
3
|
+
import { Portal as w } from "@ark-ui/react/portal";
|
|
4
|
+
import { B as n } from "./Button-AfMqNCme.js";
|
|
5
|
+
import { e as _ } from "./icons-_QeAcImG.js";
|
|
6
|
+
const k = (e) => `
|
|
7
|
+
mare:fixed mare:inset-0 mare:z-40
|
|
8
|
+
${e ?? "mare:bg-overlay"}
|
|
9
|
+
mare:ark-open:[animation:mare-dialog-backdrop-enter_300ms_ease-out]
|
|
10
|
+
mare:ark-closed:[animation:mare-dialog-backdrop-exit_200ms_ease-in]
|
|
11
|
+
`, y = `
|
|
12
|
+
mare:fixed mare:inset-0 mare:z-50
|
|
13
|
+
mare:flex mare:items-center mare:justify-center
|
|
14
|
+
mare:overflow-y-auto mare:px-0 mare:sm:px-10
|
|
15
|
+
`, v = {
|
|
16
|
+
small: "mare:sm:w-[28rem] mare:sm:max-w-[28rem]",
|
|
17
|
+
medium: "mare:sm:w-[42rem] mare:sm:max-w-[42rem]",
|
|
18
|
+
large: "mare:sm:w-[64rem] mare:sm:max-w-[64rem]"
|
|
19
|
+
}, N = (e) => `
|
|
20
|
+
mare:group/dialog mare:flex mare:flex-col
|
|
21
|
+
mare:w-full mare:max-w-full mare:max-w-screen ${v[e.size]}
|
|
22
|
+
mare:bg-default mare:text-default
|
|
23
|
+
mare:shadow-[0px_10px_15px_-3px_rgba(0,0,0,0.10),0px_4px_6px_-2px_rgba(0,0,0,0.05)]
|
|
24
|
+
mare:fixed mare:sm:relative mare:bottom-0 mare:sm:bottom-auto mare:left-0 mare:sm:left-auto mare:right-0 mare:sm:right-auto
|
|
25
|
+
mare:rounded-t-tpc-sheet mare:sm:rounded-tpc-dialog
|
|
26
|
+
mare:max-h-[calc(100%-32px)] mare:sm:max-h-[calc(100%-80px)]
|
|
27
|
+
mare:outline-none
|
|
28
|
+
mare:ark-open:[animation:mare-dialog-enter-mobile_300ms_ease-out]
|
|
29
|
+
mare:ark-closed:[animation:mare-dialog-exit-mobile_200ms_ease-in]
|
|
30
|
+
mare:sm:ark-open:[animation:mare-dialog-enter-desktop_300ms_ease-out]
|
|
31
|
+
mare:sm:ark-closed:[animation:mare-dialog-exit-desktop_200ms_ease-in]
|
|
32
|
+
${e.fullScreen ? "mare:top-0 mare:rounded-t-none! mare:sm:rounded-tpc-dialog! mare:sm:top-auto mare:max-h-full mare:sm:max-h-[calc(100%-80px)]" : ""}
|
|
33
|
+
`, $ = (e) => `
|
|
34
|
+
mare:overflow-y-auto mare:px-6 mare:pb-6
|
|
35
|
+
${e ? "mare:grow" : ""}
|
|
36
|
+
`, C = (e) => `
|
|
37
|
+
mare:flex mare:w-full mare:items-center mare:justify-between mare:shrink-0
|
|
38
|
+
mare:h-14 mare:sm:h-16 mare:px-6
|
|
39
|
+
${e ? "mare:border-b mare:border-default" : ""}
|
|
40
|
+
`, z = "mare:-ml-1.5", D = "mare:-mr-1.5", d = (e) => `
|
|
41
|
+
mare:grow mare:w-full mare:truncate mare:text-center
|
|
42
|
+
mare:tpc-typography-label-m mare:text-default
|
|
43
|
+
${e.hasRightIcon ? "" : "mare:mr-6.5"}
|
|
44
|
+
${e.hasLeftIcon ? "" : "mare:ml-6.5"}
|
|
45
|
+
`, O = (e) => `
|
|
46
|
+
mare:flex mare:flex-col-reverse mare:gap-3 mare:justify-end mare:w-full
|
|
47
|
+
mare:px-6 mare:pb-4 mare:sm:pb-6
|
|
48
|
+
${e.layout === "row" ? "mare:sm:flex-row" : ""}
|
|
49
|
+
${e.border ? "mare:pt-3 mare:sm:pt-6 mare:border-t mare:border-t-default" : "mare:pt-0"}
|
|
50
|
+
`;
|
|
51
|
+
function P({
|
|
52
|
+
open: e,
|
|
53
|
+
onOpenChange: r,
|
|
54
|
+
size: m = "medium",
|
|
55
|
+
fullScreen: t = !1,
|
|
56
|
+
modal: s = !0,
|
|
57
|
+
closeOnEscape: l = !0,
|
|
58
|
+
dismissableMask: c = !0,
|
|
59
|
+
maskColor: u,
|
|
60
|
+
portalContainer: p,
|
|
61
|
+
header: x,
|
|
62
|
+
footer: f,
|
|
63
|
+
children: g,
|
|
64
|
+
"aria-label": h
|
|
65
|
+
}) {
|
|
66
|
+
return /* @__PURE__ */ a(
|
|
67
|
+
o.Root,
|
|
68
|
+
{
|
|
69
|
+
open: e,
|
|
70
|
+
onOpenChange: (b) => r?.(b.open),
|
|
71
|
+
modal: s,
|
|
72
|
+
closeOnEscape: l,
|
|
73
|
+
closeOnInteractOutside: c,
|
|
74
|
+
"aria-label": h,
|
|
75
|
+
lazyMount: !0,
|
|
76
|
+
unmountOnExit: !0,
|
|
77
|
+
children: /* @__PURE__ */ i(w, { container: p, children: [
|
|
78
|
+
/* @__PURE__ */ a(o.Backdrop, { className: k(u) }),
|
|
79
|
+
/* @__PURE__ */ a(o.Positioner, { className: y, children: /* @__PURE__ */ i(
|
|
80
|
+
o.Content,
|
|
81
|
+
{
|
|
82
|
+
className: N({ size: m, fullScreen: t }),
|
|
83
|
+
children: [
|
|
84
|
+
x,
|
|
85
|
+
/* @__PURE__ */ a("div", { className: $(t), children: g }),
|
|
86
|
+
f
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
) })
|
|
90
|
+
] })
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
function T({
|
|
95
|
+
title: e,
|
|
96
|
+
leftIcon: r = /* @__PURE__ */ a(_, {}),
|
|
97
|
+
rightIcon: m,
|
|
98
|
+
onLeftIconClick: t,
|
|
99
|
+
onRightIconClick: s,
|
|
100
|
+
border: l = !1
|
|
101
|
+
}) {
|
|
102
|
+
return /* @__PURE__ */ i("div", { className: C(l), children: [
|
|
103
|
+
r ? /* @__PURE__ */ a("div", { className: z, children: /* @__PURE__ */ a(o.CloseTrigger, { asChild: !0, children: /* @__PURE__ */ a(
|
|
104
|
+
n,
|
|
105
|
+
{
|
|
106
|
+
severity: "ghost",
|
|
107
|
+
iconOnly: !0,
|
|
108
|
+
size: "xsmall",
|
|
109
|
+
icon: r,
|
|
110
|
+
onClick: t
|
|
111
|
+
}
|
|
112
|
+
) }) }) : null,
|
|
113
|
+
e ? /* @__PURE__ */ a(
|
|
114
|
+
o.Title,
|
|
115
|
+
{
|
|
116
|
+
className: d({
|
|
117
|
+
hasLeftIcon: !!r,
|
|
118
|
+
hasRightIcon: !!m
|
|
119
|
+
}),
|
|
120
|
+
children: e
|
|
121
|
+
}
|
|
122
|
+
) : /* @__PURE__ */ a(
|
|
123
|
+
"span",
|
|
124
|
+
{
|
|
125
|
+
className: d({
|
|
126
|
+
hasLeftIcon: !!r,
|
|
127
|
+
hasRightIcon: !!m
|
|
128
|
+
})
|
|
129
|
+
}
|
|
130
|
+
),
|
|
131
|
+
m ? /* @__PURE__ */ a("div", { className: D, children: /* @__PURE__ */ a(
|
|
132
|
+
n,
|
|
133
|
+
{
|
|
134
|
+
severity: "ghost",
|
|
135
|
+
iconOnly: !0,
|
|
136
|
+
size: "xsmall",
|
|
137
|
+
icon: m,
|
|
138
|
+
onClick: s
|
|
139
|
+
}
|
|
140
|
+
) }) : null
|
|
141
|
+
] });
|
|
142
|
+
}
|
|
143
|
+
function E({
|
|
144
|
+
layout: e = "row",
|
|
145
|
+
border: r = !1,
|
|
146
|
+
children: m
|
|
147
|
+
}) {
|
|
148
|
+
return /* @__PURE__ */ a("div", { className: O({ layout: e, border: r }), children: m });
|
|
149
|
+
}
|
|
150
|
+
export {
|
|
151
|
+
P as D,
|
|
152
|
+
E as a,
|
|
153
|
+
T as b
|
|
154
|
+
};
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { Dialog as t } from "@ark-ui/react/dialog";
|
|
3
|
+
import { Portal as g } from "@ark-ui/react/portal";
|
|
4
|
+
import { B as d } from "./Button-AfMqNCme.js";
|
|
5
|
+
import { e as y } from "./icons-_QeAcImG.js";
|
|
6
|
+
const _ = (e) => {
|
|
7
|
+
switch (e) {
|
|
8
|
+
case "left":
|
|
9
|
+
return "translateX(-100%)";
|
|
10
|
+
case "right":
|
|
11
|
+
return "translateX(100%)";
|
|
12
|
+
case "top":
|
|
13
|
+
return "translateY(-100%)";
|
|
14
|
+
case "bottom":
|
|
15
|
+
case "full":
|
|
16
|
+
return "translateY(100%)";
|
|
17
|
+
}
|
|
18
|
+
}, k = (e) => `
|
|
19
|
+
mare:fixed mare:inset-0 mare:z-40
|
|
20
|
+
${e ?? "mare:bg-overlay"}
|
|
21
|
+
mare:ark-open:[animation:mare-dialog-backdrop-enter_300ms_ease-out]
|
|
22
|
+
mare:ark-closed:[animation:mare-dialog-backdrop-exit_200ms_ease-in]
|
|
23
|
+
`, v = {
|
|
24
|
+
left: "mare:justify-start",
|
|
25
|
+
right: "mare:justify-end",
|
|
26
|
+
top: "mare:flex-col mare:justify-start",
|
|
27
|
+
bottom: "mare:flex-col mare:justify-end",
|
|
28
|
+
full: ""
|
|
29
|
+
}, N = (e) => `
|
|
30
|
+
mare:fixed mare:inset-0 mare:z-50 mare:flex
|
|
31
|
+
${v[e]}
|
|
32
|
+
`, $ = {
|
|
33
|
+
left: "mare:w-screen mare:md:w-120",
|
|
34
|
+
right: "mare:w-screen mare:md:w-120",
|
|
35
|
+
top: "mare:border-b mare:border-default",
|
|
36
|
+
bottom: "mare:border-t mare:border-default",
|
|
37
|
+
full: "mare:w-screen mare:h-screen mare:max-h-full"
|
|
38
|
+
}, j = (e) => `
|
|
39
|
+
mare:group/drawer mare:flex mare:flex-col
|
|
40
|
+
mare:bg-default mare:text-default
|
|
41
|
+
mare:outline-none
|
|
42
|
+
${e.shadow ? "mare:shadow-[0px_10px_15px_-3px_rgba(0,0,0,0.10),0px_4px_6px_-2px_rgba(0,0,0,0.05)]" : ""}
|
|
43
|
+
${$[e.position]}
|
|
44
|
+
mare:ark-open:[animation:mare-drawer-enter_300ms_ease-out]
|
|
45
|
+
mare:ark-closed:[animation:mare-drawer-exit_200ms_ease-in]
|
|
46
|
+
`, C = (e) => `
|
|
47
|
+
mare:grow mare:overflow-y-auto mare:px-6 mare:pb-6
|
|
48
|
+
${e ? "mare:pt-6" : "mare:pt-0"}
|
|
49
|
+
`, O = (e) => `
|
|
50
|
+
mare:flex mare:w-full mare:items-center mare:justify-between mare:shrink-0
|
|
51
|
+
mare:px-6
|
|
52
|
+
${e.compact ? "mare:h-auto mare:py-4" : "mare:h-14 mare:md:h-16"}
|
|
53
|
+
${e.border ? "mare:border-b mare:border-default" : ""}
|
|
54
|
+
`, z = "mare:-ml-1.5", D = "mare:-mr-1.5", u = (e) => `
|
|
55
|
+
mare:grow mare:w-full mare:truncate mare:text-center
|
|
56
|
+
mare:tpc-typography-label-m mare:text-default
|
|
57
|
+
${e.hasRightIcon ? "" : "mare:mr-6.5"}
|
|
58
|
+
${e.hasLeftIcon ? "" : "mare:ml-6.5"}
|
|
59
|
+
`, R = (e) => `
|
|
60
|
+
mare:flex mare:flex-col-reverse mare:sm:flex-row mare:justify-end
|
|
61
|
+
mare:gap-3 mare:sm:gap-4 mare:w-full
|
|
62
|
+
mare:*:w-full mare:sm:*:flex-1
|
|
63
|
+
mare:px-6 mare:pb-4 mare:sm:pb-6
|
|
64
|
+
${e ? "mare:pt-3 mare:sm:pt-6 mare:border-t mare:border-t-default" : "mare:pt-0"}
|
|
65
|
+
`;
|
|
66
|
+
function X({
|
|
67
|
+
open: e,
|
|
68
|
+
onOpenChange: a,
|
|
69
|
+
position: m = "left",
|
|
70
|
+
modal: l = !0,
|
|
71
|
+
closeOnEscape: s = !0,
|
|
72
|
+
dismissableMask: o = !0,
|
|
73
|
+
maskColor: n,
|
|
74
|
+
shadow: f = !0,
|
|
75
|
+
portalContainer: p,
|
|
76
|
+
header: c,
|
|
77
|
+
footer: x,
|
|
78
|
+
children: h,
|
|
79
|
+
"aria-label": b
|
|
80
|
+
}) {
|
|
81
|
+
return /* @__PURE__ */ r(
|
|
82
|
+
t.Root,
|
|
83
|
+
{
|
|
84
|
+
open: e,
|
|
85
|
+
onOpenChange: (w) => a?.(w.open),
|
|
86
|
+
modal: l,
|
|
87
|
+
closeOnEscape: s,
|
|
88
|
+
closeOnInteractOutside: o,
|
|
89
|
+
"aria-label": b,
|
|
90
|
+
lazyMount: !0,
|
|
91
|
+
unmountOnExit: !0,
|
|
92
|
+
children: /* @__PURE__ */ i(g, { container: p, children: [
|
|
93
|
+
/* @__PURE__ */ r(t.Backdrop, { className: k(n) }),
|
|
94
|
+
/* @__PURE__ */ r(t.Positioner, { className: N(m), children: /* @__PURE__ */ i(
|
|
95
|
+
t.Content,
|
|
96
|
+
{
|
|
97
|
+
className: j({ position: m, shadow: f }),
|
|
98
|
+
style: {
|
|
99
|
+
"--mare-drawer-from": _(m)
|
|
100
|
+
},
|
|
101
|
+
children: [
|
|
102
|
+
c,
|
|
103
|
+
/* @__PURE__ */ r("div", { className: C(!!c), children: h }),
|
|
104
|
+
x
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
) })
|
|
108
|
+
] })
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
function Y({
|
|
113
|
+
title: e,
|
|
114
|
+
leftIcon: a = /* @__PURE__ */ r(y, {}),
|
|
115
|
+
rightIcon: m,
|
|
116
|
+
onLeftIconClick: l,
|
|
117
|
+
onRightIconClick: s,
|
|
118
|
+
border: o = !1,
|
|
119
|
+
compact: n = !1
|
|
120
|
+
}) {
|
|
121
|
+
return /* @__PURE__ */ i("div", { className: O({ border: o, compact: n }), children: [
|
|
122
|
+
a ? /* @__PURE__ */ r("div", { className: z, children: /* @__PURE__ */ r(t.CloseTrigger, { asChild: !0, children: /* @__PURE__ */ r(
|
|
123
|
+
d,
|
|
124
|
+
{
|
|
125
|
+
severity: "ghost",
|
|
126
|
+
iconOnly: !0,
|
|
127
|
+
size: "xsmall",
|
|
128
|
+
icon: a,
|
|
129
|
+
onClick: l
|
|
130
|
+
}
|
|
131
|
+
) }) }) : null,
|
|
132
|
+
e ? /* @__PURE__ */ r(
|
|
133
|
+
t.Title,
|
|
134
|
+
{
|
|
135
|
+
className: u({
|
|
136
|
+
hasLeftIcon: !!a,
|
|
137
|
+
hasRightIcon: !!m
|
|
138
|
+
}),
|
|
139
|
+
children: e
|
|
140
|
+
}
|
|
141
|
+
) : /* @__PURE__ */ r(
|
|
142
|
+
"span",
|
|
143
|
+
{
|
|
144
|
+
className: u({
|
|
145
|
+
hasLeftIcon: !!a,
|
|
146
|
+
hasRightIcon: !!m
|
|
147
|
+
})
|
|
148
|
+
}
|
|
149
|
+
),
|
|
150
|
+
m ? /* @__PURE__ */ r("div", { className: D, children: /* @__PURE__ */ r(
|
|
151
|
+
d,
|
|
152
|
+
{
|
|
153
|
+
severity: "ghost",
|
|
154
|
+
iconOnly: !0,
|
|
155
|
+
size: "xsmall",
|
|
156
|
+
icon: m,
|
|
157
|
+
onClick: s
|
|
158
|
+
}
|
|
159
|
+
) }) : null
|
|
160
|
+
] });
|
|
161
|
+
}
|
|
162
|
+
function E({
|
|
163
|
+
border: e = !1,
|
|
164
|
+
children: a
|
|
165
|
+
}) {
|
|
166
|
+
return /* @__PURE__ */ r("div", { className: R(e), children: a });
|
|
167
|
+
}
|
|
168
|
+
export {
|
|
169
|
+
X as D,
|
|
170
|
+
E as a,
|
|
171
|
+
Y as b
|
|
172
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsxs as i, jsx as r, Fragment as m } from "react/jsx-runtime";
|
|
2
|
+
import { useFieldContext as s, FieldRoot as c, FieldLabel as d, FieldErrorText as u, FieldHelperText as h } from "@ark-ui/react/field";
|
|
3
|
+
import { x as f, g, F as x, p as l, h as y } from "./field-layout-D34MpDMB.js";
|
|
4
|
+
function L({ value: e, max: o }) {
|
|
5
|
+
const a = s()?.disabled ?? !1;
|
|
6
|
+
return /* @__PURE__ */ i("span", { className: f(a), children: [
|
|
7
|
+
e.length,
|
|
8
|
+
"/",
|
|
9
|
+
o
|
|
10
|
+
] });
|
|
11
|
+
}
|
|
12
|
+
function N({
|
|
13
|
+
invalid: e = !1,
|
|
14
|
+
disabled: o = !1,
|
|
15
|
+
required: t = !1,
|
|
16
|
+
children: a
|
|
17
|
+
}) {
|
|
18
|
+
return /* @__PURE__ */ r(
|
|
19
|
+
c,
|
|
20
|
+
{
|
|
21
|
+
invalid: e,
|
|
22
|
+
disabled: o,
|
|
23
|
+
required: t,
|
|
24
|
+
className: g,
|
|
25
|
+
children: a
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
const F = "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";
|
|
30
|
+
function S({ label: e, children: o }) {
|
|
31
|
+
const t = { hasFloatLabel: !0, iconSide: null }, a = `${F} mare:group-has-[.mare-icon-left_svg]:left-10 mare:group-has-[textarea]:top-2 mare:group-has-[textarea]:translate-y-0`, n = /* @__PURE__ */ i(m, { children: [
|
|
32
|
+
o,
|
|
33
|
+
/* @__PURE__ */ r(d, { className: a, children: e })
|
|
34
|
+
] }), p = !s() ? /* @__PURE__ */ r(c, { className: l, children: n }) : /* @__PURE__ */ r("div", { className: l, children: n });
|
|
35
|
+
return /* @__PURE__ */ r(x.Provider, { value: t, children: p });
|
|
36
|
+
}
|
|
37
|
+
function H({ children: e }) {
|
|
38
|
+
const t = s()?.invalid ?? !1, a = y(t);
|
|
39
|
+
return t ? /* @__PURE__ */ r(u, { className: a, children: e }) : /* @__PURE__ */ r(h, { className: a, children: e });
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
L as C,
|
|
43
|
+
S as F,
|
|
44
|
+
H,
|
|
45
|
+
N as a
|
|
46
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { jsx as t, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { useFieldContext as b, FieldInput as v, FieldRoot as L } from "@ark-ui/react/field";
|
|
3
|
+
import { u as d, d as x, m as S, f as g, F as y } from "./field-layout-D34MpDMB.js";
|
|
4
|
+
function j({
|
|
5
|
+
value: s = "",
|
|
6
|
+
onValueChange: a,
|
|
7
|
+
size: n = "medium",
|
|
8
|
+
rounded: l = !1,
|
|
9
|
+
invalid: r = !1,
|
|
10
|
+
disabled: i = !1,
|
|
11
|
+
placeholder: o,
|
|
12
|
+
...c
|
|
13
|
+
}) {
|
|
14
|
+
const e = d(), m = !b(), f = x({
|
|
15
|
+
size: n,
|
|
16
|
+
rounded: l,
|
|
17
|
+
hasFloatLabel: e?.hasFloatLabel ?? !1,
|
|
18
|
+
iconSide: e?.iconSide ?? null
|
|
19
|
+
}), h = e?.hasFloatLabel ? " " : o, u = /* @__PURE__ */ t(
|
|
20
|
+
v,
|
|
21
|
+
{
|
|
22
|
+
...c,
|
|
23
|
+
className: f,
|
|
24
|
+
placeholder: h,
|
|
25
|
+
value: s,
|
|
26
|
+
onChange: (F) => a?.(F.target.value)
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
return m ? /* @__PURE__ */ t(
|
|
30
|
+
L,
|
|
31
|
+
{
|
|
32
|
+
invalid: r,
|
|
33
|
+
disabled: i,
|
|
34
|
+
className: "mare:w-full",
|
|
35
|
+
children: u
|
|
36
|
+
}
|
|
37
|
+
) : u;
|
|
38
|
+
}
|
|
39
|
+
function w({
|
|
40
|
+
icon: s,
|
|
41
|
+
position: a = "left",
|
|
42
|
+
disabled: n = !1,
|
|
43
|
+
onIconClick: l,
|
|
44
|
+
iconLabel: r,
|
|
45
|
+
children: i
|
|
46
|
+
}) {
|
|
47
|
+
const o = d(), c = {
|
|
48
|
+
hasFloatLabel: o?.hasFloatLabel ?? !1,
|
|
49
|
+
iconSide: S(o?.iconSide ?? null, a)
|
|
50
|
+
}, e = g(a, {
|
|
51
|
+
disabled: n,
|
|
52
|
+
interactive: !!l
|
|
53
|
+
});
|
|
54
|
+
return /* @__PURE__ */ t(y.Provider, { value: c, children: /* @__PURE__ */ p(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
className: `mare:relative mare:w-full mare:group ${a === "left" ? "mare-icon-left" : "mare-icon-right"}`,
|
|
58
|
+
children: [
|
|
59
|
+
i,
|
|
60
|
+
l ? /* @__PURE__ */ t(
|
|
61
|
+
"button",
|
|
62
|
+
{
|
|
63
|
+
type: "button",
|
|
64
|
+
disabled: n,
|
|
65
|
+
onClick: l,
|
|
66
|
+
"aria-label": r,
|
|
67
|
+
className: e,
|
|
68
|
+
children: s
|
|
69
|
+
}
|
|
70
|
+
) : /* @__PURE__ */ t("span", { className: e, children: s })
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
) });
|
|
74
|
+
}
|
|
75
|
+
export {
|
|
76
|
+
w as I,
|
|
77
|
+
j as a
|
|
78
|
+
};
|
|
@@ -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-D34MpDMB.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,104 @@
|
|
|
1
|
+
import { jsxs as o, jsx as r, Fragment as u } from "react/jsx-runtime";
|
|
2
|
+
import { Menu as m } from "@ark-ui/react/menu";
|
|
3
|
+
import { Portal as p } from "@ark-ui/react/portal";
|
|
4
|
+
const h = `
|
|
5
|
+
mare:min-w-52 mare:flex mare:flex-col mare:gap-1 mare:p-2
|
|
6
|
+
mare:bg-raised mare:border mare:border-default mare:rounded-tpc-overlay
|
|
7
|
+
mare:shadow-[0_4px_6px_-1px_rgba(0,0,0,0.1),0_2px_4px_-2px_rgba(0,0,0,0.1)]
|
|
8
|
+
mare:mt-2 mare:z-50 mare:outline-none
|
|
9
|
+
mare:ark-open:[animation:mare-menu-enter_120ms_cubic-bezier(0,0,0.2,1)]
|
|
10
|
+
mare:ark-closed:[animation:mare-menu-exit_100ms_linear]
|
|
11
|
+
`, b = (e) => `
|
|
12
|
+
mare:group mare:flex mare:items-center mare:gap-2 mare:h-10 mare:px-3
|
|
13
|
+
mare:rounded-menu-item mare:cursor-pointer mare:select-none mare:outline-none
|
|
14
|
+
mare:overflow-hidden mare:text-inherit mare:no-underline
|
|
15
|
+
mare:tpc-typography-body-s mare:text-default mare:transition-colors mare:duration-200
|
|
16
|
+
${e.active ? "mare:bg-accent-weak" : "mare:ark-highlighted:bg-hover"}
|
|
17
|
+
mare:ark-disabled:text-disabled mare:ark-disabled:cursor-not-allowed mare:ark-disabled:pointer-events-none
|
|
18
|
+
`, f = "mare:flex mare:items-center mare:shrink-0 mare:[&>svg]:size-5", x = `
|
|
19
|
+
mare:flex mare:items-center mare:h-8 mare:px-3 mare:py-1.5
|
|
20
|
+
mare:text-weak mare:tpc-typography-label-s
|
|
21
|
+
`, g = "mare:border-t mare:border-default mare:my-2";
|
|
22
|
+
function i(e, a) {
|
|
23
|
+
if (a) return a(e);
|
|
24
|
+
const n = e.icon;
|
|
25
|
+
return /* @__PURE__ */ o(u, { children: [
|
|
26
|
+
n ? /* @__PURE__ */ r("span", { className: f, children: n }) : null,
|
|
27
|
+
/* @__PURE__ */ r("span", { children: e.label })
|
|
28
|
+
] });
|
|
29
|
+
}
|
|
30
|
+
function s({
|
|
31
|
+
item: e,
|
|
32
|
+
renderItem: a
|
|
33
|
+
}) {
|
|
34
|
+
const n = b({ active: e.active }), l = e.href;
|
|
35
|
+
return l ? /* @__PURE__ */ r(
|
|
36
|
+
m.Item,
|
|
37
|
+
{
|
|
38
|
+
value: e.value,
|
|
39
|
+
disabled: e.disabled,
|
|
40
|
+
className: n,
|
|
41
|
+
asChild: !0,
|
|
42
|
+
children: /* @__PURE__ */ r(
|
|
43
|
+
"a",
|
|
44
|
+
{
|
|
45
|
+
href: l,
|
|
46
|
+
target: e.target,
|
|
47
|
+
children: i(e, a)
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
) : /* @__PURE__ */ r(
|
|
52
|
+
m.Item,
|
|
53
|
+
{
|
|
54
|
+
value: e.value,
|
|
55
|
+
disabled: e.disabled,
|
|
56
|
+
className: n,
|
|
57
|
+
children: i(e, a)
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
function v({
|
|
62
|
+
entry: e,
|
|
63
|
+
renderItem: a
|
|
64
|
+
}) {
|
|
65
|
+
return e.type === "separator" ? /* @__PURE__ */ r(m.Separator, { className: g }) : e.type === "group" ? /* @__PURE__ */ o(m.ItemGroup, { children: [
|
|
66
|
+
e.label ? /* @__PURE__ */ r(m.ItemGroupLabel, { className: x, children: e.label }) : null,
|
|
67
|
+
e.items.map((n) => /* @__PURE__ */ r(
|
|
68
|
+
s,
|
|
69
|
+
{
|
|
70
|
+
item: n,
|
|
71
|
+
renderItem: a
|
|
72
|
+
},
|
|
73
|
+
n.value
|
|
74
|
+
))
|
|
75
|
+
] }) : /* @__PURE__ */ r(
|
|
76
|
+
s,
|
|
77
|
+
{
|
|
78
|
+
item: e,
|
|
79
|
+
renderItem: a
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
function M({
|
|
84
|
+
trigger: e,
|
|
85
|
+
items: a,
|
|
86
|
+
onSelect: n,
|
|
87
|
+
renderItem: l,
|
|
88
|
+
portalContainer: d
|
|
89
|
+
}) {
|
|
90
|
+
return /* @__PURE__ */ o(m.Root, { onSelect: (t) => n?.(t.value), children: [
|
|
91
|
+
/* @__PURE__ */ r(m.Trigger, { asChild: !0, children: e }),
|
|
92
|
+
/* @__PURE__ */ r(p, { container: d, children: /* @__PURE__ */ r(m.Positioner, { children: /* @__PURE__ */ r(m.Content, { className: h, children: a.map((t, c) => /* @__PURE__ */ r(
|
|
93
|
+
v,
|
|
94
|
+
{
|
|
95
|
+
entry: t,
|
|
96
|
+
renderItem: l
|
|
97
|
+
},
|
|
98
|
+
t.type === "item" || !t.type ? t.value : c
|
|
99
|
+
)) }) }) })
|
|
100
|
+
] });
|
|
101
|
+
}
|
|
102
|
+
export {
|
|
103
|
+
M
|
|
104
|
+
};
|