@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.
Files changed (36) hide show
  1. package/esm/alert/Alert.js +2 -1
  2. package/esm/alert/Alert.js.map +1 -1
  3. package/esm/index.js +2 -1
  4. package/esm/index.js.map +1 -1
  5. package/esm/stories/ColorPalette.js +2 -1
  6. package/esm/stories/ColorPalette.js.map +1 -1
  7. package/lib/alert/Alert.d.ts +3 -4
  8. package/lib/alert/Alert.d.ts.map +1 -1
  9. package/lib/alert/Alert.js +3 -3
  10. package/lib/alert/Alert.js.map +1 -1
  11. package/lib/dropdown/index.d.ts.map +1 -1
  12. package/lib/dropdown/index.js +1 -2
  13. package/lib/dropdown/index.js.map +1 -1
  14. package/lib/focus-trap-wrapper/index.d.ts.map +1 -1
  15. package/lib/focus-trap-wrapper/index.js +1 -2
  16. package/lib/focus-trap-wrapper/index.js.map +1 -1
  17. package/lib/index.d.ts +2 -1
  18. package/lib/index.d.ts.map +1 -1
  19. package/lib/index.js +8 -2
  20. package/lib/index.js.map +1 -1
  21. package/lib/stories/ColorPalette.d.ts +0 -1
  22. package/lib/stories/ColorPalette.d.ts.map +1 -1
  23. package/lib/stories/ColorPalette.js +5 -2
  24. package/lib/stories/ColorPalette.js.map +1 -1
  25. package/package.json +3 -3
  26. package/src/alert/Alert.tsx +11 -8
  27. package/src/index.ts +8 -1
  28. package/src/stories/ColorPalette.tsx +3 -1
  29. package/src/stories/__snapshots__/alerts.story.tsx.snap +88 -83
  30. package/src/stories/__snapshots__/dropdown.story.tsx.snap +1 -1
  31. package/src/stories/__snapshots__/focusTrapStory.story.tsx.snap +1 -1
  32. package/src/stories/__snapshots__/index.story.tsx.snap +1 -1
  33. package/src/stories/alerts.story.tsx +24 -15
  34. package/src/stories/dropdown.story.tsx +2 -2
  35. package/src/stories/index.story.tsx +1 -1
  36. package/tsconfig.tsbuildinfo +1 -1
@@ -1,35 +1,37 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
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="Alert__AlertContainer-sc-2vlo3n-0 bVfQIo">
5
- <svg viewbox="0 0 16 16"
6
- height="24"
7
- width="24"
8
- aria-hidden="true"
9
- focusable="false"
10
- fill="currentColor"
11
- xmlns="http://www.w3.org/2000/svg"
12
- class="StyledIconBase-sc-ea9ulj-0 ebjPRL"
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
- <div>
31
- <div class="Alert__ContentPadding-sc-2vlo3n-5 isIayL">
32
- Here is more content
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="Alert__AlertContainer-sc-2vlo3n-0 bqBujX">
42
- <svg viewbox="0 0 16 16"
43
- height="24"
44
- width="24"
45
- aria-hidden="true"
46
- focusable="false"
47
- fill="currentColor"
48
- xmlns="http://www.w3.org/2000/svg"
49
- class="StyledIconBase-sc-ea9ulj-0 ebjPRL"
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
- <svg viewbox="0 0 16 16"
65
- height="16"
66
- width="16"
67
- aria-hidden="true"
68
- focusable="false"
69
- fill="currentColor"
70
- xmlns="http://www.w3.org/2000/svg"
71
- class="StyledIconBase-sc-ea9ulj-0 ebjPRL"
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
- <path fill-rule="evenodd"
74
- 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"
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
- </path>
77
- </svg>
78
- </button>
79
- </span>
80
- <div class="Alert__AlertContent-sc-2vlo3n-4 UrwUS">
81
- <div aria-hidden="true"
82
- class="rah-static rah-static--height-zero "
83
- style="height: 0px; overflow: hidden;"
84
- >
85
- <div style="display: none;">
86
- <div class="Alert__ContentPadding-sc-2vlo3n-5 esOwtt">
87
- <div>
88
- 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.
89
- </div>
90
- <br>
91
- <div>
92
- 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.
93
- </div>
94
- <br>
95
- <div>
96
- 3) The west elevators at the Washington Park MAX Station are out of service. Please use east elevators to access street level and platforms.
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,4 +1,4 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
1
+ // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2
2
 
3
3
  exports[`Building-Blocks/Dropdown DropdownAsOtprrNavItem smoke-test 1`] = `
4
4
  <div class="dropdownstory__NavItemWrapper-sc-giygrt-0 jFfMlb">
@@ -1,4 +1,4 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
1
+ // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2
2
 
3
3
  exports[`Building-Blocks/FocusTrapWrapper FocusTrapAroundButtonSet smoke-test 1`] = `
4
4
  <div id="button-set-story-focus-trap"
@@ -1,4 +1,4 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
1
+ // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2
2
 
3
3
  exports[`Building-Blocks/Colors Blue smoke-test 1`] = `
4
4
  <div class="ColorPalette__ColorBlock-sc-fil65c-0 iEijBb">
@@ -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
- <Alert
58
- alertHeader="Next trip starts on Wednesday April 17th"
59
- alertSubheader="Trip is due to begin at 7:43 AM (Realtime monitoring will being at 7:13 AM)"
60
- >
61
- Here is more content
62
- </Alert>
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
- <Alert
69
- backgroundColor={red[50]}
70
- collapsible
71
- Icon={ExclamationTriangle}
72
- alertHeader="Your trip has alerts"
73
- >
74
- <AlertContent />
75
- </Alert>
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 { ComponentMeta } from "@storybook/react";
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 ComponentMeta<typeof Dropdown>;
45
+ } as Meta<typeof Dropdown>;
46
46
 
47
47
  export const DropdownWithLabel = (): React.ReactElement => (
48
48
  <Dropdown
@@ -1,5 +1,5 @@
1
1
  import React, { ReactElement } from "react";
2
- import { Meta } from "@storybook/react";
2
+ import { Meta } from "@storybook/react-vite";
3
3
  import ColorPalette from "./ColorPalette";
4
4
 
5
5
  import grey from "../colors/grey";