@entur-partner/common 11.0.0-alpha.1 → 11.0.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/dist/styles.css CHANGED
@@ -34,6 +34,10 @@
34
34
  height: 100px;
35
35
  }/* DO NOT CHANGE!*/
36
36
  /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
37
+ .eps-confirm-modal-content {
38
+ margin-bottom: 1rem;
39
+ }/* DO NOT CHANGE!*/
40
+ /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
37
41
  /* DO NOT CHANGE!*/
38
42
  /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
39
43
  .eps-pt-none {
@@ -2278,8 +2282,6 @@
2278
2282
 
2279
2283
  .eps-bg-lavender {
2280
2284
  background-color: #aeb7e2;
2281
- }ol.eds-breadcrumbs {
2282
- padding: 0;
2283
2285
  }/* DO NOT CHANGE!*/
2284
2286
  /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
2285
2287
  .ep-audit-info {
@@ -2306,77 +2308,16 @@
2306
2308
  .eps-content {
2307
2309
  margin: 1.5rem 1.5rem 1.5rem 22rem;
2308
2310
  }
2309
- }
2310
-
2311
- .eps-public-content {
2312
- padding-top: 5rem;
2313
- }
2314
- @media screen and (min-width: 50rem) {
2315
- .eps-public-content {
2316
- margin-left: 12rem;
2317
- }
2318
- }@import '@entur/loader/dist/styles.css';
2319
- /* DO NOT CHANGE!*/
2311
+ }/* DO NOT CHANGE!*/
2320
2312
  /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
2321
- .top-navigation {
2322
- display: flex;
2323
- align-items: center;
2324
- position: fixed;
2325
- top: 0;
2326
- left: 0;
2327
- padding-inline: 2.5rem;
2328
- justify-content: flex-start;
2329
- border-bottom: 0.125rem solid var(--designentur-header-default-divider);
2330
- background: #292b6a;
2331
- width: 100%;
2332
- height: 5rem;
2333
- z-index: 20;
2334
- transition: margin-left 0.1s ease-out;
2335
- gap: 1.5rem;
2336
- }
2337
- .top-navigation .eds-top-navigation-item {
2338
- color: white;
2339
- }
2340
- .top-navigation .eds-top-navigation-item:hover {
2341
- color: white;
2342
- }
2343
- .top-navigation .eds-top-navigation-item--active {
2344
- color: white;
2345
- font-weight: bold;
2346
- }
2347
- .top-navigation--frontpage {
2348
- border-bottom: none;
2349
- }
2350
- .top-navigation__logo {
2351
- margin-right: 1.5rem;
2352
- }
2353
- .top-navigation__logo:focus-visible {
2354
- outline: none;
2355
- box-shadow: 0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #181c56;
2356
- outline-offset: 0.125rem;
2357
- }
2358
- .top-navigation__actions {
2359
- margin-left: auto;
2360
- display: flex;
2361
- align-items: center;
2362
- }
2363
- .top-navigation__button {
2364
- color: #ffffff;
2365
- }
2366
- .top-navigation__button:hover {
2367
- color: #292b6a;
2313
+ .eps-logo-wrapper {
2314
+ display: inline-block;
2368
2315
  }
2369
- @media screen and (max-width: 1108px) {
2370
- .top-navigation {
2371
- padding-inline: 1.5rem;
2372
- }
2373
- .top-navigation .eds-top-navigation-item {
2374
- font-size: 14px;
2375
- padding: 0.75rem;
2376
- }
2377
- .top-navigation__logo {
2378
- margin-right: 1.5rem;
2379
- }
2316
+ .eps-logo-wrapper .logo {
2317
+ height: auto;
2318
+ width: 170px;
2319
+ }ol.eds-breadcrumbs {
2320
+ padding: 0;
2380
2321
  }/* DO NOT CHANGE!*/
2381
2322
  /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
2382
2323
  .eps-language-select {
@@ -2389,8 +2330,45 @@
2389
2330
  margin-left: 0.125rem;
2390
2331
  }/* DO NOT CHANGE!*/
2391
2332
  /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
2392
- .eps-confirm-modal-content {
2393
- margin-bottom: 1rem;
2333
+ /* DO NOT CHANGE!*/
2334
+ /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
2335
+ .eps-menu {
2336
+ position: relative;
2337
+ width: 100%;
2338
+ z-index: 30;
2339
+ }
2340
+ @media screen and (min-width: 50rem) {
2341
+ .eps-menu {
2342
+ left: 0;
2343
+ top: 0;
2344
+ position: fixed;
2345
+ height: 100vh;
2346
+ width: 20rem;
2347
+ overflow-y: scroll;
2348
+ }
2349
+ }.multi-language-input:focus {
2350
+ outline: none;
2351
+ }/* DO NOT CHANGE!*/
2352
+ /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
2353
+ .eps-status-label {
2354
+ display: flex;
2355
+ align-items: center;
2356
+ }
2357
+ .eps-status-label.center {
2358
+ justify-content: center;
2359
+ }
2360
+ .eps-status-label__bullet {
2361
+ padding: 5px;
2362
+ margin-bottom: 4px;
2363
+ border-radius: 50%;
2364
+ background: #d1d3d3;
2365
+ margin-right: 10px;
2366
+ }
2367
+ .eps-status-label__bullet.aggressive {
2368
+ background: #ff5959;
2369
+ }
2370
+ .eps-status-label__bullet.active {
2371
+ background: #1a8e60;
2394
2372
  }/* DO NOT CHANGE!*/
2395
2373
  /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
2396
2374
  button.eps-link-button {
@@ -2404,16 +2382,16 @@ button.eps-link-button, button.eps-link-button:hover, button.eps-link-button:foc
2404
2382
  }
2405
2383
  button.eps-link-button:hover {
2406
2384
  color: #aeb7e2;
2407
- }.multi-language-input:focus {
2408
- outline: none;
2409
- }/* DO NOT CHANGE!*/
2410
- /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
2411
- .eps-logo-wrapper {
2412
- display: inline-block;
2413
- }
2414
- .eps-logo-wrapper .logo {
2415
- height: auto;
2416
- width: 170px;
2385
+ }.eps-unbutton, .eps-unbutton:hover, .eps-unbutton:focus, .eps-unbutton:active:focus, .eps-unbutton:active:hover, .eps-unbutton:active {
2386
+ background: none;
2387
+ background-color: inherit;
2388
+ color: inherit;
2389
+ border: none;
2390
+ padding: 0;
2391
+ font: inherit;
2392
+ outline: inherit;
2393
+ height: inherit;
2394
+ min-width: inherit;
2417
2395
  }/* DO NOT CHANGE!*/
2418
2396
  /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
2419
2397
  /* DO NOT CHANGE!*/
@@ -2690,55 +2668,17 @@ button.eps-link-button:hover {
2690
2668
 
2691
2669
  .eps-font-weight-heading {
2692
2670
  font-weight: 1rem;
2693
- }/* DO NOT CHANGE!*/
2694
- /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
2695
- .eps-status-label {
2696
- display: flex;
2697
- align-items: center;
2698
- }
2699
- .eps-status-label.center {
2700
- justify-content: center;
2701
- }
2702
- .eps-status-label__bullet {
2703
- padding: 5px;
2704
- margin-bottom: 4px;
2705
- border-radius: 50%;
2706
- background: #d1d3d3;
2707
- margin-right: 10px;
2708
- }
2709
- .eps-status-label__bullet.aggressive {
2710
- background: #ff5959;
2671
+ }:root {
2672
+ --eps-common: 1;
2711
2673
  }
2712
- .eps-status-label__bullet.active {
2713
- background: #1a8e60;
2714
- }.eps-unbutton, .eps-unbutton:hover, .eps-unbutton:focus, .eps-unbutton:active:focus, .eps-unbutton:active:hover, .eps-unbutton:active {
2715
- background: none;
2716
- background-color: inherit;
2717
- color: inherit;
2718
- border: none;
2719
- padding: 0;
2720
- font: inherit;
2721
- outline: inherit;
2722
- height: inherit;
2723
- min-width: inherit;
2724
- }/* DO NOT CHANGE!*/
2725
- /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
2726
- /* DO NOT CHANGE!*/
2727
- /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
2728
- .eps-menu {
2729
- position: relative;
2730
- width: 100%;
2731
- z-index: 30;
2674
+
2675
+ main .eds-table--sticky-header--active .eds-table__head,
2676
+ .app-shell-content .eds-table--sticky-header--active .eds-table__head {
2677
+ z-index: 1;
2732
2678
  }
2733
- @media screen and (min-width: 50rem) {
2734
- .eps-menu {
2735
- left: 0;
2736
- top: 0;
2737
- position: fixed;
2738
- height: 100vh;
2739
- width: 20rem;
2740
- overflow-y: scroll;
2741
- }
2679
+ .epp-environment-banner ~ main .eds-table--sticky-header--active .eds-table__head,
2680
+ .epp-environment-banner ~ .app-shell-content .eds-table--sticky-header--active .eds-table__head {
2681
+ top: 1rem;
2742
2682
  }/* DO NOT CHANGE!*/
2743
2683
  /* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
2744
2684
  /**
@@ -2831,15 +2771,4 @@ button.eps-link-button:hover {
2831
2771
  #eps-overflow-menu .eps-overflow-menu__item {
2832
2772
  border-radius: 0.25rem;
2833
2773
  border: solid 0.0625rem #54568c;
2834
- }:root {
2835
- --eps-common: 1;
2836
- }
2837
-
2838
- main .eds-table--sticky-header--active .eds-table__head,
2839
- .app-shell-content .eds-table--sticky-header--active .eds-table__head {
2840
- z-index: 1;
2841
- }
2842
- .epp-environment-banner ~ main .eds-table--sticky-header--active .eds-table__head,
2843
- .epp-environment-banner ~ .app-shell-content .eds-table--sticky-header--active .eds-table__head {
2844
- top: 1rem;
2845
2774
  }
@@ -1,19 +1,11 @@
1
- /** biome-ignore-all lint/correctness/useUniqueElementIds: Ignore unique id for now */
2
- import "./index.scss";
1
+ import "./UserMenu.scss";
3
2
  import { type FC } from "react";
4
3
  import type { Environment } from "../environment";
5
4
  interface UserMenuProps {
6
5
  userName: string;
7
- messages: {
8
- logout: string;
9
- switchLanguage: string;
10
- appVersion?: string;
11
- myProfile?: string;
12
- cookieSettings?: string;
13
- };
14
6
  onLogout: () => void;
15
- onLanguageChange: (language: string) => void;
16
- language: string;
7
+ onLocaleChange: (locale: "nb-NO" | "en-GB") => void;
8
+ locale: "nb-NO" | "en-GB";
17
9
  className?: string;
18
10
  environment?: Environment;
19
11
  showVersionItem?: boolean;
@@ -21,6 +13,7 @@ interface UserMenuProps {
21
13
  showCookieSettingsItem?: boolean;
22
14
  onNavigateToMyProfile: () => void;
23
15
  onCookieSettingsOpen?: () => void;
16
+ onVersionItemClick?: () => void;
24
17
  }
25
18
  export declare const UserMenu: FC<UserMenuProps>;
26
19
  export {};
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ type Props = {
3
+ locale: "nb-NO" | "en-GB";
4
+ onClick: () => void;
5
+ };
6
+ export declare const CookieSettingsMenuItem: ({ locale, onClick }: Props) => React.JSX.Element;
7
+ export {};
@@ -1,4 +1,3 @@
1
- import "../index.scss";
2
1
  import React from "react";
3
2
  import { Environment } from "../../environment";
4
3
  export declare const CustomOverflowMenu: React.FC<{
@@ -1,3 +1,2 @@
1
- import "../index.scss";
2
1
  import React from "react";
3
2
  export declare const CustomOverflowMenuItem: React.FC<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>>;
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ type Props = {
3
+ locale: "nb-NO" | "en-GB";
4
+ onLocaleChange: (locale: "nb-NO" | "en-GB") => void;
5
+ };
6
+ export declare const LocaleSwitchMenuItem: ({ locale, onLocaleChange }: Props) => React.JSX.Element;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ type Props = {
3
+ onClick: () => void;
4
+ locale: "en-GB" | "nb-NO";
5
+ };
6
+ export declare const LogOutMenuItem: ({ onClick, locale }: Props) => React.JSX.Element;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ type Props = {
3
+ locale: "nb-NO" | "en-GB";
4
+ onClick: () => void;
5
+ };
6
+ export declare const UserMenuItem: ({ locale, onClick }: Props) => React.JSX.Element;
7
+ export {};
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
2
  export declare const VersionMenuItem: React.FC<{
3
- title: string;
4
- setOpen: (isOpen: boolean) => void;
3
+ locale: "nb-NO" | "en-GB";
4
+ onClick: () => void;
5
5
  }>;
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare function useOutsideClick(ref: React.RefObject<HTMLDivElement | null>, buttonRef: React.RefObject<HTMLButtonElement | null>, handler: () => void): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@entur-partner/common",
3
- "version": "11.0.0-alpha.1",
3
+ "version": "11.0.0",
4
4
  "license": "EUPL-1.2",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/common.esm.js",
@@ -33,19 +33,22 @@
33
33
  "@entur/tooltip": ">=2.4.7 <6.0.0",
34
34
  "react": ">=18.0.0",
35
35
  "react-dom": ">=18.0.0",
36
- "react-router-dom": "^6.22.0"
36
+ "react-router-dom": ">=6.30.1"
37
37
  },
38
38
  "dependencies": {
39
- "@entur-partner/util": "^1.3.3",
40
- "classnames": "^2.2.6"
39
+ "@entur-partner/util": "^1.3.6",
40
+ "classnames": "^2.5.1"
41
41
  },
42
42
  "devDependencies": {
43
- "@entur-partner/permission-client-node": "3.4.6",
44
- "@entur/tokens": "3.20.0",
43
+ "@entur-partner/permission-client-node": "3.6.1",
44
+ "@entur/tokens": "3.22.1",
45
45
  "identity-obj-proxy": "3.0.0",
46
- "react-router-dom": "6.30.1"
46
+ "react-router-dom": "7.13.0"
47
47
  },
48
48
  "jest": {
49
+ "setupFilesAfterEnv": [
50
+ "./jest-setup.js"
51
+ ],
49
52
  "moduleNameMapper": {
50
53
  "\\.(css|less|sass|scss)$": "identity-obj-proxy"
51
54
  },
@@ -58,5 +61,5 @@
58
61
  "reportFile": "jest-sonar-report.xml",
59
62
  "indent": 4
60
63
  },
61
- "gitHead": "155f3d881a185e71bb143db88082de77e9972bfc"
64
+ "gitHead": "b167f46c19c7ae5949e8df86b375eb56067dbbc8"
62
65
  }
@@ -1,9 +0,0 @@
1
- import "./BetaTopNavigation.scss";
2
- import React, { FC, ReactNode } from "react";
3
- interface BetaTopNavigationProps {
4
- children: ReactNode;
5
- as?: "nav" | React.ElementType;
6
- className?: string;
7
- }
8
- export declare const BetaTopNavigation: FC<BetaTopNavigationProps>;
9
- export {};
@@ -1,9 +0,0 @@
1
- import "../index.scss";
2
- import React from "react";
3
- type Props = {
4
- name: string;
5
- setOpen: (open: boolean) => void;
6
- onCookieSettingsOpen: () => void;
7
- };
8
- export declare const CookieSettingsMenuItem: ({ name, setOpen, onCookieSettingsOpen, }: Props) => React.JSX.Element;
9
- export {};
@@ -1,10 +0,0 @@
1
- import "../index.scss";
2
- import React from "react";
3
- type Props = {
4
- language: string;
5
- onLanguageChange: (language: string) => void;
6
- setOpen: (open: boolean) => void;
7
- name: string;
8
- };
9
- export declare const LanguageSwitchMenuItem: ({ language, onLanguageChange, setOpen, name, }: Props) => React.JSX.Element;
10
- export {};
@@ -1,9 +0,0 @@
1
- import "../index.scss";
2
- import React from "react";
3
- type Props = {
4
- name: string;
5
- setOpen: (open: boolean) => void;
6
- onLogout: () => void;
7
- };
8
- export declare const LogOutMenuItem: ({ name, setOpen, onLogout }: Props) => React.JSX.Element;
9
- export {};
@@ -1,9 +0,0 @@
1
- import "../index.scss";
2
- import React from "react";
3
- type Props = {
4
- name: string;
5
- setOpen: (open: boolean) => void;
6
- onNavigateToMyProfile: () => void;
7
- };
8
- export declare const UserMenuItem: ({ name, setOpen, onNavigateToMyProfile, }: Props) => React.JSX.Element;
9
- export {};
@@ -1,2 +0,0 @@
1
- import React from "react";
2
- export declare function useOutsideClick(ref: React.RefObject<HTMLDivElement>, buttonRef: React.RefObject<HTMLButtonElement>, handler: () => void): void;