@arc-ui/components 2.0.0 → 4.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 (29) hide show
  1. package/dist/index.es.js +491 -2419
  2. package/dist/index.es.js.map +1 -1
  3. package/dist/index.js +644 -2571
  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/Base/Base.d.ts +1 -1
  9. package/dist/types/components/BrandLogo/BrandLogo.d.ts +5 -0
  10. package/dist/types/components/Button/Button.d.ts +6 -1
  11. package/dist/types/components/Card/Card.d.ts +2 -2
  12. package/dist/types/components/Clock/Clock.rehydrator.d.ts +0 -1
  13. package/dist/types/components/Icon/Icon.d.ts +1 -2
  14. package/dist/types/components/SiteFooter/SiteFooter.rehydrator.d.ts +0 -1
  15. package/dist/types/components/SiteHeader/SiteHeader.d.ts +11 -6
  16. package/dist/types/components/SiteHeader/SiteHeader.rehydrator.d.ts +8 -0
  17. package/dist/types/components/SiteHeader/components/ItemGroup/ItemGroup.d.ts +10 -0
  18. package/dist/types/components/SiteHeader/components/ItemGroup/ItemGroup.rehydrator.d.ts +2 -0
  19. package/dist/types/components/SiteHeader/components/ItemGroup/index.d.ts +1 -0
  20. package/dist/types/components/SiteHeader/components/NavItem/NavItem.d.ts +9 -10
  21. package/dist/types/components/SiteHeader/components/NavItem/NavItem.rehydrator.d.ts +2 -0
  22. package/dist/types/components/SiteHeader/components/NavItem/NavItemWithSubNav.d.ts +8 -16
  23. package/dist/types/components/SiteHeader/components/NavItem/NavItemWithSubNav.rehydrator.d.ts +2 -0
  24. package/dist/types/components/SiteHeader/components/NavItem/index.d.ts +2 -0
  25. package/dist/types/components/SiteHeader/components/SubNavItem/SubNavItem.rehydrator.d.ts +2 -0
  26. package/dist/types/components/SiteHeader/components/SubNavItem/index.d.ts +1 -0
  27. package/dist/types/components/SiteHeader/index.d.ts +1 -0
  28. package/dist/types/components/index.d.ts +1 -1
  29. package/package.json +9 -8
@@ -1,4 +1,5 @@
1
1
  import React, { FC, ReactNode } from "react";
2
+ import { subBrands } from "../BrandLogo/BrandLogo";
2
3
  import Column from "./components/Column";
3
4
  import Item from "./components/Item";
4
5
  import ItemGroup from "./components/ItemGroup";
@@ -24,10 +25,6 @@ export interface SiteHeaderProps {
24
25
  * SiteHeader.NavItemWithSubNav components.
25
26
  */
26
27
  children?: ReactNode;
27
- /**
28
- * Should the SiteHeader have a transparent background?
29
- */
30
- isTransparent?: boolean;
31
28
  /**
32
29
  * A URL to link to when the SiteHeader basket link is clicked or touched.
33
30
  */
@@ -41,9 +38,9 @@ export interface SiteHeaderProps {
41
38
  */
42
39
  hasLogin?: boolean;
43
40
  /**
44
- * Should search functionality be included in the SiteHeader?
41
+ * Should the SiteHeader have a transparent background?
45
42
  */
46
- hasSearch?: boolean;
43
+ isTransparent?: boolean;
47
44
  /**
48
45
  * A URL to link to when SiteHeader login links are clicked or touched.
49
46
  */
@@ -60,6 +57,14 @@ export interface SiteHeaderProps {
60
57
  * Accessible text for the SiteHeader brand logo link.
61
58
  */
62
59
  logoLabel?: string;
60
+ /**
61
+ * Search component for the SiteHeader.
62
+ */
63
+ search?: ReactNode;
64
+ /**
65
+ * Optional sub-brand variant. Only applies to BT.
66
+ */
67
+ subBrand?: typeof subBrands[number];
63
68
  }
64
69
  export { Context as SiteHeaderContext };
65
70
  export default SiteHeader;
@@ -0,0 +1,8 @@
1
+ declare const SiteHeaderRehydrator: {
2
+ (el: HTMLDivElement, hydrate: any): Promise<JSX.Element>;
3
+ ItemGroupRehydrator: (el: HTMLLIElement, hydrate: any) => Promise<JSX.Element>;
4
+ NavItemRehydrator: (el: HTMLLIElement, hydrate: any) => Promise<JSX.Element>;
5
+ NavItemWithSubNavRehydrator: (el: HTMLLIElement, hydrate: any) => Promise<JSX.Element>;
6
+ SubNavItemRehydrator: (el: HTMLDivElement, hydrate: any) => Promise<JSX.Element>;
7
+ };
8
+ export default SiteHeaderRehydrator;
@@ -5,9 +5,19 @@ export interface ItemGroupProps {
5
5
  * Contents of the ItemGroup. Must be Item components.
6
6
  */
7
7
  children: ReactNode;
8
+ /**
9
+ * A top-level URL for the ItemGroup to link to.
10
+ */
11
+ href?: string;
8
12
  /**
9
13
  * Title text to be displayed in the ItemGroup summary.
10
14
  */
11
15
  title: string;
16
+ /**
17
+ * Text to display in top-level link inside the ItemGroup in narrow viewports.
18
+ * Only applies if `href` is present. If not provided, top-level link text
19
+ * will be automatically generated from `title`.
20
+ */
21
+ viewAllTitle?: string;
12
22
  }
13
23
  export default ItemGroup;
@@ -0,0 +1,2 @@
1
+ declare const _default: (el: HTMLLIElement, hydrate: any) => Promise<JSX.Element>;
2
+ export default _default;
@@ -1 +1,2 @@
1
1
  export { default } from "./ItemGroup";
2
+ export { default as ItemGroupRehydrator } from "./ItemGroup.rehydrator";
@@ -6,22 +6,21 @@ export interface NavItemProps {
6
6
  * SiteHeader.Column components.
7
7
  */
8
8
  children?: ReactNode;
9
- /**
10
- * Should a top-level link be shown inside the NavItem panel?
11
- */
12
- hasViewAll?: boolean;
13
9
  /**
14
10
  * A top-level URL for the NavItem to link to.
15
11
  *
16
12
  * When `children` are not present, the URL to link to when the NavItem is
17
13
  * clicked or touched.
18
14
  *
19
- * When `children` are present, and `hasViewAll` is true, the URL to link to
20
- * when the top-level link inside the NavItem panel is clicked or touched.
21
- *
22
- * Also used as a fallback in no-JS scenarios.
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).
23
22
  */
24
- href: string;
23
+ isCurrent?: boolean;
25
24
  /**
26
25
  * Content to display in the NavItem panel promo area.
27
26
  */
@@ -32,7 +31,7 @@ export interface NavItemProps {
32
31
  title: string;
33
32
  /**
34
33
  * Text to display in top-level link inside the NavItem panel. Only
35
- * applies if both `children` are present and `hasViewAll` is true. If not
34
+ * applies if both `children` are present and `href` is true. If not
36
35
  * provided, top-level link text will be automatically generated from `title`.
37
36
  */
38
37
  viewAllTitle?: string;
@@ -0,0 +1,2 @@
1
+ declare const _default: (el: HTMLLIElement, hydrate: any) => Promise<JSX.Element>;
2
+ export default _default;
@@ -1,4 +1,4 @@
1
- import React, { FC, ReactElement } from "react";
1
+ import React, { FC, ReactElement, ReactNode } from "react";
2
2
  declare const Context: React.Context<{
3
3
  navItem: React.MutableRefObject<HTMLLIElement> | null;
4
4
  subTitle: string | null;
@@ -6,18 +6,10 @@ declare const Context: React.Context<{
6
6
  declare const NavItemWithSubNav: FC<NavItemWithSubNavProps>;
7
7
  export interface NavItemWithSubNavProps {
8
8
  /**
9
- * Should a top-level link be shown inside the NavItemWithSubNav panel?
9
+ * The URL to link to when a top-level link inside the NavItemWithSubNav panel
10
+ * is clicked or touched.
10
11
  */
11
- hasViewAll?: boolean;
12
- /**
13
- * A top-level URL for the NavItemWithSubNav to link to.
14
- *
15
- * If `hasViewAll` is true, the URL to link to when the top-level link inside
16
- * the NavItemWithSubNav panel is clicked or touched.
17
- *
18
- * Also used as a fallback in no-JS scenarios.
19
- */
20
- href: string;
12
+ href?: string;
21
13
  /**
22
14
  * Content to be displayed in the first slot of the NavItemWithSubNav. Must be
23
15
  * a single SiteHeader.SubNavItem component.
@@ -27,12 +19,12 @@ export interface NavItemWithSubNavProps {
27
19
  * Content to be displayed in the second slot of the NavItemWithSubNav. Must
28
20
  * be a single SiteHeader.SubNavItem component.
29
21
  */
30
- slot2: ReactElement;
22
+ slot2: ReactNode;
31
23
  /**
32
24
  * Content to be displayed in the third slot of the NavItemWithSubNav. Must be
33
25
  * a single SiteHeader.SubNavItem component.
34
26
  */
35
- slot3?: ReactElement;
27
+ slot3?: ReactNode;
36
28
  /**
37
29
  * Title text to display inside the NavItemWithSubNav panel.
38
30
  */
@@ -43,8 +35,8 @@ export interface NavItemWithSubNavProps {
43
35
  title: string;
44
36
  /**
45
37
  * Text to display in top-level link inside the NavItemWithSubNav panel. Only
46
- * applies if `hasViewAll` is true. If not provided, text will be
47
- * automatically generated from `title`.
38
+ * applies if `href` is true. If not provided, text will be automatically
39
+ * generated from `title`.
48
40
  */
49
41
  viewAllTitle?: string;
50
42
  }
@@ -0,0 +1,2 @@
1
+ declare const _default: (el: HTMLLIElement, hydrate: any) => Promise<JSX.Element>;
2
+ export default _default;
@@ -1,2 +1,4 @@
1
1
  export { default } from "./NavItem";
2
+ export { default as NavItemRehydrator } from "./NavItem.rehydrator";
2
3
  export { default as NavItemWithSubNav } from "./NavItemWithSubNav";
4
+ export { default as NavItemWithSubNavRehydrator } from "./NavItemWithSubNav.rehydrator";
@@ -0,0 +1,2 @@
1
+ declare const _default: (el: HTMLDivElement, hydrate: any) => Promise<JSX.Element>;
2
+ export default _default;
@@ -1 +1,2 @@
1
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";
@@ -21,7 +21,7 @@ export { default as RadioGroup } from "./RadioGroup";
21
21
  export { default as Rule } from "./Rule";
22
22
  export { default as Section } from "./Section";
23
23
  export { default as SiteFooter, SiteFooterRehydrator } from "./SiteFooter";
24
- export { default as SiteHeader } from "./SiteHeader";
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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arc-ui/components",
3
- "version": "2.0.0",
3
+ "version": "4.0.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": "TZ=UTC 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,30 @@
23
25
  "react": "^17.0.0"
24
26
  },
25
27
  "devDependencies": {
26
- "@arc-ui/fonts": "^2.0.0",
27
- "@arc-ui/tokens": "^2.0.0",
28
+ "@arc-ui/fonts": "^4.0.0",
29
+ "@arc-ui/tokens": "^4.0.0",
28
30
  "@babel/core": "^7.14.3",
31
+ "@babel/helper-define-map": "^7.14.3",
29
32
  "@storybook/addon-essentials": "^6.3.6",
30
- "@storybook/addon-ie11": "measuredco/addon-ie11#measuredco-fork",
33
+ "@storybook/addon-ie11": "BTEnterpriseDigital/addon-ie11#measuredco-fork",
31
34
  "@storybook/addon-links": "^6.3.6",
32
35
  "@storybook/addon-postcss": "^2.0.0",
33
36
  "@storybook/react": "^6.3.6",
34
37
  "@types/classnames": "^2.2.10",
35
- "@types/jest": "^26.0.14",
36
38
  "@types/node": "^12.12.38",
37
39
  "@types/prop-types": "^15.7.3",
38
40
  "@types/react": "^16.9.49",
39
41
  "@types/react-dom": "^16.9.8",
40
42
  "babel-loader": "^8.2.2",
43
+ "camelcase": "^6.2.1",
41
44
  "cheerio": "^1.0.0-rc.3",
42
45
  "classnames": "^2.2.6",
43
46
  "ie-array-find-polyfill": "^1.1.0",
44
- "jest": "^26.4.2",
45
47
  "prop-types": "^15.7.2",
46
48
  "react": "^17.0.0",
47
49
  "react-app-polyfill": "^2.0.0",
48
50
  "react-dom": "^17.0.0",
49
51
  "react-is": "^17.0.0",
50
- "ts-jest": "^26.4.0",
51
52
  "tslib": "^2.0.1",
52
53
  "typescript": "^4.0.2"
53
54
  }