@zevra/ui 0.61.1 → 0.63.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/DECISIONS.md +59 -0
- package/dist/catalogue.d.ts.map +1 -1
- package/dist/catalogue.js +13 -1
- package/dist/catalogue.js.map +1 -1
- package/dist/css-inline.d.ts.map +1 -1
- package/dist/css-inline.js +1 -1
- package/dist/css-inline.js.map +1 -1
- package/dist/icon-data.d.ts +1 -1
- package/dist/icon-data.d.ts.map +1 -1
- package/dist/icon-data.js +4 -0
- package/dist/icon-data.js.map +1 -1
- package/dist/navigation.d.ts +24 -0
- package/dist/navigation.d.ts.map +1 -1
- package/dist/navigation.js +12 -0
- package/dist/navigation.js.map +1 -1
- package/icons/index.json +12 -0
- package/icons/sprite.svg +2 -0
- package/package.json +1 -1
- package/react/catalogue.tsx +23 -1
- package/react/css-inline.ts +1 -1
- package/react/icon-data.ts +6 -0
- package/react/navigation.tsx +51 -0
- package/src/navigation.css +82 -0
package/react/icon-data.ts
CHANGED
|
@@ -84,6 +84,8 @@ export type IconId =
|
|
|
84
84
|
| 'muet'
|
|
85
85
|
| 'oeil'
|
|
86
86
|
| 'oeil-barre'
|
|
87
|
+
| 'panneau-fermer'
|
|
88
|
+
| 'panneau-ouvrir'
|
|
87
89
|
| 'partager'
|
|
88
90
|
| 'pause'
|
|
89
91
|
| 'piece-jointe'
|
|
@@ -203,6 +205,8 @@ export const CORPS: Record<IconId, string> = {
|
|
|
203
205
|
'muet': "<path d=\"M4 9.5 H7.5 L12 5.5 V18.5 L7.5 14.5 H4 Z\" /><path d=\"M16 10 L21 14\" /><path d=\"M21 10 L16 14\" />",
|
|
204
206
|
'oeil': "<path d=\"M2 12 C5.33 6.67 8.67 4.67 12 4.67 C15.33 4.67 18.67 6.67 22 12 C18.67 17.33 15.33 19.33 12 19.33 C8.67 19.33 5.33 17.33 2 12 Z\" /><circle cx=\"12\" cy=\"12\" r=\"2.67\" />",
|
|
205
207
|
'oeil-barre': "<path d=\"M3 12 C5.5 7.5 8.6 5.5 12 5.5 C15.4 5.5 18.5 7.5 21 12 C18.5 16.5 15.4 18.5 12 18.5 C8.6 18.5 5.5 16.5 3 12 Z\" /><path d=\"M9.5 12 A2.5 2.5 0 0 1 14.5 12 A2.5 2.5 0 0 1 9.5 12 Z\" /><path d=\"M4 20 L20 4\" />",
|
|
208
|
+
'panneau-fermer': "<path d=\"M3 3 H21 V21 H3 Z\" /><path d=\"M15 3 V21\" /><path d=\"M8 9 L11 12 L8 15\" />",
|
|
209
|
+
'panneau-ouvrir': "<path d=\"M3 3 H21 V21 H3 Z\" /><path d=\"M15 3 V21\" /><path d=\"M10 15 L7 12 L10 9\" />",
|
|
206
210
|
'partager': "<g transform=\"matrix(0.9 0 0 0.9 1.20 1.20)\" stroke-width=\"2.222\"><circle cx=\"18\" cy=\"5\" r=\"3\" /><circle cx=\"6\" cy=\"12\" r=\"3\" /><circle cx=\"18\" cy=\"19\" r=\"3\" /><line x1=\"8.59\" x2=\"15.42\" y1=\"13.51\" y2=\"17.49\" /><line x1=\"15.41\" x2=\"8.59\" y1=\"6.51\" y2=\"10.49\" /></g>",
|
|
207
211
|
'pause': "<path d=\"M9 5 H11 V19 H9 Z\" fill=\"currentColor\" stroke=\"none\" /><path d=\"M13 5 H15 V19 H13 Z\" fill=\"currentColor\" stroke=\"none\" />",
|
|
208
212
|
'piece-jointe': "<g transform=\"matrix(0.9 0 0 0.9 1.20 1.20)\" stroke-width=\"2.222\"><path d=\"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551\" /></g>",
|
|
@@ -325,6 +329,8 @@ export const NOMS: Record<IconId, string> = {
|
|
|
325
329
|
'muet': "Muet",
|
|
326
330
|
'oeil': "Œil (afficher)",
|
|
327
331
|
'oeil-barre': "Œil barré",
|
|
332
|
+
'panneau-fermer': "Fermer le panneau latéral (d'après Lucide panel-right-close)",
|
|
333
|
+
'panneau-ouvrir': "Ouvrir le panneau latéral (d'après Lucide panel-right-open)",
|
|
328
334
|
'partager': "Partager",
|
|
329
335
|
'pause': "Pause",
|
|
330
336
|
'piece-jointe': "Pièce jointe",
|
package/react/navigation.tsx
CHANGED
|
@@ -15,8 +15,10 @@ import type {
|
|
|
15
15
|
KeyboardEvent as ReactKeyboardEvent,
|
|
16
16
|
ReactNode,
|
|
17
17
|
} from 'react'
|
|
18
|
+
import { forwardRef } from 'react'
|
|
18
19
|
import { cx } from './cx.js'
|
|
19
20
|
import { Seg, SegGroup } from './forms.js'
|
|
21
|
+
import { Icon, type IconId } from './icon.js'
|
|
20
22
|
|
|
21
23
|
type Div = Omit<HTMLAttributes<HTMLDivElement>, 'className'>
|
|
22
24
|
type Span = Omit<HTMLAttributes<HTMLSpanElement>, 'className'>
|
|
@@ -196,6 +198,55 @@ export function Popover({ className, ...reste }: Div & { className?: string }) {
|
|
|
196
198
|
return <div className={cx('zv-popover', className)} {...reste} />
|
|
197
199
|
}
|
|
198
200
|
|
|
201
|
+
/* ─── La valeur qui s'ouvre ────────────────────────────────────────── */
|
|
202
|
+
|
|
203
|
+
export interface OuvrableProps extends Omit<Btn, 'children'> {
|
|
204
|
+
/** Ce que le mot ouvre (popover, volet) est ouvert : pose
|
|
205
|
+
* `aria-expanded` et le fond d'ouverture. */
|
|
206
|
+
ouvert: boolean
|
|
207
|
+
/** `chiffre` : le montant d'un bandeau de totaux (Outfit, `--app-h2`).
|
|
208
|
+
* Par défaut, la taille du texte voisin. */
|
|
209
|
+
taille?: 'texte' | 'chiffre'
|
|
210
|
+
/** La valeur en `--ok` : une remise acquise, un solde nul. */
|
|
211
|
+
ton?: 'ok'
|
|
212
|
+
/** Une icône devant le mot, à la taille du texte. Facultative : la valeur
|
|
213
|
+
* d'une phrase n'en a pas besoin, un outil de barre peut garder la sienne. */
|
|
214
|
+
icone?: IconId
|
|
215
|
+
className?: string
|
|
216
|
+
children: ReactNode
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/** Le mot souligné en pointillé dont le clic ouvre quelque chose : une
|
|
220
|
+
* valeur réglable dans sa phrase, un outil de barre (Filtres, Colonnes).
|
|
221
|
+
* Sans état ni panneau : ce qui s'ouvre reste à l'app, qui le place
|
|
222
|
+
* d'après ce bouton (d'où le `ref`, transmis par `forwardRef` pour
|
|
223
|
+
* React 18 comme 19).
|
|
224
|
+
* ⚠️ Pas pour l'action principale d'un écran : c'est un bouton. Pas pour
|
|
225
|
+
* une valeur qu'on ne peut pas changer : c'est du texte. */
|
|
226
|
+
export const Ouvrable = forwardRef<HTMLButtonElement, OuvrableProps>(function Ouvrable(
|
|
227
|
+
{ ouvert, taille = 'texte', ton, icone, type = 'button', className, children, ...reste },
|
|
228
|
+
ref,
|
|
229
|
+
) {
|
|
230
|
+
return (
|
|
231
|
+
<button
|
|
232
|
+
ref={ref}
|
|
233
|
+
type={type}
|
|
234
|
+
aria-expanded={ouvert}
|
|
235
|
+
className={cx(
|
|
236
|
+
'zv-ouvrable',
|
|
237
|
+
ouvert && 'zv-ouvrable--open',
|
|
238
|
+
taille === 'chiffre' && 'zv-ouvrable--chiffre',
|
|
239
|
+
ton === 'ok' && 'zv-ouvrable--ok',
|
|
240
|
+
className,
|
|
241
|
+
)}
|
|
242
|
+
{...reste}
|
|
243
|
+
>
|
|
244
|
+
{icone && <Icon nom={icone} />}
|
|
245
|
+
<span className="zv-ouvrable__libelle">{children}</span>
|
|
246
|
+
</button>
|
|
247
|
+
)
|
|
248
|
+
})
|
|
249
|
+
|
|
199
250
|
/* ─── Onglets ──────────────────────────────────────────────────────── */
|
|
200
251
|
|
|
201
252
|
export interface TabsProps<T extends string> {
|
package/src/navigation.css
CHANGED
|
@@ -625,6 +625,88 @@ a.zv-menu__item:hover {
|
|
|
625
625
|
padding: 14px 16px;
|
|
626
626
|
}
|
|
627
627
|
|
|
628
|
+
/* ─── La valeur qui s'ouvre ─────────────────────────────────────────────
|
|
629
|
+
* HORS RELEVÉ (03/12/2026, voir DECISIONS.md, « La valeur qui s'ouvre »).
|
|
630
|
+
* Un mot souligné en pointillé ; le clic ouvre ce que l'app y attache (un
|
|
631
|
+
* popover, un volet). Ni cadre ni fond au repos : la valeur se lit comme du
|
|
632
|
+
* texte. Le mot seulement : le panneau reste à l'app.
|
|
633
|
+
* DÉRIVÉ : la taille suit le texte voisin (font: inherit) et les retraits
|
|
634
|
+
* sont en em, pour rester justes dans une ligne de métadonnées comme dans un
|
|
635
|
+
* corps de message. */
|
|
636
|
+
|
|
637
|
+
.zv-ouvrable {
|
|
638
|
+
display: inline-flex;
|
|
639
|
+
align-items: center;
|
|
640
|
+
gap: 0.3em;
|
|
641
|
+
max-width: 100%;
|
|
642
|
+
padding: 0.1em 0.3em;
|
|
643
|
+
border: 0;
|
|
644
|
+
border-radius: var(--r-btn);
|
|
645
|
+
background: transparent;
|
|
646
|
+
font: inherit;
|
|
647
|
+
font-weight: 500;
|
|
648
|
+
font-variant-numeric: tabular-nums;
|
|
649
|
+
/* Un <button> les remet à zéro, et `font` ne les rétablit pas : dans un
|
|
650
|
+
* texte en capitales interlettrées, la valeur suit ses voisines. */
|
|
651
|
+
letter-spacing: inherit;
|
|
652
|
+
text-transform: inherit;
|
|
653
|
+
color: var(--ink);
|
|
654
|
+
text-decoration: underline dotted var(--muted);
|
|
655
|
+
text-underline-offset: 0.22em;
|
|
656
|
+
white-space: nowrap;
|
|
657
|
+
cursor: pointer;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
.zv-ouvrable:hover {
|
|
661
|
+
text-decoration-color: var(--ink);
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
/* Désactivé : comme l'interrupteur, à moitié effacé et sans réaction. */
|
|
665
|
+
.zv-ouvrable:disabled {
|
|
666
|
+
cursor: not-allowed;
|
|
667
|
+
opacity: 0.5;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
.zv-ouvrable:disabled:hover {
|
|
671
|
+
text-decoration-color: var(--muted);
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
/* Ouvert : la marque de la ligne choisie d'un tableau. */
|
|
675
|
+
.zv-ouvrable--open {
|
|
676
|
+
background: var(--accent-soft);
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
/* Le libellé se tronque, pas l'icône. Rogné en largeur SEULEMENT : un
|
|
680
|
+
* `overflow: hidden` coupait aussi le pointillé, posé sous la ligne de base,
|
|
681
|
+
* dans un texte à interligne serré (un titre, un montant de bandeau). */
|
|
682
|
+
.zv-ouvrable__libelle {
|
|
683
|
+
display: inline-block;
|
|
684
|
+
min-width: 0;
|
|
685
|
+
overflow-x: clip;
|
|
686
|
+
overflow-y: visible;
|
|
687
|
+
text-overflow: ellipsis;
|
|
688
|
+
text-decoration: inherit;
|
|
689
|
+
text-underline-offset: inherit;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
/* L'icône à la taille du texte, comme une lettre. */
|
|
693
|
+
.zv-ouvrable .zv-icon {
|
|
694
|
+
width: 1em;
|
|
695
|
+
height: 1em;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
/* Le montant d'un bandeau de totaux. */
|
|
699
|
+
.zv-ouvrable--chiffre {
|
|
700
|
+
font-family: var(--font-display);
|
|
701
|
+
font-size: var(--app-h2);
|
|
702
|
+
font-weight: 400;
|
|
703
|
+
text-underline-offset: 0.25em;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
.zv-ouvrable--ok {
|
|
707
|
+
color: var(--ok);
|
|
708
|
+
}
|
|
709
|
+
|
|
628
710
|
/* ─── Fil d'Ariane ──────────────────────────────────────────────────────*/
|
|
629
711
|
|
|
630
712
|
.zv-crumbs {
|