@entur/typography 1.10.0-beta.8 → 2.0.0-beta.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/README.md +37 -17
- package/dist/BaseHeading.d.ts +1 -1
- package/dist/Blockquote.d.ts +3 -4
- package/dist/CodeText.d.ts +1 -1
- package/dist/EmphasizedText.d.ts +1 -1
- package/dist/Heading1.d.ts +1 -1
- package/dist/Heading2.d.ts +1 -1
- package/dist/Heading3.d.ts +1 -1
- package/dist/Heading4.d.ts +1 -1
- package/dist/Heading5.d.ts +1 -1
- package/dist/Heading6.d.ts +1 -1
- package/dist/Label.d.ts +1 -1
- package/dist/LeadParagraph.d.ts +1 -1
- package/dist/Link.d.ts +1 -1
- package/dist/ListItem.d.ts +1 -1
- package/dist/NumberedList.d.ts +1 -1
- package/dist/Paragraph.d.ts +1 -1
- package/dist/PreformattedText.d.ts +1 -1
- package/dist/SmallText.d.ts +1 -1
- package/dist/StrongText.d.ts +1 -1
- package/dist/SubLabel.d.ts +1 -1
- package/dist/SubParagraph.d.ts +1 -1
- package/dist/UnorderedList.d.ts +1 -1
- package/dist/beta/cjs/components/Blockquote.cjs +29 -0
- package/dist/beta/cjs/components/Blockquote.cjs.map +1 -0
- package/dist/beta/cjs/components/Heading.cjs +37 -0
- package/dist/beta/cjs/components/Heading.cjs.map +1 -0
- package/dist/beta/cjs/components/Link.cjs +41 -0
- package/dist/beta/cjs/components/Link.cjs.map +1 -0
- package/dist/beta/cjs/components/ListItem.cjs +33 -0
- package/dist/beta/cjs/components/ListItem.cjs.map +1 -0
- package/dist/beta/cjs/components/NumberedList.cjs +32 -0
- package/dist/beta/cjs/components/NumberedList.cjs.map +1 -0
- package/dist/beta/cjs/components/Text.cjs +36 -0
- package/dist/beta/cjs/components/Text.cjs.map +1 -0
- package/dist/beta/cjs/components/UnorderedList.cjs +29 -0
- package/dist/beta/cjs/components/UnorderedList.cjs.map +1 -0
- package/dist/beta/cjs/index.cjs +18 -0
- package/dist/beta/cjs/index.cjs.map +1 -0
- package/dist/beta/cjs/utils/utils.cjs +77 -0
- package/dist/beta/cjs/utils/utils.cjs.map +1 -0
- package/dist/beta/esm/components/Blockquote.mjs +29 -0
- package/dist/beta/esm/components/Blockquote.mjs.map +1 -0
- package/dist/beta/esm/components/Heading.mjs +37 -0
- package/dist/beta/esm/components/Heading.mjs.map +1 -0
- package/dist/beta/esm/components/Link.mjs +41 -0
- package/dist/beta/esm/components/Link.mjs.map +1 -0
- package/dist/beta/esm/components/ListItem.mjs +33 -0
- package/dist/beta/esm/components/ListItem.mjs.map +1 -0
- package/dist/beta/esm/components/NumberedList.mjs +32 -0
- package/dist/beta/esm/components/NumberedList.mjs.map +1 -0
- package/dist/beta/esm/components/Text.mjs +36 -0
- package/dist/beta/esm/components/Text.mjs.map +1 -0
- package/dist/beta/esm/components/UnorderedList.mjs +29 -0
- package/dist/beta/esm/components/UnorderedList.mjs.map +1 -0
- package/dist/beta/esm/index.mjs +18 -0
- package/dist/beta/esm/index.mjs.map +1 -0
- package/dist/beta/esm/utils/utils.mjs +77 -0
- package/dist/beta/esm/utils/utils.mjs.map +1 -0
- package/dist/beta/styles/components/heading.css +458 -0
- package/dist/beta/styles/components/text.css +959 -0
- package/dist/beta/types/components/Blockquote.d.ts +12 -0
- package/dist/beta/{Heading.d.ts → types/components/Heading.d.ts} +2 -3
- package/dist/beta/types/components/Link.d.ts +22 -0
- package/dist/beta/types/components/ListItem.d.ts +22 -0
- package/dist/beta/types/components/NumberedList.d.ts +22 -0
- package/dist/beta/{Text.d.ts → types/components/Text.d.ts} +2 -3
- package/dist/beta/types/components/UnorderedList.d.ts +20 -0
- package/dist/beta/types/index.d.ts +8 -0
- package/dist/beta/types/utils/utils.d.ts +13 -0
- package/dist/index.d.ts +0 -5
- package/dist/styles.css +162 -820
- package/dist/typography.cjs.js +416 -0
- package/dist/typography.cjs.js.map +1 -0
- package/dist/typography.esm.js +392 -454
- package/dist/typography.esm.js.map +1 -1
- package/fonts/Entur-Nationale-Demibold.eot +0 -0
- package/fonts/Entur-Nationale-Demibold.woff +0 -0
- package/fonts/Entur-Nationale-Demibold.woff2 +0 -0
- package/fonts/Entur-Nationale-DemiboldItalic.eot +0 -0
- package/fonts/Entur-Nationale-DemiboldItalic.woff +0 -0
- package/fonts/Entur-Nationale-DemiboldItalic.woff2 +0 -0
- package/fonts/Entur-Nationale-Italic.eot +0 -0
- package/fonts/Entur-Nationale-Italic.woff +0 -0
- package/fonts/Entur-Nationale-Italic.woff2 +0 -0
- package/fonts/Entur-Nationale-Light.eot +0 -0
- package/fonts/Entur-Nationale-Light.woff +0 -0
- package/fonts/Entur-Nationale-Light.woff2 +0 -0
- package/fonts/Entur-Nationale-LightItalic.eot +0 -0
- package/fonts/Entur-Nationale-LightItalic.woff +0 -0
- package/fonts/Entur-Nationale-LightItalic.woff2 +0 -0
- package/fonts/Entur-Nationale-Medium.eot +0 -0
- package/fonts/Entur-Nationale-Medium.woff +0 -0
- package/fonts/Entur-Nationale-Medium.woff2 +0 -0
- package/fonts/Entur-Nationale-MediumItalic.eot +0 -0
- package/fonts/Entur-Nationale-MediumItalic.woff +0 -0
- package/fonts/Entur-Nationale-MediumItalic.woff2 +0 -0
- package/fonts/Entur-Nationale-Regular.eot +0 -0
- package/fonts/Entur-Nationale-Regular.woff +0 -0
- package/fonts/Entur-Nationale-Regular.woff2 +0 -0
- package/package.json +59 -19
- package/scripts/migrate-typography.js +415 -178
- package/dist/beta/BlockquoteBeta.d.ts +0 -12
- package/dist/beta/LinkBeta.d.ts +0 -16
- package/dist/beta/index.d.ts +0 -6
- package/dist/beta/utils.d.ts +0 -9
- package/dist/index.js +0 -8
- package/dist/typography.cjs.development.js +0 -508
- package/dist/typography.cjs.development.js.map +0 -1
- package/dist/typography.cjs.production.min.js +0 -2
- package/dist/typography.cjs.production.min.js.map +0 -1
- /package/dist/beta/{types.d.ts → types/types.d.ts} +0 -0
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export type BlockquotePropsBeta = {
|
|
3
|
-
/** Ekstra klassenavn */
|
|
4
|
-
className?: string;
|
|
5
|
-
} & React.DetailedHTMLProps<React.BlockquoteHTMLAttributes<HTMLQuoteElement>, HTMLQuoteElement>;
|
|
6
|
-
export declare const BlockquoteBeta: ({ className, ...rest }: BlockquotePropsBeta) => React.JSX.Element;
|
|
7
|
-
type BlockquoteFooterPropsBeta = {
|
|
8
|
-
/** Ekstra klassenavn */
|
|
9
|
-
className?: string;
|
|
10
|
-
} & React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>;
|
|
11
|
-
export declare const BlockquoteFooterBeta: ({ className, ...rest }: BlockquoteFooterPropsBeta) => React.JSX.Element;
|
|
12
|
-
export {};
|
package/dist/beta/LinkBeta.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { PolymorphicComponentProps } from '@entur/utils';
|
|
3
|
-
import { TypographySpacing } from './types';
|
|
4
|
-
type LinkBaseProps = {
|
|
5
|
-
external?: boolean;
|
|
6
|
-
/** Ekstra klassenavn */
|
|
7
|
-
className?: string;
|
|
8
|
-
/** Innholdet */
|
|
9
|
-
children: React.ReactNode;
|
|
10
|
-
/** Spacing around the component (same as Text and Heading components) */
|
|
11
|
-
spacing?: TypographySpacing;
|
|
12
|
-
ariaLabelExternalIcon?: string;
|
|
13
|
-
};
|
|
14
|
-
export type LinkPropsBeta<C extends React.ElementType> = PolymorphicComponentProps<C, LinkBaseProps>;
|
|
15
|
-
export declare const LinkBeta: <C extends React.ElementType = "a">({ external, ariaLabelExternalIcon, className, spacing, children, as, ...rest }: LinkPropsBeta<C>) => JSX.Element;
|
|
16
|
-
export {};
|
package/dist/beta/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { Heading } from './Heading';
|
|
2
|
-
export { Text } from './Text';
|
|
3
|
-
export { LinkBeta } from './LinkBeta';
|
|
4
|
-
export { BlockquoteBeta, BlockquoteFooterBeta } from './BlockquoteBeta';
|
|
5
|
-
export { getHeadingVariantFromSemanticType, getSpacingClasses } from './utils';
|
|
6
|
-
export type { TypographyHeadingVariant, TypographyTextVariant, TypographySize, TypographyWeight, TypographySpacing, } from './types';
|
package/dist/beta/utils.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { TypographySpacing } from './types';
|
|
2
|
-
export declare function getHeadingVariantFromSemanticType(semanticType: string | React.ElementType): "title-1" | "title-2" | "subtitle-1" | "subtitle-2" | "paragraph";
|
|
3
|
-
/**
|
|
4
|
-
* Generates spacing class names for typography components
|
|
5
|
-
* @param spacing - The spacing value from TypographySpacing
|
|
6
|
-
* @param componentPrefix - The CSS class prefix (e.g., 'eds-heading', 'eds-text')
|
|
7
|
-
* @returns Object with class names for the spacing prop
|
|
8
|
-
*/
|
|
9
|
-
export declare function getSpacingClasses(spacing: TypographySpacing | undefined, componentPrefix: string): Record<string, boolean> | undefined;
|
package/dist/index.js
DELETED
|
@@ -1,508 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var utils = require('@entur/utils');
|
|
6
|
-
var React = require('react');
|
|
7
|
-
var classNames = require('classnames');
|
|
8
|
-
var icons = require('@entur/icons');
|
|
9
|
-
|
|
10
|
-
function _extends() {
|
|
11
|
-
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
12
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
13
|
-
var t = arguments[e];
|
|
14
|
-
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
15
|
-
}
|
|
16
|
-
return n;
|
|
17
|
-
}, _extends.apply(null, arguments);
|
|
18
|
-
}
|
|
19
|
-
function _objectWithoutPropertiesLoose(r, e) {
|
|
20
|
-
if (null == r) return {};
|
|
21
|
-
var t = {};
|
|
22
|
-
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
23
|
-
if (-1 !== e.indexOf(n)) continue;
|
|
24
|
-
t[n] = r[n];
|
|
25
|
-
}
|
|
26
|
-
return t;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
var _excluded$p = ["className", "ref"],
|
|
30
|
-
_excluded2$1 = ["className"];
|
|
31
|
-
var Blockquote = function Blockquote(_ref) {
|
|
32
|
-
var className = _ref.className,
|
|
33
|
-
ref = _ref.ref,
|
|
34
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$p);
|
|
35
|
-
return React.createElement("blockquote", _extends({
|
|
36
|
-
className: classNames('eds-blockquote', className),
|
|
37
|
-
ref: ref
|
|
38
|
-
}, rest));
|
|
39
|
-
};
|
|
40
|
-
var BlockquoteFooter = function BlockquoteFooter(_ref2) {
|
|
41
|
-
var className = _ref2.className,
|
|
42
|
-
rest = _objectWithoutPropertiesLoose(_ref2, _excluded2$1);
|
|
43
|
-
return React.createElement("footer", _extends({
|
|
44
|
-
className: classNames('eds-blockquote__footer', className)
|
|
45
|
-
}, rest));
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
var _excluded$o = ["className", "as"];
|
|
49
|
-
var defaultElement$h = 'code';
|
|
50
|
-
var CodeText = function CodeText(_ref) {
|
|
51
|
-
var className = _ref.className,
|
|
52
|
-
as = _ref.as,
|
|
53
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$o);
|
|
54
|
-
var Element = as || defaultElement$h;
|
|
55
|
-
return React.createElement(Element, _extends({
|
|
56
|
-
className: classNames('eds-code-text', className)
|
|
57
|
-
}, rest));
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
var _excluded$n = ["className", "margin", "as"];
|
|
61
|
-
var defaultElement$g = 'em';
|
|
62
|
-
var EmphasizedText = function EmphasizedText(_ref) {
|
|
63
|
-
var _classNames;
|
|
64
|
-
var className = _ref.className,
|
|
65
|
-
_ref$margin = _ref.margin,
|
|
66
|
-
margin = _ref$margin === void 0 ? 'both' : _ref$margin,
|
|
67
|
-
as = _ref.as,
|
|
68
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$n);
|
|
69
|
-
var Element = as || defaultElement$g;
|
|
70
|
-
return React.createElement(Element, _extends({
|
|
71
|
-
className: classNames('eds-emphasized-text', (_classNames = {}, _classNames["eds-emphasized-text--margin-top"] = margin === 'top', _classNames["eds-emphasized-text--margin-bottom"] = margin === 'bottom', _classNames["eds-emphasized-text--margin-none"] = margin === 'none', _classNames), className)
|
|
72
|
-
}, rest));
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
var _excluded$m = ["className", "level", "margin", "as"];
|
|
76
|
-
var defaultElement$f = 'h1';
|
|
77
|
-
var BaseHeading = function BaseHeading(_ref) {
|
|
78
|
-
var _classNames;
|
|
79
|
-
var className = _ref.className,
|
|
80
|
-
level = _ref.level,
|
|
81
|
-
margin = _ref.margin,
|
|
82
|
-
as = _ref.as,
|
|
83
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$m);
|
|
84
|
-
var Element = as || defaultElement$f;
|
|
85
|
-
var baseClass = "eds-h" + level;
|
|
86
|
-
return React.createElement(Element, _extends({
|
|
87
|
-
className: classNames(baseClass, (_classNames = {}, _classNames[baseClass + "--margin-top"] = margin === 'top', _classNames[baseClass + "--margin-bottom"] = margin === 'bottom', _classNames[baseClass + "--margin-none"] = margin === 'none', _classNames), className)
|
|
88
|
-
}, rest));
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
var _excluded$l = ["margin", "children", "as"];
|
|
92
|
-
var defaultElement$e = 'h1';
|
|
93
|
-
var Heading1 = function Heading1(_ref) {
|
|
94
|
-
var _ref$margin = _ref.margin,
|
|
95
|
-
margin = _ref$margin === void 0 ? 'both' : _ref$margin,
|
|
96
|
-
children = _ref.children,
|
|
97
|
-
as = _ref.as,
|
|
98
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$l);
|
|
99
|
-
var Element = as || defaultElement$e;
|
|
100
|
-
return React.createElement(BaseHeading, _extends({
|
|
101
|
-
as: Element,
|
|
102
|
-
margin: margin
|
|
103
|
-
}, rest, {
|
|
104
|
-
level: 1
|
|
105
|
-
}), children);
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
var _excluded$k = ["margin", "children", "as"];
|
|
109
|
-
var defaultElement$d = 'h2';
|
|
110
|
-
var Heading2 = function Heading2(_ref) {
|
|
111
|
-
var _ref$margin = _ref.margin,
|
|
112
|
-
margin = _ref$margin === void 0 ? 'both' : _ref$margin,
|
|
113
|
-
children = _ref.children,
|
|
114
|
-
as = _ref.as,
|
|
115
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$k);
|
|
116
|
-
var Element = as || defaultElement$d;
|
|
117
|
-
return React.createElement(BaseHeading, _extends({
|
|
118
|
-
as: Element,
|
|
119
|
-
margin: margin
|
|
120
|
-
}, rest, {
|
|
121
|
-
level: 2
|
|
122
|
-
}), children);
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
var _excluded$j = ["margin", "children", "as"];
|
|
126
|
-
var defaultElement$c = 'h3';
|
|
127
|
-
var Heading3 = function Heading3(_ref) {
|
|
128
|
-
var _ref$margin = _ref.margin,
|
|
129
|
-
margin = _ref$margin === void 0 ? 'both' : _ref$margin,
|
|
130
|
-
children = _ref.children,
|
|
131
|
-
as = _ref.as,
|
|
132
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$j);
|
|
133
|
-
var Element = as || defaultElement$c;
|
|
134
|
-
return React.createElement(BaseHeading, _extends({
|
|
135
|
-
as: Element,
|
|
136
|
-
margin: margin
|
|
137
|
-
}, rest, {
|
|
138
|
-
level: 3
|
|
139
|
-
}), children);
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
var _excluded$i = ["margin", "children", "as"];
|
|
143
|
-
var defaultElement$b = 'h4';
|
|
144
|
-
var Heading4 = function Heading4(_ref) {
|
|
145
|
-
var _ref$margin = _ref.margin,
|
|
146
|
-
margin = _ref$margin === void 0 ? 'both' : _ref$margin,
|
|
147
|
-
children = _ref.children,
|
|
148
|
-
as = _ref.as,
|
|
149
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$i);
|
|
150
|
-
var Element = as || defaultElement$b;
|
|
151
|
-
return React.createElement(BaseHeading, _extends({
|
|
152
|
-
as: Element,
|
|
153
|
-
margin: margin
|
|
154
|
-
}, rest, {
|
|
155
|
-
level: 4
|
|
156
|
-
}), children);
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
var _excluded$h = ["margin", "children", "as"];
|
|
160
|
-
var defaultElement$a = 'h5';
|
|
161
|
-
var Heading5 = function Heading5(_ref) {
|
|
162
|
-
var _ref$margin = _ref.margin,
|
|
163
|
-
margin = _ref$margin === void 0 ? 'both' : _ref$margin,
|
|
164
|
-
children = _ref.children,
|
|
165
|
-
as = _ref.as,
|
|
166
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$h);
|
|
167
|
-
var Element = as || defaultElement$a;
|
|
168
|
-
return React.createElement(BaseHeading, _extends({
|
|
169
|
-
as: Element,
|
|
170
|
-
margin: margin
|
|
171
|
-
}, rest, {
|
|
172
|
-
level: 5
|
|
173
|
-
}), children);
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
var _excluded$g = ["margin", "children", "as"];
|
|
177
|
-
var defaultElement$9 = 'h6';
|
|
178
|
-
var Heading6 = function Heading6(_ref) {
|
|
179
|
-
var _ref$margin = _ref.margin,
|
|
180
|
-
margin = _ref$margin === void 0 ? 'both' : _ref$margin,
|
|
181
|
-
children = _ref.children,
|
|
182
|
-
as = _ref.as,
|
|
183
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$g);
|
|
184
|
-
var Element = as || defaultElement$9;
|
|
185
|
-
return React.createElement(BaseHeading, _extends({
|
|
186
|
-
as: Element,
|
|
187
|
-
margin: margin
|
|
188
|
-
}, rest, {
|
|
189
|
-
level: 6
|
|
190
|
-
}), children);
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
var _excluded$f = ["className", "margin", "as"];
|
|
194
|
-
var defaultElement$8 = 'label';
|
|
195
|
-
var Label = function Label(_ref) {
|
|
196
|
-
var _classNames;
|
|
197
|
-
var className = _ref.className,
|
|
198
|
-
_ref$margin = _ref.margin,
|
|
199
|
-
margin = _ref$margin === void 0 ? 'both' : _ref$margin,
|
|
200
|
-
as = _ref.as,
|
|
201
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$f);
|
|
202
|
-
var Element = as || defaultElement$8;
|
|
203
|
-
return React.createElement(Element, _extends({
|
|
204
|
-
className: classNames('eds-label', (_classNames = {}, _classNames["eds-label--margin-top"] = margin === 'top', _classNames["eds-label--margin-bottom"] = margin === 'bottom', _classNames["eds-label--margin-none"] = margin === 'none', _classNames), className)
|
|
205
|
-
}, rest));
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
var _excluded$e = ["className", "margin", "as"];
|
|
209
|
-
var defaultElement$7 = 'p';
|
|
210
|
-
var LeadParagraph = function LeadParagraph(_ref) {
|
|
211
|
-
var _classNames;
|
|
212
|
-
var className = _ref.className,
|
|
213
|
-
_ref$margin = _ref.margin,
|
|
214
|
-
margin = _ref$margin === void 0 ? 'both' : _ref$margin,
|
|
215
|
-
as = _ref.as,
|
|
216
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$e);
|
|
217
|
-
var Element = as || defaultElement$7;
|
|
218
|
-
return React.createElement(Element, _extends({
|
|
219
|
-
className: classNames('eds-lead-paragraph', (_classNames = {}, _classNames["eds-lead-paragraph--margin-top"] = margin === 'top', _classNames["eds-lead-paragraph--margin-bottom"] = margin === 'bottom', _classNames["eds-lead-paragraph--margin-none"] = margin === 'none', _classNames), className)
|
|
220
|
-
}, rest));
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
var _excluded$d = ["external", "ariaLabelExternalIcon", "className", "margin", "children", "as"];
|
|
224
|
-
var defaultElement$6 = 'a';
|
|
225
|
-
var Link = function Link(_ref) {
|
|
226
|
-
var _classNames;
|
|
227
|
-
var _ref$external = _ref.external,
|
|
228
|
-
external = _ref$external === void 0 ? false : _ref$external,
|
|
229
|
-
_ref$ariaLabelExterna = _ref.ariaLabelExternalIcon,
|
|
230
|
-
ariaLabelExternalIcon = _ref$ariaLabelExterna === void 0 ? '(ekstern lenke)' : _ref$ariaLabelExterna,
|
|
231
|
-
className = _ref.className,
|
|
232
|
-
_ref$margin = _ref.margin,
|
|
233
|
-
margin = _ref$margin === void 0 ? 'both' : _ref$margin,
|
|
234
|
-
children = _ref.children,
|
|
235
|
-
as = _ref.as,
|
|
236
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$d);
|
|
237
|
-
var Element = as || defaultElement$6;
|
|
238
|
-
return React.createElement(Element, _extends({
|
|
239
|
-
className: classNames('eds-link', (_classNames = {}, _classNames["eds-link--margin-top"] = margin === 'top', _classNames["eds-link--margin-bottom"] = margin === 'bottom', _classNames["eds-link--margin-none"] = margin === 'none', _classNames), className)
|
|
240
|
-
}, rest), children, external ? React.createElement(icons.ExternalIcon, {
|
|
241
|
-
className: "eds-link--ext-icon",
|
|
242
|
-
"aria-label": ariaLabelExternalIcon
|
|
243
|
-
}) : React.createElement(React.Fragment, null));
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
var _excluded$c = ["className", "margin", "as"];
|
|
247
|
-
var defaultElement$5 = 'strong';
|
|
248
|
-
var StrongText = function StrongText(_ref) {
|
|
249
|
-
var _classNames;
|
|
250
|
-
var className = _ref.className,
|
|
251
|
-
_ref$margin = _ref.margin,
|
|
252
|
-
margin = _ref$margin === void 0 ? 'both' : _ref$margin,
|
|
253
|
-
as = _ref.as,
|
|
254
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$c);
|
|
255
|
-
var Element = as || defaultElement$5;
|
|
256
|
-
return React.createElement(Element, _extends({
|
|
257
|
-
className: classNames('eds-strong-text', (_classNames = {}, _classNames["eds-strong-text--margin-top"] = margin === 'top', _classNames["eds-strong-text--margin-bottom"] = margin === 'bottom', _classNames["eds-strong-text--margin-none"] = margin === 'none', _classNames), className)
|
|
258
|
-
}, rest));
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
var _excluded$b = ["children", "className", "title"];
|
|
262
|
-
var ListItem = function ListItem(_ref) {
|
|
263
|
-
var children = _ref.children,
|
|
264
|
-
className = _ref.className,
|
|
265
|
-
title = _ref.title,
|
|
266
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$b);
|
|
267
|
-
return React.createElement("li", _extends({
|
|
268
|
-
className: classNames('eds-list-item', className)
|
|
269
|
-
}, rest), title && React.createElement(StrongText, {
|
|
270
|
-
className: "eds-list-item__title"
|
|
271
|
-
}, title), children);
|
|
272
|
-
};
|
|
273
|
-
|
|
274
|
-
var _excluded$a = ["className", "type"];
|
|
275
|
-
var NumberedList = function NumberedList(_ref) {
|
|
276
|
-
var _classNames;
|
|
277
|
-
var className = _ref.className,
|
|
278
|
-
_ref$type = _ref.type,
|
|
279
|
-
type = _ref$type === void 0 ? '1' : _ref$type,
|
|
280
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$a);
|
|
281
|
-
return React.createElement("ol", _extends({
|
|
282
|
-
className: classNames('eds-numbered-list', (_classNames = {}, _classNames["eds-numbered-list--type-" + type] = type, _classNames), className),
|
|
283
|
-
type: type
|
|
284
|
-
}, rest));
|
|
285
|
-
};
|
|
286
|
-
|
|
287
|
-
var _excluded$9 = ["margin", "className", "as"];
|
|
288
|
-
var defaultElement$4 = 'p';
|
|
289
|
-
var Paragraph = function Paragraph(_ref) {
|
|
290
|
-
var _ref$margin = _ref.margin,
|
|
291
|
-
margin = _ref$margin === void 0 ? 'bottom' : _ref$margin,
|
|
292
|
-
className = _ref.className,
|
|
293
|
-
as = _ref.as,
|
|
294
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$9);
|
|
295
|
-
var Element = as || defaultElement$4;
|
|
296
|
-
return React.createElement(Element, _extends({
|
|
297
|
-
className: classNames('eds-paragraph', {
|
|
298
|
-
'eds-paragraph--margin-bottom': margin === 'bottom',
|
|
299
|
-
'eds-paragraph--margin-none': margin === 'none'
|
|
300
|
-
}, className)
|
|
301
|
-
}, rest));
|
|
302
|
-
};
|
|
303
|
-
|
|
304
|
-
var _excluded$8 = ["className", "as"];
|
|
305
|
-
var defaultElement$3 = 'pre';
|
|
306
|
-
var PreformattedText = function PreformattedText(_ref) {
|
|
307
|
-
var className = _ref.className,
|
|
308
|
-
as = _ref.as,
|
|
309
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$8);
|
|
310
|
-
var Element = as || defaultElement$3;
|
|
311
|
-
return React.createElement(Element, _extends({
|
|
312
|
-
className: classNames('eds-preformatted-text', className)
|
|
313
|
-
}, rest));
|
|
314
|
-
};
|
|
315
|
-
|
|
316
|
-
var _excluded$7 = ["className", "margin", "as"];
|
|
317
|
-
var defaultElement$2 = 'span';
|
|
318
|
-
var SmallText = function SmallText(_ref) {
|
|
319
|
-
var _classNames;
|
|
320
|
-
var className = _ref.className,
|
|
321
|
-
_ref$margin = _ref.margin,
|
|
322
|
-
margin = _ref$margin === void 0 ? 'both' : _ref$margin,
|
|
323
|
-
as = _ref.as,
|
|
324
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
|
325
|
-
var Element = as || defaultElement$2;
|
|
326
|
-
return React.createElement(Element, _extends({
|
|
327
|
-
className: classNames('eds-small-text', (_classNames = {}, _classNames["eds-small-text--margin-top"] = margin === 'top', _classNames["eds-small-text--margin-bottom"] = margin === 'bottom', _classNames["eds-small-text--margin-none"] = margin === 'none', _classNames), className)
|
|
328
|
-
}, rest));
|
|
329
|
-
};
|
|
330
|
-
|
|
331
|
-
var _excluded$6 = ["className", "margin", "as"];
|
|
332
|
-
var defaultElement$1 = 'span';
|
|
333
|
-
var SubLabel = function SubLabel(_ref) {
|
|
334
|
-
var _classNames;
|
|
335
|
-
var className = _ref.className,
|
|
336
|
-
_ref$margin = _ref.margin,
|
|
337
|
-
margin = _ref$margin === void 0 ? 'both' : _ref$margin,
|
|
338
|
-
as = _ref.as,
|
|
339
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$6);
|
|
340
|
-
var Element = as || defaultElement$1;
|
|
341
|
-
return React.createElement(Element, _extends({
|
|
342
|
-
className: classNames('eds-sub-label', (_classNames = {}, _classNames["eds-sub-label--margin-top"] = margin === 'top', _classNames["eds-sub-label--margin-bottom"] = margin === 'bottom', _classNames["eds-sub-label--margin-none"] = margin === 'none', _classNames), className)
|
|
343
|
-
}, rest));
|
|
344
|
-
};
|
|
345
|
-
|
|
346
|
-
var _excluded$5 = ["className", "margin", "as"];
|
|
347
|
-
var defaultElement = 'p';
|
|
348
|
-
var SubParagraph = function SubParagraph(_ref) {
|
|
349
|
-
var _classNames;
|
|
350
|
-
var className = _ref.className,
|
|
351
|
-
margin = _ref.margin,
|
|
352
|
-
as = _ref.as,
|
|
353
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
354
|
-
var Element = as || defaultElement;
|
|
355
|
-
return React.createElement(Element, _extends({
|
|
356
|
-
className: classNames('eds-sub-paragraph', (_classNames = {}, _classNames["eds-sub-paragraph--margin-top"] = margin === 'top', _classNames["eds-sub-paragraph--margin-bottom"] = margin === 'bottom', _classNames["eds-sub-paragraph--margin-none"] = margin === 'none', _classNames), className)
|
|
357
|
-
}, rest));
|
|
358
|
-
};
|
|
359
|
-
|
|
360
|
-
var _excluded$4 = ["className"];
|
|
361
|
-
var UnorderedList = function UnorderedList(_ref) {
|
|
362
|
-
var className = _ref.className,
|
|
363
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
364
|
-
return React.createElement("ul", _extends({
|
|
365
|
-
className: classNames('eds-unordered-list', className)
|
|
366
|
-
}, rest));
|
|
367
|
-
};
|
|
368
|
-
|
|
369
|
-
function getHeadingVariantFromSemanticType(semanticType) {
|
|
370
|
-
// Handle string element types (like 'h1', 'div', 'span')
|
|
371
|
-
if (typeof semanticType === 'string') {
|
|
372
|
-
switch (semanticType) {
|
|
373
|
-
case 'h1':
|
|
374
|
-
return 'title-1';
|
|
375
|
-
case 'h2':
|
|
376
|
-
return 'title-2';
|
|
377
|
-
case 'h3':
|
|
378
|
-
return 'subtitle-1';
|
|
379
|
-
case 'h4':
|
|
380
|
-
return 'subtitle-2';
|
|
381
|
-
case 'p':
|
|
382
|
-
return 'paragraph';
|
|
383
|
-
default:
|
|
384
|
-
return 'title-1';
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
// Handle React component types (functions/classes) - default to 'title-1'
|
|
388
|
-
return 'title-1';
|
|
389
|
-
}
|
|
390
|
-
/**
|
|
391
|
-
* Generates spacing class names for typography components
|
|
392
|
-
* @param spacing - The spacing value from TypographySpacing
|
|
393
|
-
* @param componentPrefix - The CSS class prefix (e.g., 'eds-heading', 'eds-text')
|
|
394
|
-
* @returns Object with class names for the spacing prop
|
|
395
|
-
*/
|
|
396
|
-
function getSpacingClasses(spacing, componentPrefix) {
|
|
397
|
-
var _ref;
|
|
398
|
-
if (!spacing) return undefined;
|
|
399
|
-
return _ref = {}, _ref[componentPrefix + "--spacing-none"] = spacing === 'none', _ref[componentPrefix + "--spacing-xs2"] = spacing === 'xs2', _ref[componentPrefix + "--spacing-xs2-top"] = spacing === 'xs2-top', _ref[componentPrefix + "--spacing-xs2-bottom"] = spacing === 'xs2-bottom', _ref[componentPrefix + "--spacing-xs"] = spacing === 'xs', _ref[componentPrefix + "--spacing-xs-top"] = spacing === 'xs-top', _ref[componentPrefix + "--spacing-xs-bottom"] = spacing === 'xs-bottom', _ref[componentPrefix + "--spacing-sm"] = spacing === 'sm', _ref[componentPrefix + "--spacing-sm-top"] = spacing === 'sm-top', _ref[componentPrefix + "--spacing-sm-bottom"] = spacing === 'sm-bottom', _ref[componentPrefix + "--spacing-md"] = spacing === 'md', _ref[componentPrefix + "--spacing-md-top"] = spacing === 'md-top', _ref[componentPrefix + "--spacing-md-bottom"] = spacing === 'md-bottom', _ref[componentPrefix + "--spacing-lg"] = spacing === 'lg', _ref[componentPrefix + "--spacing-lg-top"] = spacing === 'lg-top', _ref[componentPrefix + "--spacing-lg-bottom"] = spacing === 'lg-bottom', _ref[componentPrefix + "--spacing-xl"] = spacing === 'xl', _ref[componentPrefix + "--spacing-xl-top"] = spacing === 'xl-top', _ref[componentPrefix + "--spacing-xl-bottom"] = spacing === 'xl-bottom', _ref;
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
var _excluded$3 = ["children", "as", "size", "variant", "weight", "spacing", "className"];
|
|
403
|
-
var TypographyText = function TypographyText(_ref) {
|
|
404
|
-
var children = _ref.children,
|
|
405
|
-
as = _ref.as,
|
|
406
|
-
size = _ref.size,
|
|
407
|
-
variant = _ref.variant,
|
|
408
|
-
_ref$weight = _ref.weight,
|
|
409
|
-
weight = _ref$weight === void 0 ? 'medium' : _ref$weight,
|
|
410
|
-
spacing = _ref.spacing,
|
|
411
|
-
className = _ref.className,
|
|
412
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
413
|
-
var BodyElement = as || 'p';
|
|
414
|
-
return React.createElement(BodyElement, _extends({
|
|
415
|
-
className: classNames('eds-text', variant && "eds-text--" + variant, size && "eds-text--" + size, weight && "eds-text--weight-" + weight, getSpacingClasses(spacing, 'eds-text'), className)
|
|
416
|
-
}, rest), children);
|
|
417
|
-
};
|
|
418
|
-
// Export as Text to avoid DOM conflicts
|
|
419
|
-
var Text = TypographyText;
|
|
420
|
-
|
|
421
|
-
var _excluded$2 = ["children", "as", "size", "variant", "spacing", "className"];
|
|
422
|
-
var Heading = function Heading(_ref) {
|
|
423
|
-
var _classNames, _classNames2;
|
|
424
|
-
var children = _ref.children,
|
|
425
|
-
as = _ref.as,
|
|
426
|
-
size = _ref.size,
|
|
427
|
-
variant = _ref.variant,
|
|
428
|
-
spacing = _ref.spacing,
|
|
429
|
-
className = _ref.className,
|
|
430
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
431
|
-
var HeadingElement = as || 'h1';
|
|
432
|
-
// Function to determine the variant based on the semantic type
|
|
433
|
-
var usedVariant = variant != null ? variant : getHeadingVariantFromSemanticType(HeadingElement);
|
|
434
|
-
// When size is explicitly provided, it should override variant styling
|
|
435
|
-
var shouldUseSize = size !== undefined;
|
|
436
|
-
return React.createElement(HeadingElement, _extends({
|
|
437
|
-
className: classNames('eds-heading', (_classNames = {}, _classNames["eds-heading--" + usedVariant] = !shouldUseSize, _classNames), (_classNames2 = {}, _classNames2["eds-heading--" + size] = shouldUseSize && size, _classNames2), getSpacingClasses(spacing, 'eds-heading'), className)
|
|
438
|
-
}, rest), children);
|
|
439
|
-
};
|
|
440
|
-
|
|
441
|
-
var _excluded$1 = ["className"],
|
|
442
|
-
_excluded2 = ["className"];
|
|
443
|
-
var BlockquoteBeta = function BlockquoteBeta(_ref) {
|
|
444
|
-
var className = _ref.className,
|
|
445
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
446
|
-
return React.createElement("blockquote", _extends({
|
|
447
|
-
className: classNames('eds-text--blockquote', className)
|
|
448
|
-
}, rest));
|
|
449
|
-
};
|
|
450
|
-
var BlockquoteFooterBeta = function BlockquoteFooterBeta(_ref2) {
|
|
451
|
-
var className = _ref2.className,
|
|
452
|
-
rest = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
453
|
-
return React.createElement("footer", _extends({
|
|
454
|
-
className: classNames('eds-text--blockquote__footer', className)
|
|
455
|
-
}, rest));
|
|
456
|
-
};
|
|
457
|
-
|
|
458
|
-
var _excluded = ["external", "ariaLabelExternalIcon", "className", "spacing", "children", "as"];
|
|
459
|
-
var LinkBeta = function LinkBeta(_ref) {
|
|
460
|
-
var _ref$external = _ref.external,
|
|
461
|
-
external = _ref$external === void 0 ? false : _ref$external,
|
|
462
|
-
_ref$ariaLabelExterna = _ref.ariaLabelExternalIcon,
|
|
463
|
-
ariaLabelExternalIcon = _ref$ariaLabelExterna === void 0 ? '(ekstern lenke)' : _ref$ariaLabelExterna,
|
|
464
|
-
className = _ref.className,
|
|
465
|
-
spacing = _ref.spacing,
|
|
466
|
-
children = _ref.children,
|
|
467
|
-
as = _ref.as,
|
|
468
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
469
|
-
var LinkElement = as || 'a';
|
|
470
|
-
return React.createElement(LinkElement, _extends({
|
|
471
|
-
className: classNames('eds-text--link', getSpacingClasses(spacing, 'eds-text--link'), className)
|
|
472
|
-
}, rest), children, external ? React.createElement(icons.ExternalIcon, {
|
|
473
|
-
className: "eds-text--link--ext-icon",
|
|
474
|
-
"aria-label": ariaLabelExternalIcon
|
|
475
|
-
}) : null);
|
|
476
|
-
};
|
|
477
|
-
|
|
478
|
-
utils.warnAboutMissingStyles('typography');
|
|
479
|
-
// migration helpers - use @entur/typography/migration for migration support
|
|
480
|
-
|
|
481
|
-
exports.Blockquote = Blockquote;
|
|
482
|
-
exports.BlockquoteBeta = BlockquoteBeta;
|
|
483
|
-
exports.BlockquoteFooter = BlockquoteFooter;
|
|
484
|
-
exports.BlockquoteFooterBeta = BlockquoteFooterBeta;
|
|
485
|
-
exports.CodeText = CodeText;
|
|
486
|
-
exports.EmphasizedText = EmphasizedText;
|
|
487
|
-
exports.Heading = Heading;
|
|
488
|
-
exports.Heading1 = Heading1;
|
|
489
|
-
exports.Heading2 = Heading2;
|
|
490
|
-
exports.Heading3 = Heading3;
|
|
491
|
-
exports.Heading4 = Heading4;
|
|
492
|
-
exports.Heading5 = Heading5;
|
|
493
|
-
exports.Heading6 = Heading6;
|
|
494
|
-
exports.Label = Label;
|
|
495
|
-
exports.LeadParagraph = LeadParagraph;
|
|
496
|
-
exports.Link = Link;
|
|
497
|
-
exports.LinkBeta = LinkBeta;
|
|
498
|
-
exports.ListItem = ListItem;
|
|
499
|
-
exports.NumberedList = NumberedList;
|
|
500
|
-
exports.Paragraph = Paragraph;
|
|
501
|
-
exports.PreformattedText = PreformattedText;
|
|
502
|
-
exports.SmallText = SmallText;
|
|
503
|
-
exports.StrongText = StrongText;
|
|
504
|
-
exports.SubLabel = SubLabel;
|
|
505
|
-
exports.SubParagraph = SubParagraph;
|
|
506
|
-
exports.Text = Text;
|
|
507
|
-
exports.UnorderedList = UnorderedList;
|
|
508
|
-
//# sourceMappingURL=typography.cjs.development.js.map
|