@opentripplanner/building-blocks 3.0.1 → 3.1.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/esm/alert/Alert.js +2 -1
- package/esm/alert/Alert.js.map +1 -1
- package/esm/index.js +2 -1
- package/esm/index.js.map +1 -1
- package/esm/stories/ColorPalette.js +2 -1
- package/esm/stories/ColorPalette.js.map +1 -1
- package/lib/alert/Alert.d.ts +3 -4
- package/lib/alert/Alert.d.ts.map +1 -1
- package/lib/alert/Alert.js +3 -3
- package/lib/alert/Alert.js.map +1 -1
- package/lib/dropdown/index.d.ts.map +1 -1
- package/lib/dropdown/index.js +1 -2
- package/lib/dropdown/index.js.map +1 -1
- package/lib/focus-trap-wrapper/index.d.ts.map +1 -1
- package/lib/focus-trap-wrapper/index.js +1 -2
- package/lib/focus-trap-wrapper/index.js.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +8 -2
- package/lib/index.js.map +1 -1
- package/lib/stories/ColorPalette.d.ts +0 -1
- package/lib/stories/ColorPalette.d.ts.map +1 -1
- package/lib/stories/ColorPalette.js +5 -2
- package/lib/stories/ColorPalette.js.map +1 -1
- package/package.json +3 -3
- package/src/alert/Alert.tsx +11 -8
- package/src/index.ts +8 -1
- package/src/stories/ColorPalette.tsx +3 -1
- package/src/stories/__snapshots__/alerts.story.tsx.snap +88 -83
- package/src/stories/__snapshots__/dropdown.story.tsx.snap +1 -1
- package/src/stories/__snapshots__/focusTrapStory.story.tsx.snap +1 -1
- package/src/stories/__snapshots__/index.story.tsx.snap +1 -1
- package/src/stories/alerts.story.tsx +24 -15
- package/src/stories/dropdown.story.tsx +2 -2
- package/src/stories/index.story.tsx +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,35 +1,37 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://
|
|
1
|
+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
|
2
2
|
|
|
3
3
|
exports[`Building-Blocks/Alert BasicAlert smoke-test 1`] = `
|
|
4
|
-
<div class="
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<path d="M8 16a2 2 0 0 0 2-2H6a2 2 0 0 0 2 2zM8 1.918l-.797.161A4.002 4.002 0 0 0 4 6c0 .628-.134 2.197-.459 3.742-.16.767-.376 1.566-.663 2.258h10.244c-.287-.692-.502-1.49-.663-2.258C12.134 8.197 12 6.628 12 6a4.002 4.002 0 0 0-3.203-3.92L8 1.917zM14.22 12c.223.447.481.801.78 1H1c.299-.199.557-.553.78-1C2.68 10.2 3 6.88 3 6c0-2.42 1.72-4.44 4.005-4.901a1 1 0 1 1 1.99 0A5.002 5.002 0 0 1 13 6c0 .88.32 4.2 1.22 6z">
|
|
15
|
-
</path>
|
|
16
|
-
</svg>
|
|
17
|
-
<span class="Alert__AlertHeader-sc-2vlo3n-2 fpauiN">
|
|
18
|
-
Next trip starts on Wednesday April 17th
|
|
19
|
-
</span>
|
|
20
|
-
<span class="Alert__ButtonContainer-sc-2vlo3n-1 cKzYKK">
|
|
21
|
-
</span>
|
|
22
|
-
<span class="Alert__AlertHeader-sc-2vlo3n-2 Alert__AlertSubheader-sc-2vlo3n-3 fpauiN dYdxsJ">
|
|
23
|
-
Trip is due to begin at 7:43 AM (Realtime monitoring will being at 7:13 AM)
|
|
24
|
-
</span>
|
|
25
|
-
<div class="Alert__AlertContent-sc-2vlo3n-4 UrwUS">
|
|
26
|
-
<div aria-hidden="false"
|
|
27
|
-
class="rah-static rah-static--height-auto "
|
|
28
|
-
style="height: auto; overflow: visible;"
|
|
4
|
+
<div class="alertsstory__AlertContainer-sc-19s77d-0 fgnBDZ">
|
|
5
|
+
<div class="Alert__AlertContainer-sc-2vlo3n-0 bVfQIo">
|
|
6
|
+
<svg viewbox="0 0 16 16"
|
|
7
|
+
height="24"
|
|
8
|
+
width="24"
|
|
9
|
+
aria-hidden="true"
|
|
10
|
+
focusable="false"
|
|
11
|
+
fill="currentColor"
|
|
12
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
13
|
+
class="StyledIconBase-sc-ea9ulj-0 ebjPRL"
|
|
29
14
|
>
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
15
|
+
<path d="M8 16a2 2 0 0 0 2-2H6a2 2 0 0 0 2 2zM8 1.918l-.797.161A4.002 4.002 0 0 0 4 6c0 .628-.134 2.197-.459 3.742-.16.767-.376 1.566-.663 2.258h10.244c-.287-.692-.502-1.49-.663-2.258C12.134 8.197 12 6.628 12 6a4.002 4.002 0 0 0-3.203-3.92L8 1.917zM14.22 12c.223.447.481.801.78 1H1c.299-.199.557-.553.78-1C2.68 10.2 3 6.88 3 6c0-2.42 1.72-4.44 4.005-4.901a1 1 0 1 1 1.99 0A5.002 5.002 0 0 1 13 6c0 .88.32 4.2 1.22 6z">
|
|
16
|
+
</path>
|
|
17
|
+
</svg>
|
|
18
|
+
<span class="Alert__AlertHeader-sc-2vlo3n-2 fpauiN">
|
|
19
|
+
Next trip starts on Wednesday April 17th
|
|
20
|
+
</span>
|
|
21
|
+
<span class="Alert__ButtonContainer-sc-2vlo3n-1 cKzYKK">
|
|
22
|
+
</span>
|
|
23
|
+
<span class="Alert__AlertHeader-sc-2vlo3n-2 Alert__AlertSubheader-sc-2vlo3n-3 fpauiN dYdxsJ">
|
|
24
|
+
Trip is due to begin at 7:43 AM (Realtime monitoring will being at 7:13 AM)
|
|
25
|
+
</span>
|
|
26
|
+
<div class="Alert__AlertContent-sc-2vlo3n-4 UrwUS">
|
|
27
|
+
<div aria-hidden="false"
|
|
28
|
+
class="rah-static rah-static--height-auto "
|
|
29
|
+
style="height: auto; overflow: visible;"
|
|
30
|
+
>
|
|
31
|
+
<div>
|
|
32
|
+
<div class="Alert__ContentPadding-sc-2vlo3n-5 isIayL">
|
|
33
|
+
Here is more content
|
|
34
|
+
</div>
|
|
33
35
|
</div>
|
|
34
36
|
</div>
|
|
35
37
|
</div>
|
|
@@ -38,64 +40,67 @@ exports[`Building-Blocks/Alert BasicAlert smoke-test 1`] = `
|
|
|
38
40
|
`;
|
|
39
41
|
|
|
40
42
|
exports[`Building-Blocks/Alert CollapsibleAlertWithTransitAlerts smoke-test 1`] = `
|
|
41
|
-
<div class="
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
<path d="M7.938 2.016A.13.13 0 0 1 8.002 2a.13.13 0 0 1 .063.016.146.146 0 0 1 .054.057l6.857 11.667c.036.06.035.124.002.183a.163.163 0 0 1-.054.06.116.116 0 0 1-.066.017H1.146a.115.115 0 0 1-.066-.017.163.163 0 0 1-.054-.06.176.176 0 0 1 .002-.183L7.884 2.073a.147.147 0 0 1 .054-.057zm1.044-.45a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566z">
|
|
52
|
-
</path>
|
|
53
|
-
<path d="M7.002 12a1 1 0 1 1 2 0 1 1 0 0 1-2 0zM7.1 5.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995z">
|
|
54
|
-
</path>
|
|
55
|
-
</svg>
|
|
56
|
-
<span class="Alert__AlertHeader-sc-2vlo3n-2 fpauiN">
|
|
57
|
-
Your trip has alerts
|
|
58
|
-
</span>
|
|
59
|
-
<span class="Alert__ButtonContainer-sc-2vlo3n-1 cKzYKK">
|
|
60
|
-
<button type="button"
|
|
61
|
-
aria-label="Expand"
|
|
62
|
-
title="Expand"
|
|
43
|
+
<div class="alertsstory__AlertContainer-sc-19s77d-0 fgnBDZ">
|
|
44
|
+
<div class="Alert__AlertContainer-sc-2vlo3n-0 bqBujX">
|
|
45
|
+
<svg viewbox="0 0 16 16"
|
|
46
|
+
height="24"
|
|
47
|
+
width="24"
|
|
48
|
+
aria-hidden="true"
|
|
49
|
+
focusable="false"
|
|
50
|
+
fill="currentColor"
|
|
51
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
52
|
+
class="StyledIconBase-sc-ea9ulj-0 ebjPRL"
|
|
63
53
|
>
|
|
64
|
-
<
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
54
|
+
<path d="M7.938 2.016A.13.13 0 0 1 8.002 2a.13.13 0 0 1 .063.016.146.146 0 0 1 .054.057l6.857 11.667c.036.06.035.124.002.183a.163.163 0 0 1-.054.06.116.116 0 0 1-.066.017H1.146a.115.115 0 0 1-.066-.017.163.163 0 0 1-.054-.06.176.176 0 0 1 .002-.183L7.884 2.073a.147.147 0 0 1 .054-.057zm1.044-.45a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566z">
|
|
55
|
+
</path>
|
|
56
|
+
<path d="M7.002 12a1 1 0 1 1 2 0 1 1 0 0 1-2 0zM7.1 5.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995z">
|
|
57
|
+
</path>
|
|
58
|
+
</svg>
|
|
59
|
+
<span class="Alert__AlertHeader-sc-2vlo3n-2 fpauiN">
|
|
60
|
+
Your trip has alerts
|
|
61
|
+
</span>
|
|
62
|
+
<span class="Alert__ButtonContainer-sc-2vlo3n-1 cKzYKK">
|
|
63
|
+
<button type="button"
|
|
64
|
+
class="toggle-btn"
|
|
65
|
+
aria-label="Expand"
|
|
66
|
+
title="Expand"
|
|
72
67
|
>
|
|
73
|
-
<
|
|
74
|
-
|
|
68
|
+
<svg viewbox="0 0 16 16"
|
|
69
|
+
height="16"
|
|
70
|
+
width="16"
|
|
71
|
+
aria-hidden="true"
|
|
72
|
+
focusable="false"
|
|
73
|
+
fill="currentColor"
|
|
74
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
75
|
+
class="StyledIconBase-sc-ea9ulj-0 ebjPRL"
|
|
75
76
|
>
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
77
|
+
<path fill-rule="evenodd"
|
|
78
|
+
d="M7.646 4.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1-.708.708L8 5.707l-5.646 5.647a.5.5 0 0 1-.708-.708l6-6z"
|
|
79
|
+
>
|
|
80
|
+
</path>
|
|
81
|
+
</svg>
|
|
82
|
+
</button>
|
|
83
|
+
</span>
|
|
84
|
+
<div class="Alert__AlertContent-sc-2vlo3n-4 UrwUS">
|
|
85
|
+
<div aria-hidden="true"
|
|
86
|
+
class="rah-static rah-static--height-zero "
|
|
87
|
+
style="height: 0px; overflow: hidden;"
|
|
88
|
+
>
|
|
89
|
+
<div style="display: none;">
|
|
90
|
+
<div class="Alert__ContentPadding-sc-2vlo3n-5 esOwtt">
|
|
91
|
+
<div>
|
|
92
|
+
1) TriMet Customer Service will be unavailable to serve text messages or Twitter responses from 9:00 p.m.- 11:30 p.m. For immediate assistance regarding safety or security concerns, please contact the police via 911.
|
|
93
|
+
</div>
|
|
94
|
+
<br>
|
|
95
|
+
<div>
|
|
96
|
+
2) The Park and Ride garage elevator at Sunset Transit Center is closed for approximately 3 months for improvements. During this time garage users must use the stairs or find alternate parking. Visit trimet.org/parkandride for a complete list of Park and Ride garages.
|
|
97
|
+
</div>
|
|
98
|
+
<br>
|
|
99
|
+
<div>
|
|
100
|
+
3) The west elevators at the Washington Park MAX Station are out of service. Please use east elevators to access street level and platforms.
|
|
101
|
+
</div>
|
|
102
|
+
<br>
|
|
97
103
|
</div>
|
|
98
|
-
<br>
|
|
99
104
|
</div>
|
|
100
105
|
</div>
|
|
101
106
|
</div>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { ReactElement } from "react";
|
|
2
|
-
import { Meta } from "@storybook/react";
|
|
2
|
+
import { Meta } from "@storybook/react-vite";
|
|
3
3
|
import { ExclamationTriangle } from "@styled-icons/bootstrap/ExclamationTriangle";
|
|
4
|
+
import styled from "styled-components";
|
|
4
5
|
import Alert from "../alert/Alert";
|
|
5
6
|
import red from "../colors/red";
|
|
6
7
|
|
|
@@ -33,6 +34,10 @@ const alerts = [
|
|
|
33
34
|
}
|
|
34
35
|
];
|
|
35
36
|
|
|
37
|
+
const AlertContainer = styled.div`
|
|
38
|
+
max-width: 700px;
|
|
39
|
+
`;
|
|
40
|
+
|
|
36
41
|
const AlertContent = () => {
|
|
37
42
|
return (
|
|
38
43
|
<>
|
|
@@ -54,24 +59,28 @@ const AlertContent = () => {
|
|
|
54
59
|
|
|
55
60
|
export const BasicAlert = (): ReactElement => {
|
|
56
61
|
return (
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
<AlertContainer>
|
|
63
|
+
<Alert
|
|
64
|
+
alertHeader="Next trip starts on Wednesday April 17th"
|
|
65
|
+
alertSubheader="Trip is due to begin at 7:43 AM (Realtime monitoring will being at 7:13 AM)"
|
|
66
|
+
>
|
|
67
|
+
Here is more content
|
|
68
|
+
</Alert>
|
|
69
|
+
</AlertContainer>
|
|
63
70
|
);
|
|
64
71
|
};
|
|
65
72
|
|
|
66
73
|
export const CollapsibleAlertWithTransitAlerts = (): ReactElement => {
|
|
67
74
|
return (
|
|
68
|
-
<
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
<AlertContainer>
|
|
76
|
+
<Alert
|
|
77
|
+
backgroundColor={red[50]}
|
|
78
|
+
collapsible
|
|
79
|
+
Icon={ExclamationTriangle}
|
|
80
|
+
alertHeader="Your trip has alerts"
|
|
81
|
+
>
|
|
82
|
+
<AlertContent />
|
|
83
|
+
</Alert>
|
|
84
|
+
</AlertContainer>
|
|
76
85
|
);
|
|
77
86
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { Meta } from "@storybook/react-vite";
|
|
3
3
|
import styled from "styled-components";
|
|
4
4
|
import Dropdown from "../dropdown";
|
|
5
5
|
import blue from "../colors/blue";
|
|
@@ -42,7 +42,7 @@ const NavItemWrapper = styled.div`
|
|
|
42
42
|
export default {
|
|
43
43
|
title: "Building-Blocks/Dropdown",
|
|
44
44
|
component: Dropdown
|
|
45
|
-
} as
|
|
45
|
+
} as Meta<typeof Dropdown>;
|
|
46
46
|
|
|
47
47
|
export const DropdownWithLabel = (): React.ReactElement => (
|
|
48
48
|
<Dropdown
|