@etic-insa/ui 0.3.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +128 -78
- package/dist/components/etic/app-shell.d.ts +4 -1
- package/dist/components/etic/app-shell.js +150 -113
- package/dist/components/etic/app-shell.js.map +1 -1
- package/dist/components/etic/data-table-bulk-actions.d.ts +14 -2
- package/dist/components/etic/data-table-bulk-actions.js +100 -53
- package/dist/components/etic/data-table-bulk-actions.js.map +1 -1
- package/dist/components/etic/data-table-focus.d.ts +1 -1
- package/dist/components/etic/data-table-focus.js.map +1 -1
- package/dist/components/etic/data-table.d.ts +12 -4
- package/dist/components/etic/data-table.js +199 -223
- package/dist/components/etic/data-table.js.map +1 -1
- package/dist/components/etic/delete-button.d.ts +2 -2
- package/dist/components/etic/delete-button.js.map +1 -1
- package/dist/components/etic/detail-list.d.ts +3 -1
- package/dist/components/etic/detail-list.js +1 -1
- package/dist/components/etic/detail-list.js.map +1 -1
- package/dist/components/etic/disclosure.js +1 -0
- package/dist/components/etic/disclosure.js.map +1 -1
- package/dist/components/etic/icon-toggle.js +1 -1
- package/dist/components/etic/icon-toggle.js.map +1 -1
- package/dist/components/etic/page-header.d.ts +12 -4
- package/dist/components/etic/page-header.js +27 -16
- package/dist/components/etic/page-header.js.map +1 -1
- package/dist/components/etic/phone-input.js +1 -1
- package/dist/components/etic/phone-input.js.map +1 -1
- package/dist/components/etic/removable-badge.js +26 -18
- package/dist/components/etic/removable-badge.js.map +1 -1
- package/dist/components/etic/save-bar.d.ts +4 -3
- package/dist/components/etic/save-bar.js +2 -2
- package/dist/components/etic/save-bar.js.map +1 -1
- package/dist/components/etic/stat-tile.d.ts +9 -2
- package/dist/components/etic/stat-tile.js +32 -18
- package/dist/components/etic/stat-tile.js.map +1 -1
- package/dist/components/etic/theme-menu.d.ts +28 -0
- package/dist/components/etic/theme-menu.js +62 -35
- package/dist/components/etic/theme-menu.js.map +1 -1
- package/dist/components/etic/toggletip.js +3 -3
- package/dist/components/etic/toggletip.js.map +1 -1
- package/dist/components/etic/tooltip-button.d.ts +7 -3
- package/dist/components/etic/tooltip-button.js +2 -2
- package/dist/components/etic/tooltip-button.js.map +1 -1
- package/dist/components/ui/button.js +2 -2
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/calendar.js +119 -81
- package/dist/components/ui/calendar.js.map +1 -1
- package/dist/components/ui/dropdown-menu.d.ts +2 -2
- package/dist/components/ui/dropdown-menu.js +102 -68
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/select.js +3 -3
- package/dist/components/ui/select.js.map +1 -1
- package/dist/styles.css +107 -73
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu.js","names":["MenuPrimitive","DropdownMenu","props","Menu","DropdownMenuPortal","DropdownMenuTrigger","DropdownMenuContent","cn","className","DropdownMenuGroup","DropdownMenuLabel","inset","DropdownMenuItem","variant","DropdownMenuSub","DropdownMenuSubTrigger","children","ChevronRightIcon","DropdownMenuSubContent","DropdownMenuCheckboxItem","CheckIcon","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuSeparator","DropdownMenuShortcut"],"sources":["../../../src/components/ui/dropdown-menu.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Menu as MenuPrimitive } from \"@base-ui/react/menu\"\nimport { cn } from \"cn\"\nimport { ChevronRightIcon, CheckIcon } from \"lucide-react\"\n\nfunction DropdownMenu({ ...props }: MenuPrimitive.Root.Props) {\n return <MenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />\n}\n\nfunction DropdownMenuPortal({ ...props }: MenuPrimitive.Portal.Props) {\n return <MenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />\n}\n\nfunction DropdownMenuTrigger({ ...props }: MenuPrimitive.Trigger.Props) {\n return <MenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />\n}\n\nfunction DropdownMenuContent({\n align = \"start\",\n alignOffset = 0,\n side = \"bottom\",\n sideOffset = 4,\n className,\n ...props\n}: MenuPrimitive.Popup.Props &\n Pick<\n MenuPrimitive.Positioner.Props,\n \"align\" | \"alignOffset\" | \"side\" | \"sideOffset\"\n >) {\n return (\n <MenuPrimitive.Portal>\n <MenuPrimitive.Positioner\n className=\"isolate z-50 outline-none\"\n align={align}\n alignOffset={alignOffset}\n side={side}\n sideOffset={sideOffset}\n >\n <MenuPrimitive.Popup\n data-slot=\"dropdown-menu-content\"\n className={cn(\n \"z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95\",\n className\n )}\n {...props}\n />\n </MenuPrimitive.Positioner>\n </MenuPrimitive.Portal>\n )\n}\n\nfunction DropdownMenuGroup({ ...props }: MenuPrimitive.Group.Props) {\n return <MenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />\n}\n\nfunction DropdownMenuLabel({\n className,\n inset,\n ...props\n}: MenuPrimitive.GroupLabel.Props & {\n inset?: boolean\n}) {\n return (\n <MenuPrimitive.GroupLabel\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn(\n \"px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuItem({\n className,\n inset,\n variant = \"default\",\n ...props\n}: MenuPrimitive.Item.Props & {\n inset?: boolean\n variant?: \"default\" | \"destructive\"\n}) {\n return (\n <MenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuSub({ ...props }: MenuPrimitive.SubmenuRoot.Props) {\n return <MenuPrimitive.SubmenuRoot data-slot=\"dropdown-menu-sub\" {...props} />\n}\n\nfunction DropdownMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: MenuPrimitive.SubmenuTrigger.Props & {\n inset?: boolean\n}) {\n return (\n <MenuPrimitive.SubmenuTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto\" />\n </MenuPrimitive.SubmenuTrigger>\n )\n}\n\nfunction DropdownMenuSubContent({\n align = \"start\",\n alignOffset = -3,\n side = \"right\",\n sideOffset = 0,\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuContent>) {\n return (\n <DropdownMenuContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n \"w-auto min-w-[96px] rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95\",\n className\n )}\n align={align}\n alignOffset={alignOffset}\n side={side}\n sideOffset={sideOffset}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n checked,\n inset,\n ...props\n}: MenuPrimitive.CheckboxItem.Props & {\n inset?: boolean\n}) {\n return (\n <MenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n data-inset={inset}\n className={cn(\n \"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span\n className=\"pointer-events-none absolute right-2 flex items-center justify-center\"\n data-slot=\"dropdown-menu-checkbox-item-indicator\"\n >\n <MenuPrimitive.CheckboxItemIndicator>\n <CheckIcon />\n </MenuPrimitive.CheckboxItemIndicator>\n </span>\n {children}\n </MenuPrimitive.CheckboxItem>\n )\n}\n\nfunction DropdownMenuRadioGroup({ ...props }: MenuPrimitive.RadioGroup.Props) {\n return (\n <MenuPrimitive.RadioGroup\n data-slot=\"dropdown-menu-radio-group\"\n {...props}\n />\n )\n}\n\nfunction DropdownMenuRadioItem({\n className,\n children,\n inset,\n ...props\n}: MenuPrimitive.RadioItem.Props & {\n inset?: boolean\n}) {\n return (\n <MenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n data-inset={inset}\n className={cn(\n \"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <span\n className=\"pointer-events-none absolute right-2 flex items-center justify-center\"\n data-slot=\"dropdown-menu-radio-item-indicator\"\n >\n <MenuPrimitive.RadioItemIndicator>\n <CheckIcon />\n </MenuPrimitive.RadioItemIndicator>\n </span>\n {children}\n </MenuPrimitive.RadioItem>\n )\n}\n\nfunction DropdownMenuSeparator({\n className,\n ...props\n}: MenuPrimitive.Separator.Props) {\n return (\n <MenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn(\"-mx-1 my-1 h-px bg-border\", className)}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuShortcut({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\n \"ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n}\n"],"mappings":";;;;;;AAKA,SAASC,EAAa,EAAE,GAAGC,KAAmC;CAC5D,OAAO,kBAACF,EAAc,MAAf;EAAoB,aAAU;EAAgB,GAAIE;CAAQ,CAAA;AACnE;AAEA,SAASE,EAAmB,EAAE,GAAGF,KAAqC;CACpE,OAAO,kBAACF,EAAc,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ACE,kBAAC,QAAD;EACE,aAAU;EACV,WAAWK,EACT,+GACAC,CACF;EACA,GAAIN;CACL,CAAA;AAEL"}
|
|
1
|
+
{"version":3,"file":"dropdown-menu.js","names":["MenuPrimitive","React","DeclencheurContext","creerSuivi","dernier","element","assignerRef","ref","valeur","SousMenuContext","focusFinal","voulu","donne","type","actif","declencheur","suivi","DropdownMenu","props","Menu","DropdownMenuPortal","DropdownMenuTrigger","lier","DropdownMenuContent","sousMenu","finalFocus","cn","className","DropdownMenuGroup","DropdownMenuLabel","inset","DropdownMenuItem","variant","DropdownMenuSub","DropdownMenuSubTrigger","children","ChevronRightIcon","DropdownMenuSubContent","DropdownMenuCheckboxItem","CheckIcon","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuSeparator","DropdownMenuShortcut"],"sources":["../../../src/components/ui/dropdown-menu.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Menu as MenuPrimitive } from \"@base-ui/react/menu\"\nimport { cn } from \"cn\"\nimport { ChevronRightIcon, CheckIcon } from \"lucide-react\"\n\n// Écart ETIC : le dernier déclencheur monté, pour le `finalFocus` par défaut\n// de DropdownMenuContent. Gardé une fois démonté : `isConnected` dit alors\n// qu'il a disparu. Un objet créé une fois plutôt qu'un état : noter le\n// déclencheur ne redessine pas le menu (un par ligne d'un tableau). Avec\n// plusieurs déclencheurs sur un même menu (non utilisé), c'est le dernier\n// monté qui compte.\ninterface SuiviDeclencheur {\n noter: (element: HTMLElement | null) => void\n lire: () => HTMLElement | null\n}\n\nconst DeclencheurContext = React.createContext<SuiviDeclencheur | null>(null)\n\nfunction creerSuivi(): SuiviDeclencheur {\n let dernier: HTMLElement | null = null\n return {\n noter: (element) => {\n if (element) dernier = element\n },\n lire: () => dernier,\n }\n}\n\n/** Transmet l'élément à la `ref` reçue, fonction ou objet ; rend le\n * nettoyage qu'une ref fonction peut renvoyer (React 19). */\nfunction assignerRef<T>(ref: React.Ref<T> | undefined, valeur: T | null) {\n if (typeof ref === \"function\") return ref(valeur)\n if (ref) ref.current = valeur\n}\n\n// Contenu d'un sous-menu : Base UI y a sa propre logique de retour de focus\n// (vers le menu parent), que la garde de DropdownMenuContent ne remplace pas.\nconst SousMenuContext = React.createContext(false)\n\ntype FinalFocus = MenuPrimitive.Popup.Props[\"finalFocus\"]\ntype FinalFocusFonction = Extract<FinalFocus, (...args: never) => unknown>\ntype TypeFermeture = Parameters<FinalFocusFonction>[0]\n\n/**\n * Écart ETIC : `finalFocus` du menu principal. À la fermeture, Base UI rend\n * le focus au déclencheur ; retiré du DOM (ligne supprimée, barre retirée),\n * il se repliait sur un historique global — un autre menu ou sélecteur de la\n * page. Rien n'est focalisé alors : le focus tombe sur `<body>`, où les\n * rattrapages (ligne supprimée d'un DataTable, barre d'actions) le\n * reprennent. Une fonction rendant le retour « explicite » pour Base UI, on\n * garde nous-mêmes sa règle : un focus parti ailleurs (dialogue ouvert depuis\n * une entrée) y reste. Le `finalFocus` donné passe d'abord ; s'il vaut\n * `true` (retour par défaut), la garde s'applique. (Une ref donnée est\n * passée telle quelle, sans garde.)\n */\nfunction focusFinal(\n type: TypeFermeture,\n donne: FinalFocusFonction | boolean | undefined,\n suivi: SuiviDeclencheur | null\n): ReturnType<FinalFocusFonction> {\n const voulu = typeof donne === \"function\" ? donne(type) : (donne ?? true)\n if (voulu !== true) return voulu\n const actif = document.activeElement\n if (\n actif &&\n actif !== document.body &&\n !actif.closest('[data-slot^=\"dropdown-menu-\"]')\n )\n return false\n const declencheur = suivi?.lire()\n return !declencheur || declencheur.isConnected\n}\n\nfunction DropdownMenu({ ...props }: MenuPrimitive.Root.Props) {\n const [suivi] = React.useState(creerSuivi)\n return (\n <DeclencheurContext.Provider value={suivi}>\n <MenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />\n </DeclencheurContext.Provider>\n )\n}\n\nfunction DropdownMenuPortal({ ...props }: MenuPrimitive.Portal.Props) {\n return <MenuPrimitive.Portal data-slot=\"dropdown-menu-portal\" {...props} />\n}\n\nfunction DropdownMenuTrigger({ ref, ...props }: MenuPrimitive.Trigger.Props) {\n const suivi = React.useContext(DeclencheurContext)\n const lier = React.useCallback(\n (element: HTMLButtonElement | null) => {\n suivi?.noter(element)\n return assignerRef(ref, element)\n },\n [suivi, ref]\n )\n return (\n <MenuPrimitive.Trigger\n data-slot=\"dropdown-menu-trigger\"\n ref={lier}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuContent({\n align = \"start\",\n alignOffset = 0,\n side = \"bottom\",\n sideOffset = 4,\n className,\n finalFocus,\n ...props\n}: MenuPrimitive.Popup.Props &\n Pick<\n MenuPrimitive.Positioner.Props,\n \"align\" | \"alignOffset\" | \"side\" | \"sideOffset\"\n >) {\n const suivi = React.useContext(DeclencheurContext)\n const sousMenu = React.useContext(SousMenuContext)\n return (\n <MenuPrimitive.Portal>\n <MenuPrimitive.Positioner\n className=\"isolate z-50 outline-none\"\n align={align}\n alignOffset={alignOffset}\n side={side}\n sideOffset={sideOffset}\n >\n <MenuPrimitive.Popup\n data-slot=\"dropdown-menu-content\"\n finalFocus={\n sousMenu || (finalFocus && typeof finalFocus === \"object\")\n ? finalFocus\n : (type: TypeFermeture) => focusFinal(type, finalFocus, suivi)\n }\n className={cn(\n \"z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95\",\n className\n )}\n {...props}\n />\n </MenuPrimitive.Positioner>\n </MenuPrimitive.Portal>\n )\n}\n\nfunction DropdownMenuGroup({ ...props }: MenuPrimitive.Group.Props) {\n return <MenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props} />\n}\n\nfunction DropdownMenuLabel({\n className,\n inset,\n ...props\n}: MenuPrimitive.GroupLabel.Props & {\n inset?: boolean\n}) {\n return (\n <MenuPrimitive.GroupLabel\n data-slot=\"dropdown-menu-label\"\n data-inset={inset}\n className={cn(\n \"px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuItem({\n className,\n inset,\n variant = \"default\",\n ...props\n}: MenuPrimitive.Item.Props & {\n inset?: boolean\n variant?: \"default\" | \"destructive\"\n}) {\n return (\n <MenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n data-inset={inset}\n data-variant={variant}\n className={cn(\n \"group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuSub({ ...props }: MenuPrimitive.SubmenuRoot.Props) {\n return <MenuPrimitive.SubmenuRoot data-slot=\"dropdown-menu-sub\" {...props} />\n}\n\nfunction DropdownMenuSubTrigger({\n className,\n inset,\n children,\n ...props\n}: MenuPrimitive.SubmenuTrigger.Props & {\n inset?: boolean\n}) {\n return (\n <MenuPrimitive.SubmenuTrigger\n data-slot=\"dropdown-menu-sub-trigger\"\n data-inset={inset}\n className={cn(\n \"flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto\" />\n </MenuPrimitive.SubmenuTrigger>\n )\n}\n\nfunction DropdownMenuSubContent({\n align = \"start\",\n alignOffset = -3,\n side = \"right\",\n sideOffset = 0,\n className,\n ...props\n}: React.ComponentProps<typeof DropdownMenuContent>) {\n return (\n <SousMenuContext.Provider value>\n <DropdownMenuContent\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n \"w-auto min-w-[96px] rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95\",\n className\n )}\n align={align}\n alignOffset={alignOffset}\n side={side}\n sideOffset={sideOffset}\n {...props}\n />\n </SousMenuContext.Provider>\n )\n}\n\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n checked,\n inset,\n ...props\n}: MenuPrimitive.CheckboxItem.Props & {\n inset?: boolean\n}) {\n return (\n <MenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n data-inset={inset}\n className={cn(\n \"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n checked={checked}\n {...props}\n >\n <span\n className=\"pointer-events-none absolute right-2 flex items-center justify-center\"\n data-slot=\"dropdown-menu-checkbox-item-indicator\"\n >\n <MenuPrimitive.CheckboxItemIndicator>\n <CheckIcon />\n </MenuPrimitive.CheckboxItemIndicator>\n </span>\n {children}\n </MenuPrimitive.CheckboxItem>\n )\n}\n\nfunction DropdownMenuRadioGroup({ ...props }: MenuPrimitive.RadioGroup.Props) {\n return (\n <MenuPrimitive.RadioGroup\n data-slot=\"dropdown-menu-radio-group\"\n {...props}\n />\n )\n}\n\nfunction DropdownMenuRadioItem({\n className,\n children,\n inset,\n ...props\n}: MenuPrimitive.RadioItem.Props & {\n inset?: boolean\n}) {\n return (\n <MenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n data-inset={inset}\n className={cn(\n \"relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <span\n className=\"pointer-events-none absolute right-2 flex items-center justify-center\"\n data-slot=\"dropdown-menu-radio-item-indicator\"\n >\n <MenuPrimitive.RadioItemIndicator>\n <CheckIcon />\n </MenuPrimitive.RadioItemIndicator>\n </span>\n {children}\n </MenuPrimitive.RadioItem>\n )\n}\n\nfunction DropdownMenuSeparator({\n className,\n ...props\n}: MenuPrimitive.Separator.Props) {\n return (\n <MenuPrimitive.Separator\n data-slot=\"dropdown-menu-separator\"\n className={cn(\"-mx-1 my-1 h-px bg-border\", className)}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuShortcut({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\n \"ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n DropdownMenu,\n DropdownMenuPortal,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuLabel,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n}\n"],"mappings":";;;;;;AAgBA,IAAME,IAAqBD,EAAM,cAAuC,IAAI;AAE5E,SAASE,IAA+B;CACtC,IAAIC,IAA8B;CAClC,OAAO;EACL,QAAQ,MAAY;GAClB,AAAIC,MAAS,IAAUA;EACzB;EACA,YAAYD;CACd;AACF;AAIA,SAASE,EAAe,GAA+B,GAAkB;CACvE,IAAI,OAAOC,KAAQ,YAAY,OAAOA,EAAIC,CAAM;CAChD,AAAID,MAAK,EAAI,UAAUC;AACzB;AAIA,IAAMC,IAAkBR,EAAM,cAAc,EAAK;AAkBjD,SAASS,EACP,GACA,GACA,GACgC;CAChC,IAAMC,IAAQ,OAAOC,KAAU,aAAaA,EAAMC,CAAI,IAAKD,KAAS;CACpE,IAAID,MAAU,IAAM,OAAOA;CAC3B,IAAMG,IAAQ,SAAS;CACvB,IACEA,KACAA,MAAU,SAAS,QACnB,CAACA,EAAM,QAAQ,iCAA+B,GAE9C,OAAO;CACT,IAAMC,IAAcC,GAAO,KAAK;CAChC,OAAO,CAACD,KAAeA,EAAY;AACrC;AAEA,SAASE,EAAa,EAAE,GAAGC,KAAmC;CAC5D,IAAM,CAACF,KAASf,EAAM,SAASE,CAAU;CACzC,OACE,kBAACD,EAAmB,UAApB;EAA6B,OAAOc;EAClC,UAAA,kBAAChB,EAAc,MAAf;GAAoB,aAAU;GAAgB,GAAIkB;EAAQ,CAAA;CAC/B,CAAA;AAEjC;AAEA,SAASE,EAAmB,EAAE,GAAGF,KAAqC;CACpE,OAAO,kBAAClB,EAAc,QAAf;EAAsB,aAAU;EAAuB,GA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ACF;EACA,GAAIT;EAPN,UAAA,CASE,kBAAC,QAAD;GACE,WAAU;GACV,aAAU;GAEV,UAAA,kBAAClB,EAAc,oBAAf,EAAA,UACE,kBAACuC,GAAD,CAAY,CAAA,EACoB,CAAA;EAC9B,CAAA,GACLJ,CACsB;;AAE7B;AAEA,SAASO,EAAsB,EAC7B,cACA,GAAGxB,KAC6B;CAChC,OACE,kBAAClB,EAAc,WAAf;EACE,aAAU;EACV,WAAW0B,EAAG,6BAA6BC,CAAS;EACpD,GAAIT;CACL,CAAA;AAEL;AAEA,SAASyB,EAAqB,EAC5B,cACA,GAAGzB,KAC4B;CAC/B,OACE,kBAAC,QAAD;EACE,aAAU;EACV,WAAWQ,EACT,+GACAC,CACF;EACA,GAAIT;CACL,CAAA;AAEL"}
|
|
@@ -24,7 +24,7 @@ function d({ className: t, size: i = "default", children: o, ...c }) {
|
|
|
24
24
|
return /* @__PURE__ */ r(s.Trigger, {
|
|
25
25
|
"data-slot": "select-trigger",
|
|
26
26
|
"data-size": i,
|
|
27
|
-
className: e("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-base whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:
|
|
27
|
+
className: e("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-base whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:block *:data-[slot=select-value]:truncate md:text-sm dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 *:data-[slot=select-value]:[&_svg]:inline *:data-[slot=select-value]:[&_svg]:align-[-0.125em] [&_svg:not([class*='size-'])]:size-4", t),
|
|
28
28
|
...c,
|
|
29
29
|
children: [o, /* @__PURE__ */ n(s.Icon, { render: /* @__PURE__ */ n(a, { className: "pointer-events-none size-4 text-muted-foreground" }) })]
|
|
30
30
|
});
|
|
@@ -40,7 +40,7 @@ function f({ className: t, children: i, side: a = "bottom", sideOffset: o = 4, a
|
|
|
40
40
|
children: /* @__PURE__ */ r(s.Popup, {
|
|
41
41
|
"data-slot": "select-content",
|
|
42
42
|
"data-align-trigger": u,
|
|
43
|
-
className: e("relative isolate z-50 max-h-(--available-height) w-(--
|
|
43
|
+
className: e("relative isolate z-50 max-h-(--available-height) w-max max-w-(--available-width) min-w-[max(var(--anchor-width),--spacing(36))] origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", t),
|
|
44
44
|
...f,
|
|
45
45
|
children: [
|
|
46
46
|
/* @__PURE__ */ n(g, {}),
|
|
@@ -68,7 +68,7 @@ function p({ className: t, ...r }) {
|
|
|
68
68
|
}
|
|
69
69
|
function m({ className: a, children: o, description: c, ...l }) {
|
|
70
70
|
let u = t.useId(), d = /* @__PURE__ */ n(s.ItemText, {
|
|
71
|
-
className: e("flex flex-1
|
|
71
|
+
className: e("flex min-w-0 flex-1 gap-2", c && "group-data-disabled/select-item:opacity-50"),
|
|
72
72
|
children: o
|
|
73
73
|
});
|
|
74
74
|
return /* @__PURE__ */ r(s.Item, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","names":["Select","SelectPrimitive","React","Select$1","Select","SelectGroup","props","cn","className","SelectValue","SelectTrigger","size","children","ChevronDownIcon","SelectContent","alignItemWithTrigger","SelectScrollUpButton","vide","SelectScrollDownButton","SelectLabel","SelectItem","idDescription","texte","description","CheckIcon","SelectSeparator","ChevronUpIcon"],"sources":["../../../src/components/ui/select.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { Select as SelectPrimitive } from \"@base-ui/react/select\"\nimport { cn } from \"cn\"\nimport { ChevronDownIcon, CheckIcon, ChevronUpIcon } from \"lucide-react\"\n\nconst Select = SelectPrimitive.Root\n\nfunction SelectGroup({ className, ...props }: SelectPrimitive.Group.Props) {\n return (\n <SelectPrimitive.Group\n data-slot=\"select-group\"\n className={cn(\"scroll-my-1 p-1\", className)}\n {...props}\n />\n )\n}\n\nfunction SelectValue({ className, ...props }: SelectPrimitive.Value.Props) {\n return (\n <SelectPrimitive.Value\n data-slot=\"select-value\"\n className={cn(\"flex flex-1 text-left\", className)}\n {...props}\n />\n )\n}\n\nfunction SelectTrigger({\n className,\n size = \"default\",\n children,\n ...props\n}: SelectPrimitive.Trigger.Props & {\n size?: \"sm\" | \"default\"\n}) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n data-size={size}\n className={cn(\n \"flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-base whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 md:text-sm dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon\n render={\n <ChevronDownIcon className=\"pointer-events-none size-4 text-muted-foreground\" />\n }\n />\n </SelectPrimitive.Trigger>\n )\n}\n\n// Écart avec shadcn : la liste s'ouvre sous le champ, alignée à gauche\n// (`alignItemWithTrigger={false}`, `align=\"start\"`), et ne recouvre jamais\n// la zone de saisie. Les défauts de shadcn (option choisie posée sur le\n// champ, liste centrée) masquaient le champ et débordaient des deux côtés\n// d'un champ étroit. Les deux restent surchargeables.\nfunction SelectContent({\n className,\n children,\n side = \"bottom\",\n sideOffset = 4,\n align = \"start\",\n alignOffset = 0,\n alignItemWithTrigger = false,\n vide = \"Aucune option.\",\n ...props\n}: SelectPrimitive.Popup.Props &\n Pick<\n SelectPrimitive.Positioner.Props,\n \"align\" | \"alignOffset\" | \"side\" | \"sideOffset\" | \"alignItemWithTrigger\"\n > & {\n /** Affiché à la place des options quand il n'y en a aucune (la liste\n * serait sinon une fenêtre vide). */\n vide?: React.ReactNode\n }) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n alignItemWithTrigger={alignItemWithTrigger}\n className=\"isolate z-50\"\n >\n <SelectPrimitive.Popup\n data-slot=\"select-content\"\n data-align-trigger={alignItemWithTrigger}\n className={cn(\n \"relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95\",\n className\n )}\n {...props}\n >\n <SelectScrollUpButton />\n {/* Toujours rendu, masqué dès que la liste contient une option :\n décidé sur le contenu réel (un `SelectGroup` vide compris), pas\n sur les `children`. Zone de statut : annoncée à l'ouverture d'une\n liste vide, muette (masquée) quand il y a des options. */}\n <div\n role=\"status\"\n data-slot=\"select-empty\"\n className=\"px-2.5 py-1.5 text-sm text-muted-foreground in-[[data-slot=select-content]:has([data-slot=select-item])]:hidden\"\n >\n {vide}\n </div>\n {/* Écart avec shadcn : des options posées sans `SelectGroup`\n reçoivent la même marge que dans un groupe. */}\n <SelectPrimitive.List className=\"has-[>[data-slot=select-item]]:p-1\">\n {children}\n </SelectPrimitive.List>\n <SelectScrollDownButton />\n </SelectPrimitive.Popup>\n </SelectPrimitive.Positioner>\n </SelectPrimitive.Portal>\n )\n}\n\nfunction SelectLabel({\n className,\n ...props\n}: SelectPrimitive.GroupLabel.Props) {\n return (\n <SelectPrimitive.GroupLabel\n data-slot=\"select-label\"\n className={cn(\"px-1.5 py-1 text-xs text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\nfunction SelectItem({\n className,\n children,\n description,\n ...props\n}: SelectPrimitive.Item.Props & {\n /** Précision sous le libellé (raison d'une option figée…), reliée à\n * l'option par `aria-describedby`. Écart avec shadcn. */\n description?: React.ReactNode\n}) {\n const idDescription = React.useId()\n const texte = (\n <SelectPrimitive.ItemText\n className={cn(\n \"flex flex-1 shrink-0 gap-2 whitespace-nowrap\",\n // Avec une description, le libellé passe à la ligne au lieu d'être\n // coupé ou recouvert par la coche.\n description &&\n \"shrink whitespace-normal group-data-disabled/select-item:opacity-50\"\n )}\n >\n {children}\n </SelectPrimitive.ItemText>\n )\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n aria-describedby={description ? idDescription : undefined}\n className={cn(\n \"relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2\",\n // Option figée : seul le libellé s'estompe, sa raison reste lisible.\n description && \"group/select-item data-disabled:opacity-100\",\n className\n )}\n {...props}\n >\n {description ? (\n <div className=\"flex min-w-0 flex-1 flex-col\">\n {texte}\n {/* Masquée : le nom accessible de l'option reste son libellé, et\n `aria-describedby` lit quand même la raison (un texte masqué\n compte pour la description), annoncée après le nom. */}\n <div\n id={idDescription}\n aria-hidden=\"true\"\n data-slot=\"select-item-description\"\n className=\"text-xs whitespace-normal text-muted-foreground\"\n >\n {description}\n </div>\n </div>\n ) : (\n texte\n )}\n <SelectPrimitive.ItemIndicator\n render={\n <span className=\"pointer-events-none absolute right-2 flex size-4 items-center justify-center\" />\n }\n >\n <CheckIcon className=\"pointer-events-none\" />\n </SelectPrimitive.ItemIndicator>\n </SelectPrimitive.Item>\n )\n}\n\nfunction SelectSeparator({\n className,\n ...props\n}: SelectPrimitive.Separator.Props) {\n return (\n <SelectPrimitive.Separator\n data-slot=\"select-separator\"\n className={cn(\"pointer-events-none -mx-1 my-1 h-px bg-border\", className)}\n {...props}\n />\n )\n}\n\nfunction SelectScrollUpButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollUpArrow>) {\n return (\n <SelectPrimitive.ScrollUpArrow\n data-slot=\"select-scroll-up-button\"\n className={cn(\n \"top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <ChevronUpIcon />\n </SelectPrimitive.ScrollUpArrow>\n )\n}\n\nfunction SelectScrollDownButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollDownArrow>) {\n return (\n <SelectPrimitive.ScrollDownArrow\n data-slot=\"select-scroll-down-button\"\n className={cn(\n \"bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <ChevronDownIcon />\n </SelectPrimitive.ScrollDownArrow>\n )\n}\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n}\n"],"mappings":";;;;;;;AAOA,IAAMA,IAASC,EAAgB;AAE/B,SAASI,EAAY,EAAE,cAAW,GAAGC,KAAsC;CACzE,OACE,kBAACL,EAAgB,OAAjB;EACE,aAAU;EACV,WAAWM,EAAG,mBAAmBC,CAAS;EAC1C,GAAIF;CACL,CAAA;AAEL;AAEA,SAASG,EAAY,EAAE,cAAW,GAAGH,KAAsC;CACzE,OACE,kBAACL,EAAgB,OAAjB;EACE,aAAU;EACV,WAAWM,EAAG,yBAAyBC,CAAS;EAChD,GAAIF;CACL,CAAA;AAEL;AAEA,SAASI,EAAc,EACrB,cACA,UAAO,WACP,aACA,GAAGJ,KAGF;CACD,OACE,kBAACL,EAAgB,SAAjB;EACE,aAAU;EACV,aAAWU;EACX,WAAWJ,EACT,o3BACAC,CACF;EACA,GAAIF;EAPN,UAAA,CASGM,GACD,kBAACX,EAAgB,MAAjB,EACE,QACE,kBAACY,GAAD,EAAiB,WAAU,mDAAoD,CAAA,EAElF,CAAA,CACsB;;AAE7B;AAOA,SAASC,EAAc,EACrB,cACA,aACA,UAAO,U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AAM,WAAU,+EAAgF,CAAA;GAGlG,UAAA,kBAACuB,GAAD,EAAW,WAAU,sBAAuB,CAAA;EACf,CAAA,CACX;;AAE1B;AAEA,SAASC,EAAgB,EACvB,cACA,GAAGnB,KAC+B;CAClC,OACE,kBAACL,EAAgB,WAAjB;EACE,aAAU;EACV,WAAWM,EAAG,iDAAiDC,CAAS;EACxE,GAAIF;CACL,CAAA;AAEL;AAEA,SAASU,EAAqB,EAC5B,cACA,GAAGV,KAC0D;CAC7D,OACE,kBAACL,EAAgB,eAAjB;EACE,aAAU;EACV,WAAWM,EACT,0HACAC,CACF;EACA,GAAIF;EAEJ,UAAA,kBAACoB,GAAD,CAAgB,CAAA;CACa,CAAA;AAEnC;AAEA,SAASR,EAAuB,EAC9B,cACA,GAAGZ,KAC4D;CAC/D,OACE,kBAACL,EAAgB,iBAAjB;EACE,aAAU;EACV,WAAWM,EACT,6HACAC,CACF;EACA,GAAIF;EAEJ,UAAA,kBAACO,GAAD,CAAkB,CAAA;CACa,CAAA;AAErC"}
|
|
1
|
+
{"version":3,"file":"select.js","names":["Select","SelectPrimitive","React","Select$1","Select","SelectGroup","props","cn","className","SelectValue","SelectTrigger","size","children","ChevronDownIcon","SelectContent","alignItemWithTrigger","SelectScrollUpButton","vide","SelectScrollDownButton","SelectLabel","SelectItem","idDescription","texte","description","CheckIcon","SelectSeparator","ChevronUpIcon"],"sources":["../../../src/components/ui/select.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { Select as SelectPrimitive } from \"@base-ui/react/select\"\nimport { cn } from \"cn\"\nimport { ChevronDownIcon, CheckIcon, ChevronUpIcon } from \"lucide-react\"\n\nconst Select = SelectPrimitive.Root\n\nfunction SelectGroup({ className, ...props }: SelectPrimitive.Group.Props) {\n return (\n <SelectPrimitive.Group\n data-slot=\"select-group\"\n className={cn(\"scroll-my-1 p-1\", className)}\n {...props}\n />\n )\n}\n\nfunction SelectValue({ className, ...props }: SelectPrimitive.Value.Props) {\n return (\n <SelectPrimitive.Value\n data-slot=\"select-value\"\n className={cn(\"flex flex-1 text-left\", className)}\n {...props}\n />\n )\n}\n\nfunction SelectTrigger({\n className,\n size = \"default\",\n children,\n ...props\n}: SelectPrimitive.Trigger.Props & {\n size?: \"sm\" | \"default\"\n}) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n data-size={size}\n className={cn(\n // Écart avec shadcn : la valeur est un bloc `truncate`, pas\n // `flex line-clamp-1` — le `flex` annulait le `line-clamp` et une\n // valeur trop longue était coupée net, sans « … ». Une icône dans la\n // valeur reste en ligne avec le texte.\n \"flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-base whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:block *:data-[slot=select-value]:truncate md:text-sm dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 *:data-[slot=select-value]:[&_svg]:inline *:data-[slot=select-value]:[&_svg]:align-[-0.125em] [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon\n render={\n <ChevronDownIcon className=\"pointer-events-none size-4 text-muted-foreground\" />\n }\n />\n </SelectPrimitive.Trigger>\n )\n}\n\n// Écart avec shadcn : la liste s'ouvre sous le champ, alignée à gauche\n// (`alignItemWithTrigger={false}`, `align=\"start\"`), et ne recouvre jamais\n// la zone de saisie. Les défauts de shadcn (option choisie posée sur le\n// champ, liste centrée) masquaient le champ et débordaient des deux côtés\n// d'un champ étroit. Les deux restent surchargeables.\nfunction SelectContent({\n className,\n children,\n side = \"bottom\",\n sideOffset = 4,\n align = \"start\",\n alignOffset = 0,\n alignItemWithTrigger = false,\n vide = \"Aucune option.\",\n ...props\n}: SelectPrimitive.Popup.Props &\n Pick<\n SelectPrimitive.Positioner.Props,\n \"align\" | \"alignOffset\" | \"side\" | \"sideOffset\" | \"alignItemWithTrigger\"\n > & {\n /** Affiché à la place des options quand il n'y en a aucune (la liste\n * serait sinon une fenêtre vide). */\n vide?: React.ReactNode\n }) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n alignItemWithTrigger={alignItemWithTrigger}\n className=\"isolate z-50\"\n >\n <SelectPrimitive.Popup\n data-slot=\"select-content\"\n data-align-trigger={alignItemWithTrigger}\n className={cn(\n // Écart avec shadcn : la liste s'élargit à ses options (au moins\n // la largeur du champ, au plus l'espace disponible) au lieu de\n // prendre exactement celle du champ, qui coupait net les options\n // plus longues que lui.\n \"relative isolate z-50 max-h-(--available-height) w-max max-w-(--available-width) min-w-[max(var(--anchor-width),--spacing(36))] origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95\",\n className\n )}\n {...props}\n >\n <SelectScrollUpButton />\n {/* Toujours rendu, masqué dès que la liste contient une option :\n décidé sur le contenu réel (un `SelectGroup` vide compris), pas\n sur les `children`. Zone de statut : annoncée à l'ouverture d'une\n liste vide, muette (masquée) quand il y a des options. */}\n <div\n role=\"status\"\n data-slot=\"select-empty\"\n className=\"px-2.5 py-1.5 text-sm text-muted-foreground in-[[data-slot=select-content]:has([data-slot=select-item])]:hidden\"\n >\n {vide}\n </div>\n {/* Écart avec shadcn : des options posées sans `SelectGroup`\n reçoivent la même marge que dans un groupe. */}\n <SelectPrimitive.List className=\"has-[>[data-slot=select-item]]:p-1\">\n {children}\n </SelectPrimitive.List>\n <SelectScrollDownButton />\n </SelectPrimitive.Popup>\n </SelectPrimitive.Positioner>\n </SelectPrimitive.Portal>\n )\n}\n\nfunction SelectLabel({\n className,\n ...props\n}: SelectPrimitive.GroupLabel.Props) {\n return (\n <SelectPrimitive.GroupLabel\n data-slot=\"select-label\"\n className={cn(\"px-1.5 py-1 text-xs text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\nfunction SelectItem({\n className,\n children,\n description,\n ...props\n}: SelectPrimitive.Item.Props & {\n /** Précision sous le libellé (raison d'une option figée…), reliée à\n * l'option par `aria-describedby`. Écart avec shadcn. */\n description?: React.ReactNode\n}) {\n const idDescription = React.useId()\n const texte = (\n <SelectPrimitive.ItemText\n className={cn(\n // Écart avec shadcn (`shrink-0 whitespace-nowrap`) : un libellé plus\n // large que l'espace disponible passe à la ligne au lieu d'être coupé\n // ou recouvert par la coche. La liste prenant la largeur de ses\n // options, il tient sur une ligne dès qu'il y a la place.\n \"flex min-w-0 flex-1 gap-2\",\n description && \"group-data-disabled/select-item:opacity-50\"\n )}\n >\n {children}\n </SelectPrimitive.ItemText>\n )\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n aria-describedby={description ? idDescription : undefined}\n className={cn(\n \"relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2\",\n // Option figée : seul le libellé s'estompe, sa raison reste lisible.\n description && \"group/select-item data-disabled:opacity-100\",\n className\n )}\n {...props}\n >\n {description ? (\n <div className=\"flex min-w-0 flex-1 flex-col\">\n {texte}\n {/* Masquée : le nom accessible de l'option reste son libellé, et\n `aria-describedby` lit quand même la raison (un texte masqué\n compte pour la description), annoncée après le nom. */}\n <div\n id={idDescription}\n aria-hidden=\"true\"\n data-slot=\"select-item-description\"\n className=\"text-xs whitespace-normal text-muted-foreground\"\n >\n {description}\n </div>\n </div>\n ) : (\n texte\n )}\n <SelectPrimitive.ItemIndicator\n render={\n <span className=\"pointer-events-none absolute right-2 flex size-4 items-center justify-center\" />\n }\n >\n <CheckIcon className=\"pointer-events-none\" />\n </SelectPrimitive.ItemIndicator>\n </SelectPrimitive.Item>\n )\n}\n\nfunction SelectSeparator({\n className,\n ...props\n}: SelectPrimitive.Separator.Props) {\n return (\n <SelectPrimitive.Separator\n data-slot=\"select-separator\"\n className={cn(\"pointer-events-none -mx-1 my-1 h-px bg-border\", className)}\n {...props}\n />\n )\n}\n\nfunction SelectScrollUpButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollUpArrow>) {\n return (\n <SelectPrimitive.ScrollUpArrow\n data-slot=\"select-scroll-up-button\"\n className={cn(\n \"top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <ChevronUpIcon />\n </SelectPrimitive.ScrollUpArrow>\n )\n}\n\nfunction SelectScrollDownButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollDownArrow>) {\n return (\n <SelectPrimitive.ScrollDownArrow\n data-slot=\"select-scroll-down-button\"\n className={cn(\n \"bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n <ChevronDownIcon />\n </SelectPrimitive.ScrollDownArrow>\n )\n}\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n}\n"],"mappings":";;;;;;;AAOA,IAAMA,IAASC,EAAgB;AAE/B,SAASI,EAAY,EAAE,cAAW,GAAGC,KAAsC;CACzE,OACE,kBAACL,EAAgB,OAAjB;EACE,aAAU;EACV,WAAWM,EAAG,mBAAmBC,CAAS;EAC1C,GAAIF;CACL,CAAA;AAEL;AAEA,SAASG,EAAY,EAAE,cAAW,GAAGH,KAAsC;CACzE,OACE,kBAACL,EAAgB,OAAjB;EACE,aAAU;EACV,WAAWM,EAAG,yBAAyBC,CAAS;EAChD,GAAIF;CACL,CAAA;AAEL;AAEA,SAASI,EAAc,EACrB,cACA,UAAO,WACP,aACA,GAAGJ,KAGF;CACD,OACE,kBAACL,EAAgB,SAAjB;EACE,aAAU;EACV,aAAWU;EACX,WAAWJ,EAKT,o4BACAC,CACF;EACA,GAAIF;EAXN,UAAA,CAaGM,GACD,kBAACX,EAAgB,MAAjB,EACE,QACE,kBAACY,GAAD,EAAiB,WAAU,mDAAoD,CAAA,EAElF,CAAA,CACsB;;AAE7B;AAOA,SAASC,EAAc,EACrB,cACA,aACA,UAAO,UACP,gBAAa,GACb,WAAQ,SACR,iBAAc,GACd,0BAAuB,IACvB,UAAO,kBACP,GAAGR,KASA;CACH,OACE,kBAACL,EAAgB,QAAjB,EAAA,UACE,kBAACA,EAAgB,YAAjB;EACQ;EACM;EACL;EACM;EACS;EACtB,WAAU;EAEV,UAAA,kBAACA,EAAgB,OAAjB;GACE,aAAU;GACV,sBAAoBc;GACpB,WAAWR,EAKT,msBACAC,CACF;GACA,GAAIF;GAXN,UAAA;IAaE,kBAACU,GAAD,CAAuB,CAAA;IAKvB,kBAAC,OAAD;KACE,MAAK;KACL,aAAU;KACV,WAAU;KAET,UAAAC;IACE,CAAA;IAGL,kBAAChB,EAAgB,MAAjB;KAAsB,WAAU;KA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C;AAEA,SAASR,EAAuB,EAC9B,cACA,GAAGZ,KAC4D;CAC/D,OACE,kBAACL,EAAgB,iBAAjB;EACE,aAAU;EACV,WAAWM,EACT,6HACAC,CACF;EACA,GAAIF;EAEJ,UAAA,kBAACO,GAAD,CAAkB,CAAA;CACa,CAAA;AAErC"}
|
package/dist/styles.css
CHANGED
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
* Sans contrat, l'accent est le gris foncé de la base. La barre latérale suit
|
|
18
18
|
* l'accent : ses variables --sidebar-primary* et --sidebar-ring en dérivent.
|
|
19
19
|
*
|
|
20
|
-
* Couleur de base : «
|
|
21
|
-
*
|
|
22
|
-
*
|
|
20
|
+
* Couleur de base : « zinc » de shadcn (registre ui.shadcn.com/r/colors/
|
|
21
|
+
* zinc.json, cssVarsV4 : palette zinc de Tailwind 4, gris froid presque
|
|
22
|
+
* neutre, celui de toute la suite), à la place de « neutral » de Nova. Les
|
|
23
23
|
* valeurs sont celles du registre, sauf les écarts commentés ci-dessous ;
|
|
24
24
|
* src/theme.test.ts les compare au registre et vérifie les contrastes.
|
|
25
25
|
*
|
|
@@ -718,6 +718,10 @@
|
|
|
718
718
|
--color-foreground: var(--foreground);
|
|
719
719
|
--color-background: var(--background);
|
|
720
720
|
--color-page: var(--page);
|
|
721
|
+
/* Ajout d'ETIC : fond d'un cadre de tableau (bg-tableau), --card sur la
|
|
722
|
+
page, --tableau-encart dans une surface surélevée (règle --tableau-fond
|
|
723
|
+
plus bas). */
|
|
724
|
+
--color-tableau: var(--tableau-fond, var(--card));
|
|
721
725
|
--radius-sm: calc(var(--radius) * 0.6);
|
|
722
726
|
--radius-md: calc(var(--radius) * 0.8);
|
|
723
727
|
--radius-lg: var(--radius);
|
|
@@ -729,119 +733,124 @@
|
|
|
729
733
|
|
|
730
734
|
:root {
|
|
731
735
|
color-scheme: light;
|
|
732
|
-
/* Fond de page (ajout d'ETIC, bg-page) :
|
|
733
|
-
|
|
734
|
-
les cartes
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
736
|
+
/* Fond de page (ajout d'ETIC, bg-page) : zinc-50. Cartes et menus
|
|
737
|
+
(bg-card, bg-popover) restent blancs et s'en détachent, comme en sombre
|
|
738
|
+
où les cartes sont plus claires que la page. Un
|
|
739
|
+
tableau (bg-tableau) prend --card sur la page, --tableau-encart dans une
|
|
740
|
+
surface. --background garde le blanc du registre : shadcn l'emploie
|
|
741
|
+
aussi pour des surfaces posées sur --muted ou une carte. */
|
|
742
|
+
--page: oklch(0.985 0 0);
|
|
743
|
+
/* Fond d'un tableau posé dans une carte, un dialogue ou un menu (ajout
|
|
744
|
+
d'ETIC) : un gris entre zinc-50 et zinc-100, 1,05:1 sur une carte
|
|
745
|
+
blanche (zinc-50 n'y donnait que 1,04:1), filet --border encore net. */
|
|
746
|
+
--tableau-encart: oklch(0.981 0.001 286.375);
|
|
738
747
|
--background: oklch(1 0 0);
|
|
739
|
-
--foreground: oklch(0.
|
|
748
|
+
--foreground: oklch(0.141 0.005 285.823);
|
|
740
749
|
--card: oklch(1 0 0);
|
|
741
|
-
--card-foreground: oklch(0.
|
|
750
|
+
--card-foreground: oklch(0.141 0.005 285.823);
|
|
742
751
|
--popover: oklch(1 0 0);
|
|
743
|
-
--popover-foreground: oklch(0.
|
|
752
|
+
--popover-foreground: oklch(0.141 0.005 285.823);
|
|
744
753
|
/* Contrat d'accent : valeurs par défaut, remplacées par l'application.
|
|
745
754
|
--primary-text (ajout d'ETIC) vaut --primary. */
|
|
746
|
-
--primary: oklch(0.21 0.
|
|
747
|
-
--primary-foreground: oklch(0.985 0
|
|
748
|
-
--primary-text: oklch(0.21 0.
|
|
749
|
-
--ring: oklch(0.
|
|
750
|
-
--secondary: oklch(0.967 0.
|
|
751
|
-
--secondary-foreground: oklch(0.21 0.
|
|
752
|
-
--muted: oklch(0.967 0.
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
--muted-foreground: oklch(0.54 0.027 264.364);
|
|
757
|
-
--accent: oklch(0.967 0.003 264.542);
|
|
758
|
-
--accent-foreground: oklch(0.21 0.034 264.665);
|
|
755
|
+
--primary: oklch(0.21 0.006 285.885);
|
|
756
|
+
--primary-foreground: oklch(0.985 0 0);
|
|
757
|
+
--primary-text: oklch(0.21 0.006 285.885);
|
|
758
|
+
--ring: oklch(0.705 0.015 286.067);
|
|
759
|
+
--secondary: oklch(0.967 0.001 286.375);
|
|
760
|
+
--secondary-foreground: oklch(0.21 0.006 285.885);
|
|
761
|
+
--muted: oklch(0.967 0.001 286.375);
|
|
762
|
+
--muted-foreground: oklch(0.552 0.016 285.938);
|
|
763
|
+
--accent: oklch(0.967 0.001 286.375);
|
|
764
|
+
--accent-foreground: oklch(0.21 0.006 285.885);
|
|
759
765
|
/* Plus foncé que le registre (oklch(0.577 0.245 27.325)) : ≥ 4,5:1 sur sa
|
|
760
766
|
teinte à 10 % (bouton et badge destructive). */
|
|
761
767
|
--destructive: #c10007;
|
|
762
768
|
/* Texte sur la page, le fond, les cartes, --muted et sur leur teinte à
|
|
763
|
-
20 % : ≥ 4,5:1 (--success un cran plus
|
|
764
|
-
page
|
|
769
|
+
20 % : ≥ 4,5:1 (--success un cran plus foncé que #15703f pour la page
|
|
770
|
+
teintée : 4,62:1 sur sa teinte posée sur la page zinc-50). */
|
|
765
771
|
--success: #146c3d;
|
|
766
772
|
--warning: #8a5300;
|
|
767
773
|
/* Information (Alert info) : même exigence. */
|
|
768
774
|
--info: #1f5aa8;
|
|
769
|
-
--border: oklch(0.
|
|
770
|
-
--input: oklch(0.
|
|
775
|
+
--border: oklch(0.92 0.004 286.32);
|
|
776
|
+
--input: oklch(0.92 0.004 286.32);
|
|
771
777
|
/* Bord d'une case à cocher ou d'une radio vide, rail d'un switch éteint :
|
|
772
778
|
--input se voyait à peine sur le blanc
|
|
773
|
-
(et restait sous 2:1 en sombre). --muted-foreground
|
|
774
|
-
le fond et sur --muted (contrôle, WCAG 1.4.11)
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
--control-border: color-mix(
|
|
778
|
-
in oklab,
|
|
779
|
-
var(--muted-foreground) 80%,
|
|
780
|
-
transparent
|
|
781
|
-
);
|
|
779
|
+
(et restait sous 2:1 en sombre). --muted-foreground plein : ≥ 4,3:1 sur
|
|
780
|
+
le fond et sur --muted (contrôle, WCAG 1.4.11 : ≥ 3:1) ; à 80 %, il
|
|
781
|
+
restait trop pâle sur le blanc. */
|
|
782
|
+
--control-border: var(--muted-foreground);
|
|
782
783
|
--chart-1: oklch(0.646 0.222 41.116);
|
|
783
784
|
--chart-2: oklch(0.6 0.118 184.704);
|
|
784
785
|
--chart-3: oklch(0.398 0.07 227.392);
|
|
785
786
|
--chart-4: oklch(0.828 0.189 84.429);
|
|
786
787
|
--chart-5: oklch(0.769 0.188 70.08);
|
|
787
788
|
--radius: 0.625rem;
|
|
788
|
-
/* Écart au registre (
|
|
789
|
+
/* Écart au registre (zinc-50, identique à --page) : en clair la barre
|
|
789
790
|
latérale est blanche, comme une carte, et se détache de la page. */
|
|
790
791
|
--sidebar: var(--background);
|
|
791
|
-
--sidebar-foreground: oklch(0.
|
|
792
|
+
--sidebar-foreground: oklch(0.141 0.005 285.823);
|
|
792
793
|
--sidebar-primary: var(--primary);
|
|
793
794
|
--sidebar-primary-foreground: var(--primary-foreground);
|
|
794
|
-
--sidebar-accent: oklch(0.967 0.
|
|
795
|
-
--sidebar-accent-foreground: oklch(0.21 0.
|
|
796
|
-
--sidebar-border: oklch(0.
|
|
795
|
+
--sidebar-accent: oklch(0.967 0.001 286.375);
|
|
796
|
+
--sidebar-accent-foreground: oklch(0.21 0.006 285.885);
|
|
797
|
+
--sidebar-border: oklch(0.92 0.004 286.32);
|
|
797
798
|
--sidebar-ring: var(--ring);
|
|
798
799
|
}
|
|
799
800
|
|
|
800
801
|
.dark {
|
|
801
802
|
color-scheme: dark;
|
|
802
|
-
/* En sombre, la page est le fond
|
|
803
|
+
/* En sombre, la page est le fond. */
|
|
803
804
|
--page: var(--background);
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
--
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
--
|
|
813
|
-
--
|
|
814
|
-
--
|
|
815
|
-
--
|
|
816
|
-
--
|
|
817
|
-
--
|
|
818
|
-
--
|
|
819
|
-
--
|
|
805
|
+
/* Écart au registre : fonds sombres éclaircis, gris très foncé plutôt que
|
|
806
|
+
presque noir. Le registre pose zinc-950 (0.141) pour le fond, zinc-900
|
|
807
|
+
(0.21) pour les cartes et zinc-800 (0.274) pour --muted ; l'échelle
|
|
808
|
+
remonte d'un cran en gardant ses écarts (cartes 1,10:1 sur la page,
|
|
809
|
+
--muted 1,17:1 sur une carte). */
|
|
810
|
+
--background: oklch(0.2 0.006 285.9);
|
|
811
|
+
/* Entre la page et la carte : 1,05:1 sur une carte, comme en clair. Le
|
|
812
|
+
fond de la page creusait trop le tableau dans sa carte. */
|
|
813
|
+
--tableau-encart: oklch(0.22 0.006 285.9);
|
|
814
|
+
--foreground: oklch(0.985 0 0);
|
|
815
|
+
--card: oklch(0.24 0.006 285.9);
|
|
816
|
+
--card-foreground: oklch(0.985 0 0);
|
|
817
|
+
--popover: oklch(0.24 0.006 285.9);
|
|
818
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
819
|
+
--primary: oklch(0.92 0.004 286.32);
|
|
820
|
+
--primary-foreground: oklch(0.21 0.006 285.885);
|
|
821
|
+
--primary-text: oklch(0.92 0.004 286.32);
|
|
822
|
+
--ring: oklch(0.552 0.016 285.938);
|
|
823
|
+
--secondary: oklch(0.29 0.006 285.9);
|
|
824
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
825
|
+
--muted: oklch(0.29 0.006 285.9);
|
|
826
|
+
--muted-foreground: oklch(0.705 0.015 286.067);
|
|
827
|
+
--accent: oklch(0.29 0.006 285.9);
|
|
828
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
820
829
|
/* Plus clair que le registre (oklch(0.704 0.191 22.216)) : ≥ 4,5:1 sur sa
|
|
821
|
-
teinte à 20 %, y compris dans un pied de dialogue (bg-muted/50)
|
|
822
|
-
|
|
830
|
+
teinte à 20 %, y compris dans un pied de dialogue (bg-muted/50), sur
|
|
831
|
+
les fonds sombres éclaircis. */
|
|
832
|
+
--destructive: #ff9999;
|
|
823
833
|
--success: #6fd7a7;
|
|
824
834
|
--warning: #f0b25f;
|
|
825
835
|
--info: #7cb4f5;
|
|
826
836
|
--border: oklch(1 0 0 / 10%);
|
|
827
837
|
--input: oklch(1 0 0 / 15%);
|
|
828
|
-
/*
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
);
|
|
838
|
+
/* --input du registre, comme shadcn : exception assumée à WCAG 1.4.11
|
|
839
|
+
(blanc à 15 %, sous 2:1). Le bord dérivé de --muted-foreground
|
|
840
|
+
ressortait trop sur le gris foncé, colonne de sélection d'un tableau en
|
|
841
|
+
tête. Redéclaré ici, pour un « dark » posé plus bas que <html>. */
|
|
842
|
+
--control-border: var(--input);
|
|
834
843
|
--chart-1: oklch(0.488 0.243 264.376);
|
|
835
844
|
--chart-2: oklch(0.696 0.17 162.48);
|
|
836
845
|
--chart-3: oklch(0.769 0.188 70.08);
|
|
837
846
|
--chart-4: oklch(0.627 0.265 303.9);
|
|
838
847
|
--chart-5: oklch(0.645 0.246 16.439);
|
|
839
|
-
--sidebar: oklch(0.
|
|
840
|
-
--sidebar-foreground: oklch(0.985 0
|
|
848
|
+
--sidebar: oklch(0.24 0.006 285.9);
|
|
849
|
+
--sidebar-foreground: oklch(0.985 0 0);
|
|
841
850
|
--sidebar-primary: var(--primary);
|
|
842
851
|
--sidebar-primary-foreground: var(--primary-foreground);
|
|
843
|
-
--sidebar-accent: oklch(0.
|
|
844
|
-
--sidebar-accent-foreground: oklch(0.985 0
|
|
852
|
+
--sidebar-accent: oklch(0.29 0.006 285.9);
|
|
853
|
+
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
845
854
|
--sidebar-border: oklch(1 0 0 / 10%);
|
|
846
855
|
--sidebar-ring: var(--ring);
|
|
847
856
|
}
|
|
@@ -851,12 +860,37 @@
|
|
|
851
860
|
@apply border-border outline-ring/50;
|
|
852
861
|
}
|
|
853
862
|
body {
|
|
854
|
-
/* bg-page au lieu de bg-background (shadcn) : fond de page
|
|
863
|
+
/* bg-page au lieu de bg-background (shadcn) : fond de page zinc-50. */
|
|
855
864
|
@apply bg-page text-foreground;
|
|
856
865
|
}
|
|
857
866
|
html {
|
|
858
867
|
@apply font-sans;
|
|
859
868
|
}
|
|
869
|
+
/* Un tableau se détache toujours de la surface qui le porte (bg-tableau,
|
|
870
|
+
cadre de DataTable) : sur la page, il prend --card ; dans une surface
|
|
871
|
+
surélevée de la bibliothèque, peinte en bg-card ou bg-popover (ou
|
|
872
|
+
bg-sidebar, de même valeur), il prend --tableau-encart. La variable est
|
|
873
|
+
héritée : posée ici une fois, sans variante sur chaque cadre. Toute
|
|
874
|
+
nouvelle surface en bg-card ou bg-popover s'ajoute à cette liste. */
|
|
875
|
+
:where(
|
|
876
|
+
[data-slot="card"],
|
|
877
|
+
[data-slot="alert"],
|
|
878
|
+
[data-slot="dialog-content"],
|
|
879
|
+
[data-slot="alert-dialog-content"],
|
|
880
|
+
[data-slot="sheet-content"],
|
|
881
|
+
[data-slot="popover-content"],
|
|
882
|
+
[data-slot="dropdown-menu-content"],
|
|
883
|
+
[data-slot="dropdown-menu-sub-content"],
|
|
884
|
+
[data-slot="select-content"],
|
|
885
|
+
[data-slot="combobox-content"],
|
|
886
|
+
[data-slot="save-bar"],
|
|
887
|
+
[data-slot="data-table-bulk-actions"],
|
|
888
|
+
[data-slot="sidebar"],
|
|
889
|
+
[data-slot="sidebar-inner"],
|
|
890
|
+
[data-slot="disclosure"][data-variante="carte"]
|
|
891
|
+
) {
|
|
892
|
+
--tableau-fond: var(--tableau-encart);
|
|
893
|
+
}
|
|
860
894
|
/* Coquille sur mobile : la barre du haut (h-12) colle au haut de l'écran ;
|
|
861
895
|
une ancre ou un élément qu'on fait défiler jusqu'à lui s'arrête dessous,
|
|
862
896
|
pas derrière. La barre n'existe que sous le seuil mobile. */
|