@entur/travel 4.2.11 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/dist/TravelTag.d.ts +11 -4
- package/dist/styles.css +110 -72
- package/dist/travel.cjs.development.js +72 -11
- package/dist/travel.cjs.development.js.map +1 -1
- package/dist/travel.cjs.production.min.js +1 -1
- package/dist/travel.cjs.production.min.js.map +1 -1
- package/dist/travel.esm.js +73 -12
- package/dist/travel.esm.js.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,37 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [5.0.0](https://bitbucket.org/enturas/design-system/compare/@entur/travel@4.2.14...@entur/travel@5.0.0) (2022-01-05)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **travel tag:** fix 'warning' and 'error' alert prop being swapped, and colors in contrast ([0a08fb3](https://bitbucket.org/enturas/design-system/commits/0a08fb37ec70b0a19cea2fd96a2a5b39295fe5e5))
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- **travel tag:** add label and labelPlacement props ([8f63a0b](https://bitbucket.org/enturas/design-system/commits/8f63a0bc23c16523fc976a1566ec3c8dec22dd48))
|
|
15
|
+
- **travel tag:** add transport icon automatically based on transport prop ([42a191a](https://bitbucket.org/enturas/design-system/commits/42a191a2962f34696f2cfcb42c943e60c2738f4b))
|
|
16
|
+
|
|
17
|
+
### BREAKING CHANGES
|
|
18
|
+
|
|
19
|
+
- **travel tag:** If both an icon and transport prop is provided in previous code, you will now get two icos. Remove
|
|
20
|
+
the child Icon to fix
|
|
21
|
+
- **travel tag:** alert prop options 'warning' and 'error' has been swapped and will now display the correct icon
|
|
22
|
+
|
|
23
|
+
## [4.2.14](https://bitbucket.org/enturas/design-system/compare/@entur/travel@4.2.13...@entur/travel@4.2.14) (2021-11-17)
|
|
24
|
+
|
|
25
|
+
**Note:** Version bump only for package @entur/travel
|
|
26
|
+
|
|
27
|
+
## [4.2.13](https://bitbucket.org/enturas/design-system/compare/@entur/travel@4.2.12...@entur/travel@4.2.13) (2021-10-18)
|
|
28
|
+
|
|
29
|
+
### Bug Fixes
|
|
30
|
+
|
|
31
|
+
- **travel tag:** fix focus styling for close button ([d9ec26e](https://bitbucket.org/enturas/design-system/commits/d9ec26ea68ba9962a233291eb5e58920efab99b1))
|
|
32
|
+
|
|
33
|
+
## [4.2.12](https://bitbucket.org/enturas/design-system/compare/@entur/travel@4.2.11...@entur/travel@4.2.12) (2021-09-23)
|
|
34
|
+
|
|
35
|
+
**Note:** Version bump only for package @entur/travel
|
|
36
|
+
|
|
6
37
|
## [4.2.11](https://bitbucket.org/enturas/design-system/compare/@entur/travel@4.2.10...@entur/travel@4.2.11) (2021-09-13)
|
|
7
38
|
|
|
8
39
|
**Note:** Version bump only for package @entur/travel
|
package/dist/TravelTag.d.ts
CHANGED
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './TravelTag.scss';
|
|
3
3
|
export declare type TravelTagProps = {
|
|
4
|
-
/** Callback som kalles for når man skal lukke
|
|
4
|
+
/** Callback som kalles for når man skal lukke TravelTag-en
|
|
5
5
|
* @default undefined
|
|
6
6
|
*/
|
|
7
7
|
onClose?: () => void;
|
|
8
|
-
/** Innholdet
|
|
9
|
-
children
|
|
8
|
+
/** Innholdet inne i TravelTag-en */
|
|
9
|
+
children?: React.ReactNode;
|
|
10
10
|
/**Ekstra klassenavn */
|
|
11
11
|
className?: string;
|
|
12
12
|
/** Legger til et Valideringsikon i TravelTagen for å signalisere avvik, informasjon e.l.
|
|
13
13
|
* @default "none"
|
|
14
14
|
*/
|
|
15
15
|
alert?: 'none' | 'error' | 'warning' | 'info';
|
|
16
|
-
|
|
16
|
+
/** Legger til farge og ikon tilpasset valgt transportmiddel */
|
|
17
|
+
transport?: 'bus' | 'metro' | 'air' | 'tram' | 'rail' | 'water' | 'carferry' | 'bike' | 'scooter' | 'foot' | 'car' | 'taxi';
|
|
18
|
+
/** Element ved siden av eller under TravelTag. */
|
|
19
|
+
label?: React.ReactNode;
|
|
20
|
+
/** Posisjonen til label-en i forhold til TravelTag-en
|
|
21
|
+
* @default "right"
|
|
22
|
+
*/
|
|
23
|
+
labelPlacement?: 'bottom' | 'right';
|
|
17
24
|
} & React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
18
25
|
export declare const TravelTag: React.FC<TravelTagProps>;
|
package/dist/styles.css
CHANGED
|
@@ -46,6 +46,45 @@
|
|
|
46
46
|
width: calc(4em / 3);
|
|
47
47
|
}/* DO NOT CHANGE!*/
|
|
48
48
|
/* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
|
|
49
|
+
.eds-leg-line {
|
|
50
|
+
flex-grow: 1;
|
|
51
|
+
mask-image: url("./pattern/line.svg");
|
|
52
|
+
mask-position: center;
|
|
53
|
+
-webkit-mask-image: url("./pattern/line.svg");
|
|
54
|
+
-webkit-mask-position: center;
|
|
55
|
+
}
|
|
56
|
+
.eds-leg-line--dotted {
|
|
57
|
+
mask-image: url("./pattern/dotted.svg");
|
|
58
|
+
-webkit-mask-image: url("./pattern/dotted.svg");
|
|
59
|
+
}
|
|
60
|
+
.eds-leg-line--vertical {
|
|
61
|
+
mask-repeat: repeat-y;
|
|
62
|
+
width: 1rem;
|
|
63
|
+
-webkit-mask-repeat: repeat-y;
|
|
64
|
+
}
|
|
65
|
+
.eds-leg-line--vertical.eds-leg-line--dashed {
|
|
66
|
+
mask-image: url("./pattern/dashed-vertical.svg");
|
|
67
|
+
-webkit-mask-image: url("./pattern/dashed-vertical.svg");
|
|
68
|
+
}
|
|
69
|
+
.eds-leg-line--vertical.eds-leg-line--wave {
|
|
70
|
+
mask-image: url("./pattern/wave-vertical.svg");
|
|
71
|
+
-webkit-mask-image: url("./pattern/wave-vertical.svg");
|
|
72
|
+
}
|
|
73
|
+
.eds-leg-line--horizontal {
|
|
74
|
+
height: 1rem;
|
|
75
|
+
mask-repeat: repeat-x;
|
|
76
|
+
min-width: 6.25rem;
|
|
77
|
+
-webkit-mask-repeat: repeat-x;
|
|
78
|
+
}
|
|
79
|
+
.eds-leg-line--horizontal.eds-leg-line--dashed {
|
|
80
|
+
mask-image: url("./pattern/dashed-horizontal.svg");
|
|
81
|
+
-webkit-mask-image: url("./pattern/dashed-horizontal.svg");
|
|
82
|
+
}
|
|
83
|
+
.eds-leg-line--horizontal.eds-leg-line--wave {
|
|
84
|
+
mask-image: url("./pattern/wave-horizontal.svg");
|
|
85
|
+
-webkit-mask-image: url("./pattern/wave-horizontal.svg");
|
|
86
|
+
}/* DO NOT CHANGE!*/
|
|
87
|
+
/* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
|
|
49
88
|
.eds-travel-tag {
|
|
50
89
|
background-color: #e9e9e9;
|
|
51
90
|
border-radius: 0.25rem;
|
|
@@ -61,10 +100,19 @@
|
|
|
61
100
|
.eds-travel-tag--alert {
|
|
62
101
|
padding-right: 0.75rem;
|
|
63
102
|
}
|
|
103
|
+
.eds-travel-tag--alert--error {
|
|
104
|
+
box-shadow: inset 0 0 0 20px rgba(255, 255, 255, 0.5);
|
|
105
|
+
}
|
|
106
|
+
.eds-contrast .eds-travel-tag--alert--error.eds-travel-tag {
|
|
107
|
+
box-shadow: none;
|
|
108
|
+
background-color: rgba(0, 0, 0, 0);
|
|
109
|
+
border: 0.125rem dashed #54568c;
|
|
110
|
+
}
|
|
64
111
|
.eds-travel-tag--icon-and-text > .eds-icon {
|
|
65
112
|
margin-right: 0.5rem;
|
|
66
113
|
}
|
|
67
114
|
.eds-contrast .eds-travel-tag {
|
|
115
|
+
align-items: center;
|
|
68
116
|
background-color: #393d79;
|
|
69
117
|
}
|
|
70
118
|
.eds-travel-tag > .eds-icon {
|
|
@@ -74,10 +122,12 @@
|
|
|
74
122
|
appearance: none;
|
|
75
123
|
background: none;
|
|
76
124
|
border: none;
|
|
77
|
-
border-radius:
|
|
125
|
+
border-radius: 50%;
|
|
78
126
|
cursor: pointer;
|
|
79
127
|
margin: 0 0 0 0.75rem;
|
|
80
128
|
padding: 0;
|
|
129
|
+
height: 1.5rem;
|
|
130
|
+
width: 1.5rem;
|
|
81
131
|
}
|
|
82
132
|
.eds-travel-tag__close-button .eds-icon {
|
|
83
133
|
color: #181c56;
|
|
@@ -90,83 +140,77 @@
|
|
|
90
140
|
.eds-travel-tag__close-button :focus-within {
|
|
91
141
|
outline-offset: 0.125rem;
|
|
92
142
|
outline: none;
|
|
93
|
-
box-shadow: 0 0 0 0.125rem #ffffff, 0 0 0 0.
|
|
143
|
+
box-shadow: 0 0 0 0.125rem #ffffff, 0 0 0 0.25rem #181c56;
|
|
94
144
|
}
|
|
95
145
|
.eds-contrast .eds-travel-tag__close-button:focus,
|
|
96
146
|
.eds-contrast .eds-travel-tag__close-button :focus-within {
|
|
97
|
-
box-shadow: 0 0 0 0.125rem #181c56, 0 0 0 0.
|
|
147
|
+
box-shadow: 0 0 0 0.125rem #181c56, 0 0 0 0.25rem #ffffff;
|
|
98
148
|
}
|
|
99
149
|
.eds-travel-tag--transport-bus {
|
|
100
150
|
background: #c5044e;
|
|
101
151
|
color: #ffffff;
|
|
102
152
|
}
|
|
103
|
-
.eds-
|
|
104
|
-
|
|
105
|
-
color: #181c56;
|
|
153
|
+
.eds-travel-tag--transport-bus > .eds-icon {
|
|
154
|
+
color: #ffffff;
|
|
106
155
|
}
|
|
107
156
|
.eds-travel-tag--transport-metro {
|
|
108
157
|
background: #de8108;
|
|
109
158
|
color: #ffffff;
|
|
110
159
|
}
|
|
111
|
-
.eds-
|
|
112
|
-
|
|
113
|
-
|
|
160
|
+
.eds-travel-tag--transport-metro > .eds-icon {
|
|
161
|
+
color: #ffffff;
|
|
162
|
+
}
|
|
163
|
+
.eds-contrast .eds-travel-tag--transport-metro > .eds-icon {
|
|
164
|
+
color: #f08901;
|
|
114
165
|
}
|
|
115
166
|
.eds-travel-tag--transport-air {
|
|
116
167
|
background: #800664;
|
|
117
168
|
color: #ffffff;
|
|
118
169
|
}
|
|
119
|
-
.eds-
|
|
120
|
-
|
|
121
|
-
color: #181c56;
|
|
170
|
+
.eds-travel-tag--transport-air > .eds-icon {
|
|
171
|
+
color: #ffffff;
|
|
122
172
|
}
|
|
123
173
|
.eds-travel-tag--transport-tram {
|
|
124
174
|
background: #642e88;
|
|
125
175
|
color: #ffffff;
|
|
126
176
|
}
|
|
127
|
-
.eds-
|
|
128
|
-
|
|
129
|
-
color: #181c56;
|
|
177
|
+
.eds-travel-tag--transport-tram > .eds-icon {
|
|
178
|
+
color: #ffffff;
|
|
130
179
|
}
|
|
131
180
|
.eds-travel-tag--transport-rail {
|
|
132
181
|
background: #00367f;
|
|
133
182
|
color: #ffffff;
|
|
134
183
|
}
|
|
135
|
-
.eds-
|
|
136
|
-
|
|
137
|
-
color: #181c56;
|
|
184
|
+
.eds-travel-tag--transport-rail > .eds-icon {
|
|
185
|
+
color: #ffffff;
|
|
138
186
|
}
|
|
139
187
|
.eds-travel-tag--transport-water {
|
|
140
188
|
background: #0497bc;
|
|
141
189
|
color: #ffffff;
|
|
142
190
|
}
|
|
143
|
-
.eds-
|
|
144
|
-
|
|
145
|
-
color: #181c56;
|
|
191
|
+
.eds-travel-tag--transport-water > .eds-icon {
|
|
192
|
+
color: #ffffff;
|
|
146
193
|
}
|
|
147
194
|
.eds-travel-tag--transport-bike, .eds-travel-tag--transport-scooter {
|
|
148
195
|
background: #388f76;
|
|
149
196
|
color: #ffffff;
|
|
150
197
|
}
|
|
151
|
-
.eds-
|
|
152
|
-
|
|
153
|
-
color: #181c56;
|
|
198
|
+
.eds-travel-tag--transport-bike > .eds-icon, .eds-travel-tag--transport-scooter > .eds-icon {
|
|
199
|
+
color: #ffffff;
|
|
154
200
|
}
|
|
155
201
|
.eds-travel-tag--transport-foot {
|
|
156
202
|
background: #181c56;
|
|
157
203
|
color: #ffffff;
|
|
158
204
|
}
|
|
159
|
-
.eds-
|
|
160
|
-
|
|
161
|
-
color: #181c56;
|
|
205
|
+
.eds-travel-tag--transport-foot > .eds-icon {
|
|
206
|
+
color: #ffffff;
|
|
162
207
|
}
|
|
163
208
|
.eds-travel-tag--transport-car {
|
|
164
209
|
background: #181c56;
|
|
165
210
|
color: #ffffff;
|
|
166
211
|
}
|
|
167
|
-
.eds-
|
|
168
|
-
|
|
169
|
-
color: #181c56;
|
|
212
|
+
.eds-travel-tag--transport-car > .eds-icon {
|
|
213
|
+
color: #ffffff;
|
|
170
214
|
}
|
|
171
215
|
.eds-travel-tag__alert {
|
|
172
216
|
background: #ffffff;
|
|
@@ -179,21 +223,26 @@
|
|
|
179
223
|
width: 1.125rem;
|
|
180
224
|
position: absolute;
|
|
181
225
|
top: 0.4375rem;
|
|
182
|
-
right: -0.
|
|
226
|
+
right: -0.6875rem;
|
|
183
227
|
}
|
|
184
228
|
.eds-contrast .eds-travel-tag__alert {
|
|
185
229
|
background: #181c56;
|
|
186
230
|
}
|
|
231
|
+
.eds-contrast .eds-travel-tag__alert--error-icon {
|
|
232
|
+
top: 0.5625rem;
|
|
233
|
+
}
|
|
187
234
|
.eds-travel-tag__alert-exclamation-icon {
|
|
188
|
-
color: #
|
|
235
|
+
color: #ffca28;
|
|
189
236
|
}
|
|
190
237
|
.eds-contrast .eds-travel-tag__alert-exclamation-icon {
|
|
191
|
-
color: #
|
|
238
|
+
color: #ffe082;
|
|
192
239
|
}
|
|
193
240
|
.eds-travel-tag__alert-error-icon {
|
|
241
|
+
font-size: 0.875rem;
|
|
194
242
|
color: #d31b1b;
|
|
195
243
|
}
|
|
196
244
|
.eds-contrast .eds-travel-tag__alert-error-icon {
|
|
245
|
+
margin-bottom: 0.25rem;
|
|
197
246
|
color: #ff9494;
|
|
198
247
|
}
|
|
199
248
|
.eds-travel-tag__alert-info-icon {
|
|
@@ -201,6 +250,34 @@
|
|
|
201
250
|
}
|
|
202
251
|
.eds-contrast .eds-travel-tag__alert-info-icon {
|
|
203
252
|
color: #64b3e7;
|
|
253
|
+
}
|
|
254
|
+
.eds-travel-tag__wrapper {
|
|
255
|
+
display: inline-flex;
|
|
256
|
+
}
|
|
257
|
+
.eds-travel-tag__wrapper--label-position-right {
|
|
258
|
+
flex-direction: row;
|
|
259
|
+
align-items: center;
|
|
260
|
+
}
|
|
261
|
+
.eds-travel-tag__wrapper--label-position-bottom {
|
|
262
|
+
flex-direction: column;
|
|
263
|
+
align-items: flex-start;
|
|
264
|
+
}
|
|
265
|
+
.eds-travel-tag__label {
|
|
266
|
+
color: #181c56;
|
|
267
|
+
font-size: 1rem;
|
|
268
|
+
}
|
|
269
|
+
.eds-contrast .eds-travel-tag__label {
|
|
270
|
+
color: #ffffff;
|
|
271
|
+
}
|
|
272
|
+
.eds-travel-tag__label--right {
|
|
273
|
+
margin-left: 0.5rem;
|
|
274
|
+
}
|
|
275
|
+
.eds-travel-tag__label--right--with-alert {
|
|
276
|
+
margin-left: 1rem;
|
|
277
|
+
}
|
|
278
|
+
.eds-travel-tag__label--bottom {
|
|
279
|
+
margin-top: 0.125rem;
|
|
280
|
+
font-size: 0.875rem;
|
|
204
281
|
}/* DO NOT CHANGE!*/
|
|
205
282
|
/* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
|
|
206
283
|
.eds-leg-bone {
|
|
@@ -235,43 +312,4 @@
|
|
|
235
312
|
}
|
|
236
313
|
.eds-leg-bone--horizontal .eds-leg-bone__stop {
|
|
237
314
|
margin-left: 0.125rem;
|
|
238
|
-
}/* DO NOT CHANGE!*/
|
|
239
|
-
/* This file is automatically generated from @entur/tokens! Changes will be overwritten. */
|
|
240
|
-
.eds-leg-line {
|
|
241
|
-
flex-grow: 1;
|
|
242
|
-
mask-image: url("./pattern/line.svg");
|
|
243
|
-
mask-position: center;
|
|
244
|
-
-webkit-mask-image: url("./pattern/line.svg");
|
|
245
|
-
-webkit-mask-position: center;
|
|
246
|
-
}
|
|
247
|
-
.eds-leg-line--dotted {
|
|
248
|
-
mask-image: url("./pattern/dotted.svg");
|
|
249
|
-
-webkit-mask-image: url("./pattern/dotted.svg");
|
|
250
|
-
}
|
|
251
|
-
.eds-leg-line--vertical {
|
|
252
|
-
mask-repeat: repeat-y;
|
|
253
|
-
width: 1rem;
|
|
254
|
-
-webkit-mask-repeat: repeat-y;
|
|
255
|
-
}
|
|
256
|
-
.eds-leg-line--vertical.eds-leg-line--dashed {
|
|
257
|
-
mask-image: url("./pattern/dashed-vertical.svg");
|
|
258
|
-
-webkit-mask-image: url("./pattern/dashed-vertical.svg");
|
|
259
|
-
}
|
|
260
|
-
.eds-leg-line--vertical.eds-leg-line--wave {
|
|
261
|
-
mask-image: url("./pattern/wave-vertical.svg");
|
|
262
|
-
-webkit-mask-image: url("./pattern/wave-vertical.svg");
|
|
263
|
-
}
|
|
264
|
-
.eds-leg-line--horizontal {
|
|
265
|
-
height: 1rem;
|
|
266
|
-
mask-repeat: repeat-x;
|
|
267
|
-
min-width: 6.25rem;
|
|
268
|
-
-webkit-mask-repeat: repeat-x;
|
|
269
|
-
}
|
|
270
|
-
.eds-leg-line--horizontal.eds-leg-line--dashed {
|
|
271
|
-
mask-image: url("./pattern/dashed-horizontal.svg");
|
|
272
|
-
-webkit-mask-image: url("./pattern/dashed-horizontal.svg");
|
|
273
|
-
}
|
|
274
|
-
.eds-leg-line--horizontal.eds-leg-line--wave {
|
|
275
|
-
mask-image: url("./pattern/wave-horizontal.svg");
|
|
276
|
-
-webkit-mask-image: url("./pattern/wave-horizontal.svg");
|
|
277
315
|
}
|
|
@@ -52,7 +52,7 @@ var TravelHeader = function TravelHeader(_ref) {
|
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
var TravelTag = function TravelTag(_ref) {
|
|
55
|
-
var _classNames;
|
|
55
|
+
var _modeCalc, _classNames, _classNames2;
|
|
56
56
|
|
|
57
57
|
var _ref$onClose = _ref.onClose,
|
|
58
58
|
onClose = _ref$onClose === void 0 ? undefined : _ref$onClose,
|
|
@@ -61,30 +61,91 @@ var TravelTag = function TravelTag(_ref) {
|
|
|
61
61
|
_ref$alert = _ref.alert,
|
|
62
62
|
alert = _ref$alert === void 0 ? 'none' : _ref$alert,
|
|
63
63
|
transport = _ref.transport,
|
|
64
|
-
|
|
64
|
+
label = _ref.label,
|
|
65
|
+
_ref$labelPlacement = _ref.labelPlacement,
|
|
66
|
+
labelPlacement = _ref$labelPlacement === void 0 ? 'right' : _ref$labelPlacement,
|
|
67
|
+
rest = _objectWithoutPropertiesLoose(_ref, ["onClose", "children", "className", "alert", "transport", "label", "labelPlacement"]);
|
|
65
68
|
|
|
66
69
|
var isClosable = onClose ? true : false;
|
|
67
70
|
var numberOfChildren = React.Children.count(children);
|
|
68
|
-
|
|
71
|
+
var TransportIcon = (_modeCalc = modeCalc(transport)) !== null && _modeCalc !== void 0 ? _modeCalc : React.createElement(React.Fragment, null);
|
|
72
|
+
var TravelTagWithoutLabel = React.createElement("div", Object.assign({
|
|
69
73
|
className: classNames('eds-travel-tag', (_classNames = {
|
|
70
74
|
'eds-travel-tag--closable': isClosable,
|
|
71
75
|
'eds-travel-tag--alert': alert !== 'none',
|
|
72
|
-
'eds-travel-tag--
|
|
76
|
+
'eds-travel-tag--alert--error': alert === 'error',
|
|
77
|
+
'eds-travel-tag--icon-and-text': numberOfChildren > 1 || transport && numberOfChildren > 0
|
|
73
78
|
}, _classNames["eds-travel-tag--transport-" + transport] = transport, _classNames.className = className, _classNames))
|
|
74
|
-
}, rest), children, isClosable && React.createElement("button", {
|
|
79
|
+
}, rest), transport && TransportIcon, children, isClosable && React.createElement("button", {
|
|
75
80
|
onClick: onClose,
|
|
76
81
|
className: "eds-travel-tag__close-button"
|
|
77
|
-
}, React.createElement(icons.
|
|
82
|
+
}, React.createElement(icons.CloseSmallIcon, {
|
|
78
83
|
inline: true
|
|
79
84
|
})), alert !== 'none' && React.createElement("span", {
|
|
80
85
|
className: "eds-travel-tag__alert"
|
|
81
86
|
}, alert === 'info' && React.createElement(icons.ValidationInfoIcon, {
|
|
82
87
|
className: "eds-travel-tag__alert-info-icon"
|
|
83
|
-
}), alert === 'error' && React.createElement(icons.
|
|
84
|
-
className: "eds-travel-tag__alert-exclamation-icon"
|
|
85
|
-
}), alert === 'warning' && React.createElement(icons.ValidationErrorIcon, {
|
|
88
|
+
}), alert === 'error' && React.createElement(icons.ValidationErrorIcon, {
|
|
86
89
|
className: "eds-travel-tag__alert-error-icon"
|
|
90
|
+
}), alert === 'warning' && React.createElement(icons.ValidationExclamationIcon, {
|
|
91
|
+
className: "eds-travel-tag__alert-exclamation-icon"
|
|
87
92
|
})));
|
|
93
|
+
var Label = React.createElement("div", {
|
|
94
|
+
className: classNames('eds-travel-tag__label', (_classNames2 = {}, _classNames2["eds-travel-tag__label--" + labelPlacement] = label, _classNames2["eds-travel-tag__label--" + labelPlacement + "--with-alert"] = label && alert !== 'none', _classNames2))
|
|
95
|
+
}, label);
|
|
96
|
+
|
|
97
|
+
if (label) {
|
|
98
|
+
var _classNames3;
|
|
99
|
+
|
|
100
|
+
return React.createElement("div", {
|
|
101
|
+
className: classNames('eds-travel-tag__wrapper', (_classNames3 = {}, _classNames3["eds-travel-tag__wrapper--label-position-" + labelPlacement] = label, _classNames3))
|
|
102
|
+
}, TravelTagWithoutLabel, Label);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return TravelTagWithoutLabel;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
var modeCalc = function modeCalc(mode) {
|
|
109
|
+
switch (mode) {
|
|
110
|
+
case 'bus':
|
|
111
|
+
return React.createElement(icons.BusIcon, null);
|
|
112
|
+
|
|
113
|
+
case 'metro':
|
|
114
|
+
return React.createElement(icons.SubwayIcon, null);
|
|
115
|
+
|
|
116
|
+
case 'air':
|
|
117
|
+
return React.createElement(icons.PlaneIcon, null);
|
|
118
|
+
|
|
119
|
+
case 'tram':
|
|
120
|
+
return React.createElement(icons.TramIcon, null);
|
|
121
|
+
|
|
122
|
+
case 'rail':
|
|
123
|
+
return React.createElement(icons.TrainIcon, null);
|
|
124
|
+
|
|
125
|
+
case 'water':
|
|
126
|
+
return React.createElement(icons.FerryIcon, null);
|
|
127
|
+
|
|
128
|
+
case 'carferry':
|
|
129
|
+
return React.createElement(icons.CarferryIcon, null);
|
|
130
|
+
|
|
131
|
+
case 'bike':
|
|
132
|
+
return React.createElement(icons.BicycleIcon, null);
|
|
133
|
+
|
|
134
|
+
case 'scooter':
|
|
135
|
+
return React.createElement(icons.ScooterIcon, null);
|
|
136
|
+
|
|
137
|
+
case 'foot':
|
|
138
|
+
return React.createElement(icons.WalkingIcon, null);
|
|
139
|
+
|
|
140
|
+
case 'car':
|
|
141
|
+
return React.createElement(icons.CarIcon, null);
|
|
142
|
+
|
|
143
|
+
case 'taxi':
|
|
144
|
+
return React.createElement(icons.TaxiIcon, null);
|
|
145
|
+
|
|
146
|
+
default:
|
|
147
|
+
return React.createElement(React.Fragment, null);
|
|
148
|
+
}
|
|
88
149
|
};
|
|
89
150
|
|
|
90
151
|
var LegLine = function LegLine(_ref) {
|
|
@@ -150,7 +211,7 @@ var TravelLeg = function TravelLeg(_ref) {
|
|
|
150
211
|
direction = _ref.direction,
|
|
151
212
|
rest = _objectWithoutPropertiesLoose(_ref, ["className", "transport", "direction"]);
|
|
152
213
|
|
|
153
|
-
var _modeCalc = modeCalc(transport),
|
|
214
|
+
var _modeCalc = modeCalc$1(transport),
|
|
154
215
|
color = _modeCalc.color,
|
|
155
216
|
contrast = _modeCalc.contrast,
|
|
156
217
|
pattern = _modeCalc.pattern;
|
|
@@ -164,7 +225,7 @@ var TravelLeg = function TravelLeg(_ref) {
|
|
|
164
225
|
}, rest));
|
|
165
226
|
};
|
|
166
227
|
|
|
167
|
-
function modeCalc(mode) {
|
|
228
|
+
function modeCalc$1(mode) {
|
|
168
229
|
switch (mode) {
|
|
169
230
|
case 'bus':
|
|
170
231
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"travel.cjs.development.js","sources":["../src/TravelHeader.tsx","../src/TravelTag.tsx","../src/LegLine.tsx","../src/LegBone.tsx","../src/TravelLeg.tsx","../src/index.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport './TravelHeader.scss';\n\nexport type TravelHeaderProps = {\n /** HTML-elementet eller React-komponenten som lager elementet\n * @default 'div'\n */\n as?: string | React.ElementType;\n /** Destinasjonen man reiser fra */\n from: React.ReactNode;\n /** Destinasjonen man reiser til */\n to: React.ReactNode;\n /**Størrelsen på komponenten\n * @default 'large'\n */\n size?: 'large' | 'medium';\n /** Plassere til og fra på samme linje */\n noWrap?: boolean;\n /**Ekstra klassenavn */\n className?: string;\n [key: string]: any;\n};\n\nexport const TravelHeader: React.FC<TravelHeaderProps> = ({\n as: Element = 'div',\n from,\n to,\n size = 'large',\n className,\n noWrap,\n ...rest\n}) => {\n return (\n <Element\n className={classNames('eds-travel-header', className, {\n 'eds-travel-header--large': size === 'large',\n 'eds-travel-header--medium': size === 'medium',\n 'eds-travel-header--no-wrap': noWrap,\n })}\n aria-label={`Fra ${from}, til ${to}`}\n {...rest}\n >\n <span className=\"eds-travel-header__from\">{from}</span>\n <span className=\"eds-travel-header__to\">{to}</span>\n </Element>\n );\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport {\n CloseIcon,\n ValidationInfoIcon,\n ValidationErrorIcon,\n ValidationExclamationIcon,\n} from '@entur/icons';\nimport './TravelTag.scss';\n\nexport type TravelTagProps = {\n /** Callback som kalles for når man skal lukke TravelTagen\n * @default undefined\n */\n onClose?: () => void;\n /** Innholdet til TravelTagen */\n children: React.ReactNode;\n /**Ekstra klassenavn */\n className?: string;\n /** Legger til et Valideringsikon i TravelTagen for å signalisere avvik, informasjon e.l.\n * @default \"none\"\n */\n alert?: 'none' | 'error' | 'warning' | 'info';\n transport?:\n | 'bus'\n | 'metro'\n | 'air'\n | 'tram'\n | 'rail'\n | 'water'\n | 'bike'\n | 'scooter'\n | 'foot'\n | 'car';\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n>;\n\nexport const TravelTag: React.FC<TravelTagProps> = ({\n onClose = undefined,\n children,\n className,\n alert = 'none',\n transport,\n ...rest\n}) => {\n const isClosable = onClose ? true : false;\n const numberOfChildren = React.Children.count(children);\n\n return (\n <div\n className={classNames('eds-travel-tag', {\n 'eds-travel-tag--closable': isClosable,\n 'eds-travel-tag--alert': alert !== 'none',\n 'eds-travel-tag--icon-and-text': numberOfChildren > 1,\n [`eds-travel-tag--transport-${transport}`]: transport,\n className,\n })}\n {...rest}\n >\n {children}\n {isClosable && (\n <button onClick={onClose} className=\"eds-travel-tag__close-button\">\n <CloseIcon inline />\n </button>\n )}\n {alert !== 'none' && (\n <span className=\"eds-travel-tag__alert\">\n {alert === 'info' && (\n <ValidationInfoIcon className=\"eds-travel-tag__alert-info-icon\" />\n )}\n {alert === 'error' && (\n <ValidationExclamationIcon className=\"eds-travel-tag__alert-exclamation-icon\" />\n )}\n {alert === 'warning' && (\n <ValidationErrorIcon className=\"eds-travel-tag__alert-error-icon\" />\n )}\n </span>\n )}\n </div>\n );\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport './LegLine.scss';\n\nexport type LegLineProps = {\n /** Farge på LegLine'n */\n color: string;\n /** Retningen til LegLine */\n direction: 'horizontal' | 'vertical';\n /** Hvilket linjemønster som skal brukes */\n pattern: 'line' | 'dashed' | 'dotted' | 'wave';\n /** Ekstra klassenavn */\n className?: string;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n>;\n\nexport const LegLine: React.FC<LegLineProps> = ({\n color,\n direction = 'horizontal',\n pattern,\n className,\n ...rest\n}) => {\n return (\n <div\n className={classNames('eds-leg-line', className, {\n [`eds-leg-line--${pattern}`]: pattern,\n [`eds-leg-line--${direction}`]: direction,\n })}\n style={{ backgroundColor: color }}\n {...rest}\n />\n );\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport { LegLine } from './LegLine';\nimport './LegBone.scss';\n\nexport type LegBoneProps = {\n /** Retning på komponenten */\n direction: 'horizontal' | 'vertical';\n /** Hvilke linjemønster som skal brukes */\n pattern: 'line' | 'dashed' | 'dotted' | 'wave';\n /** Farge på linja */\n color: string;\n /** Farge på startpunktet\n * @default Verdien til color\n */\n startColor?: string;\n /** Farge på endepunktet\n * @default Verdien til color\n */\n endColor?: string;\n /** Vis startpunkt\n * @default true\n */\n showStart?: boolean;\n /** Vis linke\n * @default true\n */\n showLine?: boolean;\n /** Vis endepunkt\n * @default true\n */\n showStop?: boolean;\n /** Ekstra klassenavn */\n className?: string;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n>;\n\nexport const LegBone: React.FC<LegBoneProps> = ({\n direction,\n pattern,\n color,\n startColor,\n endColor,\n showStart = true,\n showStop = true,\n showLine = true,\n className,\n ...rest\n}) => {\n return (\n <div\n className={classNames(className, 'eds-leg-bone', [\n { 'eds-leg-bone--vertical': direction === 'vertical' },\n { 'eds-leg-bone--horizontal': direction === 'horizontal' },\n ])}\n {...rest}\n >\n {showStart && (\n <div\n className={`eds-leg-bone__start`}\n style={{ backgroundColor: startColor || color }}\n />\n )}\n\n {showLine && (\n <LegLine\n className={`eds-leg-bone__line`}\n direction={direction}\n color={color}\n pattern={pattern}\n />\n )}\n\n {showStop && (\n <div\n className={`eds-leg-bone__stop`}\n style={{ backgroundColor: endColor || color }}\n />\n )}\n </div>\n );\n};\n","import React from 'react';\nimport { LegBone } from './LegBone';\nimport { colors } from '@entur/tokens';\nimport { useContrast } from '@entur/layout';\n\nexport type TravelLegProps = {\n /** Ekstra klassenavn */\n className?: string;\n /** Hviklen type reise som skal vises riktig farge og linjetype */\n transport:\n | 'bus'\n | 'metro'\n | 'air'\n | 'tram'\n | 'rail'\n | 'water'\n | 'bike'\n | 'scooter'\n | 'foot'\n | 'car';\n /** Retningen på komponenten */\n direction: 'horizontal' | 'vertical';\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n>;\n\nexport const TravelLeg: React.FC<TravelLegProps> = ({\n className,\n transport,\n direction,\n ...rest\n}) => {\n const { color, contrast, pattern } = modeCalc(transport);\n const isContrast = useContrast();\n\n return (\n <LegBone\n direction={direction}\n pattern={pattern}\n color={isContrast ? contrast : color}\n className={className}\n {...rest}\n />\n );\n};\n\ntype modeCalcResult = {\n color: string;\n contrast: string;\n pattern: 'line' | 'wave' | 'dashed' | 'dotted';\n};\n\nfunction modeCalc(mode: string): modeCalcResult {\n switch (mode) {\n case 'bus':\n return {\n color: colors.transport.default.bus,\n contrast: colors.transport.contrast.bus,\n pattern: 'dashed',\n };\n case 'metro':\n return {\n color: colors.transport.default.metro,\n contrast: colors.transport.contrast.metro,\n pattern: 'line',\n };\n case 'air':\n return {\n color: colors.transport.default.plane,\n contrast: colors.transport.contrast.plane,\n pattern: 'line',\n };\n case 'tram':\n return {\n color: colors.transport.default.tram,\n contrast: colors.transport.contrast.tram,\n pattern: 'line',\n };\n case 'rail':\n return {\n color: colors.transport.default.train,\n contrast: colors.transport.contrast.train,\n pattern: 'line',\n };\n case 'water':\n return {\n color: colors.transport.default.ferry,\n contrast: colors.transport.contrast.ferry,\n pattern: 'wave',\n };\n case 'bike':\n return {\n color: colors.transport.default.mobility,\n contrast: colors.transport.contrast.mobility,\n pattern: 'line',\n };\n case 'scooter':\n return {\n color: colors.transport.default.mobility,\n contrast: colors.transport.contrast.mobility,\n pattern: 'line',\n };\n case 'foot':\n return {\n color: colors.transport.default.walk,\n contrast: colors.transport.contrast.walk,\n pattern: 'dotted',\n };\n case 'car':\n return {\n color: colors.transport.default.taxi,\n contrast: colors.transport.contrast.taxi,\n pattern: 'dashed',\n };\n default:\n console.error(\n 'No transport modality was chosen. There is likely an error in your usage of TravelLeg.',\n );\n return {\n color: colors.brand.blue,\n contrast: colors.brand.white,\n pattern: 'line',\n };\n }\n}\n","import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('travel');\n\nexport * from './TravelHeader';\nexport * from './TravelTag';\nexport * from './LegLine';\nexport * from './LegBone';\nexport * from './TravelLeg';\n"],"names":["TravelHeader","as","Element","from","to","size","className","noWrap","rest","React","classNames","TravelTag","onClose","undefined","children","alert","transport","isClosable","numberOfChildren","Children","count","onClick","CloseIcon","inline","ValidationInfoIcon","ValidationExclamationIcon","ValidationErrorIcon","LegLine","color","direction","pattern","style","backgroundColor","LegBone","startColor","endColor","showStart","showStop","showLine","TravelLeg","modeCalc","contrast","isContrast","useContrast","mode","colors","bus","metro","plane","tram","train","ferry","mobility","walk","taxi","console","error","brand","blue","white","warnAboutMissingStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;IAwBaA,YAAY,GAAgC,SAA5CA,YAA4C;qBACvDC;MAAIC,+BAAU;MACdC,YAAAA;MACAC,UAAAA;uBACAC;MAAAA,8BAAO;MACPC,iBAAAA;MACAC,cAAAA;MACGC;;AAEH,SACEC,mBAAA,CAACP,OAAD;AACEI,IAAAA,SAAS,EAAEI,UAAU,CAAC,mBAAD,EAAsBJ,SAAtB,EAAiC;AACpD,kCAA4BD,IAAI,KAAK,OADe;AAEpD,mCAA6BA,IAAI,KAAK,QAFc;AAGpD,oCAA8BE;AAHsB,KAAjC;2BAKFJ,kBAAaC;KAC5BI,KAPN,EASEC,mBAAA,OAAA;AAAMH,IAAAA,SAAS,EAAC;GAAhB,EAA2CH,IAA3C,CATF,EAUEM,mBAAA,OAAA;AAAMH,IAAAA,SAAS,EAAC;GAAhB,EAAyCF,EAAzC,CAVF,CADF;AAcD;;ICRYO,SAAS,GAA6B,SAAtCA,SAAsC;;;0BACjDC;MAAAA,oCAAUC;MACVC,gBAAAA;MACAR,iBAAAA;wBACAS;MAAAA,gCAAQ;MACRC,iBAAAA;MACGR;;AAEH,MAA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,KAAP,CAAaE,KAFlB;AAGL7B,QAAAA,OAAO,EAAE;AAHJ,OAAP;AAjEJ;AAuED;;AC1HD8B,4BAAsB,CAAC,QAAD,CAAtB;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"travel.cjs.development.js","sources":["../src/TravelHeader.tsx","../src/TravelTag.tsx","../src/LegLine.tsx","../src/LegBone.tsx","../src/TravelLeg.tsx","../src/index.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport './TravelHeader.scss';\n\nexport type TravelHeaderProps = {\n /** HTML-elementet eller React-komponenten som lager elementet\n * @default 'div'\n */\n as?: string | React.ElementType;\n /** Destinasjonen man reiser fra */\n from: React.ReactNode;\n /** Destinasjonen man reiser til */\n to: React.ReactNode;\n /**Størrelsen på komponenten\n * @default 'large'\n */\n size?: 'large' | 'medium';\n /** Plassere til og fra på samme linje */\n noWrap?: boolean;\n /**Ekstra klassenavn */\n className?: string;\n [key: string]: any;\n};\n\nexport const TravelHeader: React.FC<TravelHeaderProps> = ({\n as: Element = 'div',\n from,\n to,\n size = 'large',\n className,\n noWrap,\n ...rest\n}) => {\n return (\n <Element\n className={classNames('eds-travel-header', className, {\n 'eds-travel-header--large': size === 'large',\n 'eds-travel-header--medium': size === 'medium',\n 'eds-travel-header--no-wrap': noWrap,\n })}\n aria-label={`Fra ${from}, til ${to}`}\n {...rest}\n >\n <span className=\"eds-travel-header__from\">{from}</span>\n <span className=\"eds-travel-header__to\">{to}</span>\n </Element>\n );\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport {\n CloseSmallIcon,\n ValidationInfoIcon,\n ValidationErrorIcon,\n ValidationExclamationIcon,\n BicycleIcon,\n BusIcon,\n FerryIcon,\n PlaneIcon,\n ScooterIcon,\n SubwayIcon,\n TrainIcon,\n TramIcon,\n WalkingIcon,\n CarIcon,\n TaxiIcon,\n CarferryIcon,\n} from '@entur/icons';\nimport './TravelTag.scss';\n\nexport type TravelTagProps = {\n /** Callback som kalles for når man skal lukke TravelTag-en\n * @default undefined\n */\n onClose?: () => void;\n /** Innholdet inne i TravelTag-en */\n children?: React.ReactNode;\n /**Ekstra klassenavn */\n className?: string;\n /** Legger til et Valideringsikon i TravelTagen for å signalisere avvik, informasjon e.l.\n * @default \"none\"\n */\n alert?: 'none' | 'error' | 'warning' | 'info';\n /** Legger til farge og ikon tilpasset valgt transportmiddel */\n transport?:\n | 'bus'\n | 'metro'\n | 'air'\n | 'tram'\n | 'rail'\n | 'water'\n | 'carferry'\n | 'bike'\n | 'scooter'\n | 'foot'\n | 'car'\n | 'taxi';\n /** Element ved siden av eller under TravelTag. */\n label?: React.ReactNode;\n /** Posisjonen til label-en i forhold til TravelTag-en\n * @default \"right\"\n */\n labelPlacement?: 'bottom' | 'right';\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n>;\n\nexport const TravelTag: React.FC<TravelTagProps> = ({\n onClose = undefined,\n children,\n className,\n alert = 'none',\n transport,\n label,\n labelPlacement = 'right',\n ...rest\n}) => {\n const isClosable = onClose ? true : false;\n const numberOfChildren = React.Children.count(children);\n const TransportIcon = modeCalc(transport) ?? <></>;\n\n const TravelTagWithoutLabel: JSX.Element = (\n <div\n className={classNames('eds-travel-tag', {\n 'eds-travel-tag--closable': isClosable,\n 'eds-travel-tag--alert': alert !== 'none',\n 'eds-travel-tag--alert--error': alert === 'error',\n 'eds-travel-tag--icon-and-text':\n numberOfChildren > 1 || (transport && numberOfChildren > 0),\n [`eds-travel-tag--transport-${transport}`]: transport,\n className,\n })}\n {...rest}\n >\n {transport && TransportIcon}\n {children}\n {isClosable && (\n <button onClick={onClose} className=\"eds-travel-tag__close-button\">\n <CloseSmallIcon inline />\n </button>\n )}\n {alert !== 'none' && (\n <span className=\"eds-travel-tag__alert\">\n {alert === 'info' && (\n <ValidationInfoIcon className=\"eds-travel-tag__alert-info-icon\" />\n )}\n {alert === 'error' && (\n <ValidationErrorIcon className=\"eds-travel-tag__alert-error-icon\" />\n )}\n {alert === 'warning' && (\n <ValidationExclamationIcon className=\"eds-travel-tag__alert-exclamation-icon\" />\n )}\n </span>\n )}\n </div>\n );\n\n const Label: JSX.Element = (\n <div\n className={classNames('eds-travel-tag__label', {\n [`eds-travel-tag__label--${labelPlacement}`]: label,\n [`eds-travel-tag__label--${labelPlacement}--with-alert`]:\n label && alert !== 'none',\n })}\n >\n {label}\n </div>\n );\n\n if (label) {\n return (\n <div\n className={classNames('eds-travel-tag__wrapper', {\n [`eds-travel-tag__wrapper--label-position-${labelPlacement}`]: label,\n })}\n >\n {TravelTagWithoutLabel}\n {Label}\n </div>\n );\n }\n\n return TravelTagWithoutLabel;\n};\n\nconst modeCalc = (mode: string | undefined) => {\n switch (mode) {\n case 'bus':\n return <BusIcon />;\n case 'metro':\n return <SubwayIcon />;\n case 'air':\n return <PlaneIcon />;\n case 'tram':\n return <TramIcon />;\n case 'rail':\n return <TrainIcon />;\n case 'water':\n return <FerryIcon />;\n case 'carferry':\n return <CarferryIcon />;\n case 'bike':\n return <BicycleIcon />;\n case 'scooter':\n return <ScooterIcon />;\n case 'foot':\n return <WalkingIcon />;\n case 'car':\n return <CarIcon />;\n case 'taxi':\n return <TaxiIcon />;\n default:\n return <></>;\n }\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport './LegLine.scss';\n\nexport type LegLineProps = {\n /** Farge på LegLine'n */\n color: string;\n /** Retningen til LegLine */\n direction: 'horizontal' | 'vertical';\n /** Hvilket linjemønster som skal brukes */\n pattern: 'line' | 'dashed' | 'dotted' | 'wave';\n /** Ekstra klassenavn */\n className?: string;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n>;\n\nexport const LegLine: React.FC<LegLineProps> = ({\n color,\n direction = 'horizontal',\n pattern,\n className,\n ...rest\n}) => {\n return (\n <div\n className={classNames('eds-leg-line', className, {\n [`eds-leg-line--${pattern}`]: pattern,\n [`eds-leg-line--${direction}`]: direction,\n })}\n style={{ backgroundColor: color }}\n {...rest}\n />\n );\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport { LegLine } from './LegLine';\nimport './LegBone.scss';\n\nexport type LegBoneProps = {\n /** Retning på komponenten */\n direction: 'horizontal' | 'vertical';\n /** Hvilke linjemønster som skal brukes */\n pattern: 'line' | 'dashed' | 'dotted' | 'wave';\n /** Farge på linja */\n color: string;\n /** Farge på startpunktet\n * @default Verdien til color\n */\n startColor?: string;\n /** Farge på endepunktet\n * @default Verdien til color\n */\n endColor?: string;\n /** Vis startpunkt\n * @default true\n */\n showStart?: boolean;\n /** Vis linke\n * @default true\n */\n showLine?: boolean;\n /** Vis endepunkt\n * @default true\n */\n showStop?: boolean;\n /** Ekstra klassenavn */\n className?: string;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n>;\n\nexport const LegBone: React.FC<LegBoneProps> = ({\n direction,\n pattern,\n color,\n startColor,\n endColor,\n showStart = true,\n showStop = true,\n showLine = true,\n className,\n ...rest\n}) => {\n return (\n <div\n className={classNames(className, 'eds-leg-bone', [\n { 'eds-leg-bone--vertical': direction === 'vertical' },\n { 'eds-leg-bone--horizontal': direction === 'horizontal' },\n ])}\n {...rest}\n >\n {showStart && (\n <div\n className={`eds-leg-bone__start`}\n style={{ backgroundColor: startColor || color }}\n />\n )}\n\n {showLine && (\n <LegLine\n className={`eds-leg-bone__line`}\n direction={direction}\n color={color}\n pattern={pattern}\n />\n )}\n\n {showStop && (\n <div\n className={`eds-leg-bone__stop`}\n style={{ backgroundColor: endColor || color }}\n />\n )}\n </div>\n );\n};\n","import React from 'react';\nimport { LegBone } from './LegBone';\nimport { colors } from '@entur/tokens';\nimport { useContrast } from '@entur/layout';\n\nexport type TravelLegProps = {\n /** Ekstra klassenavn */\n className?: string;\n /** Hviklen type reise som skal vises riktig farge og linjetype */\n transport:\n | 'bus'\n | 'metro'\n | 'air'\n | 'tram'\n | 'rail'\n | 'water'\n | 'bike'\n | 'scooter'\n | 'foot'\n | 'car';\n /** Retningen på komponenten */\n direction: 'horizontal' | 'vertical';\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n>;\n\nexport const TravelLeg: React.FC<TravelLegProps> = ({\n className,\n transport,\n direction,\n ...rest\n}) => {\n const { color, contrast, pattern } = modeCalc(transport);\n const isContrast = useContrast();\n\n return (\n <LegBone\n direction={direction}\n pattern={pattern}\n color={isContrast ? contrast : color}\n className={className}\n {...rest}\n />\n );\n};\n\ntype modeCalcResult = {\n color: string;\n contrast: string;\n pattern: 'line' | 'wave' | 'dashed' | 'dotted';\n};\n\nfunction modeCalc(mode: string): modeCalcResult {\n switch (mode) {\n case 'bus':\n return {\n color: colors.transport.default.bus,\n contrast: colors.transport.contrast.bus,\n pattern: 'dashed',\n };\n case 'metro':\n return {\n color: colors.transport.default.metro,\n contrast: colors.transport.contrast.metro,\n pattern: 'line',\n };\n case 'air':\n return {\n color: colors.transport.default.plane,\n contrast: colors.transport.contrast.plane,\n pattern: 'line',\n };\n case 'tram':\n return {\n color: colors.transport.default.tram,\n contrast: colors.transport.contrast.tram,\n pattern: 'line',\n };\n case 'rail':\n return {\n color: colors.transport.default.train,\n contrast: colors.transport.contrast.train,\n pattern: 'line',\n };\n case 'water':\n return {\n color: colors.transport.default.ferry,\n contrast: colors.transport.contrast.ferry,\n pattern: 'wave',\n };\n case 'bike':\n return {\n color: colors.transport.default.mobility,\n contrast: colors.transport.contrast.mobility,\n pattern: 'line',\n };\n case 'scooter':\n return {\n color: colors.transport.default.mobility,\n contrast: colors.transport.contrast.mobility,\n pattern: 'line',\n };\n case 'foot':\n return {\n color: colors.transport.default.walk,\n contrast: colors.transport.contrast.walk,\n pattern: 'dotted',\n };\n case 'car':\n return {\n color: colors.transport.default.taxi,\n contrast: colors.transport.contrast.taxi,\n pattern: 'dashed',\n };\n default:\n console.error(\n 'No transport modality was chosen. There is likely an error in your usage of TravelLeg.',\n );\n return {\n color: colors.brand.blue,\n contrast: colors.brand.white,\n pattern: 'line',\n };\n }\n}\n","import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('travel');\n\nexport * from './TravelHeader';\nexport * from './TravelTag';\nexport * from './LegLine';\nexport * from './LegBone';\nexport * from './TravelLeg';\n"],"names":["TravelHeader","as","Element","from","to","size","className","noWrap","rest","React","classNames","TravelTag","onClose","undefined","children","alert","transport","label","labelPlacement","isClosable","numberOfChildren","Children","count","TransportIcon","modeCalc","TravelTagWithoutLabel","onClick","CloseSmallIcon","inline","ValidationInfoIcon","ValidationErrorIcon","ValidationExclamationIcon","Label","mode","BusIcon","SubwayIcon","PlaneIcon","TramIcon","TrainIcon","FerryIcon","CarferryIcon","BicycleIcon","ScooterIcon","WalkingIcon","CarIcon","TaxiIcon","LegLine","color","direction","pattern","style","backgroundColor","LegBone","startColor","endColor","showStart","showStop","showLine","TravelLeg","contrast","isContrast","useContrast","colors","bus","metro","plane","tram","train","ferry","mobility","walk","taxi","console","error","brand","blue","white","warnAboutMissingStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;IAwBaA,YAAY,GAAgC,SAA5CA,YAA4C;qBACvDC;MAAIC,+BAAU;MACdC,YAAAA;MACAC,UAAAA;uBACAC;MAAAA,8BAAO;MACPC,iBAAAA;MACAC,cAAAA;MACGC;;AAEH,SACEC,mBAAA,CAACP,OAAD;AACEI,IAAAA,SAAS,EAAEI,UAAU,CAAC,mBAAD,EAAsBJ,SAAtB,EAAiC;AACpD,kCAA4BD,IAAI,KAAK,OADe;AAEpD,mCAA6BA,IAAI,KAAK,QAFc;AAGpD,oCAA8BE;AAHsB,KAAjC;2BAKFJ,kBAAaC;KAC5BI,KAPN,EASEC,mBAAA,OAAA;AAAMH,IAAAA,SAAS,EAAC;GAAhB,EAA2CH,IAA3C,CATF,EAUEM,mBAAA,OAAA;AAAMH,IAAAA,SAAS,EAAC;GAAhB,EAAyCF,EAAzC,CAVF,CADF;AAcD;;ICaYO,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,aAAM,CAAC9C,SAAP,CAAiB2C,QAAjB,CAA0BW,IAF/B;AAGLrB,QAAAA,OAAO,EAAE;AAHJ,OAAP;;AAKF,SAAK,KAAL;AACE,aAAO;AACLF,QAAAA,KAAK,EAAEe,aAAM,CAAC9C,SAAP,YAAyBuD,IAD3B;AAELZ,QAAAA,QAAQ,EAAEG,aAAM,CAAC9C,SAAP,CAAiB2C,QAAjB,CAA0BY,IAF/B;AAGLtB,QAAAA,OAAO,EAAE;AAHJ,OAAP;;AAKF;AACEuB,MAAAA,OAAO,CAACC,KAAR,CACE,wFADF;AAGA,aAAO;AACL1B,QAAAA,KAAK,EAAEe,aAAM,CAACY,KAAP,CAAaC,IADf;AAELhB,QAAAA,QAAQ,EAAEG,aAAM,CAACY,KAAP,CAAaE,KAFlB;AAGL3B,QAAAA,OAAO,EAAE;AAHJ,OAAP;AAjEJ;AAuED;;AC1HD4B,4BAAsB,CAAC,QAAD,CAAtB;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var r=require("@entur/utils"),t=e(require("react")),a=e(require("classnames")),
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var r=require("@entur/utils"),t=e(require("react")),a=e(require("classnames")),n=require("@entur/icons"),o=require("@entur/tokens"),l=require("@entur/layout");function s(e,r){if(null==e)return{};var t,a,n={},o=Object.keys(e);for(a=0;a<o.length;a++)r.indexOf(t=o[a])>=0||(n[t]=e[t]);return n}var c=function(e){var r,n=e.color,o=e.direction,l=void 0===o?"horizontal":o,c=e.pattern,i=e.className,d=s(e,["color","direction","pattern","className"]);return t.createElement("div",Object.assign({className:a("eds-leg-line",i,(r={},r["eds-leg-line--"+c]=c,r["eds-leg-line--"+l]=l,r)),style:{backgroundColor:n}},d))},i=function(e){var r=e.direction,n=e.pattern,o=e.color,l=e.startColor,i=e.endColor,d=e.showStart,u=void 0===d||d,m=e.showStop,p=void 0===m||m,v=e.showLine,g=void 0===v||v,b=e.className,f=s(e,["direction","pattern","color","startColor","endColor","showStart","showStop","showLine","className"]);return t.createElement("div",Object.assign({className:a(b,"eds-leg-bone",[{"eds-leg-bone--vertical":"vertical"===r},{"eds-leg-bone--horizontal":"horizontal"===r}])},f),u&&t.createElement("div",{className:"eds-leg-bone__start",style:{backgroundColor:l||o}}),g&&t.createElement(c,{className:"eds-leg-bone__line",direction:r,color:o,pattern:n}),p&&t.createElement("div",{className:"eds-leg-bone__stop",style:{backgroundColor:i||o}}))};r.warnAboutMissingStyles("travel"),exports.LegBone=i,exports.LegLine=c,exports.TravelHeader=function(e){var r=e.as,n=void 0===r?"div":r,o=e.from,l=e.to,c=e.size,i=void 0===c?"large":c,d=e.className,u=e.noWrap,m=s(e,["as","from","to","size","className","noWrap"]);return t.createElement(n,Object.assign({className:a("eds-travel-header",d,{"eds-travel-header--large":"large"===i,"eds-travel-header--medium":"medium"===i,"eds-travel-header--no-wrap":u}),"aria-label":"Fra "+o+", til "+l},m),t.createElement("span",{className:"eds-travel-header__from"},o),t.createElement("span",{className:"eds-travel-header__to"},l))},exports.TravelLeg=function(e){var r=e.className,a=e.transport,n=e.direction,c=s(e,["className","transport","direction"]),d=function(e){switch(e){case"bus":return{color:o.colors.transport.default.bus,contrast:o.colors.transport.contrast.bus,pattern:"dashed"};case"metro":return{color:o.colors.transport.default.metro,contrast:o.colors.transport.contrast.metro,pattern:"line"};case"air":return{color:o.colors.transport.default.plane,contrast:o.colors.transport.contrast.plane,pattern:"line"};case"tram":return{color:o.colors.transport.default.tram,contrast:o.colors.transport.contrast.tram,pattern:"line"};case"rail":return{color:o.colors.transport.default.train,contrast:o.colors.transport.contrast.train,pattern:"line"};case"water":return{color:o.colors.transport.default.ferry,contrast:o.colors.transport.contrast.ferry,pattern:"wave"};case"bike":case"scooter":return{color:o.colors.transport.default.mobility,contrast:o.colors.transport.contrast.mobility,pattern:"line"};case"foot":return{color:o.colors.transport.default.walk,contrast:o.colors.transport.contrast.walk,pattern:"dotted"};case"car":return{color:o.colors.transport.default.taxi,contrast:o.colors.transport.contrast.taxi,pattern:"dashed"};default:return console.error("No transport modality was chosen. There is likely an error in your usage of TravelLeg."),{color:o.colors.brand.blue,contrast:o.colors.brand.white,pattern:"line"}}}(a),u=d.color,m=d.contrast,p=d.pattern,v=l.useContrast();return t.createElement(i,Object.assign({direction:n,pattern:p,color:v?m:u,className:r},c))},exports.TravelTag=function(e){var r,o,l,c,i=e.onClose,d=void 0===i?void 0:i,u=e.children,m=e.className,p=e.alert,v=void 0===p?"none":p,g=e.transport,b=e.label,f=e.labelPlacement,E=void 0===f?"right":f,_=s(e,["onClose","children","className","alert","transport","label","labelPlacement"]),N=!!d,h=t.Children.count(u),w=null!==(r=function(e){switch(e){case"bus":return t.createElement(n.BusIcon,null);case"metro":return t.createElement(n.SubwayIcon,null);case"air":return t.createElement(n.PlaneIcon,null);case"tram":return t.createElement(n.TramIcon,null);case"rail":return t.createElement(n.TrainIcon,null);case"water":return t.createElement(n.FerryIcon,null);case"carferry":return t.createElement(n.CarferryIcon,null);case"bike":return t.createElement(n.BicycleIcon,null);case"scooter":return t.createElement(n.ScooterIcon,null);case"foot":return t.createElement(n.WalkingIcon,null);case"car":return t.createElement(n.CarIcon,null);case"taxi":return t.createElement(n.TaxiIcon,null);default:return t.createElement(t.Fragment,null)}}(g))&&void 0!==r?r:t.createElement(t.Fragment,null),y=t.createElement("div",Object.assign({className:a("eds-travel-tag",(o={"eds-travel-tag--closable":N,"eds-travel-tag--alert":"none"!==v,"eds-travel-tag--alert--error":"error"===v,"eds-travel-tag--icon-and-text":h>1||g&&h>0},o["eds-travel-tag--transport-"+g]=g,o.className=m,o))},_),g&&w,u,N&&t.createElement("button",{onClick:d,className:"eds-travel-tag__close-button"},t.createElement(n.CloseSmallIcon,{inline:!0})),"none"!==v&&t.createElement("span",{className:"eds-travel-tag__alert"},"info"===v&&t.createElement(n.ValidationInfoIcon,{className:"eds-travel-tag__alert-info-icon"}),"error"===v&&t.createElement(n.ValidationErrorIcon,{className:"eds-travel-tag__alert-error-icon"}),"warning"===v&&t.createElement(n.ValidationExclamationIcon,{className:"eds-travel-tag__alert-exclamation-icon"}))),I=t.createElement("div",{className:a("eds-travel-tag__label",(l={},l["eds-travel-tag__label--"+E]=b,l["eds-travel-tag__label--"+E+"--with-alert"]=b&&"none"!==v,l))},b);return b?t.createElement("div",{className:a("eds-travel-tag__wrapper",(c={},c["eds-travel-tag__wrapper--label-position-"+E]=b,c))},y,I):y};
|
|
2
2
|
//# sourceMappingURL=travel.cjs.production.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"travel.cjs.production.min.js","sources":["../src/LegLine.tsx","../src/LegBone.tsx","../src/index.tsx","../src/TravelHeader.tsx","../src/TravelLeg.tsx","../src/TravelTag.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport './LegLine.scss';\n\nexport type LegLineProps = {\n /** Farge på LegLine'n */\n color: string;\n /** Retningen til LegLine */\n direction: 'horizontal' | 'vertical';\n /** Hvilket linjemønster som skal brukes */\n pattern: 'line' | 'dashed' | 'dotted' | 'wave';\n /** Ekstra klassenavn */\n className?: string;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n>;\n\nexport const LegLine: React.FC<LegLineProps> = ({\n color,\n direction = 'horizontal',\n pattern,\n className,\n ...rest\n}) => {\n return (\n <div\n className={classNames('eds-leg-line', className, {\n [`eds-leg-line--${pattern}`]: pattern,\n [`eds-leg-line--${direction}`]: direction,\n })}\n style={{ backgroundColor: color }}\n {...rest}\n />\n );\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport { LegLine } from './LegLine';\nimport './LegBone.scss';\n\nexport type LegBoneProps = {\n /** Retning på komponenten */\n direction: 'horizontal' | 'vertical';\n /** Hvilke linjemønster som skal brukes */\n pattern: 'line' | 'dashed' | 'dotted' | 'wave';\n /** Farge på linja */\n color: string;\n /** Farge på startpunktet\n * @default Verdien til color\n */\n startColor?: string;\n /** Farge på endepunktet\n * @default Verdien til color\n */\n endColor?: string;\n /** Vis startpunkt\n * @default true\n */\n showStart?: boolean;\n /** Vis linke\n * @default true\n */\n showLine?: boolean;\n /** Vis endepunkt\n * @default true\n */\n showStop?: boolean;\n /** Ekstra klassenavn */\n className?: string;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n>;\n\nexport const LegBone: React.FC<LegBoneProps> = ({\n direction,\n pattern,\n color,\n startColor,\n endColor,\n showStart = true,\n showStop = true,\n showLine = true,\n className,\n ...rest\n}) => {\n return (\n <div\n className={classNames(className, 'eds-leg-bone', [\n { 'eds-leg-bone--vertical': direction === 'vertical' },\n { 'eds-leg-bone--horizontal': direction === 'horizontal' },\n ])}\n {...rest}\n >\n {showStart && (\n <div\n className={`eds-leg-bone__start`}\n style={{ backgroundColor: startColor || color }}\n />\n )}\n\n {showLine && (\n <LegLine\n className={`eds-leg-bone__line`}\n direction={direction}\n color={color}\n pattern={pattern}\n />\n )}\n\n {showStop && (\n <div\n className={`eds-leg-bone__stop`}\n style={{ backgroundColor: endColor || color }}\n />\n )}\n </div>\n );\n};\n","import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('travel');\n\nexport * from './TravelHeader';\nexport * from './TravelTag';\nexport * from './LegLine';\nexport * from './LegBone';\nexport * from './TravelLeg';\n","import React from 'react';\nimport classNames from 'classnames';\nimport './TravelHeader.scss';\n\nexport type TravelHeaderProps = {\n /** HTML-elementet eller React-komponenten som lager elementet\n * @default 'div'\n */\n as?: string | React.ElementType;\n /** Destinasjonen man reiser fra */\n from: React.ReactNode;\n /** Destinasjonen man reiser til */\n to: React.ReactNode;\n /**Størrelsen på komponenten\n * @default 'large'\n */\n size?: 'large' | 'medium';\n /** Plassere til og fra på samme linje */\n noWrap?: boolean;\n /**Ekstra klassenavn */\n className?: string;\n [key: string]: any;\n};\n\nexport const TravelHeader: React.FC<TravelHeaderProps> = ({\n as: Element = 'div',\n from,\n to,\n size = 'large',\n className,\n noWrap,\n ...rest\n}) => {\n return (\n <Element\n className={classNames('eds-travel-header', className, {\n 'eds-travel-header--large': size === 'large',\n 'eds-travel-header--medium': size === 'medium',\n 'eds-travel-header--no-wrap': noWrap,\n })}\n aria-label={`Fra ${from}, til ${to}`}\n {...rest}\n >\n <span className=\"eds-travel-header__from\">{from}</span>\n <span className=\"eds-travel-header__to\">{to}</span>\n </Element>\n );\n};\n","import React from 'react';\nimport { LegBone } from './LegBone';\nimport { colors } from '@entur/tokens';\nimport { useContrast } from '@entur/layout';\n\nexport type TravelLegProps = {\n /** Ekstra klassenavn */\n className?: string;\n /** Hviklen type reise som skal vises riktig farge og linjetype */\n transport:\n | 'bus'\n | 'metro'\n | 'air'\n | 'tram'\n | 'rail'\n | 'water'\n | 'bike'\n | 'scooter'\n | 'foot'\n | 'car';\n /** Retningen på komponenten */\n direction: 'horizontal' | 'vertical';\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n>;\n\nexport const TravelLeg: React.FC<TravelLegProps> = ({\n className,\n transport,\n direction,\n ...rest\n}) => {\n const { color, contrast, pattern } = modeCalc(transport);\n const isContrast = useContrast();\n\n return (\n <LegBone\n direction={direction}\n pattern={pattern}\n color={isContrast ? contrast : color}\n className={className}\n {...rest}\n />\n );\n};\n\ntype modeCalcResult = {\n color: string;\n contrast: string;\n pattern: 'line' | 'wave' | 'dashed' | 'dotted';\n};\n\nfunction modeCalc(mode: string): modeCalcResult {\n switch (mode) {\n case 'bus':\n return {\n color: colors.transport.default.bus,\n contrast: colors.transport.contrast.bus,\n pattern: 'dashed',\n };\n case 'metro':\n return {\n color: colors.transport.default.metro,\n contrast: colors.transport.contrast.metro,\n pattern: 'line',\n };\n case 'air':\n return {\n color: colors.transport.default.plane,\n contrast: colors.transport.contrast.plane,\n pattern: 'line',\n };\n case 'tram':\n return {\n color: colors.transport.default.tram,\n contrast: colors.transport.contrast.tram,\n pattern: 'line',\n };\n case 'rail':\n return {\n color: colors.transport.default.train,\n contrast: colors.transport.contrast.train,\n pattern: 'line',\n };\n case 'water':\n return {\n color: colors.transport.default.ferry,\n contrast: colors.transport.contrast.ferry,\n pattern: 'wave',\n };\n case 'bike':\n return {\n color: colors.transport.default.mobility,\n contrast: colors.transport.contrast.mobility,\n pattern: 'line',\n };\n case 'scooter':\n return {\n color: colors.transport.default.mobility,\n contrast: colors.transport.contrast.mobility,\n pattern: 'line',\n };\n case 'foot':\n return {\n color: colors.transport.default.walk,\n contrast: colors.transport.contrast.walk,\n pattern: 'dotted',\n };\n case 'car':\n return {\n color: colors.transport.default.taxi,\n contrast: colors.transport.contrast.taxi,\n pattern: 'dashed',\n };\n default:\n console.error(\n 'No transport modality was chosen. There is likely an error in your usage of TravelLeg.',\n );\n return {\n color: colors.brand.blue,\n contrast: colors.brand.white,\n pattern: 'line',\n };\n }\n}\n","import React from 'react';\nimport classNames from 'classnames';\nimport {\n CloseIcon,\n ValidationInfoIcon,\n ValidationErrorIcon,\n ValidationExclamationIcon,\n} from '@entur/icons';\nimport './TravelTag.scss';\n\nexport type TravelTagProps = {\n /** Callback som kalles for når man skal lukke TravelTagen\n * @default undefined\n */\n onClose?: () => void;\n /** Innholdet til TravelTagen */\n children: React.ReactNode;\n /**Ekstra klassenavn */\n className?: string;\n /** Legger til et Valideringsikon i TravelTagen for å signalisere avvik, informasjon e.l.\n * @default \"none\"\n */\n alert?: 'none' | 'error' | 'warning' | 'info';\n transport?:\n | 'bus'\n | 'metro'\n | 'air'\n | 'tram'\n | 'rail'\n | 'water'\n | 'bike'\n | 'scooter'\n | 'foot'\n | 'car';\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n>;\n\nexport const TravelTag: React.FC<TravelTagProps> = ({\n onClose = undefined,\n children,\n className,\n alert = 'none',\n transport,\n ...rest\n}) => {\n const isClosable = onClose ? true : false;\n const numberOfChildren = React.Children.count(children);\n\n return (\n <div\n className={classNames('eds-travel-tag', {\n 'eds-travel-tag--closable': isClosable,\n 'eds-travel-tag--alert': alert !== 'none',\n 'eds-travel-tag--icon-and-text': numberOfChildren > 1,\n [`eds-travel-tag--transport-${transport}`]: transport,\n className,\n })}\n {...rest}\n >\n {children}\n {isClosable && (\n <button onClick={onClose} className=\"eds-travel-tag__close-button\">\n <CloseIcon inline />\n </button>\n )}\n {alert !== 'none' && (\n <span className=\"eds-travel-tag__alert\">\n {alert === 'info' && (\n <ValidationInfoIcon className=\"eds-travel-tag__alert-info-icon\" />\n )}\n {alert === 'error' && (\n <ValidationExclamationIcon className=\"eds-travel-tag__alert-exclamation-icon\" />\n )}\n {alert === 'warning' && (\n <ValidationErrorIcon className=\"eds-travel-tag__alert-error-icon\" />\n )}\n </span>\n )}\n </div>\n );\n};\n"],"names":["LegLine","color","direction","pattern","className","rest","React","classNames","style","backgroundColor","LegBone","startColor","endColor","showStart","showStop","showLine","warnAboutMissingStyles","as","Element","from","to","size","noWrap","transport","mode","colors","bus","contrast","metro","plane","tram","train","ferry","mobility","walk","taxi","console","error","brand","blue","white","modeCalc","isContrast","useContrast","onClose","undefined","children","alert","isClosable","numberOfChildren","Children","count","onClick","CloseIcon","inline","ValidationInfoIcon","ValidationExclamationIcon","ValidationErrorIcon"],"mappings":"ibAkBaA,EAAkC,kBAC7CC,IAAAA,UACAC,UAAAA,aAAY,eACZC,IAAAA,QACAC,IAAAA,UACGC,0DAGDC,qCACEF,UAAWG,EAAW,eAAgBH,2BAClBD,GAAYA,qBACZD,GAAcA,MAElCM,MAAO,CAAEC,gBAAiBR,IACtBI,KCOGK,EAAkC,gBAC7CR,IAAAA,UACAC,IAAAA,QACAF,IAAAA,MACAU,IAAAA,WACAC,IAAAA,aACAC,UAAAA,oBACAC,SAAAA,oBACAC,SAAAA,gB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S,YAER,WAMA,gBACI,CACLF,MAAOwB,SAAOF,kBAAkBU,SAChCN,SAAUF,SAAOF,UAAUI,SAASM,SACpC9B,QAAS,YAER,aACI,CACLF,MAAOwB,SAAOF,kBAAkBW,KAChCP,SAAUF,SAAOF,UAAUI,SAASO,KACpC/B,QAAS,cAER,YACI,CACLF,MAAOwB,SAAOF,kBAAkBY,KAChCR,SAAUF,SAAOF,UAAUI,SAASQ,KACpChC,QAAS,yBAGXiC,QAAQC,MACN,0FAEK,CACLpC,MAAOwB,SAAOa,MAAMC,KACpBZ,SAAUF,SAAOa,MAAME,MACvBrC,QAAS,SAzFsBsC,CAASlB,GAAtCtB,IAAAA,MAAO0B,IAAAA,SAAUxB,IAAAA,QACnBuC,EAAaC,uBAGjBrC,gBAACI,iBACCR,UAAWA,EACXC,QAASA,EACTF,MAAOyC,EAAaf,EAAW1B,EAC/BG,UAAWA,GACPC,uBCHyC,sBACjDuC,QAAAA,kBAAUC,IACVC,IAAAA,SACA1C,IAAAA,cACA2C,MAAAA,aAAQ,SACRxB,IAAAA,UACGlB,8DAEG2C,IAAaJ,EACbK,EAAmB3C,EAAM4C,SAASC,MAAML,UAG5CxC,qCACEF,UAAWG,EAAW,gDACQyC,0BACO,SAAVD,kCACQE,EAAmB,kCACtB1B,GAAcA,IAC5CnB,UAAAA,OAEEC,GAEHyC,EACAE,GACC1C,0BAAQ8C,QAASR,EAASxC,UAAU,gCAClCE,gBAAC+C,aAAUC,aAGJ,SAAVP,GACCzC,wBAAMF,UAAU,yBACH,SAAV2C,GACCzC,gBAACiD,sBAAmBnD,UAAU,oCAErB,UAAV2C,GACCzC,gBAACkD,6BAA0BpD,UAAU,2CAE5B,YAAV2C,GACCzC,gBAACmD,uBAAoBrD,UAAU"}
|
|
1
|
+
{"version":3,"file":"travel.cjs.production.min.js","sources":["../src/LegLine.tsx","../src/LegBone.tsx","../src/index.tsx","../src/TravelHeader.tsx","../src/TravelLeg.tsx","../src/TravelTag.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport './LegLine.scss';\n\nexport type LegLineProps = {\n /** Farge på LegLine'n */\n color: string;\n /** Retningen til LegLine */\n direction: 'horizontal' | 'vertical';\n /** Hvilket linjemønster som skal brukes */\n pattern: 'line' | 'dashed' | 'dotted' | 'wave';\n /** Ekstra klassenavn */\n className?: string;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n>;\n\nexport const LegLine: React.FC<LegLineProps> = ({\n color,\n direction = 'horizontal',\n pattern,\n className,\n ...rest\n}) => {\n return (\n <div\n className={classNames('eds-leg-line', className, {\n [`eds-leg-line--${pattern}`]: pattern,\n [`eds-leg-line--${direction}`]: direction,\n })}\n style={{ backgroundColor: color }}\n {...rest}\n />\n );\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport { LegLine } from './LegLine';\nimport './LegBone.scss';\n\nexport type LegBoneProps = {\n /** Retning på komponenten */\n direction: 'horizontal' | 'vertical';\n /** Hvilke linjemønster som skal brukes */\n pattern: 'line' | 'dashed' | 'dotted' | 'wave';\n /** Farge på linja */\n color: string;\n /** Farge på startpunktet\n * @default Verdien til color\n */\n startColor?: string;\n /** Farge på endepunktet\n * @default Verdien til color\n */\n endColor?: string;\n /** Vis startpunkt\n * @default true\n */\n showStart?: boolean;\n /** Vis linke\n * @default true\n */\n showLine?: boolean;\n /** Vis endepunkt\n * @default true\n */\n showStop?: boolean;\n /** Ekstra klassenavn */\n className?: string;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n>;\n\nexport const LegBone: React.FC<LegBoneProps> = ({\n direction,\n pattern,\n color,\n startColor,\n endColor,\n showStart = true,\n showStop = true,\n showLine = true,\n className,\n ...rest\n}) => {\n return (\n <div\n className={classNames(className, 'eds-leg-bone', [\n { 'eds-leg-bone--vertical': direction === 'vertical' },\n { 'eds-leg-bone--horizontal': direction === 'horizontal' },\n ])}\n {...rest}\n >\n {showStart && (\n <div\n className={`eds-leg-bone__start`}\n style={{ backgroundColor: startColor || color }}\n />\n )}\n\n {showLine && (\n <LegLine\n className={`eds-leg-bone__line`}\n direction={direction}\n color={color}\n pattern={pattern}\n />\n )}\n\n {showStop && (\n <div\n className={`eds-leg-bone__stop`}\n style={{ backgroundColor: endColor || color }}\n />\n )}\n </div>\n );\n};\n","import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('travel');\n\nexport * from './TravelHeader';\nexport * from './TravelTag';\nexport * from './LegLine';\nexport * from './LegBone';\nexport * from './TravelLeg';\n","import React from 'react';\nimport classNames from 'classnames';\nimport './TravelHeader.scss';\n\nexport type TravelHeaderProps = {\n /** HTML-elementet eller React-komponenten som lager elementet\n * @default 'div'\n */\n as?: string | React.ElementType;\n /** Destinasjonen man reiser fra */\n from: React.ReactNode;\n /** Destinasjonen man reiser til */\n to: React.ReactNode;\n /**Størrelsen på komponenten\n * @default 'large'\n */\n size?: 'large' | 'medium';\n /** Plassere til og fra på samme linje */\n noWrap?: boolean;\n /**Ekstra klassenavn */\n className?: string;\n [key: string]: any;\n};\n\nexport const TravelHeader: React.FC<TravelHeaderProps> = ({\n as: Element = 'div',\n from,\n to,\n size = 'large',\n className,\n noWrap,\n ...rest\n}) => {\n return (\n <Element\n className={classNames('eds-travel-header', className, {\n 'eds-travel-header--large': size === 'large',\n 'eds-travel-header--medium': size === 'medium',\n 'eds-travel-header--no-wrap': noWrap,\n })}\n aria-label={`Fra ${from}, til ${to}`}\n {...rest}\n >\n <span className=\"eds-travel-header__from\">{from}</span>\n <span className=\"eds-travel-header__to\">{to}</span>\n </Element>\n );\n};\n","import React from 'react';\nimport { LegBone } from './LegBone';\nimport { colors } from '@entur/tokens';\nimport { useContrast } from '@entur/layout';\n\nexport type TravelLegProps = {\n /** Ekstra klassenavn */\n className?: string;\n /** Hviklen type reise som skal vises riktig farge og linjetype */\n transport:\n | 'bus'\n | 'metro'\n | 'air'\n | 'tram'\n | 'rail'\n | 'water'\n | 'bike'\n | 'scooter'\n | 'foot'\n | 'car';\n /** Retningen på komponenten */\n direction: 'horizontal' | 'vertical';\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n>;\n\nexport const TravelLeg: React.FC<TravelLegProps> = ({\n className,\n transport,\n direction,\n ...rest\n}) => {\n const { color, contrast, pattern } = modeCalc(transport);\n const isContrast = useContrast();\n\n return (\n <LegBone\n direction={direction}\n pattern={pattern}\n color={isContrast ? contrast : color}\n className={className}\n {...rest}\n />\n );\n};\n\ntype modeCalcResult = {\n color: string;\n contrast: string;\n pattern: 'line' | 'wave' | 'dashed' | 'dotted';\n};\n\nfunction modeCalc(mode: string): modeCalcResult {\n switch (mode) {\n case 'bus':\n return {\n color: colors.transport.default.bus,\n contrast: colors.transport.contrast.bus,\n pattern: 'dashed',\n };\n case 'metro':\n return {\n color: colors.transport.default.metro,\n contrast: colors.transport.contrast.metro,\n pattern: 'line',\n };\n case 'air':\n return {\n color: colors.transport.default.plane,\n contrast: colors.transport.contrast.plane,\n pattern: 'line',\n };\n case 'tram':\n return {\n color: colors.transport.default.tram,\n contrast: colors.transport.contrast.tram,\n pattern: 'line',\n };\n case 'rail':\n return {\n color: colors.transport.default.train,\n contrast: colors.transport.contrast.train,\n pattern: 'line',\n };\n case 'water':\n return {\n color: colors.transport.default.ferry,\n contrast: colors.transport.contrast.ferry,\n pattern: 'wave',\n };\n case 'bike':\n return {\n color: colors.transport.default.mobility,\n contrast: colors.transport.contrast.mobility,\n pattern: 'line',\n };\n case 'scooter':\n return {\n color: colors.transport.default.mobility,\n contrast: colors.transport.contrast.mobility,\n pattern: 'line',\n };\n case 'foot':\n return {\n color: colors.transport.default.walk,\n contrast: colors.transport.contrast.walk,\n pattern: 'dotted',\n };\n case 'car':\n return {\n color: colors.transport.default.taxi,\n contrast: colors.transport.contrast.taxi,\n pattern: 'dashed',\n };\n default:\n console.error(\n 'No transport modality was chosen. There is likely an error in your usage of TravelLeg.',\n );\n return {\n color: colors.brand.blue,\n contrast: colors.brand.white,\n pattern: 'line',\n };\n }\n}\n","import React from 'react';\nimport classNames from 'classnames';\nimport {\n CloseSmallIcon,\n ValidationInfoIcon,\n ValidationErrorIcon,\n ValidationExclamationIcon,\n BicycleIcon,\n BusIcon,\n FerryIcon,\n PlaneIcon,\n ScooterIcon,\n SubwayIcon,\n TrainIcon,\n TramIcon,\n WalkingIcon,\n CarIcon,\n TaxiIcon,\n CarferryIcon,\n} from '@entur/icons';\nimport './TravelTag.scss';\n\nexport type TravelTagProps = {\n /** Callback som kalles for når man skal lukke TravelTag-en\n * @default undefined\n */\n onClose?: () => void;\n /** Innholdet inne i TravelTag-en */\n children?: React.ReactNode;\n /**Ekstra klassenavn */\n className?: string;\n /** Legger til et Valideringsikon i TravelTagen for å signalisere avvik, informasjon e.l.\n * @default \"none\"\n */\n alert?: 'none' | 'error' | 'warning' | 'info';\n /** Legger til farge og ikon tilpasset valgt transportmiddel */\n transport?:\n | 'bus'\n | 'metro'\n | 'air'\n | 'tram'\n | 'rail'\n | 'water'\n | 'carferry'\n | 'bike'\n | 'scooter'\n | 'foot'\n | 'car'\n | 'taxi';\n /** Element ved siden av eller under TravelTag. */\n label?: React.ReactNode;\n /** Posisjonen til label-en i forhold til TravelTag-en\n * @default \"right\"\n */\n labelPlacement?: 'bottom' | 'right';\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n>;\n\nexport const TravelTag: React.FC<TravelTagProps> = ({\n onClose = undefined,\n children,\n className,\n alert = 'none',\n transport,\n label,\n labelPlacement = 'right',\n ...rest\n}) => {\n const isClosable = onClose ? true : false;\n const numberOfChildren = React.Children.count(children);\n const TransportIcon = modeCalc(transport) ?? <></>;\n\n const TravelTagWithoutLabel: JSX.Element = (\n <div\n className={classNames('eds-travel-tag', {\n 'eds-travel-tag--closable': isClosable,\n 'eds-travel-tag--alert': alert !== 'none',\n 'eds-travel-tag--alert--error': alert === 'error',\n 'eds-travel-tag--icon-and-text':\n numberOfChildren > 1 || (transport && numberOfChildren > 0),\n [`eds-travel-tag--transport-${transport}`]: transport,\n className,\n })}\n {...rest}\n >\n {transport && TransportIcon}\n {children}\n {isClosable && (\n <button onClick={onClose} className=\"eds-travel-tag__close-button\">\n <CloseSmallIcon inline />\n </button>\n )}\n {alert !== 'none' && (\n <span className=\"eds-travel-tag__alert\">\n {alert === 'info' && (\n <ValidationInfoIcon className=\"eds-travel-tag__alert-info-icon\" />\n )}\n {alert === 'error' && (\n <ValidationErrorIcon className=\"eds-travel-tag__alert-error-icon\" />\n )}\n {alert === 'warning' && (\n <ValidationExclamationIcon className=\"eds-travel-tag__alert-exclamation-icon\" />\n )}\n </span>\n )}\n </div>\n );\n\n const Label: JSX.Element = (\n <div\n className={classNames('eds-travel-tag__label', {\n [`eds-travel-tag__label--${labelPlacement}`]: label,\n [`eds-travel-tag__label--${labelPlacement}--with-alert`]:\n label && alert !== 'none',\n })}\n >\n {label}\n </div>\n );\n\n if (label) {\n return (\n <div\n className={classNames('eds-travel-tag__wrapper', {\n [`eds-travel-tag__wrapper--label-position-${labelPlacement}`]: label,\n })}\n >\n {TravelTagWithoutLabel}\n {Label}\n </div>\n );\n }\n\n return TravelTagWithoutLabel;\n};\n\nconst modeCalc = (mode: string | undefined) => {\n switch (mode) {\n case 'bus':\n return <BusIcon />;\n case 'metro':\n return <SubwayIcon />;\n case 'air':\n return <PlaneIcon />;\n case 'tram':\n return <TramIcon />;\n case 'rail':\n return <TrainIcon />;\n case 'water':\n return <FerryIcon />;\n case 'carferry':\n return <CarferryIcon />;\n case 'bike':\n return <BicycleIcon />;\n case 'scooter':\n return <ScooterIcon />;\n case 'foot':\n return <WalkingIcon />;\n case 'car':\n return <CarIcon />;\n case 'taxi':\n return <TaxiIcon />;\n default:\n return <></>;\n }\n};\n"],"names":["LegLine","color","direction","pattern","className","rest","React","classNames","style","backgroundColor","LegBone","startColor","endColor","showStart","showStop","showLine","warnAboutMissingStyles","as","Element","from","to","size","noWrap","transport","mode","colors","bus","contrast","metro","plane","tram","train","ferry","mobility","walk","taxi","console","error","brand","blue","white","modeCalc","isContrast","useContrast","onClose","undefined","children","alert","label","labelPlacement","isClosable","numberOfChildren","Children","count","TransportIcon","BusIcon","SubwayIcon","PlaneIcon","TramIcon","TrainIcon","FerryIcon","CarferryIcon","BicycleIcon","ScooterIcon","WalkingIcon","CarIcon","TaxiIcon","TravelTagWithoutLabel","onClick","CloseSmallIcon","inline","ValidationInfoIcon","ValidationErrorIcon","ValidationExclamationIcon","Label"],"mappings":"ibAkBaA,EAAkC,kBAC7CC,IAAAA,UACAC,UAAAA,aAAY,eACZC,IAAAA,QACAC,IAAAA,UACGC,0DAGDC,qCACEF,UAAWG,EAAW,eAAgBH,2BAClBD,GAAYA,qBACZD,GAAcA,MAElCM,MAAO,CAAEC,gBAAiBR,IACtBI,KCOGK,EAAkC,gBAC7CR,IAAAA,UACAC,IAAAA,QACAF,IAAAA,MACAU,IAAAA,WACAC,IAAAA,aACAC,UAAAA,oBACAC,SAAAA,oBACAC,SAAAA,gBACAX,IAAAA,UACGC,oHAGDC,qCACEF,UAAWG,EAAWH,EAAW,eAAgB,CAC/C,0BAA0C,aAAdF,GAC5B,4BAA4C,eAAdA,MAE5BG,GAEHQ,GACCP,uBACEF,gCACAI,MAAO,CAAEC,gBAAiBE,GAAcV,KAI3Cc,GACCT,gBAACN,GACCI,+BACAF,UAAWA,EACXD,MAAOA,EACPE,QAASA,IAIZW,GACCR,uBACEF,+BACAI,MAAO,CAAEC,gBAAiBG,GAAYX,OC3EhDe,yBAAuB,mECqBkC,oBACvDC,GAAIC,aAAU,QACdC,IAAAA,KACAC,IAAAA,OACAC,KAAAA,aAAO,UACPjB,IAAAA,UACAkB,IAAAA,OACGjB,6DAGDC,gBAACY,iBACCd,UAAWG,EAAW,oBAAqBH,EAAW,4BACf,UAATiB,8BACU,WAATA,+BACCC,wBAEbH,WAAaC,GAC5Bf,GAEJC,wBAA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A,GACPC,uBCkByC,4BACjDuC,QAAAA,kBAAUC,IACVC,IAAAA,SACA1C,IAAAA,cACA2C,MAAAA,aAAQ,SACRxB,IAAAA,UACAyB,IAAAA,UACAC,eAAAA,aAAiB,UACd5C,uFAEG6C,IAAaN,EACbO,EAAmB7C,EAAM8C,SAASC,MAAMP,GACxCQ,YAkES,SAAC9B,UACRA,OACD,aACIlB,gBAACiD,oBACL,eACIjD,gBAACkD,uBACL,aACIlD,gBAACmD,sBACL,cACInD,gBAACoD,qBACL,cACIpD,gBAACqD,sBACL,eACIrD,gBAACsD,sBACL,kBACItD,gBAACuD,yBACL,cACIvD,gBAACwD,wBACL,iBACIxD,gBAACyD,wBACL,cACIzD,gBAAC0D,wBACL,aACI1D,gBAAC2D,oBACL,cACI3D,gBAAC4D,gCAED5D,kCA7FWmC,CAASlB,kBAAcjB,iCAEvC6D,EACJ7D,qCACEF,UAAWG,EAAW,gDACQ2C,0BACO,SAAVH,iCACiB,UAAVA,kCAE9BI,EAAmB,GAAM5B,GAAa4B,EAAmB,kCAC7B5B,GAAcA,IAC5CnB,UAAAA,OAEEC,GAEHkB,GAAa+B,EACbR,EACAI,GACC5C,0BAAQ8D,QAASxB,EAASxC,UAAU,gCAClCE,gBAAC+D,kBAAeC,aAGT,SAAVvB,GACCzC,wBAAMF,UAAU,yBACH,SAAV2C,GACCzC,gBAACiE,sBAAmBnE,UAAU,oCAErB,UAAV2C,GACCzC,gBAACkE,uBAAoBpE,UAAU,qCAEtB,YAAV2C,GACCzC,gBAACmE,6BAA0BrE,UAAU,6CAOzCsE,EACJpE,uBACEF,UAAWG,EAAW,0DACO0C,GAAmBD,8BACnBC,kBACzBD,GAAmB,SAAVD,OAGZC,UAIDA,EAEA1C,uBACEF,UAAWG,EAAW,6EACwB0C,GAAmBD,OAGhEmB,EACAO,GAKAP"}
|
package/dist/travel.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { warnAboutMissingStyles } from '@entur/utils';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import {
|
|
4
|
+
import { CloseSmallIcon, ValidationInfoIcon, ValidationErrorIcon, ValidationExclamationIcon, TaxiIcon, CarIcon, WalkingIcon, ScooterIcon, BicycleIcon, CarferryIcon, FerryIcon, TrainIcon, TramIcon, PlaneIcon, SubwayIcon, BusIcon } from '@entur/icons';
|
|
5
5
|
import { colors } from '@entur/tokens';
|
|
6
6
|
import { useContrast } from '@entur/layout';
|
|
7
7
|
|
|
@@ -46,7 +46,7 @@ var TravelHeader = function TravelHeader(_ref) {
|
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
var TravelTag = function TravelTag(_ref) {
|
|
49
|
-
var _classNames;
|
|
49
|
+
var _modeCalc, _classNames, _classNames2;
|
|
50
50
|
|
|
51
51
|
var _ref$onClose = _ref.onClose,
|
|
52
52
|
onClose = _ref$onClose === void 0 ? undefined : _ref$onClose,
|
|
@@ -55,30 +55,91 @@ var TravelTag = function TravelTag(_ref) {
|
|
|
55
55
|
_ref$alert = _ref.alert,
|
|
56
56
|
alert = _ref$alert === void 0 ? 'none' : _ref$alert,
|
|
57
57
|
transport = _ref.transport,
|
|
58
|
-
|
|
58
|
+
label = _ref.label,
|
|
59
|
+
_ref$labelPlacement = _ref.labelPlacement,
|
|
60
|
+
labelPlacement = _ref$labelPlacement === void 0 ? 'right' : _ref$labelPlacement,
|
|
61
|
+
rest = _objectWithoutPropertiesLoose(_ref, ["onClose", "children", "className", "alert", "transport", "label", "labelPlacement"]);
|
|
59
62
|
|
|
60
63
|
var isClosable = onClose ? true : false;
|
|
61
64
|
var numberOfChildren = React.Children.count(children);
|
|
62
|
-
|
|
65
|
+
var TransportIcon = (_modeCalc = modeCalc(transport)) !== null && _modeCalc !== void 0 ? _modeCalc : React.createElement(React.Fragment, null);
|
|
66
|
+
var TravelTagWithoutLabel = React.createElement("div", Object.assign({
|
|
63
67
|
className: classNames('eds-travel-tag', (_classNames = {
|
|
64
68
|
'eds-travel-tag--closable': isClosable,
|
|
65
69
|
'eds-travel-tag--alert': alert !== 'none',
|
|
66
|
-
'eds-travel-tag--
|
|
70
|
+
'eds-travel-tag--alert--error': alert === 'error',
|
|
71
|
+
'eds-travel-tag--icon-and-text': numberOfChildren > 1 || transport && numberOfChildren > 0
|
|
67
72
|
}, _classNames["eds-travel-tag--transport-" + transport] = transport, _classNames.className = className, _classNames))
|
|
68
|
-
}, rest), children, isClosable && React.createElement("button", {
|
|
73
|
+
}, rest), transport && TransportIcon, children, isClosable && React.createElement("button", {
|
|
69
74
|
onClick: onClose,
|
|
70
75
|
className: "eds-travel-tag__close-button"
|
|
71
|
-
}, React.createElement(
|
|
76
|
+
}, React.createElement(CloseSmallIcon, {
|
|
72
77
|
inline: true
|
|
73
78
|
})), alert !== 'none' && React.createElement("span", {
|
|
74
79
|
className: "eds-travel-tag__alert"
|
|
75
80
|
}, alert === 'info' && React.createElement(ValidationInfoIcon, {
|
|
76
81
|
className: "eds-travel-tag__alert-info-icon"
|
|
77
|
-
}), alert === 'error' && React.createElement(
|
|
78
|
-
className: "eds-travel-tag__alert-exclamation-icon"
|
|
79
|
-
}), alert === 'warning' && React.createElement(ValidationErrorIcon, {
|
|
82
|
+
}), alert === 'error' && React.createElement(ValidationErrorIcon, {
|
|
80
83
|
className: "eds-travel-tag__alert-error-icon"
|
|
84
|
+
}), alert === 'warning' && React.createElement(ValidationExclamationIcon, {
|
|
85
|
+
className: "eds-travel-tag__alert-exclamation-icon"
|
|
81
86
|
})));
|
|
87
|
+
var Label = React.createElement("div", {
|
|
88
|
+
className: classNames('eds-travel-tag__label', (_classNames2 = {}, _classNames2["eds-travel-tag__label--" + labelPlacement] = label, _classNames2["eds-travel-tag__label--" + labelPlacement + "--with-alert"] = label && alert !== 'none', _classNames2))
|
|
89
|
+
}, label);
|
|
90
|
+
|
|
91
|
+
if (label) {
|
|
92
|
+
var _classNames3;
|
|
93
|
+
|
|
94
|
+
return React.createElement("div", {
|
|
95
|
+
className: classNames('eds-travel-tag__wrapper', (_classNames3 = {}, _classNames3["eds-travel-tag__wrapper--label-position-" + labelPlacement] = label, _classNames3))
|
|
96
|
+
}, TravelTagWithoutLabel, Label);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return TravelTagWithoutLabel;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
var modeCalc = function modeCalc(mode) {
|
|
103
|
+
switch (mode) {
|
|
104
|
+
case 'bus':
|
|
105
|
+
return React.createElement(BusIcon, null);
|
|
106
|
+
|
|
107
|
+
case 'metro':
|
|
108
|
+
return React.createElement(SubwayIcon, null);
|
|
109
|
+
|
|
110
|
+
case 'air':
|
|
111
|
+
return React.createElement(PlaneIcon, null);
|
|
112
|
+
|
|
113
|
+
case 'tram':
|
|
114
|
+
return React.createElement(TramIcon, null);
|
|
115
|
+
|
|
116
|
+
case 'rail':
|
|
117
|
+
return React.createElement(TrainIcon, null);
|
|
118
|
+
|
|
119
|
+
case 'water':
|
|
120
|
+
return React.createElement(FerryIcon, null);
|
|
121
|
+
|
|
122
|
+
case 'carferry':
|
|
123
|
+
return React.createElement(CarferryIcon, null);
|
|
124
|
+
|
|
125
|
+
case 'bike':
|
|
126
|
+
return React.createElement(BicycleIcon, null);
|
|
127
|
+
|
|
128
|
+
case 'scooter':
|
|
129
|
+
return React.createElement(ScooterIcon, null);
|
|
130
|
+
|
|
131
|
+
case 'foot':
|
|
132
|
+
return React.createElement(WalkingIcon, null);
|
|
133
|
+
|
|
134
|
+
case 'car':
|
|
135
|
+
return React.createElement(CarIcon, null);
|
|
136
|
+
|
|
137
|
+
case 'taxi':
|
|
138
|
+
return React.createElement(TaxiIcon, null);
|
|
139
|
+
|
|
140
|
+
default:
|
|
141
|
+
return React.createElement(React.Fragment, null);
|
|
142
|
+
}
|
|
82
143
|
};
|
|
83
144
|
|
|
84
145
|
var LegLine = function LegLine(_ref) {
|
|
@@ -144,7 +205,7 @@ var TravelLeg = function TravelLeg(_ref) {
|
|
|
144
205
|
direction = _ref.direction,
|
|
145
206
|
rest = _objectWithoutPropertiesLoose(_ref, ["className", "transport", "direction"]);
|
|
146
207
|
|
|
147
|
-
var _modeCalc = modeCalc(transport),
|
|
208
|
+
var _modeCalc = modeCalc$1(transport),
|
|
148
209
|
color = _modeCalc.color,
|
|
149
210
|
contrast = _modeCalc.contrast,
|
|
150
211
|
pattern = _modeCalc.pattern;
|
|
@@ -158,7 +219,7 @@ var TravelLeg = function TravelLeg(_ref) {
|
|
|
158
219
|
}, rest));
|
|
159
220
|
};
|
|
160
221
|
|
|
161
|
-
function modeCalc(mode) {
|
|
222
|
+
function modeCalc$1(mode) {
|
|
162
223
|
switch (mode) {
|
|
163
224
|
case 'bus':
|
|
164
225
|
return {
|
package/dist/travel.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"travel.esm.js","sources":["../src/TravelHeader.tsx","../src/TravelTag.tsx","../src/LegLine.tsx","../src/LegBone.tsx","../src/TravelLeg.tsx","../src/index.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport './TravelHeader.scss';\n\nexport type TravelHeaderProps = {\n /** HTML-elementet eller React-komponenten som lager elementet\n * @default 'div'\n */\n as?: string | React.ElementType;\n /** Destinasjonen man reiser fra */\n from: React.ReactNode;\n /** Destinasjonen man reiser til */\n to: React.ReactNode;\n /**Størrelsen på komponenten\n * @default 'large'\n */\n size?: 'large' | 'medium';\n /** Plassere til og fra på samme linje */\n noWrap?: boolean;\n /**Ekstra klassenavn */\n className?: string;\n [key: string]: any;\n};\n\nexport const TravelHeader: React.FC<TravelHeaderProps> = ({\n as: Element = 'div',\n from,\n to,\n size = 'large',\n className,\n noWrap,\n ...rest\n}) => {\n return (\n <Element\n className={classNames('eds-travel-header', className, {\n 'eds-travel-header--large': size === 'large',\n 'eds-travel-header--medium': size === 'medium',\n 'eds-travel-header--no-wrap': noWrap,\n })}\n aria-label={`Fra ${from}, til ${to}`}\n {...rest}\n >\n <span className=\"eds-travel-header__from\">{from}</span>\n <span className=\"eds-travel-header__to\">{to}</span>\n </Element>\n );\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport {\n CloseIcon,\n ValidationInfoIcon,\n ValidationErrorIcon,\n ValidationExclamationIcon,\n} from '@entur/icons';\nimport './TravelTag.scss';\n\nexport type TravelTagProps = {\n /** Callback som kalles for når man skal lukke TravelTagen\n * @default undefined\n */\n onClose?: () => void;\n /** Innholdet til TravelTagen */\n children: React.ReactNode;\n /**Ekstra klassenavn */\n className?: string;\n /** Legger til et Valideringsikon i TravelTagen for å signalisere avvik, informasjon e.l.\n * @default \"none\"\n */\n alert?: 'none' | 'error' | 'warning' | 'info';\n transport?:\n | 'bus'\n | 'metro'\n | 'air'\n | 'tram'\n | 'rail'\n | 'water'\n | 'bike'\n | 'scooter'\n | 'foot'\n | 'car';\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n>;\n\nexport const TravelTag: React.FC<TravelTagProps> = ({\n onClose = undefined,\n children,\n className,\n alert = 'none',\n transport,\n ...rest\n}) => {\n const isClosable = onClose ? true : false;\n const numberOfChildren = React.Children.count(children);\n\n return (\n <div\n className={classNames('eds-travel-tag', {\n 'eds-travel-tag--closable': isClosable,\n 'eds-travel-tag--alert': alert !== 'none',\n 'eds-travel-tag--icon-and-text': numberOfChildren > 1,\n [`eds-travel-tag--transport-${transport}`]: transport,\n className,\n })}\n {...rest}\n >\n {children}\n {isClosable && (\n <button onClick={onClose} className=\"eds-travel-tag__close-button\">\n <CloseIcon inline />\n </button>\n )}\n {alert !== 'none' && (\n <span className=\"eds-travel-tag__alert\">\n {alert === 'info' && (\n <ValidationInfoIcon className=\"eds-travel-tag__alert-info-icon\" />\n )}\n {alert === 'error' && (\n <ValidationExclamationIcon className=\"eds-travel-tag__alert-exclamation-icon\" />\n )}\n {alert === 'warning' && (\n <ValidationErrorIcon className=\"eds-travel-tag__alert-error-icon\" />\n )}\n </span>\n )}\n </div>\n );\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport './LegLine.scss';\n\nexport type LegLineProps = {\n /** Farge på LegLine'n */\n color: string;\n /** Retningen til LegLine */\n direction: 'horizontal' | 'vertical';\n /** Hvilket linjemønster som skal brukes */\n pattern: 'line' | 'dashed' | 'dotted' | 'wave';\n /** Ekstra klassenavn */\n className?: string;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n>;\n\nexport const LegLine: React.FC<LegLineProps> = ({\n color,\n direction = 'horizontal',\n pattern,\n className,\n ...rest\n}) => {\n return (\n <div\n className={classNames('eds-leg-line', className, {\n [`eds-leg-line--${pattern}`]: pattern,\n [`eds-leg-line--${direction}`]: direction,\n })}\n style={{ backgroundColor: color }}\n {...rest}\n />\n );\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport { LegLine } from './LegLine';\nimport './LegBone.scss';\n\nexport type LegBoneProps = {\n /** Retning på komponenten */\n direction: 'horizontal' | 'vertical';\n /** Hvilke linjemønster som skal brukes */\n pattern: 'line' | 'dashed' | 'dotted' | 'wave';\n /** Farge på linja */\n color: string;\n /** Farge på startpunktet\n * @default Verdien til color\n */\n startColor?: string;\n /** Farge på endepunktet\n * @default Verdien til color\n */\n endColor?: string;\n /** Vis startpunkt\n * @default true\n */\n showStart?: boolean;\n /** Vis linke\n * @default true\n */\n showLine?: boolean;\n /** Vis endepunkt\n * @default true\n */\n showStop?: boolean;\n /** Ekstra klassenavn */\n className?: string;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n>;\n\nexport const LegBone: React.FC<LegBoneProps> = ({\n direction,\n pattern,\n color,\n startColor,\n endColor,\n showStart = true,\n showStop = true,\n showLine = true,\n className,\n ...rest\n}) => {\n return (\n <div\n className={classNames(className, 'eds-leg-bone', [\n { 'eds-leg-bone--vertical': direction === 'vertical' },\n { 'eds-leg-bone--horizontal': direction === 'horizontal' },\n ])}\n {...rest}\n >\n {showStart && (\n <div\n className={`eds-leg-bone__start`}\n style={{ backgroundColor: startColor || color }}\n />\n )}\n\n {showLine && (\n <LegLine\n className={`eds-leg-bone__line`}\n direction={direction}\n color={color}\n pattern={pattern}\n />\n )}\n\n {showStop && (\n <div\n className={`eds-leg-bone__stop`}\n style={{ backgroundColor: endColor || color }}\n />\n )}\n </div>\n );\n};\n","import React from 'react';\nimport { LegBone } from './LegBone';\nimport { colors } from '@entur/tokens';\nimport { useContrast } from '@entur/layout';\n\nexport type TravelLegProps = {\n /** Ekstra klassenavn */\n className?: string;\n /** Hviklen type reise som skal vises riktig farge og linjetype */\n transport:\n | 'bus'\n | 'metro'\n | 'air'\n | 'tram'\n | 'rail'\n | 'water'\n | 'bike'\n | 'scooter'\n | 'foot'\n | 'car';\n /** Retningen på komponenten */\n direction: 'horizontal' | 'vertical';\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n>;\n\nexport const TravelLeg: React.FC<TravelLegProps> = ({\n className,\n transport,\n direction,\n ...rest\n}) => {\n const { color, contrast, pattern } = modeCalc(transport);\n const isContrast = useContrast();\n\n return (\n <LegBone\n direction={direction}\n pattern={pattern}\n color={isContrast ? contrast : color}\n className={className}\n {...rest}\n />\n );\n};\n\ntype modeCalcResult = {\n color: string;\n contrast: string;\n pattern: 'line' | 'wave' | 'dashed' | 'dotted';\n};\n\nfunction modeCalc(mode: string): modeCalcResult {\n switch (mode) {\n case 'bus':\n return {\n color: colors.transport.default.bus,\n contrast: colors.transport.contrast.bus,\n pattern: 'dashed',\n };\n case 'metro':\n return {\n color: colors.transport.default.metro,\n contrast: colors.transport.contrast.metro,\n pattern: 'line',\n };\n case 'air':\n return {\n color: colors.transport.default.plane,\n contrast: colors.transport.contrast.plane,\n pattern: 'line',\n };\n case 'tram':\n return {\n color: colors.transport.default.tram,\n contrast: colors.transport.contrast.tram,\n pattern: 'line',\n };\n case 'rail':\n return {\n color: colors.transport.default.train,\n contrast: colors.transport.contrast.train,\n pattern: 'line',\n };\n case 'water':\n return {\n color: colors.transport.default.ferry,\n contrast: colors.transport.contrast.ferry,\n pattern: 'wave',\n };\n case 'bike':\n return {\n color: colors.transport.default.mobility,\n contrast: colors.transport.contrast.mobility,\n pattern: 'line',\n };\n case 'scooter':\n return {\n color: colors.transport.default.mobility,\n contrast: colors.transport.contrast.mobility,\n pattern: 'line',\n };\n case 'foot':\n return {\n color: colors.transport.default.walk,\n contrast: colors.transport.contrast.walk,\n pattern: 'dotted',\n };\n case 'car':\n return {\n color: colors.transport.default.taxi,\n contrast: colors.transport.contrast.taxi,\n pattern: 'dashed',\n };\n default:\n console.error(\n 'No transport modality was chosen. There is likely an error in your usage of TravelLeg.',\n );\n return {\n color: colors.brand.blue,\n contrast: colors.brand.white,\n pattern: 'line',\n };\n }\n}\n","import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('travel');\n\nexport * from './TravelHeader';\nexport * from './TravelTag';\nexport * from './LegLine';\nexport * from './LegBone';\nexport * from './TravelLeg';\n"],"names":["TravelHeader","as","Element","from","to","size","className","noWrap","rest","React","classNames","TravelTag","onClose","undefined","children","alert","transport","isClosable","numberOfChildren","Children","count","onClick","CloseIcon","inline","ValidationInfoIcon","ValidationExclamationIcon","ValidationErrorIcon","LegLine","color","direction","pattern","style","backgroundColor","LegBone","startColor","endColor","showStart","showStop","showLine","TravelLeg","modeCalc","contrast","isContrast","useContrast","mode","colors","bus","metro","plane","tram","train","ferry","mobility","walk","taxi","console","error","brand","blue","white","warnAboutMissingStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;IAwBaA,YAAY,GAAgC,SAA5CA,YAA4C;qBACvDC;MAAIC,+BAAU;MACdC,YAAAA;MACAC,UAAAA;uBACAC;MAAAA,8BAAO;MACPC,iBAAAA;MACAC,cAAAA;MACGC;;AAEH,SACEC,mBAAA,CAACP,OAAD;AACEI,IAAAA,SAAS,EAAEI,UAAU,CAAC,mBAAD,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C7B,SAAP,CAAiByB,QAAjB,CAA0BY,IAF/B;AAGLvB,QAAAA,OAAO,EAAE;AAHJ,OAAP;;AAKF,SAAK,KAAL;AACE,aAAO;AACLF,QAAAA,KAAK,EAAEiB,MAAM,CAAC7B,SAAP,YAAyBsC,IAD3B;AAELb,QAAAA,QAAQ,EAAEI,MAAM,CAAC7B,SAAP,CAAiByB,QAAjB,CAA0Ba,IAF/B;AAGLxB,QAAAA,OAAO,EAAE;AAHJ,OAAP;;AAKF;AACEyB,MAAAA,OAAO,CAACC,KAAR,CACE,wFADF;AAGA,aAAO;AACL5B,QAAAA,KAAK,EAAEiB,MAAM,CAACY,KAAP,CAAaC,IADf;AAELjB,QAAAA,QAAQ,EAAEI,MAAM,CAACY,KAAP,CAAaE,KAFlB;AAGL7B,QAAAA,OAAO,EAAE;AAHJ,OAAP;AAjEJ;AAuED;;AC1HD8B,sBAAsB,CAAC,QAAD,CAAtB;;;;"}
|
|
1
|
+
{"version":3,"file":"travel.esm.js","sources":["../src/TravelHeader.tsx","../src/TravelTag.tsx","../src/LegLine.tsx","../src/LegBone.tsx","../src/TravelLeg.tsx","../src/index.tsx"],"sourcesContent":["import React from 'react';\nimport classNames from 'classnames';\nimport './TravelHeader.scss';\n\nexport type TravelHeaderProps = {\n /** HTML-elementet eller React-komponenten som lager elementet\n * @default 'div'\n */\n as?: string | React.ElementType;\n /** Destinasjonen man reiser fra */\n from: React.ReactNode;\n /** Destinasjonen man reiser til */\n to: React.ReactNode;\n /**Størrelsen på komponenten\n * @default 'large'\n */\n size?: 'large' | 'medium';\n /** Plassere til og fra på samme linje */\n noWrap?: boolean;\n /**Ekstra klassenavn */\n className?: string;\n [key: string]: any;\n};\n\nexport const TravelHeader: React.FC<TravelHeaderProps> = ({\n as: Element = 'div',\n from,\n to,\n size = 'large',\n className,\n noWrap,\n ...rest\n}) => {\n return (\n <Element\n className={classNames('eds-travel-header', className, {\n 'eds-travel-header--large': size === 'large',\n 'eds-travel-header--medium': size === 'medium',\n 'eds-travel-header--no-wrap': noWrap,\n })}\n aria-label={`Fra ${from}, til ${to}`}\n {...rest}\n >\n <span className=\"eds-travel-header__from\">{from}</span>\n <span className=\"eds-travel-header__to\">{to}</span>\n </Element>\n );\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport {\n CloseSmallIcon,\n ValidationInfoIcon,\n ValidationErrorIcon,\n ValidationExclamationIcon,\n BicycleIcon,\n BusIcon,\n FerryIcon,\n PlaneIcon,\n ScooterIcon,\n SubwayIcon,\n TrainIcon,\n TramIcon,\n WalkingIcon,\n CarIcon,\n TaxiIcon,\n CarferryIcon,\n} from '@entur/icons';\nimport './TravelTag.scss';\n\nexport type TravelTagProps = {\n /** Callback som kalles for når man skal lukke TravelTag-en\n * @default undefined\n */\n onClose?: () => void;\n /** Innholdet inne i TravelTag-en */\n children?: React.ReactNode;\n /**Ekstra klassenavn */\n className?: string;\n /** Legger til et Valideringsikon i TravelTagen for å signalisere avvik, informasjon e.l.\n * @default \"none\"\n */\n alert?: 'none' | 'error' | 'warning' | 'info';\n /** Legger til farge og ikon tilpasset valgt transportmiddel */\n transport?:\n | 'bus'\n | 'metro'\n | 'air'\n | 'tram'\n | 'rail'\n | 'water'\n | 'carferry'\n | 'bike'\n | 'scooter'\n | 'foot'\n | 'car'\n | 'taxi';\n /** Element ved siden av eller under TravelTag. */\n label?: React.ReactNode;\n /** Posisjonen til label-en i forhold til TravelTag-en\n * @default \"right\"\n */\n labelPlacement?: 'bottom' | 'right';\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n>;\n\nexport const TravelTag: React.FC<TravelTagProps> = ({\n onClose = undefined,\n children,\n className,\n alert = 'none',\n transport,\n label,\n labelPlacement = 'right',\n ...rest\n}) => {\n const isClosable = onClose ? true : false;\n const numberOfChildren = React.Children.count(children);\n const TransportIcon = modeCalc(transport) ?? <></>;\n\n const TravelTagWithoutLabel: JSX.Element = (\n <div\n className={classNames('eds-travel-tag', {\n 'eds-travel-tag--closable': isClosable,\n 'eds-travel-tag--alert': alert !== 'none',\n 'eds-travel-tag--alert--error': alert === 'error',\n 'eds-travel-tag--icon-and-text':\n numberOfChildren > 1 || (transport && numberOfChildren > 0),\n [`eds-travel-tag--transport-${transport}`]: transport,\n className,\n })}\n {...rest}\n >\n {transport && TransportIcon}\n {children}\n {isClosable && (\n <button onClick={onClose} className=\"eds-travel-tag__close-button\">\n <CloseSmallIcon inline />\n </button>\n )}\n {alert !== 'none' && (\n <span className=\"eds-travel-tag__alert\">\n {alert === 'info' && (\n <ValidationInfoIcon className=\"eds-travel-tag__alert-info-icon\" />\n )}\n {alert === 'error' && (\n <ValidationErrorIcon className=\"eds-travel-tag__alert-error-icon\" />\n )}\n {alert === 'warning' && (\n <ValidationExclamationIcon className=\"eds-travel-tag__alert-exclamation-icon\" />\n )}\n </span>\n )}\n </div>\n );\n\n const Label: JSX.Element = (\n <div\n className={classNames('eds-travel-tag__label', {\n [`eds-travel-tag__label--${labelPlacement}`]: label,\n [`eds-travel-tag__label--${labelPlacement}--with-alert`]:\n label && alert !== 'none',\n })}\n >\n {label}\n </div>\n );\n\n if (label) {\n return (\n <div\n className={classNames('eds-travel-tag__wrapper', {\n [`eds-travel-tag__wrapper--label-position-${labelPlacement}`]: label,\n })}\n >\n {TravelTagWithoutLabel}\n {Label}\n </div>\n );\n }\n\n return TravelTagWithoutLabel;\n};\n\nconst modeCalc = (mode: string | undefined) => {\n switch (mode) {\n case 'bus':\n return <BusIcon />;\n case 'metro':\n return <SubwayIcon />;\n case 'air':\n return <PlaneIcon />;\n case 'tram':\n return <TramIcon />;\n case 'rail':\n return <TrainIcon />;\n case 'water':\n return <FerryIcon />;\n case 'carferry':\n return <CarferryIcon />;\n case 'bike':\n return <BicycleIcon />;\n case 'scooter':\n return <ScooterIcon />;\n case 'foot':\n return <WalkingIcon />;\n case 'car':\n return <CarIcon />;\n case 'taxi':\n return <TaxiIcon />;\n default:\n return <></>;\n }\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport './LegLine.scss';\n\nexport type LegLineProps = {\n /** Farge på LegLine'n */\n color: string;\n /** Retningen til LegLine */\n direction: 'horizontal' | 'vertical';\n /** Hvilket linjemønster som skal brukes */\n pattern: 'line' | 'dashed' | 'dotted' | 'wave';\n /** Ekstra klassenavn */\n className?: string;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n>;\n\nexport const LegLine: React.FC<LegLineProps> = ({\n color,\n direction = 'horizontal',\n pattern,\n className,\n ...rest\n}) => {\n return (\n <div\n className={classNames('eds-leg-line', className, {\n [`eds-leg-line--${pattern}`]: pattern,\n [`eds-leg-line--${direction}`]: direction,\n })}\n style={{ backgroundColor: color }}\n {...rest}\n />\n );\n};\n","import React from 'react';\nimport classNames from 'classnames';\nimport { LegLine } from './LegLine';\nimport './LegBone.scss';\n\nexport type LegBoneProps = {\n /** Retning på komponenten */\n direction: 'horizontal' | 'vertical';\n /** Hvilke linjemønster som skal brukes */\n pattern: 'line' | 'dashed' | 'dotted' | 'wave';\n /** Farge på linja */\n color: string;\n /** Farge på startpunktet\n * @default Verdien til color\n */\n startColor?: string;\n /** Farge på endepunktet\n * @default Verdien til color\n */\n endColor?: string;\n /** Vis startpunkt\n * @default true\n */\n showStart?: boolean;\n /** Vis linke\n * @default true\n */\n showLine?: boolean;\n /** Vis endepunkt\n * @default true\n */\n showStop?: boolean;\n /** Ekstra klassenavn */\n className?: string;\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n>;\n\nexport const LegBone: React.FC<LegBoneProps> = ({\n direction,\n pattern,\n color,\n startColor,\n endColor,\n showStart = true,\n showStop = true,\n showLine = true,\n className,\n ...rest\n}) => {\n return (\n <div\n className={classNames(className, 'eds-leg-bone', [\n { 'eds-leg-bone--vertical': direction === 'vertical' },\n { 'eds-leg-bone--horizontal': direction === 'horizontal' },\n ])}\n {...rest}\n >\n {showStart && (\n <div\n className={`eds-leg-bone__start`}\n style={{ backgroundColor: startColor || color }}\n />\n )}\n\n {showLine && (\n <LegLine\n className={`eds-leg-bone__line`}\n direction={direction}\n color={color}\n pattern={pattern}\n />\n )}\n\n {showStop && (\n <div\n className={`eds-leg-bone__stop`}\n style={{ backgroundColor: endColor || color }}\n />\n )}\n </div>\n );\n};\n","import React from 'react';\nimport { LegBone } from './LegBone';\nimport { colors } from '@entur/tokens';\nimport { useContrast } from '@entur/layout';\n\nexport type TravelLegProps = {\n /** Ekstra klassenavn */\n className?: string;\n /** Hviklen type reise som skal vises riktig farge og linjetype */\n transport:\n | 'bus'\n | 'metro'\n | 'air'\n | 'tram'\n | 'rail'\n | 'water'\n | 'bike'\n | 'scooter'\n | 'foot'\n | 'car';\n /** Retningen på komponenten */\n direction: 'horizontal' | 'vertical';\n} & React.DetailedHTMLProps<\n React.HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n>;\n\nexport const TravelLeg: React.FC<TravelLegProps> = ({\n className,\n transport,\n direction,\n ...rest\n}) => {\n const { color, contrast, pattern } = modeCalc(transport);\n const isContrast = useContrast();\n\n return (\n <LegBone\n direction={direction}\n pattern={pattern}\n color={isContrast ? contrast : color}\n className={className}\n {...rest}\n />\n );\n};\n\ntype modeCalcResult = {\n color: string;\n contrast: string;\n pattern: 'line' | 'wave' | 'dashed' | 'dotted';\n};\n\nfunction modeCalc(mode: string): modeCalcResult {\n switch (mode) {\n case 'bus':\n return {\n color: colors.transport.default.bus,\n contrast: colors.transport.contrast.bus,\n pattern: 'dashed',\n };\n case 'metro':\n return {\n color: colors.transport.default.metro,\n contrast: colors.transport.contrast.metro,\n pattern: 'line',\n };\n case 'air':\n return {\n color: colors.transport.default.plane,\n contrast: colors.transport.contrast.plane,\n pattern: 'line',\n };\n case 'tram':\n return {\n color: colors.transport.default.tram,\n contrast: colors.transport.contrast.tram,\n pattern: 'line',\n };\n case 'rail':\n return {\n color: colors.transport.default.train,\n contrast: colors.transport.contrast.train,\n pattern: 'line',\n };\n case 'water':\n return {\n color: colors.transport.default.ferry,\n contrast: colors.transport.contrast.ferry,\n pattern: 'wave',\n };\n case 'bike':\n return {\n color: colors.transport.default.mobility,\n contrast: colors.transport.contrast.mobility,\n pattern: 'line',\n };\n case 'scooter':\n return {\n color: colors.transport.default.mobility,\n contrast: colors.transport.contrast.mobility,\n pattern: 'line',\n };\n case 'foot':\n return {\n color: colors.transport.default.walk,\n contrast: colors.transport.contrast.walk,\n pattern: 'dotted',\n };\n case 'car':\n return {\n color: colors.transport.default.taxi,\n contrast: colors.transport.contrast.taxi,\n pattern: 'dashed',\n };\n default:\n console.error(\n 'No transport modality was chosen. There is likely an error in your usage of TravelLeg.',\n );\n return {\n color: colors.brand.blue,\n contrast: colors.brand.white,\n pattern: 'line',\n };\n }\n}\n","import { warnAboutMissingStyles } from '@entur/utils';\nimport './index.scss';\n\nwarnAboutMissingStyles('travel');\n\nexport * from './TravelHeader';\nexport * from './TravelTag';\nexport * from './LegLine';\nexport * from './LegBone';\nexport * from './TravelLeg';\n"],"names":["TravelHeader","as","Element","from","to","size","className","noWrap","rest","React","classNames","TravelTag","onClose","undefined","children","alert","transport","label","labelPlacement","isClosable","numberOfChildren","Children","count","TransportIcon","modeCalc","TravelTagWithoutLabel","onClick","CloseSmallIcon","inline","ValidationInfoIcon","ValidationErrorIcon","ValidationExclamationIcon","Label","mode","BusIcon","SubwayIcon","PlaneIcon","TramIcon","TrainIcon","FerryIcon","CarferryIcon","BicycleIcon","ScooterIcon","WalkingIcon","CarIcon","TaxiIcon","LegLine","color","direction","pattern","style","backgroundColor","LegBone","startColor","endColor","showStart","showStop","showLine","TravelLeg","contrast","isContrast","useContrast","colors","bus","metro","plane","tram","train","ferry","mobility","walk","taxi","console","error","brand","blue","white","warnAboutMissingStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;IAwBaA,YAAY,GAAgC,SAA5CA,YAA4C;qBACvDC;MAAIC,+BAAU;MACdC,YAAAA;MACAC,UAAAA;uBACAC;MAAA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travel.esm.js",
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"lint": "tsdx lint"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@entur/icons": "^3.
|
|
27
|
-
"@entur/layout": "^2.1.
|
|
28
|
-
"@entur/tokens": "^3.
|
|
26
|
+
"@entur/icons": "^3.4.0",
|
|
27
|
+
"@entur/layout": "^2.1.3",
|
|
28
|
+
"@entur/tokens": "^3.3.0",
|
|
29
29
|
"@entur/utils": "^0.4.2",
|
|
30
30
|
"classnames": "^2.3.1"
|
|
31
31
|
},
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"rollup-plugin-sass": "^1.2.2"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "7862498307d864c5f0265d657f49f76cd0afa8db"
|
|
40
40
|
}
|