@entur-partner/common 9.3.2 → 9.3.3-alpha.1

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.
Files changed (48) hide show
  1. package/dist/ActionBar.d.ts +9 -9
  2. package/dist/AuditInfo.d.ts +14 -14
  3. package/dist/Box.d.ts +57 -56
  4. package/dist/Breadcrumbs.d.ts +8 -8
  5. package/dist/ConfirmModal.d.ts +28 -27
  6. package/dist/Content.d.ts +10 -9
  7. package/dist/EnturPartnerLogo.d.ts +19 -18
  8. package/dist/ErrorBoundary.d.ts +22 -22
  9. package/dist/ExpandableMultiLanguageInput.d.ts +17 -17
  10. package/dist/FeatureToggle.d.ts +25 -25
  11. package/dist/FormatCurrencyAmount.d.ts +8 -7
  12. package/dist/FormatDateTime.d.ts +7 -7
  13. package/dist/LanguageSelect.d.ts +16 -16
  14. package/dist/LegacyPageTitle.d.ts +16 -0
  15. package/dist/Link.d.ts +6 -6
  16. package/dist/LinkButton.d.ts +8 -8
  17. package/dist/Menu.d.ts +10 -9
  18. package/dist/MultiLanguageInput.d.ts +28 -28
  19. package/dist/OrganisationDropdown.d.ts +14 -14
  20. package/dist/PageTitle.d.ts +6 -15
  21. package/dist/Pager.d.ts +8 -8
  22. package/dist/PermissionCheck.d.ts +24 -24
  23. package/dist/RouteLeavingGuard.d.ts +14 -14
  24. package/dist/Stack.d.ts +9 -8
  25. package/dist/StatusLabel.d.ts +11 -11
  26. package/dist/Text.d.ts +21 -20
  27. package/dist/Unbutton.d.ts +7 -7
  28. package/dist/UserMenu/components/CookieSettingsMenuItem.d.ts +9 -9
  29. package/dist/UserMenu/components/CustomOverflowMenu.d.ts +11 -11
  30. package/dist/UserMenu/components/CustomOverflowMenuItem.d.ts +3 -3
  31. package/dist/UserMenu/components/LanguageSwitchMenuItem.d.ts +10 -10
  32. package/dist/UserMenu/components/LogOutMenuItem.d.ts +9 -9
  33. package/dist/UserMenu/components/UserMenuItem.d.ts +9 -9
  34. package/dist/UserMenu/components/VersionMenuItem.d.ts +5 -5
  35. package/dist/UserMenu/index.d.ts +26 -25
  36. package/dist/UserMenu/useOutsideClick.d.ts +2 -2
  37. package/dist/common.cjs.development.js +878 -870
  38. package/dist/common.cjs.development.js.map +1 -1
  39. package/dist/common.cjs.production.min.js +1 -1
  40. package/dist/common.cjs.production.min.js.map +1 -1
  41. package/dist/common.esm.js +838 -826
  42. package/dist/common.esm.js.map +1 -1
  43. package/dist/environment.d.ts +13 -13
  44. package/dist/index.d.ts +31 -30
  45. package/dist/styles.css +161 -161
  46. package/dist/useEventListener.d.ts +3 -5
  47. package/package.json +62 -62
  48. package/dist/helpers.d.ts +0 -1
@@ -1,14 +1,14 @@
1
- import { FC } from 'react';
2
- interface OrganisationV3 {
3
- organisationId: number;
4
- tradingName: string;
5
- }
6
- interface OrganisationDropDownProps {
7
- label: string;
8
- onChange: (organisationId: number) => void;
9
- organisations: OrganisationV3[];
10
- selectedOrganisationId?: number;
11
- [key: string]: any;
12
- }
13
- export declare const OrganisationDropDown: FC<OrganisationDropDownProps>;
14
- export {};
1
+ import { type FC } from "react";
2
+ interface OrganisationV3 {
3
+ organisationId: number;
4
+ tradingName: string;
5
+ }
6
+ interface OrganisationDropDownProps {
7
+ label: string;
8
+ onChange: (organisationId: number) => void;
9
+ organisations: OrganisationV3[];
10
+ selectedOrganisationId?: number;
11
+ [key: string]: object | string | number | boolean | undefined;
12
+ }
13
+ export declare const OrganisationDropDown: FC<OrganisationDropDownProps>;
14
+ export {};
@@ -1,15 +1,6 @@
1
- import React from 'react';
2
- type Props = {
3
- readonly pathname: string;
4
- readonly onBreadcrumbLookup: (path: string) => string | undefined;
5
- };
6
- /**
7
- * This component changes page title by using helmet and current path. It will translate subpaths, join them with a dash
8
- * and display it on browser tab.
9
- *
10
- * @param Props.pathname - The current path from react-router-dom.useLocation()
11
- * @param Props.onBreadcrumbLookup - A function that takes a path and returns a i18n translated string or undefined
12
- * @returns A Helmet component with updated title
13
- */
14
- export declare function PageTitle({ pathname, onBreadcrumbLookup }: Props): React.JSX.Element;
15
- export {};
1
+ type Props = {
2
+ readonly pathname: string;
3
+ readonly onBreadcrumbLookup: (path: string) => string | undefined;
4
+ };
5
+ export declare const PageTitle: ({ pathname, onBreadcrumbLookup }: Props) => null;
6
+ export {};
package/dist/Pager.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { FC } from 'react';
2
- export interface PagerProps {
3
- currentPage: number;
4
- collectionSize: number;
5
- pageSize: number;
6
- onPageChange: (page: number) => void;
7
- }
8
- export declare const Pager: FC<PagerProps>;
1
+ import { type FC } from "react";
2
+ export interface PagerProps {
3
+ currentPage: number;
4
+ collectionSize: number;
5
+ pageSize: number;
6
+ onPageChange: (page: number) => void;
7
+ }
8
+ export declare const Pager: FC<PagerProps>;
@@ -1,24 +1,24 @@
1
- import { ReactNode, FC } from 'react';
2
- import { BusinessCapability } from '@entur-partner/permission-client-node';
3
- /**
4
- * Note: We use BusinessCapability here, not because we only want to check
5
- * BusinessCapabilities but because it represents a minimal subset of what we
6
- * need to check.
7
- */
8
- export interface PermissionCheckProps {
9
- children: ReactNode;
10
- /** User permissions to check */
11
- permissions: BusinessCapability[];
12
- /** Check that at least one of the permissions is present */
13
- oneOf?: BusinessCapability[];
14
- /** Check that all of the permissions is present */
15
- all?: BusinessCapability[] | BusinessCapability;
16
- /** Rendered if check fails. Defaults to null */
17
- fallback?: ReactNode;
18
- }
19
- /**
20
- * Note: This component uses BusinessCapability, not because we only want to
21
- * check BusinessCapabilities but because it represents a minimal subset of
22
- * what we need to check.
23
- */
24
- export declare const PermissionCheck: FC<PermissionCheckProps>;
1
+ import type { BusinessCapability } from "@entur-partner/permission-client-node";
2
+ import { type FC, type ReactNode } from "react";
3
+ /**
4
+ * Note: We use BusinessCapability here, not because we only want to check
5
+ * BusinessCapabilities but because it represents a minimal subset of what we
6
+ * need to check.
7
+ */
8
+ export interface PermissionCheckProps {
9
+ children: ReactNode;
10
+ /** User permissions to check */
11
+ permissions: BusinessCapability[];
12
+ /** Check that at least one of the permissions is present */
13
+ oneOf?: BusinessCapability[];
14
+ /** Check that all of the permissions is present */
15
+ all?: BusinessCapability[] | BusinessCapability;
16
+ /** Rendered if check fails. Defaults to null */
17
+ fallback?: ReactNode;
18
+ }
19
+ /**
20
+ * Note: This component uses BusinessCapability, not because we only want to
21
+ * check BusinessCapabilities but because it represents a minimal subset of
22
+ * what we need to check.
23
+ */
24
+ export declare const PermissionCheck: FC<PermissionCheckProps>;
@@ -1,14 +1,14 @@
1
- import { FC, ReactNode } from 'react';
2
- import { Location } from 'history';
3
- import { ModalProps } from '@entur/modal';
4
- export interface RouteLeavingGuardProps extends Partial<ModalProps> {
5
- title: string;
6
- closeLabel: string;
7
- messages: {
8
- cancel: string;
9
- confirm: string;
10
- };
11
- children: ReactNode;
12
- shouldBlockNavigation: (location: Location) => boolean;
13
- }
14
- export declare const RouteLeavingGuard: FC<RouteLeavingGuardProps>;
1
+ import type { ModalProps } from "@entur/modal";
2
+ import type { Location } from "history";
3
+ import { type FC, type ReactNode } from "react";
4
+ export interface RouteLeavingGuardProps extends Partial<ModalProps> {
5
+ title: string;
6
+ closeLabel: string;
7
+ messages: {
8
+ cancel: string;
9
+ confirm: string;
10
+ };
11
+ children: ReactNode;
12
+ shouldBlockNavigation: (location: Location) => boolean;
13
+ }
14
+ export declare const RouteLeavingGuard: FC<RouteLeavingGuardProps>;
package/dist/Stack.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- import React, { ReactNode } from 'react';
2
- import { ResponsiveStyleSpacing } from './Box';
3
- export interface StackProps {
4
- className?: string;
5
- children: ReactNode;
6
- space: ResponsiveStyleSpacing;
7
- }
8
- export declare const Stack: ({ children, space, className }: StackProps) => React.JSX.Element;
1
+ /** biome-ignore-all lint/suspicious/noArrayIndexKey: Ignore for now. Should be tested properly before doing changes */
2
+ import React, { type ReactNode } from "react";
3
+ import { type ResponsiveStyleSpacing } from "./Box";
4
+ export interface StackProps {
5
+ className?: string;
6
+ children: ReactNode;
7
+ space: ResponsiveStyleSpacing;
8
+ }
9
+ export declare const Stack: ({ children, space, className }: StackProps) => React.JSX.Element;
@@ -1,11 +1,11 @@
1
- import './StatusLabel.scss';
2
- import { FC } from 'react';
3
- interface StatusLabelProps {
4
- label: string;
5
- active: boolean;
6
- aggressiveInactive?: boolean;
7
- showBullet?: boolean;
8
- center?: boolean;
9
- }
10
- export declare const StatusLabel: FC<StatusLabelProps>;
11
- export {};
1
+ import "./StatusLabel.scss";
2
+ import { type FC } from "react";
3
+ interface StatusLabelProps {
4
+ label: string;
5
+ active: boolean;
6
+ aggressiveInactive?: boolean;
7
+ showBullet?: boolean;
8
+ center?: boolean;
9
+ }
10
+ export declare const StatusLabel: FC<StatusLabelProps>;
11
+ export {};
package/dist/Text.d.ts CHANGED
@@ -1,20 +1,21 @@
1
- import './Text.scss';
2
- import React, { ReactNode } from 'react';
3
- import { StyleColor } from './Box';
4
- type StyleFontSize = 'extraSmall' | 'small' | 'medium' | 'large' | 'extraLarge' | 'extraLarge2' | 'extraLarge3' | 'extraLarge4';
5
- type StyleFontWeight = 'body' | 'heading';
6
- type StyleLineHeight = 'extraSmall' | 'small' | 'medium' | 'large' | 'extraLarge' | 'extraLarge2' | 'extraLarge3' | 'extraLarge4' | 'extraLarge5' | 'extraLarge6' | 'extraLarge7';
7
- export type ResponsiveStyleFontSize = StyleFontSize | [StyleFontSize?, StyleFontSize?, StyleFontSize?];
8
- export type ResponsiveStyleLineHeight = StyleLineHeight | [StyleLineHeight?, StyleLineHeight?, StyleLineHeight?];
9
- export interface TextProps {
10
- className?: string;
11
- as?: React.ElementType;
12
- children: ReactNode;
13
- fontSize?: ResponsiveStyleFontSize;
14
- lineHeight?: ResponsiveStyleLineHeight;
15
- color?: StyleColor;
16
- fontWeight?: StyleFontWeight;
17
- [key: string]: any;
18
- }
19
- export declare const Text: ({ as: component, children, fontSize, color, lineHeight, fontWeight, className, ...rest }: TextProps) => React.JSX.Element;
20
- export {};
1
+ import "./Text.scss";
2
+ import type { ReactNode } from "react";
3
+ import React from "react";
4
+ import { type StyleColor } from "./Box";
5
+ type StyleFontSize = "extraSmall" | "small" | "medium" | "large" | "extraLarge" | "extraLarge2" | "extraLarge3" | "extraLarge4";
6
+ type StyleFontWeight = "body" | "heading";
7
+ type StyleLineHeight = "extraSmall" | "small" | "medium" | "large" | "extraLarge" | "extraLarge2" | "extraLarge3" | "extraLarge4" | "extraLarge5" | "extraLarge6" | "extraLarge7";
8
+ export type ResponsiveStyleFontSize = StyleFontSize | [StyleFontSize?, StyleFontSize?, StyleFontSize?];
9
+ export type ResponsiveStyleLineHeight = StyleLineHeight | [StyleLineHeight?, StyleLineHeight?, StyleLineHeight?];
10
+ export interface TextProps {
11
+ className?: string;
12
+ as?: React.ElementType;
13
+ children: ReactNode;
14
+ fontSize?: ResponsiveStyleFontSize;
15
+ lineHeight?: ResponsiveStyleLineHeight;
16
+ color?: StyleColor;
17
+ fontWeight?: StyleFontWeight;
18
+ [key: string]: any;
19
+ }
20
+ export declare const Text: ({ as: component, children, fontSize, color, lineHeight, fontWeight, className, ...rest }: TextProps) => React.JSX.Element;
21
+ export {};
@@ -1,7 +1,7 @@
1
- import './Unbutton.scss';
2
- import { FC } from 'react';
3
- import { ButtonProps } from '@entur/button';
4
- interface UnbuttonProps extends Omit<ButtonProps<any>, 'variant'> {
5
- }
6
- export declare const Unbutton: FC<UnbuttonProps>;
7
- export {};
1
+ import "./Unbutton.scss";
2
+ import { Button, type ButtonProps } from "@entur/button";
3
+ import { type FC } from "react";
4
+ interface UnbuttonProps extends Omit<ButtonProps<typeof Button>, "variant"> {
5
+ }
6
+ export declare const Unbutton: FC<UnbuttonProps>;
7
+ export {};
@@ -1,9 +1,9 @@
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
+ 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,11 +1,11 @@
1
- import '../index.scss';
2
- import React from 'react';
3
- import { Environment } from '../../environment';
4
- export declare const CustomOverflowMenu: React.FC<{
5
- className?: string;
6
- children: React.ReactNode;
7
- userName: string;
8
- open: boolean;
9
- onOpenChange: (open: boolean) => void;
10
- environment?: Environment;
11
- }>;
1
+ import "../index.scss";
2
+ import React from "react";
3
+ import { Environment } from "../../environment";
4
+ export declare const CustomOverflowMenu: React.FC<{
5
+ className?: string;
6
+ children: React.ReactNode;
7
+ userName: string;
8
+ open: boolean;
9
+ onOpenChange: (open: boolean) => void;
10
+ environment?: Environment;
11
+ }>;
@@ -1,3 +1,3 @@
1
- import '../index.scss';
2
- import React from 'react';
3
- export declare const CustomOverflowMenuItem: React.FC<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>>;
1
+ import "../index.scss";
2
+ import React from "react";
3
+ export declare const CustomOverflowMenuItem: React.FC<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>>;
@@ -1,10 +1,10 @@
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
+ 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 +1,9 @@
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
+ 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 +1,9 @@
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
+ 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,5 +1,5 @@
1
- import React from 'react';
2
- export declare const VersionMenuItem: React.FC<{
3
- title: string;
4
- setOpen: (isOpen: boolean) => void;
5
- }>;
1
+ import React from "react";
2
+ export declare const VersionMenuItem: React.FC<{
3
+ title: string;
4
+ setOpen: (isOpen: boolean) => void;
5
+ }>;
@@ -1,25 +1,26 @@
1
- import './index.scss';
2
- import { FC } from 'react';
3
- import { Environment } from '../environment';
4
- interface UserMenuProps {
5
- userName: string;
6
- messages: {
7
- logout: string;
8
- switchLanguage: string;
9
- appVersion?: string;
10
- myProfile?: string;
11
- cookieSettings?: string;
12
- };
13
- onLogout: () => void;
14
- onLanguageChange: (language: string) => void;
15
- language: string;
16
- className?: string;
17
- environment?: Environment;
18
- showVersionItem?: boolean;
19
- showMyProfileItem?: boolean;
20
- showCookieSettingsItem?: boolean;
21
- onNavigateToMyProfile: () => void;
22
- onCookieSettingsOpen?: () => void;
23
- }
24
- export declare const UserMenu: FC<UserMenuProps>;
25
- export {};
1
+ /** biome-ignore-all lint/correctness/useUniqueElementIds: Ignore unique id for now */
2
+ import "./index.scss";
3
+ import { type FC } from "react";
4
+ import type { Environment } from "../environment";
5
+ interface UserMenuProps {
6
+ userName: string;
7
+ messages: {
8
+ logout: string;
9
+ switchLanguage: string;
10
+ appVersion?: string;
11
+ myProfile?: string;
12
+ cookieSettings?: string;
13
+ };
14
+ onLogout: () => void;
15
+ onLanguageChange: (language: string) => void;
16
+ language: string;
17
+ className?: string;
18
+ environment?: Environment;
19
+ showVersionItem?: boolean;
20
+ showMyProfileItem?: boolean;
21
+ showCookieSettingsItem?: boolean;
22
+ onNavigateToMyProfile: () => void;
23
+ onCookieSettingsOpen?: () => void;
24
+ }
25
+ export declare const UserMenu: FC<UserMenuProps>;
26
+ export {};
@@ -1,2 +1,2 @@
1
- import React from 'react';
2
- export declare function useOutsideClick(ref: React.RefObject<HTMLDivElement>, buttonRef: React.RefObject<HTMLButtonElement>, handler: () => void): void;
1
+ import React from "react";
2
+ export declare function useOutsideClick(ref: React.RefObject<HTMLDivElement>, buttonRef: React.RefObject<HTMLButtonElement>, handler: () => void): void;