@entur/typography 1.10.0-beta.1 → 1.10.0-beta.11
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 +12 -11
- package/dist/beta/ListItemBeta.d.ts +16 -0
- package/dist/beta/NumberedListBeta.d.ts +16 -0
- package/dist/beta/UnorderedListBeta.d.ts +14 -0
- package/dist/beta/index.d.ts +3 -0
- package/dist/beta/utils.d.ts +2 -1
- package/dist/index.d.ts +3 -0
- package/dist/styles.css +78 -0
- package/dist/typography.cjs.development.js +125 -54
- package/dist/typography.cjs.development.js.map +1 -1
- package/dist/typography.cjs.production.min.js +1 -1
- package/dist/typography.cjs.production.min.js.map +1 -1
- package/dist/typography.esm.js +123 -55
- package/dist/typography.esm.js.map +1 -1
- package/package.json +6 -2
- package/scripts/migrate-typography.js +593 -155
|
@@ -26,12 +26,12 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
26
26
|
return t;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
var _excluded$
|
|
29
|
+
var _excluded$s = ["className", "ref"],
|
|
30
30
|
_excluded2$1 = ["className"];
|
|
31
31
|
var Blockquote = function Blockquote(_ref) {
|
|
32
32
|
var className = _ref.className,
|
|
33
33
|
ref = _ref.ref,
|
|
34
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
34
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$s);
|
|
35
35
|
return React.createElement("blockquote", _extends({
|
|
36
36
|
className: classNames('eds-blockquote', className),
|
|
37
37
|
ref: ref
|
|
@@ -45,19 +45,19 @@ var BlockquoteFooter = function BlockquoteFooter(_ref2) {
|
|
|
45
45
|
}, rest));
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
var _excluded$
|
|
48
|
+
var _excluded$r = ["className", "as"];
|
|
49
49
|
var defaultElement$h = 'code';
|
|
50
50
|
var CodeText = function CodeText(_ref) {
|
|
51
51
|
var className = _ref.className,
|
|
52
52
|
as = _ref.as,
|
|
53
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
53
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$r);
|
|
54
54
|
var Element = as || defaultElement$h;
|
|
55
55
|
return React.createElement(Element, _extends({
|
|
56
56
|
className: classNames('eds-code-text', className)
|
|
57
57
|
}, rest));
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
-
var _excluded$
|
|
60
|
+
var _excluded$q = ["className", "margin", "as"];
|
|
61
61
|
var defaultElement$g = 'em';
|
|
62
62
|
var EmphasizedText = function EmphasizedText(_ref) {
|
|
63
63
|
var _classNames;
|
|
@@ -65,14 +65,14 @@ var EmphasizedText = function EmphasizedText(_ref) {
|
|
|
65
65
|
_ref$margin = _ref.margin,
|
|
66
66
|
margin = _ref$margin === void 0 ? 'both' : _ref$margin,
|
|
67
67
|
as = _ref.as,
|
|
68
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
68
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$q);
|
|
69
69
|
var Element = as || defaultElement$g;
|
|
70
70
|
return React.createElement(Element, _extends({
|
|
71
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
72
|
}, rest));
|
|
73
73
|
};
|
|
74
74
|
|
|
75
|
-
var _excluded$
|
|
75
|
+
var _excluded$p = ["className", "level", "margin", "as"];
|
|
76
76
|
var defaultElement$f = 'h1';
|
|
77
77
|
var BaseHeading = function BaseHeading(_ref) {
|
|
78
78
|
var _classNames;
|
|
@@ -80,7 +80,7 @@ var BaseHeading = function BaseHeading(_ref) {
|
|
|
80
80
|
level = _ref.level,
|
|
81
81
|
margin = _ref.margin,
|
|
82
82
|
as = _ref.as,
|
|
83
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
83
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$p);
|
|
84
84
|
var Element = as || defaultElement$f;
|
|
85
85
|
var baseClass = "eds-h" + level;
|
|
86
86
|
return React.createElement(Element, _extends({
|
|
@@ -88,14 +88,14 @@ var BaseHeading = function BaseHeading(_ref) {
|
|
|
88
88
|
}, rest));
|
|
89
89
|
};
|
|
90
90
|
|
|
91
|
-
var _excluded$
|
|
91
|
+
var _excluded$o = ["margin", "children", "as"];
|
|
92
92
|
var defaultElement$e = 'h1';
|
|
93
93
|
var Heading1 = function Heading1(_ref) {
|
|
94
94
|
var _ref$margin = _ref.margin,
|
|
95
95
|
margin = _ref$margin === void 0 ? 'both' : _ref$margin,
|
|
96
96
|
children = _ref.children,
|
|
97
97
|
as = _ref.as,
|
|
98
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
98
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$o);
|
|
99
99
|
var Element = as || defaultElement$e;
|
|
100
100
|
return React.createElement(BaseHeading, _extends({
|
|
101
101
|
as: Element,
|
|
@@ -105,14 +105,14 @@ var Heading1 = function Heading1(_ref) {
|
|
|
105
105
|
}), children);
|
|
106
106
|
};
|
|
107
107
|
|
|
108
|
-
var _excluded$
|
|
108
|
+
var _excluded$n = ["margin", "children", "as"];
|
|
109
109
|
var defaultElement$d = 'h2';
|
|
110
110
|
var Heading2 = function Heading2(_ref) {
|
|
111
111
|
var _ref$margin = _ref.margin,
|
|
112
112
|
margin = _ref$margin === void 0 ? 'both' : _ref$margin,
|
|
113
113
|
children = _ref.children,
|
|
114
114
|
as = _ref.as,
|
|
115
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
115
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$n);
|
|
116
116
|
var Element = as || defaultElement$d;
|
|
117
117
|
return React.createElement(BaseHeading, _extends({
|
|
118
118
|
as: Element,
|
|
@@ -122,14 +122,14 @@ var Heading2 = function Heading2(_ref) {
|
|
|
122
122
|
}), children);
|
|
123
123
|
};
|
|
124
124
|
|
|
125
|
-
var _excluded$
|
|
125
|
+
var _excluded$m = ["margin", "children", "as"];
|
|
126
126
|
var defaultElement$c = 'h3';
|
|
127
127
|
var Heading3 = function Heading3(_ref) {
|
|
128
128
|
var _ref$margin = _ref.margin,
|
|
129
129
|
margin = _ref$margin === void 0 ? 'both' : _ref$margin,
|
|
130
130
|
children = _ref.children,
|
|
131
131
|
as = _ref.as,
|
|
132
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
132
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$m);
|
|
133
133
|
var Element = as || defaultElement$c;
|
|
134
134
|
return React.createElement(BaseHeading, _extends({
|
|
135
135
|
as: Element,
|
|
@@ -139,14 +139,14 @@ var Heading3 = function Heading3(_ref) {
|
|
|
139
139
|
}), children);
|
|
140
140
|
};
|
|
141
141
|
|
|
142
|
-
var _excluded$
|
|
142
|
+
var _excluded$l = ["margin", "children", "as"];
|
|
143
143
|
var defaultElement$b = 'h4';
|
|
144
144
|
var Heading4 = function Heading4(_ref) {
|
|
145
145
|
var _ref$margin = _ref.margin,
|
|
146
146
|
margin = _ref$margin === void 0 ? 'both' : _ref$margin,
|
|
147
147
|
children = _ref.children,
|
|
148
148
|
as = _ref.as,
|
|
149
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
149
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$l);
|
|
150
150
|
var Element = as || defaultElement$b;
|
|
151
151
|
return React.createElement(BaseHeading, _extends({
|
|
152
152
|
as: Element,
|
|
@@ -156,14 +156,14 @@ var Heading4 = function Heading4(_ref) {
|
|
|
156
156
|
}), children);
|
|
157
157
|
};
|
|
158
158
|
|
|
159
|
-
var _excluded$
|
|
159
|
+
var _excluded$k = ["margin", "children", "as"];
|
|
160
160
|
var defaultElement$a = 'h5';
|
|
161
161
|
var Heading5 = function Heading5(_ref) {
|
|
162
162
|
var _ref$margin = _ref.margin,
|
|
163
163
|
margin = _ref$margin === void 0 ? 'both' : _ref$margin,
|
|
164
164
|
children = _ref.children,
|
|
165
165
|
as = _ref.as,
|
|
166
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
166
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$k);
|
|
167
167
|
var Element = as || defaultElement$a;
|
|
168
168
|
return React.createElement(BaseHeading, _extends({
|
|
169
169
|
as: Element,
|
|
@@ -173,14 +173,14 @@ var Heading5 = function Heading5(_ref) {
|
|
|
173
173
|
}), children);
|
|
174
174
|
};
|
|
175
175
|
|
|
176
|
-
var _excluded$
|
|
176
|
+
var _excluded$j = ["margin", "children", "as"];
|
|
177
177
|
var defaultElement$9 = 'h6';
|
|
178
178
|
var Heading6 = function Heading6(_ref) {
|
|
179
179
|
var _ref$margin = _ref.margin,
|
|
180
180
|
margin = _ref$margin === void 0 ? 'both' : _ref$margin,
|
|
181
181
|
children = _ref.children,
|
|
182
182
|
as = _ref.as,
|
|
183
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
183
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$j);
|
|
184
184
|
var Element = as || defaultElement$9;
|
|
185
185
|
return React.createElement(BaseHeading, _extends({
|
|
186
186
|
as: Element,
|
|
@@ -190,7 +190,7 @@ var Heading6 = function Heading6(_ref) {
|
|
|
190
190
|
}), children);
|
|
191
191
|
};
|
|
192
192
|
|
|
193
|
-
var _excluded$
|
|
193
|
+
var _excluded$i = ["className", "margin", "as"];
|
|
194
194
|
var defaultElement$8 = 'label';
|
|
195
195
|
var Label = function Label(_ref) {
|
|
196
196
|
var _classNames;
|
|
@@ -198,14 +198,14 @@ var Label = function Label(_ref) {
|
|
|
198
198
|
_ref$margin = _ref.margin,
|
|
199
199
|
margin = _ref$margin === void 0 ? 'both' : _ref$margin,
|
|
200
200
|
as = _ref.as,
|
|
201
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
201
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$i);
|
|
202
202
|
var Element = as || defaultElement$8;
|
|
203
203
|
return React.createElement(Element, _extends({
|
|
204
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
205
|
}, rest));
|
|
206
206
|
};
|
|
207
207
|
|
|
208
|
-
var _excluded$
|
|
208
|
+
var _excluded$h = ["className", "margin", "as"];
|
|
209
209
|
var defaultElement$7 = 'p';
|
|
210
210
|
var LeadParagraph = function LeadParagraph(_ref) {
|
|
211
211
|
var _classNames;
|
|
@@ -213,14 +213,14 @@ var LeadParagraph = function LeadParagraph(_ref) {
|
|
|
213
213
|
_ref$margin = _ref.margin,
|
|
214
214
|
margin = _ref$margin === void 0 ? 'both' : _ref$margin,
|
|
215
215
|
as = _ref.as,
|
|
216
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
216
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$h);
|
|
217
217
|
var Element = as || defaultElement$7;
|
|
218
218
|
return React.createElement(Element, _extends({
|
|
219
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
220
|
}, rest));
|
|
221
221
|
};
|
|
222
222
|
|
|
223
|
-
var _excluded$
|
|
223
|
+
var _excluded$g = ["external", "ariaLabelExternalIcon", "className", "margin", "children", "as"];
|
|
224
224
|
var defaultElement$6 = 'a';
|
|
225
225
|
var Link = function Link(_ref) {
|
|
226
226
|
var _classNames;
|
|
@@ -233,7 +233,7 @@ var Link = function Link(_ref) {
|
|
|
233
233
|
margin = _ref$margin === void 0 ? 'both' : _ref$margin,
|
|
234
234
|
children = _ref.children,
|
|
235
235
|
as = _ref.as,
|
|
236
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
236
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$g);
|
|
237
237
|
var Element = as || defaultElement$6;
|
|
238
238
|
return React.createElement(Element, _extends({
|
|
239
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)
|
|
@@ -243,7 +243,7 @@ var Link = function Link(_ref) {
|
|
|
243
243
|
}) : React.createElement(React.Fragment, null));
|
|
244
244
|
};
|
|
245
245
|
|
|
246
|
-
var _excluded$
|
|
246
|
+
var _excluded$f = ["className", "margin", "as"];
|
|
247
247
|
var defaultElement$5 = 'strong';
|
|
248
248
|
var StrongText = function StrongText(_ref) {
|
|
249
249
|
var _classNames;
|
|
@@ -251,19 +251,19 @@ var StrongText = function StrongText(_ref) {
|
|
|
251
251
|
_ref$margin = _ref.margin,
|
|
252
252
|
margin = _ref$margin === void 0 ? 'both' : _ref$margin,
|
|
253
253
|
as = _ref.as,
|
|
254
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
254
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$f);
|
|
255
255
|
var Element = as || defaultElement$5;
|
|
256
256
|
return React.createElement(Element, _extends({
|
|
257
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
258
|
}, rest));
|
|
259
259
|
};
|
|
260
260
|
|
|
261
|
-
var _excluded$
|
|
261
|
+
var _excluded$e = ["children", "className", "title"];
|
|
262
262
|
var ListItem = function ListItem(_ref) {
|
|
263
263
|
var children = _ref.children,
|
|
264
264
|
className = _ref.className,
|
|
265
265
|
title = _ref.title,
|
|
266
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
266
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$e);
|
|
267
267
|
return React.createElement("li", _extends({
|
|
268
268
|
className: classNames('eds-list-item', className)
|
|
269
269
|
}, rest), title && React.createElement(StrongText, {
|
|
@@ -271,27 +271,27 @@ var ListItem = function ListItem(_ref) {
|
|
|
271
271
|
}, title), children);
|
|
272
272
|
};
|
|
273
273
|
|
|
274
|
-
var _excluded$
|
|
274
|
+
var _excluded$d = ["className", "type"];
|
|
275
275
|
var NumberedList = function NumberedList(_ref) {
|
|
276
276
|
var _classNames;
|
|
277
277
|
var className = _ref.className,
|
|
278
278
|
_ref$type = _ref.type,
|
|
279
279
|
type = _ref$type === void 0 ? '1' : _ref$type,
|
|
280
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
280
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$d);
|
|
281
281
|
return React.createElement("ol", _extends({
|
|
282
282
|
className: classNames('eds-numbered-list', (_classNames = {}, _classNames["eds-numbered-list--type-" + type] = type, _classNames), className),
|
|
283
283
|
type: type
|
|
284
284
|
}, rest));
|
|
285
285
|
};
|
|
286
286
|
|
|
287
|
-
var _excluded$
|
|
287
|
+
var _excluded$c = ["margin", "className", "as"];
|
|
288
288
|
var defaultElement$4 = 'p';
|
|
289
289
|
var Paragraph = function Paragraph(_ref) {
|
|
290
290
|
var _ref$margin = _ref.margin,
|
|
291
291
|
margin = _ref$margin === void 0 ? 'bottom' : _ref$margin,
|
|
292
292
|
className = _ref.className,
|
|
293
293
|
as = _ref.as,
|
|
294
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
294
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$c);
|
|
295
295
|
var Element = as || defaultElement$4;
|
|
296
296
|
return React.createElement(Element, _extends({
|
|
297
297
|
className: classNames('eds-paragraph', {
|
|
@@ -301,19 +301,19 @@ var Paragraph = function Paragraph(_ref) {
|
|
|
301
301
|
}, rest));
|
|
302
302
|
};
|
|
303
303
|
|
|
304
|
-
var _excluded$
|
|
304
|
+
var _excluded$b = ["className", "as"];
|
|
305
305
|
var defaultElement$3 = 'pre';
|
|
306
306
|
var PreformattedText = function PreformattedText(_ref) {
|
|
307
307
|
var className = _ref.className,
|
|
308
308
|
as = _ref.as,
|
|
309
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
309
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$b);
|
|
310
310
|
var Element = as || defaultElement$3;
|
|
311
311
|
return React.createElement(Element, _extends({
|
|
312
312
|
className: classNames('eds-preformatted-text', className)
|
|
313
313
|
}, rest));
|
|
314
314
|
};
|
|
315
315
|
|
|
316
|
-
var _excluded$
|
|
316
|
+
var _excluded$a = ["className", "margin", "as"];
|
|
317
317
|
var defaultElement$2 = 'span';
|
|
318
318
|
var SmallText = function SmallText(_ref) {
|
|
319
319
|
var _classNames;
|
|
@@ -321,14 +321,14 @@ var SmallText = function SmallText(_ref) {
|
|
|
321
321
|
_ref$margin = _ref.margin,
|
|
322
322
|
margin = _ref$margin === void 0 ? 'both' : _ref$margin,
|
|
323
323
|
as = _ref.as,
|
|
324
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
324
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$a);
|
|
325
325
|
var Element = as || defaultElement$2;
|
|
326
326
|
return React.createElement(Element, _extends({
|
|
327
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
328
|
}, rest));
|
|
329
329
|
};
|
|
330
330
|
|
|
331
|
-
var _excluded$
|
|
331
|
+
var _excluded$9 = ["className", "margin", "as"];
|
|
332
332
|
var defaultElement$1 = 'span';
|
|
333
333
|
var SubLabel = function SubLabel(_ref) {
|
|
334
334
|
var _classNames;
|
|
@@ -336,31 +336,31 @@ var SubLabel = function SubLabel(_ref) {
|
|
|
336
336
|
_ref$margin = _ref.margin,
|
|
337
337
|
margin = _ref$margin === void 0 ? 'both' : _ref$margin,
|
|
338
338
|
as = _ref.as,
|
|
339
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
339
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$9);
|
|
340
340
|
var Element = as || defaultElement$1;
|
|
341
341
|
return React.createElement(Element, _extends({
|
|
342
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
343
|
}, rest));
|
|
344
344
|
};
|
|
345
345
|
|
|
346
|
-
var _excluded$
|
|
346
|
+
var _excluded$8 = ["className", "margin", "as"];
|
|
347
347
|
var defaultElement = 'p';
|
|
348
348
|
var SubParagraph = function SubParagraph(_ref) {
|
|
349
349
|
var _classNames;
|
|
350
350
|
var className = _ref.className,
|
|
351
351
|
margin = _ref.margin,
|
|
352
352
|
as = _ref.as,
|
|
353
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
353
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$8);
|
|
354
354
|
var Element = as || defaultElement;
|
|
355
355
|
return React.createElement(Element, _extends({
|
|
356
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
357
|
}, rest));
|
|
358
358
|
};
|
|
359
359
|
|
|
360
|
-
var _excluded$
|
|
360
|
+
var _excluded$7 = ["className"];
|
|
361
361
|
var UnorderedList = function UnorderedList(_ref) {
|
|
362
362
|
var className = _ref.className,
|
|
363
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
363
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
|
364
364
|
return React.createElement("ul", _extends({
|
|
365
365
|
className: classNames('eds-unordered-list', className)
|
|
366
366
|
}, rest));
|
|
@@ -387,6 +387,29 @@ function getHeadingVariantFromSemanticType(semanticType) {
|
|
|
387
387
|
// Handle React component types (functions/classes) - default to 'title-1'
|
|
388
388
|
return 'title-1';
|
|
389
389
|
}
|
|
390
|
+
function getSemanticTypeFromTextVariant(variant) {
|
|
391
|
+
switch (variant) {
|
|
392
|
+
case 'paragraph':
|
|
393
|
+
case 'subparagraph':
|
|
394
|
+
case 'leading':
|
|
395
|
+
case 'quote':
|
|
396
|
+
return 'p';
|
|
397
|
+
case 'caption':
|
|
398
|
+
case 'sublabel':
|
|
399
|
+
return 'small';
|
|
400
|
+
case 'label':
|
|
401
|
+
return 'span';
|
|
402
|
+
case 'overline':
|
|
403
|
+
return 'em';
|
|
404
|
+
case 'emphasized':
|
|
405
|
+
case 'code-text':
|
|
406
|
+
return 'code';
|
|
407
|
+
case 'preformatted-text':
|
|
408
|
+
return 'pre';
|
|
409
|
+
default:
|
|
410
|
+
return 'p';
|
|
411
|
+
}
|
|
412
|
+
}
|
|
390
413
|
/**
|
|
391
414
|
* Generates spacing class names for typography components
|
|
392
415
|
* @param spacing - The spacing value from TypographySpacing
|
|
@@ -399,7 +422,7 @@ function getSpacingClasses(spacing, componentPrefix) {
|
|
|
399
422
|
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
423
|
}
|
|
401
424
|
|
|
402
|
-
var _excluded$
|
|
425
|
+
var _excluded$6 = ["children", "as", "size", "variant", "weight", "spacing", "className"];
|
|
403
426
|
var TypographyText = function TypographyText(_ref) {
|
|
404
427
|
var children = _ref.children,
|
|
405
428
|
as = _ref.as,
|
|
@@ -409,8 +432,8 @@ var TypographyText = function TypographyText(_ref) {
|
|
|
409
432
|
weight = _ref$weight === void 0 ? 'medium' : _ref$weight,
|
|
410
433
|
spacing = _ref.spacing,
|
|
411
434
|
className = _ref.className,
|
|
412
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
413
|
-
var BodyElement = as ||
|
|
435
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$6);
|
|
436
|
+
var BodyElement = as || getSemanticTypeFromTextVariant(variant);
|
|
414
437
|
return React.createElement(BodyElement, _extends({
|
|
415
438
|
className: classNames('eds-text', variant && "eds-text--" + variant, size && "eds-text--" + size, weight && "eds-text--weight-" + weight, getSpacingClasses(spacing, 'eds-text'), className)
|
|
416
439
|
}, rest), children);
|
|
@@ -418,7 +441,7 @@ var TypographyText = function TypographyText(_ref) {
|
|
|
418
441
|
// Export as Text to avoid DOM conflicts
|
|
419
442
|
var Text = TypographyText;
|
|
420
443
|
|
|
421
|
-
var _excluded$
|
|
444
|
+
var _excluded$5 = ["children", "as", "size", "variant", "spacing", "className"];
|
|
422
445
|
var Heading = function Heading(_ref) {
|
|
423
446
|
var _classNames, _classNames2;
|
|
424
447
|
var children = _ref.children,
|
|
@@ -427,7 +450,7 @@ var Heading = function Heading(_ref) {
|
|
|
427
450
|
variant = _ref.variant,
|
|
428
451
|
spacing = _ref.spacing,
|
|
429
452
|
className = _ref.className,
|
|
430
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
453
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$5);
|
|
431
454
|
var HeadingElement = as || 'h1';
|
|
432
455
|
// Function to determine the variant based on the semantic type
|
|
433
456
|
var usedVariant = variant != null ? variant : getHeadingVariantFromSemanticType(HeadingElement);
|
|
@@ -438,11 +461,11 @@ var Heading = function Heading(_ref) {
|
|
|
438
461
|
}, rest), children);
|
|
439
462
|
};
|
|
440
463
|
|
|
441
|
-
var _excluded$
|
|
464
|
+
var _excluded$4 = ["className"],
|
|
442
465
|
_excluded2 = ["className"];
|
|
443
466
|
var BlockquoteBeta = function BlockquoteBeta(_ref) {
|
|
444
467
|
var className = _ref.className,
|
|
445
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
468
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
|
446
469
|
return React.createElement("blockquote", _extends({
|
|
447
470
|
className: classNames('eds-text--blockquote', className)
|
|
448
471
|
}, rest));
|
|
@@ -455,7 +478,7 @@ var BlockquoteFooterBeta = function BlockquoteFooterBeta(_ref2) {
|
|
|
455
478
|
}, rest));
|
|
456
479
|
};
|
|
457
480
|
|
|
458
|
-
var _excluded = ["external", "ariaLabelExternalIcon", "className", "spacing", "children", "as"];
|
|
481
|
+
var _excluded$3 = ["external", "ariaLabelExternalIcon", "className", "spacing", "children", "as"];
|
|
459
482
|
var LinkBeta = function LinkBeta(_ref) {
|
|
460
483
|
var _ref$external = _ref.external,
|
|
461
484
|
external = _ref$external === void 0 ? false : _ref$external,
|
|
@@ -465,7 +488,7 @@ var LinkBeta = function LinkBeta(_ref) {
|
|
|
465
488
|
spacing = _ref.spacing,
|
|
466
489
|
children = _ref.children,
|
|
467
490
|
as = _ref.as,
|
|
468
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
491
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
469
492
|
var LinkElement = as || 'a';
|
|
470
493
|
return React.createElement(LinkElement, _extends({
|
|
471
494
|
className: classNames('eds-text--link', getSpacingClasses(spacing, 'eds-text--link'), className)
|
|
@@ -475,8 +498,53 @@ var LinkBeta = function LinkBeta(_ref) {
|
|
|
475
498
|
}) : null);
|
|
476
499
|
};
|
|
477
500
|
|
|
501
|
+
var _excluded$2 = ["className", "spacing", "as", "children"];
|
|
502
|
+
var UnorderedListBeta = function UnorderedListBeta(_ref) {
|
|
503
|
+
var className = _ref.className,
|
|
504
|
+
spacing = _ref.spacing,
|
|
505
|
+
as = _ref.as,
|
|
506
|
+
children = _ref.children,
|
|
507
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
508
|
+
var ListElement = as || 'ul';
|
|
509
|
+
return React.createElement(ListElement, _extends({
|
|
510
|
+
className: classNames('eds-text--unordered-list', getSpacingClasses(spacing, 'eds-text--unordered-list'), className)
|
|
511
|
+
}, rest), children);
|
|
512
|
+
};
|
|
513
|
+
|
|
514
|
+
var _excluded$1 = ["className", "type", "spacing", "as", "children"];
|
|
515
|
+
var NumberedListBeta = function NumberedListBeta(_ref) {
|
|
516
|
+
var _classNames;
|
|
517
|
+
var className = _ref.className,
|
|
518
|
+
_ref$type = _ref.type,
|
|
519
|
+
type = _ref$type === void 0 ? '1' : _ref$type,
|
|
520
|
+
spacing = _ref.spacing,
|
|
521
|
+
as = _ref.as,
|
|
522
|
+
children = _ref.children,
|
|
523
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
524
|
+
var ListElement = as || 'ol';
|
|
525
|
+
return React.createElement(ListElement, _extends({
|
|
526
|
+
className: classNames('eds-text--numbered-list', (_classNames = {}, _classNames["eds-text--numbered-list--type-" + type] = type, _classNames), getSpacingClasses(spacing, 'eds-text--numbered-list'), className),
|
|
527
|
+
type: type
|
|
528
|
+
}, rest), children);
|
|
529
|
+
};
|
|
530
|
+
|
|
531
|
+
var _excluded = ["children", "className", "title", "spacing", "as"];
|
|
532
|
+
var ListItemBeta = function ListItemBeta(_ref) {
|
|
533
|
+
var children = _ref.children,
|
|
534
|
+
className = _ref.className,
|
|
535
|
+
title = _ref.title,
|
|
536
|
+
spacing = _ref.spacing,
|
|
537
|
+
as = _ref.as,
|
|
538
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
539
|
+
var ItemElement = as || 'li';
|
|
540
|
+
return React.createElement(ItemElement, _extends({
|
|
541
|
+
className: classNames('eds-text--list-item', getSpacingClasses(spacing, 'eds-text--list-item'), className)
|
|
542
|
+
}, rest), title && React.createElement("span", {
|
|
543
|
+
className: "eds-text--list-item__title eds-text--weight-bold"
|
|
544
|
+
}, title), children);
|
|
545
|
+
};
|
|
546
|
+
|
|
478
547
|
utils.warnAboutMissingStyles('typography');
|
|
479
|
-
// migration helpers - use @entur/typography/migration for migration support
|
|
480
548
|
|
|
481
549
|
exports.Blockquote = Blockquote;
|
|
482
550
|
exports.BlockquoteBeta = BlockquoteBeta;
|
|
@@ -496,7 +564,9 @@ exports.LeadParagraph = LeadParagraph;
|
|
|
496
564
|
exports.Link = Link;
|
|
497
565
|
exports.LinkBeta = LinkBeta;
|
|
498
566
|
exports.ListItem = ListItem;
|
|
567
|
+
exports.ListItemBeta = ListItemBeta;
|
|
499
568
|
exports.NumberedList = NumberedList;
|
|
569
|
+
exports.NumberedListBeta = NumberedListBeta;
|
|
500
570
|
exports.Paragraph = Paragraph;
|
|
501
571
|
exports.PreformattedText = PreformattedText;
|
|
502
572
|
exports.SmallText = SmallText;
|
|
@@ -505,4 +575,5 @@ exports.SubLabel = SubLabel;
|
|
|
505
575
|
exports.SubParagraph = SubParagraph;
|
|
506
576
|
exports.Text = Text;
|
|
507
577
|
exports.UnorderedList = UnorderedList;
|
|
578
|
+
exports.UnorderedListBeta = UnorderedListBeta;
|
|
508
579
|
//# sourceMappingURL=typography.cjs.development.js.map
|