@obolnetwork/obol-ui 1.0.37 → 1.0.39

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 (63) hide show
  1. package/README.md +54 -0
  2. package/dist/__test__/components/atoms/Button.test.d.ts +1 -0
  3. package/dist/components/atoms/LogoCard/LogoCard.d.ts +0 -1
  4. package/dist/components/atoms/index.d.ts +5 -5
  5. package/dist/components/icons/AlertIcon.d.ts +0 -1
  6. package/dist/components/icons/ArrowForward.d.ts +0 -1
  7. package/dist/components/icons/ChevronDownIcon.d.ts +0 -1
  8. package/dist/components/icons/ChevronUpIcon.d.ts +0 -1
  9. package/dist/components/icons/CloseIcon.d.ts +0 -1
  10. package/dist/components/icons/Download.d.ts +0 -1
  11. package/dist/components/icons/Hexapod.d.ts +0 -1
  12. package/dist/components/icons/OpenInNew.d.ts +0 -1
  13. package/dist/components/icons/static-icons/BulletCheckIcon.d.ts +0 -1
  14. package/dist/components/icons/static-icons/CheckIcon.d.ts +0 -1
  15. package/dist/components/icons/static-icons/CheckboxIcon.d.ts +0 -1
  16. package/dist/components/icons/static-icons/Coinbase.d.ts +0 -1
  17. package/dist/components/icons/static-icons/CopyIcon.d.ts +0 -1
  18. package/dist/components/icons/static-icons/GithubIcon.d.ts +0 -1
  19. package/dist/components/icons/static-icons/HelpIcon.d.ts +0 -1
  20. package/dist/components/icons/static-icons/MenuIcon.d.ts +0 -1
  21. package/dist/components/icons/static-icons/Metamask.d.ts +0 -1
  22. package/dist/components/icons/static-icons/MinusIcon.d.ts +0 -1
  23. package/dist/components/icons/static-icons/PlusIcon.d.ts +0 -1
  24. package/dist/components/icons/static-icons/TrashIcon.d.ts +0 -1
  25. package/dist/components/icons/static-icons/TwitterIcon.d.ts +0 -1
  26. package/dist/components/icons/static-icons/WaitingIcon.d.ts +0 -1
  27. package/dist/components/icons/static-icons/WalletConnect.d.ts +0 -1
  28. package/dist/components/icons/static-icons/obol/circle/ObolDarkCircle.d.ts +0 -1
  29. package/dist/components/icons/static-icons/obol/circle/ObolLightCircle.d.ts +0 -1
  30. package/dist/components/icons/static-icons/obol/circle/index.d.ts +2 -2
  31. package/dist/components/icons/static-icons/obol/horizontal/ObolDarkBgH.d.ts +0 -1
  32. package/dist/components/icons/static-icons/obol/horizontal/ObolLightBgH.d.ts +0 -1
  33. package/dist/components/icons/static-icons/obol/horizontal/ObolSolidDarkBgH.d.ts +0 -1
  34. package/dist/components/icons/static-icons/obol/horizontal/ObolSolidLightBgH.d.ts +0 -1
  35. package/dist/components/icons/static-icons/obol/horizontal/index.d.ts +4 -4
  36. package/dist/components/icons/static-icons/obol/mark/ObolDarkBgMark.d.ts +0 -1
  37. package/dist/components/icons/static-icons/obol/mark/ObolLightBgMark.d.ts +0 -1
  38. package/dist/components/icons/static-icons/obol/mark/ObolSolidDarkBgMark.d.ts +0 -1
  39. package/dist/components/icons/static-icons/obol/mark/ObolSolidLightBgMark.d.ts +0 -1
  40. package/dist/components/icons/static-icons/obol/mark/index.d.ts +4 -4
  41. package/dist/components/icons/static-icons/obol/vertical/ObolDarkBgV.d.ts +0 -1
  42. package/dist/components/icons/static-icons/obol/vertical/ObolLightBgV.d.ts +0 -1
  43. package/dist/components/icons/static-icons/obol/vertical/ObolSolidDarkBgV.d.ts +0 -1
  44. package/dist/components/icons/static-icons/obol/vertical/ObolSolidLightBgV.d.ts +0 -1
  45. package/dist/components/icons/static-icons/obol/vertical/index.d.ts +4 -4
  46. package/dist/components/icons/static-icons/planets/PlanetBlue.d.ts +0 -1
  47. package/dist/components/icons/static-icons/planets/PlanetGreen.d.ts +0 -1
  48. package/dist/components/icons/static-icons/planets/PlanetGrey.d.ts +0 -1
  49. package/dist/components/icons/static-icons/planets/PlanetMagenta.d.ts +0 -1
  50. package/dist/components/icons/static-icons/planets/PlanetOrange.d.ts +0 -1
  51. package/dist/components/icons/static-icons/planets/index.d.ts +5 -5
  52. package/dist/components/molecules/index.d.ts +8 -8
  53. package/dist/components/organisms/index.d.ts +4 -4
  54. package/dist/components/utils/hooks/index.d.ts +1 -1
  55. package/dist/components/utils/hooks/use-media-query.d.ts +1 -1
  56. package/dist/components/utils/index.d.ts +2 -2
  57. package/dist/components/utils/types.d.ts +0 -1
  58. package/dist/index.d.ts +1 -1
  59. package/dist/index.es.js +18 -14
  60. package/dist/index.js +18 -14
  61. package/dist/jest.config.d.ts +1 -0
  62. package/package.json +21 -2
  63. package/dist/components/organisms/ObolEcosystem/ObolEcosystem.d.ts +0 -1
package/README.md CHANGED
@@ -18,6 +18,60 @@ You can start editing the page by modifying `pages/index.tsx`. The page auto-upd
18
18
 
19
19
  The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
20
20
 
21
+ ## Testing
22
+ We use Jest and React Testing Library for testing our React components and functions. Jest is a testing framework that provides us with test runners, assertions, and mocks, while React Testing Library is a set of utilities that helps us write tests that are closer to how our end-users will interact with our application.
23
+
24
+ ### Running tests
25
+ To run the tests, simply run the following command in your terminal:
26
+
27
+ ```bash
28
+ yarn run test
29
+ ```
30
+
31
+ This will start the Jest test runner, which will automatically find and run all the tests in our project that match the naming pattern *.test.js or *.spec.js. located at __tests__ You can also run a specific test file by running the following command:
32
+
33
+ ```bash
34
+ yarn run test <path-to-file>
35
+ ```
36
+
37
+ This will run only the tests in the Button.test.js file.
38
+
39
+ ### Writing tests
40
+ We write tests using Jest and React Testing Library in the same file as the component or function we are testing. For example, if we are testing a component called Button, we would create a file called Button.test.js in the same directory as the Button.js file.
41
+
42
+ Here's an example test file:
43
+
44
+ ```typescript
45
+ import { Button } from "../../../components/atoms/Button/Button";
46
+ import { render, screen } from "@testing-library/react";
47
+ import userEvent from "@testing-library/user-event";
48
+
49
+ describe("Button Component", () => {
50
+ describe("On Click Listener", () => {
51
+ const user = userEvent.setup();
52
+ const mockProps = {
53
+ onClick: jest.fn(),
54
+ };
55
+
56
+ test("Calls onClick function passed in", async () => {
57
+ render(<Button {...mockProps}>test</Button>);
58
+
59
+ const testButton = screen.getByText("test");
60
+ await user.click(testButton);
61
+
62
+ expect(mockProps.onClick).toHaveBeenCalledTimes(1);
63
+ });
64
+ });
65
+ });
66
+ ```
67
+
68
+ In this example, we're testing the Button component by rendering it with different props and checking that the correct elements are present and that the onClick function is called when the button is clicked.
69
+
70
+ Husky and pre-commit hooks
71
+ We use Husky to manage Git hooks, such as pre-commit hooks. Our pre-commit hook runs the tests before committing any code changes, ensuring that we only commit code that passes all the tests.
72
+
73
+ If you try to commit changes that break the tests, Husky will prevent the commit from going through and display an error message in your terminal.
74
+
21
75
  ## Learn More
22
76
 
23
77
  To learn more about Next.js, take a look at the following resources:
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const LogoCard: (props: {
3
2
  image: string;
4
3
  heading: string;
@@ -13,8 +13,8 @@ export * from "./Toggle/Toggle";
13
13
  export * from "./IconButton/IconButton";
14
14
  export * from "./TextField/TextField";
15
15
  export * from "./NumberField/NumberField";
16
- export * from './Tooltip/Tooltip';
17
- export * from './LoadingButton/LoadingButton';
18
- export * from './Checkbox/Checkbox';
19
- export * from './Switch/Switch';
20
- export * from './Dialog/Dialog';
16
+ export * from "./Tooltip/Tooltip";
17
+ export * from "./LoadingButton/LoadingButton";
18
+ export * from "./Checkbox/Checkbox";
19
+ export * from "./Switch/Switch";
20
+ export * from "./Dialog/Dialog";
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import { SvgIconProps } from "../atoms/SvgIcon/SvgIcon";
3
2
  export declare const AlertIcon: (props: SvgIconProps) => JSX.Element;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import { SvgIconProps } from "../atoms/SvgIcon/SvgIcon";
3
2
  export declare const ArrowForward: (props: SvgIconProps) => JSX.Element;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import { SvgIconProps } from "../atoms/SvgIcon/SvgIcon";
3
2
  export declare const ChevronDownIcon: (props: SvgIconProps) => JSX.Element;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import { SvgIconProps } from "../atoms/SvgIcon/SvgIcon";
3
2
  export declare const ChevronUpIcon: (props: SvgIconProps) => JSX.Element;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import { SvgIconProps } from "../atoms/SvgIcon/SvgIcon";
3
2
  export declare const CloseIcon: (props: SvgIconProps) => JSX.Element;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import { SvgIconProps } from "../atoms/SvgIcon/SvgIcon";
3
2
  export declare const Download: (props: SvgIconProps) => JSX.Element;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  export declare const Hexapod: () => JSX.Element;
3
2
  export declare const HexapodMobile: () => JSX.Element;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import { SvgIconProps } from "../atoms/SvgIcon/SvgIcon";
3
2
  export declare const OpenInNew: (props: SvgIconProps) => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const BulletCheckIcon: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const CheckIcon: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const CheckboxIcon: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const Coinbase: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const CopyIcon: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const GithubIcon: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const HelpIcon: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const MenuIcon: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const Metamask: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const MinusIcon: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const PlusIcon: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const TrashIcon: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const TwitterIcon: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const WaitingIcon: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const WalletConnect: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const ObolDarkCircle: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const ObolLightCircle: () => JSX.Element;
@@ -1,2 +1,2 @@
1
- export * from './ObolDarkCircle';
2
- export * from './ObolLightCircle';
1
+ export * from "./ObolDarkCircle";
2
+ export * from "./ObolLightCircle";
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const ObolDarkBgH: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const ObolLightBgH: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const ObolSolidDarkBgH: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const ObolSolidLightBgH: () => JSX.Element;
@@ -1,4 +1,4 @@
1
- export * from './ObolDarkBgH';
2
- export * from './ObolLightBgH';
3
- export * from './ObolSolidDarkBgH';
4
- export * from './ObolSolidLightBgH';
1
+ export * from "./ObolDarkBgH";
2
+ export * from "./ObolLightBgH";
3
+ export * from "./ObolSolidDarkBgH";
4
+ export * from "./ObolSolidLightBgH";
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const ObolDarkBgMark: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const ObolLightBgMark: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const ObolSolidDarkBgMark: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const ObolSolidLightBgMark: () => JSX.Element;
@@ -1,4 +1,4 @@
1
- export * from './ObolDarkBgMark';
2
- export * from './ObolLightBgMark';
3
- export * from './ObolSolidDarkBgMark';
4
- export * from './ObolSolidLightBgMark';
1
+ export * from "./ObolDarkBgMark";
2
+ export * from "./ObolLightBgMark";
3
+ export * from "./ObolSolidDarkBgMark";
4
+ export * from "./ObolSolidLightBgMark";
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const ObolDarkBgV: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const ObolLightBgV: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const ObolSolidDarkBgV: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const ObolSolidLightBgV: () => JSX.Element;
@@ -1,4 +1,4 @@
1
- export * from './ObolDarkBgV';
2
- export * from './ObolLightBgV';
3
- export * from './ObolSolidDarkBgV';
4
- export * from './ObolSolidLightBgV';
1
+ export * from "./ObolDarkBgV";
2
+ export * from "./ObolLightBgV";
3
+ export * from "./ObolSolidDarkBgV";
4
+ export * from "./ObolSolidLightBgV";
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const PlanetBlue: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const PlanetGreen: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const PlanetGrey: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const PlanetMagenta: () => JSX.Element;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const PlanetOrange: () => JSX.Element;
@@ -1,5 +1,5 @@
1
- export * from './PlanetGrey';
2
- export * from './PlanetBlue';
3
- export * from './PlanetOrange';
4
- export * from './PlanetGreen';
5
- export * from './PlanetMagenta';
1
+ export * from "./PlanetGrey";
2
+ export * from "./PlanetBlue";
3
+ export * from "./PlanetOrange";
4
+ export * from "./PlanetGreen";
5
+ export * from "./PlanetMagenta";
@@ -1,8 +1,8 @@
1
- export * as Accordion from './Accordion/Accordion';
2
- export * from './AdvisoryToggle/AdvisoryToggle';
3
- export * from './Card/Card';
4
- export * from './Navbar/Navbar';
5
- export * from './NotificationCard/NotificationCard';
6
- export * from './ProgressTracker/ProgressTracker';
7
- export * from './RadioGroup/RadioGroup';
8
- export * from './Table/Table';
1
+ export * as Accordion from "./Accordion/Accordion";
2
+ export * from "./AdvisoryToggle/AdvisoryToggle";
3
+ export * from "./Card/Card";
4
+ export * from "./Navbar/Navbar";
5
+ export * from "./NotificationCard/NotificationCard";
6
+ export * from "./ProgressTracker/ProgressTracker";
7
+ export * from "./RadioGroup/RadioGroup";
8
+ export * from "./Table/Table";
@@ -1,4 +1,4 @@
1
- export * from './Advisory/Advisory';
2
- export * from './Footer/Footer';
3
- export * from './HeroSection/HeroSection';
4
- export * from './TwoColumnSection/TwoColumnSection';
1
+ export * from "./Advisory/Advisory";
2
+ export * from "./Footer/Footer";
3
+ export * from "./HeroSection/HeroSection";
4
+ export * from "./TwoColumnSection/TwoColumnSection";
@@ -1 +1 @@
1
- export * from './use-media-query';
1
+ export * from "./use-media-query";
@@ -1,5 +1,5 @@
1
1
  import { mediaQueryKeys } from "../../../stitches.config";
2
- declare type MediaQueryKeysType = typeof mediaQueryKeys[keyof typeof mediaQueryKeys];
2
+ declare type MediaQueryKeysType = (typeof mediaQueryKeys)[keyof typeof mediaQueryKeys];
3
3
  export declare function useMediaQuery(query: MediaQueryKeysType): boolean;
4
4
  export declare const MediaQueryKeys: {
5
5
  readonly xs: "(max-width: 520px)";
@@ -1,2 +1,2 @@
1
- export * from './hooks';
2
- export * from './types';
1
+ export * from "./hooks";
2
+ export * from "./types";
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type * as Stitches from "@stitches/react";
3
2
  interface StitchesMedia {
4
3
  [x: string]: any;
package/dist/index.d.ts CHANGED
@@ -3,4 +3,4 @@ export * from "./components/icons";
3
3
  export * from "./components/molecules";
4
4
  export * from "./components/organisms";
5
5
  export * from "./components/utils";
6
- export { styled, css, theme, createTheme, getCssText, globalCss, keyframes, config, reset } from "./stitches.config";
6
+ export { styled, css, theme, createTheme, getCssText, globalCss, keyframes, config, reset, } from "./stitches.config";
package/dist/index.es.js CHANGED
@@ -437,7 +437,7 @@ SvgIcon.defaultProps = {
437
437
  xmlns: "http://www.w3.org/2000/svg",
438
438
  };
439
439
 
440
- var Box = styled('div', {});
440
+ var Box = styled("div", {});
441
441
 
442
442
  function modifyVariantsForStory(component) {
443
443
  return component;
@@ -746,7 +746,7 @@ var Text = styled("span", {
746
746
  display: "inline-block",
747
747
  borderRadius: "$1",
748
748
  padding: "0 $xxxs",
749
- }
749
+ },
750
750
  },
751
751
  size: {
752
752
  1: { fontSize: "$1" },
@@ -958,7 +958,7 @@ var Container = styled(Box, {
958
958
  },
959
959
  });
960
960
 
961
- var Image = styled('img', {
961
+ var Image = styled("img", {
962
962
  // reset
963
963
  verticalAlign: "middle",
964
964
  maxWidth: "100%",
@@ -1147,7 +1147,6 @@ var TeamMemberCard = function (props) { return (jsxs(Box, __assign({ className:
1147
1147
  gridTemplateColumns: "1fr",
1148
1148
  borderRadius: "$3",
1149
1149
  backgroundColor: "$bg04",
1150
- alignItems: "center",
1151
1150
  width: "288px",
1152
1151
  gap: "$lg",
1153
1152
  py: "$xl",
@@ -1156,6 +1155,7 @@ var TeamMemberCard = function (props) { return (jsxs(Box, __assign({ className:
1156
1155
  $$size: "160px",
1157
1156
  width: "$$size",
1158
1157
  height: "$$size",
1158
+ placeSelf: "center",
1159
1159
  "@sm": { $$size: "100px" },
1160
1160
  "&::after": {
1161
1161
  position: "absolute",
@@ -1424,7 +1424,10 @@ var TextFieldWithCopy = forwardRef(function (_a, ref) {
1424
1424
  onChange(e);
1425
1425
  }
1426
1426
  };
1427
- return (jsxs(Box, __assign({ css: { display: "flex", width: "$full" } }, { children: [jsx(TextField, __assign({}, props, { withCopy: true, ref: innerRef, value: inputValue, onChange: handleOnChange, css: { width: "$full" } })), jsxs(Tooltip, __assign({ open: isCopied }, { children: [jsx(TooltipTrigger, __assign({ asChild: true }, { children: jsx(IconButton, __assign({ onClick: function () { return copyToClipBoard(inputValue); } }, { children: !isCopied ? jsx(CopyIcon, {}) : jsx(CheckIcon, {}) })) })), jsxs(Content$3, __assign({ side: "bottom", sideOffset: 5 }, { children: ["Copied!", jsx(TooltipArrow, {})] }))] }))] })));
1427
+ return (jsxs(Box, __assign({ css: { display: "flex", width: "$full" } }, { children: [jsx(TextField, __assign({}, props, { withCopy: true, ref: innerRef, value: inputValue, onChange: handleOnChange, css: { width: "$full" } })), jsxs(Tooltip, __assign({ open: isCopied }, { children: [jsx(TooltipTrigger, __assign({ asChild: true }, { children: jsx(IconButton, __assign({ onClick: function (e) {
1428
+ e.preventDefault();
1429
+ copyToClipBoard(inputValue);
1430
+ } }, { children: !isCopied ? jsx(CopyIcon, {}) : jsx(CheckIcon, {}) })) })), jsxs(Content$3, __assign({ side: "bottom", sideOffset: 5 }, { children: ["Copied!", jsx(TooltipArrow, {})] }))] }))] })));
1428
1431
  });
1429
1432
  TextFieldWithCopy.displayName = "TextFieldWithCopy";
1430
1433
 
@@ -1533,7 +1536,7 @@ var SwitchRoot = styled(ReactSwitch.Root, {
1533
1536
  padding: "0",
1534
1537
  "&[data-state='checked']": {
1535
1538
  backgroundColor: "$obolGreen",
1536
- }
1539
+ },
1537
1540
  });
1538
1541
  var SwitchThumb = styled(ReactSwitch.Thumb, {
1539
1542
  display: "block",
@@ -1545,7 +1548,7 @@ var SwitchThumb = styled(ReactSwitch.Thumb, {
1545
1548
  transform: "translateX(4px)",
1546
1549
  "&[data-state='checked']": {
1547
1550
  transform: "translateX(40px)",
1548
- }
1551
+ },
1549
1552
  });
1550
1553
  var Switch = function (_a) {
1551
1554
  var props = __rest(_a, []);
@@ -1738,7 +1741,7 @@ var AdvisoryToggleBullet = function (props) {
1738
1741
  minHeight: "$2xl",
1739
1742
  pl: "calc($2xl - 2px)",
1740
1743
  ml: "-2px",
1741
- borderLeft: "2px solid transparent"
1744
+ borderLeft: "2px solid transparent",
1742
1745
  } }, { children: [props.state === "completed" ? (jsx(Box, { children: jsx(BulletCheckIcon, {}) })) : (jsx(Box, { children: jsx(Box, __assign({ css: {
1743
1746
  display: "grid",
1744
1747
  placeItems: "center",
@@ -2213,7 +2216,7 @@ var Advisory = function (_a) {
2213
2216
  border: "2px solid $bg04",
2214
2217
  borderRadius: "$3",
2215
2218
  minHeight: "752px",
2216
- } }, { children: [jsx(Box, __assign({ css: {
2219
+ } }, { children: [jsx(Box, __assign({ className: "advisory-toggles", css: {
2217
2220
  display: "flex",
2218
2221
  fd: "column",
2219
2222
  flex: 1,
@@ -2222,6 +2225,7 @@ var Advisory = function (_a) {
2222
2225
  borderRight: "2px solid $bg04",
2223
2226
  btlr: "$2",
2224
2227
  bblr: "$2",
2228
+ width: "330px",
2225
2229
  } }, { children: jsx(ToggleGroup, __assign({ css: {
2226
2230
  display: "flex",
2227
2231
  fd: "column",
@@ -2233,7 +2237,7 @@ var Advisory = function (_a) {
2233
2237
  onItemChange(content);
2234
2238
  }
2235
2239
  }
2236
- } }, { children: props.items.map(function (item, index) { return (jsx(AdvisoryToggleItem, __assign({ disabled: item.state === "upcoming", value: item.value, "aria-label": item.title, css: { borderLeftWidth: "0px" }, "data-state-item": item.value === itemSelected.value ? "selected" : "" }, { children: jsx(AdvisoryToggleBullet, __assign({ state: item.state, rank: item.rank, onClick: function () { return console.log("enable next, complete this"); } }, { children: item.title }), ":ab".concat(index, ":")) }), ":at".concat(index, ":"))); }) })) })), jsx(Box, __assign({ css: {
2240
+ } }, { children: props.items.map(function (item, index) { return (jsx(AdvisoryToggleItem, __assign({ disabled: item.state === "upcoming", value: item.value, "aria-label": item.title, css: { borderLeftWidth: "0px" }, "data-state-item": item.value === itemSelected.value ? "selected" : "" }, { children: jsx(AdvisoryToggleBullet, __assign({ state: item.state, rank: item.rank, onClick: function () { return console.log("enable next, complete this"); } }, { children: item.title }), ":ab".concat(index, ":")) }), ":at".concat(index, ":"))); }) })) })), jsx(Box, __assign({ className: "advisory-content", css: {
2237
2241
  display: "flex",
2238
2242
  flex: 2,
2239
2243
  fd: "column",
@@ -2318,10 +2322,10 @@ function useMediaQuery(query) {
2318
2322
  return matches;
2319
2323
  }
2320
2324
  var MediaQueryKeys = {
2321
- xs: '(max-width: 520px)',
2322
- sm: '(max-width: 900px)',
2323
- md: '(max-width: 1200px)',
2324
- lg: '(max-width: 1800px)',
2325
+ xs: "(max-width: 520px)",
2326
+ sm: "(max-width: 900px)",
2327
+ md: "(max-width: 1200px)",
2328
+ lg: "(max-width: 1800px)",
2325
2329
  };
2326
2330
 
2327
2331
  var BASE_PATH = "/assets/hexapod.svg";
package/dist/index.js CHANGED
@@ -471,7 +471,7 @@ SvgIcon.defaultProps = {
471
471
  xmlns: "http://www.w3.org/2000/svg",
472
472
  };
473
473
 
474
- var Box = styled('div', {});
474
+ var Box = styled("div", {});
475
475
 
476
476
  function modifyVariantsForStory(component) {
477
477
  return component;
@@ -780,7 +780,7 @@ var Text = styled("span", {
780
780
  display: "inline-block",
781
781
  borderRadius: "$1",
782
782
  padding: "0 $xxxs",
783
- }
783
+ },
784
784
  },
785
785
  size: {
786
786
  1: { fontSize: "$1" },
@@ -992,7 +992,7 @@ var Container = styled(Box, {
992
992
  },
993
993
  });
994
994
 
995
- var Image = styled('img', {
995
+ var Image = styled("img", {
996
996
  // reset
997
997
  verticalAlign: "middle",
998
998
  maxWidth: "100%",
@@ -1181,7 +1181,6 @@ var TeamMemberCard = function (props) { return (jsxRuntime.jsxs(Box, __assign({
1181
1181
  gridTemplateColumns: "1fr",
1182
1182
  borderRadius: "$3",
1183
1183
  backgroundColor: "$bg04",
1184
- alignItems: "center",
1185
1184
  width: "288px",
1186
1185
  gap: "$lg",
1187
1186
  py: "$xl",
@@ -1190,6 +1189,7 @@ var TeamMemberCard = function (props) { return (jsxRuntime.jsxs(Box, __assign({
1190
1189
  $$size: "160px",
1191
1190
  width: "$$size",
1192
1191
  height: "$$size",
1192
+ placeSelf: "center",
1193
1193
  "@sm": { $$size: "100px" },
1194
1194
  "&::after": {
1195
1195
  position: "absolute",
@@ -1458,7 +1458,10 @@ var TextFieldWithCopy = React.forwardRef(function (_a, ref) {
1458
1458
  onChange(e);
1459
1459
  }
1460
1460
  };
1461
- return (jsxRuntime.jsxs(Box, __assign({ css: { display: "flex", width: "$full" } }, { children: [jsxRuntime.jsx(TextField, __assign({}, props, { withCopy: true, ref: innerRef, value: inputValue, onChange: handleOnChange, css: { width: "$full" } })), jsxRuntime.jsxs(Tooltip, __assign({ open: isCopied }, { children: [jsxRuntime.jsx(TooltipTrigger, __assign({ asChild: true }, { children: jsxRuntime.jsx(IconButton, __assign({ onClick: function () { return copyToClipBoard(inputValue); } }, { children: !isCopied ? jsxRuntime.jsx(CopyIcon, {}) : jsxRuntime.jsx(CheckIcon, {}) })) })), jsxRuntime.jsxs(Content$3, __assign({ side: "bottom", sideOffset: 5 }, { children: ["Copied!", jsxRuntime.jsx(TooltipArrow, {})] }))] }))] })));
1461
+ return (jsxRuntime.jsxs(Box, __assign({ css: { display: "flex", width: "$full" } }, { children: [jsxRuntime.jsx(TextField, __assign({}, props, { withCopy: true, ref: innerRef, value: inputValue, onChange: handleOnChange, css: { width: "$full" } })), jsxRuntime.jsxs(Tooltip, __assign({ open: isCopied }, { children: [jsxRuntime.jsx(TooltipTrigger, __assign({ asChild: true }, { children: jsxRuntime.jsx(IconButton, __assign({ onClick: function (e) {
1462
+ e.preventDefault();
1463
+ copyToClipBoard(inputValue);
1464
+ } }, { children: !isCopied ? jsxRuntime.jsx(CopyIcon, {}) : jsxRuntime.jsx(CheckIcon, {}) })) })), jsxRuntime.jsxs(Content$3, __assign({ side: "bottom", sideOffset: 5 }, { children: ["Copied!", jsxRuntime.jsx(TooltipArrow, {})] }))] }))] })));
1462
1465
  });
1463
1466
  TextFieldWithCopy.displayName = "TextFieldWithCopy";
1464
1467
 
@@ -1567,7 +1570,7 @@ var SwitchRoot = styled(ReactSwitch__namespace.Root, {
1567
1570
  padding: "0",
1568
1571
  "&[data-state='checked']": {
1569
1572
  backgroundColor: "$obolGreen",
1570
- }
1573
+ },
1571
1574
  });
1572
1575
  var SwitchThumb = styled(ReactSwitch__namespace.Thumb, {
1573
1576
  display: "block",
@@ -1579,7 +1582,7 @@ var SwitchThumb = styled(ReactSwitch__namespace.Thumb, {
1579
1582
  transform: "translateX(4px)",
1580
1583
  "&[data-state='checked']": {
1581
1584
  transform: "translateX(40px)",
1582
- }
1585
+ },
1583
1586
  });
1584
1587
  var Switch = function (_a) {
1585
1588
  var props = __rest(_a, []);
@@ -1772,7 +1775,7 @@ var AdvisoryToggleBullet = function (props) {
1772
1775
  minHeight: "$2xl",
1773
1776
  pl: "calc($2xl - 2px)",
1774
1777
  ml: "-2px",
1775
- borderLeft: "2px solid transparent"
1778
+ borderLeft: "2px solid transparent",
1776
1779
  } }, { children: [props.state === "completed" ? (jsxRuntime.jsx(Box, { children: jsxRuntime.jsx(BulletCheckIcon, {}) })) : (jsxRuntime.jsx(Box, { children: jsxRuntime.jsx(Box, __assign({ css: {
1777
1780
  display: "grid",
1778
1781
  placeItems: "center",
@@ -2247,7 +2250,7 @@ var Advisory = function (_a) {
2247
2250
  border: "2px solid $bg04",
2248
2251
  borderRadius: "$3",
2249
2252
  minHeight: "752px",
2250
- } }, { children: [jsxRuntime.jsx(Box, __assign({ css: {
2253
+ } }, { children: [jsxRuntime.jsx(Box, __assign({ className: "advisory-toggles", css: {
2251
2254
  display: "flex",
2252
2255
  fd: "column",
2253
2256
  flex: 1,
@@ -2256,6 +2259,7 @@ var Advisory = function (_a) {
2256
2259
  borderRight: "2px solid $bg04",
2257
2260
  btlr: "$2",
2258
2261
  bblr: "$2",
2262
+ width: "330px",
2259
2263
  } }, { children: jsxRuntime.jsx(ToggleGroup, __assign({ css: {
2260
2264
  display: "flex",
2261
2265
  fd: "column",
@@ -2267,7 +2271,7 @@ var Advisory = function (_a) {
2267
2271
  onItemChange(content);
2268
2272
  }
2269
2273
  }
2270
- } }, { children: props.items.map(function (item, index) { return (jsxRuntime.jsx(AdvisoryToggleItem, __assign({ disabled: item.state === "upcoming", value: item.value, "aria-label": item.title, css: { borderLeftWidth: "0px" }, "data-state-item": item.value === itemSelected.value ? "selected" : "" }, { children: jsxRuntime.jsx(AdvisoryToggleBullet, __assign({ state: item.state, rank: item.rank, onClick: function () { return console.log("enable next, complete this"); } }, { children: item.title }), ":ab".concat(index, ":")) }), ":at".concat(index, ":"))); }) })) })), jsxRuntime.jsx(Box, __assign({ css: {
2274
+ } }, { children: props.items.map(function (item, index) { return (jsxRuntime.jsx(AdvisoryToggleItem, __assign({ disabled: item.state === "upcoming", value: item.value, "aria-label": item.title, css: { borderLeftWidth: "0px" }, "data-state-item": item.value === itemSelected.value ? "selected" : "" }, { children: jsxRuntime.jsx(AdvisoryToggleBullet, __assign({ state: item.state, rank: item.rank, onClick: function () { return console.log("enable next, complete this"); } }, { children: item.title }), ":ab".concat(index, ":")) }), ":at".concat(index, ":"))); }) })) })), jsxRuntime.jsx(Box, __assign({ className: "advisory-content", css: {
2271
2275
  display: "flex",
2272
2276
  flex: 2,
2273
2277
  fd: "column",
@@ -2352,10 +2356,10 @@ function useMediaQuery(query) {
2352
2356
  return matches;
2353
2357
  }
2354
2358
  var MediaQueryKeys = {
2355
- xs: '(max-width: 520px)',
2356
- sm: '(max-width: 900px)',
2357
- md: '(max-width: 1200px)',
2358
- lg: '(max-width: 1800px)',
2359
+ xs: "(max-width: 520px)",
2360
+ sm: "(max-width: 900px)",
2361
+ md: "(max-width: 1200px)",
2362
+ lg: "(max-width: 1800px)",
2359
2363
  };
2360
2364
 
2361
2365
  var BASE_PATH = "/assets/hexapod.svg";
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@obolnetwork/obol-ui",
3
- "version": "1.0.37",
3
+ "version": "1.0.39",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.es.js",
6
6
  "license": "MIT",
@@ -16,7 +16,11 @@
16
16
  "storybook": "start-storybook -p 6006",
17
17
  "build-storybook": "build-storybook",
18
18
  "ds:build": "rollup -c",
19
- "ds:release": "yarn ds:build && np"
19
+ "ds:release": "yarn ds:build && np",
20
+ "test": "jest",
21
+ "prepare": "husky install",
22
+ "format:write": "prettier --write \"**/*.{css,js,json,jsx,ts,tsx}\"",
23
+ "format": "prettier \"**/*.{css,js,json,jsx,ts,tsx}\""
20
24
  },
21
25
  "dependencies": {
22
26
  "@radix-ui/react-accordion": "^0.1.6",
@@ -42,14 +46,25 @@
42
46
  "@storybook/addon-links": "^6.5.12",
43
47
  "@storybook/react": "^6.5.12",
44
48
  "@storybook/testing-library": "^0.0.13",
49
+ "@testing-library/dom": "^9.0.0",
50
+ "@testing-library/jest-dom": "^5.16.5",
51
+ "@testing-library/react": "12.1.5",
52
+ "@testing-library/user-event": "^14.4.3",
45
53
  "@types/node": "17.0.21",
46
54
  "@types/react": "17.0.40",
47
55
  "babel-loader": "^8.2.4",
56
+ "cross-env": "^7.0.3",
48
57
  "eslint": "8.11.0",
49
58
  "eslint-config-next": "12.1.0",
59
+ "eslint-config-prettier": "^8.6.0",
50
60
  "eslint-plugin-storybook": "^0.6.4",
51
61
  "figma-api": "^1.10.1",
62
+ "husky": ">=7",
63
+ "jest": "^29.4.3",
64
+ "jest-environment-jsdom": "^29.4.3",
65
+ "lint-staged": ">=10",
52
66
  "np": "^7.6.1",
67
+ "prettier": "^2.8.4",
53
68
  "rollup": "^2.70.1",
54
69
  "rollup-plugin-typescript2": "^0.31.2",
55
70
  "storybook-addon-designs": "^6.3.1",
@@ -59,5 +74,9 @@
59
74
  "publishConfig": {
60
75
  "registry": "https://registry.npmjs.org/",
61
76
  "access": "public"
77
+ },
78
+ "lint-staged": {
79
+ "*.js": "eslint --cache --fix",
80
+ "*.{js,css,md}": "prettier --write"
62
81
  }
63
82
  }
@@ -1 +0,0 @@
1
- export declare const ObolEcosystem: () => JSX.Element;