@contractspec/lib.design-system 3.9.0 → 3.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +76 -0
- package/dist/browser/index.js +1 -1
- package/dist/components/data-table/DataTableToolbar.d.ts +3 -0
- package/dist/components/data-table/DataTableToolbar.mobile.d.ts +3 -0
- package/dist/components/data-table/DataTableToolbar.shared.d.ts +23 -0
- package/dist/components/data-view/DataViewRenderer.d.ts +3 -1
- package/dist/components/data-view/DataViewRenderer.mobile.d.ts +3 -1
- package/dist/components/data-view/DataViewTable.d.ts +3 -1
- package/dist/components/data-view/DataViewTable.mobile.d.ts +3 -1
- package/dist/components/molecules/FiltersToolbar.mobile.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -86,6 +86,82 @@ const resolver = createTranslationResolver({
|
|
|
86
86
|
</DesignSystemTranslationProvider>;
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
+
### Render the canonical account grid
|
|
90
|
+
|
|
91
|
+
The canonical data-table example lives in
|
|
92
|
+
[`@contractspec/example.data-grid-showcase`](../../examples/data-grid-showcase/README.md).
|
|
93
|
+
Its composed lane uses `DataTable`, `DataTableToolbar`, and `DataViewTable`
|
|
94
|
+
from this package:
|
|
95
|
+
|
|
96
|
+
```tsx
|
|
97
|
+
import {
|
|
98
|
+
Button,
|
|
99
|
+
DataTable,
|
|
100
|
+
DataTableToolbar,
|
|
101
|
+
DataViewTable,
|
|
102
|
+
} from '@contractspec/lib.design-system';
|
|
103
|
+
import { useContractTable } from '@contractspec/lib.presentation-runtime-react';
|
|
104
|
+
|
|
105
|
+
import { DataGridShowcaseDataView } from '@contractspec/example.data-grid-showcase/contracts/data-grid-showcase.data-view';
|
|
106
|
+
import { SHOWCASE_ROWS } from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.data';
|
|
107
|
+
import { useShowcaseColumns } from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.columns';
|
|
108
|
+
import {
|
|
109
|
+
ExpandedRowContent,
|
|
110
|
+
} from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.parts';
|
|
111
|
+
|
|
112
|
+
export function AccountHealthTable() {
|
|
113
|
+
const columns = useShowcaseColumns();
|
|
114
|
+
|
|
115
|
+
const controller = useContractTable({
|
|
116
|
+
data: SHOWCASE_ROWS,
|
|
117
|
+
columns,
|
|
118
|
+
selectionMode: 'multiple',
|
|
119
|
+
initialState: {
|
|
120
|
+
sorting: [{ id: 'arr', desc: true }],
|
|
121
|
+
pagination: { pageIndex: 0, pageSize: 4 },
|
|
122
|
+
columnVisibility: { notes: false },
|
|
123
|
+
columnPinning: { left: ['account'], right: [] },
|
|
124
|
+
},
|
|
125
|
+
renderExpandedContent: (row) => <ExpandedRowContent row={row} />,
|
|
126
|
+
getCanExpand: () => true,
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
return (
|
|
130
|
+
<>
|
|
131
|
+
<DataTable
|
|
132
|
+
controller={controller}
|
|
133
|
+
title="Account health"
|
|
134
|
+
description="Composed table surface for the canonical account grid."
|
|
135
|
+
headerActions={<Button variant="outline">Reset</Button>}
|
|
136
|
+
toolbar={
|
|
137
|
+
<DataTableToolbar
|
|
138
|
+
controller={controller}
|
|
139
|
+
searchPlaceholder="Search accounts"
|
|
140
|
+
actionsStart={
|
|
141
|
+
<Button variant="outline" size="sm">
|
|
142
|
+
Risk Only
|
|
143
|
+
</Button>
|
|
144
|
+
}
|
|
145
|
+
/>
|
|
146
|
+
}
|
|
147
|
+
loading={false}
|
|
148
|
+
emptyState={<div>No rows available.</div>}
|
|
149
|
+
footer={\`Page \${controller.pageIndex + 1} of \${controller.pageCount}\`}
|
|
150
|
+
/>
|
|
151
|
+
|
|
152
|
+
<DataViewTable
|
|
153
|
+
spec={DataGridShowcaseDataView}
|
|
154
|
+
items={SHOWCASE_ROWS}
|
|
155
|
+
/>
|
|
156
|
+
</>
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
`DataTable` remains the composed card/container surface. `DataTableToolbar` is
|
|
162
|
+
the recommended ergonomic layer for search, chips, selection summary, and
|
|
163
|
+
hidden-column recovery without widening the primitive table API.
|
|
164
|
+
|
|
89
165
|
## API map
|
|
90
166
|
|
|
91
167
|
### Theme and platform
|
package/dist/browser/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as j from"react";import{Button as Hf}from"@contractspec/lib.ui-kit-web/ui/button";import{Loader2 as p}from"lucide-react";import{jsx as x,jsxs as zf,Fragment as Df}from"react/jsx-runtime";function z({children:f,loading:g,spinnerPlacement:m="start",onPress:R,onPressIn:y,onPressOut:G,onLongPress:$,onTouchStart:q,onTouchEnd:Y,onTouchCancel:H,onMouseDown:W,onMouseUp:B,onClick:U,className:w,disabled:V,...M}){let O=Boolean(V||g),u=R?()=>{R()}:U,hf=!M.asChild?zf(Df,{children:[g&&m==="start"?x(p,{className:"h-4 w-4 animate-spin"}):null,f,g&&m==="end"?x(p,{className:"h-4 w-4 animate-spin"}):null]}):f;return x(Hf,{...M,className:w,disabled:O,"aria-busy":g?!0:void 0,"aria-disabled":O?!0:void 0,onClick:u,onMouseDown:W||y,onMouseUp:B||G,onTouchStart:q,onTouchEnd:Y||G,onTouchCancel:H||G,type:M?.type??"button",children:hf})}import{Label as C}from"@contractspec/lib.ui-kit-web/ui/label";import{Input as Wf}from"@contractspec/lib.ui-kit-web/ui/input";function Pf(f){if(!f)return;switch(f){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 Sf(f,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))f.autoCapitalize="words";if(["username","new-password","current-password","one-time-code","email","url"].includes(g))f.autoCapitalize="none"}function _(f){let g=f?.kind??Pf(f?.autoComplete)??"text",m={};switch(g){case"password":if(m.type="password",m.autoCapitalize="none",m.autoComplete=f?.autoComplete??"current-password",f?.autoCorrect!=null)m.autoCorrect=f.autoCorrect;break;case"new-password":if(m.type="password",m.autoCapitalize="none",m.autoComplete=f?.autoComplete??"new-password",f?.autoCorrect!=null)m.autoCorrect=f.autoCorrect;break;case"username":m.type="text",m.autoCapitalize="none",m.autoComplete=f?.autoComplete??"username";break;case"email":m.type="email",m.inputMode="email",m.autoCapitalize="none",m.autoComplete=f?.autoComplete??"email";break;case"url":m.type="url",m.inputMode="url",m.autoComplete=f?.autoComplete??"url";break;case"search":m.type="search",m.inputMode="search",m.enterKeyHint=f?.enterKeyHint??"search",m.autoComplete=f?.autoComplete??"off";break;case"phone":case"tel":m.type="tel",m.inputMode="tel",m.autoComplete=f?.autoComplete??"tel";break;case"number":case"int":m.type="text",m.inputMode="numeric",m.pattern="[0-9]*";break;case"decimal":m.type="text",m.inputMode="decimal",m.step="any";break;case"numbers-and-punctuation":m.type="text",m.inputMode="text",m.pattern="[0-9.,-]*";break;case"otp":m.type="text",m.inputMode="numeric",m.autoComplete=f?.autoComplete??"one-time-code",m.autoCapitalize="none";break;case"name":m.type="text",m.autoComplete=f?.autoComplete??"name",m.autoCapitalize=f?.autoCapitalize??"words";break;case"given-name":m.type="text",m.autoComplete=f?.autoComplete??"given-name",m.autoCapitalize=f?.autoCapitalize??"words";break;case"family-name":m.type="text",m.autoComplete=f?.autoComplete??"family-name",m.autoCapitalize=f?.autoCapitalize??"words";break;case"address-line1":m.type="text",m.autoComplete=f?.autoComplete??"address-line1";break;case"address-line2":m.type="text",m.autoComplete=f?.autoComplete??"address-line2";break;case"postal-code":m.type="text",m.inputMode="numeric",m.pattern="[0-9]*",m.autoComplete=f?.autoComplete??"postal-code";break;case"cc-number":m.type="text",m.inputMode="numeric",m.pattern="[0-9]*",m.autoComplete=f?.autoComplete??"cc-number";break;case"cc-exp":m.type="text",m.inputMode="numeric",m.pattern="[0-9/]*",m.autoComplete=f?.autoComplete??"cc-exp";break;case"cc-csc":m.type="text",m.inputMode="numeric",m.pattern="[0-9]*",m.autoComplete=f?.autoComplete??"cc-csc";break;case"off":m.type="text",m.autoComplete="off";break;case"date":m.type="date",m.inputMode="date",m.pattern="[0-9./-]*";break;default:m.type="text";break}if(f?.autoCapitalize)m.autoCapitalize=f.autoCapitalize;if(f?.autoComplete)m.autoComplete=f.autoComplete;if(f?.autoCorrect!=null)m.autoCorrect=f.autoCorrect;if(f?.enterKeyHint)m.enterKeyHint=f.enterKeyHint;return Sf(m,f?.autoComplete),m}import{jsx as Kf}from"react/jsx-runtime";function J({value:f,defaultValue:g,onChange:m,onSubmit:R,onFocus:y,onBlur:G,placeholder:$,disabled:q,readOnly:Y,maxLength:H,name:W,className:B,keyboard:U,...w}){let V=_(U);return Kf(Wf,{...w,className:B,value:f,defaultValue:g,onChange:m,onFocus:y,onBlur:G,placeholder:$,disabled:q,readOnly:Y,maxLength:H,name:W,...V})}import{Textarea as Xf}from"@contractspec/lib.ui-kit-web/ui/textarea";import*as ff from"react";import{jsx as Ef}from"react/jsx-runtime";function b({value:f,defaultValue:g,onChange:m,onSubmit:R,onFocus:y,onBlur:G,placeholder:$,disabled:q,readOnly:Y,maxLength:H,name:W,className:B,rows:U,keyboard:w,...V}){let M=_(w),O=ff.useCallback((u)=>m?.(u),[m]);return Ef(Xf,{...V,className:B,value:f,defaultValue:g,onChange:O,onFocus:y,onBlur:G,placeholder:$,disabled:q,readOnly:Y,maxLength:H,name:W,rows:U,...M})}import{jsx as P,jsxs as N}from"react/jsx-runtime";function mf({value:f,onChange:g,disabled:m}){return N("div",{className:"space-y-4",children:[N("div",{className:"space-y-2",children:[P(C,{children:"Nom"}),P(J,{value:f.name,onChange:(R)=>g({...f,name:R.target.value}),disabled:m})]}),N("div",{className:"space-y-2",children:[P(C,{children:"Email"}),P(J,{type:"email",value:f.email,onChange:(R)=>g({...f,email:R.target.value}),disabled:m})]}),N("div",{className:"space-y-2",children:[P(C,{children:"Objet"}),P(J,{value:f.subject,onChange:(R)=>g({...f,subject:R.target.value}),disabled:m})]}),N("div",{className:"space-y-2",children:[P(C,{children:"Message"}),P(b,{value:f.message,onChange:(R)=>g({...f,message:R.target.value}),disabled:m,rows:6})]})]})}import{jsx as gf,jsxs as Bf}from"react/jsx-runtime";function Tg({labels:f={submit:"Envoyer"},initialValue:g={name:"",email:"",subject:"",message:""},disabled:m,onSubmit:R}){let[y,G]=j.useState(g),[$,q]=j.useState(!1);return Bf("form",{onSubmit:async(H)=>{if(H.preventDefault(),!R)return;q(!0);try{await R(y)}finally{q(!1)}},className:"space-y-6",children:[gf(mf,{value:y,onChange:G,disabled:m||$}),gf(z,{disabled:m||$,type:"submit",children:$?"Envoi…":f.submit})]})}import*as Tf from"react";import{cn as Uf}from"@contractspec/lib.ui-kit-web/ui/utils";import{cva as wf}from"class-variance-authority";import{jsx as Mf}from"react/jsx-runtime";var Vf=wf("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 X({as:f,level:g,tone:m,spacing:R,className:y,...G}){return Mf(f??g??"h2",{className:Uf(Vf({level:g,tone:m,spacing:R}),y),...G})}import{cn as Nf}from"@contractspec/lib.ui-kit-web/ui/utils";import{cva as kf}from"class-variance-authority";import{jsx as Of}from"react/jsx-runtime";var If=kf("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 L({spacing:f,border:g,tone:m,className:R,...y}){return Of("div",{className:Nf(If({spacing:f,border:g,tone:m}),R),...y})}import{cn as _f}from"@contractspec/lib.ui-kit-web/ui/utils";import{cva as bf}from"class-variance-authority";import{jsx as Lf}from"react/jsx-runtime";var Cf=bf("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 Rf({as:f="p",tone:g,size:m,spacing:R,className:y,...G}){return Lf(f,{className:_f(Cf({tone:g,size:m,spacing:R}),y),...G})}import{jsx as d,jsxs as yf}from"react/jsx-runtime";function Ug({onExport:f,onDelete:g,labels:m={export:"Demander une copie",delete:"Demander la suppression"}}){let[R,y]=Tf.useState(null),G=async($)=>{let q=$==="export"?f:g;if(!q)return;y($);try{await q()}finally{y(null)}};return yf(L,{border:"top",className:"space-y-3",children:[d(X,{as:"h2",level:"h2",children:"Demandes de données"}),d(Rf,{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."}),yf("div",{className:"flex flex-wrap gap-3",children:[d(z,{onPress:()=>G("export"),disabled:R!==null,children:R==="export"?"Envoi…":m.export}),d(z,{variant:"destructive",onPress:()=>G("delete"),disabled:R!==null,children:R==="delete"?"Envoi…":m.delete})]})]})}import{cn as df}from"@contractspec/lib.ui-kit-web/ui/utils";import{cva as Ff}from"class-variance-authority";import{jsx as cf}from"react/jsx-runtime";var Af=Ff("",{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 qf({type:f,spacing:g,className:m,children:R,...y}){return cf(f==="ordered"?"ol":"ul",{className:df(Af({type:f,spacing:g}),m),...y,children:R})}import{jsx as v,jsxs as uf}from"react/jsx-runtime";function Cg({title:f="Vos droits RGPD",rights:g=["Accès à vos données","Rectification","Effacement (droit à l’oubli)","Opposition et limitation","Portabilité"]}){return uf(L,{border:"top",children:[v(X,{as:"h2",level:"h2",children:f}),v(qf,{type:"unordered",children:g.map((m,R)=>v("li",{children:m},R))})]})}import{cn as lf}from"@contractspec/lib.ui-kit-web/ui/utils";import{cn as xf}from"@contractspec/lib.ui-kit-web/ui/utils";import{jsx as jf,jsxs as i}from"react/jsx-runtime";function Gf({lastUpdated:f,version:g,className:m}){let R=(y)=>{if(!y)return null;try{return(typeof y==="string"?new Date(y):y).toLocaleDateString()}catch{return String(y)}};return i("div",{className:xf("text-base text-muted-foreground",m),children:[g&&i("span",{children:["Version ",g]}),g&&f&&jf("span",{className:"mx-2",children:"•"}),f&&i("span",{children:["Dernière mise à jour: ",R(f)]})]})}import{cn as n}from"@contractspec/lib.ui-kit-web/ui/utils";import{cva as vf}from"class-variance-authority";import{jsx as k}from"react/jsx-runtime";var nf=vf("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 l({items:f,activeHref:g,onNavigate:m,variant:R,size:y,className:G,...$}){return k("nav",{"aria-label":"Table of contents",className:n(nf({variant:R,size:y}),G),...$,children:R==="inline"?f.map((q)=>k("a",{href:q.href,onClick:(Y)=>{m?.(q.href)},className:n("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)):k("ul",{className:"list-none space-y-2 pl-0",children:f.map((q)=>k("li",{children:k("a",{href:q.href,onClick:()=>m?.(q.href),className:n("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 S,jsxs as e}from"react/jsx-runtime";function rg({title:f,meta:g,toc:m,children:R,className:y}){return e("div",{className:lf("mx-auto w-full max-w-6xl px-4 py-8 md:py-12",y),children:[e("div",{className:"mb-6 space-y-2",children:[S(X,{as:"h1",level:"h1",spacing:"sm",children:f}),g&&S(Gf,{lastUpdated:g.lastUpdated,version:g.version})]}),m&&m.length>0&&S("div",{className:"mb-6 md:hidden",children:S(l,{items:m,variant:"inline"})}),e("div",{className:"grid grid-cols-1 gap-8 md:grid-cols-[220px_minmax(0,1fr)]",children:[m&&m.length>0?S("aside",{className:"sticky top-24 hidden self-start md:block",children:S(l,{items:m,variant:"sidebar"})}):S("div",{className:"hidden md:block"}),S("article",{className:"prose max-w-none text-foreground",children:R})]})]})}import*as F from"react";import{jsx as ef}from"react/jsx-runtime";var $f=F.createContext(void 0);function ag({children:f,resolver:g}){return ef($f.Provider,{value:g,children:f})}function r(){return F.useContext($f)}function t(f,g){if(!f)return f;return g?.(f)??f}function Jf(f,g){return typeof f==="string"?t(f,g):f}function sg({registry:f,locale:g,fallbackLocale:m,specKeys:R=[]}){return(y)=>{let G=y.match(/^([^:]+)::(.+)$/);if(G?.[1]&&G[2]){let[,$,q]=G;return f.getWithFallback($,q,g,m)?.message.value}for(let $ of R){let q=f.getWithFallback($,y,g,m);if(q)return q.message.value}return}}var rf={sm:640,md:768,lg:1024,xl:1280};function mR(f){let g=f.platform??"web",m={...rf,...f.breakpoints};return{platform:g,tokens:f.tokens,breakpoints:m}}import{shadcnDriver as tf}from"@contractspec/lib.contracts-runtime-client-react/drivers/shadcn";import{createFormRenderer as of}from"@contractspec/lib.contracts-runtime-client-react/form-render";import{Checkbox as af}from"@contractspec/lib.ui-kit-web/ui/checkbox";import{Command as sf,CommandEmpty as pf,CommandGroup as fm,CommandInput as mm,CommandItem as gm,CommandList as Rm}from"@contractspec/lib.ui-kit-web/ui/command";import{DatePicker as ym}from"@contractspec/lib.ui-kit-web/ui/date-picker";import{DateTimePicker as Tm}from"@contractspec/lib.ui-kit-web/ui/datetime-picker";import{FieldDescription as qm,FieldError as Gm,FieldGroup as $m,FieldLabel as Jm,Field as Qm}from"@contractspec/lib.ui-kit-web/ui/field";import{Label as Ym}from"@contractspec/lib.ui-kit-web/ui/label";import{RadioGroupItem as Zm,RadioGroup as hm}from"@contractspec/lib.ui-kit-web/ui/radio-group";import{SelectContent as Hm,SelectGroup as Dm,SelectItem as zm,SelectTrigger as Pm,Select as Sm,SelectValue as Wm}from"@contractspec/lib.ui-kit-web/ui/select";import{Switch as Km}from"@contractspec/lib.ui-kit-web/ui/switch";import{TimePicker as Xm}from"@contractspec/lib.ui-kit-web/ui/time-picker";import{jsx as T,jsxs as D}from"react/jsx-runtime";function Z(f){return typeof f==="string"?f:String(f??"")}var Q={addressLine1:"Address line 1",addressLine2:"Address line 2",city:"City",countryCode:"Country code",extension:"Extension",noResultsFound:"No results found.",phoneNumber:"Phone number",postalCode:"Postal code",region:"Region",search:"Search",selected:"Selected"};function h(){let f=r();return(g)=>t(g,f)}function o(f,g,m){return f(g)??m}function I(){let f=r();return(g)=>Jf(g,f)}var a=(f)=>{let g=h(),{options:m,value:R,onChange:y,placeholder:G,...$}=f;return D(Sm,{value:R==null?"":Z(R),onValueChange:(q)=>y?.(q),...$,children:[T(Pm,{className:"w-full",children:T(Wm,{placeholder:g(G)})}),T(Hm,{children:T(Dm,{children:m?.map((q,Y)=>T(zm,{value:Z(q.value),disabled:q.disabled,children:g(q.labelI18n)},`${Z(q.value)}-${Y}`))})})]})},Em=(f)=>T(af,{checked:Boolean(f.checked),onCheckedChange:(g)=>f.onCheckedChange?.(Boolean(g))}),Bm=(f)=>{let g=h();return T(hm,{value:f.value==null?"":Z(f.value),onValueChange:(m)=>f.onValueChange?.(m),disabled:f.disabled,children:f.options?.map((m)=>{let R=Z(m.value);return D("div",{className:"flex items-center gap-3",children:[T(Zm,{value:R,id:R}),T(Ym,{htmlFor:R,children:g(m.labelI18n)})]},R)})})},Um=(f)=>T(Km,{checked:Boolean(f.checked),onCheckedChange:(g)=>f.onCheckedChange?.(Boolean(g))}),wm=(f)=>{let g=h();return D("div",{className:"space-y-2",children:[D(sf,{shouldFilter:!1,className:"rounded-md border border-input",children:[T(mm,{value:f.query,onValueChange:f.onQueryChange,placeholder:o(g,f.placeholder,Q.search),disabled:f.disabled||f.readOnly}),D(Rm,{children:[T(pf,{children:o(g,Q.noResultsFound,Q.noResultsFound)}),T(fm,{children:f.options.map((m)=>{let R=f.selectedOptions.some((y)=>Z(y.value)===Z(m.value));return D(gm,{value:g(m.labelI18n)??m.labelI18n,onSelect:()=>f.onSelectOption?.(m),disabled:f.disabled||m.disabled||f.readOnly,children:[D("div",{className:"flex flex-col",children:[T("span",{children:g(m.labelI18n)}),m.descriptionI18n?T("span",{className:"text-muted-foreground text-xs",children:g(m.descriptionI18n)}):null]}),R?T("span",{className:"ml-auto text-muted-foreground text-xs",children:o(g,Q.selected,Q.selected)}):null]},Z(m.value))})})]})]}),f.selectedOptions.length?T("div",{className:"flex flex-wrap gap-2",children:f.selectedOptions.map((m)=>T(z,{type:"button",variant:"outline",size:"sm",onClick:()=>f.onRemoveOption?.(m),disabled:!f.multiple||f.readOnly||f.disabled,children:g(m.labelI18n)},`selected-${Z(m.value)}`))}):null]})};function K(f,g,m){return{line1:f?.line1??"",line2:f?.line2,city:f?.city,region:f?.region,postalCode:f?.postalCode,countryCode:f?.countryCode,[g]:m}}var Vm=(f)=>{let g=h();return D("div",{className:"grid gap-3 md:grid-cols-2",children:[T(J,{value:f.value?.line1??"",onChange:(m)=>f.onChange?.(K(f.value,"line1",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.line1??Q.addressLine1),readOnly:f.readOnly,disabled:f.disabled}),T(J,{value:f.value?.line2??"",onChange:(m)=>f.onChange?.(K(f.value,"line2",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.line2??Q.addressLine2),readOnly:f.readOnly,disabled:f.disabled}),T(J,{value:f.value?.city??"",onChange:(m)=>f.onChange?.(K(f.value,"city",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.city??Q.city),readOnly:f.readOnly,disabled:f.disabled}),T(J,{value:f.value?.region??"",onChange:(m)=>f.onChange?.(K(f.value,"region",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.region??Q.region),readOnly:f.readOnly,disabled:f.disabled}),T(J,{value:f.value?.postalCode??"",onChange:(m)=>f.onChange?.(K(f.value,"postalCode",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.postalCode??Q.postalCode),readOnly:f.readOnly,disabled:f.disabled}),f.countryOptions?.length?T(a,{value:f.value?.countryCode??"",onChange:(m)=>f.onChange?.(K(f.value,"countryCode",Z(m))),options:f.countryOptions,disabled:f.disabled||f.readOnly}):T(J,{value:f.value?.countryCode??"",onChange:(m)=>f.onChange?.(K(f.value,"countryCode",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.countryCode??Q.countryCode),readOnly:f.readOnly,disabled:f.disabled})]})};function A(f,g,m){return{countryCode:f?.countryCode??"",nationalNumber:f?.nationalNumber??"",extension:f?.extension,e164:f?.e164,[g]:m}}var Mm=(f)=>{let g=h();return D("div",{className:"grid gap-3 md:grid-cols-3",children:[f.countryOptions?.length?T(a,{value:f.value?.countryCode??"",onChange:(m)=>f.onChange?.(A(f.value,"countryCode",Z(m))),options:f.countryOptions,disabled:f.disabled||f.readOnly}):T(J,{value:f.value?.countryCode??"",onChange:(m)=>f.onChange?.(A(f.value,"countryCode",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.countryCode??Q.countryCode),readOnly:f.readOnly,disabled:f.disabled}),T(J,{value:f.value?.nationalNumber??"",onChange:(m)=>f.onChange?.(A(f.value,"nationalNumber",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.nationalNumber??Q.phoneNumber),readOnly:f.readOnly,disabled:f.disabled}),T(J,{value:f.value?.extension??"",onChange:(m)=>f.onChange?.(A(f.value,"extension",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.extension??Q.extension),readOnly:f.readOnly,disabled:f.disabled})]})},Nm=(f)=>{let g=h();return T(ym,{value:f.value??null,onChange:f.onChange??(()=>{return}),disabled:f.disabled,placeholder:g(f.placeholder),minDate:f.minDate,maxDate:f.maxDate})},km=(f)=>{let g=h();return T(Xm,{value:f.value??null,onChange:f.onChange??(()=>{return}),disabled:f.disabled,placeholder:g(f.placeholder),is24Hour:f.is24Hour})},Im=(f)=>{let g=h();return T(Tm,{value:f.value??null,onChange:f.onChange??(()=>{return}),disabled:f.disabled,datePlaceholder:g(f.datePlaceholder),timePlaceholder:g(f.timePlaceholder),minDate:f.minDate,maxDate:f.maxDate,is24Hour:f.is24Hour})},Om=(f)=>{let g=I();return T(Jm,{...f,children:g(f.children)})},_m=(f)=>{let g=I();return T(qm,{...f,children:g(f.children)})},bm=(f)=>{let g=I();return T(Gm,{...f,children:g(f.children)})},Cm=(f)=>{let g=h();return T(J,{...f,placeholder:g(f.placeholder)})},Lm=(f)=>{let g=h();return T(b,{...f,placeholder:g(f.placeholder)})},dm=(f)=>{let g=I();return T(z,{...f,children:g(f.children)})},WR=of({driver:tf({Field:Qm,FieldLabel:Om,FieldDescription:_m,FieldError:bm,FieldGroup:$m,FieldSet:(f)=>T("fieldset",{...f}),FieldLegend:(f)=>{let g=I();return T("legend",{...f,children:g(f.children)})},Input:Cm,Textarea:Lm,Select:a,Checkbox:Em,RadioGroup:Bm,Switch:Um,Autocomplete:wm,AddressField:Vm,PhoneField:Mm,DateField:Nm,TimeField:km,DateTimeField:Im,Button:dm})});var E={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}};function s(f,g=E){if(f==="web")return g;let{space:m,radii:R,icons:y}=g;return{colors:g.colors,spacing:m,typography:{h1:g.typography.h1,body:g.typography.body},radii:R,icons:y}}function c(f,g){if(!g)return f;let m={...f},R=m;for(let[y,G]of Object.entries(g))if(G?.value!=null)R[y]=G.value;return m}function Qf(f,g){if(!g)return f;return{...f,colors:c(f.colors,g.colors),radii:c(f.radii,g.radii),space:c(f.space,g.space),typography:c(f.typography,g.typography)}}function Fm(f,g){if(!g?.targets?.length)return!0;return g.targets.includes(f.target)}function Yf(f,g,m=E){let R=Qf(m,f.tokens);for(let y of f.overrides??[])if(Fm(y,g))R=Qf(R,y.tokens);return R}function Zf(f,g,m){let R=f.get(g.key,g.version);if(!R)return E;let y=R.meta.extends?Zf(f,R.meta.extends,m):E;return Yf(R,m,y)}function MR(f,g,m,R){if("tokens"in f){let Y=f,H=g,W=Yf(Y,m);return s(H,W)}let y=f,G=g,$=m,q=Zf(y,G,R);return s($,q)}import{cva as Am}from"class-variance-authority";var IR=Am("",{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{mR as withPlatformUI,S2 as useResponsive,z2 as useReducedMotion,a1 as usePackageManager,Y2 as useListUrlState,r as useDesignSystemTranslation,H2 as useColorScheme,t as resolveTranslationString,Jf as resolveTranslationNode,Yf as resolveThemeSpecTokens,Zf as resolveThemeRefTokens,MR as resolvePlatformTheme,Qf as mergeThemeTokens,B2 as mapTokensForPlatform,WR as formRenderer,IR as dsBaseVariants,E as defaultTokens,sg as createTranslationResolver,ly as ZodForm,J2 as VisualizationRenderer,G2 as VisualizationGrid,T2 as VisualizationCard,vR as ViewButton,jR as ToggleRightButton,xR as ToggleLeftButton,uR as ToggleButton,R2 as TimelineView,fy as TimeChip,Ky as Textarea,r1 as TestimonialCarousel,kT as TermsTemplate,Sy as Stepper,r4 as StatusChip,l4 as StatCardGroup,n4 as StatCard,v4 as SkeletonList,x4 as SkeletonCircle,c4 as SkeletonBlock,zy as ScoreBar,MT as SalesTermsTemplate,Hy as RankBadge,wT as PrivacyTemplate,l1 as PricingSection,i1 as PricingCarousel,pR as PlaceChip,j1 as PageHeaderResponsive,o1 as PackageManagerProvider,F4 as OverviewCard,L4 as NavUser,b4 as NavMain,Zy as NavBrand,u1 as ModelComparisonView,S1 as MobileHeader,nT as MarketingStepCard,vT as MarketingSection,A1 as MarketingLayout,xT as MarketingIconCard,d1 as MarketingHeaderMobile,C1 as MarketingHeaderDesktop,_1 as MarketingHeader,cT as MarketingComparisonSection,FT as MarketingCardsSection,LT as MarketingCardTitle,CT as MarketingCardHeader,bT as MarketingCardDescription,_T as MarketingCardContent,OT as MarketingCard,O4 as MarkdownRenderer,Qy as LoaderCircular,k4 as LoaderBlock,I1 as ListTablePage,p1 as ListPageTemplate,N1 as ListPageResponsive,V1 as ListGridPage,U1 as ListCardPage,$y as Link,qT as LegalText,DT as LegalTOC,yT as LegalSection,rg as LegalPageLayout,hT as LegalMeta,gT as LegalList,fT as LegalHeading,sy as LegalCallout,M4 as LangSwitch,oy as KeyValueList,w4 as InstallCommand,qy as Input,B4 as HoverPreviewUser,X4 as HoverPreviewStats,W4 as HoverPreviewSimple,P4 as HoverPreviewMedia,D4 as HoverPreviewDoc,h4 as HoverPreview,E1 as HeroSection,K1 as HeroResponsive,P1 as Header,Cg as GDPRRights,Ug as GDPRDataRequest,iy as FormStepsLayout,uy as FormSection,cy as FormRow,jy as FormOneByOneLayout,Ay as FormGrid,dy as FormDialog,Cy as FormCardLayout,H1 as Footer,Y4 as FiltersToolbar,Z1 as FeaturesSection,Q1 as FeatureCarousel,$1 as FAQSection,yy as ErrorState,J4 as EntityCard,gy as EmptyState,q1 as EmptySearchResult,y1 as EmptyDataList,cR as EditButton,sR as DurationChip,G4 as DimensionScoresCard,z1 as DesktopHeader,ag as DesignSystemTranslationProvider,AR as DeleteButton,ry as DefinitionList,aR as DateChip,Iy as DataViewTable,Ny as DataViewRenderer,Vy as DataViewList,Uy as DataViewDetail,Ey as DataTable,rf as DEFAULT_BREAKPOINTS,tR as Cta,T4 as CopyButton,BT as CookiesTemplate,XT as ContactTemplate,Tg as ContactForm,YT as ContactFields,JT as ConsentList,$T as ConsentItem,m2 as ComparisonView,R4 as CommandTabs,m4 as CommandSearchTrigger,pT as CommandPalette,aT as CodeBlock,eR as ButtonLink,nR as Button,tT as Breadcrumbs,dR as ApprovalQueue,g1 as AppSidebar,f1 as AppLayout,s4 as AppHeader,eT as AiLinkButton,CR as AgentMonitor,_y as ActionForm,o4 as AcademyLayout};
|
|
1
|
+
import*as j from"react";import{Button as Hf}from"@contractspec/lib.ui-kit-web/ui/button";import{Loader2 as p}from"lucide-react";import{jsx as x,jsxs as zf,Fragment as Df}from"react/jsx-runtime";function z({children:f,loading:g,spinnerPlacement:m="start",onPress:R,onPressIn:y,onPressOut:G,onLongPress:$,onTouchStart:q,onTouchEnd:Y,onTouchCancel:H,onMouseDown:W,onMouseUp:B,onClick:U,className:w,disabled:V,...M}){let O=Boolean(V||g),u=R?()=>{R()}:U,hf=!M.asChild?zf(Df,{children:[g&&m==="start"?x(p,{className:"h-4 w-4 animate-spin"}):null,f,g&&m==="end"?x(p,{className:"h-4 w-4 animate-spin"}):null]}):f;return x(Hf,{...M,className:w,disabled:O,"aria-busy":g?!0:void 0,"aria-disabled":O?!0:void 0,onClick:u,onMouseDown:W||y,onMouseUp:B||G,onTouchStart:q,onTouchEnd:Y||G,onTouchCancel:H||G,type:M?.type??"button",children:hf})}import{Label as C}from"@contractspec/lib.ui-kit-web/ui/label";import{Input as Wf}from"@contractspec/lib.ui-kit-web/ui/input";function Pf(f){if(!f)return;switch(f){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 Sf(f,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))f.autoCapitalize="words";if(["username","new-password","current-password","one-time-code","email","url"].includes(g))f.autoCapitalize="none"}function _(f){let g=f?.kind??Pf(f?.autoComplete)??"text",m={};switch(g){case"password":if(m.type="password",m.autoCapitalize="none",m.autoComplete=f?.autoComplete??"current-password",f?.autoCorrect!=null)m.autoCorrect=f.autoCorrect;break;case"new-password":if(m.type="password",m.autoCapitalize="none",m.autoComplete=f?.autoComplete??"new-password",f?.autoCorrect!=null)m.autoCorrect=f.autoCorrect;break;case"username":m.type="text",m.autoCapitalize="none",m.autoComplete=f?.autoComplete??"username";break;case"email":m.type="email",m.inputMode="email",m.autoCapitalize="none",m.autoComplete=f?.autoComplete??"email";break;case"url":m.type="url",m.inputMode="url",m.autoComplete=f?.autoComplete??"url";break;case"search":m.type="search",m.inputMode="search",m.enterKeyHint=f?.enterKeyHint??"search",m.autoComplete=f?.autoComplete??"off";break;case"phone":case"tel":m.type="tel",m.inputMode="tel",m.autoComplete=f?.autoComplete??"tel";break;case"number":case"int":m.type="text",m.inputMode="numeric",m.pattern="[0-9]*";break;case"decimal":m.type="text",m.inputMode="decimal",m.step="any";break;case"numbers-and-punctuation":m.type="text",m.inputMode="text",m.pattern="[0-9.,-]*";break;case"otp":m.type="text",m.inputMode="numeric",m.autoComplete=f?.autoComplete??"one-time-code",m.autoCapitalize="none";break;case"name":m.type="text",m.autoComplete=f?.autoComplete??"name",m.autoCapitalize=f?.autoCapitalize??"words";break;case"given-name":m.type="text",m.autoComplete=f?.autoComplete??"given-name",m.autoCapitalize=f?.autoCapitalize??"words";break;case"family-name":m.type="text",m.autoComplete=f?.autoComplete??"family-name",m.autoCapitalize=f?.autoCapitalize??"words";break;case"address-line1":m.type="text",m.autoComplete=f?.autoComplete??"address-line1";break;case"address-line2":m.type="text",m.autoComplete=f?.autoComplete??"address-line2";break;case"postal-code":m.type="text",m.inputMode="numeric",m.pattern="[0-9]*",m.autoComplete=f?.autoComplete??"postal-code";break;case"cc-number":m.type="text",m.inputMode="numeric",m.pattern="[0-9]*",m.autoComplete=f?.autoComplete??"cc-number";break;case"cc-exp":m.type="text",m.inputMode="numeric",m.pattern="[0-9/]*",m.autoComplete=f?.autoComplete??"cc-exp";break;case"cc-csc":m.type="text",m.inputMode="numeric",m.pattern="[0-9]*",m.autoComplete=f?.autoComplete??"cc-csc";break;case"off":m.type="text",m.autoComplete="off";break;case"date":m.type="date",m.inputMode="date",m.pattern="[0-9./-]*";break;default:m.type="text";break}if(f?.autoCapitalize)m.autoCapitalize=f.autoCapitalize;if(f?.autoComplete)m.autoComplete=f.autoComplete;if(f?.autoCorrect!=null)m.autoCorrect=f.autoCorrect;if(f?.enterKeyHint)m.enterKeyHint=f.enterKeyHint;return Sf(m,f?.autoComplete),m}import{jsx as Kf}from"react/jsx-runtime";function J({value:f,defaultValue:g,onChange:m,onSubmit:R,onFocus:y,onBlur:G,placeholder:$,disabled:q,readOnly:Y,maxLength:H,name:W,className:B,keyboard:U,...w}){let V=_(U);return Kf(Wf,{...w,className:B,value:f,defaultValue:g,onChange:m,onFocus:y,onBlur:G,placeholder:$,disabled:q,readOnly:Y,maxLength:H,name:W,...V})}import{Textarea as Xf}from"@contractspec/lib.ui-kit-web/ui/textarea";import*as ff from"react";import{jsx as Ef}from"react/jsx-runtime";function b({value:f,defaultValue:g,onChange:m,onSubmit:R,onFocus:y,onBlur:G,placeholder:$,disabled:q,readOnly:Y,maxLength:H,name:W,className:B,rows:U,keyboard:w,...V}){let M=_(w),O=ff.useCallback((u)=>m?.(u),[m]);return Ef(Xf,{...V,className:B,value:f,defaultValue:g,onChange:O,onFocus:y,onBlur:G,placeholder:$,disabled:q,readOnly:Y,maxLength:H,name:W,rows:U,...M})}import{jsx as P,jsxs as N}from"react/jsx-runtime";function mf({value:f,onChange:g,disabled:m}){return N("div",{className:"space-y-4",children:[N("div",{className:"space-y-2",children:[P(C,{children:"Nom"}),P(J,{value:f.name,onChange:(R)=>g({...f,name:R.target.value}),disabled:m})]}),N("div",{className:"space-y-2",children:[P(C,{children:"Email"}),P(J,{type:"email",value:f.email,onChange:(R)=>g({...f,email:R.target.value}),disabled:m})]}),N("div",{className:"space-y-2",children:[P(C,{children:"Objet"}),P(J,{value:f.subject,onChange:(R)=>g({...f,subject:R.target.value}),disabled:m})]}),N("div",{className:"space-y-2",children:[P(C,{children:"Message"}),P(b,{value:f.message,onChange:(R)=>g({...f,message:R.target.value}),disabled:m,rows:6})]})]})}import{jsx as gf,jsxs as Bf}from"react/jsx-runtime";function Tg({labels:f={submit:"Envoyer"},initialValue:g={name:"",email:"",subject:"",message:""},disabled:m,onSubmit:R}){let[y,G]=j.useState(g),[$,q]=j.useState(!1);return Bf("form",{onSubmit:async(H)=>{if(H.preventDefault(),!R)return;q(!0);try{await R(y)}finally{q(!1)}},className:"space-y-6",children:[gf(mf,{value:y,onChange:G,disabled:m||$}),gf(z,{disabled:m||$,type:"submit",children:$?"Envoi…":f.submit})]})}import*as Tf from"react";import{cn as Uf}from"@contractspec/lib.ui-kit-web/ui/utils";import{cva as wf}from"class-variance-authority";import{jsx as Mf}from"react/jsx-runtime";var Vf=wf("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 X({as:f,level:g,tone:m,spacing:R,className:y,...G}){return Mf(f??g??"h2",{className:Uf(Vf({level:g,tone:m,spacing:R}),y),...G})}import{cn as Nf}from"@contractspec/lib.ui-kit-web/ui/utils";import{cva as kf}from"class-variance-authority";import{jsx as Of}from"react/jsx-runtime";var If=kf("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 L({spacing:f,border:g,tone:m,className:R,...y}){return Of("div",{className:Nf(If({spacing:f,border:g,tone:m}),R),...y})}import{cn as _f}from"@contractspec/lib.ui-kit-web/ui/utils";import{cva as bf}from"class-variance-authority";import{jsx as Lf}from"react/jsx-runtime";var Cf=bf("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 Rf({as:f="p",tone:g,size:m,spacing:R,className:y,...G}){return Lf(f,{className:_f(Cf({tone:g,size:m,spacing:R}),y),...G})}import{jsx as d,jsxs as yf}from"react/jsx-runtime";function Ug({onExport:f,onDelete:g,labels:m={export:"Demander une copie",delete:"Demander la suppression"}}){let[R,y]=Tf.useState(null),G=async($)=>{let q=$==="export"?f:g;if(!q)return;y($);try{await q()}finally{y(null)}};return yf(L,{border:"top",className:"space-y-3",children:[d(X,{as:"h2",level:"h2",children:"Demandes de données"}),d(Rf,{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."}),yf("div",{className:"flex flex-wrap gap-3",children:[d(z,{onPress:()=>G("export"),disabled:R!==null,children:R==="export"?"Envoi…":m.export}),d(z,{variant:"destructive",onPress:()=>G("delete"),disabled:R!==null,children:R==="delete"?"Envoi…":m.delete})]})]})}import{cn as df}from"@contractspec/lib.ui-kit-web/ui/utils";import{cva as Ff}from"class-variance-authority";import{jsx as cf}from"react/jsx-runtime";var Af=Ff("",{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 qf({type:f,spacing:g,className:m,children:R,...y}){return cf(f==="ordered"?"ol":"ul",{className:df(Af({type:f,spacing:g}),m),...y,children:R})}import{jsx as v,jsxs as uf}from"react/jsx-runtime";function Cg({title:f="Vos droits RGPD",rights:g=["Accès à vos données","Rectification","Effacement (droit à l’oubli)","Opposition et limitation","Portabilité"]}){return uf(L,{border:"top",children:[v(X,{as:"h2",level:"h2",children:f}),v(qf,{type:"unordered",children:g.map((m,R)=>v("li",{children:m},R))})]})}import{cn as lf}from"@contractspec/lib.ui-kit-web/ui/utils";import{cn as xf}from"@contractspec/lib.ui-kit-web/ui/utils";import{jsx as jf,jsxs as i}from"react/jsx-runtime";function Gf({lastUpdated:f,version:g,className:m}){let R=(y)=>{if(!y)return null;try{return(typeof y==="string"?new Date(y):y).toLocaleDateString()}catch{return String(y)}};return i("div",{className:xf("text-base text-muted-foreground",m),children:[g&&i("span",{children:["Version ",g]}),g&&f&&jf("span",{className:"mx-2",children:"•"}),f&&i("span",{children:["Dernière mise à jour: ",R(f)]})]})}import{cn as n}from"@contractspec/lib.ui-kit-web/ui/utils";import{cva as vf}from"class-variance-authority";import{jsx as k}from"react/jsx-runtime";var nf=vf("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 l({items:f,activeHref:g,onNavigate:m,variant:R,size:y,className:G,...$}){return k("nav",{"aria-label":"Table of contents",className:n(nf({variant:R,size:y}),G),...$,children:R==="inline"?f.map((q)=>k("a",{href:q.href,onClick:(Y)=>{m?.(q.href)},className:n("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)):k("ul",{className:"list-none space-y-2 pl-0",children:f.map((q)=>k("li",{children:k("a",{href:q.href,onClick:()=>m?.(q.href),className:n("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 S,jsxs as e}from"react/jsx-runtime";function rg({title:f,meta:g,toc:m,children:R,className:y}){return e("div",{className:lf("mx-auto w-full max-w-6xl px-4 py-8 md:py-12",y),children:[e("div",{className:"mb-6 space-y-2",children:[S(X,{as:"h1",level:"h1",spacing:"sm",children:f}),g&&S(Gf,{lastUpdated:g.lastUpdated,version:g.version})]}),m&&m.length>0&&S("div",{className:"mb-6 md:hidden",children:S(l,{items:m,variant:"inline"})}),e("div",{className:"grid grid-cols-1 gap-8 md:grid-cols-[220px_minmax(0,1fr)]",children:[m&&m.length>0?S("aside",{className:"sticky top-24 hidden self-start md:block",children:S(l,{items:m,variant:"sidebar"})}):S("div",{className:"hidden md:block"}),S("article",{className:"prose max-w-none text-foreground",children:R})]})]})}import*as F from"react";import{jsx as ef}from"react/jsx-runtime";var $f=F.createContext(void 0);function ag({children:f,resolver:g}){return ef($f.Provider,{value:g,children:f})}function r(){return F.useContext($f)}function t(f,g){if(!f)return f;return g?.(f)??f}function Jf(f,g){return typeof f==="string"?t(f,g):f}function sg({registry:f,locale:g,fallbackLocale:m,specKeys:R=[]}){return(y)=>{let G=y.match(/^([^:]+)::(.+)$/);if(G?.[1]&&G[2]){let[,$,q]=G;return f.getWithFallback($,q,g,m)?.message.value}for(let $ of R){let q=f.getWithFallback($,y,g,m);if(q)return q.message.value}return}}var rf={sm:640,md:768,lg:1024,xl:1280};function mR(f){let g=f.platform??"web",m={...rf,...f.breakpoints};return{platform:g,tokens:f.tokens,breakpoints:m}}import{shadcnDriver as tf}from"@contractspec/lib.contracts-runtime-client-react/drivers/shadcn";import{createFormRenderer as of}from"@contractspec/lib.contracts-runtime-client-react/form-render";import{Checkbox as af}from"@contractspec/lib.ui-kit-web/ui/checkbox";import{Command as sf,CommandEmpty as pf,CommandGroup as fm,CommandInput as mm,CommandItem as gm,CommandList as Rm}from"@contractspec/lib.ui-kit-web/ui/command";import{DatePicker as ym}from"@contractspec/lib.ui-kit-web/ui/date-picker";import{DateTimePicker as Tm}from"@contractspec/lib.ui-kit-web/ui/datetime-picker";import{FieldDescription as qm,FieldError as Gm,FieldGroup as $m,FieldLabel as Jm,Field as Qm}from"@contractspec/lib.ui-kit-web/ui/field";import{Label as Ym}from"@contractspec/lib.ui-kit-web/ui/label";import{RadioGroupItem as Zm,RadioGroup as hm}from"@contractspec/lib.ui-kit-web/ui/radio-group";import{SelectContent as Hm,SelectGroup as Dm,SelectItem as zm,SelectTrigger as Pm,Select as Sm,SelectValue as Wm}from"@contractspec/lib.ui-kit-web/ui/select";import{Switch as Km}from"@contractspec/lib.ui-kit-web/ui/switch";import{TimePicker as Xm}from"@contractspec/lib.ui-kit-web/ui/time-picker";import{jsx as T,jsxs as D}from"react/jsx-runtime";function Z(f){return typeof f==="string"?f:String(f??"")}var Q={addressLine1:"Address line 1",addressLine2:"Address line 2",city:"City",countryCode:"Country code",extension:"Extension",noResultsFound:"No results found.",phoneNumber:"Phone number",postalCode:"Postal code",region:"Region",search:"Search",selected:"Selected"};function h(){let f=r();return(g)=>t(g,f)}function o(f,g,m){return f(g)??m}function I(){let f=r();return(g)=>Jf(g,f)}var a=(f)=>{let g=h(),{options:m,value:R,onChange:y,placeholder:G,...$}=f;return D(Sm,{value:R==null?"":Z(R),onValueChange:(q)=>y?.(q),...$,children:[T(Pm,{className:"w-full",children:T(Wm,{placeholder:g(G)})}),T(Hm,{children:T(Dm,{children:m?.map((q,Y)=>T(zm,{value:Z(q.value),disabled:q.disabled,children:g(q.labelI18n)},`${Z(q.value)}-${Y}`))})})]})},Em=(f)=>T(af,{checked:Boolean(f.checked),onCheckedChange:(g)=>f.onCheckedChange?.(Boolean(g))}),Bm=(f)=>{let g=h();return T(hm,{value:f.value==null?"":Z(f.value),onValueChange:(m)=>f.onValueChange?.(m),disabled:f.disabled,children:f.options?.map((m)=>{let R=Z(m.value);return D("div",{className:"flex items-center gap-3",children:[T(Zm,{value:R,id:R}),T(Ym,{htmlFor:R,children:g(m.labelI18n)})]},R)})})},Um=(f)=>T(Km,{checked:Boolean(f.checked),onCheckedChange:(g)=>f.onCheckedChange?.(Boolean(g))}),wm=(f)=>{let g=h();return D("div",{className:"space-y-2",children:[D(sf,{shouldFilter:!1,className:"rounded-md border border-input",children:[T(mm,{value:f.query,onValueChange:f.onQueryChange,placeholder:o(g,f.placeholder,Q.search),disabled:f.disabled||f.readOnly}),D(Rm,{children:[T(pf,{children:o(g,Q.noResultsFound,Q.noResultsFound)}),T(fm,{children:f.options.map((m)=>{let R=f.selectedOptions.some((y)=>Z(y.value)===Z(m.value));return D(gm,{value:g(m.labelI18n)??m.labelI18n,onSelect:()=>f.onSelectOption?.(m),disabled:f.disabled||m.disabled||f.readOnly,children:[D("div",{className:"flex flex-col",children:[T("span",{children:g(m.labelI18n)}),m.descriptionI18n?T("span",{className:"text-muted-foreground text-xs",children:g(m.descriptionI18n)}):null]}),R?T("span",{className:"ml-auto text-muted-foreground text-xs",children:o(g,Q.selected,Q.selected)}):null]},Z(m.value))})})]})]}),f.selectedOptions.length?T("div",{className:"flex flex-wrap gap-2",children:f.selectedOptions.map((m)=>T(z,{type:"button",variant:"outline",size:"sm",onClick:()=>f.onRemoveOption?.(m),disabled:!f.multiple||f.readOnly||f.disabled,children:g(m.labelI18n)},`selected-${Z(m.value)}`))}):null]})};function K(f,g,m){return{line1:f?.line1??"",line2:f?.line2,city:f?.city,region:f?.region,postalCode:f?.postalCode,countryCode:f?.countryCode,[g]:m}}var Vm=(f)=>{let g=h();return D("div",{className:"grid gap-3 md:grid-cols-2",children:[T(J,{value:f.value?.line1??"",onChange:(m)=>f.onChange?.(K(f.value,"line1",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.line1??Q.addressLine1),readOnly:f.readOnly,disabled:f.disabled}),T(J,{value:f.value?.line2??"",onChange:(m)=>f.onChange?.(K(f.value,"line2",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.line2??Q.addressLine2),readOnly:f.readOnly,disabled:f.disabled}),T(J,{value:f.value?.city??"",onChange:(m)=>f.onChange?.(K(f.value,"city",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.city??Q.city),readOnly:f.readOnly,disabled:f.disabled}),T(J,{value:f.value?.region??"",onChange:(m)=>f.onChange?.(K(f.value,"region",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.region??Q.region),readOnly:f.readOnly,disabled:f.disabled}),T(J,{value:f.value?.postalCode??"",onChange:(m)=>f.onChange?.(K(f.value,"postalCode",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.postalCode??Q.postalCode),readOnly:f.readOnly,disabled:f.disabled}),f.countryOptions?.length?T(a,{value:f.value?.countryCode??"",onChange:(m)=>f.onChange?.(K(f.value,"countryCode",Z(m))),options:f.countryOptions,disabled:f.disabled||f.readOnly}):T(J,{value:f.value?.countryCode??"",onChange:(m)=>f.onChange?.(K(f.value,"countryCode",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.countryCode??Q.countryCode),readOnly:f.readOnly,disabled:f.disabled})]})};function A(f,g,m){return{countryCode:f?.countryCode??"",nationalNumber:f?.nationalNumber??"",extension:f?.extension,e164:f?.e164,[g]:m}}var Mm=(f)=>{let g=h();return D("div",{className:"grid gap-3 md:grid-cols-3",children:[f.countryOptions?.length?T(a,{value:f.value?.countryCode??"",onChange:(m)=>f.onChange?.(A(f.value,"countryCode",Z(m))),options:f.countryOptions,disabled:f.disabled||f.readOnly}):T(J,{value:f.value?.countryCode??"",onChange:(m)=>f.onChange?.(A(f.value,"countryCode",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.countryCode??Q.countryCode),readOnly:f.readOnly,disabled:f.disabled}),T(J,{value:f.value?.nationalNumber??"",onChange:(m)=>f.onChange?.(A(f.value,"nationalNumber",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.nationalNumber??Q.phoneNumber),readOnly:f.readOnly,disabled:f.disabled}),T(J,{value:f.value?.extension??"",onChange:(m)=>f.onChange?.(A(f.value,"extension",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.extension??Q.extension),readOnly:f.readOnly,disabled:f.disabled})]})},Nm=(f)=>{let g=h();return T(ym,{value:f.value??null,onChange:f.onChange??(()=>{return}),disabled:f.disabled,placeholder:g(f.placeholder),minDate:f.minDate,maxDate:f.maxDate})},km=(f)=>{let g=h();return T(Xm,{value:f.value??null,onChange:f.onChange??(()=>{return}),disabled:f.disabled,placeholder:g(f.placeholder),is24Hour:f.is24Hour})},Im=(f)=>{let g=h();return T(Tm,{value:f.value??null,onChange:f.onChange??(()=>{return}),disabled:f.disabled,datePlaceholder:g(f.datePlaceholder),timePlaceholder:g(f.timePlaceholder),minDate:f.minDate,maxDate:f.maxDate,is24Hour:f.is24Hour})},Om=(f)=>{let g=I();return T(Jm,{...f,children:g(f.children)})},_m=(f)=>{let g=I();return T(qm,{...f,children:g(f.children)})},bm=(f)=>{let g=I();return T(Gm,{...f,children:g(f.children)})},Cm=(f)=>{let g=h();return T(J,{...f,placeholder:g(f.placeholder)})},Lm=(f)=>{let g=h();return T(b,{...f,placeholder:g(f.placeholder)})},dm=(f)=>{let g=I();return T(z,{...f,children:g(f.children)})},WR=of({driver:tf({Field:Qm,FieldLabel:Om,FieldDescription:_m,FieldError:bm,FieldGroup:$m,FieldSet:(f)=>T("fieldset",{...f}),FieldLegend:(f)=>{let g=I();return T("legend",{...f,children:g(f.children)})},Input:Cm,Textarea:Lm,Select:a,Checkbox:Em,RadioGroup:Bm,Switch:Um,Autocomplete:wm,AddressField:Vm,PhoneField:Mm,DateField:Nm,TimeField:km,DateTimeField:Im,Button:dm})});var E={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}};function s(f,g=E){if(f==="web")return g;let{space:m,radii:R,icons:y}=g;return{colors:g.colors,spacing:m,typography:{h1:g.typography.h1,body:g.typography.body},radii:R,icons:y}}function c(f,g){if(!g)return f;let m={...f},R=m;for(let[y,G]of Object.entries(g))if(G?.value!=null)R[y]=G.value;return m}function Qf(f,g){if(!g)return f;return{...f,colors:c(f.colors,g.colors),radii:c(f.radii,g.radii),space:c(f.space,g.space),typography:c(f.typography,g.typography)}}function Fm(f,g){if(!g?.targets?.length)return!0;return g.targets.includes(f.target)}function Yf(f,g,m=E){let R=Qf(m,f.tokens);for(let y of f.overrides??[])if(Fm(y,g))R=Qf(R,y.tokens);return R}function Zf(f,g,m){let R=f.get(g.key,g.version);if(!R)return E;let y=R.meta.extends?Zf(f,R.meta.extends,m):E;return Yf(R,m,y)}function MR(f,g,m,R){if("tokens"in f){let Y=f,H=g,W=Yf(Y,m);return s(H,W)}let y=f,G=g,$=m,q=Zf(y,G,R);return s($,q)}import{cva as Am}from"class-variance-authority";var IR=Am("",{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{mR as withPlatformUI,K2 as useResponsive,S2 as useReducedMotion,p1 as usePackageManager,h2 as useListUrlState,r as useDesignSystemTranslation,z2 as useColorScheme,t as resolveTranslationString,Jf as resolveTranslationNode,Yf as resolveThemeSpecTokens,Zf as resolveThemeRefTokens,MR as resolvePlatformTheme,Qf as mergeThemeTokens,w2 as mapTokensForPlatform,WR as formRenderer,IR as dsBaseVariants,E as defaultTokens,sg as createTranslationResolver,ry as ZodForm,Y2 as VisualizationRenderer,J2 as VisualizationGrid,G2 as VisualizationCard,vR as ViewButton,jR as ToggleRightButton,xR as ToggleLeftButton,uR as ToggleButton,T2 as TimelineView,fy as TimeChip,Ky as Textarea,o1 as TestimonialCarousel,OT as TermsTemplate,Sy as Stepper,o4 as StatusChip,r4 as StatCardGroup,e4 as StatCard,n4 as SkeletonList,v4 as SkeletonCircle,x4 as SkeletonBlock,zy as ScoreBar,kT as SalesTermsTemplate,Hy as RankBadge,MT as PrivacyTemplate,r1 as PricingSection,l1 as PricingCarousel,pR as PlaceChip,i1 as PageHeaderResponsive,s1 as PackageManagerProvider,c4 as OverviewCard,F4 as NavUser,L4 as NavMain,Zy as NavBrand,j1 as ModelComparisonView,K1 as MobileHeader,eT as MarketingStepCard,nT as MarketingSection,u1 as MarketingLayout,vT as MarketingIconCard,A1 as MarketingHeaderMobile,d1 as MarketingHeaderDesktop,C1 as MarketingHeader,xT as MarketingComparisonSection,cT as MarketingCardsSection,FT as MarketingCardTitle,dT as MarketingCardHeader,LT as MarketingCardDescription,CT as MarketingCardContent,bT as MarketingCard,b4 as MarkdownRenderer,Qy as LoaderCircular,O4 as LoaderBlock,_1 as ListTablePage,m2 as ListPageTemplate,I1 as ListPageResponsive,N1 as ListGridPage,V1 as ListCardPage,$y as Link,$T as LegalText,PT as LegalTOC,qT as LegalSection,rg as LegalPageLayout,DT as LegalMeta,yT as LegalList,gT as LegalHeading,fT as LegalCallout,k4 as LangSwitch,sy as KeyValueList,M4 as InstallCommand,qy as Input,w4 as HoverPreviewUser,B4 as HoverPreviewStats,X4 as HoverPreviewSimple,W4 as HoverPreviewMedia,P4 as HoverPreviewDoc,D4 as HoverPreview,U1 as HeroSection,E1 as HeroResponsive,W1 as Header,Cg as GDPRRights,Ug as GDPRDataRequest,ly as FormStepsLayout,jy as FormSection,xy as FormRow,iy as FormOneByOneLayout,uy as FormGrid,Ay as FormDialog,dy as FormCardLayout,z1 as Footer,h4 as FiltersToolbar,H1 as FeaturesSection,Z1 as FeatureCarousel,Q1 as FAQSection,yy as ErrorState,Y4 as EntityCard,gy as EmptyState,$1 as EmptySearchResult,q1 as EmptyDataList,cR as EditButton,sR as DurationChip,J4 as DimensionScoresCard,S1 as DesktopHeader,ag as DesignSystemTranslationProvider,AR as DeleteButton,oy as DefinitionList,aR as DateChip,_y as DataViewTable,Iy as DataViewRenderer,Ny as DataViewList,Vy as DataViewDetail,Uy as DataTableToolbar,Ey as DataTable,rf as DEFAULT_BREAKPOINTS,tR as Cta,G4 as CopyButton,wT as CookiesTemplate,BT as ContactTemplate,Tg as ContactForm,hT as ContactFields,YT as ConsentList,QT as ConsentItem,R2 as ComparisonView,T4 as CommandTabs,R4 as CommandSearchTrigger,m4 as CommandPalette,pT as CodeBlock,eR as ButtonLink,nR as Button,aT as Breadcrumbs,dR as ApprovalQueue,y1 as AppSidebar,g1 as AppLayout,f1 as AppHeader,tT as AiLinkButton,CR as AgentMonitor,Cy as ActionForm,s4 as AcademyLayout};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type DataTableToolbarProps } from './DataTableToolbar.shared';
|
|
2
|
+
export declare function DataTableToolbar<TItem>({ controller, className, searchPlaceholder, searchValue, onSearchChange, onSearchSubmit, debounceMs, activeChips, onClearAll, actionsStart, actionsEnd, selectionSummary, }: DataTableToolbarProps<TItem>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export type { DataTableToolbarProps } from './DataTableToolbar.shared';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type DataTableToolbarProps } from './DataTableToolbar.shared';
|
|
2
|
+
export declare function DataTableToolbar<TItem>({ controller, className, searchPlaceholder, searchValue, onSearchChange, onSearchSubmit, debounceMs, activeChips, onClearAll, actionsStart, actionsEnd, selectionSummary, }: DataTableToolbarProps<TItem>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export type { DataTableToolbarProps } from './DataTableToolbar.shared';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ContractTableController } from '@contractspec/lib.presentation-runtime-react';
|
|
2
|
+
import type * as React from 'react';
|
|
3
|
+
export interface DataTableToolbarChip {
|
|
4
|
+
key: string;
|
|
5
|
+
label: React.ReactNode;
|
|
6
|
+
onRemove?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export interface DataTableToolbarProps<TItem = unknown> {
|
|
9
|
+
controller: ContractTableController<TItem, React.ReactNode>;
|
|
10
|
+
className?: string;
|
|
11
|
+
searchPlaceholder?: string;
|
|
12
|
+
searchValue?: string;
|
|
13
|
+
onSearchChange?: (value: string) => void;
|
|
14
|
+
onSearchSubmit?: () => void;
|
|
15
|
+
debounceMs?: number;
|
|
16
|
+
activeChips?: DataTableToolbarChip[];
|
|
17
|
+
onClearAll?: () => void;
|
|
18
|
+
actionsStart?: React.ReactNode;
|
|
19
|
+
actionsEnd?: React.ReactNode;
|
|
20
|
+
selectionSummary?: React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
export declare function getHiddenDataColumns<TItem>(controller: ContractTableController<TItem, React.ReactNode>): import("@contractspec/lib.presentation-runtime-core").ContractTableColumnRenderModel<React.ReactNode>[];
|
|
23
|
+
export declare function showHiddenDataColumns<TItem>(controller: ContractTableController<TItem, React.ReactNode>): void;
|
|
@@ -8,6 +8,8 @@ export interface DataViewRendererProps {
|
|
|
8
8
|
renderActions?: (item: Record<string, unknown>) => React.ReactNode;
|
|
9
9
|
onSelect?: (item: Record<string, unknown>) => void;
|
|
10
10
|
onRowClick?: (item: Record<string, unknown>) => void;
|
|
11
|
+
toolbar?: React.ReactNode;
|
|
12
|
+
loading?: boolean;
|
|
11
13
|
headerActions?: React.ReactNode;
|
|
12
14
|
emptyState?: React.ReactNode;
|
|
13
15
|
footer?: React.ReactNode;
|
|
@@ -22,4 +24,4 @@ export interface DataViewRendererProps {
|
|
|
22
24
|
};
|
|
23
25
|
onPageChange?: (page: number) => void;
|
|
24
26
|
}
|
|
25
|
-
export declare function DataViewRenderer({ spec, items, item, className, renderActions, onSelect, onRowClick, headerActions, emptyState, footer, search, onSearchChange, filters, onFilterChange, pagination, onPageChange, }: DataViewRendererProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare function DataViewRenderer({ spec, items, item, className, renderActions, onSelect, onRowClick, toolbar, loading, headerActions, emptyState, footer, search, onSearchChange, filters, onFilterChange, pagination, onPageChange, }: DataViewRendererProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,6 +8,8 @@ export interface DataViewRendererProps {
|
|
|
8
8
|
renderActions?: (item: Record<string, unknown>) => React.ReactNode;
|
|
9
9
|
onSelect?: (item: Record<string, unknown>) => void;
|
|
10
10
|
onRowClick?: (item: Record<string, unknown>) => void;
|
|
11
|
+
toolbar?: React.ReactNode;
|
|
12
|
+
loading?: boolean;
|
|
11
13
|
headerActions?: React.ReactNode;
|
|
12
14
|
emptyState?: React.ReactNode;
|
|
13
15
|
footer?: React.ReactNode;
|
|
@@ -22,4 +24,4 @@ export interface DataViewRendererProps {
|
|
|
22
24
|
};
|
|
23
25
|
onPageChange?: (page: number) => void;
|
|
24
26
|
}
|
|
25
|
-
export declare function DataViewRenderer({ spec, items, item, className, renderActions, onSelect, onRowClick, headerActions, emptyState, footer, search, onSearchChange, filters, onFilterChange, pagination, onPageChange, }: DataViewRendererProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare function DataViewRenderer({ spec, items, item, className, renderActions, onSelect, onRowClick, toolbar, loading, headerActions, emptyState, footer, search, onSearchChange, filters, onFilterChange, pagination, onPageChange, }: DataViewRendererProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,11 +5,13 @@ export interface DataViewTableProps {
|
|
|
5
5
|
items: Record<string, unknown>[];
|
|
6
6
|
className?: string;
|
|
7
7
|
onRowClick?: (item: Record<string, unknown>) => void;
|
|
8
|
+
toolbar?: React.ReactNode;
|
|
9
|
+
loading?: boolean;
|
|
8
10
|
emptyState?: React.ReactNode;
|
|
9
11
|
headerActions?: React.ReactNode;
|
|
10
12
|
footer?: React.ReactNode;
|
|
11
13
|
}
|
|
12
|
-
export declare function DataViewTable({ spec, items, className, onRowClick, emptyState, headerActions, footer, }: DataViewTableProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function DataViewTable({ spec, items, className, onRowClick, toolbar, loading, emptyState, headerActions, footer, }: DataViewTableProps): import("react/jsx-runtime").JSX.Element;
|
|
13
15
|
export declare function DisplayValue({ item, fields, fieldKey, }: {
|
|
14
16
|
item: Record<string, unknown>;
|
|
15
17
|
fields: DataViewField[];
|
|
@@ -5,11 +5,13 @@ export interface DataViewTableProps {
|
|
|
5
5
|
items: Record<string, unknown>[];
|
|
6
6
|
className?: string;
|
|
7
7
|
onRowClick?: (item: Record<string, unknown>) => void;
|
|
8
|
+
toolbar?: React.ReactNode;
|
|
9
|
+
loading?: boolean;
|
|
8
10
|
emptyState?: React.ReactNode;
|
|
9
11
|
headerActions?: React.ReactNode;
|
|
10
12
|
footer?: React.ReactNode;
|
|
11
13
|
}
|
|
12
|
-
export declare function DataViewTable({ spec, items, className, onRowClick, emptyState, headerActions, footer, }: DataViewTableProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function DataViewTable({ spec, items, className, onRowClick, toolbar, loading, emptyState, headerActions, footer, }: DataViewTableProps): import("react/jsx-runtime").JSX.Element;
|
|
13
15
|
export declare function DisplayValue({ item, fields, fieldKey, }: {
|
|
14
16
|
item: Record<string, unknown>;
|
|
15
17
|
fields: DataViewField[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { FiltersToolbarProps } from './FiltersToolbar';
|
|
2
|
-
export declare function FiltersToolbar({ className, children, right, searchPlaceholder, searchValue, onSearchChange, onSearchSubmit, debounceMs, activeChips
|
|
2
|
+
export declare function FiltersToolbar({ className, children, right, searchPlaceholder, searchValue, onSearchChange, onSearchSubmit, debounceMs, activeChips, onClearAll, }: FiltersToolbarProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export { ScoreBar, type ScoreBarProps } from './components/atoms/ScoreBar';
|
|
|
16
16
|
export { Stepper } from './components/atoms/Stepper';
|
|
17
17
|
export { Textarea } from './components/atoms/Textarea';
|
|
18
18
|
export { DataTable, type DataTableProps, } from './components/data-table/DataTable';
|
|
19
|
+
export { DataTableToolbar, type DataTableToolbarProps, } from './components/data-table/DataTableToolbar';
|
|
19
20
|
export { DataViewDetail } from './components/data-view/DataViewDetail';
|
|
20
21
|
export { DataViewList } from './components/data-view/DataViewList';
|
|
21
22
|
export { DataViewRenderer } from './components/data-view/DataViewRenderer';
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import*as j from"react";import{Button as Hf}from"@contractspec/lib.ui-kit-web/ui/button";import{Loader2 as p}from"lucide-react";import{jsx as x,jsxs as zf,Fragment as Df}from"react/jsx-runtime";function z({children:f,loading:g,spinnerPlacement:m="start",onPress:R,onPressIn:y,onPressOut:G,onLongPress:$,onTouchStart:q,onTouchEnd:Y,onTouchCancel:H,onMouseDown:W,onMouseUp:B,onClick:U,className:w,disabled:V,...M}){let O=Boolean(V||g),u=R?()=>{R()}:U,hf=!M.asChild?zf(Df,{children:[g&&m==="start"?x(p,{className:"h-4 w-4 animate-spin"}):null,f,g&&m==="end"?x(p,{className:"h-4 w-4 animate-spin"}):null]}):f;return x(Hf,{...M,className:w,disabled:O,"aria-busy":g?!0:void 0,"aria-disabled":O?!0:void 0,onClick:u,onMouseDown:W||y,onMouseUp:B||G,onTouchStart:q,onTouchEnd:Y||G,onTouchCancel:H||G,type:M?.type??"button",children:hf})}import{Label as C}from"@contractspec/lib.ui-kit-web/ui/label";import{Input as Wf}from"@contractspec/lib.ui-kit-web/ui/input";function Pf(f){if(!f)return;switch(f){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 Sf(f,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))f.autoCapitalize="words";if(["username","new-password","current-password","one-time-code","email","url"].includes(g))f.autoCapitalize="none"}function _(f){let g=f?.kind??Pf(f?.autoComplete)??"text",m={};switch(g){case"password":if(m.type="password",m.autoCapitalize="none",m.autoComplete=f?.autoComplete??"current-password",f?.autoCorrect!=null)m.autoCorrect=f.autoCorrect;break;case"new-password":if(m.type="password",m.autoCapitalize="none",m.autoComplete=f?.autoComplete??"new-password",f?.autoCorrect!=null)m.autoCorrect=f.autoCorrect;break;case"username":m.type="text",m.autoCapitalize="none",m.autoComplete=f?.autoComplete??"username";break;case"email":m.type="email",m.inputMode="email",m.autoCapitalize="none",m.autoComplete=f?.autoComplete??"email";break;case"url":m.type="url",m.inputMode="url",m.autoComplete=f?.autoComplete??"url";break;case"search":m.type="search",m.inputMode="search",m.enterKeyHint=f?.enterKeyHint??"search",m.autoComplete=f?.autoComplete??"off";break;case"phone":case"tel":m.type="tel",m.inputMode="tel",m.autoComplete=f?.autoComplete??"tel";break;case"number":case"int":m.type="text",m.inputMode="numeric",m.pattern="[0-9]*";break;case"decimal":m.type="text",m.inputMode="decimal",m.step="any";break;case"numbers-and-punctuation":m.type="text",m.inputMode="text",m.pattern="[0-9.,-]*";break;case"otp":m.type="text",m.inputMode="numeric",m.autoComplete=f?.autoComplete??"one-time-code",m.autoCapitalize="none";break;case"name":m.type="text",m.autoComplete=f?.autoComplete??"name",m.autoCapitalize=f?.autoCapitalize??"words";break;case"given-name":m.type="text",m.autoComplete=f?.autoComplete??"given-name",m.autoCapitalize=f?.autoCapitalize??"words";break;case"family-name":m.type="text",m.autoComplete=f?.autoComplete??"family-name",m.autoCapitalize=f?.autoCapitalize??"words";break;case"address-line1":m.type="text",m.autoComplete=f?.autoComplete??"address-line1";break;case"address-line2":m.type="text",m.autoComplete=f?.autoComplete??"address-line2";break;case"postal-code":m.type="text",m.inputMode="numeric",m.pattern="[0-9]*",m.autoComplete=f?.autoComplete??"postal-code";break;case"cc-number":m.type="text",m.inputMode="numeric",m.pattern="[0-9]*",m.autoComplete=f?.autoComplete??"cc-number";break;case"cc-exp":m.type="text",m.inputMode="numeric",m.pattern="[0-9/]*",m.autoComplete=f?.autoComplete??"cc-exp";break;case"cc-csc":m.type="text",m.inputMode="numeric",m.pattern="[0-9]*",m.autoComplete=f?.autoComplete??"cc-csc";break;case"off":m.type="text",m.autoComplete="off";break;case"date":m.type="date",m.inputMode="date",m.pattern="[0-9./-]*";break;default:m.type="text";break}if(f?.autoCapitalize)m.autoCapitalize=f.autoCapitalize;if(f?.autoComplete)m.autoComplete=f.autoComplete;if(f?.autoCorrect!=null)m.autoCorrect=f.autoCorrect;if(f?.enterKeyHint)m.enterKeyHint=f.enterKeyHint;return Sf(m,f?.autoComplete),m}import{jsx as Kf}from"react/jsx-runtime";function J({value:f,defaultValue:g,onChange:m,onSubmit:R,onFocus:y,onBlur:G,placeholder:$,disabled:q,readOnly:Y,maxLength:H,name:W,className:B,keyboard:U,...w}){let V=_(U);return Kf(Wf,{...w,className:B,value:f,defaultValue:g,onChange:m,onFocus:y,onBlur:G,placeholder:$,disabled:q,readOnly:Y,maxLength:H,name:W,...V})}import{Textarea as Xf}from"@contractspec/lib.ui-kit-web/ui/textarea";import*as ff from"react";import{jsx as Ef}from"react/jsx-runtime";function b({value:f,defaultValue:g,onChange:m,onSubmit:R,onFocus:y,onBlur:G,placeholder:$,disabled:q,readOnly:Y,maxLength:H,name:W,className:B,rows:U,keyboard:w,...V}){let M=_(w),O=ff.useCallback((u)=>m?.(u),[m]);return Ef(Xf,{...V,className:B,value:f,defaultValue:g,onChange:O,onFocus:y,onBlur:G,placeholder:$,disabled:q,readOnly:Y,maxLength:H,name:W,rows:U,...M})}import{jsx as P,jsxs as N}from"react/jsx-runtime";function mf({value:f,onChange:g,disabled:m}){return N("div",{className:"space-y-4",children:[N("div",{className:"space-y-2",children:[P(C,{children:"Nom"}),P(J,{value:f.name,onChange:(R)=>g({...f,name:R.target.value}),disabled:m})]}),N("div",{className:"space-y-2",children:[P(C,{children:"Email"}),P(J,{type:"email",value:f.email,onChange:(R)=>g({...f,email:R.target.value}),disabled:m})]}),N("div",{className:"space-y-2",children:[P(C,{children:"Objet"}),P(J,{value:f.subject,onChange:(R)=>g({...f,subject:R.target.value}),disabled:m})]}),N("div",{className:"space-y-2",children:[P(C,{children:"Message"}),P(b,{value:f.message,onChange:(R)=>g({...f,message:R.target.value}),disabled:m,rows:6})]})]})}import{jsx as gf,jsxs as Bf}from"react/jsx-runtime";function Tg({labels:f={submit:"Envoyer"},initialValue:g={name:"",email:"",subject:"",message:""},disabled:m,onSubmit:R}){let[y,G]=j.useState(g),[$,q]=j.useState(!1);return Bf("form",{onSubmit:async(H)=>{if(H.preventDefault(),!R)return;q(!0);try{await R(y)}finally{q(!1)}},className:"space-y-6",children:[gf(mf,{value:y,onChange:G,disabled:m||$}),gf(z,{disabled:m||$,type:"submit",children:$?"Envoi\u2026":f.submit})]})}import*as Tf from"react";import{cn as Uf}from"@contractspec/lib.ui-kit-web/ui/utils";import{cva as wf}from"class-variance-authority";import{jsx as Mf}from"react/jsx-runtime";var Vf=wf("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 X({as:f,level:g,tone:m,spacing:R,className:y,...G}){return Mf(f??g??"h2",{className:Uf(Vf({level:g,tone:m,spacing:R}),y),...G})}import{cn as Nf}from"@contractspec/lib.ui-kit-web/ui/utils";import{cva as kf}from"class-variance-authority";import{jsx as Of}from"react/jsx-runtime";var If=kf("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 L({spacing:f,border:g,tone:m,className:R,...y}){return Of("div",{className:Nf(If({spacing:f,border:g,tone:m}),R),...y})}import{cn as _f}from"@contractspec/lib.ui-kit-web/ui/utils";import{cva as bf}from"class-variance-authority";import{jsx as Lf}from"react/jsx-runtime";var Cf=bf("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 Rf({as:f="p",tone:g,size:m,spacing:R,className:y,...G}){return Lf(f,{className:_f(Cf({tone:g,size:m,spacing:R}),y),...G})}import{jsx as d,jsxs as yf}from"react/jsx-runtime";function Ug({onExport:f,onDelete:g,labels:m={export:"Demander une copie",delete:"Demander la suppression"}}){let[R,y]=Tf.useState(null),G=async($)=>{let q=$==="export"?f:g;if(!q)return;y($);try{await q()}finally{y(null)}};return yf(L,{border:"top",className:"space-y-3",children:[d(X,{as:"h2",level:"h2",children:"Demandes de donn\xE9es"}),d(Rf,{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."}),yf("div",{className:"flex flex-wrap gap-3",children:[d(z,{onPress:()=>G("export"),disabled:R!==null,children:R==="export"?"Envoi\u2026":m.export}),d(z,{variant:"destructive",onPress:()=>G("delete"),disabled:R!==null,children:R==="delete"?"Envoi\u2026":m.delete})]})]})}import{cn as df}from"@contractspec/lib.ui-kit-web/ui/utils";import{cva as Ff}from"class-variance-authority";import{jsx as cf}from"react/jsx-runtime";var Af=Ff("",{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 qf({type:f,spacing:g,className:m,children:R,...y}){return cf(f==="ordered"?"ol":"ul",{className:df(Af({type:f,spacing:g}),m),...y,children:R})}import{jsx as v,jsxs as uf}from"react/jsx-runtime";function Cg({title:f="Vos droits RGPD",rights:g=["Acc\xE8s \xE0 vos donn\xE9es","Rectification","Effacement (droit \xE0 l\u2019oubli)","Opposition et limitation","Portabilit\xE9"]}){return uf(L,{border:"top",children:[v(X,{as:"h2",level:"h2",children:f}),v(qf,{type:"unordered",children:g.map((m,R)=>v("li",{children:m},R))})]})}import{cn as lf}from"@contractspec/lib.ui-kit-web/ui/utils";import{cn as xf}from"@contractspec/lib.ui-kit-web/ui/utils";import{jsx as jf,jsxs as i}from"react/jsx-runtime";function Gf({lastUpdated:f,version:g,className:m}){let R=(y)=>{if(!y)return null;try{return(typeof y==="string"?new Date(y):y).toLocaleDateString()}catch{return String(y)}};return i("div",{className:xf("text-base text-muted-foreground",m),children:[g&&i("span",{children:["Version ",g]}),g&&f&&jf("span",{className:"mx-2",children:"\u2022"}),f&&i("span",{children:["Derni\xE8re mise \xE0 jour: ",R(f)]})]})}import{cn as n}from"@contractspec/lib.ui-kit-web/ui/utils";import{cva as vf}from"class-variance-authority";import{jsx as k}from"react/jsx-runtime";var nf=vf("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 l({items:f,activeHref:g,onNavigate:m,variant:R,size:y,className:G,...$}){return k("nav",{"aria-label":"Table of contents",className:n(nf({variant:R,size:y}),G),...$,children:R==="inline"?f.map((q)=>k("a",{href:q.href,onClick:(Y)=>{m?.(q.href)},className:n("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)):k("ul",{className:"list-none space-y-2 pl-0",children:f.map((q)=>k("li",{children:k("a",{href:q.href,onClick:()=>m?.(q.href),className:n("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 S,jsxs as e}from"react/jsx-runtime";function rg({title:f,meta:g,toc:m,children:R,className:y}){return e("div",{className:lf("mx-auto w-full max-w-6xl px-4 py-8 md:py-12",y),children:[e("div",{className:"mb-6 space-y-2",children:[S(X,{as:"h1",level:"h1",spacing:"sm",children:f}),g&&S(Gf,{lastUpdated:g.lastUpdated,version:g.version})]}),m&&m.length>0&&S("div",{className:"mb-6 md:hidden",children:S(l,{items:m,variant:"inline"})}),e("div",{className:"grid grid-cols-1 gap-8 md:grid-cols-[220px_minmax(0,1fr)]",children:[m&&m.length>0?S("aside",{className:"sticky top-24 hidden self-start md:block",children:S(l,{items:m,variant:"sidebar"})}):S("div",{className:"hidden md:block"}),S("article",{className:"prose max-w-none text-foreground",children:R})]})]})}import*as F from"react";import{jsx as ef}from"react/jsx-runtime";var $f=F.createContext(void 0);function ag({children:f,resolver:g}){return ef($f.Provider,{value:g,children:f})}function r(){return F.useContext($f)}function t(f,g){if(!f)return f;return g?.(f)??f}function Jf(f,g){return typeof f==="string"?t(f,g):f}function sg({registry:f,locale:g,fallbackLocale:m,specKeys:R=[]}){return(y)=>{let G=y.match(/^([^:]+)::(.+)$/);if(G?.[1]&&G[2]){let[,$,q]=G;return f.getWithFallback($,q,g,m)?.message.value}for(let $ of R){let q=f.getWithFallback($,y,g,m);if(q)return q.message.value}return}}var rf={sm:640,md:768,lg:1024,xl:1280};function mR(f){let g=f.platform??"web",m={...rf,...f.breakpoints};return{platform:g,tokens:f.tokens,breakpoints:m}}import{shadcnDriver as tf}from"@contractspec/lib.contracts-runtime-client-react/drivers/shadcn";import{createFormRenderer as of}from"@contractspec/lib.contracts-runtime-client-react/form-render";import{Checkbox as af}from"@contractspec/lib.ui-kit-web/ui/checkbox";import{Command as sf,CommandEmpty as pf,CommandGroup as fm,CommandInput as mm,CommandItem as gm,CommandList as Rm}from"@contractspec/lib.ui-kit-web/ui/command";import{DatePicker as ym}from"@contractspec/lib.ui-kit-web/ui/date-picker";import{DateTimePicker as Tm}from"@contractspec/lib.ui-kit-web/ui/datetime-picker";import{FieldDescription as qm,FieldError as Gm,FieldGroup as $m,FieldLabel as Jm,Field as Qm}from"@contractspec/lib.ui-kit-web/ui/field";import{Label as Ym}from"@contractspec/lib.ui-kit-web/ui/label";import{RadioGroupItem as Zm,RadioGroup as hm}from"@contractspec/lib.ui-kit-web/ui/radio-group";import{SelectContent as Hm,SelectGroup as Dm,SelectItem as zm,SelectTrigger as Pm,Select as Sm,SelectValue as Wm}from"@contractspec/lib.ui-kit-web/ui/select";import{Switch as Km}from"@contractspec/lib.ui-kit-web/ui/switch";import{TimePicker as Xm}from"@contractspec/lib.ui-kit-web/ui/time-picker";import{jsx as T,jsxs as D}from"react/jsx-runtime";function Z(f){return typeof f==="string"?f:String(f??"")}var Q={addressLine1:"Address line 1",addressLine2:"Address line 2",city:"City",countryCode:"Country code",extension:"Extension",noResultsFound:"No results found.",phoneNumber:"Phone number",postalCode:"Postal code",region:"Region",search:"Search",selected:"Selected"};function h(){let f=r();return(g)=>t(g,f)}function o(f,g,m){return f(g)??m}function I(){let f=r();return(g)=>Jf(g,f)}var a=(f)=>{let g=h(),{options:m,value:R,onChange:y,placeholder:G,...$}=f;return D(Sm,{value:R==null?"":Z(R),onValueChange:(q)=>y?.(q),...$,children:[T(Pm,{className:"w-full",children:T(Wm,{placeholder:g(G)})}),T(Hm,{children:T(Dm,{children:m?.map((q,Y)=>T(zm,{value:Z(q.value),disabled:q.disabled,children:g(q.labelI18n)},`${Z(q.value)}-${Y}`))})})]})},Em=(f)=>T(af,{checked:Boolean(f.checked),onCheckedChange:(g)=>f.onCheckedChange?.(Boolean(g))}),Bm=(f)=>{let g=h();return T(hm,{value:f.value==null?"":Z(f.value),onValueChange:(m)=>f.onValueChange?.(m),disabled:f.disabled,children:f.options?.map((m)=>{let R=Z(m.value);return D("div",{className:"flex items-center gap-3",children:[T(Zm,{value:R,id:R}),T(Ym,{htmlFor:R,children:g(m.labelI18n)})]},R)})})},Um=(f)=>T(Km,{checked:Boolean(f.checked),onCheckedChange:(g)=>f.onCheckedChange?.(Boolean(g))}),wm=(f)=>{let g=h();return D("div",{className:"space-y-2",children:[D(sf,{shouldFilter:!1,className:"rounded-md border border-input",children:[T(mm,{value:f.query,onValueChange:f.onQueryChange,placeholder:o(g,f.placeholder,Q.search),disabled:f.disabled||f.readOnly}),D(Rm,{children:[T(pf,{children:o(g,Q.noResultsFound,Q.noResultsFound)}),T(fm,{children:f.options.map((m)=>{let R=f.selectedOptions.some((y)=>Z(y.value)===Z(m.value));return D(gm,{value:g(m.labelI18n)??m.labelI18n,onSelect:()=>f.onSelectOption?.(m),disabled:f.disabled||m.disabled||f.readOnly,children:[D("div",{className:"flex flex-col",children:[T("span",{children:g(m.labelI18n)}),m.descriptionI18n?T("span",{className:"text-muted-foreground text-xs",children:g(m.descriptionI18n)}):null]}),R?T("span",{className:"ml-auto text-muted-foreground text-xs",children:o(g,Q.selected,Q.selected)}):null]},Z(m.value))})})]})]}),f.selectedOptions.length?T("div",{className:"flex flex-wrap gap-2",children:f.selectedOptions.map((m)=>T(z,{type:"button",variant:"outline",size:"sm",onClick:()=>f.onRemoveOption?.(m),disabled:!f.multiple||f.readOnly||f.disabled,children:g(m.labelI18n)},`selected-${Z(m.value)}`))}):null]})};function K(f,g,m){return{line1:f?.line1??"",line2:f?.line2,city:f?.city,region:f?.region,postalCode:f?.postalCode,countryCode:f?.countryCode,[g]:m}}var Vm=(f)=>{let g=h();return D("div",{className:"grid gap-3 md:grid-cols-2",children:[T(J,{value:f.value?.line1??"",onChange:(m)=>f.onChange?.(K(f.value,"line1",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.line1??Q.addressLine1),readOnly:f.readOnly,disabled:f.disabled}),T(J,{value:f.value?.line2??"",onChange:(m)=>f.onChange?.(K(f.value,"line2",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.line2??Q.addressLine2),readOnly:f.readOnly,disabled:f.disabled}),T(J,{value:f.value?.city??"",onChange:(m)=>f.onChange?.(K(f.value,"city",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.city??Q.city),readOnly:f.readOnly,disabled:f.disabled}),T(J,{value:f.value?.region??"",onChange:(m)=>f.onChange?.(K(f.value,"region",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.region??Q.region),readOnly:f.readOnly,disabled:f.disabled}),T(J,{value:f.value?.postalCode??"",onChange:(m)=>f.onChange?.(K(f.value,"postalCode",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.postalCode??Q.postalCode),readOnly:f.readOnly,disabled:f.disabled}),f.countryOptions?.length?T(a,{value:f.value?.countryCode??"",onChange:(m)=>f.onChange?.(K(f.value,"countryCode",Z(m))),options:f.countryOptions,disabled:f.disabled||f.readOnly}):T(J,{value:f.value?.countryCode??"",onChange:(m)=>f.onChange?.(K(f.value,"countryCode",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.countryCode??Q.countryCode),readOnly:f.readOnly,disabled:f.disabled})]})};function A(f,g,m){return{countryCode:f?.countryCode??"",nationalNumber:f?.nationalNumber??"",extension:f?.extension,e164:f?.e164,[g]:m}}var Mm=(f)=>{let g=h();return D("div",{className:"grid gap-3 md:grid-cols-3",children:[f.countryOptions?.length?T(a,{value:f.value?.countryCode??"",onChange:(m)=>f.onChange?.(A(f.value,"countryCode",Z(m))),options:f.countryOptions,disabled:f.disabled||f.readOnly}):T(J,{value:f.value?.countryCode??"",onChange:(m)=>f.onChange?.(A(f.value,"countryCode",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.countryCode??Q.countryCode),readOnly:f.readOnly,disabled:f.disabled}),T(J,{value:f.value?.nationalNumber??"",onChange:(m)=>f.onChange?.(A(f.value,"nationalNumber",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.nationalNumber??Q.phoneNumber),readOnly:f.readOnly,disabled:f.disabled}),T(J,{value:f.value?.extension??"",onChange:(m)=>f.onChange?.(A(f.value,"extension",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.extension??Q.extension),readOnly:f.readOnly,disabled:f.disabled})]})},Nm=(f)=>{let g=h();return T(ym,{value:f.value??null,onChange:f.onChange??(()=>{return}),disabled:f.disabled,placeholder:g(f.placeholder),minDate:f.minDate,maxDate:f.maxDate})},km=(f)=>{let g=h();return T(Xm,{value:f.value??null,onChange:f.onChange??(()=>{return}),disabled:f.disabled,placeholder:g(f.placeholder),is24Hour:f.is24Hour})},Im=(f)=>{let g=h();return T(Tm,{value:f.value??null,onChange:f.onChange??(()=>{return}),disabled:f.disabled,datePlaceholder:g(f.datePlaceholder),timePlaceholder:g(f.timePlaceholder),minDate:f.minDate,maxDate:f.maxDate,is24Hour:f.is24Hour})},Om=(f)=>{let g=I();return T(Jm,{...f,children:g(f.children)})},_m=(f)=>{let g=I();return T(qm,{...f,children:g(f.children)})},bm=(f)=>{let g=I();return T(Gm,{...f,children:g(f.children)})},Cm=(f)=>{let g=h();return T(J,{...f,placeholder:g(f.placeholder)})},Lm=(f)=>{let g=h();return T(b,{...f,placeholder:g(f.placeholder)})},dm=(f)=>{let g=I();return T(z,{...f,children:g(f.children)})},WR=of({driver:tf({Field:Qm,FieldLabel:Om,FieldDescription:_m,FieldError:bm,FieldGroup:$m,FieldSet:(f)=>T("fieldset",{...f}),FieldLegend:(f)=>{let g=I();return T("legend",{...f,children:g(f.children)})},Input:Cm,Textarea:Lm,Select:a,Checkbox:Em,RadioGroup:Bm,Switch:Um,Autocomplete:wm,AddressField:Vm,PhoneField:Mm,DateField:Nm,TimeField:km,DateTimeField:Im,Button:dm})});var E={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}};function s(f,g=E){if(f==="web")return g;let{space:m,radii:R,icons:y}=g;return{colors:g.colors,spacing:m,typography:{h1:g.typography.h1,body:g.typography.body},radii:R,icons:y}}function c(f,g){if(!g)return f;let m={...f},R=m;for(let[y,G]of Object.entries(g))if(G?.value!=null)R[y]=G.value;return m}function Qf(f,g){if(!g)return f;return{...f,colors:c(f.colors,g.colors),radii:c(f.radii,g.radii),space:c(f.space,g.space),typography:c(f.typography,g.typography)}}function Fm(f,g){if(!g?.targets?.length)return!0;return g.targets.includes(f.target)}function Yf(f,g,m=E){let R=Qf(m,f.tokens);for(let y of f.overrides??[])if(Fm(y,g))R=Qf(R,y.tokens);return R}function Zf(f,g,m){let R=f.get(g.key,g.version);if(!R)return E;let y=R.meta.extends?Zf(f,R.meta.extends,m):E;return Yf(R,m,y)}function MR(f,g,m,R){if("tokens"in f){let Y=f,H=g,W=Yf(Y,m);return s(H,W)}let y=f,G=g,$=m,q=Zf(y,G,R);return s($,q)}import{cva as Am}from"class-variance-authority";var IR=Am("",{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{mR as withPlatformUI,S2 as useResponsive,z2 as useReducedMotion,a1 as usePackageManager,Y2 as useListUrlState,r as useDesignSystemTranslation,H2 as useColorScheme,t as resolveTranslationString,Jf as resolveTranslationNode,Yf as resolveThemeSpecTokens,Zf as resolveThemeRefTokens,MR as resolvePlatformTheme,Qf as mergeThemeTokens,B2 as mapTokensForPlatform,WR as formRenderer,IR as dsBaseVariants,E as defaultTokens,sg as createTranslationResolver,ly as ZodForm,J2 as VisualizationRenderer,G2 as VisualizationGrid,T2 as VisualizationCard,vR as ViewButton,jR as ToggleRightButton,xR as ToggleLeftButton,uR as ToggleButton,R2 as TimelineView,fy as TimeChip,Ky as Textarea,r1 as TestimonialCarousel,kT as TermsTemplate,Sy as Stepper,r4 as StatusChip,l4 as StatCardGroup,n4 as StatCard,v4 as SkeletonList,x4 as SkeletonCircle,c4 as SkeletonBlock,zy as ScoreBar,MT as SalesTermsTemplate,Hy as RankBadge,wT as PrivacyTemplate,l1 as PricingSection,i1 as PricingCarousel,pR as PlaceChip,j1 as PageHeaderResponsive,o1 as PackageManagerProvider,F4 as OverviewCard,L4 as NavUser,b4 as NavMain,Zy as NavBrand,u1 as ModelComparisonView,S1 as MobileHeader,nT as MarketingStepCard,vT as MarketingSection,A1 as MarketingLayout,xT as MarketingIconCard,d1 as MarketingHeaderMobile,C1 as MarketingHeaderDesktop,_1 as MarketingHeader,cT as MarketingComparisonSection,FT as MarketingCardsSection,LT as MarketingCardTitle,CT as MarketingCardHeader,bT as MarketingCardDescription,_T as MarketingCardContent,OT as MarketingCard,O4 as MarkdownRenderer,Qy as LoaderCircular,k4 as LoaderBlock,I1 as ListTablePage,p1 as ListPageTemplate,N1 as ListPageResponsive,V1 as ListGridPage,U1 as ListCardPage,$y as Link,qT as LegalText,DT as LegalTOC,yT as LegalSection,rg as LegalPageLayout,hT as LegalMeta,gT as LegalList,fT as LegalHeading,sy as LegalCallout,M4 as LangSwitch,oy as KeyValueList,w4 as InstallCommand,qy as Input,B4 as HoverPreviewUser,X4 as HoverPreviewStats,W4 as HoverPreviewSimple,P4 as HoverPreviewMedia,D4 as HoverPreviewDoc,h4 as HoverPreview,E1 as HeroSection,K1 as HeroResponsive,P1 as Header,Cg as GDPRRights,Ug as GDPRDataRequest,iy as FormStepsLayout,uy as FormSection,cy as FormRow,jy as FormOneByOneLayout,Ay as FormGrid,dy as FormDialog,Cy as FormCardLayout,H1 as Footer,Y4 as FiltersToolbar,Z1 as FeaturesSection,Q1 as FeatureCarousel,$1 as FAQSection,yy as ErrorState,J4 as EntityCard,gy as EmptyState,q1 as EmptySearchResult,y1 as EmptyDataList,cR as EditButton,sR as DurationChip,G4 as DimensionScoresCard,z1 as DesktopHeader,ag as DesignSystemTranslationProvider,AR as DeleteButton,ry as DefinitionList,aR as DateChip,Iy as DataViewTable,Ny as DataViewRenderer,Vy as DataViewList,Uy as DataViewDetail,Ey as DataTable,rf as DEFAULT_BREAKPOINTS,tR as Cta,T4 as CopyButton,BT as CookiesTemplate,XT as ContactTemplate,Tg as ContactForm,YT as ContactFields,JT as ConsentList,$T as ConsentItem,m2 as ComparisonView,R4 as CommandTabs,m4 as CommandSearchTrigger,pT as CommandPalette,aT as CodeBlock,eR as ButtonLink,nR as Button,tT as Breadcrumbs,dR as ApprovalQueue,g1 as AppSidebar,f1 as AppLayout,s4 as AppHeader,eT as AiLinkButton,CR as AgentMonitor,_y as ActionForm,o4 as AcademyLayout};
|
|
2
|
+
import*as j from"react";import{Button as Hf}from"@contractspec/lib.ui-kit-web/ui/button";import{Loader2 as p}from"lucide-react";import{jsx as x,jsxs as zf,Fragment as Df}from"react/jsx-runtime";function z({children:f,loading:g,spinnerPlacement:m="start",onPress:R,onPressIn:y,onPressOut:G,onLongPress:$,onTouchStart:q,onTouchEnd:Y,onTouchCancel:H,onMouseDown:W,onMouseUp:B,onClick:U,className:w,disabled:V,...M}){let O=Boolean(V||g),u=R?()=>{R()}:U,hf=!M.asChild?zf(Df,{children:[g&&m==="start"?x(p,{className:"h-4 w-4 animate-spin"}):null,f,g&&m==="end"?x(p,{className:"h-4 w-4 animate-spin"}):null]}):f;return x(Hf,{...M,className:w,disabled:O,"aria-busy":g?!0:void 0,"aria-disabled":O?!0:void 0,onClick:u,onMouseDown:W||y,onMouseUp:B||G,onTouchStart:q,onTouchEnd:Y||G,onTouchCancel:H||G,type:M?.type??"button",children:hf})}import{Label as C}from"@contractspec/lib.ui-kit-web/ui/label";import{Input as Wf}from"@contractspec/lib.ui-kit-web/ui/input";function Pf(f){if(!f)return;switch(f){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 Sf(f,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))f.autoCapitalize="words";if(["username","new-password","current-password","one-time-code","email","url"].includes(g))f.autoCapitalize="none"}function _(f){let g=f?.kind??Pf(f?.autoComplete)??"text",m={};switch(g){case"password":if(m.type="password",m.autoCapitalize="none",m.autoComplete=f?.autoComplete??"current-password",f?.autoCorrect!=null)m.autoCorrect=f.autoCorrect;break;case"new-password":if(m.type="password",m.autoCapitalize="none",m.autoComplete=f?.autoComplete??"new-password",f?.autoCorrect!=null)m.autoCorrect=f.autoCorrect;break;case"username":m.type="text",m.autoCapitalize="none",m.autoComplete=f?.autoComplete??"username";break;case"email":m.type="email",m.inputMode="email",m.autoCapitalize="none",m.autoComplete=f?.autoComplete??"email";break;case"url":m.type="url",m.inputMode="url",m.autoComplete=f?.autoComplete??"url";break;case"search":m.type="search",m.inputMode="search",m.enterKeyHint=f?.enterKeyHint??"search",m.autoComplete=f?.autoComplete??"off";break;case"phone":case"tel":m.type="tel",m.inputMode="tel",m.autoComplete=f?.autoComplete??"tel";break;case"number":case"int":m.type="text",m.inputMode="numeric",m.pattern="[0-9]*";break;case"decimal":m.type="text",m.inputMode="decimal",m.step="any";break;case"numbers-and-punctuation":m.type="text",m.inputMode="text",m.pattern="[0-9.,-]*";break;case"otp":m.type="text",m.inputMode="numeric",m.autoComplete=f?.autoComplete??"one-time-code",m.autoCapitalize="none";break;case"name":m.type="text",m.autoComplete=f?.autoComplete??"name",m.autoCapitalize=f?.autoCapitalize??"words";break;case"given-name":m.type="text",m.autoComplete=f?.autoComplete??"given-name",m.autoCapitalize=f?.autoCapitalize??"words";break;case"family-name":m.type="text",m.autoComplete=f?.autoComplete??"family-name",m.autoCapitalize=f?.autoCapitalize??"words";break;case"address-line1":m.type="text",m.autoComplete=f?.autoComplete??"address-line1";break;case"address-line2":m.type="text",m.autoComplete=f?.autoComplete??"address-line2";break;case"postal-code":m.type="text",m.inputMode="numeric",m.pattern="[0-9]*",m.autoComplete=f?.autoComplete??"postal-code";break;case"cc-number":m.type="text",m.inputMode="numeric",m.pattern="[0-9]*",m.autoComplete=f?.autoComplete??"cc-number";break;case"cc-exp":m.type="text",m.inputMode="numeric",m.pattern="[0-9/]*",m.autoComplete=f?.autoComplete??"cc-exp";break;case"cc-csc":m.type="text",m.inputMode="numeric",m.pattern="[0-9]*",m.autoComplete=f?.autoComplete??"cc-csc";break;case"off":m.type="text",m.autoComplete="off";break;case"date":m.type="date",m.inputMode="date",m.pattern="[0-9./-]*";break;default:m.type="text";break}if(f?.autoCapitalize)m.autoCapitalize=f.autoCapitalize;if(f?.autoComplete)m.autoComplete=f.autoComplete;if(f?.autoCorrect!=null)m.autoCorrect=f.autoCorrect;if(f?.enterKeyHint)m.enterKeyHint=f.enterKeyHint;return Sf(m,f?.autoComplete),m}import{jsx as Kf}from"react/jsx-runtime";function J({value:f,defaultValue:g,onChange:m,onSubmit:R,onFocus:y,onBlur:G,placeholder:$,disabled:q,readOnly:Y,maxLength:H,name:W,className:B,keyboard:U,...w}){let V=_(U);return Kf(Wf,{...w,className:B,value:f,defaultValue:g,onChange:m,onFocus:y,onBlur:G,placeholder:$,disabled:q,readOnly:Y,maxLength:H,name:W,...V})}import{Textarea as Xf}from"@contractspec/lib.ui-kit-web/ui/textarea";import*as ff from"react";import{jsx as Ef}from"react/jsx-runtime";function b({value:f,defaultValue:g,onChange:m,onSubmit:R,onFocus:y,onBlur:G,placeholder:$,disabled:q,readOnly:Y,maxLength:H,name:W,className:B,rows:U,keyboard:w,...V}){let M=_(w),O=ff.useCallback((u)=>m?.(u),[m]);return Ef(Xf,{...V,className:B,value:f,defaultValue:g,onChange:O,onFocus:y,onBlur:G,placeholder:$,disabled:q,readOnly:Y,maxLength:H,name:W,rows:U,...M})}import{jsx as P,jsxs as N}from"react/jsx-runtime";function mf({value:f,onChange:g,disabled:m}){return N("div",{className:"space-y-4",children:[N("div",{className:"space-y-2",children:[P(C,{children:"Nom"}),P(J,{value:f.name,onChange:(R)=>g({...f,name:R.target.value}),disabled:m})]}),N("div",{className:"space-y-2",children:[P(C,{children:"Email"}),P(J,{type:"email",value:f.email,onChange:(R)=>g({...f,email:R.target.value}),disabled:m})]}),N("div",{className:"space-y-2",children:[P(C,{children:"Objet"}),P(J,{value:f.subject,onChange:(R)=>g({...f,subject:R.target.value}),disabled:m})]}),N("div",{className:"space-y-2",children:[P(C,{children:"Message"}),P(b,{value:f.message,onChange:(R)=>g({...f,message:R.target.value}),disabled:m,rows:6})]})]})}import{jsx as gf,jsxs as Bf}from"react/jsx-runtime";function Tg({labels:f={submit:"Envoyer"},initialValue:g={name:"",email:"",subject:"",message:""},disabled:m,onSubmit:R}){let[y,G]=j.useState(g),[$,q]=j.useState(!1);return Bf("form",{onSubmit:async(H)=>{if(H.preventDefault(),!R)return;q(!0);try{await R(y)}finally{q(!1)}},className:"space-y-6",children:[gf(mf,{value:y,onChange:G,disabled:m||$}),gf(z,{disabled:m||$,type:"submit",children:$?"Envoi\u2026":f.submit})]})}import*as Tf from"react";import{cn as Uf}from"@contractspec/lib.ui-kit-web/ui/utils";import{cva as wf}from"class-variance-authority";import{jsx as Mf}from"react/jsx-runtime";var Vf=wf("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 X({as:f,level:g,tone:m,spacing:R,className:y,...G}){return Mf(f??g??"h2",{className:Uf(Vf({level:g,tone:m,spacing:R}),y),...G})}import{cn as Nf}from"@contractspec/lib.ui-kit-web/ui/utils";import{cva as kf}from"class-variance-authority";import{jsx as Of}from"react/jsx-runtime";var If=kf("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 L({spacing:f,border:g,tone:m,className:R,...y}){return Of("div",{className:Nf(If({spacing:f,border:g,tone:m}),R),...y})}import{cn as _f}from"@contractspec/lib.ui-kit-web/ui/utils";import{cva as bf}from"class-variance-authority";import{jsx as Lf}from"react/jsx-runtime";var Cf=bf("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 Rf({as:f="p",tone:g,size:m,spacing:R,className:y,...G}){return Lf(f,{className:_f(Cf({tone:g,size:m,spacing:R}),y),...G})}import{jsx as d,jsxs as yf}from"react/jsx-runtime";function Ug({onExport:f,onDelete:g,labels:m={export:"Demander une copie",delete:"Demander la suppression"}}){let[R,y]=Tf.useState(null),G=async($)=>{let q=$==="export"?f:g;if(!q)return;y($);try{await q()}finally{y(null)}};return yf(L,{border:"top",className:"space-y-3",children:[d(X,{as:"h2",level:"h2",children:"Demandes de donn\xE9es"}),d(Rf,{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."}),yf("div",{className:"flex flex-wrap gap-3",children:[d(z,{onPress:()=>G("export"),disabled:R!==null,children:R==="export"?"Envoi\u2026":m.export}),d(z,{variant:"destructive",onPress:()=>G("delete"),disabled:R!==null,children:R==="delete"?"Envoi\u2026":m.delete})]})]})}import{cn as df}from"@contractspec/lib.ui-kit-web/ui/utils";import{cva as Ff}from"class-variance-authority";import{jsx as cf}from"react/jsx-runtime";var Af=Ff("",{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 qf({type:f,spacing:g,className:m,children:R,...y}){return cf(f==="ordered"?"ol":"ul",{className:df(Af({type:f,spacing:g}),m),...y,children:R})}import{jsx as v,jsxs as uf}from"react/jsx-runtime";function Cg({title:f="Vos droits RGPD",rights:g=["Acc\xE8s \xE0 vos donn\xE9es","Rectification","Effacement (droit \xE0 l\u2019oubli)","Opposition et limitation","Portabilit\xE9"]}){return uf(L,{border:"top",children:[v(X,{as:"h2",level:"h2",children:f}),v(qf,{type:"unordered",children:g.map((m,R)=>v("li",{children:m},R))})]})}import{cn as lf}from"@contractspec/lib.ui-kit-web/ui/utils";import{cn as xf}from"@contractspec/lib.ui-kit-web/ui/utils";import{jsx as jf,jsxs as i}from"react/jsx-runtime";function Gf({lastUpdated:f,version:g,className:m}){let R=(y)=>{if(!y)return null;try{return(typeof y==="string"?new Date(y):y).toLocaleDateString()}catch{return String(y)}};return i("div",{className:xf("text-base text-muted-foreground",m),children:[g&&i("span",{children:["Version ",g]}),g&&f&&jf("span",{className:"mx-2",children:"\u2022"}),f&&i("span",{children:["Derni\xE8re mise \xE0 jour: ",R(f)]})]})}import{cn as n}from"@contractspec/lib.ui-kit-web/ui/utils";import{cva as vf}from"class-variance-authority";import{jsx as k}from"react/jsx-runtime";var nf=vf("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 l({items:f,activeHref:g,onNavigate:m,variant:R,size:y,className:G,...$}){return k("nav",{"aria-label":"Table of contents",className:n(nf({variant:R,size:y}),G),...$,children:R==="inline"?f.map((q)=>k("a",{href:q.href,onClick:(Y)=>{m?.(q.href)},className:n("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)):k("ul",{className:"list-none space-y-2 pl-0",children:f.map((q)=>k("li",{children:k("a",{href:q.href,onClick:()=>m?.(q.href),className:n("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 S,jsxs as e}from"react/jsx-runtime";function rg({title:f,meta:g,toc:m,children:R,className:y}){return e("div",{className:lf("mx-auto w-full max-w-6xl px-4 py-8 md:py-12",y),children:[e("div",{className:"mb-6 space-y-2",children:[S(X,{as:"h1",level:"h1",spacing:"sm",children:f}),g&&S(Gf,{lastUpdated:g.lastUpdated,version:g.version})]}),m&&m.length>0&&S("div",{className:"mb-6 md:hidden",children:S(l,{items:m,variant:"inline"})}),e("div",{className:"grid grid-cols-1 gap-8 md:grid-cols-[220px_minmax(0,1fr)]",children:[m&&m.length>0?S("aside",{className:"sticky top-24 hidden self-start md:block",children:S(l,{items:m,variant:"sidebar"})}):S("div",{className:"hidden md:block"}),S("article",{className:"prose max-w-none text-foreground",children:R})]})]})}import*as F from"react";import{jsx as ef}from"react/jsx-runtime";var $f=F.createContext(void 0);function ag({children:f,resolver:g}){return ef($f.Provider,{value:g,children:f})}function r(){return F.useContext($f)}function t(f,g){if(!f)return f;return g?.(f)??f}function Jf(f,g){return typeof f==="string"?t(f,g):f}function sg({registry:f,locale:g,fallbackLocale:m,specKeys:R=[]}){return(y)=>{let G=y.match(/^([^:]+)::(.+)$/);if(G?.[1]&&G[2]){let[,$,q]=G;return f.getWithFallback($,q,g,m)?.message.value}for(let $ of R){let q=f.getWithFallback($,y,g,m);if(q)return q.message.value}return}}var rf={sm:640,md:768,lg:1024,xl:1280};function mR(f){let g=f.platform??"web",m={...rf,...f.breakpoints};return{platform:g,tokens:f.tokens,breakpoints:m}}import{shadcnDriver as tf}from"@contractspec/lib.contracts-runtime-client-react/drivers/shadcn";import{createFormRenderer as of}from"@contractspec/lib.contracts-runtime-client-react/form-render";import{Checkbox as af}from"@contractspec/lib.ui-kit-web/ui/checkbox";import{Command as sf,CommandEmpty as pf,CommandGroup as fm,CommandInput as mm,CommandItem as gm,CommandList as Rm}from"@contractspec/lib.ui-kit-web/ui/command";import{DatePicker as ym}from"@contractspec/lib.ui-kit-web/ui/date-picker";import{DateTimePicker as Tm}from"@contractspec/lib.ui-kit-web/ui/datetime-picker";import{FieldDescription as qm,FieldError as Gm,FieldGroup as $m,FieldLabel as Jm,Field as Qm}from"@contractspec/lib.ui-kit-web/ui/field";import{Label as Ym}from"@contractspec/lib.ui-kit-web/ui/label";import{RadioGroupItem as Zm,RadioGroup as hm}from"@contractspec/lib.ui-kit-web/ui/radio-group";import{SelectContent as Hm,SelectGroup as Dm,SelectItem as zm,SelectTrigger as Pm,Select as Sm,SelectValue as Wm}from"@contractspec/lib.ui-kit-web/ui/select";import{Switch as Km}from"@contractspec/lib.ui-kit-web/ui/switch";import{TimePicker as Xm}from"@contractspec/lib.ui-kit-web/ui/time-picker";import{jsx as T,jsxs as D}from"react/jsx-runtime";function Z(f){return typeof f==="string"?f:String(f??"")}var Q={addressLine1:"Address line 1",addressLine2:"Address line 2",city:"City",countryCode:"Country code",extension:"Extension",noResultsFound:"No results found.",phoneNumber:"Phone number",postalCode:"Postal code",region:"Region",search:"Search",selected:"Selected"};function h(){let f=r();return(g)=>t(g,f)}function o(f,g,m){return f(g)??m}function I(){let f=r();return(g)=>Jf(g,f)}var a=(f)=>{let g=h(),{options:m,value:R,onChange:y,placeholder:G,...$}=f;return D(Sm,{value:R==null?"":Z(R),onValueChange:(q)=>y?.(q),...$,children:[T(Pm,{className:"w-full",children:T(Wm,{placeholder:g(G)})}),T(Hm,{children:T(Dm,{children:m?.map((q,Y)=>T(zm,{value:Z(q.value),disabled:q.disabled,children:g(q.labelI18n)},`${Z(q.value)}-${Y}`))})})]})},Em=(f)=>T(af,{checked:Boolean(f.checked),onCheckedChange:(g)=>f.onCheckedChange?.(Boolean(g))}),Bm=(f)=>{let g=h();return T(hm,{value:f.value==null?"":Z(f.value),onValueChange:(m)=>f.onValueChange?.(m),disabled:f.disabled,children:f.options?.map((m)=>{let R=Z(m.value);return D("div",{className:"flex items-center gap-3",children:[T(Zm,{value:R,id:R}),T(Ym,{htmlFor:R,children:g(m.labelI18n)})]},R)})})},Um=(f)=>T(Km,{checked:Boolean(f.checked),onCheckedChange:(g)=>f.onCheckedChange?.(Boolean(g))}),wm=(f)=>{let g=h();return D("div",{className:"space-y-2",children:[D(sf,{shouldFilter:!1,className:"rounded-md border border-input",children:[T(mm,{value:f.query,onValueChange:f.onQueryChange,placeholder:o(g,f.placeholder,Q.search),disabled:f.disabled||f.readOnly}),D(Rm,{children:[T(pf,{children:o(g,Q.noResultsFound,Q.noResultsFound)}),T(fm,{children:f.options.map((m)=>{let R=f.selectedOptions.some((y)=>Z(y.value)===Z(m.value));return D(gm,{value:g(m.labelI18n)??m.labelI18n,onSelect:()=>f.onSelectOption?.(m),disabled:f.disabled||m.disabled||f.readOnly,children:[D("div",{className:"flex flex-col",children:[T("span",{children:g(m.labelI18n)}),m.descriptionI18n?T("span",{className:"text-muted-foreground text-xs",children:g(m.descriptionI18n)}):null]}),R?T("span",{className:"ml-auto text-muted-foreground text-xs",children:o(g,Q.selected,Q.selected)}):null]},Z(m.value))})})]})]}),f.selectedOptions.length?T("div",{className:"flex flex-wrap gap-2",children:f.selectedOptions.map((m)=>T(z,{type:"button",variant:"outline",size:"sm",onClick:()=>f.onRemoveOption?.(m),disabled:!f.multiple||f.readOnly||f.disabled,children:g(m.labelI18n)},`selected-${Z(m.value)}`))}):null]})};function K(f,g,m){return{line1:f?.line1??"",line2:f?.line2,city:f?.city,region:f?.region,postalCode:f?.postalCode,countryCode:f?.countryCode,[g]:m}}var Vm=(f)=>{let g=h();return D("div",{className:"grid gap-3 md:grid-cols-2",children:[T(J,{value:f.value?.line1??"",onChange:(m)=>f.onChange?.(K(f.value,"line1",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.line1??Q.addressLine1),readOnly:f.readOnly,disabled:f.disabled}),T(J,{value:f.value?.line2??"",onChange:(m)=>f.onChange?.(K(f.value,"line2",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.line2??Q.addressLine2),readOnly:f.readOnly,disabled:f.disabled}),T(J,{value:f.value?.city??"",onChange:(m)=>f.onChange?.(K(f.value,"city",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.city??Q.city),readOnly:f.readOnly,disabled:f.disabled}),T(J,{value:f.value?.region??"",onChange:(m)=>f.onChange?.(K(f.value,"region",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.region??Q.region),readOnly:f.readOnly,disabled:f.disabled}),T(J,{value:f.value?.postalCode??"",onChange:(m)=>f.onChange?.(K(f.value,"postalCode",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.postalCode??Q.postalCode),readOnly:f.readOnly,disabled:f.disabled}),f.countryOptions?.length?T(a,{value:f.value?.countryCode??"",onChange:(m)=>f.onChange?.(K(f.value,"countryCode",Z(m))),options:f.countryOptions,disabled:f.disabled||f.readOnly}):T(J,{value:f.value?.countryCode??"",onChange:(m)=>f.onChange?.(K(f.value,"countryCode",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.countryCode??Q.countryCode),readOnly:f.readOnly,disabled:f.disabled})]})};function A(f,g,m){return{countryCode:f?.countryCode??"",nationalNumber:f?.nationalNumber??"",extension:f?.extension,e164:f?.e164,[g]:m}}var Mm=(f)=>{let g=h();return D("div",{className:"grid gap-3 md:grid-cols-3",children:[f.countryOptions?.length?T(a,{value:f.value?.countryCode??"",onChange:(m)=>f.onChange?.(A(f.value,"countryCode",Z(m))),options:f.countryOptions,disabled:f.disabled||f.readOnly}):T(J,{value:f.value?.countryCode??"",onChange:(m)=>f.onChange?.(A(f.value,"countryCode",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.countryCode??Q.countryCode),readOnly:f.readOnly,disabled:f.disabled}),T(J,{value:f.value?.nationalNumber??"",onChange:(m)=>f.onChange?.(A(f.value,"nationalNumber",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.nationalNumber??Q.phoneNumber),readOnly:f.readOnly,disabled:f.disabled}),T(J,{value:f.value?.extension??"",onChange:(m)=>f.onChange?.(A(f.value,"extension",m.currentTarget.value)),placeholder:g(f.parts?.placeholdersI18n?.extension??Q.extension),readOnly:f.readOnly,disabled:f.disabled})]})},Nm=(f)=>{let g=h();return T(ym,{value:f.value??null,onChange:f.onChange??(()=>{return}),disabled:f.disabled,placeholder:g(f.placeholder),minDate:f.minDate,maxDate:f.maxDate})},km=(f)=>{let g=h();return T(Xm,{value:f.value??null,onChange:f.onChange??(()=>{return}),disabled:f.disabled,placeholder:g(f.placeholder),is24Hour:f.is24Hour})},Im=(f)=>{let g=h();return T(Tm,{value:f.value??null,onChange:f.onChange??(()=>{return}),disabled:f.disabled,datePlaceholder:g(f.datePlaceholder),timePlaceholder:g(f.timePlaceholder),minDate:f.minDate,maxDate:f.maxDate,is24Hour:f.is24Hour})},Om=(f)=>{let g=I();return T(Jm,{...f,children:g(f.children)})},_m=(f)=>{let g=I();return T(qm,{...f,children:g(f.children)})},bm=(f)=>{let g=I();return T(Gm,{...f,children:g(f.children)})},Cm=(f)=>{let g=h();return T(J,{...f,placeholder:g(f.placeholder)})},Lm=(f)=>{let g=h();return T(b,{...f,placeholder:g(f.placeholder)})},dm=(f)=>{let g=I();return T(z,{...f,children:g(f.children)})},WR=of({driver:tf({Field:Qm,FieldLabel:Om,FieldDescription:_m,FieldError:bm,FieldGroup:$m,FieldSet:(f)=>T("fieldset",{...f}),FieldLegend:(f)=>{let g=I();return T("legend",{...f,children:g(f.children)})},Input:Cm,Textarea:Lm,Select:a,Checkbox:Em,RadioGroup:Bm,Switch:Um,Autocomplete:wm,AddressField:Vm,PhoneField:Mm,DateField:Nm,TimeField:km,DateTimeField:Im,Button:dm})});var E={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}};function s(f,g=E){if(f==="web")return g;let{space:m,radii:R,icons:y}=g;return{colors:g.colors,spacing:m,typography:{h1:g.typography.h1,body:g.typography.body},radii:R,icons:y}}function c(f,g){if(!g)return f;let m={...f},R=m;for(let[y,G]of Object.entries(g))if(G?.value!=null)R[y]=G.value;return m}function Qf(f,g){if(!g)return f;return{...f,colors:c(f.colors,g.colors),radii:c(f.radii,g.radii),space:c(f.space,g.space),typography:c(f.typography,g.typography)}}function Fm(f,g){if(!g?.targets?.length)return!0;return g.targets.includes(f.target)}function Yf(f,g,m=E){let R=Qf(m,f.tokens);for(let y of f.overrides??[])if(Fm(y,g))R=Qf(R,y.tokens);return R}function Zf(f,g,m){let R=f.get(g.key,g.version);if(!R)return E;let y=R.meta.extends?Zf(f,R.meta.extends,m):E;return Yf(R,m,y)}function MR(f,g,m,R){if("tokens"in f){let Y=f,H=g,W=Yf(Y,m);return s(H,W)}let y=f,G=g,$=m,q=Zf(y,G,R);return s($,q)}import{cva as Am}from"class-variance-authority";var IR=Am("",{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{mR as withPlatformUI,K2 as useResponsive,S2 as useReducedMotion,p1 as usePackageManager,h2 as useListUrlState,r as useDesignSystemTranslation,z2 as useColorScheme,t as resolveTranslationString,Jf as resolveTranslationNode,Yf as resolveThemeSpecTokens,Zf as resolveThemeRefTokens,MR as resolvePlatformTheme,Qf as mergeThemeTokens,w2 as mapTokensForPlatform,WR as formRenderer,IR as dsBaseVariants,E as defaultTokens,sg as createTranslationResolver,ry as ZodForm,Y2 as VisualizationRenderer,J2 as VisualizationGrid,G2 as VisualizationCard,vR as ViewButton,jR as ToggleRightButton,xR as ToggleLeftButton,uR as ToggleButton,T2 as TimelineView,fy as TimeChip,Ky as Textarea,o1 as TestimonialCarousel,OT as TermsTemplate,Sy as Stepper,o4 as StatusChip,r4 as StatCardGroup,e4 as StatCard,n4 as SkeletonList,v4 as SkeletonCircle,x4 as SkeletonBlock,zy as ScoreBar,kT as SalesTermsTemplate,Hy as RankBadge,MT as PrivacyTemplate,r1 as PricingSection,l1 as PricingCarousel,pR as PlaceChip,i1 as PageHeaderResponsive,s1 as PackageManagerProvider,c4 as OverviewCard,F4 as NavUser,L4 as NavMain,Zy as NavBrand,j1 as ModelComparisonView,K1 as MobileHeader,eT as MarketingStepCard,nT as MarketingSection,u1 as MarketingLayout,vT as MarketingIconCard,A1 as MarketingHeaderMobile,d1 as MarketingHeaderDesktop,C1 as MarketingHeader,xT as MarketingComparisonSection,cT as MarketingCardsSection,FT as MarketingCardTitle,dT as MarketingCardHeader,LT as MarketingCardDescription,CT as MarketingCardContent,bT as MarketingCard,b4 as MarkdownRenderer,Qy as LoaderCircular,O4 as LoaderBlock,_1 as ListTablePage,m2 as ListPageTemplate,I1 as ListPageResponsive,N1 as ListGridPage,V1 as ListCardPage,$y as Link,$T as LegalText,PT as LegalTOC,qT as LegalSection,rg as LegalPageLayout,DT as LegalMeta,yT as LegalList,gT as LegalHeading,fT as LegalCallout,k4 as LangSwitch,sy as KeyValueList,M4 as InstallCommand,qy as Input,w4 as HoverPreviewUser,B4 as HoverPreviewStats,X4 as HoverPreviewSimple,W4 as HoverPreviewMedia,P4 as HoverPreviewDoc,D4 as HoverPreview,U1 as HeroSection,E1 as HeroResponsive,W1 as Header,Cg as GDPRRights,Ug as GDPRDataRequest,ly as FormStepsLayout,jy as FormSection,xy as FormRow,iy as FormOneByOneLayout,uy as FormGrid,Ay as FormDialog,dy as FormCardLayout,z1 as Footer,h4 as FiltersToolbar,H1 as FeaturesSection,Z1 as FeatureCarousel,Q1 as FAQSection,yy as ErrorState,Y4 as EntityCard,gy as EmptyState,$1 as EmptySearchResult,q1 as EmptyDataList,cR as EditButton,sR as DurationChip,J4 as DimensionScoresCard,S1 as DesktopHeader,ag as DesignSystemTranslationProvider,AR as DeleteButton,oy as DefinitionList,aR as DateChip,_y as DataViewTable,Iy as DataViewRenderer,Ny as DataViewList,Vy as DataViewDetail,Uy as DataTableToolbar,Ey as DataTable,rf as DEFAULT_BREAKPOINTS,tR as Cta,G4 as CopyButton,wT as CookiesTemplate,BT as ContactTemplate,Tg as ContactForm,hT as ContactFields,YT as ConsentList,QT as ConsentItem,R2 as ComparisonView,T4 as CommandTabs,R4 as CommandSearchTrigger,m4 as CommandPalette,pT as CodeBlock,eR as ButtonLink,nR as Button,aT as Breadcrumbs,dR as ApprovalQueue,y1 as AppSidebar,g1 as AppLayout,f1 as AppHeader,tT as AiLinkButton,CR as AgentMonitor,Cy as ActionForm,s4 as AcademyLayout};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/lib.design-system",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.10.0",
|
|
4
4
|
"description": "Design tokens and theming primitives",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"contractspec",
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"sideEffects": false,
|
|
31
31
|
"tree-shake": true,
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@contractspec/lib.ai-agent": "8.0.
|
|
34
|
-
"@contractspec/lib.contracts-spec": "5.
|
|
35
|
-
"@contractspec/lib.contracts-runtime-client-react": "3.9.
|
|
36
|
-
"@contractspec/lib.presentation-runtime-react": "36.0.
|
|
37
|
-
"@contractspec/lib.ui-kit": "3.9.
|
|
38
|
-
"@contractspec/lib.ui-kit-web": "3.10.
|
|
33
|
+
"@contractspec/lib.ai-agent": "8.0.8",
|
|
34
|
+
"@contractspec/lib.contracts-spec": "5.4.0",
|
|
35
|
+
"@contractspec/lib.contracts-runtime-client-react": "3.9.1",
|
|
36
|
+
"@contractspec/lib.presentation-runtime-react": "36.0.8",
|
|
37
|
+
"@contractspec/lib.ui-kit": "3.9.1",
|
|
38
|
+
"@contractspec/lib.ui-kit-web": "3.10.1",
|
|
39
39
|
"@hookform/resolvers": "5.2.2",
|
|
40
40
|
"class-variance-authority": "^0.7.1",
|
|
41
41
|
"clsx": "^2.1.1",
|