@dododog/ui 0.14.0 → 0.14.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/README.md +3 -3
- package/dist/{chunk-SZ3SV4SJ.mjs → chunk-4DHZ6MIL.mjs} +1 -1
- package/dist/{chunk-77WKG2D7.js → chunk-5UNG2O64.js} +38 -8
- package/dist/{chunk-C4RZBOKH.js → chunk-EQPT6VZF.js} +1 -1
- package/dist/{chunk-NBDPT3XQ.js → chunk-HH4X2JYO.js} +94 -15
- package/dist/{chunk-GRG4USTC.mjs → chunk-JWOV5H6G.mjs} +38 -8
- package/dist/chunk-N5ZNXNCO.mjs +178 -0
- package/dist/components/Footer/index.js +2 -2
- package/dist/components/Footer/index.mjs +1 -1
- package/dist/components/Input/index.js +3 -3
- package/dist/components/Input/index.mjs +1 -1
- package/dist/components/Modal/index.d.mts +12 -0
- package/dist/components/Modal/index.d.ts +12 -0
- package/dist/components/Modal/index.js +2 -2
- package/dist/components/Modal/index.mjs +1 -1
- package/dist/index.js +39 -39
- package/dist/index.mjs +11 -11
- package/dist/tailwind-preset.d.mts +2 -2
- package/dist/tailwind-preset.d.ts +2 -2
- package/dist/tailwind-preset.js +2 -2
- package/dist/tailwind-preset.mjs +2 -2
- package/package.json +14 -14
- package/dist/chunk-74B2EGKT.mjs +0 -99
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @dododog/ui
|
|
2
2
|
|
|
3
|
-
React UI component library for [
|
|
3
|
+
React UI component library for [ToutouTrip](https://toutoutrip.com) — the pet-friendly travel platform.
|
|
4
4
|
|
|
5
5
|
Built with React, TypeScript, Tailwind CSS, and [class-variance-authority](https://cva.style).
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@ npm install @dododog/ui
|
|
|
14
14
|
|
|
15
15
|
### Tailwind CSS
|
|
16
16
|
|
|
17
|
-
Add the
|
|
17
|
+
Add the ToutouTrip preset and content path to your `tailwind.config.ts`:
|
|
18
18
|
|
|
19
19
|
```ts
|
|
20
20
|
import type { Config } from "tailwindcss";
|
|
@@ -113,7 +113,7 @@ export default function App() {
|
|
|
113
113
|
| Export | Import path | Description |
|
|
114
114
|
|--------|-------------|-------------|
|
|
115
115
|
| Tokens | `@dododog/ui/tokens` | Design tokens (colors, spacing, etc.) |
|
|
116
|
-
| Tailwind Preset | `@dododog/ui/tailwind-preset` | Tailwind CSS preset with
|
|
116
|
+
| Tailwind Preset | `@dododog/ui/tailwind-preset` | Tailwind CSS preset with ToutouTrip theme |
|
|
117
117
|
| Utils | `@dododog/ui/utils` | Utility functions (`cn`, etc.) |
|
|
118
118
|
|
|
119
119
|
## Requirements
|
|
@@ -106,7 +106,7 @@ var Footer = React.forwardRef(
|
|
|
106
106
|
bottomExtra
|
|
107
107
|
] }),
|
|
108
108
|
tagline && /* @__PURE__ */ jsx("div", { className: "text-sm text-white/60", children: tagline }),
|
|
109
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-white/60", children: copyright || `\xA9 ${year}
|
|
109
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-white/60", children: copyright || `\xA9 ${year} ToutouTrip. Tous droits r\xE9serv\xE9s.` })
|
|
110
110
|
] }) }) })
|
|
111
111
|
] });
|
|
112
112
|
}
|
|
@@ -46,31 +46,61 @@ var inputVariants = classVarianceAuthority.cva(
|
|
|
46
46
|
}
|
|
47
47
|
);
|
|
48
48
|
var Input = React__namespace.forwardRef(
|
|
49
|
-
({
|
|
49
|
+
({
|
|
50
|
+
className,
|
|
51
|
+
size,
|
|
52
|
+
variant,
|
|
53
|
+
label,
|
|
54
|
+
error,
|
|
55
|
+
required,
|
|
56
|
+
leftIcon,
|
|
57
|
+
rightIcon,
|
|
58
|
+
id,
|
|
59
|
+
"aria-describedby": ariaDescribedBy,
|
|
60
|
+
"aria-invalid": ariaInvalid,
|
|
61
|
+
"aria-required": ariaRequired,
|
|
62
|
+
...props
|
|
63
|
+
}, ref) => {
|
|
64
|
+
const generatedId = React__namespace.useId();
|
|
65
|
+
const inputId = id ?? generatedId;
|
|
66
|
+
const errorId = `${inputId}-error`;
|
|
50
67
|
const resolvedVariant = error ? "error" : variant ?? "default";
|
|
68
|
+
const describedBy = [ariaDescribedBy, error ? errorId : null].filter(Boolean).join(" ") || void 0;
|
|
51
69
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full", children: [
|
|
52
|
-
label && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
53
|
-
label,
|
|
54
|
-
|
|
55
|
-
|
|
70
|
+
label && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
71
|
+
"label",
|
|
72
|
+
{
|
|
73
|
+
htmlFor: inputId,
|
|
74
|
+
className: "block text-sm font-medium text-primary mb-1.5",
|
|
75
|
+
children: [
|
|
76
|
+
label,
|
|
77
|
+
required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-secondary", "aria-hidden": "true", children: " *" })
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
),
|
|
56
81
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
57
82
|
leftIcon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-muted", children: leftIcon }),
|
|
58
83
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
59
84
|
"input",
|
|
60
85
|
{
|
|
86
|
+
...props,
|
|
61
87
|
ref,
|
|
88
|
+
id: inputId,
|
|
89
|
+
required,
|
|
90
|
+
"aria-required": ariaRequired ?? (required ? true : void 0),
|
|
91
|
+
"aria-invalid": ariaInvalid ?? (error ? true : void 0),
|
|
92
|
+
"aria-describedby": describedBy,
|
|
62
93
|
className: chunkADIDI7AJ_js.cn(
|
|
63
94
|
inputVariants({ size, variant: resolvedVariant }),
|
|
64
95
|
leftIcon && "pl-10",
|
|
65
96
|
rightIcon && "pr-10",
|
|
66
97
|
className
|
|
67
|
-
)
|
|
68
|
-
...props
|
|
98
|
+
)
|
|
69
99
|
}
|
|
70
100
|
),
|
|
71
101
|
rightIcon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute right-3 top-1/2 -translate-y-1/2 text-text-muted", children: rightIcon })
|
|
72
102
|
] }),
|
|
73
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-sm text-red-500", children: error })
|
|
103
|
+
error && /* @__PURE__ */ jsxRuntime.jsx("p", { id: errorId, className: "mt-1 text-sm text-red-500", children: error })
|
|
74
104
|
] });
|
|
75
105
|
}
|
|
76
106
|
);
|
|
@@ -128,7 +128,7 @@ var Footer = React__namespace.forwardRef(
|
|
|
128
128
|
bottomExtra
|
|
129
129
|
] }),
|
|
130
130
|
tagline && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-white/60", children: tagline }),
|
|
131
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-white/60", children: copyright || `\xA9 ${year}
|
|
131
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-white/60", children: copyright || `\xA9 ${year} ToutouTrip. Tous droits r\xE9serv\xE9s.` })
|
|
132
132
|
] }) }) })
|
|
133
133
|
] });
|
|
134
134
|
}
|
|
@@ -24,13 +24,89 @@ function _interopNamespace(e) {
|
|
|
24
24
|
|
|
25
25
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
26
|
|
|
27
|
+
var FOCUSABLE_SELECTOR = [
|
|
28
|
+
"a[href]",
|
|
29
|
+
"area[href]",
|
|
30
|
+
"button:not([disabled])",
|
|
31
|
+
"input:not([disabled]):not([type='hidden'])",
|
|
32
|
+
"select:not([disabled])",
|
|
33
|
+
"textarea:not([disabled])",
|
|
34
|
+
"iframe",
|
|
35
|
+
"audio[controls]",
|
|
36
|
+
"video[controls]",
|
|
37
|
+
"[contenteditable]:not([contenteditable='false'])",
|
|
38
|
+
'[tabindex]:not([tabindex="-1"])'
|
|
39
|
+
].join(", ");
|
|
40
|
+
function getFocusableElements(panel) {
|
|
41
|
+
return Array.from(panel.querySelectorAll(FOCUSABLE_SELECTOR)).filter(
|
|
42
|
+
(element) => !element.closest("[hidden], [aria-hidden='true'], details:not([open])")
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
function isTopMostDialog(panel) {
|
|
46
|
+
const dialogs = document.querySelectorAll('[role="dialog"][aria-modal="true"]');
|
|
47
|
+
const topMost = dialogs[dialogs.length - 1];
|
|
48
|
+
return !topMost || topMost.contains(panel);
|
|
49
|
+
}
|
|
27
50
|
var Modal = React__namespace.forwardRef(
|
|
28
|
-
({
|
|
29
|
-
|
|
51
|
+
({
|
|
52
|
+
isOpen,
|
|
53
|
+
onClose,
|
|
54
|
+
children,
|
|
55
|
+
title,
|
|
56
|
+
className,
|
|
57
|
+
"aria-label": ariaLabel,
|
|
58
|
+
"aria-labelledby": ariaLabelledBy,
|
|
59
|
+
"aria-describedby": ariaDescribedBy
|
|
60
|
+
}, ref) => {
|
|
61
|
+
const panelRef = React__namespace.useRef(null);
|
|
62
|
+
const generatedTitleId = React__namespace.useId();
|
|
63
|
+
const titleId = title ? `${generatedTitleId}-title` : void 0;
|
|
64
|
+
const labelledBy = ariaLabelledBy ?? titleId;
|
|
30
65
|
React__namespace.useEffect(() => {
|
|
31
66
|
if (!isOpen) return;
|
|
32
|
-
const
|
|
33
|
-
|
|
67
|
+
const trigger = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
68
|
+
return () => {
|
|
69
|
+
if (trigger && trigger.isConnected) trigger.focus();
|
|
70
|
+
};
|
|
71
|
+
}, [isOpen]);
|
|
72
|
+
React__namespace.useEffect(() => {
|
|
73
|
+
if (!isOpen) return;
|
|
74
|
+
const panel = panelRef.current;
|
|
75
|
+
if (!panel) return;
|
|
76
|
+
const focusable = getFocusableElements(panel);
|
|
77
|
+
(focusable[0] ?? panel).focus();
|
|
78
|
+
}, [isOpen]);
|
|
79
|
+
React__namespace.useEffect(() => {
|
|
80
|
+
if (!isOpen) return;
|
|
81
|
+
const handleKeyDown = (event) => {
|
|
82
|
+
const panel = panelRef.current;
|
|
83
|
+
if (!panel || !isTopMostDialog(panel)) return;
|
|
84
|
+
if (event.key === "Escape") {
|
|
85
|
+
onClose();
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (event.key !== "Tab") return;
|
|
89
|
+
const focusable = getFocusableElements(panel);
|
|
90
|
+
const active = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
91
|
+
if (focusable.length === 0) {
|
|
92
|
+
event.preventDefault();
|
|
93
|
+
panel.focus();
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const first = focusable[0];
|
|
97
|
+
const last = focusable[focusable.length - 1];
|
|
98
|
+
if (!active || !panel.contains(active)) {
|
|
99
|
+
event.preventDefault();
|
|
100
|
+
(event.shiftKey ? last : first).focus();
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (event.shiftKey && active === first) {
|
|
104
|
+
event.preventDefault();
|
|
105
|
+
last.focus();
|
|
106
|
+
} else if (!event.shiftKey && active === last) {
|
|
107
|
+
event.preventDefault();
|
|
108
|
+
first.focus();
|
|
109
|
+
}
|
|
34
110
|
};
|
|
35
111
|
document.addEventListener("keydown", handleKeyDown);
|
|
36
112
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
@@ -43,13 +119,6 @@ var Modal = React__namespace.forwardRef(
|
|
|
43
119
|
document.body.style.overflow = prev;
|
|
44
120
|
};
|
|
45
121
|
}, [isOpen]);
|
|
46
|
-
React__namespace.useEffect(() => {
|
|
47
|
-
if (!isOpen || !contentRef.current) return;
|
|
48
|
-
const focusable = contentRef.current.querySelectorAll(
|
|
49
|
-
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
50
|
-
);
|
|
51
|
-
if (focusable.length > 0) focusable[0].focus();
|
|
52
|
-
}, [isOpen]);
|
|
53
122
|
if (!isOpen) return null;
|
|
54
123
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
55
124
|
"div",
|
|
@@ -58,7 +127,9 @@ var Modal = React__namespace.forwardRef(
|
|
|
58
127
|
className: "fixed inset-0 z-50 flex items-center justify-center p-4",
|
|
59
128
|
role: "dialog",
|
|
60
129
|
"aria-modal": "true",
|
|
61
|
-
"aria-
|
|
130
|
+
"aria-labelledby": labelledBy,
|
|
131
|
+
"aria-label": labelledBy ? void 0 : ariaLabel,
|
|
132
|
+
"aria-describedby": ariaDescribedBy,
|
|
62
133
|
children: [
|
|
63
134
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
64
135
|
"div",
|
|
@@ -71,14 +142,22 @@ var Modal = React__namespace.forwardRef(
|
|
|
71
142
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
72
143
|
"div",
|
|
73
144
|
{
|
|
74
|
-
ref:
|
|
145
|
+
ref: panelRef,
|
|
146
|
+
tabIndex: -1,
|
|
75
147
|
className: chunkADIDI7AJ_js.cn(
|
|
76
|
-
"relative bg-white rounded-2xl shadow-xl max-w-md w-full max-h-[90vh] overflow-auto",
|
|
148
|
+
"relative bg-white rounded-2xl shadow-xl max-w-md w-full max-h-[90vh] overflow-auto outline-none",
|
|
77
149
|
className
|
|
78
150
|
),
|
|
79
151
|
children: [
|
|
80
152
|
title && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-6 pt-6 pb-2", children: [
|
|
81
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
153
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
154
|
+
"h2",
|
|
155
|
+
{
|
|
156
|
+
id: titleId,
|
|
157
|
+
className: "text-lg font-heading font-semibold text-primary",
|
|
158
|
+
children: title
|
|
159
|
+
}
|
|
160
|
+
),
|
|
82
161
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
83
162
|
"button",
|
|
84
163
|
{
|
|
@@ -24,31 +24,61 @@ var inputVariants = cva(
|
|
|
24
24
|
}
|
|
25
25
|
);
|
|
26
26
|
var Input = React.forwardRef(
|
|
27
|
-
({
|
|
27
|
+
({
|
|
28
|
+
className,
|
|
29
|
+
size,
|
|
30
|
+
variant,
|
|
31
|
+
label,
|
|
32
|
+
error,
|
|
33
|
+
required,
|
|
34
|
+
leftIcon,
|
|
35
|
+
rightIcon,
|
|
36
|
+
id,
|
|
37
|
+
"aria-describedby": ariaDescribedBy,
|
|
38
|
+
"aria-invalid": ariaInvalid,
|
|
39
|
+
"aria-required": ariaRequired,
|
|
40
|
+
...props
|
|
41
|
+
}, ref) => {
|
|
42
|
+
const generatedId = React.useId();
|
|
43
|
+
const inputId = id ?? generatedId;
|
|
44
|
+
const errorId = `${inputId}-error`;
|
|
28
45
|
const resolvedVariant = error ? "error" : variant ?? "default";
|
|
46
|
+
const describedBy = [ariaDescribedBy, error ? errorId : null].filter(Boolean).join(" ") || void 0;
|
|
29
47
|
return /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
|
|
30
|
-
label && /* @__PURE__ */ jsxs(
|
|
31
|
-
label,
|
|
32
|
-
|
|
33
|
-
|
|
48
|
+
label && /* @__PURE__ */ jsxs(
|
|
49
|
+
"label",
|
|
50
|
+
{
|
|
51
|
+
htmlFor: inputId,
|
|
52
|
+
className: "block text-sm font-medium text-primary mb-1.5",
|
|
53
|
+
children: [
|
|
54
|
+
label,
|
|
55
|
+
required && /* @__PURE__ */ jsx("span", { className: "text-secondary", "aria-hidden": "true", children: " *" })
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
),
|
|
34
59
|
/* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
35
60
|
leftIcon && /* @__PURE__ */ jsx("div", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-muted", children: leftIcon }),
|
|
36
61
|
/* @__PURE__ */ jsx(
|
|
37
62
|
"input",
|
|
38
63
|
{
|
|
64
|
+
...props,
|
|
39
65
|
ref,
|
|
66
|
+
id: inputId,
|
|
67
|
+
required,
|
|
68
|
+
"aria-required": ariaRequired ?? (required ? true : void 0),
|
|
69
|
+
"aria-invalid": ariaInvalid ?? (error ? true : void 0),
|
|
70
|
+
"aria-describedby": describedBy,
|
|
40
71
|
className: cn(
|
|
41
72
|
inputVariants({ size, variant: resolvedVariant }),
|
|
42
73
|
leftIcon && "pl-10",
|
|
43
74
|
rightIcon && "pr-10",
|
|
44
75
|
className
|
|
45
|
-
)
|
|
46
|
-
...props
|
|
76
|
+
)
|
|
47
77
|
}
|
|
48
78
|
),
|
|
49
79
|
rightIcon && /* @__PURE__ */ jsx("div", { className: "absolute right-3 top-1/2 -translate-y-1/2 text-text-muted", children: rightIcon })
|
|
50
80
|
] }),
|
|
51
|
-
error && /* @__PURE__ */ jsx("p", { className: "mt-1 text-sm text-red-500", children: error })
|
|
81
|
+
error && /* @__PURE__ */ jsx("p", { id: errorId, className: "mt-1 text-sm text-red-500", children: error })
|
|
52
82
|
] });
|
|
53
83
|
}
|
|
54
84
|
);
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { cn } from './chunk-IMKLN273.mjs';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
var FOCUSABLE_SELECTOR = [
|
|
6
|
+
"a[href]",
|
|
7
|
+
"area[href]",
|
|
8
|
+
"button:not([disabled])",
|
|
9
|
+
"input:not([disabled]):not([type='hidden'])",
|
|
10
|
+
"select:not([disabled])",
|
|
11
|
+
"textarea:not([disabled])",
|
|
12
|
+
"iframe",
|
|
13
|
+
"audio[controls]",
|
|
14
|
+
"video[controls]",
|
|
15
|
+
"[contenteditable]:not([contenteditable='false'])",
|
|
16
|
+
'[tabindex]:not([tabindex="-1"])'
|
|
17
|
+
].join(", ");
|
|
18
|
+
function getFocusableElements(panel) {
|
|
19
|
+
return Array.from(panel.querySelectorAll(FOCUSABLE_SELECTOR)).filter(
|
|
20
|
+
(element) => !element.closest("[hidden], [aria-hidden='true'], details:not([open])")
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
function isTopMostDialog(panel) {
|
|
24
|
+
const dialogs = document.querySelectorAll('[role="dialog"][aria-modal="true"]');
|
|
25
|
+
const topMost = dialogs[dialogs.length - 1];
|
|
26
|
+
return !topMost || topMost.contains(panel);
|
|
27
|
+
}
|
|
28
|
+
var Modal = React.forwardRef(
|
|
29
|
+
({
|
|
30
|
+
isOpen,
|
|
31
|
+
onClose,
|
|
32
|
+
children,
|
|
33
|
+
title,
|
|
34
|
+
className,
|
|
35
|
+
"aria-label": ariaLabel,
|
|
36
|
+
"aria-labelledby": ariaLabelledBy,
|
|
37
|
+
"aria-describedby": ariaDescribedBy
|
|
38
|
+
}, ref) => {
|
|
39
|
+
const panelRef = React.useRef(null);
|
|
40
|
+
const generatedTitleId = React.useId();
|
|
41
|
+
const titleId = title ? `${generatedTitleId}-title` : void 0;
|
|
42
|
+
const labelledBy = ariaLabelledBy ?? titleId;
|
|
43
|
+
React.useEffect(() => {
|
|
44
|
+
if (!isOpen) return;
|
|
45
|
+
const trigger = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
46
|
+
return () => {
|
|
47
|
+
if (trigger && trigger.isConnected) trigger.focus();
|
|
48
|
+
};
|
|
49
|
+
}, [isOpen]);
|
|
50
|
+
React.useEffect(() => {
|
|
51
|
+
if (!isOpen) return;
|
|
52
|
+
const panel = panelRef.current;
|
|
53
|
+
if (!panel) return;
|
|
54
|
+
const focusable = getFocusableElements(panel);
|
|
55
|
+
(focusable[0] ?? panel).focus();
|
|
56
|
+
}, [isOpen]);
|
|
57
|
+
React.useEffect(() => {
|
|
58
|
+
if (!isOpen) return;
|
|
59
|
+
const handleKeyDown = (event) => {
|
|
60
|
+
const panel = panelRef.current;
|
|
61
|
+
if (!panel || !isTopMostDialog(panel)) return;
|
|
62
|
+
if (event.key === "Escape") {
|
|
63
|
+
onClose();
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (event.key !== "Tab") return;
|
|
67
|
+
const focusable = getFocusableElements(panel);
|
|
68
|
+
const active = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
69
|
+
if (focusable.length === 0) {
|
|
70
|
+
event.preventDefault();
|
|
71
|
+
panel.focus();
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const first = focusable[0];
|
|
75
|
+
const last = focusable[focusable.length - 1];
|
|
76
|
+
if (!active || !panel.contains(active)) {
|
|
77
|
+
event.preventDefault();
|
|
78
|
+
(event.shiftKey ? last : first).focus();
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (event.shiftKey && active === first) {
|
|
82
|
+
event.preventDefault();
|
|
83
|
+
last.focus();
|
|
84
|
+
} else if (!event.shiftKey && active === last) {
|
|
85
|
+
event.preventDefault();
|
|
86
|
+
first.focus();
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
90
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
91
|
+
}, [isOpen, onClose]);
|
|
92
|
+
React.useEffect(() => {
|
|
93
|
+
if (!isOpen) return;
|
|
94
|
+
const prev = document.body.style.overflow;
|
|
95
|
+
document.body.style.overflow = "hidden";
|
|
96
|
+
return () => {
|
|
97
|
+
document.body.style.overflow = prev;
|
|
98
|
+
};
|
|
99
|
+
}, [isOpen]);
|
|
100
|
+
if (!isOpen) return null;
|
|
101
|
+
return /* @__PURE__ */ jsxs(
|
|
102
|
+
"div",
|
|
103
|
+
{
|
|
104
|
+
ref,
|
|
105
|
+
className: "fixed inset-0 z-50 flex items-center justify-center p-4",
|
|
106
|
+
role: "dialog",
|
|
107
|
+
"aria-modal": "true",
|
|
108
|
+
"aria-labelledby": labelledBy,
|
|
109
|
+
"aria-label": labelledBy ? void 0 : ariaLabel,
|
|
110
|
+
"aria-describedby": ariaDescribedBy,
|
|
111
|
+
children: [
|
|
112
|
+
/* @__PURE__ */ jsx(
|
|
113
|
+
"div",
|
|
114
|
+
{
|
|
115
|
+
className: "absolute inset-0 bg-black/50",
|
|
116
|
+
onClick: onClose,
|
|
117
|
+
"aria-hidden": "true"
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
/* @__PURE__ */ jsxs(
|
|
121
|
+
"div",
|
|
122
|
+
{
|
|
123
|
+
ref: panelRef,
|
|
124
|
+
tabIndex: -1,
|
|
125
|
+
className: cn(
|
|
126
|
+
"relative bg-white rounded-2xl shadow-xl max-w-md w-full max-h-[90vh] overflow-auto outline-none",
|
|
127
|
+
className
|
|
128
|
+
),
|
|
129
|
+
children: [
|
|
130
|
+
title && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-6 pt-6 pb-2", children: [
|
|
131
|
+
/* @__PURE__ */ jsx(
|
|
132
|
+
"h2",
|
|
133
|
+
{
|
|
134
|
+
id: titleId,
|
|
135
|
+
className: "text-lg font-heading font-semibold text-primary",
|
|
136
|
+
children: title
|
|
137
|
+
}
|
|
138
|
+
),
|
|
139
|
+
/* @__PURE__ */ jsx(
|
|
140
|
+
"button",
|
|
141
|
+
{
|
|
142
|
+
type: "button",
|
|
143
|
+
onClick: onClose,
|
|
144
|
+
className: "text-text-muted hover:text-primary transition-colors",
|
|
145
|
+
"aria-label": "Fermer",
|
|
146
|
+
children: /* @__PURE__ */ jsxs(
|
|
147
|
+
"svg",
|
|
148
|
+
{
|
|
149
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
150
|
+
width: "20",
|
|
151
|
+
height: "20",
|
|
152
|
+
viewBox: "0 0 24 24",
|
|
153
|
+
fill: "none",
|
|
154
|
+
stroke: "currentColor",
|
|
155
|
+
strokeWidth: "2",
|
|
156
|
+
strokeLinecap: "round",
|
|
157
|
+
strokeLinejoin: "round",
|
|
158
|
+
children: [
|
|
159
|
+
/* @__PURE__ */ jsx("path", { d: "M18 6 6 18" }),
|
|
160
|
+
/* @__PURE__ */ jsx("path", { d: "m6 6 12 12" })
|
|
161
|
+
]
|
|
162
|
+
}
|
|
163
|
+
)
|
|
164
|
+
}
|
|
165
|
+
)
|
|
166
|
+
] }),
|
|
167
|
+
/* @__PURE__ */ jsx("div", { className: cn(title ? "px-6 pb-6" : "p-6"), children })
|
|
168
|
+
]
|
|
169
|
+
}
|
|
170
|
+
)
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
);
|
|
176
|
+
Modal.displayName = "Modal";
|
|
177
|
+
|
|
178
|
+
export { Modal };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkEQPT6VZF_js = require('../../chunk-EQPT6VZF.js');
|
|
4
4
|
require('../../chunk-ADIDI7AJ.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "Footer", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkEQPT6VZF_js.Footer; }
|
|
11
11
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Footer } from '../../chunk-
|
|
1
|
+
export { Footer } from '../../chunk-4DHZ6MIL.mjs';
|
|
2
2
|
import '../../chunk-IMKLN273.mjs';
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk5UNG2O64_js = require('../../chunk-5UNG2O64.js');
|
|
4
4
|
require('../../chunk-ADIDI7AJ.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "Input", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunk5UNG2O64_js.Input; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "inputVariants", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunk5UNG2O64_js.inputVariants; }
|
|
15
15
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Input, inputVariants } from '../../chunk-
|
|
1
|
+
export { Input, inputVariants } from '../../chunk-JWOV5H6G.mjs';
|
|
2
2
|
import '../../chunk-IMKLN273.mjs';
|
|
@@ -6,6 +6,18 @@ interface ModalProps {
|
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
title?: string;
|
|
8
8
|
className?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Nom accessible quand aucun `title` n'est rendu. Ignore si `title` est
|
|
11
|
+
* fourni : le titre visible sert alors de nom via `aria-labelledby`.
|
|
12
|
+
*/
|
|
13
|
+
"aria-label"?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Id d'un titre rendu par l'appelant (dialogue sans `title`). Prioritaire
|
|
16
|
+
* sur l'id genere en interne.
|
|
17
|
+
*/
|
|
18
|
+
"aria-labelledby"?: string;
|
|
19
|
+
/** Id d'une description du dialogue, relayee telle quelle. */
|
|
20
|
+
"aria-describedby"?: string;
|
|
9
21
|
}
|
|
10
22
|
declare const Modal: React.ForwardRefExoticComponent<ModalProps & React.RefAttributes<HTMLDivElement>>;
|
|
11
23
|
|
|
@@ -6,6 +6,18 @@ interface ModalProps {
|
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
title?: string;
|
|
8
8
|
className?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Nom accessible quand aucun `title` n'est rendu. Ignore si `title` est
|
|
11
|
+
* fourni : le titre visible sert alors de nom via `aria-labelledby`.
|
|
12
|
+
*/
|
|
13
|
+
"aria-label"?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Id d'un titre rendu par l'appelant (dialogue sans `title`). Prioritaire
|
|
16
|
+
* sur l'id genere en interne.
|
|
17
|
+
*/
|
|
18
|
+
"aria-labelledby"?: string;
|
|
19
|
+
/** Id d'une description du dialogue, relayee telle quelle. */
|
|
20
|
+
"aria-describedby"?: string;
|
|
9
21
|
}
|
|
10
22
|
declare const Modal: React.ForwardRefExoticComponent<ModalProps & React.RefAttributes<HTMLDivElement>>;
|
|
11
23
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkHH4X2JYO_js = require('../../chunk-HH4X2JYO.js');
|
|
4
4
|
require('../../chunk-ADIDI7AJ.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "Modal", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkHH4X2JYO_js.Modal; }
|
|
11
11
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Modal } from '../../chunk-
|
|
1
|
+
export { Modal } from '../../chunk-N5ZNXNCO.mjs';
|
|
2
2
|
import '../../chunk-IMKLN273.mjs';
|
package/dist/index.js
CHANGED
|
@@ -17,30 +17,30 @@ var chunkI4S3R6C6_js = require('./chunk-I4S3R6C6.js');
|
|
|
17
17
|
var chunk762LQMWP_js = require('./chunk-762LQMWP.js');
|
|
18
18
|
var chunk6KW7ZSKR_js = require('./chunk-6KW7ZSKR.js');
|
|
19
19
|
var chunkSEHALSKW_js = require('./chunk-SEHALSKW.js');
|
|
20
|
-
var chunkOGB5LIXN_js = require('./chunk-OGB5LIXN.js');
|
|
21
20
|
var chunkQWDKSY6Y_js = require('./chunk-QWDKSY6Y.js');
|
|
22
21
|
var chunk3R7PT3JG_js = require('./chunk-3R7PT3JG.js');
|
|
22
|
+
var chunkOGB5LIXN_js = require('./chunk-OGB5LIXN.js');
|
|
23
23
|
var chunkDS4LM7OS_js = require('./chunk-DS4LM7OS.js');
|
|
24
24
|
var chunkWXSBKARZ_js = require('./chunk-WXSBKARZ.js');
|
|
25
25
|
var chunkSCGN5H6D_js = require('./chunk-SCGN5H6D.js');
|
|
26
26
|
var chunkB4LR4H6R_js = require('./chunk-B4LR4H6R.js');
|
|
27
27
|
var chunkPG4I4NWO_js = require('./chunk-PG4I4NWO.js');
|
|
28
|
-
var chunkPRDIS2VR_js = require('./chunk-PRDIS2VR.js');
|
|
29
28
|
var chunkGXKON34B_js = require('./chunk-GXKON34B.js');
|
|
29
|
+
var chunkPRDIS2VR_js = require('./chunk-PRDIS2VR.js');
|
|
30
30
|
var chunkTZHT7NZU_js = require('./chunk-TZHT7NZU.js');
|
|
31
31
|
var chunkKFQILIZO_js = require('./chunk-KFQILIZO.js');
|
|
32
32
|
var chunkNCU5PY34_js = require('./chunk-NCU5PY34.js');
|
|
33
33
|
var chunkHS3MAW3G_js = require('./chunk-HS3MAW3G.js');
|
|
34
34
|
var chunkDFC6XK57_js = require('./chunk-DFC6XK57.js');
|
|
35
|
-
var
|
|
35
|
+
var chunk5UNG2O64_js = require('./chunk-5UNG2O64.js');
|
|
36
36
|
var chunkU3XWNFHH_js = require('./chunk-U3XWNFHH.js');
|
|
37
37
|
var chunkW7DZZS6L_js = require('./chunk-W7DZZS6L.js');
|
|
38
38
|
var chunkTE4WHZ4Q_js = require('./chunk-TE4WHZ4Q.js');
|
|
39
39
|
var chunkHN6B4TAW_js = require('./chunk-HN6B4TAW.js');
|
|
40
40
|
var chunkKZSGVMUG_js = require('./chunk-KZSGVMUG.js');
|
|
41
|
-
var
|
|
41
|
+
var chunkHH4X2JYO_js = require('./chunk-HH4X2JYO.js');
|
|
42
42
|
var chunkZCQJN4IT_js = require('./chunk-ZCQJN4IT.js');
|
|
43
|
-
var
|
|
43
|
+
var chunkEQPT6VZF_js = require('./chunk-EQPT6VZF.js');
|
|
44
44
|
var chunkKOO5ZXLD_js = require('./chunk-KOO5ZXLD.js');
|
|
45
45
|
var chunkIRKM5UF4_js = require('./chunk-IRKM5UF4.js');
|
|
46
46
|
var chunkECVKFE6U_js = require('./chunk-ECVKFE6U.js');
|
|
@@ -50,24 +50,24 @@ var chunkDLOHAW74_js = require('./chunk-DLOHAW74.js');
|
|
|
50
50
|
var chunkBS7R7VDS_js = require('./chunk-BS7R7VDS.js');
|
|
51
51
|
var chunkVWFY24XF_js = require('./chunk-VWFY24XF.js');
|
|
52
52
|
var chunkT5FLQQP6_js = require('./chunk-T5FLQQP6.js');
|
|
53
|
-
var chunkTDGU5Y2P_js = require('./chunk-TDGU5Y2P.js');
|
|
54
53
|
var chunkIEHX4DU6_js = require('./chunk-IEHX4DU6.js');
|
|
54
|
+
var chunkTDGU5Y2P_js = require('./chunk-TDGU5Y2P.js');
|
|
55
55
|
var chunkS5TLUDNM_js = require('./chunk-S5TLUDNM.js');
|
|
56
|
-
var chunk7W3TFPIF_js = require('./chunk-7W3TFPIF.js');
|
|
57
56
|
var chunkTJDHGNMR_js = require('./chunk-TJDHGNMR.js');
|
|
58
|
-
var
|
|
57
|
+
var chunk7W3TFPIF_js = require('./chunk-7W3TFPIF.js');
|
|
59
58
|
var chunkMY6BYO5F_js = require('./chunk-MY6BYO5F.js');
|
|
59
|
+
var chunkP7GAKOCX_js = require('./chunk-P7GAKOCX.js');
|
|
60
|
+
var chunkIJIUUBFT_js = require('./chunk-IJIUUBFT.js');
|
|
60
61
|
var chunkT4AT3YCT_js = require('./chunk-T4AT3YCT.js');
|
|
61
62
|
var chunkAIA3NHCK_js = require('./chunk-AIA3NHCK.js');
|
|
62
|
-
var chunkIJIUUBFT_js = require('./chunk-IJIUUBFT.js');
|
|
63
63
|
var chunkE24VNM6S_js = require('./chunk-E24VNM6S.js');
|
|
64
|
-
var chunkXXC2YD3D_js = require('./chunk-XXC2YD3D.js');
|
|
65
64
|
require('./chunk-VNURXHKK.js');
|
|
65
|
+
var chunkXXC2YD3D_js = require('./chunk-XXC2YD3D.js');
|
|
66
66
|
var chunkNHB2TI2B_js = require('./chunk-NHB2TI2B.js');
|
|
67
67
|
var chunkEY4ZIR3P_js = require('./chunk-EY4ZIR3P.js');
|
|
68
68
|
var chunkZ5S7LHMY_js = require('./chunk-Z5S7LHMY.js');
|
|
69
|
-
var chunk6EG6EAHW_js = require('./chunk-6EG6EAHW.js');
|
|
70
69
|
var chunkPND5YKFN_js = require('./chunk-PND5YKFN.js');
|
|
70
|
+
var chunk6EG6EAHW_js = require('./chunk-6EG6EAHW.js');
|
|
71
71
|
var chunkH3JNRTAI_js = require('./chunk-H3JNRTAI.js');
|
|
72
72
|
var chunkYZTVHCLK_js = require('./chunk-YZTVHCLK.js');
|
|
73
73
|
var chunkZAUYE2EI_js = require('./chunk-ZAUYE2EI.js');
|
|
@@ -618,10 +618,6 @@ Object.defineProperty(exports, "SearchWidget", {
|
|
|
618
618
|
enumerable: true,
|
|
619
619
|
get: function () { return chunkSEHALSKW_js.SearchWidget; }
|
|
620
620
|
});
|
|
621
|
-
Object.defineProperty(exports, "SectionHeader", {
|
|
622
|
-
enumerable: true,
|
|
623
|
-
get: function () { return chunkOGB5LIXN_js.SectionHeader; }
|
|
624
|
-
});
|
|
625
621
|
Object.defineProperty(exports, "SegmentedControl", {
|
|
626
622
|
enumerable: true,
|
|
627
623
|
get: function () { return chunkQWDKSY6Y_js.SegmentedControl; }
|
|
@@ -634,6 +630,10 @@ Object.defineProperty(exports, "selectVariants", {
|
|
|
634
630
|
enumerable: true,
|
|
635
631
|
get: function () { return chunk3R7PT3JG_js.selectVariants; }
|
|
636
632
|
});
|
|
633
|
+
Object.defineProperty(exports, "SectionHeader", {
|
|
634
|
+
enumerable: true,
|
|
635
|
+
get: function () { return chunkOGB5LIXN_js.SectionHeader; }
|
|
636
|
+
});
|
|
637
637
|
Object.defineProperty(exports, "Sidebar", {
|
|
638
638
|
enumerable: true,
|
|
639
639
|
get: function () { return chunkDS4LM7OS_js.Sidebar; }
|
|
@@ -666,6 +666,10 @@ Object.defineProperty(exports, "progressFillVariants", {
|
|
|
666
666
|
enumerable: true,
|
|
667
667
|
get: function () { return chunkPG4I4NWO_js.progressFillVariants; }
|
|
668
668
|
});
|
|
669
|
+
Object.defineProperty(exports, "RadioGroup", {
|
|
670
|
+
enumerable: true,
|
|
671
|
+
get: function () { return chunkGXKON34B_js.RadioGroup; }
|
|
672
|
+
});
|
|
669
673
|
Object.defineProperty(exports, "PromoBanner", {
|
|
670
674
|
enumerable: true,
|
|
671
675
|
get: function () { return chunkPRDIS2VR_js.PromoBanner; }
|
|
@@ -674,10 +678,6 @@ Object.defineProperty(exports, "promoBannerVariants", {
|
|
|
674
678
|
enumerable: true,
|
|
675
679
|
get: function () { return chunkPRDIS2VR_js.promoBannerVariants; }
|
|
676
680
|
});
|
|
677
|
-
Object.defineProperty(exports, "RadioGroup", {
|
|
678
|
-
enumerable: true,
|
|
679
|
-
get: function () { return chunkGXKON34B_js.RadioGroup; }
|
|
680
|
-
});
|
|
681
681
|
Object.defineProperty(exports, "Rating", {
|
|
682
682
|
enumerable: true,
|
|
683
683
|
get: function () { return chunkTZHT7NZU_js.Rating; }
|
|
@@ -716,11 +716,11 @@ Object.defineProperty(exports, "ImpactCard", {
|
|
|
716
716
|
});
|
|
717
717
|
Object.defineProperty(exports, "Input", {
|
|
718
718
|
enumerable: true,
|
|
719
|
-
get: function () { return
|
|
719
|
+
get: function () { return chunk5UNG2O64_js.Input; }
|
|
720
720
|
});
|
|
721
721
|
Object.defineProperty(exports, "inputVariants", {
|
|
722
722
|
enumerable: true,
|
|
723
|
-
get: function () { return
|
|
723
|
+
get: function () { return chunk5UNG2O64_js.inputVariants; }
|
|
724
724
|
});
|
|
725
725
|
Object.defineProperty(exports, "Lightbox", {
|
|
726
726
|
enumerable: true,
|
|
@@ -744,7 +744,7 @@ Object.defineProperty(exports, "MobileMenu", {
|
|
|
744
744
|
});
|
|
745
745
|
Object.defineProperty(exports, "Modal", {
|
|
746
746
|
enumerable: true,
|
|
747
|
-
get: function () { return
|
|
747
|
+
get: function () { return chunkHH4X2JYO_js.Modal; }
|
|
748
748
|
});
|
|
749
749
|
Object.defineProperty(exports, "FloatingDock", {
|
|
750
750
|
enumerable: true,
|
|
@@ -752,7 +752,7 @@ Object.defineProperty(exports, "FloatingDock", {
|
|
|
752
752
|
});
|
|
753
753
|
Object.defineProperty(exports, "Footer", {
|
|
754
754
|
enumerable: true,
|
|
755
|
-
get: function () { return
|
|
755
|
+
get: function () { return chunkEQPT6VZF_js.Footer; }
|
|
756
756
|
});
|
|
757
757
|
Object.defineProperty(exports, "GuestPicker", {
|
|
758
758
|
enumerable: true,
|
|
@@ -794,33 +794,37 @@ Object.defineProperty(exports, "DropdownMenu", {
|
|
|
794
794
|
enumerable: true,
|
|
795
795
|
get: function () { return chunkT5FLQQP6_js.DropdownMenu; }
|
|
796
796
|
});
|
|
797
|
-
Object.defineProperty(exports, "DualRangeSlider", {
|
|
798
|
-
enumerable: true,
|
|
799
|
-
get: function () { return chunkTDGU5Y2P_js.DualRangeSlider; }
|
|
800
|
-
});
|
|
801
797
|
Object.defineProperty(exports, "EmptyState", {
|
|
802
798
|
enumerable: true,
|
|
803
799
|
get: function () { return chunkIEHX4DU6_js.EmptyState; }
|
|
804
800
|
});
|
|
801
|
+
Object.defineProperty(exports, "DualRangeSlider", {
|
|
802
|
+
enumerable: true,
|
|
803
|
+
get: function () { return chunkTDGU5Y2P_js.DualRangeSlider; }
|
|
804
|
+
});
|
|
805
805
|
Object.defineProperty(exports, "ErrorBoundary", {
|
|
806
806
|
enumerable: true,
|
|
807
807
|
get: function () { return chunkS5TLUDNM_js.ErrorBoundary; }
|
|
808
808
|
});
|
|
809
|
+
Object.defineProperty(exports, "FilterPill", {
|
|
810
|
+
enumerable: true,
|
|
811
|
+
get: function () { return chunkTJDHGNMR_js.FilterPill; }
|
|
812
|
+
});
|
|
809
813
|
Object.defineProperty(exports, "FilterAccordion", {
|
|
810
814
|
enumerable: true,
|
|
811
815
|
get: function () { return chunk7W3TFPIF_js.FilterAccordion; }
|
|
812
816
|
});
|
|
813
|
-
Object.defineProperty(exports, "
|
|
817
|
+
Object.defineProperty(exports, "CardList", {
|
|
814
818
|
enumerable: true,
|
|
815
|
-
get: function () { return
|
|
819
|
+
get: function () { return chunkMY6BYO5F_js.CardList; }
|
|
816
820
|
});
|
|
817
821
|
Object.defineProperty(exports, "Carousel", {
|
|
818
822
|
enumerable: true,
|
|
819
823
|
get: function () { return chunkP7GAKOCX_js.Carousel; }
|
|
820
824
|
});
|
|
821
|
-
Object.defineProperty(exports, "
|
|
825
|
+
Object.defineProperty(exports, "Checkbox", {
|
|
822
826
|
enumerable: true,
|
|
823
|
-
get: function () { return
|
|
827
|
+
get: function () { return chunkIJIUUBFT_js.Checkbox; }
|
|
824
828
|
});
|
|
825
829
|
Object.defineProperty(exports, "Counter", {
|
|
826
830
|
enumerable: true,
|
|
@@ -834,10 +838,6 @@ Object.defineProperty(exports, "DateRangePicker", {
|
|
|
834
838
|
enumerable: true,
|
|
835
839
|
get: function () { return chunkAIA3NHCK_js.DateRangePicker; }
|
|
836
840
|
});
|
|
837
|
-
Object.defineProperty(exports, "Checkbox", {
|
|
838
|
-
enumerable: true,
|
|
839
|
-
get: function () { return chunkIJIUUBFT_js.Checkbox; }
|
|
840
|
-
});
|
|
841
841
|
Object.defineProperty(exports, "DetailList", {
|
|
842
842
|
enumerable: true,
|
|
843
843
|
get: function () { return chunkE24VNM6S_js.DetailList; }
|
|
@@ -866,6 +866,10 @@ Object.defineProperty(exports, "badgeVariants", {
|
|
|
866
866
|
enumerable: true,
|
|
867
867
|
get: function () { return chunkZ5S7LHMY_js.badgeVariants; }
|
|
868
868
|
});
|
|
869
|
+
Object.defineProperty(exports, "BottomNavBar", {
|
|
870
|
+
enumerable: true,
|
|
871
|
+
get: function () { return chunkPND5YKFN_js.BottomNavBar; }
|
|
872
|
+
});
|
|
869
873
|
Object.defineProperty(exports, "Banner", {
|
|
870
874
|
enumerable: true,
|
|
871
875
|
get: function () { return chunk6EG6EAHW_js.Banner; }
|
|
@@ -874,10 +878,6 @@ Object.defineProperty(exports, "bannerVariants", {
|
|
|
874
878
|
enumerable: true,
|
|
875
879
|
get: function () { return chunk6EG6EAHW_js.bannerVariants; }
|
|
876
880
|
});
|
|
877
|
-
Object.defineProperty(exports, "BottomNavBar", {
|
|
878
|
-
enumerable: true,
|
|
879
|
-
get: function () { return chunkPND5YKFN_js.BottomNavBar; }
|
|
880
|
-
});
|
|
881
881
|
Object.defineProperty(exports, "Breadcrumb", {
|
|
882
882
|
enumerable: true,
|
|
883
883
|
get: function () { return chunkH3JNRTAI_js.Breadcrumb; }
|
package/dist/index.mjs
CHANGED
|
@@ -15,30 +15,30 @@ export { Switch, switchThumbVariants, switchTrackVariants } from './chunk-DMCMWO
|
|
|
15
15
|
export { Tabs } from './chunk-VOZPGXQD.mjs';
|
|
16
16
|
export { SearchLoadingChecklist } from './chunk-SRYZ4N7T.mjs';
|
|
17
17
|
export { SearchWidget } from './chunk-DUT3ABEI.mjs';
|
|
18
|
-
export { SectionHeader } from './chunk-DM76AK4A.mjs';
|
|
19
18
|
export { SegmentedControl } from './chunk-36Y7UU32.mjs';
|
|
20
19
|
export { Select, selectVariants } from './chunk-333YD5QI.mjs';
|
|
20
|
+
export { SectionHeader } from './chunk-DM76AK4A.mjs';
|
|
21
21
|
export { Sidebar } from './chunk-MPL35D5G.mjs';
|
|
22
22
|
export { SignInCallout, signInCalloutVariants } from './chunk-Z3KRMKHP.mjs';
|
|
23
23
|
export { Pagination } from './chunk-XQVODPHL.mjs';
|
|
24
24
|
export { PriceDisplay } from './chunk-REXLQTNE.mjs';
|
|
25
25
|
export { ProgressBar, progressBarVariants, progressFillVariants } from './chunk-UGYMWWKT.mjs';
|
|
26
|
-
export { PromoBanner, promoBannerVariants } from './chunk-FNDR3WOZ.mjs';
|
|
27
26
|
export { RadioGroup } from './chunk-F2BUMJYW.mjs';
|
|
27
|
+
export { PromoBanner, promoBannerVariants } from './chunk-FNDR3WOZ.mjs';
|
|
28
28
|
export { Rating } from './chunk-SGDC4IVX.mjs';
|
|
29
29
|
export { RoomTypeCard, RoomTypeCardSkeleton } from './chunk-IGBEBAPY.mjs';
|
|
30
30
|
export { Skeleton, SkeletonCircle, SkeletonImage, SkeletonText } from './chunk-PAHSQMXV.mjs';
|
|
31
31
|
export { SearchBar } from './chunk-KQK7LFWM.mjs';
|
|
32
32
|
export { ImpactCard } from './chunk-IKQYFSBW.mjs';
|
|
33
|
-
export { Input, inputVariants } from './chunk-
|
|
33
|
+
export { Input, inputVariants } from './chunk-JWOV5H6G.mjs';
|
|
34
34
|
export { Lightbox } from './chunk-GBWVIY3C.mjs';
|
|
35
35
|
export { LinkCard } from './chunk-UYDZKAGZ.mjs';
|
|
36
36
|
export { LoadingOverlay } from './chunk-WVEJS2J2.mjs';
|
|
37
37
|
export { MegaMenu } from './chunk-EUEM2D5M.mjs';
|
|
38
38
|
export { MobileMenu } from './chunk-R4DC7XPP.mjs';
|
|
39
|
-
export { Modal } from './chunk-
|
|
39
|
+
export { Modal } from './chunk-N5ZNXNCO.mjs';
|
|
40
40
|
export { FloatingDock } from './chunk-P2SGBTKS.mjs';
|
|
41
|
-
export { Footer } from './chunk-
|
|
41
|
+
export { Footer } from './chunk-4DHZ6MIL.mjs';
|
|
42
42
|
export { GuestPicker } from './chunk-EJ7LDW7E.mjs';
|
|
43
43
|
export { Header } from './chunk-PPDKQ3FF.mjs';
|
|
44
44
|
export { HotelCard } from './chunk-XSSRFA5O.mjs';
|
|
@@ -48,24 +48,24 @@ export { ImageWithFallback } from './chunk-BUXVK2HE.mjs';
|
|
|
48
48
|
export { DogCard } from './chunk-4A3AQ66D.mjs';
|
|
49
49
|
export { Drawer } from './chunk-ZLF7IL3Y.mjs';
|
|
50
50
|
export { DropdownMenu } from './chunk-Q7BKR6O7.mjs';
|
|
51
|
-
export { DualRangeSlider } from './chunk-ERL3WXNY.mjs';
|
|
52
51
|
export { EmptyState } from './chunk-OCUHCDAQ.mjs';
|
|
52
|
+
export { DualRangeSlider } from './chunk-ERL3WXNY.mjs';
|
|
53
53
|
export { ErrorBoundary } from './chunk-5257MWFI.mjs';
|
|
54
|
-
export { FilterAccordion } from './chunk-VQVRKRSM.mjs';
|
|
55
54
|
export { FilterPill } from './chunk-YKBASX5A.mjs';
|
|
56
|
-
export {
|
|
55
|
+
export { FilterAccordion } from './chunk-VQVRKRSM.mjs';
|
|
57
56
|
export { CardList } from './chunk-RJWHPHHX.mjs';
|
|
57
|
+
export { Carousel } from './chunk-OOPP4ES2.mjs';
|
|
58
|
+
export { Checkbox } from './chunk-EEIPCJQ2.mjs';
|
|
58
59
|
export { Counter } from './chunk-LRNSVRUN.mjs';
|
|
59
60
|
export { DatePickerInput, DateRangePicker } from './chunk-FL3GD5FJ.mjs';
|
|
60
|
-
export { Checkbox } from './chunk-EEIPCJQ2.mjs';
|
|
61
61
|
export { DetailList } from './chunk-N6THLJIG.mjs';
|
|
62
|
-
export { Divider } from './chunk-E4B6LXK7.mjs';
|
|
63
62
|
import './chunk-OZULAGYL.mjs';
|
|
63
|
+
export { Divider } from './chunk-E4B6LXK7.mjs';
|
|
64
64
|
export { Autocomplete, autocompleteInputVariants } from './chunk-B47HQHX3.mjs';
|
|
65
65
|
export { Avatar } from './chunk-2POGTS27.mjs';
|
|
66
66
|
export { Badge, badgeVariants } from './chunk-XZU2SISM.mjs';
|
|
67
|
-
export { Banner, bannerVariants } from './chunk-LFIZX2S6.mjs';
|
|
68
67
|
export { BottomNavBar } from './chunk-UQRQZLMQ.mjs';
|
|
68
|
+
export { Banner, bannerVariants } from './chunk-LFIZX2S6.mjs';
|
|
69
69
|
export { Breadcrumb, breadcrumbVariants } from './chunk-UKCH6RYL.mjs';
|
|
70
70
|
export { Button, buttonVariants } from './chunk-4U5MNA3B.mjs';
|
|
71
71
|
export { Card, CardContent, CardDescription, CardImage, CardTitle, cardImageVariants, cardVariants } from './chunk-V5J2XLPD.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { F as FontSizeValue } from './typography-BUlhEnfy.mjs';
|
|
2
2
|
|
|
3
|
-
declare const
|
|
3
|
+
declare const toutoutripPreset: {
|
|
4
4
|
theme: {
|
|
5
5
|
extend: {
|
|
6
6
|
colors: {
|
|
@@ -167,4 +167,4 @@ declare const dododogPreset: {
|
|
|
167
167
|
};
|
|
168
168
|
};
|
|
169
169
|
|
|
170
|
-
export {
|
|
170
|
+
export { toutoutripPreset };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { F as FontSizeValue } from './typography-BUlhEnfy.js';
|
|
2
2
|
|
|
3
|
-
declare const
|
|
3
|
+
declare const toutoutripPreset: {
|
|
4
4
|
theme: {
|
|
5
5
|
extend: {
|
|
6
6
|
colors: {
|
|
@@ -167,4 +167,4 @@ declare const dododogPreset: {
|
|
|
167
167
|
};
|
|
168
168
|
};
|
|
169
169
|
|
|
170
|
-
export {
|
|
170
|
+
export { toutoutripPreset };
|
package/dist/tailwind-preset.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var chunk2XH74PQR_js = require('./chunk-2XH74PQR.js');
|
|
4
4
|
|
|
5
5
|
// src/tailwind-preset.ts
|
|
6
|
-
var
|
|
6
|
+
var toutoutripPreset = {
|
|
7
7
|
theme: {
|
|
8
8
|
extend: {
|
|
9
9
|
colors: chunk2XH74PQR_js.colors,
|
|
@@ -16,4 +16,4 @@ var dododogPreset = {
|
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
exports.
|
|
19
|
+
exports.toutoutripPreset = toutoutripPreset;
|
package/dist/tailwind-preset.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { animation, keyframes, boxShadow, fontSize, fontFamily, colors } from './chunk-7JYJ7ICL.mjs';
|
|
2
2
|
|
|
3
3
|
// src/tailwind-preset.ts
|
|
4
|
-
var
|
|
4
|
+
var toutoutripPreset = {
|
|
5
5
|
theme: {
|
|
6
6
|
extend: {
|
|
7
7
|
colors,
|
|
@@ -14,4 +14,4 @@ var dododogPreset = {
|
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
export {
|
|
17
|
+
export { toutoutripPreset };
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dododog/ui",
|
|
3
|
-
"version": "0.14.
|
|
4
|
-
"description": "React UI component library for
|
|
3
|
+
"version": "0.14.1",
|
|
4
|
+
"description": "React UI component library for ToutouTrip — pet-friendly travel platform",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"homepage": "https://storybook.
|
|
7
|
+
"homepage": "https://storybook.toutoutrip.com",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"react",
|
|
10
10
|
"ui",
|
|
11
11
|
"components",
|
|
12
12
|
"tailwindcss",
|
|
13
13
|
"design-system",
|
|
14
|
-
"
|
|
14
|
+
"toutoutrip"
|
|
15
15
|
],
|
|
16
16
|
"files": [
|
|
17
17
|
"dist",
|
|
@@ -417,25 +417,19 @@
|
|
|
417
417
|
"main": "./dist/index.js",
|
|
418
418
|
"module": "./dist/index.mjs",
|
|
419
419
|
"types": "./dist/index.d.ts",
|
|
420
|
-
"scripts": {
|
|
421
|
-
"build": "NODE_OPTIONS='--max-old-space-size=8192' tsup",
|
|
422
|
-
"dev": "tsup --watch",
|
|
423
|
-
"lint": "eslint . --max-warnings 0",
|
|
424
|
-
"clean": "rm -rf .turbo node_modules dist"
|
|
425
|
-
},
|
|
426
420
|
"peerDependencies": {
|
|
427
421
|
"react": ">=18",
|
|
428
422
|
"tailwindcss": ">=3"
|
|
429
423
|
},
|
|
430
424
|
"devDependencies": {
|
|
431
|
-
"@dododog/eslint-config": "workspace:*",
|
|
432
|
-
"@dododog/typescript-config": "workspace:*",
|
|
433
425
|
"@types/react": "^18.2.61",
|
|
434
426
|
"@types/react-dom": "^18.2.19",
|
|
435
427
|
"eslint": "^8.57.0",
|
|
436
428
|
"react": "^18.2.0",
|
|
437
429
|
"tsup": "^8.0.2",
|
|
438
|
-
"typescript": "5.5.4"
|
|
430
|
+
"typescript": "5.5.4",
|
|
431
|
+
"@toutoutrip/eslint-config": "0.0.0",
|
|
432
|
+
"@toutoutrip/typescript-config": "0.0.0"
|
|
439
433
|
},
|
|
440
434
|
"publishConfig": {
|
|
441
435
|
"access": "public"
|
|
@@ -445,5 +439,11 @@
|
|
|
445
439
|
"class-variance-authority": "^0.7.1",
|
|
446
440
|
"clsx": "^2.1.1",
|
|
447
441
|
"tailwind-merge": "^2.6.1"
|
|
442
|
+
},
|
|
443
|
+
"scripts": {
|
|
444
|
+
"build": "NODE_OPTIONS='--max-old-space-size=8192' tsup",
|
|
445
|
+
"dev": "tsup --watch",
|
|
446
|
+
"lint": "eslint . --max-warnings 0",
|
|
447
|
+
"clean": "rm -rf .turbo node_modules dist"
|
|
448
448
|
}
|
|
449
|
-
}
|
|
449
|
+
}
|
package/dist/chunk-74B2EGKT.mjs
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { cn } from './chunk-IMKLN273.mjs';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
-
|
|
5
|
-
var Modal = React.forwardRef(
|
|
6
|
-
({ isOpen, onClose, children, title, className }, ref) => {
|
|
7
|
-
const contentRef = React.useRef(null);
|
|
8
|
-
React.useEffect(() => {
|
|
9
|
-
if (!isOpen) return;
|
|
10
|
-
const handleKeyDown = (e) => {
|
|
11
|
-
if (e.key === "Escape") onClose();
|
|
12
|
-
};
|
|
13
|
-
document.addEventListener("keydown", handleKeyDown);
|
|
14
|
-
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
15
|
-
}, [isOpen, onClose]);
|
|
16
|
-
React.useEffect(() => {
|
|
17
|
-
if (!isOpen) return;
|
|
18
|
-
const prev = document.body.style.overflow;
|
|
19
|
-
document.body.style.overflow = "hidden";
|
|
20
|
-
return () => {
|
|
21
|
-
document.body.style.overflow = prev;
|
|
22
|
-
};
|
|
23
|
-
}, [isOpen]);
|
|
24
|
-
React.useEffect(() => {
|
|
25
|
-
if (!isOpen || !contentRef.current) return;
|
|
26
|
-
const focusable = contentRef.current.querySelectorAll(
|
|
27
|
-
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
28
|
-
);
|
|
29
|
-
if (focusable.length > 0) focusable[0].focus();
|
|
30
|
-
}, [isOpen]);
|
|
31
|
-
if (!isOpen) return null;
|
|
32
|
-
return /* @__PURE__ */ jsxs(
|
|
33
|
-
"div",
|
|
34
|
-
{
|
|
35
|
-
ref,
|
|
36
|
-
className: "fixed inset-0 z-50 flex items-center justify-center p-4",
|
|
37
|
-
role: "dialog",
|
|
38
|
-
"aria-modal": "true",
|
|
39
|
-
"aria-label": title,
|
|
40
|
-
children: [
|
|
41
|
-
/* @__PURE__ */ jsx(
|
|
42
|
-
"div",
|
|
43
|
-
{
|
|
44
|
-
className: "absolute inset-0 bg-black/50",
|
|
45
|
-
onClick: onClose,
|
|
46
|
-
"aria-hidden": "true"
|
|
47
|
-
}
|
|
48
|
-
),
|
|
49
|
-
/* @__PURE__ */ jsxs(
|
|
50
|
-
"div",
|
|
51
|
-
{
|
|
52
|
-
ref: contentRef,
|
|
53
|
-
className: cn(
|
|
54
|
-
"relative bg-white rounded-2xl shadow-xl max-w-md w-full max-h-[90vh] overflow-auto",
|
|
55
|
-
className
|
|
56
|
-
),
|
|
57
|
-
children: [
|
|
58
|
-
title && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-6 pt-6 pb-2", children: [
|
|
59
|
-
/* @__PURE__ */ jsx("h2", { className: "text-lg font-heading font-semibold text-primary", children: title }),
|
|
60
|
-
/* @__PURE__ */ jsx(
|
|
61
|
-
"button",
|
|
62
|
-
{
|
|
63
|
-
type: "button",
|
|
64
|
-
onClick: onClose,
|
|
65
|
-
className: "text-text-muted hover:text-primary transition-colors",
|
|
66
|
-
"aria-label": "Fermer",
|
|
67
|
-
children: /* @__PURE__ */ jsxs(
|
|
68
|
-
"svg",
|
|
69
|
-
{
|
|
70
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
71
|
-
width: "20",
|
|
72
|
-
height: "20",
|
|
73
|
-
viewBox: "0 0 24 24",
|
|
74
|
-
fill: "none",
|
|
75
|
-
stroke: "currentColor",
|
|
76
|
-
strokeWidth: "2",
|
|
77
|
-
strokeLinecap: "round",
|
|
78
|
-
strokeLinejoin: "round",
|
|
79
|
-
children: [
|
|
80
|
-
/* @__PURE__ */ jsx("path", { d: "M18 6 6 18" }),
|
|
81
|
-
/* @__PURE__ */ jsx("path", { d: "m6 6 12 12" })
|
|
82
|
-
]
|
|
83
|
-
}
|
|
84
|
-
)
|
|
85
|
-
}
|
|
86
|
-
)
|
|
87
|
-
] }),
|
|
88
|
-
/* @__PURE__ */ jsx("div", { className: cn(title ? "px-6 pb-6" : "p-6"), children })
|
|
89
|
-
]
|
|
90
|
-
}
|
|
91
|
-
)
|
|
92
|
-
]
|
|
93
|
-
}
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
|
-
);
|
|
97
|
-
Modal.displayName = "Modal";
|
|
98
|
-
|
|
99
|
-
export { Modal };
|