@athbnb/ui 0.0.2 → 0.0.3
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/index.js +22 -4322
- package/dist/ui/Accordion.js +255 -0
- package/dist/ui/BookingDetailsCard.js +122 -0
- package/dist/ui/Breadcrumbs.js +83 -0
- package/dist/ui/Button.js +66 -0
- package/dist/ui/Card.js +155 -0
- package/dist/ui/CongratulationsBox.js +77 -0
- package/dist/ui/DatePicker.js +650 -0
- package/dist/ui/Dropdown.js +609 -0
- package/dist/ui/GoogleMap.js +26 -0
- package/dist/ui/ImagePreviewModal.js +120 -0
- package/dist/ui/List.js +56 -0
- package/dist/ui/Loader.js +115 -0
- package/dist/ui/Modal.js +53 -0
- package/dist/ui/ProgressBar.js +167 -0
- package/dist/ui/SearchBar.js +631 -0
- package/dist/ui/Slider.js +232 -0
- package/dist/ui/Tabs.js +70 -0
- package/dist/ui/TextInput.js +538 -0
- package/dist/ui/TimePicker.js +231 -0
- package/dist/ui/Toast.js +18 -0
- package/dist/ui/Tooltip.js +30 -0
- package/dist/utils/date-picker-utils.js +81 -0
- package/package.json +25 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { c as e } from "react/compiler-runtime";
|
|
2
|
+
import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect as i, useState as a } from "react";
|
|
4
|
+
//#region src/ui/CongratulationsBox.tsx
|
|
5
|
+
function o(t) {
|
|
6
|
+
let i = e(4), { className: a } = t, o, s;
|
|
7
|
+
i[0] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ n("circle", {
|
|
8
|
+
cx: "40",
|
|
9
|
+
cy: "40",
|
|
10
|
+
r: "38",
|
|
11
|
+
className: "fill-primary",
|
|
12
|
+
stroke: "currentColor",
|
|
13
|
+
strokeWidth: "2"
|
|
14
|
+
}), s = /* @__PURE__ */ n("path", {
|
|
15
|
+
className: "stroke-white",
|
|
16
|
+
strokeWidth: "4",
|
|
17
|
+
strokeLinecap: "round",
|
|
18
|
+
strokeLinejoin: "round",
|
|
19
|
+
d: "M24 40l11 11 21-22"
|
|
20
|
+
}), i[0] = o, i[1] = s) : (o = i[0], s = i[1]);
|
|
21
|
+
let c;
|
|
22
|
+
return i[2] === a ? c = i[3] : (c = /* @__PURE__ */ r("svg", {
|
|
23
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
24
|
+
viewBox: "0 0 80 80",
|
|
25
|
+
fill: "none",
|
|
26
|
+
className: a,
|
|
27
|
+
"aria-hidden": !0,
|
|
28
|
+
children: [o, s]
|
|
29
|
+
}), i[2] = a, i[3] = c), c;
|
|
30
|
+
}
|
|
31
|
+
function s({ title: e = "Congratulations!", message: s = /* @__PURE__ */ n(t, { children: "Your Profile is now \"Verified\"." }), durationMs: c = 3e3, tickMs: l = 50, onComplete: u, className: d = "" }) {
|
|
32
|
+
let [f, p] = a(0), [m, h] = a(!0);
|
|
33
|
+
return i(() => {
|
|
34
|
+
if (c <= 0) return;
|
|
35
|
+
let e = 100 / c * l, t = window.setInterval(() => {
|
|
36
|
+
p((n) => {
|
|
37
|
+
let r = n + e;
|
|
38
|
+
return r >= 100 ? (window.clearInterval(t), window.setTimeout(() => {
|
|
39
|
+
h(!1), u?.();
|
|
40
|
+
}, 100), 100) : r;
|
|
41
|
+
});
|
|
42
|
+
}, l);
|
|
43
|
+
return () => window.clearInterval(t);
|
|
44
|
+
}, [
|
|
45
|
+
c,
|
|
46
|
+
l,
|
|
47
|
+
u
|
|
48
|
+
]), m ? /* @__PURE__ */ n("div", {
|
|
49
|
+
className: `mx-auto w-full max-w-lg py-8 sm:max-w-xl md:max-w-2xl ${d}`.trim(),
|
|
50
|
+
children: /* @__PURE__ */ r("div", {
|
|
51
|
+
className: "relative mt-8 flex w-full flex-col gap-4 rounded-primary p-4 shadow-primary sm:gap-8 sm:p-8 lg:p-12",
|
|
52
|
+
children: [
|
|
53
|
+
c > 0 ? /* @__PURE__ */ n("div", {
|
|
54
|
+
className: "absolute top-0 left-0 flex w-full justify-start",
|
|
55
|
+
children: /* @__PURE__ */ n("div", {
|
|
56
|
+
className: "h-2 rounded-primary bg-primary transition-all duration-100 ease-linear",
|
|
57
|
+
style: { width: `${f}%` }
|
|
58
|
+
})
|
|
59
|
+
}) : null,
|
|
60
|
+
/* @__PURE__ */ n("div", {
|
|
61
|
+
className: "flex justify-center rounded-full",
|
|
62
|
+
children: /* @__PURE__ */ n(o, { className: "h-16 w-16 text-primary lg:h-24 lg:w-24" })
|
|
63
|
+
}),
|
|
64
|
+
/* @__PURE__ */ n("h1", {
|
|
65
|
+
className: "text-center text-2xl font-bold text-primary sm:text-3xl lg:text-5xl",
|
|
66
|
+
children: e
|
|
67
|
+
}),
|
|
68
|
+
/* @__PURE__ */ n("p", {
|
|
69
|
+
className: "text-center text-base font-bold text-secondary sm:text-lg lg:text-2xl",
|
|
70
|
+
children: s
|
|
71
|
+
})
|
|
72
|
+
]
|
|
73
|
+
})
|
|
74
|
+
}) : null;
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
77
|
+
export { s as CongratulationsBox };
|