@ably/ui 14.0.0-dev.fbce38f → 14.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.
Files changed (208) hide show
  1. package/README.md +8 -10
  2. package/core/Accordion.js +1 -0
  3. package/core/Code/component.js +1 -1
  4. package/core/Code.js +1 -0
  5. package/core/ConnectStateWrapper.js +1 -0
  6. package/core/ContactFooter/component.css +9 -7
  7. package/core/ContactFooter/component.js +1 -1
  8. package/core/ContactFooter.js +1 -0
  9. package/core/CookieMessage/component.css +12 -10
  10. package/core/CookieMessage.js +1 -0
  11. package/core/CustomerLogos.js +1 -0
  12. package/core/DropdownMenu.js +1 -0
  13. package/core/Expander.js +1 -0
  14. package/core/FeaturedLink.js +1 -0
  15. package/core/Flash/component.css +21 -19
  16. package/core/Flash.js +1 -0
  17. package/core/Footer/component.css +24 -22
  18. package/core/Footer.js +1 -0
  19. package/core/Icon.js +1 -0
  20. package/core/Loader.js +13 -0
  21. package/core/Logo.js +1 -0
  22. package/core/Meganav/component.css +105 -103
  23. package/core/Meganav/component.js +1 -1
  24. package/core/Meganav.js +1 -0
  25. package/core/MeganavBlogPostsList/component.js +1 -1
  26. package/core/MeganavBlogPostsList.js +1 -0
  27. package/core/MeganavContentCompany.js +1 -0
  28. package/core/MeganavContentDevelopers.js +1 -0
  29. package/core/MeganavContentProducts.js +1 -0
  30. package/core/MeganavContentUseCases.js +1 -0
  31. package/core/MeganavControl/component.js +1 -1
  32. package/core/MeganavControl.js +1 -0
  33. package/core/MeganavControlMobileDropdown/component.js +1 -1
  34. package/core/MeganavControlMobileDropdown.js +1 -0
  35. package/core/MeganavControlMobilePanelClose/component.js +1 -1
  36. package/core/MeganavControlMobilePanelClose.js +1 -0
  37. package/core/MeganavControlMobilePanelOpen/component.js +1 -1
  38. package/core/MeganavControlMobilePanelOpen.js +1 -0
  39. package/core/MeganavItemsDesktop.js +1 -0
  40. package/core/MeganavItemsMobile.js +1 -0
  41. package/core/MeganavItemsSignedIn.js +1 -0
  42. package/core/MeganavSearch.js +1 -0
  43. package/core/MeganavSearchAutocomplete/component.js +1 -1
  44. package/core/MeganavSearchAutocomplete.js +1 -0
  45. package/core/MeganavSearchPanel.js +1 -0
  46. package/core/MeganavSearchSuggestions/component.js +1 -1
  47. package/core/MeganavSearchSuggestions.js +1 -0
  48. package/core/Notice/component.css +6 -4
  49. package/core/Notice/component.js +1 -1
  50. package/core/Notice.js +1 -0
  51. package/core/SignOutLink.js +1 -0
  52. package/core/Slider/component.css +38 -4
  53. package/core/Slider/component.js +1 -1
  54. package/core/Slider.js +1 -0
  55. package/core/Table/Table.js +1 -1
  56. package/core/Table/TableCell.js +7 -1
  57. package/core/Table/TableRow.js +1 -1
  58. package/core/Table/data.js +1 -0
  59. package/core/Table.js +1 -0
  60. package/core/Tooltip.js +1 -0
  61. package/core/css.js +1 -1
  62. package/core/dom-query.js +1 -1
  63. package/core/hubspot-chat-toggle.js +1 -1
  64. package/core/icons/icon-gui-partial.svg +4 -0
  65. package/core/icons.js +1 -1
  66. package/core/load-sprites.js +1 -1
  67. package/core/react-renderer.js +1 -1
  68. package/core/remote-blogs-posts.js +1 -1
  69. package/core/remote-data-store.js +1 -1
  70. package/core/remote-data-util.js +1 -1
  71. package/core/remote-session-data.js +1 -1
  72. package/core/scripts.js +1 -1
  73. package/core/sprites.svg +1 -1
  74. package/core/styles/buttons.css +123 -121
  75. package/core/styles/forms.css +51 -49
  76. package/core/styles/layout.css +16 -14
  77. package/core/styles/properties.css +252 -250
  78. package/core/styles/text.css +167 -165
  79. package/core/styles.components.css +24 -22
  80. package/core/url-base.js +1 -1
  81. package/core/utils/syntax-highlighter-registry.js +1 -1
  82. package/core/utils/syntax-highlighter.css +59 -55
  83. package/core/utils/syntax-highlighter.js +1 -1
  84. package/package.json +3 -6
  85. package/src/core/Accordion/Accordion.stories.tsx +1 -1
  86. package/src/core/{Accordion/component.tsx → Accordion.tsx} +8 -6
  87. package/src/core/Code/Code.stories.tsx +1 -1
  88. package/src/core/{Code/component.tsx → Code.tsx} +2 -3
  89. package/src/core/{ConnectStateWrapper/component.tsx → ConnectStateWrapper.tsx} +1 -1
  90. package/src/core/ContactFooter/ContactFooter.stories.tsx +1 -1
  91. package/src/core/ContactFooter/component.css +9 -7
  92. package/src/core/{ContactFooter/component.tsx → ContactFooter.tsx} +3 -4
  93. package/src/core/CookieMessage/CookieMessage.stories.tsx +1 -1
  94. package/src/core/CookieMessage/component.css +12 -10
  95. package/src/core/{CookieMessage/component.tsx → CookieMessage.tsx} +1 -2
  96. package/src/core/CustomerLogos/CustomerLogos.stories.tsx +1 -1
  97. package/src/core/DropdownMenu/DropdownMenu.stories.tsx +2 -2
  98. package/src/core/{DropdownMenu/component.tsx → DropdownMenu.tsx} +1 -1
  99. package/src/core/Expander/Expander.stories.tsx +132 -0
  100. package/src/core/Expander.tsx +63 -0
  101. package/src/core/FeaturedLink/FeaturedLink.stories.tsx +1 -1
  102. package/src/core/{FeaturedLink/component.tsx → FeaturedLink.tsx} +1 -1
  103. package/src/core/Flash/Flash.stories.tsx +1 -1
  104. package/src/core/Flash/component.css +21 -19
  105. package/src/core/{Flash/component.tsx → Flash.tsx} +3 -4
  106. package/src/core/Footer/Footer.stories.tsx +1 -1
  107. package/src/core/Footer/component.css +24 -22
  108. package/src/core/{Footer/component.tsx → Footer.tsx} +2 -3
  109. package/src/core/Icon/Icon.stories.tsx +2 -1
  110. package/src/core/Loader/Loader.stories.tsx +1 -1
  111. package/src/core/Logo/Logo.stories.tsx +1 -1
  112. package/src/core/Meganav/Meganav.stories.tsx +1 -1
  113. package/src/core/Meganav/component.css +105 -103
  114. package/src/core/Meganav/component.js +0 -2
  115. package/src/core/{Meganav/component.tsx → Meganav.tsx} +16 -19
  116. package/src/core/{MeganavBlogPostsList/component.tsx → MeganavBlogPostsList.tsx} +2 -2
  117. package/src/core/{MeganavContentCompany/component.tsx → MeganavContentCompany.tsx} +5 -5
  118. package/src/core/{MeganavContentDevelopers/component.tsx → MeganavContentDevelopers.tsx} +2 -2
  119. package/src/core/{MeganavContentProducts/component.tsx → MeganavContentProducts.tsx} +2 -2
  120. package/src/core/{MeganavContentUseCases/component.tsx → MeganavContentUseCases.tsx} +2 -2
  121. package/src/core/{MeganavControl/component.tsx → MeganavControl.tsx} +2 -2
  122. package/src/core/{MeganavControlMobileDropdown/component.tsx → MeganavControlMobileDropdown.tsx} +2 -2
  123. package/src/core/{MeganavControlMobilePanelClose/component.tsx → MeganavControlMobilePanelClose.tsx} +1 -2
  124. package/src/core/{MeganavControlMobilePanelOpen/component.tsx → MeganavControlMobilePanelOpen.tsx} +1 -2
  125. package/src/core/{MeganavItemsDesktop/component.tsx → MeganavItemsDesktop.tsx} +3 -3
  126. package/src/core/{MeganavItemsMobile/component.tsx → MeganavItemsMobile.tsx} +9 -9
  127. package/src/core/{MeganavItemsSignedIn/component.tsx → MeganavItemsSignedIn.tsx} +4 -8
  128. package/src/core/{MeganavSearch/component.tsx → MeganavSearch.tsx} +3 -3
  129. package/src/core/{MeganavSearchPanel/component.tsx → MeganavSearchPanel.tsx} +4 -4
  130. package/src/core/{MeganavSearchSuggestions/component.tsx → MeganavSearchSuggestions.tsx} +2 -2
  131. package/src/core/Notice/component.css +6 -4
  132. package/src/core/Notice/component.js +1 -2
  133. package/src/core/{Notice/component.tsx → Notice.tsx} +2 -4
  134. package/src/core/{SignOutLink/component.tsx → SignOutLink.tsx} +1 -1
  135. package/src/core/Slider/Slider.stories.tsx +83 -30
  136. package/src/core/Slider/component.css +38 -4
  137. package/src/core/Slider/component.js +0 -2
  138. package/src/core/Slider.tsx +224 -0
  139. package/src/core/Table/Table.tsx +38 -10
  140. package/src/core/Table/TableCell.tsx +14 -27
  141. package/src/core/Table/{stories/data.tsx → data.tsx} +23 -3
  142. package/src/core/{Table/index.ts → Table.tsx} +3 -12
  143. package/src/core/Tooltip/Tooltip.stories.tsx +1 -1
  144. package/src/core/{Tooltip/component.tsx → Tooltip.tsx} +34 -6
  145. package/src/core/icons/icon-gui-partial.svg +4 -0
  146. package/src/core/scripts.js +0 -2
  147. package/src/core/styles/buttons.css +123 -121
  148. package/src/core/styles/forms.css +51 -49
  149. package/src/core/styles/layout.css +16 -14
  150. package/src/core/styles/properties.css +252 -250
  151. package/src/core/styles/text.css +167 -165
  152. package/src/core/styles.components.css +24 -22
  153. package/src/core/utils/syntax-highlighter.css +59 -55
  154. package/src/pages/Buttons.mdx +1 -1
  155. package/src/pages/Chips.mdx +1 -1
  156. package/src/pages/Forms.mdx +2 -2
  157. package/core/Accordion/component.js +0 -1
  158. package/core/ConnectStateWrapper/component.js +0 -1
  159. package/core/CookieMessage/component.js +0 -1
  160. package/core/CustomerLogos/component.js +0 -1
  161. package/core/DropdownMenu/component.js +0 -1
  162. package/core/FeaturedLink/component.js +0 -1
  163. package/core/Flash/component.js +0 -1
  164. package/core/Footer/component.js +0 -1
  165. package/core/Icon/component.js +0 -1
  166. package/core/Loader/component.js +0 -1
  167. package/core/Logo/component.js +0 -1
  168. package/core/MeganavContentCompany/component.js +0 -1
  169. package/core/MeganavContentDevelopers/component.js +0 -1
  170. package/core/MeganavContentProducts/component.js +0 -1
  171. package/core/MeganavContentUseCases/component.js +0 -1
  172. package/core/MeganavItemsDesktop/component.js +0 -1
  173. package/core/MeganavItemsMobile/component.js +0 -1
  174. package/core/MeganavItemsSignedIn/component.js +0 -1
  175. package/core/MeganavSearch/component.js +0 -1
  176. package/core/MeganavSearchPanel/component.js +0 -1
  177. package/core/SignOutLink/component.js +0 -1
  178. package/core/Table/index.js +0 -1
  179. package/core/Table/stories/data.js +0 -1
  180. package/core/Tooltip/component.js +0 -1
  181. package/src/core/Accordion/component.js +0 -0
  182. package/src/core/ConnectStateWrapper/component.js +0 -0
  183. package/src/core/CookieMessage/component.js +0 -1
  184. package/src/core/CustomerLogos/component.js +0 -0
  185. package/src/core/DropdownMenu/component.js +0 -0
  186. package/src/core/FeaturedLink/component.js +0 -0
  187. package/src/core/Flash/component.js +0 -1
  188. package/src/core/Footer/component.js +0 -1
  189. package/src/core/Icon/component.js +0 -0
  190. package/src/core/Loader/component.js +0 -0
  191. package/src/core/Logo/component.js +0 -0
  192. package/src/core/MeganavContentCompany/component.js +0 -0
  193. package/src/core/MeganavContentDevelopers/component.js +0 -0
  194. package/src/core/MeganavContentProducts/component.js +0 -0
  195. package/src/core/MeganavContentUseCases/component.js +0 -1
  196. package/src/core/MeganavItemsDesktop/component.js +0 -0
  197. package/src/core/MeganavItemsMobile/component.js +0 -0
  198. package/src/core/MeganavItemsSignedIn/component.js +0 -0
  199. package/src/core/MeganavSearch/component.js +0 -0
  200. package/src/core/MeganavSearchPanel/component.js +0 -0
  201. package/src/core/SignOutLink/component.js +0 -0
  202. package/src/core/Slider/component.tsx +0 -112
  203. /package/src/core/{CustomerLogos/component.tsx → CustomerLogos.tsx} +0 -0
  204. /package/src/core/{Icon/component.tsx → Icon.tsx} +0 -0
  205. /package/src/core/{Loader/component.tsx → Loader.tsx} +0 -0
  206. /package/src/core/{Logo/component.tsx → Logo.tsx} +0 -0
  207. /package/src/core/{MeganavSearchAutocomplete/component.tsx → MeganavSearchAutocomplete.tsx} +0 -0
  208. /package/src/core/Table/{stories/Table.stories.tsx → Table.stories.tsx} +0 -0
@@ -1,4 +1,4 @@
1
- import Code from "./component.tsx";
1
+ import Code from "../Code";
2
2
 
3
3
  export default {
4
4
  title: "Components/Code",
@@ -1,11 +1,10 @@
1
1
  import React from "react";
2
2
 
3
- import "../utils/syntax-highlighter.css";
4
3
  import {
5
4
  highlightSnippet,
6
5
  registerDefaultLanguages,
7
- } from "../utils/syntax-highlighter";
8
- import languagesRegistry from "../utils/syntax-highlighter-registry";
6
+ } from "./utils/syntax-highlighter";
7
+ import languagesRegistry from "./utils/syntax-highlighter-registry";
9
8
 
10
9
  registerDefaultLanguages(languagesRegistry);
11
10
 
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect, useState } from "react";
2
2
 
3
- import { connectState, getRemoteDataStore } from "../remote-data-store";
3
+ import { connectState, getRemoteDataStore } from "./remote-data-store";
4
4
 
5
5
  /*
6
6
  Connect a react component to a global store.
@@ -1,4 +1,4 @@
1
- import ContactFooter from "./component.tsx";
1
+ import ContactFooter from "../ContactFooter";
2
2
 
3
3
  export default {
4
4
  title: "Components/Contact Footer",
@@ -1,9 +1,11 @@
1
- .ui-contact-footer {
2
- background-size: 100% 100%;
3
- background-position: right center;
4
- @apply w-full bg-gradient-active-orange;
5
- }
1
+ @layer components {
2
+ .ui-contact-footer {
3
+ background-size: 100% 100%;
4
+ background-position: right center;
5
+ @apply w-full bg-gradient-active-orange;
6
+ }
6
7
 
7
- .ui-contact-footer-box {
8
- @apply p-24 sm:p-32 xl:p-40 bg-white flex flex-col justify-between rounded-sm;
8
+ .ui-contact-footer-box {
9
+ @apply p-24 sm:p-32 xl:p-40 bg-white flex flex-col justify-between rounded-sm;
10
+ }
9
11
  }
@@ -1,9 +1,8 @@
1
1
  import React, { useEffect } from "react";
2
2
 
3
- import Icon from "../Icon/component.tsx";
4
- import _absUrl from "../url-base.js";
5
- import toggleChatWidget from "../hubspot-chat-toggle";
6
- import "./component.css";
3
+ import Icon from "./Icon";
4
+ import _absUrl from "./url-base.js";
5
+ import toggleChatWidget from "./hubspot-chat-toggle";
7
6
 
8
7
  type ContactFooterProps = {
9
8
  urlBase: string;
@@ -1,4 +1,4 @@
1
- import CookieMessage from "./component.tsx";
1
+ import CookieMessage from "../CookieMessage";
2
2
 
3
3
  export default {
4
4
  title: "Components/Cookie Message",
@@ -1,11 +1,13 @@
1
- .ui-cookie-message {
2
- @apply rounded-lg bg-white font-sans;
3
- @apply justify-between items-center;
4
- @apply opacity-100 z-50 bottom-0 fixed sm:flex;
5
- @apply p-16 mb-16 ml-16;
6
- max-width: 70vw;
7
- box-shadow: 0px 24px 32px 0px #0000000d;
8
- border: 1px solid var(--color-mid-grey);
9
- border-left: 0.5rem solid var(--color-electric-cyan);
10
- transition: bottom 250ms ease-out, opacity 150ms ease-out;
1
+ @layer components {
2
+ .ui-cookie-message {
3
+ @apply rounded-lg bg-white font-sans;
4
+ @apply justify-between items-center;
5
+ @apply opacity-100 z-50 bottom-0 fixed sm:flex;
6
+ @apply p-16 mb-16 ml-16;
7
+ max-width: 70vw;
8
+ box-shadow: 0px 24px 32px 0px #0000000d;
9
+ border: 1px solid var(--color-mid-grey);
10
+ border-left: 0.5rem solid var(--color-electric-cyan);
11
+ transition: bottom 250ms ease-out, opacity 150ms ease-out;
12
+ }
11
13
  }
@@ -1,8 +1,7 @@
1
1
  import React, { useRef, useEffect, useState } from "react";
2
2
  import Cookie from "js-cookie";
3
- import "./component.css";
4
3
 
5
- import _absUrl from "../url-base";
4
+ import _absUrl from "./url-base";
6
5
 
7
6
  const COOKIE_EXPIRY = 365;
8
7
 
@@ -1,4 +1,4 @@
1
- import CustomerLogos from "./component.tsx";
1
+ import CustomerLogos from "../CustomerLogos";
2
2
 
3
3
  import hubspot from "../images/cust-logo-hubspot-mono-pos.svg";
4
4
  import webflow from "../images/cust-logo-webflow-col-pos.svg";
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
- import Icon from "../Icon/component.tsx";
3
- import DropdownMenu from "./component.tsx";
2
+ import Icon from "../Icon";
3
+ import DropdownMenu from "../DropdownMenu";
4
4
 
5
5
  export default {
6
6
  title: "Components/Dropdown Menu",
@@ -7,7 +7,7 @@ import React, {
7
7
  ReactNode,
8
8
  Dispatch,
9
9
  } from "react";
10
- import Icon from "../Icon/component.tsx";
10
+ import Icon from "./Icon";
11
11
 
12
12
  const DropdownMenuContext = createContext<{
13
13
  isOpen: boolean;
@@ -0,0 +1,132 @@
1
+ import React from "react";
2
+ import Expander from "../Expander";
3
+
4
+ export default {
5
+ title: "Components/Expander",
6
+ component: Expander,
7
+ tags: ["autodocs"],
8
+ args: {
9
+ height: 200,
10
+ },
11
+ argTypes: {
12
+ height: {
13
+ control: {
14
+ type: "number",
15
+ },
16
+ },
17
+ },
18
+ };
19
+
20
+ const longContentInner = (
21
+ <div>
22
+ <p>Ipsum</p>
23
+ <ul className="mb-16 list-inside list-disc">
24
+ <li>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</li>
25
+ <li>Sed convallis ex pharetra, tristique tellus vel, rhoncus velit.</li>
26
+ <li>Mauris molestie felis et scelerisque ullamcorper.</li>
27
+ <li>Maecenas congue ligula ut commodo tristique.</li>
28
+ <li>
29
+ Pellentesque venenatis elit vitae urna condimentum, in mollis arcu
30
+ venenatis.
31
+ </li>
32
+ <li>Donec nec turpis vel urna egestas fringilla.</li>
33
+ </ul>
34
+ <p>Ipsum</p>
35
+ <ul className="mb-16 list-inside list-disc">
36
+ <li>Mauris ut nibh vel metus cursus semper.</li>
37
+ <li>Ut mattis tortor eu urna accumsan gravida.</li>
38
+ <li>Nunc pellentesque neque at elit pretium tempor.</li>
39
+ <li>Curabitur finibus magna vitae nunc varius fermentum.</li>
40
+ </ul>
41
+ <ul className="mb-16 list-inside list-disc">
42
+ <li>Curabitur vehicula mi iaculis, luctus augue eu, venenatis quam.</li>
43
+ <li>Praesent in eros efficitur, consequat ante eu, faucibus arcu.</li>
44
+ <li>Nulla laoreet nibh a odio interdum, non molestie diam auctor.</li>
45
+ </ul>
46
+ <p>Ipsum</p>
47
+ <ul className="mb-16 list-inside list-disc">
48
+ <li>
49
+ Praesent aliquam diam tincidunt, sollicitudin tortor eget, vulputate
50
+ lacus.
51
+ </li>
52
+ <li>Quisque in mi sed ex vulputate varius in a leo.</li>
53
+ <li>Etiam posuere dolor at tortor aliquam imperdiet.</li>
54
+ <li>
55
+ Maecenas quis neque consequat, ultricies est sit amet, congue est.
56
+ </li>
57
+ <li>Aenean a elit sed nibh pretium lacinia sed convallis sapien.</li>
58
+ </ul>
59
+ <p>Ipsum</p>
60
+ <ul className="mb-16 list-inside list-disc">
61
+ <li>
62
+ Nulla malesuada libero id dolor aliquam, non sagittis mi scelerisque.
63
+ </li>
64
+ <li>
65
+ Etiam tincidunt lacus eu diam laoreet consectetur sit amet non est.
66
+ </li>
67
+ <li>In porta arcu nec purus tincidunt vulputate.</li>
68
+ </ul>
69
+ </div>
70
+ );
71
+
72
+ export const LongContent = {
73
+ render: () => <Expander>{longContentInner}</Expander>,
74
+ parameters: {
75
+ docs: {
76
+ description: {
77
+ story:
78
+ "A larger amount of content that exceeds the height cut-off, controls shown.",
79
+ },
80
+ },
81
+ },
82
+ };
83
+
84
+ export const ShortContent = {
85
+ render: () => (
86
+ <Expander>
87
+ <div>
88
+ <p>Ipsum</p>
89
+ <ul className="mb-16 list-inside list-disc">
90
+ <li>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</li>
91
+ <li>
92
+ Sed convallis ex pharetra, tristique tellus vel, rhoncus velit.
93
+ </li>
94
+ <li>Mauris molestie felis et scelerisque ullamcorper.</li>
95
+ <li>Maecenas congue ligula ut commodo tristique.</li>
96
+ <li>
97
+ Pellentesque venenatis elit vitae urna condimentum, in mollis arcu
98
+ venenatis.
99
+ </li>
100
+ <li>Donec nec turpis vel urna egestas fringilla.</li>
101
+ </ul>
102
+ </div>
103
+ </Expander>
104
+ ),
105
+ parameters: {
106
+ docs: {
107
+ description: {
108
+ story:
109
+ "A smaller amount of content that doesn't exceed the height cut-off, therefore no controls shown.",
110
+ },
111
+ },
112
+ },
113
+ };
114
+
115
+ export const OverriddenStyles = {
116
+ render: () => (
117
+ <Expander
118
+ className="bg-neutral-400 p-16 rounded-lg"
119
+ fadeClassName="from-neutral-800"
120
+ >
121
+ {longContentInner}
122
+ </Expander>
123
+ ),
124
+ parameters: {
125
+ docs: {
126
+ description: {
127
+ story:
128
+ "A larger amount of content, with overridden styles for the content wrapper and fader.",
129
+ },
130
+ },
131
+ },
132
+ };
@@ -0,0 +1,63 @@
1
+ import React, { PropsWithChildren, useEffect, useRef, useState } from "react";
2
+
3
+ type ExpanderProps = {
4
+ heightThreshold?: number;
5
+ className?: string;
6
+ fadeClassName?: string;
7
+ };
8
+
9
+ const Expander = ({
10
+ heightThreshold = 200,
11
+ className,
12
+ fadeClassName,
13
+ children,
14
+ }: PropsWithChildren<ExpanderProps>) => {
15
+ const innerRef = useRef<HTMLDivElement>(null);
16
+ const [showControls, setShowControls] = useState(false);
17
+ const [height, setHeight] = useState<number | "auto">(heightThreshold);
18
+ const [expanded, setExpanded] = useState(false);
19
+
20
+ useEffect(() => {
21
+ const contentHeight = innerRef.current?.clientHeight ?? heightThreshold;
22
+
23
+ if (contentHeight < heightThreshold) {
24
+ setHeight("auto");
25
+ } else if (expanded) {
26
+ setHeight(contentHeight);
27
+ } else {
28
+ setHeight(heightThreshold);
29
+ }
30
+
31
+ setShowControls(contentHeight >= heightThreshold);
32
+ }, [heightThreshold, expanded]);
33
+
34
+ return (
35
+ <>
36
+ <div
37
+ style={{ height }}
38
+ className={`overflow-hidden transition-all relative ${className ?? ""}`}
39
+ >
40
+ {showControls && !expanded && (
41
+ <div
42
+ className={`h-64 w-full bg-gradient-to-t from-white to-transparent absolute bottom-0 left-0 right-0 ${
43
+ fadeClassName ?? ""
44
+ }`}
45
+ ></div>
46
+ )}
47
+ <div ref={innerRef}>{children}</div>
48
+ </div>
49
+ {showControls && (
50
+ <div
51
+ onClick={() => setExpanded(!expanded)}
52
+ onKeyDown={(e) => e.key === "Enter" && setExpanded(!expanded)}
53
+ tabIndex={0}
54
+ className="mt-16 cursor-pointer font-bold text-gui-blue-default-light hover:text-gui-blue-hover-light"
55
+ >
56
+ {expanded ? "View less -" : "View all +"}
57
+ </div>
58
+ )}
59
+ </>
60
+ );
61
+ };
62
+
63
+ export default Expander;
@@ -1,4 +1,4 @@
1
- import FeaturedLink from "./component.tsx";
1
+ import FeaturedLink from "../FeaturedLink";
2
2
 
3
3
  export default {
4
4
  title: "Components/Featured Link",
@@ -1,6 +1,6 @@
1
1
  import React, { CSSProperties, ReactNode } from "react";
2
2
 
3
- import Icon from "../Icon/component.tsx";
3
+ import Icon from "./Icon";
4
4
 
5
5
  type FeaturedLinkProps = {
6
6
  url: string;
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import Flash, { reducerFlashes } from "./component.tsx";
2
+ import Flash, { reducerFlashes } from "../Flash";
3
3
 
4
4
  import {
5
5
  attachStoreToWindow,
@@ -1,23 +1,25 @@
1
- .ui-flash {
2
- @apply w-full fixed;
3
- top: 5.5rem;
4
- z-index: calc(var(--stacking-context-page-meganav) - 10);
5
- transition: margin-top 200ms;
6
- }
1
+ @layer components {
2
+ .ui-flash {
3
+ @apply w-full fixed;
4
+ top: 5.5rem;
5
+ z-index: calc(var(--stacking-context-page-meganav) - 10);
6
+ transition: margin-top 200ms;
7
+ }
7
8
 
8
- .ui-flash-message {
9
- @apply font-sans font-light antialiased max-w-screen-xl mx-auto mt-8 opacity-0 relative;
10
- transition: opacity 200ms, transform 200ms, height 200ms 200ms,
11
- margin-top 200ms 200ms;
12
- transform: translateY(-200%) rotateX(-90deg);
13
- }
9
+ .ui-flash-message {
10
+ @apply font-sans font-light antialiased max-w-screen-xl mx-auto mt-8 opacity-0 relative;
11
+ transition: opacity 200ms, transform 200ms, height 200ms 200ms,
12
+ margin-top 200ms 200ms;
13
+ transform: translateY(-200%) rotateX(-90deg);
14
+ }
14
15
 
15
- /* dynamic content inside flash, can't add classes */
16
- .ui-flash-text a {
17
- @apply underline;
18
- }
16
+ /* dynamic content inside flash, can't add classes */
17
+ .ui-flash-text a {
18
+ @apply underline;
19
+ }
19
20
 
20
- .ui-flash-message-enter {
21
- @apply opacity-100;
22
- transform: translateY(0) rotateX(0);
21
+ .ui-flash-message-enter {
22
+ @apply opacity-100;
23
+ transform: translateY(0) rotateX(0);
24
+ }
23
25
  }
@@ -2,10 +2,9 @@ import React, { useEffect, useState, useRef } from "react";
2
2
  import DOMPurify from "dompurify";
3
3
  import { nanoid } from "nanoid/non-secure";
4
4
 
5
- import { getRemoteDataStore } from "../remote-data-store.js";
6
- import ConnectStateWrapper from "../ConnectStateWrapper/component.tsx";
7
- import Icon from "../Icon/component.tsx";
8
- import "./component.css";
5
+ import { getRemoteDataStore } from "./remote-data-store.js";
6
+ import ConnectStateWrapper from "./ConnectStateWrapper";
7
+ import Icon from "./Icon";
9
8
 
10
9
  type FlashProps = {
11
10
  id: string;
@@ -1,4 +1,4 @@
1
- import Footer from "./component.tsx";
1
+ import Footer from "../Footer";
2
2
 
3
3
  import ablyStack from "../images/ably-stack.svg";
4
4
  import highestPerformer from "../images/high-performer-2023.svg";
@@ -1,31 +1,33 @@
1
- .ui-footer-col-title {
2
- @apply font-mono text-overline2 p-menu-row-title font-medium uppercase tracking-widen-0.16;
3
- }
1
+ @layer components {
2
+ .ui-footer-col-title {
3
+ @apply font-mono text-overline2 p-menu-row-title font-medium uppercase tracking-widen-0.16;
4
+ }
4
5
 
5
- .ui-footer-menu-row-link {
6
- @apply text-menu3 text-cool-black font-sans font-medium hover:text-gui-hover block;
7
- }
6
+ .ui-footer-menu-row-link {
7
+ @apply text-menu3 text-cool-black font-sans font-medium hover:text-gui-hover block;
8
+ }
8
9
 
9
- .ui-footer-link {
10
- @apply text-gui-default hover:text-gui-hover text-menu3 font-sans font-medium;
11
- }
10
+ .ui-footer-link {
11
+ @apply text-gui-default hover:text-gui-hover text-menu3 font-sans font-medium;
12
+ }
12
13
 
13
- .ui-footer-compliance-text {
14
- font-size: 12px;
15
- }
14
+ .ui-footer-compliance-text {
15
+ font-size: 12px;
16
+ }
16
17
 
17
- .ui-footer-tick-icon {
18
- min-width: 1.5rem;
19
- }
18
+ .ui-footer-tick-icon {
19
+ min-width: 1.5rem;
20
+ }
20
21
 
21
- @media (max-width: 1040px) {
22
- .ui-footer-bottom-links {
23
- @apply pb-40;
22
+ @media (max-width: 1040px) {
23
+ .ui-footer-bottom-links {
24
+ @apply pb-40;
25
+ }
24
26
  }
25
- }
26
27
 
27
- @media screen {
28
- .ui-footer-glassdoor {
29
- display: none;
28
+ @media screen {
29
+ .ui-footer-glassdoor {
30
+ display: none;
31
+ }
30
32
  }
31
33
  }
@@ -1,8 +1,7 @@
1
1
  import React from "react";
2
2
 
3
- import Icon from "../Icon/component.tsx";
4
- import _absUrl from "../url-base.js";
5
- import "./component.css";
3
+ import Icon from "./Icon";
4
+ import _absUrl from "./url-base.js";
6
5
 
7
6
  type FooterProps = {
8
7
  paths: {
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import Icon from "./component.tsx";
2
+ import Icon from "../Icon";
3
3
 
4
4
  export default {
5
5
  title: "Components/Icon",
@@ -38,6 +38,7 @@ const coreIcons = [
38
38
  "icon-gui-link-arrow",
39
39
  "icon-gui-live-chat",
40
40
  "icon-gui-minus",
41
+ "icon-gui-partial",
41
42
  "icon-gui-plus",
42
43
  "icon-gui-quote-marks-solid",
43
44
  "icon-gui-refresh",
@@ -1,4 +1,4 @@
1
- import Loader from "./component.tsx";
1
+ import Loader from "../Loader";
2
2
 
3
3
  export default {
4
4
  title: "Components/Loader",
@@ -1,4 +1,4 @@
1
- import Logo from "./component.tsx";
1
+ import Logo from "../Logo";
2
2
  import logoUrl from "../images/ably-logo.png";
3
3
 
4
4
  export default {
@@ -1,7 +1,7 @@
1
1
  import React, { useEffect } from "react";
2
2
  import { rest } from "msw";
3
3
 
4
- import Meganav from "./component.tsx";
4
+ import Meganav from "../Meganav";
5
5
  import loadIcons from "../icons.js";
6
6
  import logo from "../images/ably-logo.png";
7
7
  import ablyStack from "../images/ably-stack.svg";