create-modoock-app 2.8.0 → 2.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -24,6 +24,7 @@ import type {
|
|
|
24
24
|
CardAction,
|
|
25
25
|
Column,
|
|
26
26
|
DateRangeValue,
|
|
27
|
+
ModalSize,
|
|
27
28
|
} from "@modoock/components";
|
|
28
29
|
import { useEffect, useMemo, useState, type ReactNode } from "react";
|
|
29
30
|
|
|
@@ -290,17 +291,24 @@ export function ModalLoaderDemo() {
|
|
|
290
291
|
);
|
|
291
292
|
}
|
|
292
293
|
|
|
293
|
-
export function ModalDemo(
|
|
294
|
+
export function ModalDemo({
|
|
295
|
+
size = "normal",
|
|
296
|
+
label = "Ouvrir la modale",
|
|
297
|
+
}: {
|
|
298
|
+
size?: ModalSize;
|
|
299
|
+
label?: string;
|
|
300
|
+
}) {
|
|
294
301
|
const [open, setOpen] = useState(false);
|
|
295
302
|
|
|
296
303
|
return (
|
|
297
304
|
<>
|
|
298
305
|
<ClickableButton type="button" variant="secondary" onClick={() => setOpen(true)}>
|
|
299
|
-
|
|
306
|
+
{label}
|
|
300
307
|
</ClickableButton>
|
|
301
308
|
<Modal
|
|
302
309
|
open={open}
|
|
303
|
-
title=
|
|
310
|
+
title={`Confirmation (${size})`}
|
|
311
|
+
size={size}
|
|
304
312
|
onClose={() => setOpen(false)}
|
|
305
313
|
primaryAction={{ label: "Confirmer", onClick: () => setOpen(false) }}
|
|
306
314
|
secondaryAction={{ label: "Annuler", onClick: () => setOpen(false) }}
|
|
@@ -8,10 +8,10 @@ export default function ModalePage() {
|
|
|
8
8
|
title="Modale"
|
|
9
9
|
subtitle={
|
|
10
10
|
<>
|
|
11
|
-
Composant <code className="">Modal</code>
|
|
11
|
+
Composant <code className="font-mono">Modal</code>
|
|
12
12
|
</>
|
|
13
13
|
}
|
|
14
|
-
usage="Ouvrez une modale pour une confirmation ou un formulaire
|
|
14
|
+
usage="Ouvrez une modale pour une confirmation ou un formulaire. Contrôlez open / onClose ; size (normal, md, lg, 2xl) fixe la largeur ; primaryAction et secondaryAction construisent le pied de page."
|
|
15
15
|
importCode={`import { Modal, ClickableButton } from "@modoock/components";`}
|
|
16
16
|
>
|
|
17
17
|
<div className="grid gap-component md:grid-cols-2">
|
|
@@ -42,6 +42,22 @@ export default function ModalePage() {
|
|
|
42
42
|
>
|
|
43
43
|
<ModalDemo />
|
|
44
44
|
</DemoCard>
|
|
45
|
+
|
|
46
|
+
<DemoCard
|
|
47
|
+
title="Tailles"
|
|
48
|
+
description="size : normal (défaut), md, lg, 2xl."
|
|
49
|
+
code={`<Modal size="normal" … />
|
|
50
|
+
<Modal size="md" … />
|
|
51
|
+
<Modal size="lg" … />
|
|
52
|
+
<Modal size="2xl" … />`}
|
|
53
|
+
>
|
|
54
|
+
<div className="flex flex-wrap gap-inline">
|
|
55
|
+
<ModalDemo size="normal" label="normal" />
|
|
56
|
+
<ModalDemo size="md" label="md" />
|
|
57
|
+
<ModalDemo size="lg" label="lg" />
|
|
58
|
+
<ModalDemo size="2xl" label="2xl" />
|
|
59
|
+
</div>
|
|
60
|
+
</DemoCard>
|
|
45
61
|
</div>
|
|
46
62
|
</ShowcaseShell>
|
|
47
63
|
);
|
|
@@ -181,7 +181,7 @@ export default function Header({
|
|
|
181
181
|
<Icon name="ArrowLeft" aria-hidden="true" />
|
|
182
182
|
</ClickableButton>
|
|
183
183
|
<div className="min-w-0">
|
|
184
|
-
<h1 className="truncate text-
|
|
184
|
+
<h1 className="truncate text-section-title text-foreground">
|
|
185
185
|
{meta.title}
|
|
186
186
|
</h1>
|
|
187
187
|
{meta.description && (
|
|
@@ -14,7 +14,7 @@ import { scrollAppMainToIdWhenReady } from "@/lib/scroll-to-section";
|
|
|
14
14
|
|
|
15
15
|
const MD_NAV = "(min-width: 56rem)";
|
|
16
16
|
const DESKTOP_NAV = "(min-width: 1024px)";
|
|
17
|
-
const APP_VERSION = "2.
|
|
17
|
+
const APP_VERSION = "2.8.0";
|
|
18
18
|
const FOCUSABLE_SELECTOR =
|
|
19
19
|
"a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex='-1'])";
|
|
20
20
|
|