diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/Main.dc.html b/Main.dc.html old mode 100644 new mode 100755 diff --git a/OptionA2.dc.html b/OptionA2.dc.html old mode 100644 new mode 100755 diff --git a/OptionA3.dc.html b/OptionA3.dc.html old mode 100644 new mode 100755 diff --git a/OptionA4.dc.html b/OptionA4.dc.html old mode 100644 new mode 100755 diff --git a/OptionA4Dark.dc.html b/OptionA4Dark.dc.html old mode 100644 new mode 100755 diff --git a/OptionB.dc.html b/OptionB.dc.html old mode 100644 new mode 100755 diff --git a/OptionC.dc.html b/OptionC.dc.html old mode 100644 new mode 100755 diff --git a/canvas.json b/canvas.json old mode 100644 new mode 100755 diff --git a/figma-kit-audit.md b/figma-kit-audit.md old mode 100644 new mode 100755 diff --git a/kit-audit/Buttons.dc.html b/kit-audit/Buttons.dc.html old mode 100644 new mode 100755 diff --git a/kit-audit/Colors.dc.html b/kit-audit/Colors.dc.html old mode 100644 new mode 100755 diff --git a/kit-audit/Components.dc.html b/kit-audit/Components.dc.html old mode 100644 new mode 100755 diff --git a/kit-audit/Main.dc.html b/kit-audit/Main.dc.html old mode 100644 new mode 100755 diff --git a/kit-audit/Typography.dc.html b/kit-audit/Typography.dc.html old mode 100644 new mode 100755 diff --git a/kit-audit/canvas.json b/kit-audit/canvas.json old mode 100644 new mode 100755 diff --git a/kit-audit/kit-ios27-inventaire.html b/kit-audit/kit-ios27-inventaire.html old mode 100644 new mode 100755 diff --git a/napps-directions.html b/napps-directions.html old mode 100644 new mode 100755 diff --git a/packages/design-system/package-lock.json b/packages/design-system/package-lock.json old mode 100644 new mode 100755 diff --git a/packages/design-system/package.json b/packages/design-system/package.json old mode 100644 new mode 100755 diff --git a/packages/design-system/src/components/Badge.tsx b/packages/design-system/src/components/Badge.tsx new file mode 100644 index 0000000..904daa6 --- /dev/null +++ b/packages/design-system/src/components/Badge.tsx @@ -0,0 +1,20 @@ +import { HTMLAttributes, ReactNode } from 'react'; + +export type BadgeTone = 'neutral' | 'accent' | 'success' | 'warning' | 'error'; + +export interface BadgeProps extends HTMLAttributes { + tone?: BadgeTone; + children: ReactNode; +} + +/** + * Jamais un signal seul : toujours accompagné d'un texte explicite (jamais + * une pastille de couleur nue) — principe vérifié dans l'audit du kit Apple. + */ +export function Badge({ tone = 'neutral', className, children, ...props }: BadgeProps) { + return ( + + {children} + + ); +} diff --git a/packages/design-system/src/components/Button.tsx b/packages/design-system/src/components/Button.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/src/components/Card.tsx b/packages/design-system/src/components/Card.tsx new file mode 100644 index 0000000..01acf33 --- /dev/null +++ b/packages/design-system/src/components/Card.tsx @@ -0,0 +1,14 @@ +import { HTMLAttributes, ReactNode } from 'react'; + +export interface CardProps extends HTMLAttributes { + children: ReactNode; +} + +/** Surface groupée standard (voir Surface pour les autres niveaux/matières). */ +export function Card({ className, children, ...props }: CardProps) { + return ( +
+ {children} +
+ ); +} diff --git a/packages/design-system/src/components/Checkbox.tsx b/packages/design-system/src/components/Checkbox.tsx new file mode 100644 index 0000000..02dd6ba --- /dev/null +++ b/packages/design-system/src/components/Checkbox.tsx @@ -0,0 +1,26 @@ +export interface CheckboxProps { + checked: boolean; + onChange: (checked: boolean) => void; + disabled?: boolean; + 'aria-label': string; +} + +export function Checkbox({ checked, onChange, disabled, ...props }: CheckboxProps) { + return ( + + ); +} diff --git a/packages/design-system/src/components/Dialog.tsx b/packages/design-system/src/components/Dialog.tsx new file mode 100644 index 0000000..c82205a --- /dev/null +++ b/packages/design-system/src/components/Dialog.tsx @@ -0,0 +1,66 @@ +import { ReactNode, useEffect } from 'react'; + +export type DialogActionRole = 'default' | 'cancel' | 'destructive'; + +export interface DialogAction { + label: string; + role?: DialogActionRole; + onClick: () => void; +} + +export interface DialogProps { + open: boolean; + title: ReactNode; + message?: ReactNode; + actions: DialogAction[]; + onDismiss?: () => void; +} + +/** + * Verre de panneau (.material-panel) — pas la même recette que les boutons + * flottants. Rôles d'action calqués sur Alert/Action Sheet du kit : Default + * = accent plein, Cancel/None = fill-secondary + texte noir, Destructive = + * fill-secondary + texte rouge (jamais de bouton rouge plein). + * + * Implémentation volontairement minimale : pas de portail ni de focus trap. + * À renforcer avant un usage en production si l'accessibilité au clavier + * complète est requise. + */ +export function Dialog({ open, title, message, actions, onDismiss }: DialogProps) { + useEffect(() => { + if (!open || !onDismiss) return; + const handler = (event: KeyboardEvent) => { + if (event.key === 'Escape') onDismiss(); + }; + document.addEventListener('keydown', handler); + return () => document.removeEventListener('keydown', handler); + }, [open, onDismiss]); + + if (!open) return null; + + return ( +
{ + if (e.target === e.currentTarget) onDismiss?.(); + }} + > +
+

{title}

+ {message &&

{message}

} +
+ {actions.map((action, i) => ( + + ))} +
+
+
+ ); +} diff --git a/packages/design-system/src/components/EmptyState.tsx b/packages/design-system/src/components/EmptyState.tsx new file mode 100644 index 0000000..9422572 --- /dev/null +++ b/packages/design-system/src/components/EmptyState.tsx @@ -0,0 +1,32 @@ +import { ReactNode } from 'react'; +import { IconBadge } from './IconBadge'; +import { Text } from './Text'; + +export interface EmptyStateProps { + icon?: ReactNode; + title: ReactNode; + description?: ReactNode; + action?: ReactNode; +} + +/** + * Reprend le pattern "Symbol in Circle" du kit : badge circulaire teinté + * accent, titre, description, puis une action (généralement un Button + * primary) — jamais de remplissage gratuit si l'un des champs est vide. + */ +export function EmptyState({ icon, title, description, action }: EmptyStateProps) { + return ( +
+ {icon && {icon}} +
+ {title} + {description && ( + + {description} + + )} +
+ {action} +
+ ); +} diff --git a/packages/design-system/src/components/IconBadge.tsx b/packages/design-system/src/components/IconBadge.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/src/components/ListRow.tsx b/packages/design-system/src/components/ListRow.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/src/components/Radio.tsx b/packages/design-system/src/components/Radio.tsx new file mode 100644 index 0000000..50be88a --- /dev/null +++ b/packages/design-system/src/components/Radio.tsx @@ -0,0 +1,26 @@ +export interface RadioProps { + checked: boolean; + onChange: () => void; + disabled?: boolean; + 'aria-label': string; +} + +export function Radio({ checked, onChange, disabled, ...props }: RadioProps) { + return ( + + ); +} diff --git a/packages/design-system/src/components/SegmentedControl.tsx b/packages/design-system/src/components/SegmentedControl.tsx old mode 100644 new mode 100755 diff --git a/packages/design-system/src/components/Select.tsx b/packages/design-system/src/components/Select.tsx new file mode 100644 index 0000000..90a7d27 --- /dev/null +++ b/packages/design-system/src/components/Select.tsx @@ -0,0 +1,20 @@ +import { SelectHTMLAttributes, forwardRef } from 'react'; + +export type SelectProps = SelectHTMLAttributes; + +export const Select = forwardRef( + ({ className, ...props }, ref) => { + return ( +
+