@dododog/ui 0.11.0 → 0.13.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/chunk-AGNY5DBW.mjs +116 -0
- package/dist/chunk-CRQ4XOCC.mjs +107 -0
- package/dist/chunk-DFC6XK57.js +55 -0
- package/dist/chunk-DUT3ABEI.mjs +108 -0
- package/dist/chunk-G3LZ32WA.js +129 -0
- package/dist/chunk-HB2XJOBZ.js +141 -0
- package/dist/chunk-IKQYFSBW.mjs +33 -0
- package/dist/chunk-IVCQVBOT.mjs +86 -0
- package/dist/chunk-OTHB7MU7.js +108 -0
- package/dist/chunk-OZULAGYL.mjs +1 -0
- package/dist/chunk-SEHALSKW.js +130 -0
- package/dist/chunk-VNURXHKK.js +2 -0
- package/dist/components/ActiveStayCard/index.d.mts +36 -0
- package/dist/components/ActiveStayCard/index.d.ts +36 -0
- package/dist/components/ActiveStayCard/index.js +12 -0
- package/dist/components/ActiveStayCard/index.mjs +3 -0
- package/dist/components/DogAvatar/index.d.mts +37 -0
- package/dist/components/DogAvatar/index.d.ts +37 -0
- package/dist/components/DogAvatar/index.js +24 -0
- package/dist/components/DogAvatar/index.mjs +3 -0
- package/dist/components/ImpactCard/index.d.mts +12 -0
- package/dist/components/ImpactCard/index.d.ts +12 -0
- package/dist/components/ImpactCard/index.js +11 -0
- package/dist/components/ImpactCard/index.mjs +2 -0
- package/dist/components/SearchWidget/index.d.mts +20 -0
- package/dist/components/SearchWidget/index.d.ts +20 -0
- package/dist/components/SearchWidget/index.js +11 -0
- package/dist/components/SearchWidget/index.mjs +2 -0
- package/dist/components/StayListRow/index.d.mts +35 -0
- package/dist/components/StayListRow/index.d.ts +35 -0
- package/dist/components/StayListRow/index.js +12 -0
- package/dist/components/StayListRow/index.mjs +3 -0
- package/dist/index.d.mts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +159 -121
- package/dist/index.mjs +31 -25
- package/package.json +26 -1
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { cn } from './chunk-IMKLN273.mjs';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
function DogGlyph({ size }) {
|
|
6
|
+
return /* @__PURE__ */ jsxs(
|
|
7
|
+
"svg",
|
|
8
|
+
{
|
|
9
|
+
viewBox: "0 0 24 24",
|
|
10
|
+
width: size,
|
|
11
|
+
height: size,
|
|
12
|
+
fill: "none",
|
|
13
|
+
stroke: "#fff",
|
|
14
|
+
strokeWidth: 2.1,
|
|
15
|
+
strokeLinecap: "round",
|
|
16
|
+
strokeLinejoin: "round",
|
|
17
|
+
"aria-hidden": "true",
|
|
18
|
+
style: { width: "58%", height: "58%" },
|
|
19
|
+
children: [
|
|
20
|
+
/* @__PURE__ */ jsx("path", { d: "M10 5.172C10 3.782 8.423 2.679 6.5 3c-2.823.47-4.113 6.006-4 7 .08.703 1.725 1.722 3.656 1 1.261-.472 1.96-1.45 2.344-2.5" }),
|
|
21
|
+
/* @__PURE__ */ jsx("path", { d: "M14.267 5.172c0-1.39 1.577-2.493 3.5-2.172 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5" }),
|
|
22
|
+
/* @__PURE__ */ jsx("path", { d: "M8 14v.5" }),
|
|
23
|
+
/* @__PURE__ */ jsx("path", { d: "M16 14v.5" }),
|
|
24
|
+
/* @__PURE__ */ jsx("path", { d: "M11.25 16.25h1.5L12 17l-.75-.75Z" }),
|
|
25
|
+
/* @__PURE__ */ jsx("path", { d: "M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444c0-1.061-.162-2.2-.493-3.309" })
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
var DOG_AVATAR_COLORS = [
|
|
31
|
+
"#f27c54",
|
|
32
|
+
"#00bfb3",
|
|
33
|
+
"#e0a458",
|
|
34
|
+
"#c96f4a",
|
|
35
|
+
"#7ba05b"
|
|
36
|
+
];
|
|
37
|
+
function dogAvatarColor(name) {
|
|
38
|
+
let hash = 0;
|
|
39
|
+
for (let i = 0; i < name.length; i++) {
|
|
40
|
+
hash = name.charCodeAt(i) + ((hash << 5) - hash);
|
|
41
|
+
}
|
|
42
|
+
return DOG_AVATAR_COLORS[Math.abs(hash) % DOG_AVATAR_COLORS.length];
|
|
43
|
+
}
|
|
44
|
+
var DogAvatar = React.forwardRef(
|
|
45
|
+
({ name, color, size = 46, ringColor, className, style, ...props }, ref) => {
|
|
46
|
+
const bg = color ?? dogAvatarColor(name);
|
|
47
|
+
return /* @__PURE__ */ jsx(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
ref,
|
|
51
|
+
role: "img",
|
|
52
|
+
"aria-label": name,
|
|
53
|
+
className: cn("grid place-items-center rounded-full", className),
|
|
54
|
+
style: {
|
|
55
|
+
width: size,
|
|
56
|
+
height: size,
|
|
57
|
+
background: bg,
|
|
58
|
+
border: ringColor ? `2px solid ${ringColor}` : void 0,
|
|
59
|
+
...style
|
|
60
|
+
},
|
|
61
|
+
...props,
|
|
62
|
+
children: /* @__PURE__ */ jsx(DogGlyph, { size })
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
DogAvatar.displayName = "DogAvatar";
|
|
68
|
+
var DogAvatarStack = React.forwardRef(
|
|
69
|
+
({
|
|
70
|
+
dogs,
|
|
71
|
+
size = 26,
|
|
72
|
+
max = 4,
|
|
73
|
+
overlap = 8,
|
|
74
|
+
ringColor = "#fff",
|
|
75
|
+
className,
|
|
76
|
+
...props
|
|
77
|
+
}, ref) => {
|
|
78
|
+
const shown = dogs.slice(0, max);
|
|
79
|
+
const extra = dogs.length - shown.length;
|
|
80
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: cn("flex items-center", className), ...props, children: [
|
|
81
|
+
shown.map((dog, i) => /* @__PURE__ */ jsx(
|
|
82
|
+
DogAvatar,
|
|
83
|
+
{
|
|
84
|
+
name: dog.name,
|
|
85
|
+
color: dog.color ?? DOG_AVATAR_COLORS[i % DOG_AVATAR_COLORS.length],
|
|
86
|
+
size,
|
|
87
|
+
ringColor,
|
|
88
|
+
style: i > 0 ? { marginLeft: -overlap } : void 0
|
|
89
|
+
},
|
|
90
|
+
`${dog.name}-${i}`
|
|
91
|
+
)),
|
|
92
|
+
extra > 0 && /* @__PURE__ */ jsxs(
|
|
93
|
+
"div",
|
|
94
|
+
{
|
|
95
|
+
className: "grid place-items-center rounded-full font-bold text-text-secondary",
|
|
96
|
+
style: {
|
|
97
|
+
width: size,
|
|
98
|
+
height: size,
|
|
99
|
+
marginLeft: -overlap,
|
|
100
|
+
background: "#f5f0e8",
|
|
101
|
+
border: `2px solid ${ringColor}`,
|
|
102
|
+
fontSize: Math.round(size * 0.4)
|
|
103
|
+
},
|
|
104
|
+
"aria-label": `${extra} de plus`,
|
|
105
|
+
children: [
|
|
106
|
+
"+",
|
|
107
|
+
extra
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
)
|
|
111
|
+
] });
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
DogAvatarStack.displayName = "DogAvatarStack";
|
|
115
|
+
|
|
116
|
+
export { DOG_AVATAR_COLORS, DogAvatar, DogAvatarStack, dogAvatarColor };
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { DogAvatarStack } from './chunk-AGNY5DBW.mjs';
|
|
2
|
+
import { cn } from './chunk-IMKLN273.mjs';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
function MapPinIcon({ size = 15 }) {
|
|
7
|
+
return /* @__PURE__ */ jsxs("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
8
|
+
/* @__PURE__ */ jsx("path", { d: "M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z" }),
|
|
9
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "10", r: "3" })
|
|
10
|
+
] });
|
|
11
|
+
}
|
|
12
|
+
var boxClass = "flex-1 rounded-2xl border border-sand-dark/70 bg-sand-light px-3.5 py-2.5";
|
|
13
|
+
var boxLabelClass = "text-[11px] font-semibold uppercase tracking-[0.04em] text-text-secondary";
|
|
14
|
+
var primaryBtnClass = "flex min-h-[44px] flex-1 items-center justify-center gap-2 rounded-full bg-secondary px-4 py-3 text-sm font-semibold text-white shadow-[0_8px_18px_-8px_rgba(242,124,84,0.7)] transition-colors hover:bg-secondary-dark focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2";
|
|
15
|
+
var ActiveStayCard = React.forwardRef(
|
|
16
|
+
({
|
|
17
|
+
statusLabel = "S\xE9jour en cours",
|
|
18
|
+
petBadge,
|
|
19
|
+
hotelName,
|
|
20
|
+
location,
|
|
21
|
+
priceLabel,
|
|
22
|
+
priceNote,
|
|
23
|
+
checkinLabel,
|
|
24
|
+
checkoutLabel,
|
|
25
|
+
countdownLabel,
|
|
26
|
+
dogs = [],
|
|
27
|
+
imageUrl,
|
|
28
|
+
primaryActionLabel = "Voir la r\xE9servation",
|
|
29
|
+
primaryActionHref,
|
|
30
|
+
secondaryActions,
|
|
31
|
+
renderImage,
|
|
32
|
+
renderLink,
|
|
33
|
+
className,
|
|
34
|
+
...props
|
|
35
|
+
}, ref) => {
|
|
36
|
+
const primaryBtn = primaryActionHref ? renderLink ? renderLink({
|
|
37
|
+
href: primaryActionHref,
|
|
38
|
+
className: primaryBtnClass,
|
|
39
|
+
children: primaryActionLabel
|
|
40
|
+
}) : /* @__PURE__ */ jsx("a", { href: primaryActionHref, className: primaryBtnClass, children: primaryActionLabel }) : /* @__PURE__ */ jsx("button", { type: "button", className: primaryBtnClass, children: primaryActionLabel });
|
|
41
|
+
return /* @__PURE__ */ jsxs(
|
|
42
|
+
"section",
|
|
43
|
+
{
|
|
44
|
+
ref,
|
|
45
|
+
"aria-label": statusLabel,
|
|
46
|
+
className: cn(
|
|
47
|
+
"overflow-hidden rounded-[22px] border border-sand-dark bg-white shadow-[0_14px_30px_-16px_rgba(29,34,48,0.3)] md:rounded-3xl",
|
|
48
|
+
className
|
|
49
|
+
),
|
|
50
|
+
...props,
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ jsxs("div", { className: "relative h-[150px] md:h-[200px]", children: [
|
|
53
|
+
imageUrl ? renderImage ? renderImage({ src: imageUrl, alt: hotelName, className: "h-full w-full object-cover" }) : /* @__PURE__ */ jsx("img", { src: imageUrl, alt: hotelName, className: "h-full w-full object-cover" }) : /* @__PURE__ */ jsx("div", { className: "h-full w-full bg-gradient-to-br from-accent-light to-accent-dark" }),
|
|
54
|
+
/* @__PURE__ */ jsxs("span", { className: "absolute left-3.5 top-3.5 inline-flex items-center gap-1.5 rounded-full bg-white px-3 py-1.5 text-[11.5px] font-bold text-accent-dark md:text-xs", children: [
|
|
55
|
+
/* @__PURE__ */ jsx("span", { className: "h-1.5 w-1.5 animate-pulse rounded-full bg-accent" }),
|
|
56
|
+
statusLabel
|
|
57
|
+
] }),
|
|
58
|
+
petBadge && /* @__PURE__ */ jsx("span", { className: "absolute right-3.5 top-3.5 rounded-full bg-white/90 px-3 py-1.5 text-[11.5px] font-bold text-accent-dark backdrop-blur-sm md:text-xs", children: petBadge })
|
|
59
|
+
] }),
|
|
60
|
+
/* @__PURE__ */ jsxs("div", { className: "p-[18px] md:p-[22px]", children: [
|
|
61
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-4", children: [
|
|
62
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
|
|
63
|
+
/* @__PURE__ */ jsx("h2", { className: "font-heading text-xl font-bold leading-[1.15] text-primary md:text-2xl", children: hotelName }),
|
|
64
|
+
location && /* @__PURE__ */ jsxs("p", { className: "mt-1.5 inline-flex items-center gap-1.5 text-[13px] text-text-secondary md:text-sm", children: [
|
|
65
|
+
/* @__PURE__ */ jsx(MapPinIcon, {}),
|
|
66
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: location })
|
|
67
|
+
] })
|
|
68
|
+
] }),
|
|
69
|
+
priceLabel && /* @__PURE__ */ jsxs("div", { className: "shrink-0 text-right", children: [
|
|
70
|
+
/* @__PURE__ */ jsx("div", { className: "font-heading text-lg font-bold text-primary md:text-[22px]", children: priceLabel }),
|
|
71
|
+
priceNote && /* @__PURE__ */ jsx("div", { className: "text-[11px] text-text-secondary md:text-xs", children: priceNote })
|
|
72
|
+
] })
|
|
73
|
+
] }),
|
|
74
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-3.5 flex items-center justify-between rounded-2xl border border-sand-dark/70 bg-sand-light px-3.5 py-2.5 md:hidden", children: [
|
|
75
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
76
|
+
/* @__PURE__ */ jsx("div", { className: boxLabelClass, children: "D\xE9part dans" }),
|
|
77
|
+
/* @__PURE__ */ jsx("div", { className: "mt-0.5 text-[14.5px] font-bold text-primary", children: countdownLabel ?? `${checkinLabel} \u2192 ${checkoutLabel}` })
|
|
78
|
+
] }),
|
|
79
|
+
dogs.length > 0 && /* @__PURE__ */ jsx(DogAvatarStack, { dogs, size: 26, ringColor: "#faf7f2" })
|
|
80
|
+
] }),
|
|
81
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-4 hidden gap-2.5 md:flex", children: [
|
|
82
|
+
/* @__PURE__ */ jsxs("div", { className: boxClass, children: [
|
|
83
|
+
/* @__PURE__ */ jsx("div", { className: boxLabelClass, children: "Arriv\xE9e" }),
|
|
84
|
+
/* @__PURE__ */ jsx("div", { className: "mt-0.5 text-[14.5px] font-semibold text-primary", children: checkinLabel })
|
|
85
|
+
] }),
|
|
86
|
+
/* @__PURE__ */ jsxs("div", { className: boxClass, children: [
|
|
87
|
+
/* @__PURE__ */ jsx("div", { className: boxLabelClass, children: "D\xE9part" }),
|
|
88
|
+
/* @__PURE__ */ jsx("div", { className: "mt-0.5 text-[14.5px] font-semibold text-primary", children: checkoutLabel })
|
|
89
|
+
] }),
|
|
90
|
+
/* @__PURE__ */ jsxs("div", { className: boxClass, children: [
|
|
91
|
+
/* @__PURE__ */ jsx("div", { className: boxLabelClass, children: "Chiens" }),
|
|
92
|
+
/* @__PURE__ */ jsx("div", { className: "mt-1", children: dogs.length > 0 ? /* @__PURE__ */ jsx(DogAvatarStack, { dogs, size: 22, overlap: 0, className: "gap-1", ringColor: "transparent" }) : /* @__PURE__ */ jsx("span", { className: "text-[13px] text-text-secondary", children: "\u2014" }) })
|
|
93
|
+
] })
|
|
94
|
+
] }),
|
|
95
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-4 flex gap-2.5", children: [
|
|
96
|
+
primaryBtn,
|
|
97
|
+
secondaryActions && /* @__PURE__ */ jsx("div", { className: "hidden gap-2.5 md:flex", children: secondaryActions })
|
|
98
|
+
] })
|
|
99
|
+
] })
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
ActiveStayCard.displayName = "ActiveStayCard";
|
|
106
|
+
|
|
107
|
+
export { ActiveStayCard };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkADIDI7AJ_js = require('./chunk-ADIDI7AJ.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n.default = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
|
+
|
|
27
|
+
function HeartIcon() {
|
|
28
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "#f5a083", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.29 1.51 4.04 3 5.5l7 7Z" }) });
|
|
29
|
+
}
|
|
30
|
+
var ImpactCard = React__namespace.forwardRef(
|
|
31
|
+
({ badgeLabel = "Voyage engag\xE9", amountLabel, description, className, ...props }, ref) => {
|
|
32
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
ref,
|
|
36
|
+
className: chunkADIDI7AJ_js.cn(
|
|
37
|
+
"rounded-[22px] bg-primary p-5 text-white shadow-[0_10px_26px_-14px_rgba(29,34,48,0.5)]",
|
|
38
|
+
className
|
|
39
|
+
),
|
|
40
|
+
...props,
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "inline-flex items-center gap-1.5 rounded-full bg-white/[0.12] px-2.5 py-1 text-[11px] font-semibold text-[#ffd9c6]", children: [
|
|
43
|
+
/* @__PURE__ */ jsxRuntime.jsx(HeartIcon, {}),
|
|
44
|
+
badgeLabel
|
|
45
|
+
] }),
|
|
46
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3 font-heading text-[26px] font-bold", children: amountLabel }),
|
|
47
|
+
description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-[12.5px] leading-[1.45] text-white/70", children: description })
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
ImpactCard.displayName = "ImpactCard";
|
|
54
|
+
|
|
55
|
+
exports.ImpactCard = ImpactCard;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { cn } from './chunk-IMKLN273.mjs';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
function PinIcon() {
|
|
6
|
+
return /* @__PURE__ */ jsxs("svg", { width: "17", height: "17", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
7
|
+
/* @__PURE__ */ jsx("path", { d: "M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z" }),
|
|
8
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "10", r: "3" })
|
|
9
|
+
] });
|
|
10
|
+
}
|
|
11
|
+
function CalendarIcon() {
|
|
12
|
+
return /* @__PURE__ */ jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
13
|
+
/* @__PURE__ */ jsx("path", { d: "M8 2v4" }),
|
|
14
|
+
/* @__PURE__ */ jsx("path", { d: "M16 2v4" }),
|
|
15
|
+
/* @__PURE__ */ jsx("rect", { width: "18", height: "18", x: "3", y: "4", rx: "2" }),
|
|
16
|
+
/* @__PURE__ */ jsx("path", { d: "M3 10h18" })
|
|
17
|
+
] });
|
|
18
|
+
}
|
|
19
|
+
function DogIcon() {
|
|
20
|
+
return /* @__PURE__ */ jsxs("svg", { width: "17", height: "17", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
21
|
+
/* @__PURE__ */ jsx("path", { d: "M10 5.172C10 3.782 8.423 2.679 6.5 3c-2.823.47-4.113 6.006-4 7 .08.703 1.725 1.722 3.656 1 1.261-.472 1.96-1.45 2.344-2.5" }),
|
|
22
|
+
/* @__PURE__ */ jsx("path", { d: "M14.267 5.172c0-1.39 1.577-2.493 3.5-2.172 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5" }),
|
|
23
|
+
/* @__PURE__ */ jsx("path", { d: "M8 14v.5" }),
|
|
24
|
+
/* @__PURE__ */ jsx("path", { d: "M16 14v.5" }),
|
|
25
|
+
/* @__PURE__ */ jsx("path", { d: "M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444c0-1.061-.162-2.2-.493-3.309" })
|
|
26
|
+
] });
|
|
27
|
+
}
|
|
28
|
+
function ChevronDownIcon() {
|
|
29
|
+
return /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "m6 9 6 6 6-6" }) });
|
|
30
|
+
}
|
|
31
|
+
function SearchIcon() {
|
|
32
|
+
return /* @__PURE__ */ jsxs("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": "true", children: [
|
|
33
|
+
/* @__PURE__ */ jsx("circle", { cx: "11", cy: "11", r: "7" }),
|
|
34
|
+
/* @__PURE__ */ jsx("path", { d: "m21 21-4.3-4.3" })
|
|
35
|
+
] });
|
|
36
|
+
}
|
|
37
|
+
var fieldClass = "flex items-center gap-2.5 rounded-[14px] border border-sand-dark/70 bg-sand-light px-3.5 py-3";
|
|
38
|
+
var fieldLabelClass = "text-[10px] font-semibold uppercase tracking-[0.04em] text-text-secondary";
|
|
39
|
+
var fieldValueClass = "text-sm font-medium text-primary";
|
|
40
|
+
var SearchWidget = React.forwardRef(
|
|
41
|
+
({
|
|
42
|
+
title = "Trouver un s\xE9jour",
|
|
43
|
+
destination = "O\xF9 partez-vous ?",
|
|
44
|
+
arrivalLabel = "Ajouter",
|
|
45
|
+
departureLabel = "Ajouter",
|
|
46
|
+
travelersLabel = "2 adultes \xB7 2 chiens",
|
|
47
|
+
actionLabel = "Rechercher",
|
|
48
|
+
href = "/search",
|
|
49
|
+
renderLink,
|
|
50
|
+
className,
|
|
51
|
+
...props
|
|
52
|
+
}, ref) => {
|
|
53
|
+
const btnClass = "flex min-h-[44px] w-full items-center justify-center gap-2 rounded-full bg-secondary px-4 py-3 text-sm font-semibold text-white shadow-[0_8px_18px_-8px_rgba(242,124,84,0.7)] transition-colors hover:bg-secondary-dark focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2";
|
|
54
|
+
const btnChildren = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
55
|
+
/* @__PURE__ */ jsx(SearchIcon, {}),
|
|
56
|
+
actionLabel
|
|
57
|
+
] });
|
|
58
|
+
return /* @__PURE__ */ jsxs(
|
|
59
|
+
"div",
|
|
60
|
+
{
|
|
61
|
+
ref,
|
|
62
|
+
className: cn(
|
|
63
|
+
"rounded-[22px] border border-sand-dark bg-white p-[18px] shadow-[0_8px_22px_-14px_rgba(29,34,48,0.22)] md:p-5",
|
|
64
|
+
className
|
|
65
|
+
),
|
|
66
|
+
...props,
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ jsx("h4", { className: "mb-3.5 font-heading text-base font-bold text-primary", children: title }),
|
|
69
|
+
/* @__PURE__ */ jsxs("div", { className: cn(fieldClass, "mb-2.5"), children: [
|
|
70
|
+
/* @__PURE__ */ jsx("span", { className: "text-secondary", children: /* @__PURE__ */ jsx(PinIcon, {}) }),
|
|
71
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
72
|
+
/* @__PURE__ */ jsx("div", { className: fieldLabelClass, children: "Destination" }),
|
|
73
|
+
/* @__PURE__ */ jsx("div", { className: fieldValueClass, children: destination })
|
|
74
|
+
] })
|
|
75
|
+
] }),
|
|
76
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-2.5 flex gap-2.5", children: [
|
|
77
|
+
/* @__PURE__ */ jsx("div", { className: cn(fieldClass, "flex-1"), children: /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
78
|
+
/* @__PURE__ */ jsx("div", { className: fieldLabelClass, children: "Arriv\xE9e" }),
|
|
79
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-0.5 flex items-center gap-1.5 text-text-secondary", children: [
|
|
80
|
+
/* @__PURE__ */ jsx(CalendarIcon, {}),
|
|
81
|
+
/* @__PURE__ */ jsx("span", { className: "text-[13px] font-medium text-primary", children: arrivalLabel })
|
|
82
|
+
] })
|
|
83
|
+
] }) }),
|
|
84
|
+
/* @__PURE__ */ jsx("div", { className: cn(fieldClass, "flex-1"), children: /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
85
|
+
/* @__PURE__ */ jsx("div", { className: fieldLabelClass, children: "D\xE9part" }),
|
|
86
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-0.5 flex items-center gap-1.5 text-text-secondary", children: [
|
|
87
|
+
/* @__PURE__ */ jsx(CalendarIcon, {}),
|
|
88
|
+
/* @__PURE__ */ jsx("span", { className: "text-[13px] font-medium text-primary", children: departureLabel })
|
|
89
|
+
] })
|
|
90
|
+
] }) })
|
|
91
|
+
] }),
|
|
92
|
+
/* @__PURE__ */ jsxs("div", { className: cn(fieldClass, "mb-3.5"), children: [
|
|
93
|
+
/* @__PURE__ */ jsx("span", { className: "text-accent", children: /* @__PURE__ */ jsx(DogIcon, {}) }),
|
|
94
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
|
|
95
|
+
/* @__PURE__ */ jsx("div", { className: fieldLabelClass, children: "Voyageurs" }),
|
|
96
|
+
/* @__PURE__ */ jsx("div", { className: fieldValueClass, children: travelersLabel })
|
|
97
|
+
] }),
|
|
98
|
+
/* @__PURE__ */ jsx("span", { className: "text-text-secondary", children: /* @__PURE__ */ jsx(ChevronDownIcon, {}) })
|
|
99
|
+
] }),
|
|
100
|
+
renderLink ? renderLink({ href, className: btnClass, children: btnChildren }) : /* @__PURE__ */ jsx("a", { href, className: btnClass, children: btnChildren })
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
SearchWidget.displayName = "SearchWidget";
|
|
107
|
+
|
|
108
|
+
export { SearchWidget };
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkHB2XJOBZ_js = require('./chunk-HB2XJOBZ.js');
|
|
4
|
+
var chunkADIDI7AJ_js = require('./chunk-ADIDI7AJ.js');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
|
|
8
|
+
function _interopNamespace(e) {
|
|
9
|
+
if (e && e.__esModule) return e;
|
|
10
|
+
var n = Object.create(null);
|
|
11
|
+
if (e) {
|
|
12
|
+
Object.keys(e).forEach(function (k) {
|
|
13
|
+
if (k !== 'default') {
|
|
14
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return e[k]; }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
n.default = e;
|
|
23
|
+
return Object.freeze(n);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
27
|
+
|
|
28
|
+
function MapPinIcon({ size = 15 }) {
|
|
29
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
30
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z" }),
|
|
31
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "10", r: "3" })
|
|
32
|
+
] });
|
|
33
|
+
}
|
|
34
|
+
var boxClass = "flex-1 rounded-2xl border border-sand-dark/70 bg-sand-light px-3.5 py-2.5";
|
|
35
|
+
var boxLabelClass = "text-[11px] font-semibold uppercase tracking-[0.04em] text-text-secondary";
|
|
36
|
+
var primaryBtnClass = "flex min-h-[44px] flex-1 items-center justify-center gap-2 rounded-full bg-secondary px-4 py-3 text-sm font-semibold text-white shadow-[0_8px_18px_-8px_rgba(242,124,84,0.7)] transition-colors hover:bg-secondary-dark focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2";
|
|
37
|
+
var ActiveStayCard = React__namespace.forwardRef(
|
|
38
|
+
({
|
|
39
|
+
statusLabel = "S\xE9jour en cours",
|
|
40
|
+
petBadge,
|
|
41
|
+
hotelName,
|
|
42
|
+
location,
|
|
43
|
+
priceLabel,
|
|
44
|
+
priceNote,
|
|
45
|
+
checkinLabel,
|
|
46
|
+
checkoutLabel,
|
|
47
|
+
countdownLabel,
|
|
48
|
+
dogs = [],
|
|
49
|
+
imageUrl,
|
|
50
|
+
primaryActionLabel = "Voir la r\xE9servation",
|
|
51
|
+
primaryActionHref,
|
|
52
|
+
secondaryActions,
|
|
53
|
+
renderImage,
|
|
54
|
+
renderLink,
|
|
55
|
+
className,
|
|
56
|
+
...props
|
|
57
|
+
}, ref) => {
|
|
58
|
+
const primaryBtn = primaryActionHref ? renderLink ? renderLink({
|
|
59
|
+
href: primaryActionHref,
|
|
60
|
+
className: primaryBtnClass,
|
|
61
|
+
children: primaryActionLabel
|
|
62
|
+
}) : /* @__PURE__ */ jsxRuntime.jsx("a", { href: primaryActionHref, className: primaryBtnClass, children: primaryActionLabel }) : /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: primaryBtnClass, children: primaryActionLabel });
|
|
63
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
64
|
+
"section",
|
|
65
|
+
{
|
|
66
|
+
ref,
|
|
67
|
+
"aria-label": statusLabel,
|
|
68
|
+
className: chunkADIDI7AJ_js.cn(
|
|
69
|
+
"overflow-hidden rounded-[22px] border border-sand-dark bg-white shadow-[0_14px_30px_-16px_rgba(29,34,48,0.3)] md:rounded-3xl",
|
|
70
|
+
className
|
|
71
|
+
),
|
|
72
|
+
...props,
|
|
73
|
+
children: [
|
|
74
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative h-[150px] md:h-[200px]", children: [
|
|
75
|
+
imageUrl ? renderImage ? renderImage({ src: imageUrl, alt: hotelName, className: "h-full w-full object-cover" }) : /* @__PURE__ */ jsxRuntime.jsx("img", { src: imageUrl, alt: hotelName, className: "h-full w-full object-cover" }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-full w-full bg-gradient-to-br from-accent-light to-accent-dark" }),
|
|
76
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "absolute left-3.5 top-3.5 inline-flex items-center gap-1.5 rounded-full bg-white px-3 py-1.5 text-[11.5px] font-bold text-accent-dark md:text-xs", children: [
|
|
77
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "h-1.5 w-1.5 animate-pulse rounded-full bg-accent" }),
|
|
78
|
+
statusLabel
|
|
79
|
+
] }),
|
|
80
|
+
petBadge && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute right-3.5 top-3.5 rounded-full bg-white/90 px-3 py-1.5 text-[11.5px] font-bold text-accent-dark backdrop-blur-sm md:text-xs", children: petBadge })
|
|
81
|
+
] }),
|
|
82
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-[18px] md:p-[22px]", children: [
|
|
83
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-4", children: [
|
|
84
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
|
|
85
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "font-heading text-xl font-bold leading-[1.15] text-primary md:text-2xl", children: hotelName }),
|
|
86
|
+
location && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "mt-1.5 inline-flex items-center gap-1.5 text-[13px] text-text-secondary md:text-sm", children: [
|
|
87
|
+
/* @__PURE__ */ jsxRuntime.jsx(MapPinIcon, {}),
|
|
88
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: location })
|
|
89
|
+
] })
|
|
90
|
+
] }),
|
|
91
|
+
priceLabel && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "shrink-0 text-right", children: [
|
|
92
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-heading text-lg font-bold text-primary md:text-[22px]", children: priceLabel }),
|
|
93
|
+
priceNote && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[11px] text-text-secondary md:text-xs", children: priceNote })
|
|
94
|
+
] })
|
|
95
|
+
] }),
|
|
96
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-3.5 flex items-center justify-between rounded-2xl border border-sand-dark/70 bg-sand-light px-3.5 py-2.5 md:hidden", children: [
|
|
97
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
98
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: boxLabelClass, children: "D\xE9part dans" }),
|
|
99
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-0.5 text-[14.5px] font-bold text-primary", children: countdownLabel ?? `${checkinLabel} \u2192 ${checkoutLabel}` })
|
|
100
|
+
] }),
|
|
101
|
+
dogs.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(chunkHB2XJOBZ_js.DogAvatarStack, { dogs, size: 26, ringColor: "#faf7f2" })
|
|
102
|
+
] }),
|
|
103
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-4 hidden gap-2.5 md:flex", children: [
|
|
104
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: boxClass, children: [
|
|
105
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: boxLabelClass, children: "Arriv\xE9e" }),
|
|
106
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-0.5 text-[14.5px] font-semibold text-primary", children: checkinLabel })
|
|
107
|
+
] }),
|
|
108
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: boxClass, children: [
|
|
109
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: boxLabelClass, children: "D\xE9part" }),
|
|
110
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-0.5 text-[14.5px] font-semibold text-primary", children: checkoutLabel })
|
|
111
|
+
] }),
|
|
112
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: boxClass, children: [
|
|
113
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: boxLabelClass, children: "Chiens" }),
|
|
114
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1", children: dogs.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(chunkHB2XJOBZ_js.DogAvatarStack, { dogs, size: 22, overlap: 0, className: "gap-1", ringColor: "transparent" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[13px] text-text-secondary", children: "\u2014" }) })
|
|
115
|
+
] })
|
|
116
|
+
] }),
|
|
117
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-4 flex gap-2.5", children: [
|
|
118
|
+
primaryBtn,
|
|
119
|
+
secondaryActions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "hidden gap-2.5 md:flex", children: secondaryActions })
|
|
120
|
+
] })
|
|
121
|
+
] })
|
|
122
|
+
]
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
ActiveStayCard.displayName = "ActiveStayCard";
|
|
128
|
+
|
|
129
|
+
exports.ActiveStayCard = ActiveStayCard;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkADIDI7AJ_js = require('./chunk-ADIDI7AJ.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n.default = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
|
+
|
|
27
|
+
function DogGlyph({ size }) {
|
|
28
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
29
|
+
"svg",
|
|
30
|
+
{
|
|
31
|
+
viewBox: "0 0 24 24",
|
|
32
|
+
width: size,
|
|
33
|
+
height: size,
|
|
34
|
+
fill: "none",
|
|
35
|
+
stroke: "#fff",
|
|
36
|
+
strokeWidth: 2.1,
|
|
37
|
+
strokeLinecap: "round",
|
|
38
|
+
strokeLinejoin: "round",
|
|
39
|
+
"aria-hidden": "true",
|
|
40
|
+
style: { width: "58%", height: "58%" },
|
|
41
|
+
children: [
|
|
42
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 5.172C10 3.782 8.423 2.679 6.5 3c-2.823.47-4.113 6.006-4 7 .08.703 1.725 1.722 3.656 1 1.261-.472 1.96-1.45 2.344-2.5" }),
|
|
43
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M14.267 5.172c0-1.39 1.577-2.493 3.5-2.172 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5" }),
|
|
44
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 14v.5" }),
|
|
45
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16 14v.5" }),
|
|
46
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M11.25 16.25h1.5L12 17l-.75-.75Z" }),
|
|
47
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444c0-1.061-.162-2.2-.493-3.309" })
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
var DOG_AVATAR_COLORS = [
|
|
53
|
+
"#f27c54",
|
|
54
|
+
"#00bfb3",
|
|
55
|
+
"#e0a458",
|
|
56
|
+
"#c96f4a",
|
|
57
|
+
"#7ba05b"
|
|
58
|
+
];
|
|
59
|
+
function dogAvatarColor(name) {
|
|
60
|
+
let hash = 0;
|
|
61
|
+
for (let i = 0; i < name.length; i++) {
|
|
62
|
+
hash = name.charCodeAt(i) + ((hash << 5) - hash);
|
|
63
|
+
}
|
|
64
|
+
return DOG_AVATAR_COLORS[Math.abs(hash) % DOG_AVATAR_COLORS.length];
|
|
65
|
+
}
|
|
66
|
+
var DogAvatar = React__namespace.forwardRef(
|
|
67
|
+
({ name, color, size = 46, ringColor, className, style, ...props }, ref) => {
|
|
68
|
+
const bg = color ?? dogAvatarColor(name);
|
|
69
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
ref,
|
|
73
|
+
role: "img",
|
|
74
|
+
"aria-label": name,
|
|
75
|
+
className: chunkADIDI7AJ_js.cn("grid place-items-center rounded-full", className),
|
|
76
|
+
style: {
|
|
77
|
+
width: size,
|
|
78
|
+
height: size,
|
|
79
|
+
background: bg,
|
|
80
|
+
border: ringColor ? `2px solid ${ringColor}` : void 0,
|
|
81
|
+
...style
|
|
82
|
+
},
|
|
83
|
+
...props,
|
|
84
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(DogGlyph, { size })
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
DogAvatar.displayName = "DogAvatar";
|
|
90
|
+
var DogAvatarStack = React__namespace.forwardRef(
|
|
91
|
+
({
|
|
92
|
+
dogs,
|
|
93
|
+
size = 26,
|
|
94
|
+
max = 4,
|
|
95
|
+
overlap = 8,
|
|
96
|
+
ringColor = "#fff",
|
|
97
|
+
className,
|
|
98
|
+
...props
|
|
99
|
+
}, ref) => {
|
|
100
|
+
const shown = dogs.slice(0, max);
|
|
101
|
+
const extra = dogs.length - shown.length;
|
|
102
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: chunkADIDI7AJ_js.cn("flex items-center", className), ...props, children: [
|
|
103
|
+
shown.map((dog, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
104
|
+
DogAvatar,
|
|
105
|
+
{
|
|
106
|
+
name: dog.name,
|
|
107
|
+
color: dog.color ?? DOG_AVATAR_COLORS[i % DOG_AVATAR_COLORS.length],
|
|
108
|
+
size,
|
|
109
|
+
ringColor,
|
|
110
|
+
style: i > 0 ? { marginLeft: -overlap } : void 0
|
|
111
|
+
},
|
|
112
|
+
`${dog.name}-${i}`
|
|
113
|
+
)),
|
|
114
|
+
extra > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
115
|
+
"div",
|
|
116
|
+
{
|
|
117
|
+
className: "grid place-items-center rounded-full font-bold text-text-secondary",
|
|
118
|
+
style: {
|
|
119
|
+
width: size,
|
|
120
|
+
height: size,
|
|
121
|
+
marginLeft: -overlap,
|
|
122
|
+
background: "#f5f0e8",
|
|
123
|
+
border: `2px solid ${ringColor}`,
|
|
124
|
+
fontSize: Math.round(size * 0.4)
|
|
125
|
+
},
|
|
126
|
+
"aria-label": `${extra} de plus`,
|
|
127
|
+
children: [
|
|
128
|
+
"+",
|
|
129
|
+
extra
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
)
|
|
133
|
+
] });
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
DogAvatarStack.displayName = "DogAvatarStack";
|
|
137
|
+
|
|
138
|
+
exports.DOG_AVATAR_COLORS = DOG_AVATAR_COLORS;
|
|
139
|
+
exports.DogAvatar = DogAvatar;
|
|
140
|
+
exports.DogAvatarStack = DogAvatarStack;
|
|
141
|
+
exports.dogAvatarColor = dogAvatarColor;
|