@contractspec/lib.design-system 3.8.9 → 3.8.11

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.
@@ -1,1196 +1 @@
1
- // src/components/legal/organisms/ContactForm.tsx
2
- import * as React2 from "react";
3
-
4
- // src/components/atoms/Button.tsx
5
- import {
6
- Button as WebButton
7
- } from "@contractspec/lib.ui-kit-web/ui/button";
8
- import { Loader2 } from "lucide-react";
9
- import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
10
- function Button({
11
- children,
12
- loading,
13
- spinnerPlacement = "start",
14
- onPress,
15
- onPressIn,
16
- onPressOut,
17
- onLongPress,
18
- onTouchStart,
19
- onTouchEnd,
20
- onTouchCancel,
21
- onMouseDown,
22
- onMouseUp,
23
- onClick,
24
- className,
25
- disabled,
26
- ...rest
27
- }) {
28
- const isDisabled = Boolean(disabled || loading);
29
- const handleClick = onPress ? () => {
30
- onPress();
31
- } : onClick;
32
- const content = !rest.asChild ? /* @__PURE__ */ jsxDEV(Fragment, {
33
- children: [
34
- loading && spinnerPlacement === "start" ? /* @__PURE__ */ jsxDEV(Loader2, {
35
- className: "h-4 w-4 animate-spin"
36
- }, undefined, false, undefined, this) : null,
37
- children,
38
- loading && spinnerPlacement === "end" ? /* @__PURE__ */ jsxDEV(Loader2, {
39
- className: "h-4 w-4 animate-spin"
40
- }, undefined, false, undefined, this) : null
41
- ]
42
- }, undefined, true, undefined, this) : children;
43
- return /* @__PURE__ */ jsxDEV(WebButton, {
44
- ...rest,
45
- className,
46
- disabled: isDisabled,
47
- "aria-busy": loading ? true : undefined,
48
- "aria-disabled": isDisabled ? true : undefined,
49
- onClick: handleClick,
50
- onMouseDown: onMouseDown || onPressIn,
51
- onMouseUp: onMouseUp || onPressOut,
52
- onTouchStart,
53
- onTouchEnd: onTouchEnd || onPressOut,
54
- onTouchCancel: onTouchCancel || onPressOut,
55
- type: rest?.type ?? "button",
56
- children: content
57
- }, undefined, false, undefined, this);
58
- }
59
-
60
- // src/components/legal/molecules/ContactFields.tsx
61
- import { Label } from "@contractspec/lib.ui-kit-web/ui/label";
62
-
63
- // src/components/atoms/Input.tsx
64
- import {
65
- Input as WebInput
66
- } from "@contractspec/lib.ui-kit-web/ui/input";
67
-
68
- // src/lib/keyboard.ts
69
- function deriveKindFromAutoComplete(ac) {
70
- if (!ac)
71
- return;
72
- switch (ac) {
73
- case "email":
74
- return "email";
75
- case "url":
76
- return "url";
77
- case "username":
78
- return "username";
79
- case "new-password":
80
- return "new-password";
81
- case "current-password":
82
- return "password";
83
- case "one-time-code":
84
- return "otp";
85
- case "tel":
86
- case "tel-country-code":
87
- case "tel-national":
88
- case "tel-area-code":
89
- case "tel-local":
90
- case "tel-local-prefix":
91
- case "tel-local-suffix":
92
- case "tel-extension":
93
- return "tel";
94
- case "postal-code":
95
- case "cc-number":
96
- case "cc-csc":
97
- case "bday-day":
98
- case "bday-month":
99
- case "bday-year":
100
- return "int";
101
- case "cc-exp":
102
- case "cc-exp-month":
103
- case "cc-exp-year":
104
- return "numbers-and-punctuation";
105
- case "bday":
106
- return "date";
107
- default:
108
- return "text";
109
- }
110
- }
111
- function applyAutoCompleteDefaultsWeb(res, ac) {
112
- if (!ac)
113
- return;
114
- const wordsCaps = [
115
- "name",
116
- "given-name",
117
- "additional-name",
118
- "family-name",
119
- "honorific-prefix",
120
- "honorific-suffix",
121
- "nickname",
122
- "organization",
123
- "organization-title",
124
- "cc-name",
125
- "cc-given-name",
126
- "cc-additional-name",
127
- "cc-family-name"
128
- ];
129
- if (wordsCaps.includes(ac)) {
130
- res.autoCapitalize = "words";
131
- }
132
- const noneCaps = [
133
- "username",
134
- "new-password",
135
- "current-password",
136
- "one-time-code",
137
- "email",
138
- "url"
139
- ];
140
- if (noneCaps.includes(ac)) {
141
- res.autoCapitalize = "none";
142
- }
143
- }
144
- function mapKeyboardToWeb(opts) {
145
- const kind = opts?.kind ?? deriveKindFromAutoComplete(opts?.autoComplete) ?? "text";
146
- const res = {};
147
- switch (kind) {
148
- case "password":
149
- res.type = "password";
150
- res.autoCapitalize = "none";
151
- res.autoComplete = opts?.autoComplete ?? "current-password";
152
- if (opts?.autoCorrect != null)
153
- res.autoCorrect = opts.autoCorrect;
154
- break;
155
- case "new-password":
156
- res.type = "password";
157
- res.autoCapitalize = "none";
158
- res.autoComplete = opts?.autoComplete ?? "new-password";
159
- if (opts?.autoCorrect != null)
160
- res.autoCorrect = opts.autoCorrect;
161
- break;
162
- case "username":
163
- res.type = "text";
164
- res.autoCapitalize = "none";
165
- res.autoComplete = opts?.autoComplete ?? "username";
166
- break;
167
- case "email":
168
- res.type = "email";
169
- res.inputMode = "email";
170
- res.autoCapitalize = "none";
171
- res.autoComplete = opts?.autoComplete ?? "email";
172
- break;
173
- case "url":
174
- res.type = "url";
175
- res.inputMode = "url";
176
- res.autoComplete = opts?.autoComplete ?? "url";
177
- break;
178
- case "search":
179
- res.type = "search";
180
- res.inputMode = "search";
181
- res.enterKeyHint = opts?.enterKeyHint ?? "search";
182
- res.autoComplete = opts?.autoComplete ?? "off";
183
- break;
184
- case "phone":
185
- case "tel":
186
- res.type = "tel";
187
- res.inputMode = "tel";
188
- res.autoComplete = opts?.autoComplete ?? "tel";
189
- break;
190
- case "number":
191
- case "int":
192
- res.type = "text";
193
- res.inputMode = "numeric";
194
- res.pattern = "[0-9]*";
195
- break;
196
- case "decimal":
197
- res.type = "text";
198
- res.inputMode = "decimal";
199
- res.step = "any";
200
- break;
201
- case "numbers-and-punctuation":
202
- res.type = "text";
203
- res.inputMode = "text";
204
- res.pattern = "[0-9.,-]*";
205
- break;
206
- case "otp":
207
- res.type = "text";
208
- res.inputMode = "numeric";
209
- res.autoComplete = opts?.autoComplete ?? "one-time-code";
210
- res.autoCapitalize = "none";
211
- break;
212
- case "name":
213
- res.type = "text";
214
- res.autoComplete = opts?.autoComplete ?? "name";
215
- res.autoCapitalize = opts?.autoCapitalize ?? "words";
216
- break;
217
- case "given-name":
218
- res.type = "text";
219
- res.autoComplete = opts?.autoComplete ?? "given-name";
220
- res.autoCapitalize = opts?.autoCapitalize ?? "words";
221
- break;
222
- case "family-name":
223
- res.type = "text";
224
- res.autoComplete = opts?.autoComplete ?? "family-name";
225
- res.autoCapitalize = opts?.autoCapitalize ?? "words";
226
- break;
227
- case "address-line1":
228
- res.type = "text";
229
- res.autoComplete = opts?.autoComplete ?? "address-line1";
230
- break;
231
- case "address-line2":
232
- res.type = "text";
233
- res.autoComplete = opts?.autoComplete ?? "address-line2";
234
- break;
235
- case "postal-code":
236
- res.type = "text";
237
- res.inputMode = "numeric";
238
- res.pattern = "[0-9]*";
239
- res.autoComplete = opts?.autoComplete ?? "postal-code";
240
- break;
241
- case "cc-number":
242
- res.type = "text";
243
- res.inputMode = "numeric";
244
- res.pattern = "[0-9]*";
245
- res.autoComplete = opts?.autoComplete ?? "cc-number";
246
- break;
247
- case "cc-exp":
248
- res.type = "text";
249
- res.inputMode = "numeric";
250
- res.pattern = "[0-9/]*";
251
- res.autoComplete = opts?.autoComplete ?? "cc-exp";
252
- break;
253
- case "cc-csc":
254
- res.type = "text";
255
- res.inputMode = "numeric";
256
- res.pattern = "[0-9]*";
257
- res.autoComplete = opts?.autoComplete ?? "cc-csc";
258
- break;
259
- case "off":
260
- res.type = "text";
261
- res.autoComplete = "off";
262
- break;
263
- case "date":
264
- res.type = "date";
265
- res.inputMode = "date";
266
- res.pattern = "[0-9./-]*";
267
- break;
268
- default:
269
- res.type = "text";
270
- break;
271
- }
272
- if (opts?.autoCapitalize)
273
- res.autoCapitalize = opts.autoCapitalize;
274
- if (opts?.autoComplete)
275
- res.autoComplete = opts.autoComplete;
276
- if (opts?.autoCorrect != null)
277
- res.autoCorrect = opts.autoCorrect;
278
- if (opts?.enterKeyHint)
279
- res.enterKeyHint = opts.enterKeyHint;
280
- applyAutoCompleteDefaultsWeb(res, opts?.autoComplete);
281
- return res;
282
- }
283
-
284
- // src/components/atoms/Input.tsx
285
- import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
286
- function Input({
287
- value,
288
- defaultValue,
289
- onChange,
290
- onSubmit,
291
- onFocus,
292
- onBlur,
293
- placeholder,
294
- disabled,
295
- readOnly,
296
- maxLength,
297
- name,
298
- className,
299
- keyboard,
300
- ...rest
301
- }) {
302
- const webKeyboard = mapKeyboardToWeb(keyboard);
303
- return /* @__PURE__ */ jsxDEV2(WebInput, {
304
- ...rest,
305
- className,
306
- value,
307
- defaultValue,
308
- onChange,
309
- onFocus,
310
- onBlur,
311
- placeholder,
312
- disabled,
313
- readOnly,
314
- maxLength,
315
- name,
316
- ...webKeyboard
317
- }, undefined, false, undefined, this);
318
- }
319
-
320
- // src/components/atoms/Textarea.tsx
321
- import {
322
- Textarea as WebTextarea
323
- } from "@contractspec/lib.ui-kit-web/ui/textarea";
324
- import * as React from "react";
325
- import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
326
- function Textarea({
327
- value,
328
- defaultValue,
329
- onChange,
330
- onSubmit,
331
- onFocus,
332
- onBlur,
333
- placeholder,
334
- disabled,
335
- readOnly,
336
- maxLength,
337
- name,
338
- className,
339
- rows,
340
- keyboard,
341
- ...rest
342
- }) {
343
- const webKeyboard = mapKeyboardToWeb(keyboard);
344
- const handleChange = React.useCallback((e) => onChange?.(e), [onChange]);
345
- return /* @__PURE__ */ jsxDEV3(WebTextarea, {
346
- ...rest,
347
- className,
348
- value,
349
- defaultValue,
350
- onChange: handleChange,
351
- onFocus,
352
- onBlur,
353
- placeholder,
354
- disabled,
355
- readOnly,
356
- maxLength,
357
- name,
358
- rows,
359
- ...webKeyboard
360
- }, undefined, false, undefined, this);
361
- }
362
-
363
- // src/components/legal/molecules/ContactFields.tsx
364
- import { jsxDEV as jsxDEV4 } from "react/jsx-dev-runtime";
365
- function ContactFields({
366
- value,
367
- onChange,
368
- disabled
369
- }) {
370
- return /* @__PURE__ */ jsxDEV4("div", {
371
- className: "space-y-4",
372
- children: [
373
- /* @__PURE__ */ jsxDEV4("div", {
374
- className: "space-y-2",
375
- children: [
376
- /* @__PURE__ */ jsxDEV4(Label, {
377
- children: "Nom"
378
- }, undefined, false, undefined, this),
379
- /* @__PURE__ */ jsxDEV4(Input, {
380
- value: value.name,
381
- onChange: (e) => onChange({ ...value, name: e.target.value }),
382
- disabled
383
- }, undefined, false, undefined, this)
384
- ]
385
- }, undefined, true, undefined, this),
386
- /* @__PURE__ */ jsxDEV4("div", {
387
- className: "space-y-2",
388
- children: [
389
- /* @__PURE__ */ jsxDEV4(Label, {
390
- children: "Email"
391
- }, undefined, false, undefined, this),
392
- /* @__PURE__ */ jsxDEV4(Input, {
393
- type: "email",
394
- value: value.email,
395
- onChange: (e) => onChange({ ...value, email: e.target.value }),
396
- disabled
397
- }, undefined, false, undefined, this)
398
- ]
399
- }, undefined, true, undefined, this),
400
- /* @__PURE__ */ jsxDEV4("div", {
401
- className: "space-y-2",
402
- children: [
403
- /* @__PURE__ */ jsxDEV4(Label, {
404
- children: "Objet"
405
- }, undefined, false, undefined, this),
406
- /* @__PURE__ */ jsxDEV4(Input, {
407
- value: value.subject,
408
- onChange: (e) => onChange({
409
- ...value,
410
- subject: e.target.value
411
- }),
412
- disabled
413
- }, undefined, false, undefined, this)
414
- ]
415
- }, undefined, true, undefined, this),
416
- /* @__PURE__ */ jsxDEV4("div", {
417
- className: "space-y-2",
418
- children: [
419
- /* @__PURE__ */ jsxDEV4(Label, {
420
- children: "Message"
421
- }, undefined, false, undefined, this),
422
- /* @__PURE__ */ jsxDEV4(Textarea, {
423
- value: value.message,
424
- onChange: (e) => onChange({
425
- ...value,
426
- message: e.target.value
427
- }),
428
- disabled,
429
- rows: 6
430
- }, undefined, false, undefined, this)
431
- ]
432
- }, undefined, true, undefined, this)
433
- ]
434
- }, undefined, true, undefined, this);
435
- }
436
-
437
- // src/components/legal/organisms/ContactForm.tsx
438
- import { jsxDEV as jsxDEV5 } from "react/jsx-dev-runtime";
439
- function ContactForm({
440
- labels = { submit: "Envoyer" },
441
- initialValue = { name: "", email: "", subject: "", message: "" },
442
- disabled,
443
- onSubmit
444
- }) {
445
- const [value, setValue] = React2.useState(initialValue);
446
- const [loading, setLoading] = React2.useState(false);
447
- const handleSubmit = async (e) => {
448
- e.preventDefault();
449
- if (!onSubmit)
450
- return;
451
- setLoading(true);
452
- try {
453
- await onSubmit(value);
454
- } finally {
455
- setLoading(false);
456
- }
457
- };
458
- return /* @__PURE__ */ jsxDEV5("form", {
459
- onSubmit: handleSubmit,
460
- className: "space-y-6",
461
- children: [
462
- /* @__PURE__ */ jsxDEV5(ContactFields, {
463
- value,
464
- onChange: setValue,
465
- disabled: disabled || loading
466
- }, undefined, false, undefined, this),
467
- /* @__PURE__ */ jsxDEV5(Button, {
468
- disabled: disabled || loading,
469
- type: "submit",
470
- children: loading ? "Envoi…" : labels.submit
471
- }, undefined, false, undefined, this)
472
- ]
473
- }, undefined, true, undefined, this);
474
- }
475
- // src/components/legal/organisms/GDPRDataRequest.tsx
476
- import * as React3 from "react";
477
-
478
- // src/components/legal/atoms/LegalHeading.tsx
479
- import { cn } from "@contractspec/lib.ui-kit-web/ui/utils";
480
- import { cva } from "class-variance-authority";
481
- import { jsxDEV as jsxDEV6 } from "react/jsx-dev-runtime";
482
- var headingVariants = cva("text-foreground tracking-tight", {
483
- variants: {
484
- level: {
485
- h1: "font-semibold text-3xl md:text-4xl",
486
- h2: "font-semibold text-2xl md:text-3xl",
487
- h3: "font-semibold text-xl md:text-2xl",
488
- h4: "font-semibold text-lg md:text-xl"
489
- },
490
- tone: {
491
- default: "",
492
- muted: "text-muted-foreground",
493
- accent: "text-primary"
494
- },
495
- spacing: {
496
- none: "",
497
- sm: "mt-4",
498
- md: "mt-6",
499
- lg: "mt-8"
500
- }
501
- },
502
- defaultVariants: {
503
- level: "h2",
504
- tone: "default",
505
- spacing: "md"
506
- }
507
- });
508
- function LegalHeading({
509
- as,
510
- level,
511
- tone,
512
- spacing,
513
- className,
514
- ...props
515
- }) {
516
- const Comp = as ?? level ?? "h2";
517
- return /* @__PURE__ */ jsxDEV6(Comp, {
518
- className: cn(headingVariants({ level, tone, spacing }), className),
519
- ...props
520
- }, undefined, false, undefined, this);
521
- }
522
-
523
- // src/components/legal/atoms/LegalSection.tsx
524
- import { cn as cn2 } from "@contractspec/lib.ui-kit-web/ui/utils";
525
- import { cva as cva2 } from "class-variance-authority";
526
- import { jsxDEV as jsxDEV7 } from "react/jsx-dev-runtime";
527
- var sectionVariants = cva2("space-y-3", {
528
- variants: {
529
- spacing: {
530
- sm: "py-3",
531
- md: "py-4",
532
- lg: "py-6"
533
- },
534
- border: {
535
- none: "",
536
- top: "border-t",
537
- bottom: "border-b",
538
- both: "border-y"
539
- },
540
- tone: {
541
- plain: "",
542
- subtle: "bg-muted/30"
543
- }
544
- },
545
- defaultVariants: {
546
- spacing: "md",
547
- border: "none",
548
- tone: "plain"
549
- }
550
- });
551
- function LegalSection({
552
- spacing,
553
- border,
554
- tone,
555
- className,
556
- ...props
557
- }) {
558
- return /* @__PURE__ */ jsxDEV7("div", {
559
- className: cn2(sectionVariants({ spacing, border, tone }), className),
560
- ...props
561
- }, undefined, false, undefined, this);
562
- }
563
-
564
- // src/components/legal/atoms/LegalText.tsx
565
- import { cn as cn3 } from "@contractspec/lib.ui-kit-web/ui/utils";
566
- import { cva as cva3 } from "class-variance-authority";
567
- import { jsxDEV as jsxDEV8 } from "react/jsx-dev-runtime";
568
- var textVariants = cva3("text-base leading-relaxed", {
569
- variants: {
570
- tone: {
571
- default: "text-foreground",
572
- muted: "text-muted-foreground",
573
- danger: "text-destructive"
574
- },
575
- size: {
576
- base: "text-base",
577
- sm: "text-sm",
578
- lg: "text-lg"
579
- },
580
- spacing: {
581
- none: "",
582
- sm: "mt-2",
583
- md: "mt-3",
584
- lg: "mt-4"
585
- }
586
- },
587
- defaultVariants: {
588
- tone: "default",
589
- size: "base",
590
- spacing: "sm"
591
- }
592
- });
593
- function LegalText({
594
- as = "p",
595
- tone,
596
- size,
597
- spacing,
598
- className,
599
- ...props
600
- }) {
601
- const Comp = as;
602
- return /* @__PURE__ */ jsxDEV8(Comp, {
603
- className: cn3(textVariants({ tone, size, spacing }), className),
604
- ...props
605
- }, undefined, false, undefined, this);
606
- }
607
-
608
- // src/components/legal/organisms/GDPRDataRequest.tsx
609
- import { jsxDEV as jsxDEV9 } from "react/jsx-dev-runtime";
610
- function GDPRDataRequest({
611
- onExport,
612
- onDelete,
613
- labels = { export: "Demander une copie", delete: "Demander la suppression" }
614
- }) {
615
- const [loading, setLoading] = React3.useState(null);
616
- const handle = async (kind) => {
617
- const fn = kind === "export" ? onExport : onDelete;
618
- if (!fn)
619
- return;
620
- setLoading(kind);
621
- try {
622
- await fn();
623
- } finally {
624
- setLoading(null);
625
- }
626
- };
627
- return /* @__PURE__ */ jsxDEV9(LegalSection, {
628
- border: "top",
629
- className: "space-y-3",
630
- children: [
631
- /* @__PURE__ */ jsxDEV9(LegalHeading, {
632
- as: "h2",
633
- level: "h2",
634
- children: "Demandes de données"
635
- }, undefined, false, undefined, this),
636
- /* @__PURE__ */ jsxDEV9(LegalText, {
637
- children: "Vous pouvez demander une copie de vos données ou solliciter leur suppression. Ces demandes nécessitent une vérification d’identité et sont traitées dans les délais légaux."
638
- }, undefined, false, undefined, this),
639
- /* @__PURE__ */ jsxDEV9("div", {
640
- className: "flex flex-wrap gap-3",
641
- children: [
642
- /* @__PURE__ */ jsxDEV9(Button, {
643
- onPress: () => handle("export"),
644
- disabled: loading !== null,
645
- children: loading === "export" ? "Envoi…" : labels.export
646
- }, undefined, false, undefined, this),
647
- /* @__PURE__ */ jsxDEV9(Button, {
648
- variant: "destructive",
649
- onPress: () => handle("delete"),
650
- disabled: loading !== null,
651
- children: loading === "delete" ? "Envoi…" : labels.delete
652
- }, undefined, false, undefined, this)
653
- ]
654
- }, undefined, true, undefined, this)
655
- ]
656
- }, undefined, true, undefined, this);
657
- }
658
- // src/components/legal/atoms/LegalList.tsx
659
- import { cn as cn4 } from "@contractspec/lib.ui-kit-web/ui/utils";
660
- import { cva as cva4 } from "class-variance-authority";
661
- import { jsxDEV as jsxDEV10 } from "react/jsx-dev-runtime";
662
- var listVariants = cva4("", {
663
- variants: {
664
- type: {
665
- unordered: "list-disc pl-6",
666
- ordered: "list-decimal pl-6",
667
- none: "pl-0"
668
- },
669
- spacing: {
670
- sm: "space-y-1",
671
- md: "space-y-2",
672
- lg: "space-y-3"
673
- }
674
- },
675
- defaultVariants: {
676
- type: "unordered",
677
- spacing: "md"
678
- }
679
- });
680
- function LegalList({
681
- type,
682
- spacing,
683
- className,
684
- children,
685
- ...props
686
- }) {
687
- const Comp = type === "ordered" ? "ol" : "ul";
688
- return /* @__PURE__ */ jsxDEV10(Comp, {
689
- className: cn4(listVariants({ type, spacing }), className),
690
- ...props,
691
- children
692
- }, undefined, false, undefined, this);
693
- }
694
-
695
- // src/components/legal/organisms/GDPRRights.tsx
696
- import { jsxDEV as jsxDEV11 } from "react/jsx-dev-runtime";
697
- function GDPRRights({
698
- title = "Vos droits RGPD",
699
- rights = [
700
- "Accès à vos données",
701
- "Rectification",
702
- "Effacement (droit à l’oubli)",
703
- "Opposition et limitation",
704
- "Portabilité"
705
- ]
706
- }) {
707
- return /* @__PURE__ */ jsxDEV11(LegalSection, {
708
- border: "top",
709
- children: [
710
- /* @__PURE__ */ jsxDEV11(LegalHeading, {
711
- as: "h2",
712
- level: "h2",
713
- children: title
714
- }, undefined, false, undefined, this),
715
- /* @__PURE__ */ jsxDEV11(LegalList, {
716
- type: "unordered",
717
- children: rights.map((r, i) => /* @__PURE__ */ jsxDEV11("li", {
718
- children: r
719
- }, i, false, undefined, this))
720
- }, undefined, false, undefined, this)
721
- ]
722
- }, undefined, true, undefined, this);
723
- }
724
- // src/components/legal/organisms/LegalPageLayout.tsx
725
- import { cn as cn7 } from "@contractspec/lib.ui-kit-web/ui/utils";
726
-
727
- // src/components/legal/molecules/LegalMeta.tsx
728
- import { cn as cn5 } from "@contractspec/lib.ui-kit-web/ui/utils";
729
- import { jsxDEV as jsxDEV12 } from "react/jsx-dev-runtime";
730
- function LegalMeta({
731
- lastUpdated,
732
- version,
733
- className
734
- }) {
735
- const fmtDate = (d) => {
736
- if (!d)
737
- return null;
738
- try {
739
- const date = typeof d === "string" ? new Date(d) : d;
740
- return date.toLocaleDateString();
741
- } catch {
742
- return String(d);
743
- }
744
- };
745
- return /* @__PURE__ */ jsxDEV12("div", {
746
- className: cn5("text-base text-muted-foreground", className),
747
- children: [
748
- version && /* @__PURE__ */ jsxDEV12("span", {
749
- children: [
750
- "Version ",
751
- version
752
- ]
753
- }, undefined, true, undefined, this),
754
- version && lastUpdated && /* @__PURE__ */ jsxDEV12("span", {
755
- className: "mx-2",
756
- children: "•"
757
- }, undefined, false, undefined, this),
758
- lastUpdated && /* @__PURE__ */ jsxDEV12("span", {
759
- children: [
760
- "Dernière mise à jour: ",
761
- fmtDate(lastUpdated)
762
- ]
763
- }, undefined, true, undefined, this)
764
- ]
765
- }, undefined, true, undefined, this);
766
- }
767
-
768
- // src/components/legal/molecules/LegalTOC.tsx
769
- import { cn as cn6 } from "@contractspec/lib.ui-kit-web/ui/utils";
770
- import { cva as cva5 } from "class-variance-authority";
771
- import { jsxDEV as jsxDEV13 } from "react/jsx-dev-runtime";
772
- var tocVariants = cva5("text-base", {
773
- variants: {
774
- variant: {
775
- sidebar: "space-y-2",
776
- inline: "flex flex-wrap gap-3"
777
- },
778
- size: {
779
- sm: "",
780
- md: "text-base"
781
- }
782
- },
783
- defaultVariants: { variant: "sidebar", size: "md" }
784
- });
785
- function LegalTOC({
786
- items,
787
- activeHref,
788
- onNavigate,
789
- variant,
790
- size,
791
- className,
792
- ...props
793
- }) {
794
- return /* @__PURE__ */ jsxDEV13("nav", {
795
- "aria-label": "Table of contents",
796
- className: cn6(tocVariants({ variant, size }), className),
797
- ...props,
798
- children: variant === "inline" ? items.map((it) => /* @__PURE__ */ jsxDEV13("a", {
799
- href: it.href,
800
- onClick: (_e) => {
801
- onNavigate?.(it.href);
802
- },
803
- className: cn6("rounded-xs px-2 py-1 hover:bg-accent hover:text-accent-foreground", activeHref === it.href && "bg-accent text-accent-foreground"),
804
- children: it.label
805
- }, it.href, false, undefined, this)) : /* @__PURE__ */ jsxDEV13("ul", {
806
- className: "list-none space-y-2 pl-0",
807
- children: items.map((it) => /* @__PURE__ */ jsxDEV13("li", {
808
- children: /* @__PURE__ */ jsxDEV13("a", {
809
- href: it.href,
810
- onClick: () => onNavigate?.(it.href),
811
- className: cn6("block rounded-xs px-2 py-1 hover:bg-accent hover:text-accent-foreground", activeHref === it.href && "bg-accent text-accent-foreground"),
812
- children: it.label
813
- }, undefined, false, undefined, this)
814
- }, it.href, false, undefined, this))
815
- }, undefined, false, undefined, this)
816
- }, undefined, false, undefined, this);
817
- }
818
-
819
- // src/components/legal/organisms/LegalPageLayout.tsx
820
- import { jsxDEV as jsxDEV14 } from "react/jsx-dev-runtime";
821
- function LegalPageLayout({
822
- title,
823
- meta,
824
- toc,
825
- children,
826
- className
827
- }) {
828
- return /* @__PURE__ */ jsxDEV14("div", {
829
- className: cn7("mx-auto w-full max-w-6xl px-4 py-8 md:py-12", className),
830
- children: [
831
- /* @__PURE__ */ jsxDEV14("div", {
832
- className: "mb-6 space-y-2",
833
- children: [
834
- /* @__PURE__ */ jsxDEV14(LegalHeading, {
835
- as: "h1",
836
- level: "h1",
837
- spacing: "sm",
838
- children: title
839
- }, undefined, false, undefined, this),
840
- meta && /* @__PURE__ */ jsxDEV14(LegalMeta, {
841
- lastUpdated: meta.lastUpdated,
842
- version: meta.version
843
- }, undefined, false, undefined, this)
844
- ]
845
- }, undefined, true, undefined, this),
846
- toc && toc.length > 0 && /* @__PURE__ */ jsxDEV14("div", {
847
- className: "mb-6 md:hidden",
848
- children: /* @__PURE__ */ jsxDEV14(LegalTOC, {
849
- items: toc,
850
- variant: "inline"
851
- }, undefined, false, undefined, this)
852
- }, undefined, false, undefined, this),
853
- /* @__PURE__ */ jsxDEV14("div", {
854
- className: "grid grid-cols-1 gap-8 md:grid-cols-[220px_minmax(0,1fr)]",
855
- children: [
856
- toc && toc.length > 0 ? /* @__PURE__ */ jsxDEV14("aside", {
857
- className: "sticky top-24 hidden self-start md:block",
858
- children: /* @__PURE__ */ jsxDEV14(LegalTOC, {
859
- items: toc,
860
- variant: "sidebar"
861
- }, undefined, false, undefined, this)
862
- }, undefined, false, undefined, this) : /* @__PURE__ */ jsxDEV14("div", {
863
- className: "hidden md:block"
864
- }, undefined, false, undefined, this),
865
- /* @__PURE__ */ jsxDEV14("article", {
866
- className: "prose max-w-none text-foreground",
867
- children
868
- }, undefined, false, undefined, this)
869
- ]
870
- }, undefined, true, undefined, this)
871
- ]
872
- }, undefined, true, undefined, this);
873
- }
874
- // src/platform/withPlatformUI.ts
875
- "use client";
876
- var DEFAULT_BREAKPOINTS = {
877
- sm: 640,
878
- md: 768,
879
- lg: 1024,
880
- xl: 1280
881
- };
882
- function withPlatformUI(options) {
883
- const platform = options.platform ?? "web";
884
- const breakpoints = {
885
- ...DEFAULT_BREAKPOINTS,
886
- ...options.breakpoints
887
- };
888
- return {
889
- platform,
890
- tokens: options.tokens,
891
- breakpoints
892
- };
893
- }
894
- // src/renderers/form-contract.tsx
895
- import { shadcnDriver } from "@contractspec/lib.contracts-runtime-client-react/drivers/shadcn";
896
- import { createFormRenderer } from "@contractspec/lib.contracts-runtime-client-react/form-render";
897
- import { Checkbox as CheckboxUiKit } from "@contractspec/lib.ui-kit-web/ui/checkbox";
898
- import {
899
- FieldDescription,
900
- FieldError,
901
- FieldGroup,
902
- FieldLabel,
903
- Field as FieldWrap
904
- } from "@contractspec/lib.ui-kit-web/ui/field";
905
- import { Label as Label2 } from "@contractspec/lib.ui-kit-web/ui/label";
906
- import {
907
- RadioGroupItem,
908
- RadioGroup as RadioGroupUiKit
909
- } from "@contractspec/lib.ui-kit-web/ui/radio-group";
910
- import {
911
- SelectContent,
912
- SelectGroup,
913
- SelectItem,
914
- SelectTrigger,
915
- Select as SelectUiKit,
916
- SelectValue
917
- } from "@contractspec/lib.ui-kit-web/ui/select";
918
- import { Switch as SwitchUiKit } from "@contractspec/lib.ui-kit-web/ui/switch";
919
- import { jsxDEV as jsxDEV15 } from "react/jsx-dev-runtime";
920
- "use client";
921
- var Select = (props) => {
922
- const { options, value, onChange, ...rest } = props;
923
- return /* @__PURE__ */ jsxDEV15(SelectUiKit, {
924
- value: value ?? "",
925
- onValueChange: (v) => onChange?.(v),
926
- ...rest,
927
- children: [
928
- /* @__PURE__ */ jsxDEV15(SelectTrigger, {
929
- className: "w-[180px]",
930
- children: /* @__PURE__ */ jsxDEV15(SelectValue, {
931
- placeholder: props.placeholder
932
- }, undefined, false, undefined, this)
933
- }, undefined, false, undefined, this),
934
- /* @__PURE__ */ jsxDEV15(SelectContent, {
935
- children: /* @__PURE__ */ jsxDEV15(SelectGroup, {
936
- children: options?.map((o, i) => /* @__PURE__ */ jsxDEV15(SelectItem, {
937
- value: o.value,
938
- disabled: o.disabled,
939
- children: o.labelI18n
940
- }, i, false, undefined, this))
941
- }, undefined, false, undefined, this)
942
- }, undefined, false, undefined, this)
943
- ]
944
- }, undefined, true, undefined, this);
945
- };
946
- var Checkbox = (props) => /* @__PURE__ */ jsxDEV15(CheckboxUiKit, {
947
- checked: !!props.checked,
948
- onCheckedChange: (v) => props.onCheckedChange?.(v),
949
- ...props
950
- }, undefined, false, undefined, this);
951
- var RadioGroup = (props) => /* @__PURE__ */ jsxDEV15(RadioGroupUiKit, {
952
- ...props,
953
- children: props.options?.map((o) => /* @__PURE__ */ jsxDEV15("div", {
954
- className: "flex items-center gap-3",
955
- children: [
956
- /* @__PURE__ */ jsxDEV15(RadioGroupItem, {
957
- value: o.value,
958
- id: o.value
959
- }, undefined, false, undefined, this),
960
- /* @__PURE__ */ jsxDEV15(Label2, {
961
- htmlFor: o.value,
962
- children: o.label
963
- }, undefined, false, undefined, this)
964
- ]
965
- }, o.value, true, undefined, this))
966
- }, undefined, false, undefined, this);
967
- var Switch = (props) => /* @__PURE__ */ jsxDEV15(SwitchUiKit, {
968
- checked: !!props.checked,
969
- onCheckedChange: (v) => props.onCheckedChange?.(v),
970
- ...props
971
- }, undefined, false, undefined, this);
972
- var formRenderer = createFormRenderer({
973
- driver: shadcnDriver({
974
- Field: FieldWrap,
975
- FieldLabel,
976
- FieldDescription,
977
- FieldError,
978
- FieldGroup,
979
- FieldSet: (p) => /* @__PURE__ */ jsxDEV15("fieldset", {
980
- ...p
981
- }, undefined, false, undefined, this),
982
- FieldLegend: (p) => /* @__PURE__ */ jsxDEV15("legend", {
983
- ...p
984
- }, undefined, false, undefined, this),
985
- Input,
986
- Textarea,
987
- Select,
988
- Checkbox,
989
- RadioGroup,
990
- Switch,
991
- Button
992
- })
993
- });
994
- // src/theme/tokens.ts
995
- "use client";
996
- var defaultTokens = {
997
- colors: {
998
- background: "#ffffff",
999
- foreground: "#0a0a0a",
1000
- muted: "#f4f4f5",
1001
- mutedForeground: "#71717a",
1002
- primary: "#0f49a0",
1003
- primaryForeground: "#ffffff",
1004
- accent: "#16a34a",
1005
- accentForeground: "#ffffff",
1006
- destructive: "#ef4444",
1007
- destructiveForeground: "#ffffff",
1008
- border: "#e4e4e7",
1009
- ring: "#2563eb"
1010
- },
1011
- radii: { sm: 4, md: 8, lg: 12, xl: 16, full: 9999 },
1012
- space: { xs: 4, sm: 8, md: 12, lg: 16, xl: 24 },
1013
- typography: { h1: 30, h2: 24, h3: 20, body: 16, small: 14 },
1014
- icons: { sm: 16, md: 20, lg: 24 }
1015
- };
1016
- // src/theme/variants.ts
1017
- import { cva as cva6 } from "class-variance-authority";
1018
- "use client";
1019
- var dsBaseVariants = cva6("", {
1020
- variants: {
1021
- size: {
1022
- sm: "",
1023
- md: "",
1024
- lg: ""
1025
- },
1026
- density: {
1027
- compact: "",
1028
- comfortable: ""
1029
- },
1030
- tone: {
1031
- neutral: "",
1032
- info: "",
1033
- success: "",
1034
- warning: "",
1035
- danger: ""
1036
- },
1037
- emphasis: {
1038
- default: "",
1039
- subtle: "",
1040
- strong: ""
1041
- }
1042
- },
1043
- defaultVariants: {
1044
- size: "md",
1045
- density: "comfortable",
1046
- tone: "neutral",
1047
- emphasis: "default"
1048
- }
1049
- });
1050
- export {
1051
- withPlatformUI,
1052
- useResponsive,
1053
- useReducedMotion,
1054
- usePackageManager,
1055
- useListUrlState,
1056
- useColorScheme,
1057
- mapTokensForPlatform,
1058
- formRenderer,
1059
- dsBaseVariants,
1060
- defaultTokens,
1061
- ZodForm,
1062
- VisualizationRenderer,
1063
- VisualizationGrid,
1064
- VisualizationCard,
1065
- ViewButton,
1066
- ToggleRightButton,
1067
- ToggleLeftButton,
1068
- ToggleButton,
1069
- TimelineView,
1070
- TimeChip,
1071
- Textarea2 as Textarea,
1072
- TestimonialCarousel,
1073
- TermsTemplate,
1074
- Stepper,
1075
- StatusChip,
1076
- StatCardGroup,
1077
- StatCard,
1078
- SkeletonList,
1079
- SkeletonCircle,
1080
- SkeletonBlock,
1081
- ScoreBar,
1082
- SalesTermsTemplate,
1083
- RankBadge,
1084
- PrivacyTemplate,
1085
- PricingSection,
1086
- PricingCarousel,
1087
- PlaceChip,
1088
- PageHeaderResponsive,
1089
- PackageManagerProvider,
1090
- OverviewCard,
1091
- NavUser,
1092
- NavMain,
1093
- NavBrand,
1094
- ModelComparisonView,
1095
- MobileHeader,
1096
- MarketingStepCard,
1097
- MarketingSection,
1098
- MarketingLayout,
1099
- MarketingIconCard,
1100
- MarketingHeaderMobile,
1101
- MarketingHeaderDesktop,
1102
- MarketingHeader,
1103
- MarketingComparisonSection,
1104
- MarketingCardsSection,
1105
- MarketingCardTitle,
1106
- MarketingCardHeader,
1107
- MarketingCardDescription,
1108
- MarketingCardContent,
1109
- MarketingCard,
1110
- MarkdownRenderer,
1111
- LoaderCircular,
1112
- LoaderBlock,
1113
- ListTablePage,
1114
- ListPageTemplate,
1115
- ListPageResponsive,
1116
- ListGridPage,
1117
- ListCardPage,
1118
- Link,
1119
- LegalText2 as LegalText,
1120
- LegalTOC2 as LegalTOC,
1121
- LegalSection2 as LegalSection,
1122
- LegalPageLayout,
1123
- LegalMeta2 as LegalMeta,
1124
- LegalList2 as LegalList,
1125
- LegalHeading2 as LegalHeading,
1126
- LegalCallout,
1127
- LangSwitch,
1128
- KeyValueList,
1129
- InstallCommand,
1130
- Input2 as Input,
1131
- HoverPreviewUser,
1132
- HoverPreviewStats,
1133
- HoverPreviewSimple,
1134
- HoverPreviewMedia,
1135
- HoverPreviewDoc,
1136
- HoverPreview,
1137
- HeroSection,
1138
- HeroResponsive,
1139
- Header,
1140
- GDPRRights,
1141
- GDPRDataRequest,
1142
- FormStepsLayout,
1143
- FormSection,
1144
- FormRow,
1145
- FormOneByOneLayout,
1146
- FormGrid,
1147
- FormDialog,
1148
- FormCardLayout,
1149
- Footer,
1150
- FiltersToolbar,
1151
- FeaturesSection,
1152
- FeatureCarousel,
1153
- FAQSection,
1154
- ErrorState,
1155
- EntityCard,
1156
- EmptyState,
1157
- EmptySearchResult,
1158
- EmptyDataList,
1159
- EditButton,
1160
- DurationChip,
1161
- DimensionScoresCard,
1162
- DesktopHeader,
1163
- DeleteButton,
1164
- DefinitionList,
1165
- DateChip,
1166
- DataViewTable,
1167
- DataViewRenderer,
1168
- DataViewList,
1169
- DataViewDetail,
1170
- DataTable,
1171
- DEFAULT_BREAKPOINTS,
1172
- Cta,
1173
- CopyButton,
1174
- CookiesTemplate,
1175
- ContactTemplate,
1176
- ContactForm,
1177
- ContactFields2 as ContactFields,
1178
- ConsentList,
1179
- ConsentItem,
1180
- ComparisonView,
1181
- CommandTabs,
1182
- CommandSearchTrigger,
1183
- CommandPalette,
1184
- CodeBlock,
1185
- ButtonLink,
1186
- Button2 as Button,
1187
- Breadcrumbs,
1188
- ApprovalQueue,
1189
- AppSidebar,
1190
- AppLayout,
1191
- AppHeader,
1192
- AiLinkButton,
1193
- AgentMonitor,
1194
- ActionForm,
1195
- AcademyLayout
1196
- };
1
+ import*as N from"react";import{Button as o}from"@contractspec/lib.ui-kit-web/ui/button";import{Loader2 as h}from"lucide-react";import{jsx as U,jsxs as e,Fragment as a}from"react/jsx-runtime";function y({children:R,loading:g,spinnerPlacement:f="start",onPress:q,onPressIn:E,onPressOut:J,onLongPress:X,onTouchStart:Q,onTouchEnd:_,onTouchCancel:m,onMouseDown:D,onMouseUp:F,onClick:S,className:T,disabled:z,...B}){let M=Boolean(z||g),I=q?()=>{q()}:S,p=!B.asChild?e(a,{children:[g&&f==="start"?U(h,{className:"h-4 w-4 animate-spin"}):null,R,g&&f==="end"?U(h,{className:"h-4 w-4 animate-spin"}):null]}):R;return U(o,{...B,className:T,disabled:M,"aria-busy":g?!0:void 0,"aria-disabled":M?!0:void 0,onClick:I,onMouseDown:D||E,onMouseUp:F||J,onTouchStart:Q,onTouchEnd:_||J,onTouchCancel:m||J,type:B?.type??"button",children:p})}import{Label as K}from"@contractspec/lib.ui-kit-web/ui/label";import{Input as ff}from"@contractspec/lib.ui-kit-web/ui/input";function t(R){if(!R)return;switch(R){case"email":return"email";case"url":return"url";case"username":return"username";case"new-password":return"new-password";case"current-password":return"password";case"one-time-code":return"otp";case"tel":case"tel-country-code":case"tel-national":case"tel-area-code":case"tel-local":case"tel-local-prefix":case"tel-local-suffix":case"tel-extension":return"tel";case"postal-code":case"cc-number":case"cc-csc":case"bday-day":case"bday-month":case"bday-year":return"int";case"cc-exp":case"cc-exp-month":case"cc-exp-year":return"numbers-and-punctuation";case"bday":return"date";default:return"text"}}function s(R,g){if(!g)return;if(["name","given-name","additional-name","family-name","honorific-prefix","honorific-suffix","nickname","organization","organization-title","cc-name","cc-given-name","cc-additional-name","cc-family-name"].includes(g))R.autoCapitalize="words";if(["username","new-password","current-password","one-time-code","email","url"].includes(g))R.autoCapitalize="none"}function W(R){let g=R?.kind??t(R?.autoComplete)??"text",f={};switch(g){case"password":if(f.type="password",f.autoCapitalize="none",f.autoComplete=R?.autoComplete??"current-password",R?.autoCorrect!=null)f.autoCorrect=R.autoCorrect;break;case"new-password":if(f.type="password",f.autoCapitalize="none",f.autoComplete=R?.autoComplete??"new-password",R?.autoCorrect!=null)f.autoCorrect=R.autoCorrect;break;case"username":f.type="text",f.autoCapitalize="none",f.autoComplete=R?.autoComplete??"username";break;case"email":f.type="email",f.inputMode="email",f.autoCapitalize="none",f.autoComplete=R?.autoComplete??"email";break;case"url":f.type="url",f.inputMode="url",f.autoComplete=R?.autoComplete??"url";break;case"search":f.type="search",f.inputMode="search",f.enterKeyHint=R?.enterKeyHint??"search",f.autoComplete=R?.autoComplete??"off";break;case"phone":case"tel":f.type="tel",f.inputMode="tel",f.autoComplete=R?.autoComplete??"tel";break;case"number":case"int":f.type="text",f.inputMode="numeric",f.pattern="[0-9]*";break;case"decimal":f.type="text",f.inputMode="decimal",f.step="any";break;case"numbers-and-punctuation":f.type="text",f.inputMode="text",f.pattern="[0-9.,-]*";break;case"otp":f.type="text",f.inputMode="numeric",f.autoComplete=R?.autoComplete??"one-time-code",f.autoCapitalize="none";break;case"name":f.type="text",f.autoComplete=R?.autoComplete??"name",f.autoCapitalize=R?.autoCapitalize??"words";break;case"given-name":f.type="text",f.autoComplete=R?.autoComplete??"given-name",f.autoCapitalize=R?.autoCapitalize??"words";break;case"family-name":f.type="text",f.autoComplete=R?.autoComplete??"family-name",f.autoCapitalize=R?.autoCapitalize??"words";break;case"address-line1":f.type="text",f.autoComplete=R?.autoComplete??"address-line1";break;case"address-line2":f.type="text",f.autoComplete=R?.autoComplete??"address-line2";break;case"postal-code":f.type="text",f.inputMode="numeric",f.pattern="[0-9]*",f.autoComplete=R?.autoComplete??"postal-code";break;case"cc-number":f.type="text",f.inputMode="numeric",f.pattern="[0-9]*",f.autoComplete=R?.autoComplete??"cc-number";break;case"cc-exp":f.type="text",f.inputMode="numeric",f.pattern="[0-9/]*",f.autoComplete=R?.autoComplete??"cc-exp";break;case"cc-csc":f.type="text",f.inputMode="numeric",f.pattern="[0-9]*",f.autoComplete=R?.autoComplete??"cc-csc";break;case"off":f.type="text",f.autoComplete="off";break;case"date":f.type="date",f.inputMode="date",f.pattern="[0-9./-]*";break;default:f.type="text";break}if(R?.autoCapitalize)f.autoCapitalize=R.autoCapitalize;if(R?.autoComplete)f.autoComplete=R.autoComplete;if(R?.autoCorrect!=null)f.autoCorrect=R.autoCorrect;if(R?.enterKeyHint)f.enterKeyHint=R.enterKeyHint;return s(f,R?.autoComplete),f}import{jsx as Rf}from"react/jsx-runtime";function G({value:R,defaultValue:g,onChange:f,onSubmit:q,onFocus:E,onBlur:J,placeholder:X,disabled:Q,readOnly:_,maxLength:m,name:D,className:F,keyboard:S,...T}){let z=W(S);return Rf(ff,{...T,className:F,value:R,defaultValue:g,onChange:f,onFocus:E,onBlur:J,placeholder:X,disabled:Q,readOnly:_,maxLength:m,name:D,...z})}import{Textarea as gf}from"@contractspec/lib.ui-kit-web/ui/textarea";import*as u from"react";import{jsx as qf}from"react/jsx-runtime";function P({value:R,defaultValue:g,onChange:f,onSubmit:q,onFocus:E,onBlur:J,placeholder:X,disabled:Q,readOnly:_,maxLength:m,name:D,className:F,rows:S,keyboard:T,...z}){let B=W(T),M=u.useCallback((I)=>f?.(I),[f]);return qf(gf,{...z,className:F,value:R,defaultValue:g,onChange:M,onFocus:E,onBlur:J,placeholder:X,disabled:Q,readOnly:_,maxLength:m,name:D,rows:S,...B})}import{jsx as Z,jsxs as L}from"react/jsx-runtime";function x({value:R,onChange:g,disabled:f}){return L("div",{className:"space-y-4",children:[L("div",{className:"space-y-2",children:[Z(K,{children:"Nom"}),Z(G,{value:R.name,onChange:(q)=>g({...R,name:q.target.value}),disabled:f})]}),L("div",{className:"space-y-2",children:[Z(K,{children:"Email"}),Z(G,{type:"email",value:R.email,onChange:(q)=>g({...R,email:q.target.value}),disabled:f})]}),L("div",{className:"space-y-2",children:[Z(K,{children:"Objet"}),Z(G,{value:R.subject,onChange:(q)=>g({...R,subject:q.target.value}),disabled:f})]}),L("div",{className:"space-y-2",children:[Z(K,{children:"Message"}),Z(P,{value:R.message,onChange:(q)=>g({...R,message:q.target.value}),disabled:f,rows:6})]})]})}import{jsx as j,jsxs as Ef}from"react/jsx-runtime";function SR({labels:R={submit:"Envoyer"},initialValue:g={name:"",email:"",subject:"",message:""},disabled:f,onSubmit:q}){let[E,J]=N.useState(g),[X,Q]=N.useState(!1);return Ef("form",{onSubmit:async(m)=>{if(m.preventDefault(),!q)return;Q(!0);try{await q(E)}finally{Q(!1)}},className:"space-y-6",children:[j(x,{value:E,onChange:J,disabled:f||X}),j(y,{disabled:f||X,type:"submit",children:X?"Envoi…":R.submit})]})}import*as r from"react";import{cn as Jf}from"@contractspec/lib.ui-kit-web/ui/utils";import{cva as Qf}from"class-variance-authority";import{jsx as Yf}from"react/jsx-runtime";var Xf=Qf("text-foreground tracking-tight",{variants:{level:{h1:"font-semibold text-3xl md:text-4xl",h2:"font-semibold text-2xl md:text-3xl",h3:"font-semibold text-xl md:text-2xl",h4:"font-semibold text-lg md:text-xl"},tone:{default:"",muted:"text-muted-foreground",accent:"text-primary"},spacing:{none:"",sm:"mt-4",md:"mt-6",lg:"mt-8"}},defaultVariants:{level:"h2",tone:"default",spacing:"md"}});function H({as:R,level:g,tone:f,spacing:q,className:E,...J}){return Yf(R??g??"h2",{className:Jf(Xf({level:g,tone:f,spacing:q}),E),...J})}import{cn as Zf}from"@contractspec/lib.ui-kit-web/ui/utils";import{cva as $f}from"class-variance-authority";import{jsx as mf}from"react/jsx-runtime";var _f=$f("space-y-3",{variants:{spacing:{sm:"py-3",md:"py-4",lg:"py-6"},border:{none:"",top:"border-t",bottom:"border-b",both:"border-y"},tone:{plain:"",subtle:"bg-muted/30"}},defaultVariants:{spacing:"md",border:"none",tone:"plain"}});function O({spacing:R,border:g,tone:f,className:q,...E}){return mf("div",{className:Zf(_f({spacing:R,border:g,tone:f}),q),...E})}import{cn as yf}from"@contractspec/lib.ui-kit-web/ui/utils";import{cva as Gf}from"class-variance-authority";import{jsx as Df}from"react/jsx-runtime";var Hf=Gf("text-base leading-relaxed",{variants:{tone:{default:"text-foreground",muted:"text-muted-foreground",danger:"text-destructive"},size:{base:"text-base",sm:"text-sm",lg:"text-lg"},spacing:{none:"",sm:"mt-2",md:"mt-3",lg:"mt-4"}},defaultVariants:{tone:"default",size:"base",spacing:"sm"}});function l({as:R="p",tone:g,size:f,spacing:q,className:E,...J}){return Df(R,{className:yf(Hf({tone:g,size:f,spacing:q}),E),...J})}import{jsx as V,jsxs as v}from"react/jsx-runtime";function dR({onExport:R,onDelete:g,labels:f={export:"Demander une copie",delete:"Demander la suppression"}}){let[q,E]=r.useState(null),J=async(X)=>{let Q=X==="export"?R:g;if(!Q)return;E(X);try{await Q()}finally{E(null)}};return v(O,{border:"top",className:"space-y-3",children:[V(H,{as:"h2",level:"h2",children:"Demandes de données"}),V(l,{children:"Vous pouvez demander une copie de vos données ou solliciter leur suppression. Ces demandes nécessitent une vérification d’identité et sont traitées dans les délais légaux."}),v("div",{className:"flex flex-wrap gap-3",children:[V(y,{onPress:()=>J("export"),disabled:q!==null,children:q==="export"?"Envoi…":f.export}),V(y,{variant:"destructive",onPress:()=>J("delete"),disabled:q!==null,children:q==="delete"?"Envoi…":f.delete})]})]})}import{cn as Ff}from"@contractspec/lib.ui-kit-web/ui/utils";import{cva as Sf}from"class-variance-authority";import{jsx as zf}from"react/jsx-runtime";var Tf=Sf("",{variants:{type:{unordered:"list-disc pl-6",ordered:"list-decimal pl-6",none:"pl-0"},spacing:{sm:"space-y-1",md:"space-y-2",lg:"space-y-3"}},defaultVariants:{type:"unordered",spacing:"md"}});function c({type:R,spacing:g,className:f,children:q,...E}){return zf(R==="ordered"?"ol":"ul",{className:Ff(Tf({type:R,spacing:g}),f),...E,children:q})}import{jsx as k,jsxs as Bf}from"react/jsx-runtime";function iR({title:R="Vos droits RGPD",rights:g=["Accès à vos données","Rectification","Effacement (droit à l’oubli)","Opposition et limitation","Portabilité"]}){return Bf(O,{border:"top",children:[k(H,{as:"h2",level:"h2",children:R}),k(c,{type:"unordered",children:g.map((f,q)=>k("li",{children:f},q))})]})}import{cn as Pf}from"@contractspec/lib.ui-kit-web/ui/utils";import{cn as Lf}from"@contractspec/lib.ui-kit-web/ui/utils";import{jsx as Af,jsxs as w}from"react/jsx-runtime";function n({lastUpdated:R,version:g,className:f}){let q=(E)=>{if(!E)return null;try{return(typeof E==="string"?new Date(E):E).toLocaleDateString()}catch{return String(E)}};return w("div",{className:Lf("text-base text-muted-foreground",f),children:[g&&w("span",{children:["Version ",g]}),g&&R&&Af("span",{className:"mx-2",children:"•"}),R&&w("span",{children:["Dernière mise à jour: ",q(R)]})]})}import{cn as C}from"@contractspec/lib.ui-kit-web/ui/utils";import{cva as Mf}from"class-variance-authority";import{jsx as A}from"react/jsx-runtime";var Wf=Mf("text-base",{variants:{variant:{sidebar:"space-y-2",inline:"flex flex-wrap gap-3"},size:{sm:"",md:"text-base"}},defaultVariants:{variant:"sidebar",size:"md"}});function b({items:R,activeHref:g,onNavigate:f,variant:q,size:E,className:J,...X}){return A("nav",{"aria-label":"Table of contents",className:C(Wf({variant:q,size:E}),J),...X,children:q==="inline"?R.map((Q)=>A("a",{href:Q.href,onClick:(_)=>{f?.(Q.href)},className:C("rounded-xs px-2 py-1 hover:bg-accent hover:text-accent-foreground",g===Q.href&&"bg-accent text-accent-foreground"),children:Q.label},Q.href)):A("ul",{className:"list-none space-y-2 pl-0",children:R.map((Q)=>A("li",{children:A("a",{href:Q.href,onClick:()=>f?.(Q.href),className:C("block rounded-xs px-2 py-1 hover:bg-accent hover:text-accent-foreground",g===Q.href&&"bg-accent text-accent-foreground"),children:Q.label})},Q.href))})})}import{jsx as $,jsxs as d}from"react/jsx-runtime";function X4({title:R,meta:g,toc:f,children:q,className:E}){return d("div",{className:Pf("mx-auto w-full max-w-6xl px-4 py-8 md:py-12",E),children:[d("div",{className:"mb-6 space-y-2",children:[$(H,{as:"h1",level:"h1",spacing:"sm",children:R}),g&&$(n,{lastUpdated:g.lastUpdated,version:g.version})]}),f&&f.length>0&&$("div",{className:"mb-6 md:hidden",children:$(b,{items:f,variant:"inline"})}),d("div",{className:"grid grid-cols-1 gap-8 md:grid-cols-[220px_minmax(0,1fr)]",children:[f&&f.length>0?$("aside",{className:"sticky top-24 hidden self-start md:block",children:$(b,{items:f,variant:"sidebar"})}):$("div",{className:"hidden md:block"}),$("article",{className:"prose max-w-none text-foreground",children:q})]})]})}var Kf={sm:640,md:768,lg:1024,xl:1280};function $4(R){let g=R.platform??"web",f={...Kf,...R.breakpoints};return{platform:g,tokens:R.tokens,breakpoints:f}}import{shadcnDriver as Of}from"@contractspec/lib.contracts-runtime-client-react/drivers/shadcn";import{createFormRenderer as Vf}from"@contractspec/lib.contracts-runtime-client-react/form-render";import{Checkbox as If}from"@contractspec/lib.ui-kit-web/ui/checkbox";import{FieldDescription as Uf,FieldError as Nf,FieldGroup as kf,FieldLabel as wf,Field as Cf}from"@contractspec/lib.ui-kit-web/ui/field";import{Label as bf}from"@contractspec/lib.ui-kit-web/ui/label";import{RadioGroupItem as df,RadioGroup as hf}from"@contractspec/lib.ui-kit-web/ui/radio-group";import{SelectContent as uf,SelectGroup as xf,SelectItem as jf,SelectTrigger as lf,Select as vf,SelectValue as rf}from"@contractspec/lib.ui-kit-web/ui/select";import{Switch as cf}from"@contractspec/lib.ui-kit-web/ui/switch";import{jsx as Y,jsxs as i}from"react/jsx-runtime";var nf=(R)=>{let{options:g,value:f,onChange:q,...E}=R;return i(vf,{value:f??"",onValueChange:(J)=>q?.(J),...E,children:[Y(lf,{className:"w-[180px]",children:Y(rf,{placeholder:R.placeholder})}),Y(uf,{children:Y(xf,{children:g?.map((J,X)=>Y(jf,{value:J.value,disabled:J.disabled,children:J.labelI18n},X))})})]})},pf=(R)=>Y(If,{checked:!!R.checked,onCheckedChange:(g)=>R.onCheckedChange?.(g),...R}),of=(R)=>Y(hf,{...R,children:R.options?.map((g)=>i("div",{className:"flex items-center gap-3",children:[Y(df,{value:g.value,id:g.value}),Y(bf,{htmlFor:g.value,children:g.label})]},g.value))}),af=(R)=>Y(cf,{checked:!!R.checked,onCheckedChange:(g)=>R.onCheckedChange?.(g),...R}),A4=Vf({driver:Of({Field:Cf,FieldLabel:wf,FieldDescription:Uf,FieldError:Nf,FieldGroup:kf,FieldSet:(R)=>Y("fieldset",{...R}),FieldLegend:(R)=>Y("legend",{...R}),Input:G,Textarea:P,Select:nf,Checkbox:pf,RadioGroup:of,Switch:af,Button:y})});var P4={colors:{background:"#ffffff",foreground:"#0a0a0a",muted:"#f4f4f5",mutedForeground:"#71717a",primary:"#0f49a0",primaryForeground:"#ffffff",accent:"#16a34a",accentForeground:"#ffffff",destructive:"#ef4444",destructiveForeground:"#ffffff",border:"#e4e4e7",ring:"#2563eb"},radii:{sm:4,md:8,lg:12,xl:16,full:9999},space:{xs:4,sm:8,md:12,lg:16,xl:24},typography:{h1:30,h2:24,h3:20,body:16,small:14},icons:{sm:16,md:20,lg:24}};import{cva as ef}from"class-variance-authority";var V4=ef("",{variants:{size:{sm:"",md:"",lg:""},density:{compact:"",comfortable:""},tone:{neutral:"",info:"",success:"",warning:"",danger:""},emphasis:{default:"",subtle:"",strong:""}},defaultVariants:{size:"md",density:"comfortable",tone:"neutral",emphasis:"default"}});export{$4 as withPlatformUI,D6 as useResponsive,G6 as useReducedMotion,a0 as usePackageManager,$6 as useListUrlState,m6 as useColorScheme,z6 as mapTokensForPlatform,A4 as formRenderer,V4 as dsBaseVariants,P4 as defaultTokens,cg as ZodForm,Y6 as VisualizationRenderer,Q6 as VisualizationGrid,E6 as VisualizationCard,l4 as ViewButton,j4 as ToggleRightButton,x4 as ToggleLeftButton,u4 as ToggleButton,g6 as TimelineView,s4 as TimeChip,Tg as Textarea,i0 as TestimonialCarousel,O2 as TermsTemplate,Fg as Stepper,i1 as StatusChip,c1 as StatCardGroup,r1 as StatCard,l1 as SkeletonList,x1 as SkeletonCircle,h1 as SkeletonBlock,Hg as ScoreBar,P2 as SalesTermsTemplate,yg as RankBadge,M2 as PrivacyTemplate,c0 as PricingSection,v0 as PricingCarousel,t4 as PlaceChip,j0 as PageHeaderResponsive,o0 as PackageManagerProvider,b1 as OverviewCard,w1 as NavUser,N1 as NavMain,_g as NavBrand,u0 as ModelComparisonView,F0 as MobileHeader,r2 as MarketingStepCard,l2 as MarketingSection,d0 as MarketingLayout,x2 as MarketingIconCard,C0 as MarketingHeaderMobile,k0 as MarketingHeaderDesktop,U0 as MarketingHeader,h2 as MarketingComparisonSection,b2 as MarketingCardsSection,w2 as MarketingCardTitle,k2 as MarketingCardHeader,N2 as MarketingCardDescription,U2 as MarketingCardContent,I2 as MarketingCard,I1 as MarkdownRenderer,Zg as LoaderCircular,O1 as LoaderBlock,V0 as ListTablePage,t0 as ListPageTemplate,K0 as ListPageResponsive,W0 as ListGridPage,A0 as ListCardPage,Xg as Link,J2 as LegalText,G2 as LegalTOC,q2 as LegalSection,X4 as LegalPageLayout,m2 as LegalMeta,R2 as LegalList,sg as LegalHeading,eg as LegalCallout,P1 as LangSwitch,og as KeyValueList,M1 as InstallCommand,Jg as Input,L1 as HoverPreviewUser,z1 as HoverPreviewStats,S1 as HoverPreviewSimple,D1 as HoverPreviewMedia,G1 as HoverPreviewDoc,m1 as HoverPreview,B0 as HeroSection,T0 as HeroResponsive,D0 as Header,iR as GDPRRights,dR as GDPRDataRequest,vg as FormStepsLayout,ug as FormSection,hg as FormRow,jg as FormOneByOneLayout,dg as FormGrid,Cg as FormDialog,kg as FormCardLayout,y0 as Footer,$1 as FiltersToolbar,_0 as FeaturesSection,Z0 as FeatureCarousel,X0 as FAQSection,qg as ErrorState,Y1 as EntityCard,Rg as EmptyState,J0 as EmptySearchResult,q0 as EmptyDataList,h4 as EditButton,e4 as DurationChip,Q1 as DimensionScoresCard,H0 as DesktopHeader,d4 as DeleteButton,ig as DefinitionList,a4 as DateChip,Vg as DataViewTable,Kg as DataViewRenderer,Wg as DataViewList,Ag as DataViewDetail,Bg as DataTable,Kf as DEFAULT_BREAKPOINTS,p4 as Cta,E1 as CopyButton,L2 as CookiesTemplate,z2 as ContactTemplate,SR as ContactForm,$2 as ContactFields,Y2 as ConsentList,X2 as ConsentItem,f6 as ComparisonView,g1 as CommandTabs,f1 as CommandSearchTrigger,t2 as CommandPalette,a2 as CodeBlock,n4 as ButtonLink,r4 as Button,p2 as Breadcrumbs,C4 as ApprovalQueue,R0 as AppSidebar,s1 as AppLayout,e1 as AppHeader,n2 as AiLinkButton,k4 as AgentMonitor,Ug as ActionForm,o1 as AcademyLayout};