@arc-ui/components 1.3.0 → 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 (40) hide show
  1. package/dist/index.es.js +733 -2411
  2. package/dist/index.es.js.map +1 -1
  3. package/dist/index.js +842 -2518
  4. package/dist/index.js.map +1 -1
  5. package/dist/styles.bt.css +1 -1
  6. package/dist/styles.css +1 -1
  7. package/dist/styles.ee.css +1 -1
  8. package/dist/types/components/Button/Button.d.ts +6 -1
  9. package/dist/types/components/Clock/Clock.rehydrator.d.ts +0 -1
  10. package/dist/types/components/Icon/Icon.d.ts +1 -1
  11. package/dist/types/components/SiteFooter/SiteFooter.d.ts +4 -0
  12. package/dist/types/components/SiteFooter/SiteFooter.rehydrator.d.ts +2 -0
  13. package/dist/types/components/SiteFooter/index.d.ts +1 -0
  14. package/dist/types/components/SiteHeader/SiteHeader.d.ts +41 -18
  15. package/dist/types/components/SiteHeader/SiteHeader.rehydrator.d.ts +8 -0
  16. package/dist/types/components/SiteHeader/components/BackButton/BackButton.d.ts +6 -0
  17. package/dist/types/components/SiteHeader/components/BackButton/index.d.ts +1 -0
  18. package/dist/types/components/SiteHeader/components/Column/Column.d.ts +9 -0
  19. package/dist/types/components/SiteHeader/components/Column/index.d.ts +1 -0
  20. package/dist/types/components/SiteHeader/components/Item/Item.d.ts +17 -0
  21. package/dist/types/components/SiteHeader/components/Item/index.d.ts +1 -0
  22. package/dist/types/components/SiteHeader/components/ItemGroup/ItemGroup.d.ts +13 -0
  23. package/dist/types/components/SiteHeader/components/ItemGroup/ItemGroup.rehydrator.d.ts +2 -0
  24. package/dist/types/components/SiteHeader/components/ItemGroup/index.d.ts +2 -0
  25. package/dist/types/components/SiteHeader/components/MenuButton/MenuButton.d.ts +7 -0
  26. package/dist/types/components/SiteHeader/components/MenuButton/index.d.ts +1 -0
  27. package/dist/types/components/SiteHeader/components/NavItem/NavItem.d.ts +39 -0
  28. package/dist/types/components/SiteHeader/components/NavItem/NavItem.rehydrator.d.ts +2 -0
  29. package/dist/types/components/SiteHeader/components/NavItem/NavItemWithSubNav.d.ts +44 -0
  30. package/dist/types/components/SiteHeader/components/NavItem/NavItemWithSubNav.rehydrator.d.ts +2 -0
  31. package/dist/types/components/SiteHeader/components/NavItem/index.d.ts +4 -0
  32. package/dist/types/components/SiteHeader/components/Panel/Panel.d.ts +22 -0
  33. package/dist/types/components/SiteHeader/components/Panel/index.d.ts +1 -0
  34. package/dist/types/components/SiteHeader/components/SubNavItem/SubNavItem.d.ts +29 -0
  35. package/dist/types/components/SiteHeader/components/SubNavItem/SubNavItem.rehydrator.d.ts +2 -0
  36. package/dist/types/components/SiteHeader/components/SubNavItem/index.d.ts +2 -0
  37. package/dist/types/components/SiteHeader/index.d.ts +1 -0
  38. package/dist/types/components/index.d.ts +2 -2
  39. package/dist/types/hooks/index.d.ts +1 -0
  40. package/package.json +8 -8
@@ -0,0 +1,6 @@
1
+ import { FC } from "react";
2
+ export declare const BackButton: FC<BackButtonProps>;
3
+ export interface BackButtonProps {
4
+ setOpen: (arg0: boolean) => any;
5
+ }
6
+ export default BackButton;
@@ -0,0 +1 @@
1
+ export { default } from "./BackButton";
@@ -0,0 +1,9 @@
1
+ import { FC, ReactNode } from "react";
2
+ declare const Column: FC<ColumnProps>;
3
+ export interface ColumnProps {
4
+ /**
5
+ * Contents of the Column. Must be SiteHeader.ItemGroup components.
6
+ */
7
+ children: ReactNode;
8
+ }
9
+ export default Column;
@@ -0,0 +1 @@
1
+ export { default } from "./Column";
@@ -0,0 +1,17 @@
1
+ import { FC, ReactNode } from "react";
2
+ declare const Item: FC<ItemProps>;
3
+ export interface ItemProps {
4
+ /**
5
+ * Contents of the Item. Usually text to be displayed in the Item link.
6
+ */
7
+ children: ReactNode;
8
+ /**
9
+ * A URL to link to when the Item is clicked or touched.
10
+ */
11
+ href: string;
12
+ /**
13
+ * Should the Item be emphasised?
14
+ */
15
+ isEmphasised?: boolean;
16
+ }
17
+ export default Item;
@@ -0,0 +1 @@
1
+ export { default } from "./Item";
@@ -0,0 +1,13 @@
1
+ import { FC, ReactNode } from "react";
2
+ declare const ItemGroup: FC<ItemGroupProps>;
3
+ export interface ItemGroupProps {
4
+ /**
5
+ * Contents of the ItemGroup. Must be Item components.
6
+ */
7
+ children: ReactNode;
8
+ /**
9
+ * Title text to be displayed in the ItemGroup summary.
10
+ */
11
+ title: string;
12
+ }
13
+ export default ItemGroup;
@@ -0,0 +1,2 @@
1
+ declare const _default: (el: HTMLLIElement, hydrate: any) => Promise<JSX.Element>;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export { default } from "./ItemGroup";
2
+ export { default as ItemGroupRehydrator } from "./ItemGroup.rehydrator";
@@ -0,0 +1,7 @@
1
+ import { FC } from "react";
2
+ declare const MenuButton: FC<MenuButtonProps>;
3
+ export interface MenuButtonProps {
4
+ menuOpen: boolean;
5
+ setMenuOpen: (arg0: boolean) => any;
6
+ }
7
+ export default MenuButton;
@@ -0,0 +1 @@
1
+ export { default } from "./MenuButton";
@@ -0,0 +1,39 @@
1
+ import { FC, ReactNode } from "react";
2
+ export declare const NavItem: FC<NavItemProps>;
3
+ export interface NavItemProps {
4
+ /**
5
+ * Contents of the NavItem. Must be SiteHeader.ItemGroup or
6
+ * SiteHeader.Column components.
7
+ */
8
+ children?: ReactNode;
9
+ /**
10
+ * A top-level URL for the NavItem to link to.
11
+ *
12
+ * When `children` are not present, the URL to link to when the NavItem is
13
+ * clicked or touched.
14
+ *
15
+ * When `children` are present, the URL to link to when a top-level link
16
+ * inside the NavItem panel is clicked or touched.
17
+ */
18
+ href?: string;
19
+ /**
20
+ * Should the NavItem be highlighted as the current item/page? Only applies if
21
+ * `children` are not present (and `href` is present).
22
+ */
23
+ isCurrent?: boolean;
24
+ /**
25
+ * Content to display in the NavItem panel promo area.
26
+ */
27
+ promo?: ReactNode;
28
+ /**
29
+ * Top-level text to display in the NavItem.
30
+ */
31
+ title: string;
32
+ /**
33
+ * Text to display in top-level link inside the NavItem panel. Only
34
+ * applies if both `children` are present and `href` is true. If not
35
+ * provided, top-level link text will be automatically generated from `title`.
36
+ */
37
+ viewAllTitle?: string;
38
+ }
39
+ export default NavItem;
@@ -0,0 +1,2 @@
1
+ declare const _default: (el: HTMLLIElement, hydrate: any) => Promise<JSX.Element>;
2
+ export default _default;
@@ -0,0 +1,44 @@
1
+ import React, { FC, ReactElement, ReactNode } from "react";
2
+ declare const Context: React.Context<{
3
+ navItem: React.MutableRefObject<HTMLLIElement> | null;
4
+ subTitle: string | null;
5
+ }>;
6
+ declare const NavItemWithSubNav: FC<NavItemWithSubNavProps>;
7
+ export interface NavItemWithSubNavProps {
8
+ /**
9
+ * The URL to link to when a top-level link inside the NavItemWithSubNav panel
10
+ * is clicked or touched.
11
+ */
12
+ href?: string;
13
+ /**
14
+ * Content to be displayed in the first slot of the NavItemWithSubNav. Must be
15
+ * a single SiteHeader.SubNavItem component.
16
+ */
17
+ slot1: ReactElement;
18
+ /**
19
+ * Content to be displayed in the second slot of the NavItemWithSubNav. Must
20
+ * be a single SiteHeader.SubNavItem component.
21
+ */
22
+ slot2: ReactNode;
23
+ /**
24
+ * Content to be displayed in the third slot of the NavItemWithSubNav. Must be
25
+ * a single SiteHeader.SubNavItem component.
26
+ */
27
+ slot3?: ReactNode;
28
+ /**
29
+ * Title text to display inside the NavItemWithSubNav panel.
30
+ */
31
+ subTitle?: string;
32
+ /**
33
+ * Top-level text to display in the NavItemWithSubNav.
34
+ */
35
+ title: string;
36
+ /**
37
+ * Text to display in top-level link inside the NavItemWithSubNav panel. Only
38
+ * applies if `href` is true. If not provided, text will be automatically
39
+ * generated from `title`.
40
+ */
41
+ viewAllTitle?: string;
42
+ }
43
+ export { Context as NavItemContext };
44
+ export default NavItemWithSubNav;
@@ -0,0 +1,2 @@
1
+ declare const _default: (el: HTMLLIElement, hydrate: any) => Promise<JSX.Element>;
2
+ export default _default;
@@ -0,0 +1,4 @@
1
+ export { default } from "./NavItem";
2
+ export { default as NavItemRehydrator } from "./NavItem.rehydrator";
3
+ export { default as NavItemWithSubNav } from "./NavItemWithSubNav";
4
+ export { default as NavItemWithSubNavRehydrator } from "./NavItemWithSubNav.rehydrator";
@@ -0,0 +1,22 @@
1
+ import React, { FC, ReactElement, ReactNode } from "react";
2
+ export declare const Panel: FC<PanelProps> & {
3
+ ViewAll: typeof ViewAll;
4
+ };
5
+ export declare const ViewAll: FC<ViewAllProps>;
6
+ export interface ViewAllProps {
7
+ href: string;
8
+ title: string;
9
+ }
10
+ export interface PanelProps {
11
+ children: ReactNode;
12
+ navItemRef: React.MutableRefObject<HTMLElement> | null;
13
+ open: boolean;
14
+ promo?: ReactNode;
15
+ setOpen: (arg0: boolean) => any;
16
+ subNavItemRef?: React.MutableRefObject<HTMLElement>;
17
+ subNavLink?: string;
18
+ title?: ReactNode;
19
+ viewAll?: ReactElement;
20
+ withSubNav?: boolean;
21
+ }
22
+ export default Panel;
@@ -0,0 +1 @@
1
+ export { default } from "./Panel";
@@ -0,0 +1,29 @@
1
+ import { FC, ReactNode } from "react";
2
+ declare const SubNavItem: FC<SubNavItemProps>;
3
+ export interface SubNavItemProps {
4
+ /**
5
+ * Contents of the SubNavItem. Must be SiteHeader.ItemGroup or
6
+ * SiteHeader.Column components.
7
+ */
8
+ children?: ReactNode;
9
+ /**
10
+ * Should the SubNavItem be the default open item in a
11
+ * SiteHeader.NavItemWithSubNav? If not specified, the default open item will
12
+ * be set automatically.
13
+ */
14
+ isDefaultItem?: boolean;
15
+ /**
16
+ * Content to display in the SubNavItem panel promo area.
17
+ */
18
+ promo?: ReactNode;
19
+ /**
20
+ * A URL to link to when the SubNavItem is clicked or touched. Only applies if
21
+ * `children` are not present.
22
+ */
23
+ href?: string;
24
+ /**
25
+ * Title text for the SubNavItem.
26
+ */
27
+ title: ReactNode;
28
+ }
29
+ export default SubNavItem;
@@ -0,0 +1,2 @@
1
+ declare const _default: (el: HTMLDivElement, hydrate: any) => Promise<JSX.Element>;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export { default } from "./SubNavItem";
2
+ export { default as SubNavItemRehydrator } from "./SubNavItem.rehydrator";
@@ -1 +1,2 @@
1
1
  export { default } from "./SiteHeader";
2
+ export { default as SiteHeaderRehydrator } from "./SiteHeader.rehydrator";
@@ -20,8 +20,8 @@ export { default as Poster } from "./Poster";
20
20
  export { default as RadioGroup } from "./RadioGroup";
21
21
  export { default as Rule } from "./Rule";
22
22
  export { default as Section } from "./Section";
23
- export { default as SiteFooter } from "./SiteFooter";
24
- export { default as SiteHeader } from "./SiteHeader";
23
+ export { default as SiteFooter, SiteFooterRehydrator } from "./SiteFooter";
24
+ export { default as SiteHeader, SiteHeaderRehydrator } from "./SiteHeader";
25
25
  export { default as Surface, SurfaceContext } from "./Surface";
26
26
  export { default as Text } from "./Text";
27
27
  export { default as TextInput } from "./TextInput";
@@ -1,3 +1,4 @@
1
1
  export * from "./use-aria-describedby";
2
2
  export * from "./use-interaction-mode";
3
+ export * from "./use-media-query";
3
4
  export * from "./use-numeric-input";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arc-ui/components",
3
- "version": "1.3.0",
3
+ "version": "3.1.0",
4
4
  "homepage": "https://ui.digital-ent-int.bt.com",
5
5
  "author": "BT Enterprise Digital UI Team <ui-digital-ent-int@bt.com>",
6
6
  "main": "dist/index.js",
@@ -11,7 +11,9 @@
11
11
  "storybook": "start-storybook --ci -p 6006 --no-manager-cache",
12
12
  "storybook:build": "build-storybook --docs --quiet",
13
13
  "storybook:quiet": "yarn storybook --quiet",
14
- "test:unit": "jest"
14
+ "test": "jest",
15
+ "test:coverage": "yarn test --coverage",
16
+ "test:watch": "yarn test --changedSince=origin/master --coverage --watch"
15
17
  },
16
18
  "files": [
17
19
  "dist"
@@ -23,31 +25,29 @@
23
25
  "react": "^17.0.0"
24
26
  },
25
27
  "devDependencies": {
26
- "@arc-ui/fonts": "^1.3.0",
27
- "@arc-ui/tokens": "^1.3.0",
28
+ "@arc-ui/fonts": "^3.1.0",
29
+ "@arc-ui/tokens": "^3.1.0",
28
30
  "@babel/core": "^7.14.3",
29
31
  "@storybook/addon-essentials": "^6.3.6",
30
- "@storybook/addon-ie11": "measuredco/addon-ie11#measuredco-fork",
32
+ "@storybook/addon-ie11": "BTEnterpriseDigital/addon-ie11#measuredco-fork",
31
33
  "@storybook/addon-links": "^6.3.6",
32
34
  "@storybook/addon-postcss": "^2.0.0",
33
35
  "@storybook/react": "^6.3.6",
34
36
  "@types/classnames": "^2.2.10",
35
- "@types/jest": "^26.0.14",
36
37
  "@types/node": "^12.12.38",
37
38
  "@types/prop-types": "^15.7.3",
38
39
  "@types/react": "^16.9.49",
39
40
  "@types/react-dom": "^16.9.8",
40
41
  "babel-loader": "^8.2.2",
42
+ "camelcase": "^6.2.1",
41
43
  "cheerio": "^1.0.0-rc.3",
42
44
  "classnames": "^2.2.6",
43
45
  "ie-array-find-polyfill": "^1.1.0",
44
- "jest": "^26.4.2",
45
46
  "prop-types": "^15.7.2",
46
47
  "react": "^17.0.0",
47
48
  "react-app-polyfill": "^2.0.0",
48
49
  "react-dom": "^17.0.0",
49
50
  "react-is": "^17.0.0",
50
- "ts-jest": "^26.4.0",
51
51
  "tslib": "^2.0.1",
52
52
  "typescript": "^4.0.2"
53
53
  }