@entur/layout 3.1.9 → 3.1.10
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/Badge/Badge.d.ts +37 -0
- package/dist/Badge/BulletBadge.d.ts +25 -0
- package/dist/Badge/NotificationBadge.d.ts +33 -0
- package/dist/Badge/StatusBadge.d.ts +25 -0
- package/dist/BaseCard.d.ts +15 -0
- package/dist/Contrast.d.ts +13 -0
- package/dist/MediaCard.d.ts +43 -0
- package/dist/NavigationCard.d.ts +26 -0
- package/dist/Tag.d.ts +19 -0
- package/dist/index.d.ts +9 -310
- package/package.json +6 -6
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { PolymorphicComponentPropsWithRef, VariantType } from '../../../utils';
|
|
3
|
+
/** @deprecated use variant="information" instead */
|
|
4
|
+
declare const info = "info";
|
|
5
|
+
/** @deprecated use variant="negative" instead */
|
|
6
|
+
declare const danger = "danger";
|
|
7
|
+
export type BadgeTypes = 'status' | 'bullet' | 'notification';
|
|
8
|
+
export type BadgeOwnProps = {
|
|
9
|
+
/** Elementet som wrapper badgen
|
|
10
|
+
* @default "span"
|
|
11
|
+
*/
|
|
12
|
+
as?: 'span' | React.ElementType;
|
|
13
|
+
/** Ekstra klassenavn */
|
|
14
|
+
className?: string;
|
|
15
|
+
/** Elementet som badge vil legges relativt til */
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
/** Hvilken type badge man vil ha */
|
|
18
|
+
variant: 'primary' | 'neutral' | VariantType | typeof danger | typeof info;
|
|
19
|
+
/** Om 0 skal vises
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
showZero?: boolean;
|
|
23
|
+
/** Hva som er høyeste tallet før det legges på "+"
|
|
24
|
+
* @default ++
|
|
25
|
+
*/
|
|
26
|
+
max?: number;
|
|
27
|
+
type?: BadgeTypes;
|
|
28
|
+
/** @deprecated Bruk `hide` i stedet */
|
|
29
|
+
invisible?: boolean;
|
|
30
|
+
/** Skjul badge */
|
|
31
|
+
hide?: boolean;
|
|
32
|
+
};
|
|
33
|
+
export type BadgeProps<T extends React.ElementType> = PolymorphicComponentPropsWithRef<T, BadgeOwnProps>;
|
|
34
|
+
export type BadgeComponent = <T extends React.ElementType = typeof defaultElement>(props: BadgeProps<T>) => React.ReactElement | null;
|
|
35
|
+
declare const defaultElement = "span";
|
|
36
|
+
export declare const Badge: BadgeComponent;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { PolymorphicComponentPropsWithRef, VariantType } from '../../../utils';
|
|
3
|
+
/** @deprecated use variant="information" instead */
|
|
4
|
+
declare const info = "info";
|
|
5
|
+
/** @deprecated use variant="negative" instead */
|
|
6
|
+
declare const danger = "danger";
|
|
7
|
+
type BulletBadgeBaseProps = {
|
|
8
|
+
/** Elementet som wrapper badgen
|
|
9
|
+
* @default "span"
|
|
10
|
+
*/
|
|
11
|
+
as?: string | React.ElementType;
|
|
12
|
+
/** Ekstra klassenavn */
|
|
13
|
+
className?: string;
|
|
14
|
+
/** Elementet som badge vil legges relativt til */
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
/** Hvilken type badge man vil ha */
|
|
17
|
+
variant: 'primary' | 'neutral' | VariantType | typeof danger | typeof info;
|
|
18
|
+
/** Skjul badge */
|
|
19
|
+
hide?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type BulletBadgeProps<T extends React.ElementType> = PolymorphicComponentPropsWithRef<T, BulletBadgeBaseProps>;
|
|
22
|
+
export type BulletBadgeComponent = <T extends React.ElementType = typeof defaultElement>(props: BulletBadgeProps<T>) => React.ReactElement | null;
|
|
23
|
+
declare const defaultElement = "span";
|
|
24
|
+
export declare const BulletBadge: BulletBadgeComponent;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { PolymorphicComponentPropsWithRef, VariantType } from '../../../utils';
|
|
3
|
+
/** @deprecated use variant="information" instead */
|
|
4
|
+
declare const info = "info";
|
|
5
|
+
/** @deprecated use variant="negative" instead */
|
|
6
|
+
declare const danger = "danger";
|
|
7
|
+
type NotificationBadgeBaseProps = {
|
|
8
|
+
/** Elementet som wrapper badgen
|
|
9
|
+
* @default "span"
|
|
10
|
+
*/
|
|
11
|
+
as?: string | React.ElementType;
|
|
12
|
+
/** Ekstra klassenavn */
|
|
13
|
+
className?: string;
|
|
14
|
+
/** Elementet som badge vil legges relativt til */
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
/** Hvilken type badge man vil ha */
|
|
17
|
+
variant: 'primary' | 'neutral' | VariantType | typeof danger | typeof info;
|
|
18
|
+
/** Om 0 skal vises
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
showZero?: boolean;
|
|
22
|
+
/** Hva som er høyeste tallet før det legges på "+"
|
|
23
|
+
* @default ++
|
|
24
|
+
*/
|
|
25
|
+
max?: number;
|
|
26
|
+
/** Skjul badge */
|
|
27
|
+
hide?: boolean;
|
|
28
|
+
};
|
|
29
|
+
export type NotificationBadgeProps<T extends React.ElementType> = PolymorphicComponentPropsWithRef<T, NotificationBadgeBaseProps>;
|
|
30
|
+
export type NotificationBadgeComponent = <T extends React.ElementType = typeof defaultElement>(props: NotificationBadgeProps<T>) => React.ReactElement | null;
|
|
31
|
+
declare const defaultElement = "span";
|
|
32
|
+
export declare const NotificationBadge: NotificationBadgeComponent;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { PolymorphicComponentPropsWithRef, VariantType } from '../../../utils';
|
|
3
|
+
/** @deprecated use variant="information" instead */
|
|
4
|
+
declare const info = "info";
|
|
5
|
+
/** @deprecated use variant="negative" instead */
|
|
6
|
+
declare const danger = "danger";
|
|
7
|
+
type StatusBadgeBaseProps = {
|
|
8
|
+
/** Elementet som wrapper badgen
|
|
9
|
+
* @default "span"
|
|
10
|
+
*/
|
|
11
|
+
as?: string | React.ElementType;
|
|
12
|
+
/** Ekstra klassenavn */
|
|
13
|
+
className?: string;
|
|
14
|
+
/** Elementet som badge vil legges relativt til */
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
/** Hvilken type badge man vil ha */
|
|
17
|
+
variant: 'primary' | 'neutral' | VariantType | typeof danger | typeof info;
|
|
18
|
+
/** Skjul badge */
|
|
19
|
+
hide?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type StatusBadgeProps<T extends React.ElementType> = PolymorphicComponentPropsWithRef<T, StatusBadgeBaseProps>;
|
|
22
|
+
export type StatusBadgeComponent = <T extends React.ElementType = typeof defaultElement>(props: StatusBadgeProps<T>) => React.ReactElement | null;
|
|
23
|
+
declare const defaultElement = "span";
|
|
24
|
+
export declare const StatusBadge: StatusBadgeComponent;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { PolymorphicComponentProps } from '../../utils';
|
|
3
|
+
export type BaseCardOwnProps = {
|
|
4
|
+
/** HTML-elementet eller React-komponenten som lager Card
|
|
5
|
+
* @default "div"
|
|
6
|
+
*/
|
|
7
|
+
as?: 'div' | React.ElementType;
|
|
8
|
+
/** Ekstra klassenavn */
|
|
9
|
+
className?: string;
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
};
|
|
12
|
+
export type BaseCardProps<T extends React.ElementType = typeof defaultElement> = PolymorphicComponentProps<T, BaseCardOwnProps>;
|
|
13
|
+
declare const defaultElement = "div";
|
|
14
|
+
export declare const BaseCard: <E extends React.ElementType = "div">({ children, className, as, ...rest }: BaseCardProps<E>) => JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { PolymorphicComponentPropsWithRef } from '../../utils';
|
|
3
|
+
export type ContrastBaseProps = {
|
|
4
|
+
/** Ekstra klassenavn */
|
|
5
|
+
className?: string;
|
|
6
|
+
};
|
|
7
|
+
export type ContrastProps<T extends React.ElementType> = PolymorphicComponentPropsWithRef<T, ContrastBaseProps>;
|
|
8
|
+
export type ContrastComponent = <T extends React.ElementType = typeof defaultElement>(props: ContrastProps<T>) => React.ReactElement | null;
|
|
9
|
+
declare const defaultElement = "div";
|
|
10
|
+
export declare const Contrast: ContrastComponent;
|
|
11
|
+
export declare const ContrastContext: React.Context<boolean>;
|
|
12
|
+
export declare const useContrast: () => boolean;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { default as React, CSSProperties } from 'react';
|
|
2
|
+
import { PolymorphicComponentProps } from '../../utils';
|
|
3
|
+
export type MediaCardOwnProps = {
|
|
4
|
+
/** HTML-elementet eller React-komponenten som lager bunnen (under media) av MediaCard
|
|
5
|
+
* @default 'a'
|
|
6
|
+
*/
|
|
7
|
+
as?: 'a' | 'button' | React.ElementType;
|
|
8
|
+
/** Tittelen/teksten som står i CardBox */
|
|
9
|
+
title: string;
|
|
10
|
+
/** Teksten under tittelen i MediaCard */
|
|
11
|
+
description?: React.ReactNode;
|
|
12
|
+
/** Kategori (eller lignende) som vises over tittelen */
|
|
13
|
+
category?: string;
|
|
14
|
+
/** Ekstra klassenavn */
|
|
15
|
+
className?: string;
|
|
16
|
+
/** Det du skulle ønske som media (f.eks. bilder eller video) */
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
/** Styling som sendes til komponenten */
|
|
19
|
+
style?: CSSProperties;
|
|
20
|
+
/** Hvilken heading som brukes for tittelen.
|
|
21
|
+
* Blir kun satt hvis description også er satt.
|
|
22
|
+
* @default 'h2'
|
|
23
|
+
*/
|
|
24
|
+
headingLevel?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
25
|
+
/** Skjul pil-ikonet nederst til høyre
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
hideArrow?: boolean;
|
|
29
|
+
/** Om MediaCard skal vises horisontalt eller vertikalt
|
|
30
|
+
* @default 'vertical'
|
|
31
|
+
*/
|
|
32
|
+
orientation?: 'horizontal' | 'vertical';
|
|
33
|
+
/** Props som sendes til wrapper-elementet i stedet for lenke-elementet */
|
|
34
|
+
wrapperProps?: React.HTMLAttributes<HTMLElement>;
|
|
35
|
+
/** @deprecated Denne prop-en har ikke lenger en funksjon.
|
|
36
|
+
* Hvis du trenger å legge til props på wrapper-elementet, bruk 'wrapperProps'-prop-en
|
|
37
|
+
*/
|
|
38
|
+
wholeCardAsElement?: boolean;
|
|
39
|
+
};
|
|
40
|
+
export type MediaCardProps<T extends React.ElementType = typeof defaultElement> = PolymorphicComponentProps<T, MediaCardOwnProps>;
|
|
41
|
+
declare const defaultElement = "a";
|
|
42
|
+
export declare const MediaCard: <E extends React.ElementType = "a">({ title, description, children, className, category, style, as, headingLevel, wholeCardAsElement: whole, hideArrow, wrapperProps, orientation, ...rest }: MediaCardProps<E>) => JSX.Element;
|
|
43
|
+
export default MediaCard;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { PolymorphicComponentProps } from '../../utils';
|
|
3
|
+
export type NavigationCardOwnProps = {
|
|
4
|
+
/** HTML-elementet eller React-komponenten som lager NavigationCard
|
|
5
|
+
* @default 'a'
|
|
6
|
+
*/
|
|
7
|
+
as?: 'a' | 'button' | React.ElementType;
|
|
8
|
+
/** Tittelen/teksten som står i CardBox */
|
|
9
|
+
title: string;
|
|
10
|
+
/** Valgfritt ikon som står over tittelen */
|
|
11
|
+
titleIcon?: React.ReactNode;
|
|
12
|
+
/** Ekstra klassenavn */
|
|
13
|
+
className?: string;
|
|
14
|
+
/** Lager en mer kompakt NavigationCard, uten ikon og beskrivende tekst
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
17
|
+
compact?: boolean;
|
|
18
|
+
/** Beskrivelse under tittel, om ikke "compact" er valgt */
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
/** @deprecated eksternlenke ikon er ikke lenger støttet i NavigationCard */
|
|
21
|
+
externalLink?: boolean;
|
|
22
|
+
};
|
|
23
|
+
export type NavigationCardProps<T extends React.ElementType = typeof defaultElement> = PolymorphicComponentProps<T, NavigationCardOwnProps>;
|
|
24
|
+
declare const defaultElement = "a";
|
|
25
|
+
export declare const NavigationCard: <E extends React.ElementType = "a">({ title, children, titleIcon, compact, className, as, ...rest }: NavigationCardProps<E>) => JSX.Element;
|
|
26
|
+
export {};
|
package/dist/Tag.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { PolymorphicComponentProps } from '../../utils';
|
|
3
|
+
export type TagOwnProps = {
|
|
4
|
+
/** HTML-elementet eller React-komponenten som rendres
|
|
5
|
+
* @default 'div'
|
|
6
|
+
*/
|
|
7
|
+
as?: string | React.ElementType;
|
|
8
|
+
/** Ekstra klassenavn */
|
|
9
|
+
className?: string;
|
|
10
|
+
/**Mindre og mer kompakt Tag, til f.eks. tabellbruk
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
compact?: boolean;
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
};
|
|
16
|
+
export type TagProps<T extends React.ElementType = typeof defaultElement> = PolymorphicComponentProps<T, TagOwnProps>;
|
|
17
|
+
declare const defaultElement = "div";
|
|
18
|
+
export declare const Tag: <E extends React.ElementType = "div">({ className, children, compact, as, ...rest }: TagProps<E>) => JSX.Element;
|
|
19
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,310 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export declare const Badge: BadgeComponent;
|
|
13
|
-
|
|
14
|
-
export declare type BadgeComponent = <T extends default_2.ElementType = typeof defaultElement_5>(props: BadgeProps<T>) => default_2.ReactElement | null;
|
|
15
|
-
|
|
16
|
-
export declare type BadgeOwnProps = {
|
|
17
|
-
/** Elementet som wrapper badgen
|
|
18
|
-
* @default "span"
|
|
19
|
-
*/
|
|
20
|
-
as?: 'span' | default_2.ElementType;
|
|
21
|
-
/** Ekstra klassenavn */
|
|
22
|
-
className?: string;
|
|
23
|
-
/** Elementet som badge vil legges relativt til */
|
|
24
|
-
children: default_2.ReactNode;
|
|
25
|
-
/** Hvilken type badge man vil ha */
|
|
26
|
-
variant: 'primary' | 'neutral' | VariantType | typeof danger | typeof info;
|
|
27
|
-
/** Om 0 skal vises
|
|
28
|
-
* @default false
|
|
29
|
-
*/
|
|
30
|
-
showZero?: boolean;
|
|
31
|
-
/** Hva som er høyeste tallet før det legges på "+"
|
|
32
|
-
* @default ++
|
|
33
|
-
*/
|
|
34
|
-
max?: number;
|
|
35
|
-
type?: BadgeTypes;
|
|
36
|
-
/** @deprecated Bruk `hide` i stedet */
|
|
37
|
-
invisible?: boolean;
|
|
38
|
-
/** Skjul badge */
|
|
39
|
-
hide?: boolean;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export declare type BadgeProps<T extends default_2.ElementType> = PolymorphicComponentPropsWithRef<T, BadgeOwnProps>;
|
|
43
|
-
|
|
44
|
-
export declare type BadgeTypes = 'status' | 'bullet' | 'notification';
|
|
45
|
-
|
|
46
|
-
export declare const BaseCard: <E extends default_2.ElementType = "div">({ children, className, as, ...rest }: BaseCardProps<E>) => JSX.Element;
|
|
47
|
-
|
|
48
|
-
export declare type BaseCardOwnProps = {
|
|
49
|
-
/** HTML-elementet eller React-komponenten som lager Card
|
|
50
|
-
* @default "div"
|
|
51
|
-
*/
|
|
52
|
-
as?: 'div' | default_2.ElementType;
|
|
53
|
-
/** Ekstra klassenavn */
|
|
54
|
-
className?: string;
|
|
55
|
-
children?: default_2.ReactNode;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export declare type BaseCardProps<T extends default_2.ElementType = typeof defaultElement_3> = PolymorphicComponentProps<T, BaseCardOwnProps>;
|
|
59
|
-
|
|
60
|
-
export declare const BulletBadge: BulletBadgeComponent;
|
|
61
|
-
|
|
62
|
-
declare type BulletBadgeBaseProps = {
|
|
63
|
-
/** Elementet som wrapper badgen
|
|
64
|
-
* @default "span"
|
|
65
|
-
*/
|
|
66
|
-
as?: string | default_2.ElementType;
|
|
67
|
-
/** Ekstra klassenavn */
|
|
68
|
-
className?: string;
|
|
69
|
-
/** Elementet som badge vil legges relativt til */
|
|
70
|
-
children: default_2.ReactNode;
|
|
71
|
-
/** Hvilken type badge man vil ha */
|
|
72
|
-
variant: 'primary' | 'neutral' | VariantType | typeof danger_2 | typeof info_2;
|
|
73
|
-
/** Skjul badge */
|
|
74
|
-
hide?: boolean;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export declare type BulletBadgeComponent = <T extends default_2.ElementType = typeof defaultElement_6>(props: BulletBadgeProps<T>) => default_2.ReactElement | null;
|
|
78
|
-
|
|
79
|
-
export declare type BulletBadgeProps<T extends default_2.ElementType> = PolymorphicComponentPropsWithRef<T, BulletBadgeBaseProps>;
|
|
80
|
-
|
|
81
|
-
export declare const Contrast: ContrastComponent;
|
|
82
|
-
|
|
83
|
-
export declare type ContrastBaseProps = {
|
|
84
|
-
/** Ekstra klassenavn */
|
|
85
|
-
className?: string;
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
export declare type ContrastComponent = <T extends default_2.ElementType = typeof defaultElement>(props: ContrastProps<T>) => default_2.ReactElement | null;
|
|
89
|
-
|
|
90
|
-
export declare const ContrastContext: default_2.Context<boolean>;
|
|
91
|
-
|
|
92
|
-
export declare type ContrastProps<T extends default_2.ElementType> = PolymorphicComponentPropsWithRef<T, ContrastBaseProps>;
|
|
93
|
-
|
|
94
|
-
/** @deprecated use variant="negative" instead */
|
|
95
|
-
declare const danger = "danger";
|
|
96
|
-
|
|
97
|
-
/** @deprecated use variant="negative" instead */
|
|
98
|
-
declare const danger_2 = "danger";
|
|
99
|
-
|
|
100
|
-
/** @deprecated use variant="negative" instead */
|
|
101
|
-
declare const danger_3 = "danger";
|
|
102
|
-
|
|
103
|
-
/** @deprecated use variant="negative" instead */
|
|
104
|
-
declare const danger_4 = "danger";
|
|
105
|
-
|
|
106
|
-
declare const defaultElement = "div";
|
|
107
|
-
|
|
108
|
-
declare const defaultElement_2 = "a";
|
|
109
|
-
|
|
110
|
-
declare const defaultElement_3 = "div";
|
|
111
|
-
|
|
112
|
-
declare const defaultElement_4 = "a";
|
|
113
|
-
|
|
114
|
-
declare const defaultElement_5 = "span";
|
|
115
|
-
|
|
116
|
-
declare const defaultElement_6 = "span";
|
|
117
|
-
|
|
118
|
-
declare const defaultElement_7 = "span";
|
|
119
|
-
|
|
120
|
-
declare const defaultElement_8 = "span";
|
|
121
|
-
|
|
122
|
-
declare const defaultElement_9 = "div";
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Allows for extending a set of props (`ExtendedProps`) by an overriding set of props
|
|
126
|
-
* (`OverrideProps`), ensuring that any duplicates are overridden by the overriding
|
|
127
|
-
* set of props.
|
|
128
|
-
*/
|
|
129
|
-
declare type ExtendableProps<ExtendedProps = Record<string, unknown>, OverrideProps = Record<string, unknown>> = OverrideProps & Omit<ExtendedProps, keyof OverrideProps>;
|
|
130
|
-
|
|
131
|
-
/** @deprecated use variant="information" instead */
|
|
132
|
-
declare const info = "info";
|
|
133
|
-
|
|
134
|
-
/** @deprecated use variant="information" instead */
|
|
135
|
-
declare const info_2 = "info";
|
|
136
|
-
|
|
137
|
-
/** @deprecated use variant="information" instead */
|
|
138
|
-
declare const info_3 = "info";
|
|
139
|
-
|
|
140
|
-
/** @deprecated use variant="information" instead */
|
|
141
|
-
declare const info_4 = "info";
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Allows for inheriting the props from the specified element type so that
|
|
145
|
-
* props like children, className & style work, as well as element-specific
|
|
146
|
-
* attributes like aria roles. The component (`C`) must be passed in.
|
|
147
|
-
*/
|
|
148
|
-
declare type InheritableElementProps<C extends default_2.ElementType, Props = Record<string, unknown>> = ExtendableProps<PropsOf<C>, Props>;
|
|
149
|
-
|
|
150
|
-
export declare const MediaCard: <E extends default_2.ElementType = "a">({ title, description, children, className, category, style, as, headingLevel, wholeCardAsElement: whole, hideArrow, wrapperProps, orientation, ...rest }: MediaCardProps<E>) => JSX.Element;
|
|
151
|
-
|
|
152
|
-
export declare type MediaCardOwnProps = {
|
|
153
|
-
/** HTML-elementet eller React-komponenten som lager bunnen (under media) av MediaCard
|
|
154
|
-
* @default 'a'
|
|
155
|
-
*/
|
|
156
|
-
as?: 'a' | 'button' | default_2.ElementType;
|
|
157
|
-
/** Tittelen/teksten som står i CardBox */
|
|
158
|
-
title: string;
|
|
159
|
-
/** Teksten under tittelen i MediaCard */
|
|
160
|
-
description?: default_2.ReactNode;
|
|
161
|
-
/** Kategori (eller lignende) som vises over tittelen */
|
|
162
|
-
category?: string;
|
|
163
|
-
/** Ekstra klassenavn */
|
|
164
|
-
className?: string;
|
|
165
|
-
/** Det du skulle ønske som media (f.eks. bilder eller video) */
|
|
166
|
-
children?: default_2.ReactNode;
|
|
167
|
-
/** Styling som sendes til komponenten */
|
|
168
|
-
style?: CSSProperties;
|
|
169
|
-
/** Hvilken heading som brukes for tittelen.
|
|
170
|
-
* Blir kun satt hvis description også er satt.
|
|
171
|
-
* @default 'h2'
|
|
172
|
-
*/
|
|
173
|
-
headingLevel?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
174
|
-
/** Skjul pil-ikonet nederst til høyre
|
|
175
|
-
* @default false
|
|
176
|
-
*/
|
|
177
|
-
hideArrow?: boolean;
|
|
178
|
-
/** Om MediaCard skal vises horisontalt eller vertikalt
|
|
179
|
-
* @default 'vertical'
|
|
180
|
-
*/
|
|
181
|
-
orientation?: 'horizontal' | 'vertical';
|
|
182
|
-
/** Props som sendes til wrapper-elementet i stedet for lenke-elementet */
|
|
183
|
-
wrapperProps?: default_2.HTMLAttributes<HTMLElement>;
|
|
184
|
-
/** @deprecated Denne prop-en har ikke lenger en funksjon.
|
|
185
|
-
* Hvis du trenger å legge til props på wrapper-elementet, bruk 'wrapperProps'-prop-en
|
|
186
|
-
*/
|
|
187
|
-
wholeCardAsElement?: boolean;
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
export declare type MediaCardProps<T extends default_2.ElementType = typeof defaultElement_4> = PolymorphicComponentProps<T, MediaCardOwnProps>;
|
|
191
|
-
|
|
192
|
-
export declare const NavigationCard: <E extends default_2.ElementType = "a">({ title, children, titleIcon, compact, className, as, ...rest }: NavigationCardProps<E>) => JSX.Element;
|
|
193
|
-
|
|
194
|
-
export declare type NavigationCardOwnProps = {
|
|
195
|
-
/** HTML-elementet eller React-komponenten som lager NavigationCard
|
|
196
|
-
* @default 'a'
|
|
197
|
-
*/
|
|
198
|
-
as?: 'a' | 'button' | default_2.ElementType;
|
|
199
|
-
/** Tittelen/teksten som står i CardBox */
|
|
200
|
-
title: string;
|
|
201
|
-
/** Valgfritt ikon som står over tittelen */
|
|
202
|
-
titleIcon?: default_2.ReactNode;
|
|
203
|
-
/** Ekstra klassenavn */
|
|
204
|
-
className?: string;
|
|
205
|
-
/** Lager en mer kompakt NavigationCard, uten ikon og beskrivende tekst
|
|
206
|
-
* @default false
|
|
207
|
-
*/
|
|
208
|
-
compact?: boolean;
|
|
209
|
-
/** Beskrivelse under tittel, om ikke "compact" er valgt */
|
|
210
|
-
children?: default_2.ReactNode;
|
|
211
|
-
/** @deprecated eksternlenke ikon er ikke lenger støttet i NavigationCard */
|
|
212
|
-
externalLink?: boolean;
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
export declare type NavigationCardProps<T extends default_2.ElementType = typeof defaultElement_2> = PolymorphicComponentProps<T, NavigationCardOwnProps>;
|
|
216
|
-
|
|
217
|
-
export declare const NotificationBadge: NotificationBadgeComponent;
|
|
218
|
-
|
|
219
|
-
declare type NotificationBadgeBaseProps = {
|
|
220
|
-
/** Elementet som wrapper badgen
|
|
221
|
-
* @default "span"
|
|
222
|
-
*/
|
|
223
|
-
as?: string | default_2.ElementType;
|
|
224
|
-
/** Ekstra klassenavn */
|
|
225
|
-
className?: string;
|
|
226
|
-
/** Elementet som badge vil legges relativt til */
|
|
227
|
-
children: default_2.ReactNode;
|
|
228
|
-
/** Hvilken type badge man vil ha */
|
|
229
|
-
variant: 'primary' | 'neutral' | VariantType | typeof danger_3 | typeof info_3;
|
|
230
|
-
/** Om 0 skal vises
|
|
231
|
-
* @default false
|
|
232
|
-
*/
|
|
233
|
-
showZero?: boolean;
|
|
234
|
-
/** Hva som er høyeste tallet før det legges på "+"
|
|
235
|
-
* @default ++
|
|
236
|
-
*/
|
|
237
|
-
max?: number;
|
|
238
|
-
/** Skjul badge */
|
|
239
|
-
hide?: boolean;
|
|
240
|
-
};
|
|
241
|
-
|
|
242
|
-
export declare type NotificationBadgeComponent = <T extends default_2.ElementType = typeof defaultElement_7>(props: NotificationBadgeProps<T>) => default_2.ReactElement | null;
|
|
243
|
-
|
|
244
|
-
export declare type NotificationBadgeProps<T extends default_2.ElementType> = PolymorphicComponentPropsWithRef<T, NotificationBadgeBaseProps>;
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* A more sophisticated version of `InheritableElementProps` where
|
|
248
|
-
* the passed in `as` prop will determine which props can be included
|
|
249
|
-
*/
|
|
250
|
-
declare type PolymorphicComponentProps<C extends default_2.ElementType, Props = Record<string, unknown>> = InheritableElementProps<C, Props & AsProp<C>>;
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* A wrapper of `PolymorphicComponentProps` that also includes the `ref`
|
|
254
|
-
* prop for the polymorphic component
|
|
255
|
-
*/
|
|
256
|
-
declare type PolymorphicComponentPropsWithRef<C extends default_2.ElementType, Props = Record<string, unknown>> = PolymorphicComponentProps<C, Props> & {
|
|
257
|
-
ref?: PolymorphicRef<C>;
|
|
258
|
-
};
|
|
259
|
-
|
|
260
|
-
/**
|
|
261
|
-
* Utility type to extract the `ref` prop from a polymorphic component
|
|
262
|
-
*/
|
|
263
|
-
declare type PolymorphicRef<C extends default_2.ElementType> = default_2.ComponentPropsWithRef<C>['ref'];
|
|
264
|
-
|
|
265
|
-
declare type PropsOf<C extends keyof JSX.IntrinsicElements | default_2.JSXElementConstructor<any>> = JSX.LibraryManagedAttributes<C, default_2.ComponentPropsWithoutRef<C>>;
|
|
266
|
-
|
|
267
|
-
export declare const StatusBadge: StatusBadgeComponent;
|
|
268
|
-
|
|
269
|
-
declare type StatusBadgeBaseProps = {
|
|
270
|
-
/** Elementet som wrapper badgen
|
|
271
|
-
* @default "span"
|
|
272
|
-
*/
|
|
273
|
-
as?: string | default_2.ElementType;
|
|
274
|
-
/** Ekstra klassenavn */
|
|
275
|
-
className?: string;
|
|
276
|
-
/** Elementet som badge vil legges relativt til */
|
|
277
|
-
children: default_2.ReactNode;
|
|
278
|
-
/** Hvilken type badge man vil ha */
|
|
279
|
-
variant: 'primary' | 'neutral' | VariantType | typeof danger_4 | typeof info_4;
|
|
280
|
-
/** Skjul badge */
|
|
281
|
-
hide?: boolean;
|
|
282
|
-
};
|
|
283
|
-
|
|
284
|
-
export declare type StatusBadgeComponent = <T extends default_2.ElementType = typeof defaultElement_8>(props: StatusBadgeProps<T>) => default_2.ReactElement | null;
|
|
285
|
-
|
|
286
|
-
export declare type StatusBadgeProps<T extends default_2.ElementType> = PolymorphicComponentPropsWithRef<T, StatusBadgeBaseProps>;
|
|
287
|
-
|
|
288
|
-
export declare const Tag: <E extends default_2.ElementType = "div">({ className, children, compact, as, ...rest }: TagProps<E>) => JSX.Element;
|
|
289
|
-
|
|
290
|
-
export declare type TagOwnProps = {
|
|
291
|
-
/** HTML-elementet eller React-komponenten som rendres
|
|
292
|
-
* @default 'div'
|
|
293
|
-
*/
|
|
294
|
-
as?: string | default_2.ElementType;
|
|
295
|
-
/** Ekstra klassenavn */
|
|
296
|
-
className?: string;
|
|
297
|
-
/**Mindre og mer kompakt Tag, til f.eks. tabellbruk
|
|
298
|
-
* @default false
|
|
299
|
-
*/
|
|
300
|
-
compact?: boolean;
|
|
301
|
-
children: default_2.ReactNode;
|
|
302
|
-
};
|
|
303
|
-
|
|
304
|
-
export declare type TagProps<T extends default_2.ElementType = typeof defaultElement_9> = PolymorphicComponentProps<T, TagOwnProps>;
|
|
305
|
-
|
|
306
|
-
export declare const useContrast: () => boolean;
|
|
307
|
-
|
|
308
|
-
declare type VariantType = 'success' | 'negative' | 'warning' | 'information';
|
|
309
|
-
|
|
310
|
-
export { }
|
|
1
|
+
export * from './Contrast';
|
|
2
|
+
export * from './NavigationCard';
|
|
3
|
+
export * from './BaseCard';
|
|
4
|
+
export * from './MediaCard';
|
|
5
|
+
export * from './Badge/Badge';
|
|
6
|
+
export * from './Badge/BulletBadge';
|
|
7
|
+
export * from './Badge/NotificationBadge';
|
|
8
|
+
export * from './Badge/StatusBadge';
|
|
9
|
+
export * from './Tag';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@entur/layout",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.10",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
5
|
"main": "dist/layout.cjs.js",
|
|
6
6
|
"module": "dist/layout.esm.js",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"react-dom": ">=16.8.0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@entur/icons": "^8.0.
|
|
31
|
-
"@entur/tokens": "^3.19.
|
|
32
|
-
"@entur/typography": "^1.9.
|
|
33
|
-
"@entur/utils": "^0.12.
|
|
30
|
+
"@entur/icons": "^8.0.2",
|
|
31
|
+
"@entur/tokens": "^3.19.3",
|
|
32
|
+
"@entur/typography": "^1.9.14",
|
|
33
|
+
"@entur/utils": "^0.12.5",
|
|
34
34
|
"classnames": "^2.5.1"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"vite": "^7.1.3",
|
|
47
47
|
"vite-plugin-dts": "^4.5.4"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "5dd9d318f1d79f6f522f978de27b551fda1e91cc"
|
|
50
50
|
}
|