@dododog/ui 0.9.2 → 0.10.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.
@@ -0,0 +1,189 @@
1
+ import { cn } from './chunk-IMKLN273.mjs';
2
+ import * as React from 'react';
3
+ import { jsx, jsxs } from 'react/jsx-runtime';
4
+
5
+ var DEFAULT_STEPS = [
6
+ { id: "analyse", label: "Analyse de votre recherche" },
7
+ { id: "destination", label: "Exploration de la destination" },
8
+ { id: "selection", label: "S\xE9lection des h\xE9bergements dog-friendly" },
9
+ { id: "finalisation", label: "Finalisation des r\xE9sultats" }
10
+ ];
11
+ var DEFAULT_TITLE = "Pr\xE9paration des r\xE9sultats de votre recherche";
12
+ function DogIcon({ className }) {
13
+ return /* @__PURE__ */ jsxs(
14
+ "svg",
15
+ {
16
+ xmlns: "http://www.w3.org/2000/svg",
17
+ viewBox: "0 0 24 24",
18
+ fill: "none",
19
+ stroke: "currentColor",
20
+ strokeWidth: "2",
21
+ strokeLinecap: "round",
22
+ strokeLinejoin: "round",
23
+ className,
24
+ "aria-hidden": "true",
25
+ children: [
26
+ /* @__PURE__ */ jsx("path", { d: "M11.25 16.25h1.5L12 17z" }),
27
+ /* @__PURE__ */ jsx("path", { d: "M16 14v.5" }),
28
+ /* @__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.444a11.702 11.702 0 0 0-.493-3.309" }),
29
+ /* @__PURE__ */ jsx("path", { d: "M8 14v.5" }),
30
+ /* @__PURE__ */ jsx("path", { d: "M8.5 8.5c-.384 1.05-1.083 2.028-2.344 2.5-1.931.722-3.576-.297-3.656-1-.113-.994 1.177-6.53 4-7 1.923-.321 3.651.845 3.651 2.235A7.497 7.497 0 0 1 14 5.277c0-1.39 1.844-2.598 3.767-2.277 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" })
31
+ ]
32
+ }
33
+ );
34
+ }
35
+ function CheckIcon({ className }) {
36
+ return /* @__PURE__ */ jsx(
37
+ "svg",
38
+ {
39
+ xmlns: "http://www.w3.org/2000/svg",
40
+ viewBox: "0 0 24 24",
41
+ fill: "none",
42
+ stroke: "currentColor",
43
+ strokeWidth: "3",
44
+ strokeLinecap: "round",
45
+ strokeLinejoin: "round",
46
+ className,
47
+ "aria-hidden": "true",
48
+ children: /* @__PURE__ */ jsx("path", { d: "M20 6 9 17l-5-5" })
49
+ }
50
+ );
51
+ }
52
+ var SearchLoadingChecklist = React.forwardRef(
53
+ ({
54
+ active = true,
55
+ title = DEFAULT_TITLE,
56
+ steps = DEFAULT_STEPS,
57
+ stepDurationMs = 750,
58
+ variant = "fixed",
59
+ className,
60
+ ...props
61
+ }, ref) => {
62
+ const [completedThrough, setCompletedThrough] = React.useState(0);
63
+ const lastStepIndex = Math.max(0, steps.length - 1);
64
+ React.useEffect(() => {
65
+ if (!active) {
66
+ setCompletedThrough(0);
67
+ return;
68
+ }
69
+ if (completedThrough >= lastStepIndex) {
70
+ return;
71
+ }
72
+ const timer = setTimeout(() => {
73
+ setCompletedThrough(
74
+ (current) => Math.min(current + 1, lastStepIndex)
75
+ );
76
+ }, stepDurationMs);
77
+ return () => {
78
+ clearTimeout(timer);
79
+ };
80
+ }, [active, completedThrough, lastStepIndex, stepDurationMs]);
81
+ if (!active) return null;
82
+ return /* @__PURE__ */ jsx(
83
+ "div",
84
+ {
85
+ ref,
86
+ role: "status",
87
+ "aria-live": "polite",
88
+ "aria-busy": "true",
89
+ className: cn(
90
+ variant === "fixed" ? "fixed" : "absolute",
91
+ "inset-0 z-50 flex items-center justify-center bg-white/80 backdrop-blur-sm px-4",
92
+ className
93
+ ),
94
+ ...props,
95
+ children: /* @__PURE__ */ jsxs("div", { className: "w-full max-w-md rounded-2xl border border-sand-dark bg-white p-6 shadow-xl sm:p-8", children: [
96
+ /* @__PURE__ */ jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsxs("span", { className: "relative flex h-16 w-16 items-center justify-center", children: [
97
+ /* @__PURE__ */ jsx(
98
+ "span",
99
+ {
100
+ className: "absolute inset-0 animate-spin rounded-full border-2 border-secondary/20 border-t-secondary",
101
+ "aria-hidden": "true"
102
+ }
103
+ ),
104
+ /* @__PURE__ */ jsx(DogIcon, { className: "h-8 w-8 animate-pulse text-secondary" })
105
+ ] }) }),
106
+ /* @__PURE__ */ jsx("h2", { className: "mt-5 text-center text-lg font-semibold text-text-primary", children: title }),
107
+ /* @__PURE__ */ jsx("ul", { className: "mt-6 space-y-3", children: steps.map((step, index) => {
108
+ const isCompleted = index < completedThrough;
109
+ const isCurrent = index === completedThrough;
110
+ return /* @__PURE__ */ jsxs(
111
+ "li",
112
+ {
113
+ className: "flex items-center gap-3",
114
+ "aria-current": isCurrent ? "step" : void 0,
115
+ children: [
116
+ /* @__PURE__ */ jsx(
117
+ "span",
118
+ {
119
+ className: cn(
120
+ "flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-full border transition-colors duration-300",
121
+ isCompleted && "border-secondary bg-secondary text-white",
122
+ isCurrent && "border-secondary bg-secondary/10 text-secondary",
123
+ !isCompleted && !isCurrent && "border-gray-300 bg-white text-gray-300"
124
+ ),
125
+ children: isCompleted ? /* @__PURE__ */ jsx(CheckIcon, { className: "h-3.5 w-3.5" }) : isCurrent ? /* @__PURE__ */ jsxs(
126
+ "svg",
127
+ {
128
+ className: "h-3.5 w-3.5 animate-spin",
129
+ xmlns: "http://www.w3.org/2000/svg",
130
+ fill: "none",
131
+ viewBox: "0 0 24 24",
132
+ "aria-hidden": "true",
133
+ children: [
134
+ /* @__PURE__ */ jsx(
135
+ "circle",
136
+ {
137
+ className: "opacity-25",
138
+ cx: "12",
139
+ cy: "12",
140
+ r: "10",
141
+ stroke: "currentColor",
142
+ strokeWidth: "4"
143
+ }
144
+ ),
145
+ /* @__PURE__ */ jsx(
146
+ "path",
147
+ {
148
+ className: "opacity-75",
149
+ fill: "currentColor",
150
+ d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"
151
+ }
152
+ )
153
+ ]
154
+ }
155
+ ) : /* @__PURE__ */ jsx(
156
+ "span",
157
+ {
158
+ className: "h-1.5 w-1.5 rounded-full bg-current",
159
+ "aria-hidden": "true"
160
+ }
161
+ )
162
+ }
163
+ ),
164
+ /* @__PURE__ */ jsx(
165
+ "span",
166
+ {
167
+ className: cn(
168
+ "text-sm transition-colors duration-300",
169
+ isCompleted && "font-medium text-text-primary",
170
+ isCurrent && "font-medium text-text-primary",
171
+ !isCompleted && !isCurrent && "text-text-secondary"
172
+ ),
173
+ children: step.label
174
+ }
175
+ )
176
+ ]
177
+ },
178
+ step.id
179
+ );
180
+ }) }),
181
+ /* @__PURE__ */ jsx("p", { className: "mt-6 text-center text-xs text-text-secondary", children: "Cela peut prendre quelques instants, nous v\xE9rifions les meilleures disponibilit\xE9s pour vous et votre chien." })
182
+ ] })
183
+ }
184
+ );
185
+ }
186
+ );
187
+ SearchLoadingChecklist.displayName = "SearchLoadingChecklist";
188
+
189
+ export { SearchLoadingChecklist };
@@ -0,0 +1,44 @@
1
+ import * as React from 'react';
2
+
3
+ interface DogCardData {
4
+ name: string;
5
+ /** Photo personnelle du chien (prioritaire). */
6
+ photoUrl?: string | null;
7
+ /** Image de la race, utilisée en repli quand `photoUrl` est absente. */
8
+ breedImageUrl?: string | null;
9
+ /** Libellé de taille déjà traduit ("Petit", "Grand"…). */
10
+ sizeLabel?: string | null;
11
+ /** Libellé de sexe déjà traduit ("Mâle", "Femelle"). */
12
+ sexLabel?: string | null;
13
+ /** Nom de la race. */
14
+ breed?: string | null;
15
+ /** Âge déjà formaté ("6 ans", "8 mois"). */
16
+ ageLabel?: string | null;
17
+ /** Poids déjà formaté ("32 kg"). */
18
+ weightLabel?: string | null;
19
+ /** Chien principal du foyer. */
20
+ isPrimary?: boolean;
21
+ /** Lien vers le passeport du chien. */
22
+ href?: string;
23
+ }
24
+ interface DogCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
25
+ dog: DogCardData;
26
+ /** Actions (éditer / supprimer) rendues par le consommateur en pied de carte. */
27
+ actions?: React.ReactNode;
28
+ /** Render personnalisé de l'image (ex : next/image). */
29
+ renderImage?: (props: {
30
+ src: string;
31
+ alt: string;
32
+ className: string;
33
+ }) => React.ReactNode;
34
+ /** Render personnalisé du lien (ex : next/link). */
35
+ renderLink?: (props: {
36
+ href: string;
37
+ className: string;
38
+ children: React.ReactNode;
39
+ "aria-label"?: string;
40
+ }) => React.ReactNode;
41
+ }
42
+ declare const DogCard: React.ForwardRefExoticComponent<DogCardProps & React.RefAttributes<HTMLDivElement>>;
43
+
44
+ export { DogCard, type DogCardData, type DogCardProps };
@@ -0,0 +1,44 @@
1
+ import * as React from 'react';
2
+
3
+ interface DogCardData {
4
+ name: string;
5
+ /** Photo personnelle du chien (prioritaire). */
6
+ photoUrl?: string | null;
7
+ /** Image de la race, utilisée en repli quand `photoUrl` est absente. */
8
+ breedImageUrl?: string | null;
9
+ /** Libellé de taille déjà traduit ("Petit", "Grand"…). */
10
+ sizeLabel?: string | null;
11
+ /** Libellé de sexe déjà traduit ("Mâle", "Femelle"). */
12
+ sexLabel?: string | null;
13
+ /** Nom de la race. */
14
+ breed?: string | null;
15
+ /** Âge déjà formaté ("6 ans", "8 mois"). */
16
+ ageLabel?: string | null;
17
+ /** Poids déjà formaté ("32 kg"). */
18
+ weightLabel?: string | null;
19
+ /** Chien principal du foyer. */
20
+ isPrimary?: boolean;
21
+ /** Lien vers le passeport du chien. */
22
+ href?: string;
23
+ }
24
+ interface DogCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
25
+ dog: DogCardData;
26
+ /** Actions (éditer / supprimer) rendues par le consommateur en pied de carte. */
27
+ actions?: React.ReactNode;
28
+ /** Render personnalisé de l'image (ex : next/image). */
29
+ renderImage?: (props: {
30
+ src: string;
31
+ alt: string;
32
+ className: string;
33
+ }) => React.ReactNode;
34
+ /** Render personnalisé du lien (ex : next/link). */
35
+ renderLink?: (props: {
36
+ href: string;
37
+ className: string;
38
+ children: React.ReactNode;
39
+ "aria-label"?: string;
40
+ }) => React.ReactNode;
41
+ }
42
+ declare const DogCard: React.ForwardRefExoticComponent<DogCardProps & React.RefAttributes<HTMLDivElement>>;
43
+
44
+ export { DogCard, type DogCardData, type DogCardProps };
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ var chunkBS7R7VDS_js = require('../../chunk-BS7R7VDS.js');
4
+ require('../../chunk-ADIDI7AJ.js');
5
+
6
+
7
+
8
+ Object.defineProperty(exports, "DogCard", {
9
+ enumerable: true,
10
+ get: function () { return chunkBS7R7VDS_js.DogCard; }
11
+ });
@@ -0,0 +1,2 @@
1
+ export { DogCard } from '../../chunk-4A3AQ66D.mjs';
2
+ import '../../chunk-IMKLN273.mjs';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkSATQIPV5_js = require('../../chunk-SATQIPV5.js');
3
+ var chunkKFQILIZO_js = require('../../chunk-KFQILIZO.js');
4
4
  require('../../chunk-NCU5PY34.js');
5
5
  require('../../chunk-ADIDI7AJ.js');
6
6
 
@@ -8,9 +8,9 @@ require('../../chunk-ADIDI7AJ.js');
8
8
 
9
9
  Object.defineProperty(exports, "RoomTypeCard", {
10
10
  enumerable: true,
11
- get: function () { return chunkSATQIPV5_js.RoomTypeCard; }
11
+ get: function () { return chunkKFQILIZO_js.RoomTypeCard; }
12
12
  });
13
13
  Object.defineProperty(exports, "RoomTypeCardSkeleton", {
14
14
  enumerable: true,
15
- get: function () { return chunkSATQIPV5_js.RoomTypeCardSkeleton; }
15
+ get: function () { return chunkKFQILIZO_js.RoomTypeCardSkeleton; }
16
16
  });
@@ -1,3 +1,3 @@
1
- export { RoomTypeCard, RoomTypeCardSkeleton } from '../../chunk-ZEHZPS2P.mjs';
1
+ export { RoomTypeCard, RoomTypeCardSkeleton } from '../../chunk-IGBEBAPY.mjs';
2
2
  import '../../chunk-PAHSQMXV.mjs';
3
3
  import '../../chunk-IMKLN273.mjs';
@@ -0,0 +1,37 @@
1
+ import * as React from 'react';
2
+
3
+ interface SearchLoadingStep {
4
+ /** Identifiant stable de l'étape */
5
+ id: string;
6
+ /** Libellé affiché à l'utilisateur */
7
+ label: string;
8
+ }
9
+ interface SearchLoadingChecklistProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
10
+ /**
11
+ * Indique si la recherche réelle est en cours. Quand `false`, l'overlay
12
+ * disparaît immédiatement, même si toutes les étapes ne sont pas cochées.
13
+ * Défaut : `true`.
14
+ */
15
+ active?: boolean;
16
+ /** Titre rassurant affiché au-dessus de la check-list. */
17
+ title?: string;
18
+ /**
19
+ * Étapes affichées. Par défaut, les 4 étapes standard de la recherche
20
+ * dog-friendly.
21
+ */
22
+ steps?: SearchLoadingStep[];
23
+ /**
24
+ * Durée cosmétique (ms) de chaque étape avant de se cocher. Purement
25
+ * visuel : n'a aucun effet sur la fin réelle du chargement. Défaut : 750.
26
+ */
27
+ stepDurationMs?: number;
28
+ /**
29
+ * Mise en page de l'overlay :
30
+ * - `fixed` : plein écran (position fixe) — défaut.
31
+ * - `absolute` : rempli le conteneur positionné parent.
32
+ */
33
+ variant?: "fixed" | "absolute";
34
+ }
35
+ declare const SearchLoadingChecklist: React.ForwardRefExoticComponent<SearchLoadingChecklistProps & React.RefAttributes<HTMLDivElement>>;
36
+
37
+ export { SearchLoadingChecklist, type SearchLoadingChecklistProps, type SearchLoadingStep };
@@ -0,0 +1,37 @@
1
+ import * as React from 'react';
2
+
3
+ interface SearchLoadingStep {
4
+ /** Identifiant stable de l'étape */
5
+ id: string;
6
+ /** Libellé affiché à l'utilisateur */
7
+ label: string;
8
+ }
9
+ interface SearchLoadingChecklistProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
10
+ /**
11
+ * Indique si la recherche réelle est en cours. Quand `false`, l'overlay
12
+ * disparaît immédiatement, même si toutes les étapes ne sont pas cochées.
13
+ * Défaut : `true`.
14
+ */
15
+ active?: boolean;
16
+ /** Titre rassurant affiché au-dessus de la check-list. */
17
+ title?: string;
18
+ /**
19
+ * Étapes affichées. Par défaut, les 4 étapes standard de la recherche
20
+ * dog-friendly.
21
+ */
22
+ steps?: SearchLoadingStep[];
23
+ /**
24
+ * Durée cosmétique (ms) de chaque étape avant de se cocher. Purement
25
+ * visuel : n'a aucun effet sur la fin réelle du chargement. Défaut : 750.
26
+ */
27
+ stepDurationMs?: number;
28
+ /**
29
+ * Mise en page de l'overlay :
30
+ * - `fixed` : plein écran (position fixe) — défaut.
31
+ * - `absolute` : rempli le conteneur positionné parent.
32
+ */
33
+ variant?: "fixed" | "absolute";
34
+ }
35
+ declare const SearchLoadingChecklist: React.ForwardRefExoticComponent<SearchLoadingChecklistProps & React.RefAttributes<HTMLDivElement>>;
36
+
37
+ export { SearchLoadingChecklist, type SearchLoadingChecklistProps, type SearchLoadingStep };
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ var chunk6KW7ZSKR_js = require('../../chunk-6KW7ZSKR.js');
4
+ require('../../chunk-ADIDI7AJ.js');
5
+
6
+
7
+
8
+ Object.defineProperty(exports, "SearchLoadingChecklist", {
9
+ enumerable: true,
10
+ get: function () { return chunk6KW7ZSKR_js.SearchLoadingChecklist; }
11
+ });
@@ -0,0 +1,2 @@
1
+ export { SearchLoadingChecklist } from '../../chunk-SRYZ4N7T.mjs';
2
+ import '../../chunk-IMKLN273.mjs';
package/dist/index.d.mts CHANGED
@@ -8,6 +8,8 @@ export { Select, SelectOption, SelectProps, selectVariants } from './components/
8
8
  export { Breadcrumb, BreadcrumbItem, BreadcrumbProps, breadcrumbVariants } from './components/Breadcrumb/index.mjs';
9
9
  export { ImageWithFallback, ImageWithFallbackProps } from './components/ImageWithFallback/index.mjs';
10
10
  export { HotelCard, HotelCardData, HotelCardProps } from './components/HotelCard/index.mjs';
11
+ export { DogCard, DogCardData, DogCardProps } from './components/DogCard/index.mjs';
12
+ export { SearchLoadingChecklist, SearchLoadingChecklistProps, SearchLoadingStep } from './components/SearchLoadingChecklist/index.mjs';
11
13
  export { RadioGroup, RadioGroupItemOption, RadioGroupProps } from './components/RadioGroup/index.mjs';
12
14
  export { Checkbox, CheckboxProps } from './components/Checkbox/index.mjs';
13
15
  export { Toggle, ToggleProps } from './components/Toggle/index.mjs';
package/dist/index.d.ts CHANGED
@@ -8,6 +8,8 @@ export { Select, SelectOption, SelectProps, selectVariants } from './components/
8
8
  export { Breadcrumb, BreadcrumbItem, BreadcrumbProps, breadcrumbVariants } from './components/Breadcrumb/index.js';
9
9
  export { ImageWithFallback, ImageWithFallbackProps } from './components/ImageWithFallback/index.js';
10
10
  export { HotelCard, HotelCardData, HotelCardProps } from './components/HotelCard/index.js';
11
+ export { DogCard, DogCardData, DogCardProps } from './components/DogCard/index.js';
12
+ export { SearchLoadingChecklist, SearchLoadingChecklistProps, SearchLoadingStep } from './components/SearchLoadingChecklist/index.js';
11
13
  export { RadioGroup, RadioGroupItemOption, RadioGroupProps } from './components/RadioGroup/index.js';
12
14
  export { Checkbox, CheckboxProps } from './components/Checkbox/index.js';
13
15
  export { Toggle, ToggleProps } from './components/Toggle/index.js';