@hgdc/ui 0.37.0 → 0.39.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/styles.css CHANGED
@@ -838,20 +838,58 @@
838
838
  :root:not(:has([data-slot="app-shell"])) [data-slot="family-loader-root"] > [data-frame] {
839
839
  display: block;
840
840
  }
841
+ /* Sur ordinateur, le cadre est la coque elle-même (`ShellFrame`) : barre des produits complète,
842
+ marque du produit, navigation en squelette, carte du contenu (ADR 0020). */
841
843
  @media (width >= 64rem) {
842
844
  [data-slot="family-loader-root"] > [data-frame] {
843
- background:
844
- linear-gradient(var(--shell-rail), var(--shell-rail)) left / var(--hgdc-rail-w) 100% no-repeat,
845
- var(--shell);
846
- }
847
- [data-slot="family-loader-root"] > [data-frame]::after {
848
- content: "";
849
- position: absolute;
850
- inset: 0.5rem 0.5rem 0.5rem var(--hgdc-content-left);
851
- border-radius: var(--radius-xl);
852
- background: var(--background);
845
+ background: var(--shell);
853
846
  }
854
847
  }
848
+ /* La marque du produit de l'adresse (`<html data-hgdc-product>`, `sidebarInitScript`), seule ; le
849
+ produit courant marqué dans la barre, comme `aria-current` dans la coque. */
850
+ [data-slot="shell-frame"] [data-product] {
851
+ display: none;
852
+ }
853
+ [data-slot="shell-frame-rail"] [data-product] {
854
+ display: flex;
855
+ }
856
+ :root[data-hgdc-product="account"] [data-slot="shell-frame"] [data-product="account"],
857
+ :root[data-hgdc-product="host"] [data-slot="shell-frame"] [data-product="host"],
858
+ :root[data-hgdc-product="mail"] [data-slot="shell-frame"] [data-product="mail"],
859
+ :root[data-hgdc-product="portal"] [data-slot="shell-frame"] [data-product="portal"],
860
+ :root[data-hgdc-product="status"] [data-slot="shell-frame"] [data-product="status"],
861
+ :root[data-hgdc-product="analytics"] [data-slot="shell-frame"] [data-product="analytics"],
862
+ :root[data-hgdc-product="docs"] [data-slot="shell-frame"] [data-product="docs"] {
863
+ display: contents;
864
+ }
865
+ :root[data-hgdc-product="account"] [data-slot="shell-frame-rail"] [data-product="account"],
866
+ :root[data-hgdc-product="host"] [data-slot="shell-frame-rail"] [data-product="host"],
867
+ :root[data-hgdc-product="mail"] [data-slot="shell-frame-rail"] [data-product="mail"],
868
+ :root[data-hgdc-product="portal"] [data-slot="shell-frame-rail"] [data-product="portal"],
869
+ :root[data-hgdc-product="status"] [data-slot="shell-frame-rail"] [data-product="status"],
870
+ :root[data-hgdc-product="analytics"] [data-slot="shell-frame-rail"] [data-product="analytics"],
871
+ :root[data-hgdc-product="docs"] [data-slot="shell-frame-rail"] [data-product="docs"] {
872
+ display: flex;
873
+ background: var(--shell-active);
874
+ color: var(--shell-foreground);
875
+ }
876
+ /* Navigation en squelette, à la hauteur retenue pour ce produit (`--hgdc-nav-height`). */
877
+ [data-slot="shell-frame-nav"] {
878
+ max-height: var(--hgdc-nav-height, 7.5rem);
879
+ }
880
+
881
+ /* La place de l'organisation (`OrgPlaceholder`) : la marque retenue (`<html data-hgdc-org>`,
882
+ initiales ou logo), comme `OrgMark` ; sinon un carré de squelette de la même taille. */
883
+ [data-slot="org-placeholder-mark"] {
884
+ background: var(--shell-hover);
885
+ }
886
+ :root[data-hgdc-org] [data-slot="org-placeholder-mark"] {
887
+ background: var(--hgdc-org-logo, var(--foreground)) center / cover no-repeat;
888
+ color: var(--background);
889
+ }
890
+ :root[data-hgdc-org] [data-slot="org-placeholder-mark"]::before {
891
+ content: var(--hgdc-org-initials, "");
892
+ }
855
893
 
856
894
  /* Calque de la zone de contenu (`AppShell`) : opaque, au-dessus de l'ancienne page, sous le H du
857
895
  document. Mêmes conditions et même rythme que le H : ils apparaissent et s'effacent ensemble. */
@@ -870,3 +908,102 @@
870
908
  opacity 150ms var(--ease-out),
871
909
  visibility 0s;
872
910
  }
911
+
912
+ /* Passage d'un produit à l'autre sous la même origine (`app.hgdc.ch/<produit>`, ADR 0020) : une
913
+ transition de vue entre documents. La barre des produits, la barre latérale et la barre du haut
914
+ gardent leur place (même nom des deux côtés : elles ne bougent pas, leur contenu passe en
915
+ fondu) ; le reste de la page passe en fondu court. Le navigateur garde l'ancienne page à l'écran
916
+ jusqu'à ce que la nouvelle soit prête : pas de page blanche. Chrome, Edge et Safari 18.2+ ;
917
+ ailleurs, une navigation ordinaire. Entre deux origines (un produit encore sur son sous-domaine)
918
+ ou derrière une redirection vers Account, le navigateur n'en fait pas. Mouvement réduit : aucune
919
+ transition. */
920
+ @media (prefers-reduced-motion: no-preference) {
921
+ @view-transition {
922
+ navigation: auto;
923
+ }
924
+ }
925
+ [data-slot="product-rail"] {
926
+ view-transition-name: hgdc-product-rail;
927
+ }
928
+ [data-slot="app-shell-sidebar"] {
929
+ view-transition-name: hgdc-sidebar;
930
+ }
931
+ [data-slot="app-shell-header"] {
932
+ view-transition-name: hgdc-header;
933
+ }
934
+ /* Le cadre du chargeur (hors de la coque) et le H lui-même portent les mêmes noms, seulement quand
935
+ ils sont à l'écran : mêmes conditions que l'affichage du chargeur, plus haut. */
936
+ :root:has([data-slot="page-pending"]):not(:has([data-slot="app-shell"])) {
937
+ & [data-slot="shell-frame-rail"] {
938
+ view-transition-name: hgdc-product-rail;
939
+ }
940
+ & [data-slot="shell-frame-sidebar"] {
941
+ view-transition-name: hgdc-sidebar;
942
+ }
943
+ & [data-slot="shell-frame-header"] {
944
+ view-transition-name: hgdc-header;
945
+ }
946
+ }
947
+ :root:has([data-slot="page-pending"]):not(:has([data-slot="app-shell"])),
948
+ :root:has([data-slot="app-shell"][data-loading]),
949
+ :root:has([data-slot="app-shell"]:not([data-hydrated]) [data-slot="page-pending"]) {
950
+ & [data-slot="family-loader-root"] > [data-stage] {
951
+ view-transition-name: hgdc-loader;
952
+ }
953
+ }
954
+ /* Un clic dans la barre des produits : la barre se replie et la barre latérale revient d'un coup,
955
+ pour que l'image de départ soit déjà celle de l'arrivée (`ProductRail`). */
956
+ :root[data-hgdc-switching] [data-slot="product-rail"],
957
+ :root[data-hgdc-switching] [data-slot="app-shell-sidebar"] {
958
+ transition: none;
959
+ }
960
+ ::view-transition-old(root),
961
+ ::view-transition-new(root) {
962
+ animation-duration: var(--duration-fast);
963
+ animation-timing-function: var(--ease-out);
964
+ }
965
+ /* Barre latérale et barre du haut : à la même place des deux côtés, leur contenu (un autre
966
+ produit) passe en fondu en place. */
967
+ ::view-transition-group(hgdc-sidebar),
968
+ ::view-transition-group(hgdc-header),
969
+ ::view-transition-old(hgdc-sidebar),
970
+ ::view-transition-new(hgdc-sidebar),
971
+ ::view-transition-old(hgdc-header),
972
+ ::view-transition-new(hgdc-header) {
973
+ animation-duration: var(--duration-base);
974
+ animation-timing-function: var(--ease-ios);
975
+ }
976
+ /* Barre des produits et H : identiques des deux côtés (la barre ne change que d'indicateur, le H
977
+ est à la même phase, calé sur l'horloge). Ni fondu ni mouvement : l'ancienne image est masquée,
978
+ la nouvelle, vivante, s'affiche telle quelle. Présents d'un seul côté (une page sans coque,
979
+ une page prête sans H), ils apparaissent ou s'effacent en fondu court. */
980
+ ::view-transition-group(hgdc-product-rail),
981
+ ::view-transition-group(hgdc-loader),
982
+ ::view-transition-new(hgdc-product-rail),
983
+ ::view-transition-new(hgdc-loader) {
984
+ animation: none;
985
+ }
986
+ ::view-transition-old(hgdc-product-rail),
987
+ ::view-transition-old(hgdc-loader) {
988
+ animation: none;
989
+ opacity: 0;
990
+ }
991
+ ::view-transition-old(hgdc-product-rail):only-child,
992
+ ::view-transition-old(hgdc-loader):only-child {
993
+ opacity: 1;
994
+ animation: hgdc-view-out var(--duration-fast) var(--ease-out) both;
995
+ }
996
+ ::view-transition-new(hgdc-product-rail):only-child,
997
+ ::view-transition-new(hgdc-loader):only-child {
998
+ animation: hgdc-view-in var(--duration-fast) var(--ease-out) both;
999
+ }
1000
+ @keyframes hgdc-view-out {
1001
+ to {
1002
+ opacity: 0;
1003
+ }
1004
+ }
1005
+ @keyframes hgdc-view-in {
1006
+ from {
1007
+ opacity: 0;
1008
+ }
1009
+ }