@dododog/ui 0.14.1 → 0.16.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-5KOWMIWK.mjs +110 -0
- package/dist/{chunk-MCF3EQTV.js → chunk-73BHQJW6.js} +13 -1
- package/dist/{chunk-U3XWNFHH.js → chunk-A3M3XQ35.js} +96 -29
- package/dist/chunk-CPBDDGRX.mjs +572 -0
- package/dist/chunk-DJTFRMRY.js +595 -0
- package/dist/{chunk-NHB2TI2B.js → chunk-FHAWYXPX.js} +1 -1
- package/dist/{chunk-5UNG2O64.js → chunk-FR46MMNP.js} +7 -1
- package/dist/{chunk-I4S3R6C6.js → chunk-JUB3NGJR.js} +51 -6
- package/dist/chunk-JWQ2OUEG.js +132 -0
- package/dist/{chunk-EEIPCJQ2.mjs → chunk-KWQKC5TG.mjs} +1 -1
- package/dist/{chunk-IJIUUBFT.js → chunk-OUN5BU4Z.js} +1 -1
- package/dist/{chunk-DMCMWOBJ.mjs → chunk-PBXH4I5N.mjs} +51 -6
- package/dist/{chunk-ERL3WXNY.mjs → chunk-PZZWQ6IG.mjs} +5 -5
- package/dist/{chunk-L7OYR6U3.js → chunk-R4G5LFPN.js} +1 -1
- package/dist/{chunk-F2BUMJYW.mjs → chunk-RBVTV3LA.mjs} +1 -1
- package/dist/{chunk-B47HQHX3.mjs → chunk-RGZHSI2G.mjs} +1 -1
- package/dist/{chunk-GXKON34B.js → chunk-RTI25IBR.js} +1 -1
- package/dist/{chunk-GBWVIY3C.mjs → chunk-UJEIFKSK.mjs} +96 -29
- package/dist/{chunk-3R7PT3JG.js → chunk-USJDHMKS.js} +40 -6
- package/dist/{chunk-333YD5QI.mjs → chunk-WNBZXXFA.mjs} +40 -6
- package/dist/chunk-WY24TZ4R.mjs +94 -0
- package/dist/{chunk-JWOV5H6G.mjs → chunk-X53C3IQC.mjs} +7 -1
- package/dist/chunk-XBNIHUSG.js +116 -0
- package/dist/{chunk-TDGU5Y2P.js → chunk-XOFTU3T7.js} +5 -5
- package/dist/{chunk-NZ7GF6RF.mjs → chunk-YOMOULLR.mjs} +13 -1
- package/dist/{chunk-ZZ4EWC53.mjs → chunk-Z7CF7EQJ.mjs} +1 -1
- package/dist/components/Accordion/index.js +2 -2
- package/dist/components/Accordion/index.mjs +1 -1
- package/dist/components/Autocomplete/index.js +3 -3
- package/dist/components/Autocomplete/index.mjs +1 -1
- package/dist/components/Checkbox/index.js +2 -2
- package/dist/components/Checkbox/index.mjs +1 -1
- package/dist/components/Counter/index.d.mts +12 -0
- package/dist/components/Counter/index.d.ts +12 -0
- package/dist/components/Counter/index.js +2 -2
- package/dist/components/Counter/index.mjs +1 -1
- package/dist/components/DateRangePicker/index.d.mts +7 -1
- package/dist/components/DateRangePicker/index.d.ts +7 -1
- package/dist/components/DateRangePicker/index.js +3 -3
- package/dist/components/DateRangePicker/index.mjs +1 -1
- package/dist/components/Drawer/index.d.mts +21 -1
- package/dist/components/Drawer/index.d.ts +21 -1
- package/dist/components/Drawer/index.js +2 -2
- package/dist/components/Drawer/index.mjs +1 -1
- package/dist/components/DualRangeSlider/index.js +2 -2
- package/dist/components/DualRangeSlider/index.mjs +1 -1
- package/dist/components/Input/index.js +3 -3
- package/dist/components/Input/index.mjs +1 -1
- package/dist/components/Lightbox/index.d.mts +2 -0
- package/dist/components/Lightbox/index.d.ts +2 -0
- package/dist/components/Lightbox/index.js +2 -2
- package/dist/components/Lightbox/index.mjs +1 -1
- package/dist/components/RadioGroup/index.js +2 -2
- package/dist/components/RadioGroup/index.mjs +1 -1
- package/dist/components/Select/index.d.mts +8 -0
- package/dist/components/Select/index.d.ts +8 -0
- package/dist/components/Select/index.js +3 -3
- package/dist/components/Select/index.mjs +1 -1
- package/dist/components/Switch/index.d.mts +41 -1
- package/dist/components/Switch/index.d.ts +41 -1
- package/dist/components/Switch/index.js +4 -4
- package/dist/components/Switch/index.mjs +1 -1
- package/dist/components/Textarea/index.js +3 -3
- package/dist/components/Textarea/index.mjs +1 -1
- package/dist/index.js +81 -81
- package/dist/index.mjs +20 -20
- package/package.json +1 -1
- package/dist/chunk-AIA3NHCK.js +0 -373
- package/dist/chunk-FL3GD5FJ.mjs +0 -350
- package/dist/chunk-LRNSVRUN.mjs +0 -55
- package/dist/chunk-T4AT3YCT.js +0 -77
- package/dist/chunk-VWFY24XF.js +0 -89
- package/dist/chunk-ZLF7IL3Y.mjs +0 -67
|
@@ -57,14 +57,27 @@ var Select = React__namespace.forwardRef(
|
|
|
57
57
|
placeholder,
|
|
58
58
|
value,
|
|
59
59
|
onChange,
|
|
60
|
-
disabled = false
|
|
60
|
+
disabled = false,
|
|
61
|
+
id,
|
|
62
|
+
"aria-label": ariaLabel,
|
|
63
|
+
"aria-labelledby": ariaLabelledBy,
|
|
64
|
+
"aria-describedby": ariaDescribedBy
|
|
61
65
|
}, ref) => {
|
|
62
66
|
const [isOpen, setIsOpen] = React__namespace.useState(false);
|
|
63
67
|
const [highlightedIndex, setHighlightedIndex] = React__namespace.useState(-1);
|
|
64
68
|
const containerRef = React__namespace.useRef(null);
|
|
65
69
|
const listboxRef = React__namespace.useRef(null);
|
|
70
|
+
const generatedId = React__namespace.useId();
|
|
71
|
+
const selectId = id ?? generatedId;
|
|
72
|
+
const labelId = `${selectId}-label`;
|
|
73
|
+
const listboxId = `${selectId}-listbox`;
|
|
74
|
+
const errorId = `${selectId}-error`;
|
|
75
|
+
const optionId = (index) => `${selectId}-option-${index}`;
|
|
66
76
|
const resolvedVariant = error ? "error" : variant ?? "default";
|
|
67
77
|
const selectedOption = options.find((o) => o.value === value);
|
|
78
|
+
const labelledBy = [label ? labelId : null, ariaLabelledBy].filter(Boolean).join(" ") || void 0;
|
|
79
|
+
const describedBy = [ariaDescribedBy, error ? errorId : null].filter(Boolean).join(" ") || void 0;
|
|
80
|
+
const hasHighlight = isOpen && highlightedIndex >= 0 && highlightedIndex < options.length;
|
|
68
81
|
React__namespace.useEffect(() => {
|
|
69
82
|
const handleClickOutside = (e) => {
|
|
70
83
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
@@ -133,18 +146,34 @@ var Select = React__namespace.forwardRef(
|
|
|
133
146
|
}
|
|
134
147
|
};
|
|
135
148
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full", ref, children: [
|
|
136
|
-
label && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
137
|
-
label,
|
|
138
|
-
|
|
139
|
-
|
|
149
|
+
label && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
150
|
+
"label",
|
|
151
|
+
{
|
|
152
|
+
id: labelId,
|
|
153
|
+
htmlFor: selectId,
|
|
154
|
+
className: "block text-sm font-medium text-primary mb-1.5",
|
|
155
|
+
children: [
|
|
156
|
+
label,
|
|
157
|
+
required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-secondary", "aria-hidden": "true", children: " *" })
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
),
|
|
140
161
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { ref: containerRef, className: "relative", children: [
|
|
141
162
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
142
163
|
"button",
|
|
143
164
|
{
|
|
144
165
|
type: "button",
|
|
166
|
+
id: selectId,
|
|
145
167
|
role: "combobox",
|
|
146
168
|
"aria-expanded": isOpen,
|
|
147
169
|
"aria-haspopup": "listbox",
|
|
170
|
+
"aria-controls": isOpen ? listboxId : void 0,
|
|
171
|
+
"aria-activedescendant": hasHighlight ? optionId(highlightedIndex) : void 0,
|
|
172
|
+
"aria-labelledby": labelledBy,
|
|
173
|
+
"aria-label": labelledBy ? void 0 : ariaLabel,
|
|
174
|
+
"aria-required": required ? true : void 0,
|
|
175
|
+
"aria-invalid": error ? true : void 0,
|
|
176
|
+
"aria-describedby": describedBy,
|
|
148
177
|
disabled,
|
|
149
178
|
onClick: handleToggle,
|
|
150
179
|
onKeyDown: handleKeyDown,
|
|
@@ -170,6 +199,7 @@ var Select = React__namespace.forwardRef(
|
|
|
170
199
|
strokeWidth: "2",
|
|
171
200
|
strokeLinecap: "round",
|
|
172
201
|
strokeLinejoin: "round",
|
|
202
|
+
"aria-hidden": "true",
|
|
173
203
|
className: chunkADIDI7AJ_js.cn(
|
|
174
204
|
"absolute right-3 top-1/2 -translate-y-1/2 text-text-muted pointer-events-none transition-transform",
|
|
175
205
|
isOpen && "rotate-180"
|
|
@@ -181,12 +211,16 @@ var Select = React__namespace.forwardRef(
|
|
|
181
211
|
"ul",
|
|
182
212
|
{
|
|
183
213
|
ref: listboxRef,
|
|
214
|
+
id: listboxId,
|
|
184
215
|
role: "listbox",
|
|
216
|
+
"aria-labelledby": labelledBy,
|
|
217
|
+
"aria-label": labelledBy ? void 0 : ariaLabel,
|
|
185
218
|
className: "absolute z-50 mt-1 w-full bg-white border border-gray-200 rounded-xl shadow-lg max-h-60 overflow-auto py-1",
|
|
186
219
|
children: [
|
|
187
220
|
options.map((option, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
188
221
|
"li",
|
|
189
222
|
{
|
|
223
|
+
id: optionId(index),
|
|
190
224
|
role: "option",
|
|
191
225
|
"aria-selected": option.value === value,
|
|
192
226
|
onClick: () => handleSelect(option.value),
|
|
@@ -205,7 +239,7 @@ var Select = React__namespace.forwardRef(
|
|
|
205
239
|
}
|
|
206
240
|
)
|
|
207
241
|
] }),
|
|
208
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-sm text-red-
|
|
242
|
+
error && /* @__PURE__ */ jsxRuntime.jsx("p", { id: errorId, role: "alert", className: "mt-1 text-sm text-red-600", children: error })
|
|
209
243
|
] });
|
|
210
244
|
}
|
|
211
245
|
);
|
|
@@ -35,14 +35,27 @@ var Select = React.forwardRef(
|
|
|
35
35
|
placeholder,
|
|
36
36
|
value,
|
|
37
37
|
onChange,
|
|
38
|
-
disabled = false
|
|
38
|
+
disabled = false,
|
|
39
|
+
id,
|
|
40
|
+
"aria-label": ariaLabel,
|
|
41
|
+
"aria-labelledby": ariaLabelledBy,
|
|
42
|
+
"aria-describedby": ariaDescribedBy
|
|
39
43
|
}, ref) => {
|
|
40
44
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
41
45
|
const [highlightedIndex, setHighlightedIndex] = React.useState(-1);
|
|
42
46
|
const containerRef = React.useRef(null);
|
|
43
47
|
const listboxRef = React.useRef(null);
|
|
48
|
+
const generatedId = React.useId();
|
|
49
|
+
const selectId = id ?? generatedId;
|
|
50
|
+
const labelId = `${selectId}-label`;
|
|
51
|
+
const listboxId = `${selectId}-listbox`;
|
|
52
|
+
const errorId = `${selectId}-error`;
|
|
53
|
+
const optionId = (index) => `${selectId}-option-${index}`;
|
|
44
54
|
const resolvedVariant = error ? "error" : variant ?? "default";
|
|
45
55
|
const selectedOption = options.find((o) => o.value === value);
|
|
56
|
+
const labelledBy = [label ? labelId : null, ariaLabelledBy].filter(Boolean).join(" ") || void 0;
|
|
57
|
+
const describedBy = [ariaDescribedBy, error ? errorId : null].filter(Boolean).join(" ") || void 0;
|
|
58
|
+
const hasHighlight = isOpen && highlightedIndex >= 0 && highlightedIndex < options.length;
|
|
46
59
|
React.useEffect(() => {
|
|
47
60
|
const handleClickOutside = (e) => {
|
|
48
61
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
@@ -111,18 +124,34 @@ var Select = React.forwardRef(
|
|
|
111
124
|
}
|
|
112
125
|
};
|
|
113
126
|
return /* @__PURE__ */ jsxs("div", { className: "w-full", ref, children: [
|
|
114
|
-
label && /* @__PURE__ */ jsxs(
|
|
115
|
-
label,
|
|
116
|
-
|
|
117
|
-
|
|
127
|
+
label && /* @__PURE__ */ jsxs(
|
|
128
|
+
"label",
|
|
129
|
+
{
|
|
130
|
+
id: labelId,
|
|
131
|
+
htmlFor: selectId,
|
|
132
|
+
className: "block text-sm font-medium text-primary mb-1.5",
|
|
133
|
+
children: [
|
|
134
|
+
label,
|
|
135
|
+
required && /* @__PURE__ */ jsx("span", { className: "text-secondary", "aria-hidden": "true", children: " *" })
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
),
|
|
118
139
|
/* @__PURE__ */ jsxs("div", { ref: containerRef, className: "relative", children: [
|
|
119
140
|
/* @__PURE__ */ jsx(
|
|
120
141
|
"button",
|
|
121
142
|
{
|
|
122
143
|
type: "button",
|
|
144
|
+
id: selectId,
|
|
123
145
|
role: "combobox",
|
|
124
146
|
"aria-expanded": isOpen,
|
|
125
147
|
"aria-haspopup": "listbox",
|
|
148
|
+
"aria-controls": isOpen ? listboxId : void 0,
|
|
149
|
+
"aria-activedescendant": hasHighlight ? optionId(highlightedIndex) : void 0,
|
|
150
|
+
"aria-labelledby": labelledBy,
|
|
151
|
+
"aria-label": labelledBy ? void 0 : ariaLabel,
|
|
152
|
+
"aria-required": required ? true : void 0,
|
|
153
|
+
"aria-invalid": error ? true : void 0,
|
|
154
|
+
"aria-describedby": describedBy,
|
|
126
155
|
disabled,
|
|
127
156
|
onClick: handleToggle,
|
|
128
157
|
onKeyDown: handleKeyDown,
|
|
@@ -148,6 +177,7 @@ var Select = React.forwardRef(
|
|
|
148
177
|
strokeWidth: "2",
|
|
149
178
|
strokeLinecap: "round",
|
|
150
179
|
strokeLinejoin: "round",
|
|
180
|
+
"aria-hidden": "true",
|
|
151
181
|
className: cn(
|
|
152
182
|
"absolute right-3 top-1/2 -translate-y-1/2 text-text-muted pointer-events-none transition-transform",
|
|
153
183
|
isOpen && "rotate-180"
|
|
@@ -159,12 +189,16 @@ var Select = React.forwardRef(
|
|
|
159
189
|
"ul",
|
|
160
190
|
{
|
|
161
191
|
ref: listboxRef,
|
|
192
|
+
id: listboxId,
|
|
162
193
|
role: "listbox",
|
|
194
|
+
"aria-labelledby": labelledBy,
|
|
195
|
+
"aria-label": labelledBy ? void 0 : ariaLabel,
|
|
163
196
|
className: "absolute z-50 mt-1 w-full bg-white border border-gray-200 rounded-xl shadow-lg max-h-60 overflow-auto py-1",
|
|
164
197
|
children: [
|
|
165
198
|
options.map((option, index) => /* @__PURE__ */ jsx(
|
|
166
199
|
"li",
|
|
167
200
|
{
|
|
201
|
+
id: optionId(index),
|
|
168
202
|
role: "option",
|
|
169
203
|
"aria-selected": option.value === value,
|
|
170
204
|
onClick: () => handleSelect(option.value),
|
|
@@ -183,7 +217,7 @@ var Select = React.forwardRef(
|
|
|
183
217
|
}
|
|
184
218
|
)
|
|
185
219
|
] }),
|
|
186
|
-
error && /* @__PURE__ */ jsx("p", { className: "mt-1 text-sm text-red-
|
|
220
|
+
error && /* @__PURE__ */ jsx("p", { id: errorId, role: "alert", className: "mt-1 text-sm text-red-600", children: error })
|
|
187
221
|
] });
|
|
188
222
|
}
|
|
189
223
|
);
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { cn } from './chunk-IMKLN273.mjs';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
var Counter = React.forwardRef(
|
|
6
|
+
({
|
|
7
|
+
value,
|
|
8
|
+
onChange,
|
|
9
|
+
min = 0,
|
|
10
|
+
max = 99,
|
|
11
|
+
label,
|
|
12
|
+
subtitle,
|
|
13
|
+
className,
|
|
14
|
+
"aria-label": ariaLabel,
|
|
15
|
+
"aria-labelledby": ariaLabelledBy,
|
|
16
|
+
decrementLabel,
|
|
17
|
+
incrementLabel
|
|
18
|
+
}, ref) => {
|
|
19
|
+
const generatedId = React.useId();
|
|
20
|
+
const labelId = `${generatedId}-label`;
|
|
21
|
+
const canDecrement = value > min;
|
|
22
|
+
const canIncrement = value < max;
|
|
23
|
+
const labelledBy = [label ? labelId : null, ariaLabelledBy].filter(Boolean).join(" ") || void 0;
|
|
24
|
+
const groupName = label ?? ariaLabel;
|
|
25
|
+
const resolvedDecrementLabel = decrementLabel ?? (groupName ? `Diminuer ${groupName}` : "Diminuer");
|
|
26
|
+
const resolvedIncrementLabel = incrementLabel ?? (groupName ? `Augmenter ${groupName}` : "Augmenter");
|
|
27
|
+
return /* @__PURE__ */ jsxs(
|
|
28
|
+
"div",
|
|
29
|
+
{
|
|
30
|
+
ref,
|
|
31
|
+
role: "group",
|
|
32
|
+
"aria-labelledby": labelledBy,
|
|
33
|
+
"aria-label": labelledBy ? void 0 : ariaLabel,
|
|
34
|
+
className: cn("flex items-center justify-between", className),
|
|
35
|
+
children: [
|
|
36
|
+
(label || subtitle) && /* @__PURE__ */ jsxs("div", { children: [
|
|
37
|
+
label && /* @__PURE__ */ jsx("span", { id: labelId, className: "text-sm font-medium text-primary", children: label }),
|
|
38
|
+
subtitle && /* @__PURE__ */ jsx("span", { className: "block text-xs text-text-secondary", children: subtitle })
|
|
39
|
+
] }),
|
|
40
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
41
|
+
/* @__PURE__ */ jsx(
|
|
42
|
+
"button",
|
|
43
|
+
{
|
|
44
|
+
type: "button",
|
|
45
|
+
disabled: !canDecrement,
|
|
46
|
+
onPointerDown: (e) => e.stopPropagation(),
|
|
47
|
+
onClick: () => canDecrement && onChange?.(value - 1),
|
|
48
|
+
className: cn(
|
|
49
|
+
"w-8 h-8 rounded-full border flex items-center justify-center transition-colors",
|
|
50
|
+
canDecrement ? "border-gray-300 text-primary hover:border-primary hover:bg-primary/5" : "border-gray-200 text-gray-300 cursor-not-allowed"
|
|
51
|
+
),
|
|
52
|
+
"aria-label": resolvedDecrementLabel,
|
|
53
|
+
children: /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/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: "M5 12h14" }) })
|
|
54
|
+
}
|
|
55
|
+
),
|
|
56
|
+
/* @__PURE__ */ jsxs(
|
|
57
|
+
"span",
|
|
58
|
+
{
|
|
59
|
+
"aria-live": "polite",
|
|
60
|
+
"aria-atomic": "true",
|
|
61
|
+
className: "w-8 text-center text-sm font-medium text-primary tabular-nums",
|
|
62
|
+
children: [
|
|
63
|
+
groupName && /* @__PURE__ */ jsx("span", { className: "sr-only", children: `${groupName} : ` }),
|
|
64
|
+
value
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
/* @__PURE__ */ jsx(
|
|
69
|
+
"button",
|
|
70
|
+
{
|
|
71
|
+
type: "button",
|
|
72
|
+
disabled: !canIncrement,
|
|
73
|
+
onPointerDown: (e) => e.stopPropagation(),
|
|
74
|
+
onClick: () => canIncrement && onChange?.(value + 1),
|
|
75
|
+
className: cn(
|
|
76
|
+
"w-8 h-8 rounded-full border flex items-center justify-center transition-colors",
|
|
77
|
+
canIncrement ? "border-gray-300 text-primary hover:border-primary hover:bg-primary/5" : "border-gray-200 text-gray-300 cursor-not-allowed"
|
|
78
|
+
),
|
|
79
|
+
"aria-label": resolvedIncrementLabel,
|
|
80
|
+
children: /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
81
|
+
/* @__PURE__ */ jsx("path", { d: "M5 12h14" }),
|
|
82
|
+
/* @__PURE__ */ jsx("path", { d: "M12 5v14" })
|
|
83
|
+
] })
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
] })
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
Counter.displayName = "Counter";
|
|
93
|
+
|
|
94
|
+
export { Counter };
|
|
@@ -78,7 +78,13 @@ var Input = React.forwardRef(
|
|
|
78
78
|
),
|
|
79
79
|
rightIcon && /* @__PURE__ */ jsx("div", { className: "absolute right-3 top-1/2 -translate-y-1/2 text-text-muted", children: rightIcon })
|
|
80
80
|
] }),
|
|
81
|
-
error &&
|
|
81
|
+
error && // Pas de `role="alert"` ici, contrairement aux autres champs de la
|
|
82
|
+
// bibliotheque : les trois seuls consommateurs de cette prop
|
|
83
|
+
// (BookingForm, PaymentForm, EscalationForm) sont des formulaires du
|
|
84
|
+
// tunnel, et BookingForm annonce deja ses fautes par un resume en
|
|
85
|
+
// region live (TTR-651). Un second canal produirait des annonces
|
|
86
|
+
// concurrentes sur le chemin de paiement.
|
|
87
|
+
/* @__PURE__ */ jsx("p", { id: errorId, className: "mt-1 text-sm text-red-600", children: error })
|
|
82
88
|
] });
|
|
83
89
|
}
|
|
84
90
|
);
|
|
@@ -0,0 +1,116 @@
|
|
|
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
|
+
var Counter = React__namespace.forwardRef(
|
|
28
|
+
({
|
|
29
|
+
value,
|
|
30
|
+
onChange,
|
|
31
|
+
min = 0,
|
|
32
|
+
max = 99,
|
|
33
|
+
label,
|
|
34
|
+
subtitle,
|
|
35
|
+
className,
|
|
36
|
+
"aria-label": ariaLabel,
|
|
37
|
+
"aria-labelledby": ariaLabelledBy,
|
|
38
|
+
decrementLabel,
|
|
39
|
+
incrementLabel
|
|
40
|
+
}, ref) => {
|
|
41
|
+
const generatedId = React__namespace.useId();
|
|
42
|
+
const labelId = `${generatedId}-label`;
|
|
43
|
+
const canDecrement = value > min;
|
|
44
|
+
const canIncrement = value < max;
|
|
45
|
+
const labelledBy = [label ? labelId : null, ariaLabelledBy].filter(Boolean).join(" ") || void 0;
|
|
46
|
+
const groupName = label ?? ariaLabel;
|
|
47
|
+
const resolvedDecrementLabel = decrementLabel ?? (groupName ? `Diminuer ${groupName}` : "Diminuer");
|
|
48
|
+
const resolvedIncrementLabel = incrementLabel ?? (groupName ? `Augmenter ${groupName}` : "Augmenter");
|
|
49
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
ref,
|
|
53
|
+
role: "group",
|
|
54
|
+
"aria-labelledby": labelledBy,
|
|
55
|
+
"aria-label": labelledBy ? void 0 : ariaLabel,
|
|
56
|
+
className: chunkADIDI7AJ_js.cn("flex items-center justify-between", className),
|
|
57
|
+
children: [
|
|
58
|
+
(label || subtitle) && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
59
|
+
label && /* @__PURE__ */ jsxRuntime.jsx("span", { id: labelId, className: "text-sm font-medium text-primary", children: label }),
|
|
60
|
+
subtitle && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block text-xs text-text-secondary", children: subtitle })
|
|
61
|
+
] }),
|
|
62
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
63
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
64
|
+
"button",
|
|
65
|
+
{
|
|
66
|
+
type: "button",
|
|
67
|
+
disabled: !canDecrement,
|
|
68
|
+
onPointerDown: (e) => e.stopPropagation(),
|
|
69
|
+
onClick: () => canDecrement && onChange?.(value - 1),
|
|
70
|
+
className: chunkADIDI7AJ_js.cn(
|
|
71
|
+
"w-8 h-8 rounded-full border flex items-center justify-center transition-colors",
|
|
72
|
+
canDecrement ? "border-gray-300 text-primary hover:border-primary hover:bg-primary/5" : "border-gray-200 text-gray-300 cursor-not-allowed"
|
|
73
|
+
),
|
|
74
|
+
"aria-label": resolvedDecrementLabel,
|
|
75
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/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__ */ jsxRuntime.jsx("path", { d: "M5 12h14" }) })
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
79
|
+
"span",
|
|
80
|
+
{
|
|
81
|
+
"aria-live": "polite",
|
|
82
|
+
"aria-atomic": "true",
|
|
83
|
+
className: "w-8 text-center text-sm font-medium text-primary tabular-nums",
|
|
84
|
+
children: [
|
|
85
|
+
groupName && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: `${groupName} : ` }),
|
|
86
|
+
value
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
91
|
+
"button",
|
|
92
|
+
{
|
|
93
|
+
type: "button",
|
|
94
|
+
disabled: !canIncrement,
|
|
95
|
+
onPointerDown: (e) => e.stopPropagation(),
|
|
96
|
+
onClick: () => canIncrement && onChange?.(value + 1),
|
|
97
|
+
className: chunkADIDI7AJ_js.cn(
|
|
98
|
+
"w-8 h-8 rounded-full border flex items-center justify-center transition-colors",
|
|
99
|
+
canIncrement ? "border-gray-300 text-primary hover:border-primary hover:bg-primary/5" : "border-gray-200 text-gray-300 cursor-not-allowed"
|
|
100
|
+
),
|
|
101
|
+
"aria-label": resolvedIncrementLabel,
|
|
102
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
103
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5 12h14" }),
|
|
104
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 5v14" })
|
|
105
|
+
] })
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
] })
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
Counter.displayName = "Counter";
|
|
115
|
+
|
|
116
|
+
exports.Counter = Counter;
|
|
@@ -52,12 +52,12 @@ var DualRangeSlider = React__namespace.forwardRef(
|
|
|
52
52
|
const labelMin = formatLabel ? formatLabel(valueMin, "min") : String(valueMin);
|
|
53
53
|
const labelMax = formatLabel ? formatLabel(valueMax, "max") : String(valueMax);
|
|
54
54
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: chunkADIDI7AJ_js.cn("w-full", className), children: [
|
|
55
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative h-
|
|
56
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 rounded-full bg-gray-200" }),
|
|
55
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative h-6", children: [
|
|
56
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-x-0 top-1/2 h-2 -translate-y-1/2 rounded-full bg-gray-200" }),
|
|
57
57
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
58
58
|
"div",
|
|
59
59
|
{
|
|
60
|
-
className: "absolute h-
|
|
60
|
+
className: "absolute top-1/2 h-2 -translate-y-1/2 rounded-full bg-secondary",
|
|
61
61
|
style: { left: `${leftPercent}%`, right: `${rightPercent}%` }
|
|
62
62
|
}
|
|
63
63
|
),
|
|
@@ -72,7 +72,7 @@ var DualRangeSlider = React__namespace.forwardRef(
|
|
|
72
72
|
onChange: handleMinChange,
|
|
73
73
|
"aria-label": "Minimum",
|
|
74
74
|
className: chunkADIDI7AJ_js.cn(
|
|
75
|
-
"absolute
|
|
75
|
+
"absolute inset-0 h-6 w-full appearance-none bg-transparent pointer-events-none",
|
|
76
76
|
// Webkit thumb
|
|
77
77
|
"[&::-webkit-slider-thumb]:pointer-events-auto",
|
|
78
78
|
"[&::-webkit-slider-thumb]:appearance-none",
|
|
@@ -104,7 +104,7 @@ var DualRangeSlider = React__namespace.forwardRef(
|
|
|
104
104
|
onChange: handleMaxChange,
|
|
105
105
|
"aria-label": "Maximum",
|
|
106
106
|
className: chunkADIDI7AJ_js.cn(
|
|
107
|
-
"absolute
|
|
107
|
+
"absolute inset-0 h-6 w-full appearance-none bg-transparent pointer-events-none",
|
|
108
108
|
"[&::-webkit-slider-thumb]:pointer-events-auto",
|
|
109
109
|
"[&::-webkit-slider-thumb]:appearance-none",
|
|
110
110
|
"[&::-webkit-slider-thumb]:w-5 [&::-webkit-slider-thumb]:h-5",
|
|
@@ -51,11 +51,15 @@ Accordion.displayName = "Accordion";
|
|
|
51
51
|
function AccordionItem({ title, isOpen, onToggle, children }) {
|
|
52
52
|
const contentRef = React.useRef(null);
|
|
53
53
|
const [height, setHeight] = React.useState(0);
|
|
54
|
+
const baseId = React.useId();
|
|
55
|
+
const headerId = `${baseId}-header`;
|
|
56
|
+
const panelId = `${baseId}-panel`;
|
|
54
57
|
React.useEffect(() => {
|
|
55
58
|
if (contentRef.current) {
|
|
56
59
|
setHeight(isOpen ? contentRef.current.scrollHeight : 0);
|
|
57
60
|
}
|
|
58
61
|
}, [isOpen]);
|
|
62
|
+
const inertProps = isOpen ? {} : { inert: "" };
|
|
59
63
|
return /* @__PURE__ */ jsxs(
|
|
60
64
|
"div",
|
|
61
65
|
{
|
|
@@ -67,8 +71,10 @@ function AccordionItem({ title, isOpen, onToggle, children }) {
|
|
|
67
71
|
/* @__PURE__ */ jsxs(
|
|
68
72
|
"button",
|
|
69
73
|
{
|
|
74
|
+
id: headerId,
|
|
70
75
|
onClick: onToggle,
|
|
71
76
|
"aria-expanded": isOpen,
|
|
77
|
+
"aria-controls": panelId,
|
|
72
78
|
className: "w-full flex items-center justify-between py-5 px-5 text-left group",
|
|
73
79
|
children: [
|
|
74
80
|
/* @__PURE__ */ jsx(
|
|
@@ -84,6 +90,7 @@ function AccordionItem({ title, isOpen, onToggle, children }) {
|
|
|
84
90
|
/* @__PURE__ */ jsx(
|
|
85
91
|
"div",
|
|
86
92
|
{
|
|
93
|
+
"aria-hidden": "true",
|
|
87
94
|
className: cn(
|
|
88
95
|
"w-7 h-7 rounded-full flex items-center justify-center shrink-0 transition-all duration-300",
|
|
89
96
|
isOpen ? "bg-secondary text-white" : "bg-gray-100 text-gray-600 group-hover:bg-secondary/10 group-hover:text-secondary"
|
|
@@ -100,7 +107,12 @@ function AccordionItem({ title, isOpen, onToggle, children }) {
|
|
|
100
107
|
/* @__PURE__ */ jsx(
|
|
101
108
|
"div",
|
|
102
109
|
{
|
|
103
|
-
|
|
110
|
+
id: panelId,
|
|
111
|
+
role: "region",
|
|
112
|
+
"aria-labelledby": headerId,
|
|
113
|
+
"aria-hidden": isOpen ? void 0 : true,
|
|
114
|
+
...inertProps,
|
|
115
|
+
style: { height, visibility: isOpen ? void 0 : "hidden" },
|
|
104
116
|
className: "overflow-hidden transition-all duration-500 ease-out",
|
|
105
117
|
children: /* @__PURE__ */ jsx("div", { ref: contentRef, className: "pb-5 px-5 pr-12", children })
|
|
106
118
|
}
|
|
@@ -43,7 +43,7 @@ var Textarea = React.forwardRef(
|
|
|
43
43
|
...props
|
|
44
44
|
}
|
|
45
45
|
),
|
|
46
|
-
error && /* @__PURE__ */ jsx("p", { className: "mt-1 text-sm text-red-
|
|
46
|
+
error && /* @__PURE__ */ jsx("p", { role: "alert", className: "mt-1 text-sm text-red-600", children: error })
|
|
47
47
|
] });
|
|
48
48
|
}
|
|
49
49
|
);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk73BHQJW6_js = require('../../chunk-73BHQJW6.js');
|
|
4
4
|
require('../../chunk-ADIDI7AJ.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "Accordion", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunk73BHQJW6_js.Accordion; }
|
|
11
11
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Accordion } from '../../chunk-
|
|
1
|
+
export { Accordion } from '../../chunk-YOMOULLR.mjs';
|
|
2
2
|
import '../../chunk-IMKLN273.mjs';
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkFHAWYXPX_js = require('../../chunk-FHAWYXPX.js');
|
|
4
4
|
require('../../chunk-ADIDI7AJ.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "Autocomplete", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkFHAWYXPX_js.Autocomplete; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "autocompleteInputVariants", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkFHAWYXPX_js.autocompleteInputVariants; }
|
|
15
15
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Autocomplete, autocompleteInputVariants } from '../../chunk-
|
|
1
|
+
export { Autocomplete, autocompleteInputVariants } from '../../chunk-RGZHSI2G.mjs';
|
|
2
2
|
import '../../chunk-IMKLN273.mjs';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkOUN5BU4Z_js = require('../../chunk-OUN5BU4Z.js');
|
|
4
4
|
require('../../chunk-ADIDI7AJ.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "Checkbox", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkOUN5BU4Z_js.Checkbox; }
|
|
11
11
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Checkbox } from '../../chunk-
|
|
1
|
+
export { Checkbox } from '../../chunk-KWQKC5TG.mjs';
|
|
2
2
|
import '../../chunk-IMKLN273.mjs';
|
|
@@ -8,6 +8,18 @@ interface CounterProps {
|
|
|
8
8
|
label?: string;
|
|
9
9
|
subtitle?: string;
|
|
10
10
|
className?: string;
|
|
11
|
+
/** Nom accessible du groupe quand aucun `label` visible n'est rendu. */
|
|
12
|
+
"aria-label"?: string;
|
|
13
|
+
/** Id d'un texte externe qui sert de nom accessible au groupe. */
|
|
14
|
+
"aria-labelledby"?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Libelle du bouton « moins ». Par defaut « Diminuer <nom du compteur> » :
|
|
17
|
+
* un simple « Diminuer » ne dit pas quoi, des que plusieurs compteurs
|
|
18
|
+
* cohabitent.
|
|
19
|
+
*/
|
|
20
|
+
decrementLabel?: string;
|
|
21
|
+
/** Libelle du bouton « plus ». Par defaut « Augmenter <nom du compteur> ». */
|
|
22
|
+
incrementLabel?: string;
|
|
11
23
|
}
|
|
12
24
|
declare const Counter: React.ForwardRefExoticComponent<CounterProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
25
|
|
|
@@ -8,6 +8,18 @@ interface CounterProps {
|
|
|
8
8
|
label?: string;
|
|
9
9
|
subtitle?: string;
|
|
10
10
|
className?: string;
|
|
11
|
+
/** Nom accessible du groupe quand aucun `label` visible n'est rendu. */
|
|
12
|
+
"aria-label"?: string;
|
|
13
|
+
/** Id d'un texte externe qui sert de nom accessible au groupe. */
|
|
14
|
+
"aria-labelledby"?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Libelle du bouton « moins ». Par defaut « Diminuer <nom du compteur> » :
|
|
17
|
+
* un simple « Diminuer » ne dit pas quoi, des que plusieurs compteurs
|
|
18
|
+
* cohabitent.
|
|
19
|
+
*/
|
|
20
|
+
decrementLabel?: string;
|
|
21
|
+
/** Libelle du bouton « plus ». Par defaut « Augmenter <nom du compteur> ». */
|
|
22
|
+
incrementLabel?: string;
|
|
11
23
|
}
|
|
12
24
|
declare const Counter: React.ForwardRefExoticComponent<CounterProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
25
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkXBNIHUSG_js = require('../../chunk-XBNIHUSG.js');
|
|
4
4
|
require('../../chunk-ADIDI7AJ.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "Counter", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkXBNIHUSG_js.Counter; }
|
|
11
11
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Counter } from '../../chunk-
|
|
1
|
+
export { Counter } from '../../chunk-WY24TZ4R.mjs';
|
|
2
2
|
import '../../chunk-IMKLN273.mjs';
|