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