origam 2.18.18 → 2.18.20
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/CHANGELOG.md +183 -0
- package/dist/src/assets/css/main.css +1 -1
- package/dist/src/assets/css/tokens/dark.css +124 -6
- package/dist/src/assets/css/tokens/light.css +62 -3
- package/dist/src/assets/css/tokens/origam-utilities.css +30 -0
- package/dist/src/assets/css/tokens/primitive.css +5 -0
- package/dist/src/assets/scss/tokens/_dark.scss +124 -6
- package/dist/src/assets/scss/tokens/_light.scss +62 -3
- package/dist/src/assets/scss/tokens/_origam-utilities.scss +30 -0
- package/dist/src/assets/scss/tokens/_primitive.scss +5 -0
- package/dist/src/components/Audio/OrigamAudio.vue +66 -2
- package/dist/src/components/Chip/OrigamChip.vue +34 -0
- package/dist/src/components/Field/OrigamField.vue +76 -3
- package/dist/src/components/List/OrigamList.vue +90 -3
- package/dist/src/components/Main/OrigamMain.vue +2 -2
- package/dist/src/components/Media/OrigamMediaScrubber.vue +11 -1
- package/dist/src/components/SliderField/OrigamSliderField.vue +138 -3
- package/dist/src/components/SliderField/OrigamSliderFieldTrack.vue +12 -1
- package/dist/src/components/Snackbar/OrigamSnackbar.vue +2 -2
- package/dist/src/components/Switch/OrigamSwitch.vue +32 -0
- package/dist/src/components/TextField/OrigamTextField.vue +3 -1
- package/dist/src/components/Video/OrigamVideo.vue +11 -1
- package/dist/src/composables/Commons/backdrop.composable.cjs +50 -0
- package/dist/src/composables/Commons/backdrop.composable.d.ts +32 -0
- package/dist/src/composables/Commons/backdrop.composable.js +33 -0
- package/dist/src/composables/Commons/layout.composable.cjs +2 -2
- package/dist/src/composables/Commons/layout.composable.d.ts +16 -2
- package/dist/src/composables/Commons/layout.composable.js +1 -1
- package/dist/src/composables/Commons/opacity.composable.cjs +50 -0
- package/dist/src/composables/Commons/opacity.composable.d.ts +33 -0
- package/dist/src/composables/Commons/opacity.composable.js +34 -0
- package/dist/src/composables/Commons/stateEffect.composable.cjs +17 -2
- package/dist/src/composables/Commons/stateEffect.composable.d.ts +7 -2
- package/dist/src/composables/Commons/stateEffect.composable.js +23 -2
- package/dist/src/composables/Commons/theme-props-resolver.composable.cjs +44 -9
- package/dist/src/composables/Commons/theme-props-resolver.composable.d.ts +33 -1
- package/dist/src/composables/Commons/theme-props-resolver.composable.js +42 -10
- package/dist/src/composables/index.cjs +24 -0
- package/dist/src/composables/index.d.ts +2 -0
- package/dist/src/composables/index.js +2 -0
- package/dist/src/consts/Commons/backdrop.const.cjs +15 -0
- package/dist/src/consts/Commons/backdrop.const.d.ts +47 -0
- package/dist/src/consts/Commons/backdrop.const.js +9 -0
- package/dist/src/consts/Commons/opacity.const.cjs +20 -0
- package/dist/src/consts/Commons/opacity.const.d.ts +58 -0
- package/dist/src/consts/Commons/opacity.const.js +14 -0
- package/dist/src/consts/Commons/variant-preset.const.cjs +8 -0
- package/dist/src/consts/Commons/variant-preset.const.d.ts +60 -0
- package/dist/src/consts/Commons/variant-preset.const.js +2 -0
- package/dist/src/consts/index.cjs +33 -0
- package/dist/src/consts/index.d.ts +3 -0
- package/dist/src/consts/index.js +3 -0
- package/dist/src/interfaces/Commons/backdrop.interface.cjs +1 -0
- package/dist/src/interfaces/Commons/backdrop.interface.d.ts +49 -0
- package/dist/src/interfaces/Commons/backdrop.interface.js +0 -0
- package/dist/src/interfaces/Commons/opacity.interface.cjs +1 -0
- package/dist/src/interfaces/Commons/opacity.interface.d.ts +37 -0
- package/dist/src/interfaces/Commons/opacity.interface.js +0 -0
- package/dist/src/interfaces/Commons/state-effect.interface.d.ts +31 -0
- package/dist/src/interfaces/Commons/theme.interface.d.ts +33 -0
- package/dist/src/interfaces/Masonry/masonry.interface.d.ts +2 -2
- package/dist/src/interfaces/index.cjs +22 -0
- package/dist/src/interfaces/index.d.ts +2 -0
- package/dist/src/interfaces/index.js +2 -0
- package/dist/src/origam.cjs +2 -1
- package/dist/src/origam.js +8 -2
- package/dist/src/types/Commons/backdrop.type.cjs +1 -0
- package/dist/src/types/Commons/backdrop.type.d.ts +23 -0
- package/dist/src/types/Commons/backdrop.type.js +0 -0
- package/dist/src/types/Commons/opacity.type.cjs +1 -0
- package/dist/src/types/Commons/opacity.type.d.ts +36 -0
- package/dist/src/types/Commons/opacity.type.js +0 -0
- package/dist/src/types/Commons/state-effect.type.d.ts +2 -1
- package/dist/src/types/Commons/variant-preset.type.cjs +1 -0
- package/dist/src/types/Commons/variant-preset.type.d.ts +73 -0
- package/dist/src/types/Commons/variant-preset.type.js +0 -0
- package/dist/src/types/index.cjs +33 -0
- package/dist/src/types/index.d.ts +3 -0
- package/dist/src/types/index.js +3 -0
- package/dist/src/types/tokens.type.d.ts +1 -1
- package/package.json +1 -1
|
@@ -572,8 +572,41 @@ defineExpose({
|
|
|
572
572
|
display: grid;
|
|
573
573
|
grid-template-areas: "prepend-inner field clear append-inner";
|
|
574
574
|
grid-template-columns: min-content minmax(0, 1fr) min-content min-content;
|
|
575
|
+
/*
|
|
576
|
+
* ⛔ #595 — NEUF tokens `--origam-field*` (plus un `--origam-input*`)
|
|
577
|
+
* que les feuilles declarent et que ce SCSS ne lit pas. Ils restent en
|
|
578
|
+
* baseline `token-var-channels-dormant.json` :
|
|
579
|
+
*
|
|
580
|
+
* · les quatre `__overlay---{background-color,opacity,
|
|
581
|
+
* pointer-events,position}` — l element `.origam-field__overlay`
|
|
582
|
+
* EXISTE dans le template (ligne 10) mais AUCUNE regle ne le style :
|
|
583
|
+
* il est aujourd hui sans position, sans fond, sans opacite. Les
|
|
584
|
+
* cabler ajouterait quatre proprietes absentes du rendu. C est le
|
|
585
|
+
* raisonnement « visuellement inerte » qu un lot de #550 a tenu
|
|
586
|
+
* avant de devoir tout reverter (hypothese de containment non
|
|
587
|
+
* verifiee en navigateur) : on ne le rejoue pas ;
|
|
588
|
+
* · `---color` (text---primary) — la racine ne declare aucun `color`,
|
|
589
|
+
* la couleur du champ est heritee ;
|
|
590
|
+
* · `---transition-duration`, `---transition-easing` — la racine ne
|
|
591
|
+
* declare aucune `transition` ; celles qui existent sont portees par
|
|
592
|
+
* `__label` / `__clearable` / `__outline`, chacune avec son propre
|
|
593
|
+
* couple de tokens deja cable ;
|
|
594
|
+
* · `---prepend-inner-icon-opacity-focused`,
|
|
595
|
+
* `---append-inner-icon-opacity-focused` (opacity---100) — au focus,
|
|
596
|
+
* `opacity: 1` est pose sur les CONTENEURS `__prepend-inner` /
|
|
597
|
+
* `__append-inner`, pas sur l icone : l icone garde son 0.7. Cabler
|
|
598
|
+
* par le nom la ferait passer a 1 (changement de rendu) ; cabler le
|
|
599
|
+
* conteneur graverait un nom faux ;
|
|
600
|
+
* · `--origam-input---icon-opacity-active` (opacity---100) — le seul
|
|
601
|
+
* `opacity: 1` d icone vit dans `OrigamInput` sous
|
|
602
|
+
* `&--disabled, &--error`. La valeur coinciderait, le nom
|
|
603
|
+
* « active » non.
|
|
604
|
+
*
|
|
605
|
+
* `---letter-spacing`, lui, vient d etre cable : la valeur livree en dur
|
|
606
|
+
* est identique aux deux sites, et la feuille a ete realignee sur elle.
|
|
607
|
+
*/
|
|
575
608
|
font-size: var(--origam-field---font-size, 16px);
|
|
576
|
-
letter-spacing: 0.009375em;
|
|
609
|
+
letter-spacing: var(--origam-field---letter-spacing, 0.009375em);
|
|
577
610
|
max-width: 100%;
|
|
578
611
|
border-radius: var(--origam-field---border-radius, 8px);
|
|
579
612
|
contain: layout;
|
|
@@ -608,6 +641,18 @@ defineExpose({
|
|
|
608
641
|
|
|
609
642
|
&__skeleton {
|
|
610
643
|
width: 100%;
|
|
644
|
+
/*
|
|
645
|
+
* ⛔ #595 — FAUX POSITIF de `token-var-channels`, a laisser en
|
|
646
|
+
* baseline. Le repli est `var(--origam-input__control---height, 36px)`,
|
|
647
|
+
* et ce token-la est ECRIT PAR INSTANCE : les quatre modificateurs
|
|
648
|
+
* de taille de ce composant (~l.1532-1550) comme ceux d `OrigamInput`
|
|
649
|
+
* et d `OrigamTextareaField` le posent sur l element
|
|
650
|
+
* (`sm`=28 / `md`=36 / `lg`=44 / `xl`=52px). Declarer
|
|
651
|
+
* `--origam-field__skeleton---min-height` a `:root` avec ce repli
|
|
652
|
+
* substituerait la valeur RACINE (36px) une fois pour toutes : le
|
|
653
|
+
* squelette cesserait de suivre la taille du champ. Meme piege que
|
|
654
|
+
* `---hover-x` sur SliderField.
|
|
655
|
+
*/
|
|
611
656
|
min-height: var(--origam-field__skeleton---min-height, var(--origam-input__control---height, 36px));
|
|
612
657
|
border-radius: var(--origam-field---border-radius, 8px);
|
|
613
658
|
grid-column: 1 / -1;
|
|
@@ -635,9 +680,24 @@ defineExpose({
|
|
|
635
680
|
column-gap: 2px;
|
|
636
681
|
display: flex;
|
|
637
682
|
flex-wrap: wrap;
|
|
638
|
-
letter-spacing: 0.009375em;
|
|
683
|
+
letter-spacing: var(--origam-field---letter-spacing, 0.009375em);
|
|
639
684
|
opacity: var(--origam-field__input---opacity, 0.7);
|
|
640
685
|
box-sizing: border-box;
|
|
686
|
+
/*
|
|
687
|
+
* ⛔ #595 — FAUX POSITIF de `token-var-channels`, a laisser en
|
|
688
|
+
* baseline (5 lectures ici, 1 dans OrigamSwitch, 1 dans
|
|
689
|
+
* OrigamCheckbox). `--origam-input---density` est ECRIT PAR
|
|
690
|
+
* INSTANCE par les trois modificateurs de densite d `OrigamInput`
|
|
691
|
+
* (~l.424-432 : `default`=0px, `compact`=-8px,
|
|
692
|
+
* `comfortable`=+8px) — ce sont eux, et non une feuille, qui
|
|
693
|
+
* portent la valeur. Ce que les feuilles declarent, c est l ECHELLE
|
|
694
|
+
* (`--origam-input---density-{default,compact,comfortable}-density`),
|
|
695
|
+
* qui est bien atteignable par un theme ; le token agrege ne doit
|
|
696
|
+
* pas l etre. La declarer a `:root` figerait la densite racine pour
|
|
697
|
+
* tout champ dont le modificateur ne serait pas un ancetre du
|
|
698
|
+
* lecteur — et le lot ne peut pas le verifier sur les trois
|
|
699
|
+
* composants sans changer de perimetre.
|
|
700
|
+
*/
|
|
641
701
|
min-height: max(calc(var(--origam-input__control---height, 36px) + var(--origam-input---density, 0px)), 1.5rem + var(--origam-field__input---padding-top) + var(--origam-field__input---padding-bottom));
|
|
642
702
|
min-width: 0;
|
|
643
703
|
padding-inline: var(--origam-field__input---padding-start) var(--origam-field__input---padding-end);
|
|
@@ -1011,7 +1071,20 @@ defineExpose({
|
|
|
1011
1071
|
|
|
1012
1072
|
&--variant {
|
|
1013
1073
|
&-solo {
|
|
1014
|
-
|
|
1074
|
+
/*
|
|
1075
|
+
* #595 — EFFONDREMENT d un repli fantome. Cette ligne lisait
|
|
1076
|
+
* `var(--origam-theme---elevation, var(RUNG2, ...))`. Mesure du
|
|
1077
|
+
* 2026-09-29 : `--origam-theme---elevation` a UNE SEULE
|
|
1078
|
+
* occurrence dans tout le depot — ce site de lecture. Aucune
|
|
1079
|
+
* feuille ne la declare, aucun composant ne l ecrit, et la
|
|
1080
|
+
* matrice runtime (`apply-theme.util.ts`) ne l emet pas non
|
|
1081
|
+
* plus. Le nom n est d ailleurs pas grammatical : `--origam-theme`
|
|
1082
|
+
* n est pas un bloc de composant. RUNG2
|
|
1083
|
+
* (`--origam-field--variant-solo---box-shadow`) est lui declare
|
|
1084
|
+
* light ET dark a `var(--origam-shadow---sm)` : c est lui qui
|
|
1085
|
+
* peignait, et qui peint toujours. Zero pixel deplace.
|
|
1086
|
+
*/
|
|
1087
|
+
box-shadow: var(--origam-field--variant-solo---box-shadow, var(--origam-shadow---sm));
|
|
1015
1088
|
border-color: transparent;
|
|
1016
1089
|
--origam-field__input---padding-top: var(--origam-field__input---padding-block-solo);
|
|
1017
1090
|
}
|
|
@@ -372,10 +372,97 @@ defineExpose({
|
|
|
372
372
|
// padding `0px/0px`, so the rows ran edge-to-edge inside the menu
|
|
373
373
|
// and their hover surface was clipped by the menu's own corner
|
|
374
374
|
// radius. The two longhands are the names the base rule reads.
|
|
375
|
-
--origam-list---padding-inline-start: var(--origam-space---
|
|
376
|
-
--origam-list---padding-inline-end: var(--origam-space---
|
|
375
|
+
--origam-list---padding-inline-start: var(--origam-space---1, 4px);
|
|
376
|
+
--origam-list---padding-inline-end: var(--origam-space---1, 4px);
|
|
377
|
+
|
|
378
|
+
// ⛔ L'AXE VERTICAL DOIT ETRE DECLARE ICI AUSSI, et pas seulement dans
|
|
379
|
+
// la feuille. Mesure du 2026-09-30, menu nav de la barre marketing sur
|
|
380
|
+
// les 8 identites : `--origam-list---padding-block-start/end` valait
|
|
381
|
+
// `0` sur SEPT d'entre elles, et `var(--origam-space---2)` sur la seule
|
|
382
|
+
// `origam`. La feuille (`light.css:1716`) donne bien 8px, mais la
|
|
383
|
+
// matrice de theme runtime emet `0` pour chaque marque, et `origam`
|
|
384
|
+
// n'y echappe que parce qu'elle porte encore le reset genere
|
|
385
|
+
// (`origam-reset.generated.ts`, cf. #609) qui le re-declare.
|
|
386
|
+
//
|
|
387
|
+
// Une declaration SUR L'ELEMENT bat celle de `:root` : la poser ici
|
|
388
|
+
// neutralise l'ecart entre identites sans toucher aux 7 themes. Le
|
|
389
|
+
// rendu passait de 5-7px en vertical contre 13-27px en inline — un
|
|
390
|
+
// facteur 4 sur cartoon et glass — a des gouttieres du meme ordre.
|
|
391
|
+
--origam-list---padding-block-start: var(--origam-space---1, 4px);
|
|
392
|
+
--origam-list---padding-block-end: var(--origam-space---1, 4px);
|
|
393
|
+
|
|
377
394
|
--origam-list-subheader---font-size: var(--origam-list__subheader---nav-font-size, 0.75rem);
|
|
378
|
-
|
|
395
|
+
|
|
396
|
+
// ⛔ INDENT A ZERO EN MODE NAV — il rendait les items ASYMETRIQUES.
|
|
397
|
+
// `OrigamListItem` calcule
|
|
398
|
+
// `padding-inline-start: calc(base + indent + density)` mais
|
|
399
|
+
// `padding-inline-end: calc(base + density)` : l'indent ne s'applique
|
|
400
|
+
// QU'AU COTE START. Avec -8px, un item de menu recevait donc 8px de
|
|
401
|
+
// moins a gauche qu'a droite. Mesure : du bord du menu au texte,
|
|
402
|
+
// `origam` 12px a gauche contre 20px a droite, `apple` 14/18,
|
|
403
|
+
// `ecom`/`editorial`/`geek` 13/17 — cinq identites sur huit
|
|
404
|
+
// desequilibrees.
|
|
405
|
+
//
|
|
406
|
+
// L'indent sert a decaler les niveaux IMBRIQUES ; un menu de
|
|
407
|
+
// navigation est plat, il n'a rien a indenter. Les listes imbriquees
|
|
408
|
+
// gardent `--origam-list---indent-padding` intact hors mode nav.
|
|
409
|
+
--origam-list---indent-padding: 0px;
|
|
410
|
+
|
|
411
|
+
// ⛔ HAUTEUR DE RANGEE RESSERREE — 48px -> 36px, decision de
|
|
412
|
+
// l'utilisateur (2026-09-30), et elle a un COUT qu'il a accepte en
|
|
413
|
+
// connaissance de cause.
|
|
414
|
+
//
|
|
415
|
+
// `OrigamListItem` calcule
|
|
416
|
+
// `min-height: max(calc(base + densite), 1.5rem)`. Avec la base de
|
|
417
|
+
// feuille a 56px et la densite compacte a -8px, une rangee de menu
|
|
418
|
+
// faisait 48px : les libelles restaient a 50px les uns des autres
|
|
419
|
+
// alors que les gouttieres venaient d'etre resserrees a 8-11px. C'est
|
|
420
|
+
// la hauteur de rangee, PAS une gouttiere, qui portait le reste du
|
|
421
|
+
// desequilibre signale.
|
|
422
|
+
//
|
|
423
|
+
// ⚠️ 36px passe SOUS la cible tactile de 44x44 recommandee par WCAG
|
|
424
|
+
// 2.5.5. Le compromis est assume pour un menu de navigation d'en-tete,
|
|
425
|
+
// dense et pointe a la souris. ⛔ NE PAS propager cette valeur aux
|
|
426
|
+
// listes hors mode `nav` : une liste de contenu garde 48px, et c'est
|
|
427
|
+
// pour cela que la declaration vit dans `&--nav` et nulle part
|
|
428
|
+
// ailleurs. La base ajoute la densite, donc on vise 44 pour obtenir 36
|
|
429
|
+
// en densite compacte.
|
|
430
|
+
--origam-list-item---min-height: var(--origam-list--nav---item-min-height, 44px);
|
|
431
|
+
|
|
432
|
+
// Le `min-height` seul ne suffit pas : mesure, la rangee rendait 40px
|
|
433
|
+
// et non 36, parce que le CONTENU la depassait — texte plus les 8px de
|
|
434
|
+
// padding haut et bas de l'item. On resserre donc aussi ce padding en
|
|
435
|
+
// mode nav, sinon la hauteur demandee reste theorique.
|
|
436
|
+
:deep(.origam-list-item) {
|
|
437
|
+
--origam-list-item---padding-block-start: var(--origam-list--nav---item-padding-block, 6px);
|
|
438
|
+
--origam-list-item---padding-block-end: var(--origam-list--nav---item-padding-block, 6px);
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
// ⛔ L'ECART ENTRE PASTILLES ETAIT NUL — le desequilibre signale.
|
|
442
|
+
// Mesure du 2026-09-30 sur le menu « Features » (10 items), 8
|
|
443
|
+
// identites : la pastille d'un item est en retrait de 12 a 15px a
|
|
444
|
+
// gauche ET a droite, mais l'ecart VERTICAL entre deux pastilles
|
|
445
|
+
// valait `0` sur SEPT identites sur huit (geek : 5px). Les rangees se
|
|
446
|
+
// touchent donc bord a bord pendant que les cotes respirent — un
|
|
447
|
+
// rapport infini, pas seulement desequilibre.
|
|
448
|
+
//
|
|
449
|
+
// La liste est un conteneur BLOC : pas de `gap` disponible sans la
|
|
450
|
+
// passer en flex, ce qui toucherait les ~200 consommateurs de
|
|
451
|
+
// `origam-list`. La marge entre freres adjacents obtient le meme
|
|
452
|
+
// resultat sans changer le mode de disposition, et ne s'applique qu'au
|
|
453
|
+
// mode nav.
|
|
454
|
+
// ⛔ `:deep()` EST OBLIGATOIRE ICI, et une regle scopee nue ne marche
|
|
455
|
+
// PAS. Mesure : l'item porte `data-v-5f5f508b` (OrigamListItem) et le
|
|
456
|
+
// scope de l'appelant, mais PAS `data-v-05b52ddf` (OrigamList) — les
|
|
457
|
+
// items arrivent par le SLOT, donc ils appartiennent au scope de celui
|
|
458
|
+
// qui les ecrit, pas a celui de la liste qui les recoit. Une regle
|
|
459
|
+
// scopee nue compile en `… .origam-list-item[data-v-05b52ddf]` et ne
|
|
460
|
+
// matche jamais : le premier essai a rendu un ecart de 0px, identique
|
|
461
|
+
// a l'etat d'avant. `:deep()` pose l'attribut sur l'ANCETRE, qui lui
|
|
462
|
+
// le porte.
|
|
463
|
+
:deep(.origam-list-item + .origam-list-item) {
|
|
464
|
+
margin-block-start: var(--origam-list--nav---item-gap, 2px);
|
|
465
|
+
}
|
|
379
466
|
}
|
|
380
467
|
|
|
381
468
|
&--rounded {
|
|
@@ -20,7 +20,7 @@ import { useDimension } from "../../composables/Commons/dimension.composable";
|
|
|
20
20
|
import { useBorder } from "../../composables/Commons/border.composable";
|
|
21
21
|
import { useBothColor } from "../../composables/Commons/bothColor.composable";
|
|
22
22
|
import { useElevation } from "../../composables/Commons/elevation.composable";
|
|
23
|
-
import {
|
|
23
|
+
import { useLayoutMain } from "../../composables/Commons/layout.composable";
|
|
24
24
|
import { useMargin } from "../../composables/Commons/margin.composable";
|
|
25
25
|
import { usePadding } from "../../composables/Commons/padding.composable";
|
|
26
26
|
import { useProps } from "../../composables/Commons/props.composable";
|
|
@@ -78,7 +78,7 @@ const props = defineProps({
|
|
|
78
78
|
const { filterProps } = useProps(props);
|
|
79
79
|
defineEmits([]);
|
|
80
80
|
defineSlots();
|
|
81
|
-
const { mainStyles: mainLayoutStyles } =
|
|
81
|
+
const { mainStyles: mainLayoutStyles } = useLayoutMain();
|
|
82
82
|
const { ssrBootStyles } = useSsrBoot();
|
|
83
83
|
const { colorClasses, colorStyles } = useBothColor(toRef(props, "bgColor"), toRef(props, "color"));
|
|
84
84
|
const { elevationClasses } = useElevation(props);
|
|
@@ -428,7 +428,17 @@ defineExpose({
|
|
|
428
428
|
color: var(--origam-media-scrubber__tooltip---color, #ffffff);
|
|
429
429
|
font-size: 11px;
|
|
430
430
|
font-weight: 600;
|
|
431
|
-
|
|
431
|
+
/*
|
|
432
|
+
* #595 — REFERENCE CORRIGEE : lisait `var(--origam-font---family, …)`,
|
|
433
|
+
* un nom que AUCUNE feuille ne declare (zero occurrence en partie
|
|
434
|
+
* gauche dans `assets/`). Ce composant retombait donc toujours sur
|
|
435
|
+
* `system-ui` et ignorait la police du DS. Le barreau reel est
|
|
436
|
+
* `--origam-font__family---sans` (primitive.css) = `Inter, 'Helvetica
|
|
437
|
+
* Neue', Arial, sans-serif`. ⚠️ Change le rendu, volontairement. Le
|
|
438
|
+
* repli `system-ui, sans-serif` reste en ceinture de securite si la
|
|
439
|
+
* feuille de primitives n est pas chargee.
|
|
440
|
+
*/
|
|
441
|
+
font-family: var(--origam-font__family---sans, system-ui, sans-serif);
|
|
432
442
|
border-radius: 3px;
|
|
433
443
|
white-space: nowrap;
|
|
434
444
|
pointer-events: none;
|
|
@@ -981,14 +981,67 @@ defineExpose({
|
|
|
981
981
|
position: absolute;
|
|
982
982
|
pointer-events: none;
|
|
983
983
|
bottom: calc(100% + 6px);
|
|
984
|
+
/*
|
|
985
|
+
* ⛔ #595 — FAUX POSITIF de `token-var-channels`, a laisser en
|
|
986
|
+
* baseline. `--origam-slider-field---hover-x` est ECRIT PAR
|
|
987
|
+
* INSTANCE, en style inline, par le `pointermove` de ce meme
|
|
988
|
+
* composant (`container.style.setProperty(...)`, ~l.680) et RETIRE
|
|
989
|
+
* au `pointerleave` (`removeProperty`, ~l.703). Une custom property
|
|
990
|
+
* est substituee SUR L ELEMENT QUI LA DECLARE : la declarer a
|
|
991
|
+
* `:root` ferait que, apres `removeProperty`, l infobulle ne
|
|
992
|
+
* retomberait plus sur le repli `0%` mais sur la valeur de la
|
|
993
|
+
* feuille — l infobulle resterait collee a sa derniere position au
|
|
994
|
+
* lieu de revenir au depart. La garde compare des noms, pas des
|
|
995
|
+
* chaines de repli : elle ne peut pas voir la difference.
|
|
996
|
+
*/
|
|
984
997
|
inset-inline-start: var(--origam-slider-field---hover-x, 0%);
|
|
985
998
|
transform: translateX(-50%);
|
|
986
999
|
padding: 3px 6px;
|
|
987
|
-
|
|
988
|
-
|
|
1000
|
+
/*
|
|
1001
|
+
* #595 — EFFONDREMENT. Ces deux lignes lisaient
|
|
1002
|
+
* `var(RUNG1, var(--origam-color__{surface--inverse---bg,
|
|
1003
|
+
* on--inverse---fg}, T))`. Les deux RUNG1 viennent d etre declares
|
|
1004
|
+
* dans les feuilles — AVEC leur `var()` interne recopie verbatim,
|
|
1005
|
+
* donc le canal `--inverse` reste atteignable PAR LA FEUILLE. Le
|
|
1006
|
+
* garder aussi ici etait du poids mort : RUNG1 etant declare,
|
|
1007
|
+
* l echelon 2 du site de lecture est inatteignable par
|
|
1008
|
+
* construction. Retire : zero pixel deplace, deux canaux morts en
|
|
1009
|
+
* moins.
|
|
1010
|
+
*
|
|
1011
|
+
* ⛔ Et les deux noms de l echelon 2 etaient FAUX. Forme d ETAT
|
|
1012
|
+
* (`--inverse---`) d une famille qui n existe pas : zero
|
|
1013
|
+
* declaration dans tout `assets/`. L infobulle retombait donc
|
|
1014
|
+
* eternellement sur son repli sombre en dur, qui n inversait
|
|
1015
|
+
* JAMAIS. Les vrais noms existaient a cote depuis toujours, et ils
|
|
1016
|
+
* inversent — mesure en Chromium le 2026-09-29, data-theme pilote :
|
|
1017
|
+
*
|
|
1018
|
+
* --origam-color__surface---inverse light #171717 dark #ffffff
|
|
1019
|
+
* --origam-color__text---inverse light #ffffff dark #0a0a0a
|
|
1020
|
+
*
|
|
1021
|
+
* La DECLARATION de chaque RUNG1, dans les quatre feuilles, pointe
|
|
1022
|
+
* maintenant sur eux. C est la que vit la correction : RUNG1 etant
|
|
1023
|
+
* declare, le repli ecrit ici ne serait jamais atteint — corriger
|
|
1024
|
+
* ce fichier seul n aurait rien change.
|
|
1025
|
+
*
|
|
1026
|
+
* ⚠️ Ceci CHANGE le rendu, volontairement : l infobulle inverse
|
|
1027
|
+
* enfin (surface claire + texte sombre en mode sombre). Avant, les
|
|
1028
|
+
* deux tokens rendaient la MEME valeur dans les deux modes.
|
|
1029
|
+
*/
|
|
1030
|
+
background: var(--origam-slider-field__hover-tooltip---background-color, rgba(0, 0, 0, 0.85));
|
|
1031
|
+
color: var(--origam-slider-field__hover-tooltip---color, #ffffff);
|
|
989
1032
|
font-size: 11px;
|
|
990
1033
|
font-weight: 600;
|
|
991
|
-
|
|
1034
|
+
/*
|
|
1035
|
+
* #595 — REFERENCE CORRIGEE : lisait `var(--origam-font---family, …)`,
|
|
1036
|
+
* un nom que AUCUNE feuille ne declare (zero occurrence en partie
|
|
1037
|
+
* gauche dans `assets/`). Ce composant retombait donc toujours sur
|
|
1038
|
+
* `system-ui` et ignorait la police du DS. Le barreau reel est
|
|
1039
|
+
* `--origam-font__family---sans` (primitive.css) = `Inter, 'Helvetica
|
|
1040
|
+
* Neue', Arial, sans-serif`. ⚠️ Change le rendu, volontairement. Le
|
|
1041
|
+
* repli `system-ui, sans-serif` reste en ceinture de securite si la
|
|
1042
|
+
* feuille de primitives n est pas chargee.
|
|
1043
|
+
*/
|
|
1044
|
+
font-family: var(--origam-font__family---sans, system-ui, sans-serif);
|
|
992
1045
|
border-radius: 3px;
|
|
993
1046
|
white-space: nowrap;
|
|
994
1047
|
z-index: 4;
|
|
@@ -1099,6 +1152,22 @@ defineExpose({
|
|
|
1099
1152
|
height: 100%;
|
|
1100
1153
|
display: flex;
|
|
1101
1154
|
justify-content: center;
|
|
1155
|
+
/*
|
|
1156
|
+
* ⛔ #595, trouvaille hors perimetre : le repli `2` est SANS
|
|
1157
|
+
* UNITE. `width: 2` est invalide et `calc(2 + 2px)` aussi — le
|
|
1158
|
+
* navigateur jette la declaration entiere. Tant que
|
|
1159
|
+
* `OrigamSliderFieldTrack` n ecrit pas
|
|
1160
|
+
* `--origam-slider-field-track---size` en inline (il ne le fait
|
|
1161
|
+
* que si la prop `size` est fournie), TOUTES les regles de
|
|
1162
|
+
* largeur du mode vertical sont mortes. Meme famille que la
|
|
1163
|
+
* gouttiere d `OrigamRow` (#568) et que le garde
|
|
1164
|
+
* `unitless-zero-in-calc`.
|
|
1165
|
+
*
|
|
1166
|
+
* Non corrige ici : declarer le token ou unifier le repli a
|
|
1167
|
+
* `2px` REPARERAIT le rendu, donc le changerait — hors du
|
|
1168
|
+
* contrat « zero pixel deplace » de ce lot. Signale sans
|
|
1169
|
+
* ticket (consigne du lot).
|
|
1170
|
+
*/
|
|
1102
1171
|
width: calc(var(--origam-slider-field-track---size, 2) + 2px);
|
|
1103
1172
|
|
|
1104
1173
|
.origam-slider-field-track__background {
|
|
@@ -1334,6 +1403,72 @@ defineExpose({
|
|
|
1334
1403
|
}
|
|
1335
1404
|
}
|
|
1336
1405
|
|
|
1406
|
+
/*
|
|
1407
|
+
* ⛔ #595 — SEIZE tokens `--origam-slider-field*` que les feuilles
|
|
1408
|
+
* declarent et que ce SCSS ne lit pas. Ils restent en baseline
|
|
1409
|
+
* `token-var-channels-dormant.json` ; raison par famille :
|
|
1410
|
+
*
|
|
1411
|
+
* · `__thumb---border-color` (surface---default) — DEUXIEME grammaire
|
|
1412
|
+
* pour la meme propriete. La grammaire VIVANTE est
|
|
1413
|
+
* `--origam-slider-field-thumb__surface---border-color`, lue trois
|
|
1414
|
+
* lignes plus bas, et `packages/marketing/src/themes/ecom.theme.ts`
|
|
1415
|
+
* la surcharge deja (`#e11d48`). Renommer la lecture casserait ce
|
|
1416
|
+
* theme ; c est donc le nom `-thumb__surface-` qui vient d etre
|
|
1417
|
+
* declare, et celui-ci qui reste dormant ;
|
|
1418
|
+
* · `__thumb---border-width` (border__width---2 = 2px) — le pouce livre
|
|
1419
|
+
* `border: 1px solid` ; `__thumb---box-shadow` (shadow---sm) — il
|
|
1420
|
+
* livre `box-shadow: none`. Cabler l un ou l autre change le rendu ;
|
|
1421
|
+
* · `__thumb---focus-ring-color`, `---focus-ring-width`,
|
|
1422
|
+
* `---scale-hover`, `---scale-active` — l anneau et l agrandissement
|
|
1423
|
+
* sont dessines par `&__surface:before` (`transform: scale(2)`,
|
|
1424
|
+
* `opacity: .12/.04`), pas par un anneau dimensionne : aucune
|
|
1425
|
+
* declaration a remplacer ;
|
|
1426
|
+
* · `---opacity-disabled` (opacity---32 = 0.32) — le rendu desactive est
|
|
1427
|
+
* `opacity: 0.38` ;
|
|
1428
|
+
* · `---padding-block` (space---2) — aucune declaration `padding-block`
|
|
1429
|
+
* sur la racine ;
|
|
1430
|
+
* · `---transition-duration` (motion---fast), `---transition-timing-
|
|
1431
|
+
* function` (easing---standard) — les transitions sont des raccourcis
|
|
1432
|
+
* multi-proprietes ecrits en dur (0.15s/0.2s/0.3s/120ms) ;
|
|
1433
|
+
* · les trois `__label---{color,font-size,padding}` — le libelle est
|
|
1434
|
+
* rendu par `OrigamLabel`, qui lit `--origam-label---*` ;
|
|
1435
|
+
* · `__tick---size` (4px) — la taille du tick est ECRITE EN INLINE par
|
|
1436
|
+
* `OrigamSliderFieldTrack` (`convertToUnit(props.tickSize)`) sous le
|
|
1437
|
+
* nom `--origam-slider-field-track__tick---size` : c est une valeur
|
|
1438
|
+
* d instance, pas un canal de theme ;
|
|
1439
|
+
* · `__track---height` (4px) — `.origam-slider-field__track` existe dans
|
|
1440
|
+
* le template mais aucune regle ne lui donne de hauteur ; la hauteur
|
|
1441
|
+
* vivante est celle de `.origam-slider-field-track` (sous-composant).
|
|
1442
|
+
*
|
|
1443
|
+
* ⛔ `--origam-slider-field---track-size` : FAUX POSITIF de la garde, a
|
|
1444
|
+
* laisser en baseline et surtout a NE PAS declarer.
|
|
1445
|
+
*
|
|
1446
|
+
* Il est ECRIT PAR INSTANCE, inconditionnellement, par `sliderFieldStyles`
|
|
1447
|
+
* (~l.1018) : `convertToUnit(trackProps.size ?? 4)`. Ce style inline est
|
|
1448
|
+
* pose sur la RACINE des deux variantes (`<origam-input>` et `<section>`),
|
|
1449
|
+
* donc tout le sous-arbre en herite et les HUIT sites de lecture prennent
|
|
1450
|
+
* cette valeur. Mesure en Chromium le 2026-09-29, trois variants de la
|
|
1451
|
+
* story, bloc `--horizontal` present :
|
|
1452
|
+
*
|
|
1453
|
+
* style inline sur la racine --origam-slider-field---track-size: 4px
|
|
1454
|
+
* token relu sur la racine 4px
|
|
1455
|
+
* token relu sur la piste 4px
|
|
1456
|
+
* hauteur rendue de la piste 4px <- la regle au repli 14px
|
|
1457
|
+
*
|
|
1458
|
+
* ⚠️ Deux consequences, contre-intuitives toutes les deux :
|
|
1459
|
+
*
|
|
1460
|
+
* 1. Les replis `14px` des six lignes du bloc `--horizontal` sont du CODE
|
|
1461
|
+
* MORT : ils ne sont jamais atteints, la piste horizontale mesure 4px.
|
|
1462
|
+
* Il n y a donc PAS « deux camps » a arbitrer — la lecture precedente
|
|
1463
|
+
* de ce commentaire, qui annoncait un arbitrage entre 4px et 14px,
|
|
1464
|
+
* etait fausse : elle comparait des textes de repli sans verifier
|
|
1465
|
+
* lequel s applique.
|
|
1466
|
+
* 2. Le declarer a `:root` serait INERTE : l ecriture inline sur la
|
|
1467
|
+
* racine bat une declaration de feuille pour tout le sous-arbre. Un
|
|
1468
|
+
* theme qui le reglerait ne verrait RIEN changer — on annoncerait un
|
|
1469
|
+
* canal qui ne fonctionne pas. C est exactement le motif que la
|
|
1470
|
+
* campagne interdit de cabler.
|
|
1471
|
+
*/
|
|
1337
1472
|
.origam-slider-field-thumb {
|
|
1338
1473
|
$this: &;
|
|
1339
1474
|
|
|
@@ -271,7 +271,18 @@ defineExpose({
|
|
|
271
271
|
position: absolute;
|
|
272
272
|
opacity: 0;
|
|
273
273
|
transition: 0.2s opacity cubic-bezier(0.4, 0, 0.2, 1);
|
|
274
|
-
|
|
274
|
+
// #595 — remplacement litteral : la valeur livree (`2px`) est
|
|
275
|
+
// desormais lue depuis son token, dont la feuille a ete realignee
|
|
276
|
+
// sur elle (elle annoncait `radius---full`, soit 9999px). Zero
|
|
277
|
+
// pixel deplace, un canal de theme de plus.
|
|
278
|
+
//
|
|
279
|
+
// ⛔ `--origam-slider-field-track__tick---size` juste en dessous
|
|
280
|
+
// reste NON declare a dessein : OrigamSliderFieldTrack l ecrit en
|
|
281
|
+
// style INLINE par instance (`convertToUnit(props.tickSize)`,
|
|
282
|
+
// ligne ~152). Le declarer a `:root` remplacerait le repli par une
|
|
283
|
+
// valeur de feuille des que la prop est absente — un changement de
|
|
284
|
+
// rendu, pas un canal.
|
|
285
|
+
border-radius: var(--origam-slider-field__tick---border-radius, 2px);
|
|
275
286
|
width: var(--origam-slider-field-track__tick---size, 2);
|
|
276
287
|
height: var(--origam-slider-field-track__tick---size, 2);
|
|
277
288
|
transform: translate(calc(var(--origam-slider-field-track__tick---size, 2) / -2), calc(var(--origam-slider-field-track__tick---size, 2) / -2));
|
|
@@ -92,7 +92,7 @@ import OrigamOverlay from "../Overlay/OrigamOverlay.vue";
|
|
|
92
92
|
import OrigamSnack from "../Transition/OrigamSnack.vue";
|
|
93
93
|
import OrigamSnackbarItem from "./OrigamSnackbarItem.vue";
|
|
94
94
|
import { useBothColor } from "../../composables/Commons/bothColor.composable";
|
|
95
|
-
import {
|
|
95
|
+
import { useLayoutMain } from "../../composables/Commons/layout.composable";
|
|
96
96
|
import { usePosition } from "../../composables/Commons/position.composable";
|
|
97
97
|
import { useProps } from "../../composables/Commons/props.composable";
|
|
98
98
|
import { useScopeId } from "../../composables/Commons/scopeId.composable";
|
|
@@ -216,7 +216,7 @@ const mainStyles = ref();
|
|
|
216
216
|
const hasLayout = inject(ORIGAM_LAYOUT_KEY, void 0);
|
|
217
217
|
const timerKey = shallowRef(0);
|
|
218
218
|
useToggleScope(() => !!hasLayout, () => {
|
|
219
|
-
const layout =
|
|
219
|
+
const layout = useLayoutMain();
|
|
220
220
|
watchEffect(() => {
|
|
221
221
|
mainStyles.value = layout.mainStyles.value;
|
|
222
222
|
});
|
|
@@ -571,6 +571,38 @@ defineExpose({
|
|
|
571
571
|
background-color: currentColor;
|
|
572
572
|
}
|
|
573
573
|
|
|
574
|
+
/*
|
|
575
|
+
* ⛔ #595 — DOUZE tokens `--origam-switch__*` que les feuilles declarent
|
|
576
|
+
* et que ce SCSS ne lit PAS. Mesure du 2026-09-27 : dans les douze cas la
|
|
577
|
+
* feuille decrit une intention de design que le SCSS n a jamais
|
|
578
|
+
* implementee, et la cabler DEPLACERAIT le rendu. Ils restent donc en
|
|
579
|
+
* baseline `token-var-channels-dormant.json`, ici est la raison :
|
|
580
|
+
*
|
|
581
|
+
* · `__thumb---background-color-checked` (surface---default) — le pouce
|
|
582
|
+
* coche est peint `currentColor` par les regles `:has()` ci-dessus, pas
|
|
583
|
+
* par un token : la valeur declaree est une AUTRE couleur ;
|
|
584
|
+
* · `__thumb---background-color-disabled` (surface---overlay),
|
|
585
|
+
* `__thumb---box-shadow` (shadow---sm) — aucune declaration
|
|
586
|
+
* correspondante n existe sur le pouce (ni fond desactive, ni ombre) :
|
|
587
|
+
* les ajouter serait ajouter une propriete ABSENTE du rendu, ce que la
|
|
588
|
+
* regle de securite de #550 interdit apres un revert ;
|
|
589
|
+
* · `__thumb---transition-duration` (motion---medium) — la transition du
|
|
590
|
+
* pouce est un raccourci multi-proprietes ecrit en dur a 0.15s/0.2s ;
|
|
591
|
+
* · `__thumb---translate-distance` (20px) — le deplacement est pose en
|
|
592
|
+
* `translateX(±10px)` sur `.origam-selection-control__input`, soit la
|
|
593
|
+
* MOITIE du token. Cabler par le nom exigerait un `calc()` derive ;
|
|
594
|
+
* · `__track---background-color-checked` (action--primary---bg) — le rail
|
|
595
|
+
* coche est peint par `bgColor` / la classe utilitaire, pas par une
|
|
596
|
+
* regle `--dirty` ;
|
|
597
|
+
* · `__input---opacity` (0) — aucune classe `.origam-switch__input` :
|
|
598
|
+
* l input natif appartient a `OrigamSelectionControl` ;
|
|
599
|
+
* · les cinq `__label---*` (color, color-disabled, color-error,
|
|
600
|
+
* font-size, padding-inline) — le libelle est rendu par `OrigamLabel`,
|
|
601
|
+
* qui lit `--origam-label---*`. La seule regle que Switch pose sur lui
|
|
602
|
+
* est `padding-inline-start: 10px`, quand le token vaut `space---2`
|
|
603
|
+
* (8px) : cabler decalerait chaque libelle de 2px, et le nom
|
|
604
|
+
* `padding-inline` mentirait sur une regle qui ne touche que `-start`.
|
|
605
|
+
*/
|
|
574
606
|
&__thumb {
|
|
575
607
|
align-items: center;
|
|
576
608
|
background-color: var(--origam-switch__thumb---background-color, rgb(255, 255, 255));
|
|
@@ -487,7 +487,9 @@ const enrichedRules = computed(() => {
|
|
|
487
487
|
}
|
|
488
488
|
return base;
|
|
489
489
|
});
|
|
490
|
-
const
|
|
490
|
+
const filteredAttrs = computed(() => filterInputAttrs(attrs));
|
|
491
|
+
const rootAttrs = computed(() => filteredAttrs.value[0]);
|
|
492
|
+
const inputAttrs = computed(() => filteredAttrs.value[1]);
|
|
491
493
|
const inputProps = computed(() => {
|
|
492
494
|
return origamInputRef.value?.filterProps(props, ["modelValue", "class", "style", "focused", ...BORDER_PROP_KEYS]);
|
|
493
495
|
});
|
|
@@ -956,7 +956,17 @@ defineExpose({
|
|
|
956
956
|
.origam-video__skip-ripple-label {
|
|
957
957
|
font-size: 13px;
|
|
958
958
|
font-weight: 600;
|
|
959
|
-
|
|
959
|
+
/*
|
|
960
|
+
* #595 — REFERENCE CORRIGEE : lisait `var(--origam-font---family, …)`,
|
|
961
|
+
* un nom que AUCUNE feuille ne declare (zero occurrence en partie
|
|
962
|
+
* gauche dans `assets/`). Ce composant retombait donc toujours sur
|
|
963
|
+
* `system-ui` et ignorait la police du DS. Le barreau reel est
|
|
964
|
+
* `--origam-font__family---sans` (primitive.css) = `Inter, 'Helvetica
|
|
965
|
+
* Neue', Arial, sans-serif`. ⚠️ Change le rendu, volontairement. Le
|
|
966
|
+
* repli `system-ui, sans-serif` reste en ceinture de securite si la
|
|
967
|
+
* feuille de primitives n est pas chargee.
|
|
968
|
+
*/
|
|
969
|
+
font-family: var(--origam-font__family---sans, system-ui, sans-serif);
|
|
960
970
|
letter-spacing: 0.02em;
|
|
961
971
|
white-space: nowrap;
|
|
962
972
|
user-select: none;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useBackdrop = useBackdrop;
|
|
7
|
+
var _vue = require("vue");
|
|
8
|
+
var _backdrop = require("../../consts/Commons/backdrop.const.cjs");
|
|
9
|
+
function resolveBackdropBlur(value) {
|
|
10
|
+
if (value == null || value === false || value === "") return null;
|
|
11
|
+
if (value === true) {
|
|
12
|
+
return {
|
|
13
|
+
rung: _backdrop.BACKDROP_BLUR_DEFAULT_RUNG,
|
|
14
|
+
length: _backdrop.BACKDROP_BLUR_RUNG_VARS[_backdrop.BACKDROP_BLUR_DEFAULT_RUNG]
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
if (typeof value === "number") return {
|
|
18
|
+
rung: null,
|
|
19
|
+
length: `${value}px`
|
|
20
|
+
};
|
|
21
|
+
const key = String(value).trim();
|
|
22
|
+
const rungVar = _backdrop.BACKDROP_BLUR_RUNG_VARS[key];
|
|
23
|
+
if (rungVar) return {
|
|
24
|
+
rung: key,
|
|
25
|
+
length: rungVar
|
|
26
|
+
};
|
|
27
|
+
return {
|
|
28
|
+
rung: null,
|
|
29
|
+
length: key
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function useBackdrop(props) {
|
|
33
|
+
const resolved = (0, _vue.computed)(() => {
|
|
34
|
+
return resolveBackdropBlur((0, _vue.isRef)(props) ? props.value : props.backdropBlur);
|
|
35
|
+
});
|
|
36
|
+
const backdropClasses = (0, _vue.computed)(() => {
|
|
37
|
+
const rung = resolved.value?.rung;
|
|
38
|
+
return rung ? [`${_backdrop.BACKDROP_UTILITY_CLASS_PREFIX}${rung}`] : [];
|
|
39
|
+
});
|
|
40
|
+
const backdropStyles = (0, _vue.computed)(() => {
|
|
41
|
+
const current = resolved.value;
|
|
42
|
+
if (!current) return [];
|
|
43
|
+
const filter = `blur(${current.length})`;
|
|
44
|
+
return [`backdrop-filter: ${filter}`, `-webkit-backdrop-filter: ${filter}`];
|
|
45
|
+
});
|
|
46
|
+
return {
|
|
47
|
+
backdropClasses,
|
|
48
|
+
backdropStyles
|
|
49
|
+
};
|
|
50
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import type { IBackdropProps } from '../../interfaces/Commons/backdrop.interface';
|
|
3
|
+
import { TBackdropBlur } from '../../types/Commons/backdrop.type';
|
|
4
|
+
/*********************************************************
|
|
5
|
+
* useBackdrop
|
|
6
|
+
*
|
|
7
|
+
* @description
|
|
8
|
+
* Translates the `backdropBlur` prop into `backdropClasses` (the global
|
|
9
|
+
* utility class, when the value lands on a token rung) AND
|
|
10
|
+
* `backdropStyles` (always a `backdrop-filter` pair). Both channels are
|
|
11
|
+
* emitted in PARALLEL — strategy A, same contract as `useElevation`.
|
|
12
|
+
*
|
|
13
|
+
* @description
|
|
14
|
+
* The `-webkit-` prefixed twin is emitted alongside the standard property
|
|
15
|
+
* on every path: Safari still ships `backdrop-filter` prefixed only, and
|
|
16
|
+
* every one of the 12 components already painting glass in this DS writes
|
|
17
|
+
* the pair. Dropping it would make the prop a no-op on Safari while
|
|
18
|
+
* looking correct everywhere the author tests.
|
|
19
|
+
*
|
|
20
|
+
* @description
|
|
21
|
+
* No `@supports` gate, and that is not an oversight. An unsupported
|
|
22
|
+
* browser drops an unknown declaration by itself, so the gate would buy
|
|
23
|
+
* nothing here — and an inline style cannot carry one anyway. The
|
|
24
|
+
* `@supports not (backdrop-filter: ...)` blocks that exist in the DS
|
|
25
|
+
* today thicken the BACKGROUND COLOUR when blur is unavailable, which is
|
|
26
|
+
* a `bgColor` decision belonging to whoever writes the preset, not to
|
|
27
|
+
* this composable.
|
|
28
|
+
********************************************************/
|
|
29
|
+
export declare function useBackdrop(props: IBackdropProps | Ref<TBackdropBlur | undefined>): {
|
|
30
|
+
backdropClasses: import("vue").ComputedRef<string[]>;
|
|
31
|
+
backdropStyles: import("vue").ComputedRef<string[]>;
|
|
32
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { computed, isRef } from "vue";
|
|
2
|
+
import {
|
|
3
|
+
BACKDROP_BLUR_DEFAULT_RUNG,
|
|
4
|
+
BACKDROP_BLUR_RUNG_VARS,
|
|
5
|
+
BACKDROP_UTILITY_CLASS_PREFIX
|
|
6
|
+
} from "../../consts/Commons/backdrop.const.js";
|
|
7
|
+
function resolveBackdropBlur(value) {
|
|
8
|
+
if (value == null || value === false || value === "") return null;
|
|
9
|
+
if (value === true) {
|
|
10
|
+
return { rung: BACKDROP_BLUR_DEFAULT_RUNG, length: BACKDROP_BLUR_RUNG_VARS[BACKDROP_BLUR_DEFAULT_RUNG] };
|
|
11
|
+
}
|
|
12
|
+
if (typeof value === "number") return { rung: null, length: `${value}px` };
|
|
13
|
+
const key = String(value).trim();
|
|
14
|
+
const rungVar = BACKDROP_BLUR_RUNG_VARS[key];
|
|
15
|
+
if (rungVar) return { rung: key, length: rungVar };
|
|
16
|
+
return { rung: null, length: key };
|
|
17
|
+
}
|
|
18
|
+
export function useBackdrop(props) {
|
|
19
|
+
const resolved = computed(() => {
|
|
20
|
+
return resolveBackdropBlur(isRef(props) ? props.value : props.backdropBlur);
|
|
21
|
+
});
|
|
22
|
+
const backdropClasses = computed(() => {
|
|
23
|
+
const rung = resolved.value?.rung;
|
|
24
|
+
return rung ? [`${BACKDROP_UTILITY_CLASS_PREFIX}${rung}`] : [];
|
|
25
|
+
});
|
|
26
|
+
const backdropStyles = computed(() => {
|
|
27
|
+
const current = resolved.value;
|
|
28
|
+
if (!current) return [];
|
|
29
|
+
const filter = `blur(${current.length})`;
|
|
30
|
+
return [`backdrop-filter: ${filter}`, `-webkit-backdrop-filter: ${filter}`];
|
|
31
|
+
});
|
|
32
|
+
return { backdropClasses, backdropStyles };
|
|
33
|
+
}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.useLayoutMain = useLayoutMain;
|
|
7
7
|
var _vue = require("vue");
|
|
8
8
|
var _layout = require("../../consts/Commons/layout.const.cjs");
|
|
9
|
-
function
|
|
9
|
+
function useLayoutMain() {
|
|
10
10
|
const layout = (0, _vue.inject)(_layout.ORIGAM_LAYOUT_KEY);
|
|
11
11
|
if (!layout) {
|
|
12
12
|
throw new Error("[Origam] Could not find injected layout");
|