@ably/ui 14.0.0-dev.968e4a2 → 14.0.0-dev.f024736

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 (152) hide show
  1. package/README.md +8 -10
  2. package/core/.DS_Store +0 -0
  3. package/core/Accordion.js +1 -1
  4. package/core/Code.js +1 -1
  5. package/core/ConnectStateWrapper.js +1 -1
  6. package/core/ContactFooter.js +1 -1
  7. package/core/CookieMessage.js +1 -1
  8. package/core/DropdownMenu.js +1 -1
  9. package/core/FeaturedLink.js +1 -1
  10. package/core/Flash.js +1 -1
  11. package/core/Footer.js +1 -1
  12. package/core/Meganav.js +1 -1
  13. package/core/MeganavBlogPostsList.js +1 -1
  14. package/core/MeganavContentCompany.js +1 -1
  15. package/core/MeganavContentDevelopers.js +1 -1
  16. package/core/MeganavContentProducts.js +1 -1
  17. package/core/MeganavContentUseCases.js +1 -1
  18. package/core/MeganavControl.js +1 -1
  19. package/core/MeganavControlMobileDropdown.js +1 -1
  20. package/core/MeganavControlMobilePanelClose.js +1 -1
  21. package/core/MeganavControlMobilePanelOpen.js +1 -1
  22. package/core/MeganavItemsDesktop.js +1 -1
  23. package/core/MeganavItemsMobile.js +1 -1
  24. package/core/MeganavItemsSignedIn.js +1 -1
  25. package/core/MeganavSearch.js +1 -1
  26. package/core/MeganavSearchPanel.js +1 -1
  27. package/core/MeganavSearchSuggestions.js +1 -1
  28. package/core/Notice/component.js +1 -1
  29. package/core/Notice.js +1 -1
  30. package/core/Slider.js +1 -1
  31. package/core/Table/Table.js +1 -1
  32. package/core/Table/TableCell.js +4 -4
  33. package/core/Table/data.js +1 -1
  34. package/core/Table.js +1 -1
  35. package/core/Tooltip.js +1 -1
  36. package/package.json +1 -2
  37. package/src/.DS_Store +0 -0
  38. package/src/core/.DS_Store +0 -0
  39. package/src/core/Accordion/Accordion.stories.tsx +1 -1
  40. package/src/core/Accordion.tsx +1 -1
  41. package/src/core/Code/Code.stories.tsx +1 -1
  42. package/src/core/Code.tsx +3 -3
  43. package/src/core/ConnectStateWrapper.tsx +1 -1
  44. package/src/core/ContactFooter/ContactFooter.stories.tsx +1 -1
  45. package/src/core/ContactFooter.tsx +4 -4
  46. package/src/core/CookieMessage/CookieMessage.stories.tsx +1 -1
  47. package/src/core/CookieMessage.tsx +2 -2
  48. package/src/core/CustomerLogos/CustomerLogos.stories.tsx +1 -1
  49. package/src/core/DropdownMenu/DropdownMenu.stories.tsx +2 -2
  50. package/src/core/DropdownMenu.tsx +1 -1
  51. package/src/core/FeaturedLink/FeaturedLink.stories.tsx +1 -1
  52. package/src/core/FeaturedLink.tsx +1 -1
  53. package/src/core/Flash/Flash.stories.tsx +1 -1
  54. package/src/core/Flash.tsx +4 -4
  55. package/src/core/Footer/Footer.stories.tsx +1 -1
  56. package/src/core/Footer.tsx +3 -3
  57. package/src/core/Icon/Icon.stories.tsx +1 -1
  58. package/src/core/Loader/Loader.stories.tsx +1 -1
  59. package/src/core/Logo/Logo.stories.tsx +1 -1
  60. package/src/core/Meganav/Meganav.stories.tsx +1 -1
  61. package/src/core/Meganav.tsx +17 -19
  62. package/src/core/MeganavBlogPostsList.tsx +2 -2
  63. package/src/core/MeganavContentCompany.tsx +5 -5
  64. package/src/core/MeganavContentDevelopers.tsx +2 -2
  65. package/src/core/MeganavContentProducts.tsx +2 -2
  66. package/src/core/MeganavContentUseCases.tsx +2 -2
  67. package/src/core/MeganavControl.tsx +2 -2
  68. package/src/core/MeganavControlMobileDropdown.tsx +2 -2
  69. package/src/core/MeganavControlMobilePanelClose.tsx +1 -2
  70. package/src/core/MeganavControlMobilePanelOpen.tsx +1 -2
  71. package/src/core/MeganavItemsDesktop.tsx +3 -3
  72. package/src/core/MeganavItemsMobile.tsx +9 -9
  73. package/src/core/MeganavItemsSignedIn.tsx +4 -8
  74. package/src/core/MeganavSearch.tsx +3 -3
  75. package/src/core/MeganavSearchPanel.tsx +4 -4
  76. package/src/core/MeganavSearchSuggestions.tsx +2 -2
  77. package/src/core/Notice/component.js +1 -1
  78. package/src/core/Notice.tsx +3 -4
  79. package/src/core/SignOutLink.tsx +1 -1
  80. package/src/core/Slider/Slider.stories.tsx +1 -1
  81. package/src/core/Slider.tsx +3 -3
  82. package/src/core/Table/Table.tsx +38 -9
  83. package/src/core/Table/TableCell.tsx +13 -5
  84. package/src/core/Table/data.tsx +3 -3
  85. package/src/core/Table.tsx +3 -3
  86. package/src/core/Tooltip/Tooltip.stories.tsx +1 -1
  87. package/src/core/Tooltip.tsx +34 -6
  88. package/src/pages/Buttons.mdx +1 -1
  89. package/src/pages/Chips.mdx +1 -1
  90. package/src/pages/Forms.mdx +2 -2
  91. package/core/Accordion/component.js +0 -0
  92. package/core/ConnectStateWrapper/component.js +0 -0
  93. package/core/CookieMessage/component.js +0 -1
  94. package/core/CustomerLogos/component.js +0 -0
  95. package/core/DropdownMenu/component.js +0 -0
  96. package/core/FeaturedLink/component.js +0 -0
  97. package/core/Flash/component.js +0 -1
  98. package/core/Footer/component.js +0 -1
  99. package/core/Icon/component.js +0 -0
  100. package/core/Loader/component.js +0 -0
  101. package/core/Logo/component.js +0 -0
  102. package/core/MeganavContentCompany/component.js +0 -0
  103. package/core/MeganavContentDevelopers/component.js +0 -0
  104. package/core/MeganavContentProducts/.DS_Store +0 -0
  105. package/core/MeganavContentProducts/component.js +0 -0
  106. package/core/MeganavContentUseCases/.DS_Store +0 -0
  107. package/core/MeganavContentUseCases/component.js +0 -0
  108. package/core/MeganavItemsDesktop/.DS_Store +0 -0
  109. package/core/MeganavItemsDesktop/component.js +0 -0
  110. package/core/MeganavItemsMobile/.DS_Store +0 -0
  111. package/core/MeganavItemsMobile/component.js +0 -0
  112. package/core/MeganavItemsSignedIn/.DS_Store +0 -0
  113. package/core/MeganavItemsSignedIn/component.js +0 -0
  114. package/core/MeganavSearch/.DS_Store +0 -0
  115. package/core/MeganavSearch/component.js +0 -0
  116. package/core/MeganavSearchPanel/.DS_Store +0 -0
  117. package/core/MeganavSearchPanel/component.js +0 -0
  118. package/core/SignOutLink/.DS_Store +0 -0
  119. package/core/SignOutLink/component.js +0 -0
  120. package/src/core/Accordion/component.js +0 -0
  121. package/src/core/ConnectStateWrapper/component.js +0 -0
  122. package/src/core/CookieMessage/component.js +0 -1
  123. package/src/core/CustomerLogos/component.js +0 -0
  124. package/src/core/DropdownMenu/component.js +0 -0
  125. package/src/core/FeaturedLink/component.js +0 -0
  126. package/src/core/Flash/component.js +0 -1
  127. package/src/core/Footer/component.js +0 -1
  128. package/src/core/Icon/component.js +0 -0
  129. package/src/core/Loader/component.js +0 -0
  130. package/src/core/Logo/component.js +0 -0
  131. package/src/core/MeganavContentCompany/.DS_Store +0 -0
  132. package/src/core/MeganavContentCompany/component.js +0 -0
  133. package/src/core/MeganavContentDevelopers/.DS_Store +0 -0
  134. package/src/core/MeganavContentDevelopers/component.js +0 -0
  135. package/src/core/MeganavContentProducts/.DS_Store +0 -0
  136. package/src/core/MeganavContentProducts/component.js +0 -0
  137. package/src/core/MeganavContentUseCases/.DS_Store +0 -0
  138. package/src/core/MeganavContentUseCases/component.js +0 -1
  139. package/src/core/MeganavItemsDesktop/.DS_Store +0 -0
  140. package/src/core/MeganavItemsDesktop/component.js +0 -0
  141. package/src/core/MeganavItemsMobile/.DS_Store +0 -0
  142. package/src/core/MeganavItemsMobile/component.js +0 -0
  143. package/src/core/MeganavItemsSignedIn/.DS_Store +0 -0
  144. package/src/core/MeganavItemsSignedIn/component.js +0 -0
  145. package/src/core/MeganavSearch/.DS_Store +0 -0
  146. package/src/core/MeganavSearch/component.js +0 -0
  147. package/src/core/MeganavSearchPanel/.DS_Store +0 -0
  148. package/src/core/MeganavSearchPanel/component.js +0 -0
  149. package/src/core/SignOutLink/.DS_Store +0 -0
  150. package/src/core/SignOutLink/component.js +0 -0
  151. /package/core/{MeganavContentCompany → Tooltip}/.DS_Store +0 -0
  152. /package/{core/MeganavContentDevelopers → src/core/Tooltip}/.DS_Store +0 -0
@@ -1,8 +1,8 @@
1
1
  import React, { CSSProperties, ReactNode, useEffect, useRef } from "react";
2
2
 
3
- import Icon from "../Icon/component.tsx";
4
- import SliderScripts from "./component.js";
5
- import "./component.css";
3
+ import Icon from "./Icon";
4
+ import SliderScripts from "./Slider/component.js";
5
+ import "./Slider/component.css";
6
6
 
7
7
  type SliderProps = {
8
8
  slides?: ReactNode[];
@@ -1,28 +1,57 @@
1
- import React, { PropsWithChildren, ReactElement, cloneElement } from "react";
1
+ import React, {
2
+ PropsWithChildren,
3
+ ReactElement,
4
+ TableHTMLAttributes,
5
+ cloneElement,
6
+ } from "react";
2
7
 
3
8
  type TableProps = {
4
9
  id?: string;
5
10
  };
6
11
 
7
- export const Table = ({ id, children }: PropsWithChildren<TableProps>) => (
8
- <table id={id} className="ui-standard-container mb-4 sm:table-fixed">
12
+ export const Table = ({
13
+ id,
14
+ children,
15
+ ...rest
16
+ }: PropsWithChildren<TableProps & TableHTMLAttributes<HTMLTableElement>>) => (
17
+ <table
18
+ id={id}
19
+ {...rest}
20
+ className={`ui-standard-container mb-4 sm:table-fixed ${
21
+ rest?.className ?? ""
22
+ }`}
23
+ >
9
24
  {children}
10
25
  </table>
11
26
  );
12
27
 
13
- export const TableBody = ({ children }: PropsWithChildren) => (
14
- <tbody>{children}</tbody>
28
+ export const TableBody = ({
29
+ children,
30
+ ...rest
31
+ }: PropsWithChildren<TableHTMLAttributes<HTMLTableSectionElement>>) => (
32
+ <tbody {...rest}>{children}</tbody>
15
33
  );
16
34
 
17
- export const TableHeader = ({ children }: PropsWithChildren) => (
18
- <thead className="sticky bg-white z-10 top-0" key="sticky-block">
35
+ export const TableHeader = ({
36
+ children,
37
+ ...rest
38
+ }: PropsWithChildren<TableHTMLAttributes<HTMLTableSectionElement>>) => (
39
+ <thead
40
+ {...rest}
41
+ className={`sticky bg-white z-10 top-0 ${rest?.className ?? ""}`}
42
+ >
19
43
  {cloneElement(children as ReactElement, { isHeader: true })}
20
44
  </thead>
21
45
  );
22
46
 
23
- export const TableRowHeader = ({ children }: PropsWithChildren) => (
47
+ export const TableRowHeader = ({
48
+ children,
49
+ ...rest
50
+ }: PropsWithChildren<TableHTMLAttributes<HTMLTableRowElement>>) => (
24
51
  <tr
25
- className="-ml-24 mt-8 sm:ml-0 sm:mt-0 ui-text-overline1 !text-cool-black bg-light-grey sm:sticky z-10"
52
+ className={`-ml-24 mt-8 sm:ml-0 sm:mt-0 bg-light-grey sm:sticky z-10 ${
53
+ rest?.className ?? ""
54
+ }`}
26
55
  style={{ top: "4rem" }}
27
56
  >
28
57
  {cloneElement(children as ReactElement, { isRowHeader: true })}
@@ -1,5 +1,5 @@
1
1
  import React, { PropsWithChildren } from "react";
2
- import Icon from "../Icon/component.tsx";
2
+ import Icon from "../Icon";
3
3
 
4
4
  type TableCellProps = {
5
5
  isRowHeader?: boolean;
@@ -31,7 +31,7 @@ const LabelCell = ({
31
31
  }: PropsWithChildren<React.TdHTMLAttributes<HTMLTableCellElement>>) => {
32
32
  const classes = `
33
33
  ui-text-p1 !font-bold pt-24 pb-8 border-light-grey sm:p-24 sm:relative sm:top-2 flex sm:table-cell ${
34
- rest.className ?? ""
34
+ rest?.className ?? ""
35
35
  }
36
36
  `;
37
37
 
@@ -56,7 +56,7 @@ const TableCell = ({
56
56
  ? "rounded-l-none rounded-r sm:rounded-lg py-20 px-24"
57
57
  : "py-6"
58
58
  }
59
- ${rest.className ?? ""}
59
+ ${rest?.className ?? ""}
60
60
  `}
61
61
  >
62
62
  {children}
@@ -67,7 +67,12 @@ const HeaderCell = ({
67
67
  children,
68
68
  ...rest
69
69
  }: PropsWithChildren<React.TdHTMLAttributes<HTMLTableCellElement>>) => (
70
- <td {...rest} className="ui-text-h3 px-24 py-24 hidden sm:table-cell">
70
+ <td
71
+ {...rest}
72
+ className={`ui-text-h3 px-24 py-24 hidden sm:table-cell ${
73
+ rest?.className ?? ""
74
+ }`}
75
+ >
71
76
  {children}
72
77
  </td>
73
78
  );
@@ -76,7 +81,10 @@ const CtaCell = ({
76
81
  children,
77
82
  ...rest
78
83
  }: PropsWithChildren<React.TdHTMLAttributes<HTMLTableCellElement>>) => (
79
- <td {...rest} className="pt-24 hidden sm:table-cell">
84
+ <td
85
+ {...rest}
86
+ className={`pt-24 hidden sm:table-cell ${rest?.className ?? ""}`}
87
+ >
80
88
  {children}
81
89
  </td>
82
90
  );
@@ -1,8 +1,8 @@
1
1
  import React, { Fragment } from "react";
2
2
 
3
- import Tooltip from "../../Tooltip/component";
4
- import { Supported, Unsupported } from "../TableCell";
5
- import Table from "..";
3
+ import Tooltip from "../Tooltip";
4
+ import { Supported, Unsupported } from "./TableCell";
5
+ import Table from "../Table";
6
6
 
7
7
  const testRow = (index) => ({
8
8
  label: `Label ${index + 1}`,
@@ -1,5 +1,5 @@
1
- import { Table, TableRowHeader, TableHeader, TableBody } from "./Table";
2
- import { TableRow } from "./TableRow";
1
+ import { Table, TableRowHeader, TableHeader, TableBody } from "./Table/Table";
2
+ import { TableRow } from "./Table/TableRow";
3
3
  import {
4
4
  TableCell,
5
5
  LabelCell,
@@ -7,7 +7,7 @@ import {
7
7
  CtaCell,
8
8
  Supported,
9
9
  Unsupported,
10
- } from "./TableCell";
10
+ } from "./Table/TableCell";
11
11
 
12
12
  export default {
13
13
  Root: Table,
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import Tooltip from "./component";
2
+ import Tooltip from "../Tooltip";
3
3
 
4
4
  export default {
5
5
  title: "Components/Tooltip",
@@ -1,7 +1,24 @@
1
- import React, { PropsWithChildren, useEffect, useRef, useState } from "react";
2
- import Icon from "../Icon/component.tsx";
1
+ import React, {
2
+ ButtonHTMLAttributes,
3
+ HTMLAttributes,
4
+ PropsWithChildren,
5
+ useEffect,
6
+ useRef,
7
+ useState,
8
+ } from "react";
9
+ import Icon from "./Icon";
3
10
 
4
- const Tooltip = ({ children }: PropsWithChildren) => {
11
+ type TooltipProps = {
12
+ triggerProps?: ButtonHTMLAttributes<HTMLButtonElement>;
13
+ tooltipProps?: HTMLAttributes<HTMLDivElement>;
14
+ } & HTMLAttributes<HTMLDivElement>;
15
+
16
+ const Tooltip = ({
17
+ children,
18
+ triggerProps,
19
+ tooltipProps,
20
+ ...rest
21
+ }: PropsWithChildren<TooltipProps>) => {
5
22
  const [open, setOpen] = useState(false);
6
23
  const [position, setPosition] = useState({ x: 0, y: 0 });
7
24
  const offset = 8;
@@ -27,21 +44,28 @@ const Tooltip = ({ children }: PropsWithChildren) => {
27
44
  }, [open]);
28
45
 
29
46
  return (
30
- <div className="relative inline-block align-top h-16">
47
+ <div
48
+ {...rest}
49
+ className={`relative inline-block align-top h-16 ${
50
+ rest?.className ?? ""
51
+ }`}
52
+ >
31
53
  <button
32
54
  onMouseEnter={() => setOpen(true)}
33
55
  onMouseLeave={() => setOpen(false)}
34
- className="ml-8 p-0 relative top-1 focus:outline-none"
35
56
  type="button"
36
57
  ref={reference}
37
58
  aria-describedby="tooltip"
59
+ {...triggerProps}
60
+ className={`ml-8 p-0 relative top-1 focus:outline-none ${
61
+ triggerProps?.className ?? ""
62
+ }`}
38
63
  >
39
64
  <Icon name="icon-gui-info" size="1rem" />
40
65
  </button>
41
66
 
42
67
  {open ? (
43
68
  <div
44
- className="bg-light-grey p-12 rounded pointer-events-none absolute z-20"
45
69
  role="tooltip"
46
70
  ref={floating}
47
71
  style={{
@@ -49,6 +73,10 @@ const Tooltip = ({ children }: PropsWithChildren) => {
49
73
  left: -position.x,
50
74
  boxShadow: "4px 4px 15px rgba(0, 0, 0, 0.2)",
51
75
  }}
76
+ {...tooltipProps}
77
+ className={`bg-light-grey p-12 rounded pointer-events-none absolute z-20 ${
78
+ tooltipProps?.className ?? ""
79
+ }`}
52
80
  >
53
81
  <div className="w-256">{children}</div>
54
82
  </div>
@@ -1,5 +1,5 @@
1
1
  import { Meta, Unstyled } from "@storybook/blocks";
2
- import Icon from "../core/Icon/component.tsx";
2
+ import Icon from "../core/Icon";
3
3
 
4
4
  <Meta title="Brand/Buttons" />
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { Meta, Unstyled } from "@storybook/blocks";
2
- import Icon from "../core/Icon/component.tsx";
2
+ import Icon from "../core/Icon";
3
3
 
4
4
  <Meta title="Brand/Chips" />
5
5
 
@@ -1,7 +1,7 @@
1
1
  import { Meta, Unstyled } from "@storybook/blocks";
2
2
  import { formsHtml } from "./utils";
3
- import Code from "../core/Code/component.tsx";
4
- import Icon from "../core/Icon/component.tsx";
3
+ import Code from "../core/Code";
4
+ import Icon from "../core/Icon";
5
5
 
6
6
  <Meta title="Brand/Forms" />
7
7
 
File without changes
File without changes
@@ -1 +0,0 @@
1
- import"./component.css";
File without changes
File without changes
File without changes
@@ -1 +0,0 @@
1
- import"./component.css";
@@ -1 +0,0 @@
1
- import"./component.css";
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
Binary file
File without changes
Binary file
File without changes
Binary file
File without changes
Binary file
File without changes
Binary file
File without changes
Binary file
File without changes
File without changes
File without changes
@@ -1 +0,0 @@
1
- import "./component.css";
File without changes
File without changes
File without changes
@@ -1 +0,0 @@
1
- import "./component.css";
@@ -1 +0,0 @@
1
- import "./component.css";
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1 +0,0 @@
1
- // TODO: Webpack expects a .js file for any component
File without changes
File without changes
File without changes
Binary file
File without changes
File without changes
Binary file
File without changes