@modoock/components 2.1.0 → 2.3.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/accordion.d.ts.map +1 -1
- package/dist/accordion.js +1 -1
- package/dist/agenda.js +5 -5
- package/dist/avatar.d.ts +40 -0
- package/dist/avatar.d.ts.map +1 -0
- package/dist/avatar.js +91 -0
- package/dist/button.js +1 -1
- package/dist/chart.d.ts +37 -0
- package/dist/chart.d.ts.map +1 -0
- package/dist/chart.js +92 -0
- package/dist/date-picker.d.ts.map +1 -1
- package/dist/date-picker.js +5 -3
- package/dist/drawer.d.ts +26 -0
- package/dist/drawer.d.ts.map +1 -0
- package/dist/drawer.js +125 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/input.js +2 -2
- package/dist/metric-bar.js +1 -1
- package/dist/modal.d.ts.map +1 -1
- package/dist/modal.js +25 -6
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +9 -5
- package/dist/stepper.js +1 -1
- package/dist/switch.d.ts +21 -0
- package/dist/switch.d.ts.map +1 -0
- package/dist/switch.js +27 -0
- package/dist/tab.js +1 -1
- package/dist/table.js +6 -6
- package/dist/toast.d.ts +31 -0
- package/dist/toast.d.ts.map +1 -0
- package/dist/toast.js +165 -0
- package/dist/tooltip.d.ts +18 -0
- package/dist/tooltip.d.ts.map +1 -0
- package/dist/tooltip.js +78 -0
- package/package.json +7 -3
package/dist/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export { default as ClickableButton } from "./button";
|
|
2
2
|
export { default as Input, Textarea } from "./input";
|
|
3
3
|
export { default as Badge } from "./badge";
|
|
4
|
+
export { default as Avatar, AvatarGroup, getAvatarInitials } from "./avatar";
|
|
4
5
|
export { default as Table } from "./table";
|
|
5
6
|
export { Select, MultiSelect, SelectWithSearch, MultiSelectWithSearch, SelectFilter } from "./select";
|
|
6
7
|
export { default as Modal } from "./modal";
|
|
8
|
+
export { default as Drawer } from "./drawer";
|
|
7
9
|
export { default as Tabs } from "./tab";
|
|
8
10
|
export { default as Icon } from "./icon";
|
|
9
11
|
export { default as Loader } from "./loader";
|
|
@@ -12,3 +14,7 @@ export { default as Stepper } from "./stepper";
|
|
|
12
14
|
export { default as Accordion } from "./accordion";
|
|
13
15
|
export { DatePicker, DateTimePicker, DateRangePicker } from "./date-picker";
|
|
14
16
|
export { default as Agenda, AGENDA_STATUS_OPTIONS } from "./agenda";
|
|
17
|
+
export { default as Chart, CHART_COLORS } from "./chart";
|
|
18
|
+
export { Toaster, toast } from "./toast";
|
|
19
|
+
export { default as Switch } from "./switch";
|
|
20
|
+
export { default as Tooltip } from "./tooltip";
|
package/dist/input.js
CHANGED
|
@@ -72,9 +72,9 @@ export default function Input({ label, icon, trailingIcon, state, error, helper,
|
|
|
72
72
|
: state === "invalid" || error
|
|
73
73
|
? "border-danger hover:border-danger focus:border-danger"
|
|
74
74
|
: "";
|
|
75
|
-
return (_jsxs("div", { className: "w-full", children: [label && (_jsxs("label", { htmlFor: inputId, className: LABEL_CLASS, children: [_jsx("span", { className: "truncate", children: label }), required && _jsx(RequiredMark, {})] })), _jsxs("div", { className: "relative w-full", children: [icon && (_jsx("span", { className: "pointer-events-none absolute left-3 top-1/2 flex -translate-y-1/2 items-center text-muted-foreground [&_svg]:size-[var(--icon-small)] [&_svg]:shrink-0 [&_svg]:text-current", children: icon })), _jsx("input", { ref: setRefs, id: inputId, type: resolvedType, disabled: disabled, required: required, "aria-invalid": state === "invalid" || Boolean(error) || undefined, "aria-required": required || undefined, "aria-describedby": describedBy, maxLength: maxLength, value: value, defaultValue: defaultValue, onChange: handleChange, className: `ds-input ${icon ? "pl-9" : ""} ${rightPad} ${toneClass} ${className}`, ...props }), rightCount > 0 && (_jsxs("span", { className: "absolute right-3 top-1/2 flex -translate-y-1/2 items-center gap-inline", children: [state === "valid" && !trailingIcon && (_jsx(Icon, { name: "Check", variant: "success", "aria-hidden": "true" })), !trailingIcon && (state === "invalid" || error) && (_jsx(Icon, { name: "CircleAlert", variant: "danger", "aria-hidden": "true" })), trailingIcon && (_jsx("span", { className: "pointer-events-none text-muted-foreground [&_svg]:size-[var(--icon-small)] [&_svg]:shrink-0 [&_svg]:text-current", children: trailingIcon })), hasClear && (_jsx("button", { type: "button", onClick: handleClear, "aria-label": "Effacer la valeur", className: "flex items-center rounded-small text-muted-foreground transition-colors hover:text-foreground [&_svg]:size-[var(--icon-small)] [&_svg]:shrink-0 [&_svg]:text-current", children: _jsx(Icon, { name: "X", "aria-hidden": "true" }) })), isPassword && (_jsx("button", { type: "button", onClick: () => setShowPassword((prev) => !prev), "aria-label": showPassword
|
|
75
|
+
return (_jsxs("div", { className: "w-full", children: [label && (_jsxs("label", { htmlFor: inputId, className: LABEL_CLASS, children: [_jsx("span", { className: "truncate", children: label }), required && _jsx(RequiredMark, {})] })), _jsxs("div", { className: "relative w-full", children: [icon && (_jsx("span", { className: "pointer-events-none absolute left-3 top-1/2 flex -translate-y-1/2 items-center text-muted-foreground [&_svg]:size-[var(--icon-small)] [&_svg]:shrink-0 [&_svg]:text-current", children: icon })), _jsx("input", { ref: setRefs, id: inputId, type: resolvedType, disabled: disabled, required: required, "aria-invalid": state === "invalid" || Boolean(error) || undefined, "aria-required": required || undefined, "aria-describedby": describedBy, maxLength: maxLength, value: value, defaultValue: defaultValue, onChange: handleChange, className: `ds-input ${icon ? "pl-9" : ""} ${rightPad} ${toneClass} ${className}`, ...props }), rightCount > 0 && (_jsxs("span", { className: "absolute right-3 top-1/2 flex -translate-y-1/2 items-center gap-inline", children: [state === "valid" && !trailingIcon && (_jsx(Icon, { name: "Check", variant: "success", "aria-hidden": "true" })), !trailingIcon && (state === "invalid" || error) && (_jsx(Icon, { name: "CircleAlert", variant: "danger", "aria-hidden": "true" })), trailingIcon && (_jsx("span", { className: "pointer-events-none text-muted-foreground [&_svg]:size-[var(--icon-small)] [&_svg]:shrink-0 [&_svg]:text-current", children: trailingIcon })), hasClear && (_jsx("button", { type: "button", onClick: handleClear, "aria-label": "Effacer la valeur", className: "flex items-center rounded-small text-muted-foreground transition-colors duration-200 ease-out hover:text-foreground motion-reduce:transition-none [&_svg]:size-[var(--icon-small)] [&_svg]:shrink-0 [&_svg]:text-current", children: _jsx(Icon, { name: "X", "aria-hidden": "true" }) })), isPassword && (_jsx("button", { type: "button", onClick: () => setShowPassword((prev) => !prev), "aria-label": showPassword
|
|
76
76
|
? "Masquer le mot de passe"
|
|
77
|
-
: "Afficher le mot de passe", className: "flex items-center rounded-small text-muted-foreground transition-colors hover:text-foreground [&_svg]:size-[var(--icon-small)] [&_svg]:shrink-0 [&_svg]:text-current", children: showPassword ? (_jsx(Icon, { name: "EyeOff", "aria-hidden": "true" })) : (_jsx(Icon, { name: "Eye", "aria-hidden": "true" })) }))] }))] }), (error || helper || counter) && (_jsxs("div", { className: "mt-inline flex items-start justify-between gap-inline", children: [_jsx("div", { className: "min-w-0", children: error ? (_jsx(FieldFeedback, { id: errorId, error: error })) : helper ? (_jsx("p", { id: helperId, className: "text-small text-muted-foreground", children: helper })) : null }), counter && (_jsxs("span", { className: "shrink-0 text-small text-muted-foreground", children: [effectiveValue.length, typeof maxLength === "number" ? ` / ${maxLength}` : ""] }))] }))] }));
|
|
77
|
+
: "Afficher le mot de passe", className: "flex items-center rounded-small text-muted-foreground transition-colors duration-200 ease-out hover:text-foreground motion-reduce:transition-none [&_svg]:size-[var(--icon-small)] [&_svg]:shrink-0 [&_svg]:text-current", children: showPassword ? (_jsx(Icon, { name: "EyeOff", "aria-hidden": "true" })) : (_jsx(Icon, { name: "Eye", "aria-hidden": "true" })) }))] }))] }), (error || helper || counter) && (_jsxs("div", { className: "mt-inline flex items-start justify-between gap-inline", children: [_jsx("div", { className: "min-w-0", children: error ? (_jsx(FieldFeedback, { id: errorId, error: error })) : helper ? (_jsx("p", { id: helperId, className: "text-small text-muted-foreground", children: helper })) : null }), counter && (_jsxs("span", { className: "shrink-0 text-small text-muted-foreground", children: [effectiveValue.length, typeof maxLength === "number" ? ` / ${maxLength}` : ""] }))] }))] }));
|
|
78
78
|
}
|
|
79
79
|
export function Textarea({ label, state, error, helper, required = false, counter = false, id, disabled, maxLength, value, defaultValue, onChange, className = "", ref, ...props }) {
|
|
80
80
|
const generatedId = useId();
|
package/dist/metric-bar.js
CHANGED
|
@@ -15,5 +15,5 @@ const TONE_BG = {
|
|
|
15
15
|
*/
|
|
16
16
|
export default function MetricBar({ value, tone, }) {
|
|
17
17
|
const width = Math.min(100, Math.max(2, value));
|
|
18
|
-
return (_jsxs("div", { className: "flex items-center gap-inline", children: [_jsx("div", { className: "h-1.5 w-24 overflow-hidden rounded-full bg-surface-muted", children: _jsx("div", { className: `h-full rounded-full ${TONE_BG[tone]}`, style: { width: `${width}%` } }) }), _jsxs("span", { className: "text-small text-muted-foreground", children: [value.toFixed(0), " %"] })] }));
|
|
18
|
+
return (_jsxs("div", { className: "flex items-center gap-inline", children: [_jsx("div", { className: "h-1.5 w-24 overflow-hidden rounded-full bg-surface-muted", children: _jsx("div", { className: `h-full rounded-full transition-[width] duration-200 ease-out motion-reduce:transition-none ${TONE_BG[tone]}`, style: { width: `${width}%` } }) }), _jsxs("span", { className: "text-small text-muted-foreground", children: [value.toFixed(0), " %"] })] }));
|
|
19
19
|
}
|
package/dist/modal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../components/ui/modal.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../components/ui/modal.tsx"],"names":[],"mappings":"AAEA,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAQf,UAAU,UAAU;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,aAAa,CAAC,EAAE;QACd,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,IAAI,CAAC;KACrB,CAAC;IACF,eAAe,CAAC,EAAE;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,IAAI,CAAC;KACrB,CAAC;CACH;AAmBD,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAC5B,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,OAAO,EACP,MAAM,EACN,aAAa,EACb,eAAe,GAChB,EAAE,UAAU,sCAiJZ"}
|
package/dist/modal.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useEffect, useId, useRef, } from "react";
|
|
3
|
+
import { useEffect, useId, useRef, useState, } from "react";
|
|
4
4
|
import { createPortal } from "react-dom";
|
|
5
5
|
import Icon from "./icon";
|
|
6
6
|
import ClickableButton from "./button";
|
|
7
|
+
/** Matches Tailwind `duration-200` for enter/exit unmount timing. */
|
|
8
|
+
const ANIMATION_MS = 200;
|
|
7
9
|
/** Selector matching every focusable element the dialog can own. */
|
|
8
10
|
const FOCUSABLE_SELECTOR = [
|
|
9
11
|
"a[href]",
|
|
@@ -25,16 +27,31 @@ export default function Modal({ open, title, children, onClose, footer, primaryA
|
|
|
25
27
|
const panelRef = useRef(null);
|
|
26
28
|
// Element that had focus before the modal opened, restored on close.
|
|
27
29
|
const previouslyFocusedRef = useRef(null);
|
|
28
|
-
|
|
30
|
+
const [present, setPresent] = useState(open);
|
|
31
|
+
const [visible, setVisible] = useState(open);
|
|
32
|
+
// Keep the portal mounted through the exit transition.
|
|
29
33
|
useEffect(() => {
|
|
30
|
-
if (
|
|
34
|
+
if (open) {
|
|
35
|
+
setPresent(true);
|
|
36
|
+
const frame = requestAnimationFrame(() => {
|
|
37
|
+
requestAnimationFrame(() => setVisible(true));
|
|
38
|
+
});
|
|
39
|
+
return () => cancelAnimationFrame(frame);
|
|
40
|
+
}
|
|
41
|
+
setVisible(false);
|
|
42
|
+
const timeout = window.setTimeout(() => setPresent(false), ANIMATION_MS);
|
|
43
|
+
return () => window.clearTimeout(timeout);
|
|
44
|
+
}, [open]);
|
|
45
|
+
// Lock body scroll while the dialog is present (including exit animation).
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (!present)
|
|
31
48
|
return;
|
|
32
49
|
const previousOverflow = document.body.style.overflow;
|
|
33
50
|
document.body.style.overflow = "hidden";
|
|
34
51
|
return () => {
|
|
35
52
|
document.body.style.overflow = previousOverflow;
|
|
36
53
|
};
|
|
37
|
-
}, [
|
|
54
|
+
}, [present]);
|
|
38
55
|
// Close on Escape.
|
|
39
56
|
useEffect(() => {
|
|
40
57
|
if (!open)
|
|
@@ -61,7 +78,7 @@ export default function Modal({ open, title, children, onClose, footer, primaryA
|
|
|
61
78
|
previouslyFocusedRef.current = null;
|
|
62
79
|
};
|
|
63
80
|
}, [open]);
|
|
64
|
-
if (!
|
|
81
|
+
if (!present)
|
|
65
82
|
return null;
|
|
66
83
|
// Keep Tab / Shift+Tab cycling within the dialog panel.
|
|
67
84
|
const handlePanelKeyDown = (event) => {
|
|
@@ -84,5 +101,7 @@ export default function Modal({ open, title, children, onClose, footer, primaryA
|
|
|
84
101
|
last.focus();
|
|
85
102
|
}
|
|
86
103
|
};
|
|
87
|
-
return createPortal(_jsx("div", { className:
|
|
104
|
+
return createPortal(_jsx("div", { className: `fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 transition-opacity duration-200 ease-out motion-reduce:transition-none ${visible ? "opacity-100" : "opacity-0"}`, role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, onClick: onClose, children: _jsxs("div", { ref: panelRef, tabIndex: -1, className: `flex max-h-[90vh] w-full max-w-[560px] flex-col overflow-hidden rounded-large border border-border bg-surface shadow-lg transition-[opacity,transform] duration-200 ease-out motion-reduce:transition-none ${visible
|
|
105
|
+
? "translate-y-0 scale-100 opacity-100"
|
|
106
|
+
: "translate-y-2 scale-95 opacity-0"}`, onClick: (event) => event.stopPropagation(), onKeyDown: handlePanelKeyDown, children: [_jsxs("div", { className: "flex shrink-0 items-center justify-between border-b border-border px-component py-control", children: [_jsx("h2", { id: titleId, className: "text-component-title text-foreground", children: title }), _jsx("button", { type: "button", onClick: onClose, className: "grid size-8 place-items-center rounded-small text-muted-foreground outline-none transition-colors duration-200 ease-out hover:bg-surface-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-primary motion-reduce:transition-none [&_svg]:size-[var(--icon-small)] [&_svg]:shrink-0 [&_svg]:text-current", "aria-label": "Fermer", children: _jsx(Icon, { name: "X", "aria-hidden": "true" }) })] }), _jsx("div", { className: "min-h-0 flex-1 overflow-y-auto overscroll-contain px-component py-control", children: children }), (footer || primaryAction || secondaryAction) && (_jsxs("div", { className: "flex shrink-0 items-center justify-end gap-inline border-t border-border px-component py-control", children: [secondaryAction && (_jsx(ClickableButton, { type: "button", onClick: secondaryAction.onClick, variant: "ghost", children: secondaryAction.label })), footer && footer, primaryAction && (_jsx(ClickableButton, { onClick: primaryAction.onClick, children: primaryAction.label }))] }))] }) }), document.body);
|
|
88
107
|
}
|
package/dist/select.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../components/ui/select.tsx"],"names":[],"mappings":"AAOA,6DAA6D;AAC7D,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,UAAU,eAAe;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,WAAY,SAAQ,eAAe;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED,UAAU,gBAAiB,SAAQ,eAAe;IAChD,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACrC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../components/ui/select.tsx"],"names":[],"mappings":"AAOA,6DAA6D;AAC7D,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,UAAU,eAAe;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,WAAY,SAAQ,eAAe;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED,UAAU,gBAAiB,SAAQ,eAAe;IAChD,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACrC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AA2KD;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,EACrB,KAAK,EACL,OAAO,EACP,KAAK,EACL,QAAQ,EACR,WAA+B,EAC/B,YAAY,GACb,EAAE,WAAW,+BAgCb;AAmDD;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,OAAO,EACP,MAAM,EACN,QAAQ,EACR,WAA+B,EAC/B,YAAY,EACZ,eAAmB,GACpB,EAAE,gBAAgB,+BAgClB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,OAAO,EACP,KAAK,EACL,QAAQ,EACR,WAA+B,EAC/B,YAAY,GACb,EAAE,WAAW,+BAgCb;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,OAAO,EACP,MAAM,EACN,QAAQ,EACR,WAA+B,EAC/B,YAAY,EACZ,eAAmB,GACpB,EAAE,gBAAgB,+BAgClB;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,OAAO,EACP,MAAM,EACN,QAAQ,EACR,WAA0B,EAC1B,YAAY,EACZ,eAAe,GAChB,EAAE,gBAAgB,+BAYlB"}
|
package/dist/select.js
CHANGED
|
@@ -46,7 +46,7 @@ function useDismissibleOpen() {
|
|
|
46
46
|
return { open, setOpen, rootRef };
|
|
47
47
|
}
|
|
48
48
|
function SelectTrigger({ open, onOpenChange, children, }) {
|
|
49
|
-
return (_jsxs("button", { type: "button", "aria-haspopup": "true", "aria-expanded": open, onClick: () => onOpenChange(!open), className: "ds-input flex cursor-pointer items-center justify-between gap-2 text-left [&_svg]:size-[var(--icon-small)] [&_svg]:shrink-0", children: [children, _jsx(Icon, { name: "ChevronDown", variant: "muted", "aria-hidden": "true", className: `transition-transform duration-
|
|
49
|
+
return (_jsxs("button", { type: "button", "aria-haspopup": "true", "aria-expanded": open, onClick: () => onOpenChange(!open), className: "ds-input flex cursor-pointer items-center justify-between gap-2 text-left [&_svg]:size-[var(--icon-small)] [&_svg]:shrink-0", children: [children, _jsx(Icon, { name: "ChevronDown", variant: "muted", "aria-hidden": "true", className: `transition-transform duration-200 ease-out motion-reduce:transition-none ${open ? "rotate-180" : ""}` })] }));
|
|
50
50
|
}
|
|
51
51
|
function SelectDropdown({ open, options, selected, multiple, searchable, searchablePlaceholder = "Rechercher...", onToggle, emptyMessage = "Aucun résultat trouvé.", }) {
|
|
52
52
|
const [searchQuery, setSearchQuery] = useState("");
|
|
@@ -57,11 +57,15 @@ function SelectDropdown({ open, options, selected, multiple, searchable, searcha
|
|
|
57
57
|
return options.filter((option) => option.label.toLowerCase().includes(query) ||
|
|
58
58
|
option.value.toLowerCase().includes(query));
|
|
59
59
|
}, [options, searchQuery]);
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
if (!open)
|
|
62
|
+
setSearchQuery("");
|
|
63
|
+
}, [open]);
|
|
64
|
+
return (_jsxs("div", { "aria-hidden": !open, inert: !open ? true : undefined, className: `absolute top-full z-50 mt-1 max-h-64 w-full min-w-[10rem] overflow-hidden rounded-medium border border-border bg-surface shadow-lg transition-[opacity,transform] duration-200 ease-out motion-reduce:transition-none ${open
|
|
65
|
+
? "pointer-events-auto translate-y-0 opacity-100"
|
|
66
|
+
: "pointer-events-none -translate-y-1 opacity-0"}`, children: [searchable && (_jsx("div", { className: "border-b border-border p-2", children: _jsx(Input, { type: "text", placeholder: searchablePlaceholder, value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), icon: _jsx(Icon, { name: "Search" }), "aria-label": searchablePlaceholder }) })), _jsx("div", { className: "overflow-y-auto", children: filteredOptions.length === 0 ? (_jsx("div", { className: "px-3 py-2 text-sm text-muted-foreground", children: emptyMessage })) : (filteredOptions.map((option) => {
|
|
63
67
|
const isSelected = selected.has(option.value);
|
|
64
|
-
return (_jsxs("div", { className: "flex items-center justify-between px-3 py-2 text-sm text-foreground hover:bg-surface-muted
|
|
68
|
+
return (_jsxs("div", { className: "flex cursor-pointer items-center justify-between px-3 py-2 text-sm text-foreground transition-colors duration-200 ease-out hover:bg-surface-muted motion-reduce:transition-none [&_svg]:size-[var(--icon-small)] [&_svg]:shrink-0", onClick: () => onToggle(option.value), children: [_jsx("span", { children: option.label }), multiple ? (_jsx("div", { className: `flex h-4 w-4 items-center justify-center rounded-sm border transition-[background-color,border-color] duration-200 ease-out motion-reduce:transition-none [&_svg]:size-3 [&_svg]:text-current ${isSelected ? "border-primary bg-primary text-primary-foreground" : "border-muted-foreground"}`, children: isSelected && _jsx(Icon, { name: "Check" }) })) : isSelected ? (_jsx(Icon, { name: "Check", variant: "primary" })) : null] }, option.value));
|
|
65
69
|
})) })] }));
|
|
66
70
|
}
|
|
67
71
|
/**
|
package/dist/stepper.js
CHANGED
|
@@ -33,6 +33,6 @@ export default function Stepper({ steps, currentIndex, complete = false, rejecte
|
|
|
33
33
|
return (_jsx("ol", { "aria-label": label, className: "flex flex-col gap-control md:flex-row md:items-center", children: steps.map((step, index) => {
|
|
34
34
|
const visual = stepState(index, currentIndex, complete, rejected);
|
|
35
35
|
const last = index === steps.length - 1;
|
|
36
|
-
return (_jsxs("li", { className: "flex min-w-0 items-center gap-inline md:flex-1", "aria-label": `${step}, ${STATE_NAME[visual]}`, "aria-current": visual === "current" || visual === "rejected" ? "step" : undefined, children: [_jsx("span", { className: `grid size-8 shrink-0 place-items-center rounded-full text-label ${CIRCLE_CLASS[visual]}`, children: visual === "done" ? (_jsx(Icon, { name: "Check", variant: "white", size: "small", "aria-hidden": "true" })) : (index + 1) }), _jsx("span", { className: `min-w-0 text-label ${LABEL_CLASS[visual]}`, children: step }), last ? null : (_jsx("span", { className: `hidden h-px flex-1 md:block ${visual === "done" ? "bg-success" : "bg-border"}`, "aria-hidden": "true" }))] }, step));
|
|
36
|
+
return (_jsxs("li", { className: "flex min-w-0 items-center gap-inline md:flex-1", "aria-label": `${step}, ${STATE_NAME[visual]}`, "aria-current": visual === "current" || visual === "rejected" ? "step" : undefined, children: [_jsx("span", { className: `grid size-8 shrink-0 place-items-center rounded-full text-label transition-[background-color,color,box-shadow] duration-200 ease-out motion-reduce:transition-none ${CIRCLE_CLASS[visual]}`, children: visual === "done" ? (_jsx(Icon, { name: "Check", variant: "white", size: "small", "aria-hidden": "true" })) : (index + 1) }), _jsx("span", { className: `min-w-0 text-label transition-colors duration-200 ease-out motion-reduce:transition-none ${LABEL_CLASS[visual]}`, children: step }), last ? null : (_jsx("span", { className: `hidden h-px flex-1 md:block ${visual === "done" ? "bg-success" : "bg-border"}`, "aria-hidden": "true" }))] }, step));
|
|
37
37
|
}) }));
|
|
38
38
|
}
|
package/dist/switch.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type SwitchSize = "sm" | "md";
|
|
2
|
+
export interface SwitchProps {
|
|
3
|
+
/** Controlled checked state. */
|
|
4
|
+
checked: boolean;
|
|
5
|
+
onCheckedChange: (checked: boolean) => void;
|
|
6
|
+
/** Visible label — required for accessibility. */
|
|
7
|
+
label: string;
|
|
8
|
+
/** Optional helper text under the label. */
|
|
9
|
+
description?: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
id?: string;
|
|
12
|
+
name?: string;
|
|
13
|
+
size?: SwitchSize;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Interrupteur (switch) — bascule on/off.
|
|
18
|
+
* Identité Modoock : piste primary à l’activation, pastille blanche.
|
|
19
|
+
*/
|
|
20
|
+
export default function Switch({ checked, onCheckedChange, label, description, disabled, id, name, size, className, }: SwitchProps): import("react").JSX.Element;
|
|
21
|
+
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../components/ui/switch.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,CAAC;AAErC,MAAM,WAAW,WAAW;IAC1B,gCAAgC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAiBD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,OAAO,EACP,eAAe,EACf,KAAK,EACL,WAAW,EACX,QAAgB,EAChB,EAAE,EACF,IAAI,EACJ,IAAW,EACX,SAAc,GACf,EAAE,WAAW,+BAmDb"}
|
package/dist/switch.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useId } from "react";
|
|
4
|
+
const TRACK_SIZE = {
|
|
5
|
+
sm: "h-5 w-9",
|
|
6
|
+
md: "h-6 w-11",
|
|
7
|
+
};
|
|
8
|
+
const THUMB_SIZE = {
|
|
9
|
+
sm: "size-4",
|
|
10
|
+
md: "size-5",
|
|
11
|
+
};
|
|
12
|
+
const THUMB_ON = {
|
|
13
|
+
sm: "translate-x-4",
|
|
14
|
+
md: "translate-x-5",
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Interrupteur (switch) — bascule on/off.
|
|
18
|
+
* Identité Modoock : piste primary à l’activation, pastille blanche.
|
|
19
|
+
*/
|
|
20
|
+
export default function Switch({ checked, onCheckedChange, label, description, disabled = false, id, name, size = "md", className = "", }) {
|
|
21
|
+
const generatedId = useId();
|
|
22
|
+
const switchId = id ?? generatedId;
|
|
23
|
+
const descriptionId = description ? `${switchId}-description` : undefined;
|
|
24
|
+
return (_jsxs("div", { className: `inline-flex items-start gap-control ${disabled ? "opacity-60" : ""} ${className}`, children: [_jsx("button", { type: "button", role: "switch", id: switchId, name: name, "aria-checked": checked, "aria-describedby": descriptionId, disabled: disabled, onClick: () => onCheckedChange(!checked), className: `relative inline-flex shrink-0 cursor-pointer items-center rounded-full border p-0.5 outline-none transition-[background-color,border-color] duration-200 ease-out focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:cursor-not-allowed motion-reduce:transition-none ${TRACK_SIZE[size]} ${checked
|
|
25
|
+
? "border-primary bg-primary"
|
|
26
|
+
: "border-border bg-surface-muted"}`, children: _jsx("span", { "aria-hidden": "true", className: `pointer-events-none block rounded-full bg-white shadow-sm transition-transform duration-200 ease-out motion-reduce:transition-none ${THUMB_SIZE[size]} ${checked ? THUMB_ON[size] : "translate-x-0"}` }) }), _jsxs("div", { className: "min-w-0 pt-micro", children: [_jsx("label", { htmlFor: switchId, className: `text-body-medium leading-snug text-foreground ${disabled ? "cursor-not-allowed" : "cursor-pointer"}`, children: label }), description ? (_jsx("p", { id: descriptionId, className: "mt-0 text-small leading-snug text-muted-foreground", children: description })) : null] })] }));
|
|
27
|
+
}
|
package/dist/tab.js
CHANGED
|
@@ -18,7 +18,7 @@ export default function Tabs({ tabs, defaultValue, onChange, children, panelClas
|
|
|
18
18
|
};
|
|
19
19
|
return (_jsxs("div", { className: "flex h-full min-h-0 w-full flex-col", children: [_jsx("div", { role: "tablist", className: "inline-flex max-w-full items-center gap-micro overflow-x-auto rounded-large bg-surface-muted p-micro", children: tabs.map((tab) => {
|
|
20
20
|
const isActive = activeTab === tab.value;
|
|
21
|
-
return (_jsx(ClickableButton, { type: "button", variant: "bare", role: "tab", "aria-selected": isActive, "aria-current": isActive ? "page" : undefined, onClick: () => handleSelect(tab.value), className: `whitespace-nowrap rounded-large px-component py-inline text-body-medium focus-visible:ring-primary ${isActive
|
|
21
|
+
return (_jsx(ClickableButton, { type: "button", variant: "bare", role: "tab", "aria-selected": isActive, "aria-current": isActive ? "page" : undefined, onClick: () => handleSelect(tab.value), className: `whitespace-nowrap rounded-large px-component py-inline text-body-medium transition-[color,background-color,box-shadow] duration-200 ease-out focus-visible:ring-primary motion-reduce:transition-none ${isActive
|
|
22
22
|
? "bg-surface text-primary shadow-sm"
|
|
23
23
|
: "bg-transparent text-muted-foreground hover:text-foreground"}`, children: tab.label }, tab.value));
|
|
24
24
|
}) }), children && _jsx("div", { className: panelClassName, children: children(activeTab) })] }));
|
package/dist/table.js
CHANGED
|
@@ -24,8 +24,8 @@ function CardActionsMenu({ tableActions, rowActions, open, onToggle, onClose, tr
|
|
|
24
24
|
_jsx("div", { onClick: onClose, className: "rounded-small focus-within:ring-primary", children: action.content }, action.label || `derived-${index}`)) : (_jsxs("button", { type: "button", role: "menuitem", onClick: () => {
|
|
25
25
|
onClose();
|
|
26
26
|
action.onSelect();
|
|
27
|
-
}, className: `flex items-center gap-inline whitespace-nowrap rounded-small px-component py-control text-left text-body-medium transition-colors hover:bg-surface-muted focus-visible:ring-primary ${action.danger ? "text-danger" : "text-foreground"}`, children: [action.icon && (_jsx(Icon, { name: action.icon, size: "small", variant: action.danger ? "danger" : "muted", "aria-hidden": "true" })), action.label] }, action.label)));
|
|
28
|
-
return (_jsxs("div", { className: "relative", children: [trigger === "kebab" ? (_jsx(ClickableButton, { type: "button", variant: "ghost", size: "icon", "aria-label": "Plus d'actions", "aria-haspopup": "menu", "aria-expanded": open, onClick: onToggle, className: "text-muted-foreground hover:text-primary focus-visible:ring-primary", children: _jsx(Icon, { name: "EllipsisVertical", "aria-hidden": "true" }) })) : (_jsxs(ClickableButton, { type: "button", variant: "secondary", size: "sm", "aria-haspopup": "menu", "aria-expanded": open, onClick: onToggle, leftIcon: _jsx(Icon, { name: "EllipsisVertical", size: "small" }), children: ["Actions", _jsx(Icon, { name: "ChevronDown", size: "small", className: `transition-transform ${open ? "rotate-180" : ""}` })] })), open && (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", "aria-label": "Fermer le menu", tabIndex: -1, onClick: onClose, className: "fixed inset-0 z-40 cursor-default" }), _jsxs("div", { role: "menu", className: `absolute right-0 z-50 flex min-w-40 max-w-[16rem] flex-col rounded-medium border border-border bg-surface shadow-lg ${direction === "up" ? "bottom-full mb-micro" : "top-full mt-micro"}`, children: [hasGroups && (_jsx("p", { className: "px-component pt-micro text-label text-muted-foreground", children: "Tableau" })), renderGroup(tableActions), hasGroups && _jsx("div", { className: "mx-component my-micro h-px bg-border" }), hasGroups && (_jsx("p", { className: "px-component pt-micro text-label text-muted-foreground", children: "Cette ligne" })), renderGroup(rowActions)] })] }))] }));
|
|
27
|
+
}, className: `flex items-center gap-inline whitespace-nowrap rounded-small px-component py-control text-left text-body-medium transition-colors duration-200 ease-out motion-reduce:transition-none hover:bg-surface-muted focus-visible:ring-primary ${action.danger ? "text-danger" : "text-foreground"}`, children: [action.icon && (_jsx(Icon, { name: action.icon, size: "small", variant: action.danger ? "danger" : "muted", "aria-hidden": "true" })), action.label] }, action.label)));
|
|
28
|
+
return (_jsxs("div", { className: "relative", children: [trigger === "kebab" ? (_jsx(ClickableButton, { type: "button", variant: "ghost", size: "icon", "aria-label": "Plus d'actions", "aria-haspopup": "menu", "aria-expanded": open, onClick: onToggle, className: "text-muted-foreground hover:text-primary focus-visible:ring-primary", children: _jsx(Icon, { name: "EllipsisVertical", "aria-hidden": "true" }) })) : (_jsxs(ClickableButton, { type: "button", variant: "secondary", size: "sm", "aria-haspopup": "menu", "aria-expanded": open, onClick: onToggle, leftIcon: _jsx(Icon, { name: "EllipsisVertical", size: "small" }), children: ["Actions", _jsx(Icon, { name: "ChevronDown", size: "small", className: `transition-transform duration-200 ease-out motion-reduce:transition-none ${open ? "rotate-180" : ""}` })] })), open && (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", "aria-label": "Fermer le menu", tabIndex: -1, onClick: onClose, className: "fixed inset-0 z-40 cursor-default" }), _jsxs("div", { role: "menu", className: `absolute right-0 z-50 flex min-w-40 max-w-[16rem] flex-col rounded-medium border border-border bg-surface shadow-lg ${direction === "up" ? "bottom-full mb-micro" : "top-full mt-micro"}`, children: [hasGroups && (_jsx("p", { className: "px-component pt-micro text-label text-muted-foreground", children: "Tableau" })), renderGroup(tableActions), hasGroups && _jsx("div", { className: "mx-component my-micro h-px bg-border" }), hasGroups && (_jsx("p", { className: "px-component pt-micro text-label text-muted-foreground", children: "Cette ligne" })), renderGroup(rowActions)] })] }))] }));
|
|
29
29
|
}
|
|
30
30
|
function TableActionsBar({ selectAllAction, allSelected, tableActions, open, direction = "down", onToggle, onClose, }) {
|
|
31
31
|
return (_jsxs("div", { className: "flex items-center justify-end gap-inline", children: [selectAllAction ? (_jsx(ClickableButton, { type: "button", variant: "secondary", size: "sm", "aria-pressed": allSelected, onClick: selectAllAction.onSelect, leftIcon: selectAllAction.icon ? (_jsx(Icon, { name: selectAllAction.icon, size: "small", variant: allSelected ? "primary" : "muted", "aria-hidden": "true" })) : undefined, children: selectAllAction.label })) : null, tableActions.length > 0 ? (_jsx(CardActionsMenu, { trigger: "labeled", direction: direction, tableActions: tableActions, rowActions: [], open: open, onToggle: onToggle, onClose: onClose })) : null] }));
|
|
@@ -154,11 +154,11 @@ export default function Table({ columns, data, rowsPerPage = 8, emptyMessage = "
|
|
|
154
154
|
return (_jsx("div", { className: "flex justify-end", children: _jsx(ClickableButton, { type: "button", variant: action.danger ? "danger" : "secondary", size: "sm", onClick: action.onSelect, children: action.label }) }));
|
|
155
155
|
};
|
|
156
156
|
const SortIcon = () => (_jsx(Icon, { name: "ChevronsUpDown", "aria-hidden": "true" }));
|
|
157
|
-
const SortableHeader = ({ column }) => (_jsx("th", { className: "text-left", children: _jsxs(ClickableButton, { type: "button", variant: "bare", onClick: () => handleSort(column), className: "px-component py-control text-muted-foreground transition-colors hover:text-primary focus-visible:ring-primary", children: [_jsx("span", { className: "text-label", children: column.label }), _jsx(SortIcon, {})] }) }));
|
|
157
|
+
const SortableHeader = ({ column }) => (_jsx("th", { className: "text-left", children: _jsxs(ClickableButton, { type: "button", variant: "bare", onClick: () => handleSort(column), className: "px-component py-control text-muted-foreground transition-colors duration-200 ease-out motion-reduce:transition-none hover:text-primary focus-visible:ring-primary", children: [_jsx("span", { className: "text-label", children: column.label }), _jsx(SortIcon, {})] }) }));
|
|
158
158
|
return (_jsxs("div", { className: `flex flex-col overflow-hidden rounded-large border border-border bg-surface md:h-full ${className ?? ""}`, children: [tableActions.length > 0 || selectAllAction ? (_jsx("div", { className: "hidden shrink-0 border-b border-border px-component py-control md:flex md:justify-end", children: _jsx(TableActionsBar, { selectAllAction: selectAllAction, allSelected: allSelected, tableActions: tableActions, open: openMenu === "actions-desktop", onToggle: () => toggleMenu("actions-desktop"), onClose: closeMenus }) })) : null, _jsx("div", { className: "hidden min-h-0 flex-1 overflow-auto md:block", children: _jsx("table", { className: "w-full border-collapse text-body", children: transpose ? (_jsxs(_Fragment, { children: [_jsx("thead", { className: "sticky top-0 z-10 bg-surface-muted", children: _jsxs("tr", { className: "border-b border-border", children: [_jsx("th", { className: "px-component py-control text-left text-label text-muted-foreground", children: transposeLabel ?? columns[0]?.label ?? "" }), data.map((item, i) => (_jsx("th", { className: "px-component py-control text-left", children: transposeHeader ? transposeHeader(item) : null }, i)))] }) }), _jsx("tbody", { children: data.length === 0 ? (_jsx("tr", { children: _jsx("td", { colSpan: 1, className: "px-component py-section text-center text-muted-foreground", children: emptyMessage }) })) : (columns.slice(1).map((column) => (_jsxs("tr", { className: "h-12 border-t border-border", children: [_jsx("td", { className: "px-component align-middle text-label text-muted-foreground", children: column.label }), data.map((item, i) => (_jsx("td", { className: `px-component align-middle ${column.className ?? "text-body-medium text-foreground"}`, children: getCellValue(item, column) }, i)))] }, String(column.key))))) })] })) : (_jsxs(_Fragment, { children: [_jsx("thead", { className: "sticky top-0 z-10 bg-surface-muted", children: _jsxs("tr", { className: "border-b border-border", children: [hasSelectionControl ? (_jsx("th", { className: "w-10 px-component py-control", children: selectAllAction ? (_jsx(ClickableButton, { type: "button", variant: "ghost", size: "icon", "aria-label": selectAllAction.label, "aria-pressed": allSelected, onClick: selectAllAction.onSelect, className: "text-muted-foreground hover:text-primary focus-visible:ring-primary", children: _jsx(Icon, { name: allSelected ? "SquareCheck" : "Square", "aria-hidden": "true" }) })) : null })) : null, visibleColumns.map((column, columnIndex) => column.sortable ? (_jsx(SortableHeader, { column: column }, `col-${columnIndex}`)) : (_jsx("th", { className: "px-component py-control text-left text-label text-muted-foreground", children: column.label }, `col-${columnIndex}`)))] }) }), _jsx("tbody", { children: visibleData.length === 0 ? (_jsx("tr", { children: _jsx("td", { colSpan: columnCount, className: "px-component py-section text-center text-muted-foreground", children: emptyMessage }) })) : (visibleData.map((row, rowIndex) => {
|
|
159
159
|
const rowKey = getRowKey(row, startIndex + rowIndex);
|
|
160
160
|
const selected = selectedKeys?.has(rowKey) ?? false;
|
|
161
|
-
return (_jsxs("tr", { className: "h-12 border-b border-border transition-colors last:border-b-0 hover:bg-surface-muted", children: [hasSelectionControl ? (_jsx("td", { className: "px-component align-middle", children: _jsx(ClickableButton, { type: "button", variant: "ghost", size: "icon", "aria-pressed": selected, "aria-label": selected
|
|
161
|
+
return (_jsxs("tr", { className: "h-12 border-b border-border transition-colors duration-200 ease-out motion-reduce:transition-none last:border-b-0 hover:bg-surface-muted", children: [hasSelectionControl ? (_jsx("td", { className: "px-component align-middle", children: _jsx(ClickableButton, { type: "button", variant: "ghost", size: "icon", "aria-pressed": selected, "aria-label": selected
|
|
162
162
|
? "Retirer la sélection"
|
|
163
163
|
: "Sélectionner", onClick: () => onToggleSelect?.(rowKey), className: "text-muted-foreground hover:text-primary focus-visible:ring-primary", children: _jsx(Icon, { name: selected ? "SquareCheck" : "Square", "aria-hidden": "true" }) }) })) : null, visibleColumns.map((column, columnIndex) => (_jsx("td", { className: `px-component align-middle ${column.className ?? "text-body-medium text-foreground"}`, children: cardActions?.row && column === rowActionColumn ? (renderPersonalActions(row, rowKey)) : (getCellValue(row, column)) }, `col-${columnIndex}`)))] }, rowKey));
|
|
164
164
|
})) })] })) }) }), _jsx("div", { className: "md:hidden", children: visibleData.length === 0 ? (_jsx("div", { className: "px-component py-section text-center text-muted-foreground", children: emptyMessage })) : (_jsxs("div", { className: "flex flex-col gap-component p-component", children: [tableActions.length > 0 || selectAllAction ? (_jsx("div", { className: "flex justify-end", children: _jsx(TableActionsBar, { selectAllAction: selectAllAction, allSelected: allSelected, tableActions: tableActions, direction: "down", open: openMenu === "actions-top", onToggle: () => toggleMenu("actions-top"), onClose: closeMenus }) })) : null, visibleData.map((row, rowIndex) => {
|
|
@@ -173,8 +173,8 @@ export default function Table({ columns, data, rowsPerPage = 8, emptyMessage = "
|
|
|
173
173
|
const menuKey = `card:${String(rowKey)}`;
|
|
174
174
|
return (_jsxs("article", { className: "flex flex-col overflow-hidden rounded-large border border-border bg-surface", children: [_jsxs("div", { className: "flex items-center gap-inline bg-surface-muted px-component py-control", children: [hasSelectionControl ? (_jsx("button", { type: "button", onClick: () => onToggleSelect?.(rowKey), "aria-pressed": selectedKeys?.has(rowKey) ?? false, "aria-label": selectedKeys?.has(rowKey)
|
|
175
175
|
? "Retirer la sélection"
|
|
176
|
-
: "Sélectionner", className: "grid size-8 shrink-0 place-items-center rounded-small text-muted-foreground transition-colors hover:text-primary focus-visible:ring-primary", children: _jsx(Icon, { name: selectedKeys?.has(rowKey) ? "SquareCheck" : "Square", size: "default", "aria-hidden": "true" }) })) : (headerControlColumn && (_jsx("div", { className: "shrink-0", children: getCellValue(row, headerControlColumn) }))), _jsx("p", { className: "min-w-0 flex-1 text-component-title text-foreground", children: getCellValue(row, titleColumn) }), rowActions.length > 0 ? (_jsx(CardActionsMenu, { trigger: "kebab", tableActions: [], rowActions: rowActions, open: openMenu === menuKey, onToggle: () => toggleMenu(menuKey), onClose: closeMenus })) : null] }), visiblePairs.map((column) => (_jsxs("div", { className: "flex items-center justify-between gap-inline border-t border-border px-component py-control", children: [_jsx("span", { className: "shrink-0 text-label text-muted-foreground", children: column.label }), _jsx("span", { className: "min-w-0 text-right text-body-medium text-foreground", children: getCellValue(row, column) })] }, String(column.key)))), collapsible && (_jsx("div", { className: "border-t border-border px-component py-control", children: _jsxs(ClickableButton, { type: "button", variant: "bare", onClick: () => toggleCard(rowKey), "aria-expanded": isExpanded, className: "flex items-center gap-micro text-small text-primary transition-colors hover:text-primary focus-visible:ring-primary", children: [_jsx(Icon, { name: "ChevronDown", "aria-hidden": "true", className: `transition-transform ${isExpanded ? "rotate-180" : ""}` }), isExpanded
|
|
176
|
+
: "Sélectionner", className: "grid size-8 shrink-0 place-items-center rounded-small text-muted-foreground transition-colors duration-200 ease-out motion-reduce:transition-none hover:text-primary focus-visible:ring-primary", children: _jsx(Icon, { name: selectedKeys?.has(rowKey) ? "SquareCheck" : "Square", size: "default", "aria-hidden": "true" }) })) : (headerControlColumn && (_jsx("div", { className: "shrink-0", children: getCellValue(row, headerControlColumn) }))), _jsx("p", { className: "min-w-0 flex-1 text-component-title text-foreground", children: getCellValue(row, titleColumn) }), rowActions.length > 0 ? (_jsx(CardActionsMenu, { trigger: "kebab", tableActions: [], rowActions: rowActions, open: openMenu === menuKey, onToggle: () => toggleMenu(menuKey), onClose: closeMenus })) : null] }), visiblePairs.map((column) => (_jsxs("div", { className: "flex items-center justify-between gap-inline border-t border-border px-component py-control", children: [_jsx("span", { className: "shrink-0 text-label text-muted-foreground", children: column.label }), _jsx("span", { className: "min-w-0 text-right text-body-medium text-foreground", children: getCellValue(row, column) })] }, String(column.key)))), collapsible && (_jsx("div", { className: "border-t border-border px-component py-control", children: _jsxs(ClickableButton, { type: "button", variant: "bare", onClick: () => toggleCard(rowKey), "aria-expanded": isExpanded, className: "flex items-center gap-micro text-small text-primary transition-colors duration-200 ease-out motion-reduce:transition-none hover:text-primary focus-visible:ring-primary", children: [_jsx(Icon, { name: "ChevronDown", "aria-hidden": "true", className: `transition-transform duration-200 ease-out motion-reduce:transition-none ${isExpanded ? "rotate-180" : ""}` }), isExpanded
|
|
177
177
|
? "Réduire"
|
|
178
178
|
: `Voir tout (+${contentColumns.length - pairLimit})`] }) })), actionColumn && rowActions.length === 0 ? (_jsx("div", { className: "flex justify-end border-t border-border px-component py-control", children: getCellValue(row, actionColumn) })) : null] }, rowKey));
|
|
179
|
-
}), tableActions.length > 0 || selectAllAction ? (_jsx("div", { className: "flex justify-end", children: _jsx(TableActionsBar, { selectAllAction: selectAllAction, allSelected: allSelected, tableActions: tableActions, direction: "up", open: openMenu === "actions-bottom", onToggle: () => toggleMenu("actions-bottom"), onClose: closeMenus }) })) : null] })) }), totalPages > 1 && (_jsxs("div", { className: "flex items-center justify-between border-t border-border bg-surface px-component py-control", children: [_jsxs("p", { className: "text-small text-muted-foreground", children: [startIndex + 1, "\u2013", Math.min(startIndex + rowsPerPage, sortedData.length), " sur", " ", sortedData.length] }), _jsxs("div", { className: "flex items-center gap-inline", children: [_jsx(ClickableButton, { type: "button", variant: "bare", onClick: () => setCurrentPage((page) => Math.max(1, page - 1)), disabled: safePage === 1, className: "rounded-medium border border-border p-inline text-muted-foreground transition-colors hover:text-primary disabled:opacity-50 focus-visible:ring-primary", "aria-label": "Page pr\u00E9c\u00E9dente", children: _jsx(Icon, { name: "ChevronLeft", "aria-hidden": "true" }) }), _jsxs("span", { className: "text-small text-muted-foreground", children: [safePage, " / ", totalPages] }), _jsx(ClickableButton, { type: "button", variant: "bare", onClick: () => setCurrentPage((page) => Math.min(totalPages, page + 1)), disabled: safePage === totalPages, className: "rounded-medium border border-border p-inline text-muted-foreground transition-colors hover:text-primary disabled:opacity-50 focus-visible:ring-primary", "aria-label": "Page suivante", children: _jsx(Icon, { name: "ChevronRight", "aria-hidden": "true" }) })] })] }))] }));
|
|
179
|
+
}), tableActions.length > 0 || selectAllAction ? (_jsx("div", { className: "flex justify-end", children: _jsx(TableActionsBar, { selectAllAction: selectAllAction, allSelected: allSelected, tableActions: tableActions, direction: "up", open: openMenu === "actions-bottom", onToggle: () => toggleMenu("actions-bottom"), onClose: closeMenus }) })) : null] })) }), totalPages > 1 && (_jsxs("div", { className: "flex items-center justify-between border-t border-border bg-surface px-component py-control", children: [_jsxs("p", { className: "text-small text-muted-foreground", children: [startIndex + 1, "\u2013", Math.min(startIndex + rowsPerPage, sortedData.length), " sur", " ", sortedData.length] }), _jsxs("div", { className: "flex items-center gap-inline", children: [_jsx(ClickableButton, { type: "button", variant: "bare", onClick: () => setCurrentPage((page) => Math.max(1, page - 1)), disabled: safePage === 1, className: "rounded-medium border border-border p-inline text-muted-foreground transition-colors duration-200 ease-out motion-reduce:transition-none hover:text-primary disabled:opacity-50 focus-visible:ring-primary", "aria-label": "Page pr\u00E9c\u00E9dente", children: _jsx(Icon, { name: "ChevronLeft", "aria-hidden": "true" }) }), _jsxs("span", { className: "text-small text-muted-foreground", children: [safePage, " / ", totalPages] }), _jsx(ClickableButton, { type: "button", variant: "bare", onClick: () => setCurrentPage((page) => Math.min(totalPages, page + 1)), disabled: safePage === totalPages, className: "rounded-medium border border-border p-inline text-muted-foreground transition-colors duration-200 ease-out motion-reduce:transition-none hover:text-primary disabled:opacity-50 focus-visible:ring-primary", "aria-label": "Page suivante", children: _jsx(Icon, { name: "ChevronRight", "aria-hidden": "true" }) })] })] }))] }));
|
|
180
180
|
}
|
package/dist/toast.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type ToastVariant = "default" | "success" | "warning" | "danger" | "info";
|
|
2
|
+
export type ToastPosition = "top-right" | "top-left" | "bottom-right" | "bottom-left";
|
|
3
|
+
export interface ToastOptions {
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
variant?: ToastVariant;
|
|
7
|
+
/** Auto-dismiss delay in ms. `0` keeps the toast until closed. Default 4000. */
|
|
8
|
+
duration?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface ToasterProps {
|
|
11
|
+
position?: ToastPosition;
|
|
12
|
+
/** Max visible toasts. Oldest are dismissed first. Default 4. */
|
|
13
|
+
max?: number;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
declare function dismiss(id: string): void;
|
|
17
|
+
export declare const toast: ((options: ToastOptions) => string) & {
|
|
18
|
+
success: (title: string, description: string, options?: Omit<ToastOptions, "title" | "description" | "variant">) => string;
|
|
19
|
+
warning: (title: string, description: string, options?: Omit<ToastOptions, "title" | "description" | "variant">) => string;
|
|
20
|
+
danger: (title: string, description: string, options?: Omit<ToastOptions, "title" | "description" | "variant">) => string;
|
|
21
|
+
info: (title: string, description: string, options?: Omit<ToastOptions, "title" | "description" | "variant">) => string;
|
|
22
|
+
message: (title: string, description: string, options?: Omit<ToastOptions, "title" | "description" | "variant">) => string;
|
|
23
|
+
dismiss: typeof dismiss;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Conteneur des toasts — monter une seule fois (layout racine).
|
|
27
|
+
* Déclencher via `toast.success("…")` / `toast({ title, … })`.
|
|
28
|
+
*/
|
|
29
|
+
export declare function Toaster({ position, max, className, }: ToasterProps): import("react").ReactPortal | null;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=toast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../components/ui/toast.tsx"],"names":[],"mappings":"AAUA,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,SAAS,GACT,SAAS,GACT,QAAQ,GACR,MAAM,CAAC;AAEX,MAAM,MAAM,aAAa,GACrB,WAAW,GACX,UAAU,GACV,cAAc,GACd,aAAa,CAAC;AAElB,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,gFAAgF;IAChF,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,iEAAiE;IACjE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA8CD,iBAAS,OAAO,CAAC,EAAE,EAAE,MAAM,QAU1B;AAmDD,eAAO,MAAM,KAAK,aACN,YAAY;qBAPb,MAAM,eACA,MAAM,YACT,IAAI,CAAC,YAAY,EAAE,OAAO,GAAG,aAAa,GAAG,SAAS,CAAC;qBAF1D,MAAM,eACA,MAAM,YACT,IAAI,CAAC,YAAY,EAAE,OAAO,GAAG,aAAa,GAAG,SAAS,CAAC;oBAF1D,MAAM,eACA,MAAM,YACT,IAAI,CAAC,YAAY,EAAE,OAAO,GAAG,aAAa,GAAG,SAAS,CAAC;kBAF1D,MAAM,eACA,MAAM,YACT,IAAI,CAAC,YAAY,EAAE,OAAO,GAAG,aAAa,GAAG,SAAS,CAAC;qBAF1D,MAAM,eACA,MAAM,YACT,IAAI,CAAC,YAAY,EAAE,OAAO,GAAG,aAAa,GAAG,SAAS,CAAC;;CAcpE,CAAC;AA4HF;;;GAGG;AACH,wBAAgB,OAAO,CAAC,EACtB,QAAyB,EACzB,GAAiB,EACjB,SAAc,GACf,EAAE,YAAY,sCA4Bd"}
|
package/dist/toast.js
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { createPortal } from "react-dom";
|
|
5
|
+
import Icon from "./icon";
|
|
6
|
+
/* ------------------------------------------------------------------ */
|
|
7
|
+
/* Store */
|
|
8
|
+
/* ------------------------------------------------------------------ */
|
|
9
|
+
const ANIMATION_MS = 200;
|
|
10
|
+
const DEFAULT_DURATION = 4000;
|
|
11
|
+
const DEFAULT_MAX = 4;
|
|
12
|
+
let items = [];
|
|
13
|
+
let maxToasts = DEFAULT_MAX;
|
|
14
|
+
const listeners = new Set();
|
|
15
|
+
const timers = new Map();
|
|
16
|
+
function emit() {
|
|
17
|
+
for (const listener of listeners)
|
|
18
|
+
listener(items);
|
|
19
|
+
}
|
|
20
|
+
function subscribe(listener) {
|
|
21
|
+
listeners.add(listener);
|
|
22
|
+
listener(items);
|
|
23
|
+
return () => {
|
|
24
|
+
listeners.delete(listener);
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function remove(id) {
|
|
28
|
+
const timer = timers.get(id);
|
|
29
|
+
if (timer != null) {
|
|
30
|
+
window.clearTimeout(timer);
|
|
31
|
+
timers.delete(id);
|
|
32
|
+
}
|
|
33
|
+
items = items.filter((item) => item.id !== id);
|
|
34
|
+
emit();
|
|
35
|
+
}
|
|
36
|
+
function dismiss(id) {
|
|
37
|
+
const current = items.find((item) => item.id === id);
|
|
38
|
+
if (!current || !current.open)
|
|
39
|
+
return;
|
|
40
|
+
items = items.map((item) => item.id === id ? { ...item, open: false } : item);
|
|
41
|
+
emit();
|
|
42
|
+
window.setTimeout(() => remove(id), ANIMATION_MS);
|
|
43
|
+
}
|
|
44
|
+
function trimToMax(max) {
|
|
45
|
+
const openItems = items.filter((item) => item.open);
|
|
46
|
+
if (openItems.length <= max)
|
|
47
|
+
return;
|
|
48
|
+
const overflow = openItems.length - max;
|
|
49
|
+
for (let i = 0; i < overflow; i += 1) {
|
|
50
|
+
dismiss(openItems[i].id);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function createId() {
|
|
54
|
+
return `toast-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
55
|
+
}
|
|
56
|
+
function pushToast(options) {
|
|
57
|
+
const id = createId();
|
|
58
|
+
const duration = options.duration ?? DEFAULT_DURATION;
|
|
59
|
+
const record = {
|
|
60
|
+
id,
|
|
61
|
+
title: options.title,
|
|
62
|
+
description: options.description,
|
|
63
|
+
variant: options.variant ?? "default",
|
|
64
|
+
duration,
|
|
65
|
+
open: true,
|
|
66
|
+
};
|
|
67
|
+
items = [...items, record];
|
|
68
|
+
emit();
|
|
69
|
+
trimToMax(maxToasts);
|
|
70
|
+
if (duration > 0) {
|
|
71
|
+
const timer = window.setTimeout(() => dismiss(id), duration);
|
|
72
|
+
timers.set(id, timer);
|
|
73
|
+
}
|
|
74
|
+
return id;
|
|
75
|
+
}
|
|
76
|
+
/* ------------------------------------------------------------------ */
|
|
77
|
+
/* Imperative API */
|
|
78
|
+
/* ------------------------------------------------------------------ */
|
|
79
|
+
function createToastFn(variant) {
|
|
80
|
+
return (title, description, options) => pushToast({ ...options, title, description, variant });
|
|
81
|
+
}
|
|
82
|
+
export const toast = Object.assign((options) => pushToast(options), {
|
|
83
|
+
success: createToastFn("success"),
|
|
84
|
+
warning: createToastFn("warning"),
|
|
85
|
+
danger: createToastFn("danger"),
|
|
86
|
+
info: createToastFn("info"),
|
|
87
|
+
message: createToastFn("default"),
|
|
88
|
+
dismiss,
|
|
89
|
+
});
|
|
90
|
+
/* ------------------------------------------------------------------ */
|
|
91
|
+
/* Visual */
|
|
92
|
+
/* ------------------------------------------------------------------ */
|
|
93
|
+
const VARIANT_ICON = {
|
|
94
|
+
default: "Info",
|
|
95
|
+
success: "CircleCheck",
|
|
96
|
+
warning: "TriangleAlert",
|
|
97
|
+
danger: "CircleAlert",
|
|
98
|
+
info: "Info",
|
|
99
|
+
};
|
|
100
|
+
const VARIANT_ICON_WRAP = {
|
|
101
|
+
default: "bg-muted text-muted-foreground",
|
|
102
|
+
success: "bg-success text-white",
|
|
103
|
+
warning: "bg-warning text-white",
|
|
104
|
+
danger: "bg-danger text-white",
|
|
105
|
+
info: "bg-info text-white",
|
|
106
|
+
};
|
|
107
|
+
const VARIANT_PROGRESS = {
|
|
108
|
+
default: "bg-border-strong",
|
|
109
|
+
success: "bg-success",
|
|
110
|
+
warning: "bg-warning",
|
|
111
|
+
danger: "bg-danger",
|
|
112
|
+
info: "bg-info",
|
|
113
|
+
};
|
|
114
|
+
const POSITION_CLASS = {
|
|
115
|
+
"top-right": "top-component right-component items-end",
|
|
116
|
+
"top-left": "top-component left-component items-start",
|
|
117
|
+
"bottom-right": "bottom-component right-component items-end",
|
|
118
|
+
"bottom-left": "bottom-component left-component items-start",
|
|
119
|
+
};
|
|
120
|
+
function isTop(position) {
|
|
121
|
+
return position.startsWith("top");
|
|
122
|
+
}
|
|
123
|
+
function ToastCard({ item, fromTop, }) {
|
|
124
|
+
const [progress, setProgress] = useState(item.duration > 0 ? 1 : 0);
|
|
125
|
+
useEffect(() => {
|
|
126
|
+
if (item.duration <= 0 || !item.open)
|
|
127
|
+
return;
|
|
128
|
+
const frame = requestAnimationFrame(() => {
|
|
129
|
+
requestAnimationFrame(() => setProgress(0));
|
|
130
|
+
});
|
|
131
|
+
return () => cancelAnimationFrame(frame);
|
|
132
|
+
}, [item.duration, item.id, item.open]);
|
|
133
|
+
return (_jsxs("div", { role: "status", "aria-live": "polite", "aria-atomic": "true", className: `pointer-events-auto relative w-[min(22rem,calc(100vw-2rem))] overflow-hidden rounded-large border border-border/80 bg-surface/90 shadow-lg backdrop-blur-md transition-[opacity,transform] duration-200 ease-out motion-reduce:transition-none ${item.open
|
|
134
|
+
? "translate-y-0 scale-100 opacity-100"
|
|
135
|
+
: fromTop
|
|
136
|
+
? "-translate-y-2 scale-[0.98] opacity-0"
|
|
137
|
+
: "translate-y-2 scale-[0.98] opacity-0"}`, children: [_jsxs("div", { className: "flex min-w-0 items-start gap-control px-component pb-control pt-component", children: [_jsx("span", { className: `grid size-9 shrink-0 place-items-center rounded-full ${VARIANT_ICON_WRAP[item.variant]}`, "aria-hidden": "true", children: _jsx(Icon, { name: VARIANT_ICON[item.variant], size: "small", variant: item.variant === "default" ? "muted" : "white" }) }), _jsxs("div", { className: "min-w-0 flex-1 pt-micro", children: [_jsx("p", { className: "text-body-medium leading-snug tracking-tight text-foreground", children: item.title }), _jsx("p", { className: "mt-0 text-small leading-snug text-muted-foreground", children: item.description })] }), _jsx("button", { type: "button", onClick: () => dismiss(item.id), className: "grid size-8 shrink-0 place-items-center rounded-full text-muted-foreground outline-none transition-colors duration-200 ease-out hover:bg-surface-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-primary motion-reduce:transition-none [&_svg]:size-[var(--icon-small)] [&_svg]:shrink-0 [&_svg]:text-current", "aria-label": "Fermer la notification", children: _jsx(Icon, { name: "X", "aria-hidden": "true" }) })] }), item.duration > 0 ? (_jsx("div", { className: "h-0.5 w-full bg-muted", "aria-hidden": "true", children: _jsx("div", { className: `h-full origin-left ${VARIANT_PROGRESS[item.variant]} motion-reduce:transition-none`, style: {
|
|
138
|
+
transform: `scaleX(${progress})`,
|
|
139
|
+
transition: progress === 0
|
|
140
|
+
? `transform ${item.duration}ms linear`
|
|
141
|
+
: undefined,
|
|
142
|
+
} }) })) : null] }));
|
|
143
|
+
}
|
|
144
|
+
/* ------------------------------------------------------------------ */
|
|
145
|
+
/* Toaster */
|
|
146
|
+
/* ------------------------------------------------------------------ */
|
|
147
|
+
/**
|
|
148
|
+
* Conteneur des toasts — monter une seule fois (layout racine).
|
|
149
|
+
* Déclencher via `toast.success("…")` / `toast({ title, … })`.
|
|
150
|
+
*/
|
|
151
|
+
export function Toaster({ position = "bottom-right", max = DEFAULT_MAX, className = "", }) {
|
|
152
|
+
const [toasts, setToasts] = useState([]);
|
|
153
|
+
const [mounted, setMounted] = useState(false);
|
|
154
|
+
useEffect(() => {
|
|
155
|
+
maxToasts = max;
|
|
156
|
+
}, [max]);
|
|
157
|
+
useEffect(() => {
|
|
158
|
+
setMounted(true);
|
|
159
|
+
return subscribe(setToasts);
|
|
160
|
+
}, []);
|
|
161
|
+
if (!mounted)
|
|
162
|
+
return null;
|
|
163
|
+
const fromTop = isTop(position);
|
|
164
|
+
return createPortal(_jsx("div", { className: `pointer-events-none fixed z-[60] flex flex-col gap-inline ${POSITION_CLASS[position]} ${className}`, "aria-label": "Notifications", children: toasts.map((item) => (_jsx(ToastCard, { item: item, fromTop: fromTop }, item.id))) }), document.body);
|
|
165
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export type TooltipSide = "top" | "right" | "bottom" | "left";
|
|
3
|
+
export interface TooltipProps {
|
|
4
|
+
/** Tooltip text (French in product copy). */
|
|
5
|
+
content: string;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/** Placement relative to the trigger. Default `top`. */
|
|
8
|
+
side?: TooltipSide;
|
|
9
|
+
/** Delay before show (ms). Default 200. */
|
|
10
|
+
delay?: number;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Infobulle — aide secondaire au survol / focus.
|
|
15
|
+
* Ne remplace pas un label accessible (aria-label / texte visible).
|
|
16
|
+
*/
|
|
17
|
+
export default function Tooltip({ content, children, side, delay, className, }: TooltipProps): import("react").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=tooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../components/ui/tooltip.tsx"],"names":[],"mappings":"AAEA,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE9D,MAAM,WAAW,YAAY;IAC3B,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,SAAS,CAAC;IACpB,wDAAwD;IACxD,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAiCD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAC9B,OAAO,EACP,QAAQ,EACR,IAAY,EACZ,KAAW,EACX,SAAc,GACf,EAAE,YAAY,+BA4Ed"}
|