@entur/menu 7.4.0 → 7.5.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.
@@ -63,6 +63,70 @@
63
63
  --components-menu-sidenavigationbeta-contrast-stroke-active:#e3e6e8;
64
64
  --components-menu-sidenavigationbeta-contrast-stroke-submenu-indicator-default:#81828f;
65
65
  --components-menu-sidenavigationbeta-contrast-alert:#ff9494;
66
+ }
67
+
68
+ [data-view-mode=standard],
69
+ :root{
70
+ --spacing-2xs:0.25rem;
71
+ --spacing-xs:0.5rem;
72
+ --spacing-s:0.75rem;
73
+ --spacing-m:1rem;
74
+ --spacing-lg:1.25rem;
75
+ --spacing-xl:1.5rem;
76
+ --spacing-2xl:1.75rem;
77
+ --spacing-3xl:2rem;
78
+ --spacing-4xl:2.25rem;
79
+ --spacing-5xl:2.5rem;
80
+ --spacing-6xl:3rem;
81
+ --spacing-7xl:3.25rem;
82
+ --spacing-8xl:3.5rem;
83
+ --spacing-9xl:4rem;
84
+ --spacing-10xl:4.5rem;
85
+ --spacing-11xl:5rem;
86
+ --spacing-12xl:5.5rem;
87
+ --spacing-13xl:6rem;
88
+ }
89
+
90
+ [data-view-mode=compact]{
91
+ --spacing-2xs:0.125rem;
92
+ --spacing-xs:0.25rem;
93
+ --spacing-s:0.5rem;
94
+ --spacing-m:0.75rem;
95
+ --spacing-lg:1rem;
96
+ --spacing-xl:1.25rem;
97
+ --spacing-2xl:1.5rem;
98
+ --spacing-3xl:1.75rem;
99
+ --spacing-4xl:2rem;
100
+ --spacing-5xl:2.25rem;
101
+ --spacing-6xl:2.5rem;
102
+ --spacing-7xl:3rem;
103
+ --spacing-8xl:3.25rem;
104
+ --spacing-9xl:3.5rem;
105
+ --spacing-10xl:4rem;
106
+ --spacing-11xl:4.5rem;
107
+ --spacing-12xl:5rem;
108
+ --spacing-13xl:5.5rem;
109
+ }
110
+
111
+ [data-view-mode=display]{
112
+ --spacing-2xs:0.5rem;
113
+ --spacing-xs:1rem;
114
+ --spacing-s:1.5rem;
115
+ --spacing-m:1.75rem;
116
+ --spacing-lg:2.25rem;
117
+ --spacing-xl:2.75rem;
118
+ --spacing-2xl:3.5rem;
119
+ --spacing-3xl:4rem;
120
+ --spacing-4xl:4.5rem;
121
+ --spacing-5xl:5rem;
122
+ --spacing-6xl:6rem;
123
+ --spacing-7xl:6.5rem;
124
+ --spacing-8xl:7rem;
125
+ --spacing-9xl:8rem;
126
+ --spacing-10xl:8.5rem;
127
+ --spacing-11xl:9rem;
128
+ --spacing-12xl:9.5rem;
129
+ --spacing-13xl:10rem;
66
130
  }.eds-side-navigation-beta{
67
131
  --eds-side-navigation-beta-fill-default:var(--components-menu-sidenavigationbeta-standard-fill-default);
68
132
  --eds-side-navigation-beta-fill-hover:var(--components-menu-sidenavigationbeta-standard-fill-hover);
@@ -356,4 +420,213 @@
356
420
  -moz-transform:rotate(-180deg);
357
421
  -o-transform:rotate(-180deg);
358
422
  transform:rotate(-180deg);
423
+ }.eds-footer{
424
+ --eds-footer-text:var(--basecolors-text-accent);
425
+ --eds-footer-text-subdued:var(--basecolors-text-subdued);
426
+ --eds-footer-divider:var(--basecolors-stroke-subduedalt);
427
+ container:eds-footer/inline-size;
428
+ -webkit-box-sizing:border-box;
429
+ -moz-box-sizing:border-box;
430
+ box-sizing:border-box;
431
+ width:100%;
432
+ background-color:var(--basecolors-frame-tint);
433
+ color:var(--eds-footer-text);
434
+ }
435
+ .eds-footer--contrast, :where(.eds-contrast) .eds-footer{
436
+ --eds-footer-text:var(--basecolors-text-light);
437
+ --eds-footer-text-subdued:var(--basecolors-text-subduedalt);
438
+ --eds-footer-divider:var(--basecolors-stroke-subdued);
439
+ background-color:var(--basecolors-frame-contrast);
440
+ }
441
+ .eds-footer__inner{
442
+ -webkit-box-sizing:content-box;
443
+ -moz-box-sizing:content-box;
444
+ box-sizing:content-box;
445
+ max-inline-size:none;
446
+ max-inline-size:var(--eds-footer-max-width, none);
447
+ margin-inline:auto;
448
+ padding:var(--spacing-6xl) var(--eds-footer-padding-inline, var(--spacing-xl)) var(--spacing-m);
449
+ }
450
+ @container eds-footer (width >= 800px){
451
+ .eds-footer__inner{
452
+ -webkit-padding-before:var(--spacing-9xl);
453
+ padding-block-start:var(--spacing-9xl);
454
+ padding-inline:var(--eds-footer-padding-inline, var(--spacing-11xl));
455
+ }
456
+ }
457
+ .eds-footer__inner--subfooter-only{
458
+ -webkit-padding-before:var(--spacing-m);
459
+ padding-block-start:var(--spacing-m);
460
+ }
461
+ .eds-footer__content{
462
+ display:grid;
463
+ grid-template-columns:minmax(0, 1fr);
464
+ grid-gap:var(--spacing-3xl) var(--spacing-xl);
465
+ gap:var(--spacing-3xl) var(--spacing-xl);
466
+ word-wrap:break-word;
467
+ }
468
+ @container eds-footer (width >= 800px){
469
+ .eds-footer__content{
470
+ grid-template-columns:repeat(2, minmax(0, 1fr));
471
+ }
472
+ }
473
+ @container eds-footer (width >= 1200px){
474
+ .eds-footer__content{
475
+ grid-template-columns:1fr repeat(3, minmax(0, 1fr));
476
+ grid-auto-flow:column;
477
+ grid-auto-columns:minmax(0, 1fr);
478
+ }
479
+ }
480
+ .eds-footer__brand{
481
+ display:-webkit-box;
482
+ display:-webkit-flex;
483
+ display:-moz-box;
484
+ display:flex;
485
+ -webkit-box-orient:vertical;
486
+ -webkit-box-direction:normal;
487
+ -webkit-flex-direction:column;
488
+ -moz-box-orient:vertical;
489
+ -moz-box-direction:normal;
490
+ flex-direction:column;
491
+ -webkit-box-align:start;
492
+ -webkit-align-items:flex-start;
493
+ -moz-box-align:start;
494
+ align-items:flex-start;
495
+ gap:var(--spacing-m);
496
+ max-width:24rem;
497
+ font-size:var(--font-size-body-m);
498
+ line-height:var(--font-line-height-body-m);
499
+ font-weight:var(--font-weight-body);
500
+ }
501
+ @container eds-footer (800px <= width < 1200px){
502
+ .eds-footer__brand{
503
+ grid-column:1/-1;
504
+ }
505
+ }
506
+ @container eds-footer (width >= 1200px){
507
+ .eds-footer__brand{
508
+ -webkit-margin-end:-webkit-calc(var(--spacing-10xl) - var(--spacing-xl));
509
+ -moz-margin-end:-moz-calc(var(--spacing-10xl) - var(--spacing-xl));
510
+ margin-inline-end:calc(var(--spacing-10xl) - var(--spacing-xl));
511
+ }
512
+ }
513
+ :where(.eds-footer__brand) > :where(*){
514
+ margin:0;
515
+ font-style:normal;
516
+ }
517
+ .eds-footer__link-group{
518
+ display:-webkit-box;
519
+ display:-webkit-flex;
520
+ display:-moz-box;
521
+ display:flex;
522
+ -webkit-box-orient:vertical;
523
+ -webkit-box-direction:normal;
524
+ -webkit-flex-direction:column;
525
+ -moz-box-orient:vertical;
526
+ -moz-box-direction:normal;
527
+ flex-direction:column;
528
+ gap:var(--spacing-xs);
529
+ }
530
+ .eds-footer__heading{
531
+ margin:0;
532
+ font-size:var(--font-size-heading-m);
533
+ line-height:var(--font-line-height-heading-m);
534
+ font-weight:var(--font-weight-heading);
535
+ }
536
+ .eds-footer__links{
537
+ display:-webkit-box;
538
+ display:-webkit-flex;
539
+ display:-moz-box;
540
+ display:flex;
541
+ -webkit-box-orient:vertical;
542
+ -webkit-box-direction:normal;
543
+ -webkit-flex-direction:column;
544
+ -moz-box-orient:vertical;
545
+ -moz-box-direction:normal;
546
+ flex-direction:column;
547
+ -webkit-box-align:start;
548
+ -webkit-align-items:flex-start;
549
+ -moz-box-align:start;
550
+ align-items:flex-start;
551
+ gap:var(--spacing-xs);
552
+ margin:0;
553
+ padding:0;
554
+ list-style:none;
555
+ }
556
+ .eds-footer__subfooter{
557
+ display:-webkit-box;
558
+ display:-webkit-flex;
559
+ display:-moz-box;
560
+ display:flex;
561
+ -webkit-flex-wrap:wrap;
562
+ flex-wrap:wrap;
563
+ -webkit-box-align:center;
564
+ -webkit-align-items:center;
565
+ -moz-box-align:center;
566
+ align-items:center;
567
+ -webkit-box-pack:justify;
568
+ -webkit-justify-content:space-between;
569
+ -moz-box-pack:justify;
570
+ justify-content:space-between;
571
+ gap:var(--spacing-m);
572
+ -webkit-margin-before:var(--spacing-3xl);
573
+ margin-block-start:var(--spacing-3xl);
574
+ -webkit-padding-before:var(--spacing-m);
575
+ padding-block-start:var(--spacing-m);
576
+ -webkit-border-before:1px solid var(--eds-footer-divider);
577
+ border-block-start:1px solid var(--eds-footer-divider);
578
+ color:var(--eds-footer-text-subdued);
579
+ font-size:var(--font-size-body-s);
580
+ line-height:var(--font-line-height-body-s);
581
+ }
582
+ @container eds-footer (width >= 800px){
583
+ .eds-footer__subfooter{
584
+ -webkit-margin-before:var(--spacing-5xl);
585
+ margin-block-start:var(--spacing-5xl);
586
+ }
587
+ }
588
+ :where(.eds-footer__inner--subfooter-only) > .eds-footer__subfooter{
589
+ -webkit-margin-before:0;
590
+ margin-block-start:0;
591
+ -webkit-padding-before:0;
592
+ padding-block-start:0;
593
+ -webkit-border-before:none;
594
+ border-block-start:none;
595
+ }
596
+ .eds-footer__legal{
597
+ display:-webkit-box;
598
+ display:-webkit-flex;
599
+ display:-moz-box;
600
+ display:flex;
601
+ -webkit-box-align:center;
602
+ -webkit-align-items:center;
603
+ -moz-box-align:center;
604
+ align-items:center;
605
+ margin:0;
606
+ }
607
+ .eds-footer__legal > :where(:not(:last-child)){
608
+ -webkit-margin-end:var(--spacing-xs);
609
+ -moz-margin-end:var(--spacing-xs);
610
+ margin-inline-end:var(--spacing-xs);
611
+ -webkit-padding-end:var(--spacing-xs);
612
+ -moz-padding-end:var(--spacing-xs);
613
+ padding-inline-end:var(--spacing-xs);
614
+ -webkit-border-end:1px solid var(--eds-footer-divider);
615
+ -moz-border-end:1px solid var(--eds-footer-divider);
616
+ border-inline-end:1px solid var(--eds-footer-divider);
617
+ }
618
+ .eds-footer__social{
619
+ display:-webkit-box;
620
+ display:-webkit-flex;
621
+ display:-moz-box;
622
+ display:flex;
623
+ gap:var(--spacing-m);
624
+ margin:0 -webkit-calc(-1 * var(--spacing-2xs));
625
+ margin:0 -moz-calc(-1 * var(--spacing-2xs));
626
+ margin:0 calc(-1 * var(--spacing-2xs));
627
+ padding:0;
628
+ list-style:none;
629
+ }
630
+ .eds-footer__subfooter-link{
631
+ color:inherit;
359
632
  }
@@ -0,0 +1,54 @@
1
+ import { default as React } from 'react';
2
+ export type FooterOwnProps = {
3
+ /** Bruker kontrastvarianten. Velg variant etter produktets visuelle uttrykk.
4
+ * Inne i en `Contrast`-wrapper er footeren alltid kontrast.
5
+ * @default false
6
+ */
7
+ contrast?: boolean;
8
+ /** Viser Enturs sosiale medier i subfooteren. Bruk det bare i tjenester for reisende og andre privatpersoner (B2C).
9
+ * @default false
10
+ */
11
+ showSocialMedia?: boolean;
12
+ /** Tilgjengelig navn på listen med sosiale medier
13
+ * @default "Entur i sosiale medier"
14
+ */
15
+ socialMediaLabel?: string;
16
+ /** `Footer.Brand` og en eller flere `Footer.LinkGroup`. Uten innhold vises bare subfooteren. */
17
+ children?: React.ReactNode;
18
+ className?: string;
19
+ style?: React.CSSProperties;
20
+ };
21
+ export type FooterBrandOwnProps = {
22
+ /** Produktnavnet som vises etter Entur-logoen (f.eks. "Tavla", "Partner") */
23
+ productName?: string;
24
+ /** Tekst under logoen, for eksempel en kort beskrivelse, adresse eller organisasjonsnummer.
25
+ * Ren tekst og elementer får riktig typografi. Hvert element blir en egen linje.
26
+ */
27
+ children?: React.ReactNode;
28
+ className?: string;
29
+ style?: React.CSSProperties;
30
+ };
31
+ export type FooterLinkGroupOwnProps = {
32
+ /** Overskrift for lenkegruppen. Brukes også som navn på navigasjonen. */
33
+ title: React.ReactNode;
34
+ /** Lenkene i gruppen. Hvert element blir et punkt i en liste. */
35
+ children?: React.ReactNode;
36
+ className?: string;
37
+ style?: React.CSSProperties;
38
+ };
39
+ export type FooterProps = FooterOwnProps & Omit<React.ComponentPropsWithoutRef<'footer'>, keyof FooterOwnProps>;
40
+ export type FooterBrandProps = FooterBrandOwnProps & Omit<React.ComponentPropsWithoutRef<'div'>, keyof FooterBrandOwnProps>;
41
+ export type FooterLinkGroupProps = FooterLinkGroupOwnProps & Omit<React.ComponentPropsWithoutRef<'nav'>, keyof FooterLinkGroupOwnProps>;
42
+ declare const FooterRoot: React.ForwardRefExoticComponent<FooterOwnProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref">, keyof FooterOwnProps> & React.RefAttributes<HTMLElement>>;
43
+ export declare const FooterBrand: React.ForwardRefExoticComponent<FooterBrandOwnProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, keyof FooterBrandOwnProps> & React.RefAttributes<HTMLDivElement>>;
44
+ export declare const FooterLinkGroup: React.ForwardRefExoticComponent<FooterLinkGroupOwnProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref">, keyof FooterLinkGroupOwnProps> & React.RefAttributes<HTMLElement>>;
45
+ export type FooterComponent = typeof FooterRoot & {
46
+ Brand: typeof FooterBrand;
47
+ LinkGroup: typeof FooterLinkGroup;
48
+ };
49
+ /**
50
+ * Footer for Entur-produkter. Subfooteren med copyright og lenke til entur.no er lik
51
+ * i alle produkter og kan ikke endres.
52
+ */
53
+ export declare const Footer: FooterComponent;
54
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Footer } from './Footer';
2
+ export type { FooterComponent, FooterProps, FooterOwnProps, FooterBrandProps, FooterBrandOwnProps, FooterLinkGroupProps, FooterLinkGroupOwnProps, } from './Footer';
@@ -1,2 +1,4 @@
1
1
  export { SideNavigation } from './SideNavigation';
2
+ export { Footer } from './Footer';
2
3
  export type { SideNavigationComponent, SideNavigationProps, SideNavigationItemProps, SideNavigationItemOwnProps, SideNavigationGroupProps, SideNavigationExpandableItemProps, } from './SideNavigation';
4
+ export type { FooterComponent, FooterProps, FooterOwnProps, FooterBrandProps, FooterBrandOwnProps, FooterLinkGroupProps, FooterLinkGroupOwnProps, } from './Footer';
package/dist/menu.cjs CHANGED
@@ -131,7 +131,7 @@ const useSideNavigationContext = () => {
131
131
  return context;
132
132
  };
133
133
  const defaultElement$1 = "div";
134
- const Logo = React.forwardRef(
134
+ const Logo = utils.forwardRefPolymorphic(
135
135
  ({
136
136
  productName,
137
137
  size = "medium",
@@ -673,7 +673,7 @@ function isActiveRecursively(child) {
673
673
  );
674
674
  }
675
675
  const defaultElementBaseItem = "a";
676
- const BaseSideNavigationItem = React.forwardRef(
676
+ const BaseSideNavigationItem = utils.forwardRefPolymorphic(
677
677
  ({
678
678
  className,
679
679
  active = false,
@@ -720,7 +720,7 @@ const DisabledSideNavigationItem = React.forwardRef(({ children, ...rest }, ref)
720
720
  }
721
721
  ));
722
722
  const defaultElementItem = "a";
723
- const SideNavigationItem = React.forwardRef(
723
+ const SideNavigationItem = utils.forwardRefPolymorphic(
724
724
  ({
725
725
  active,
726
726
  disabled,