@arc-ui/components 2.1.0 → 4.0.1

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.
@@ -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";
@@ -36,10 +37,6 @@ export interface SiteHeaderProps {
36
37
  * Should account login links be included in the SiteHeader?
37
38
  */
38
39
  hasLogin?: boolean;
39
- /**
40
- * Should search functionality be included in the SiteHeader?
41
- */
42
- hasSearch?: boolean;
43
40
  /**
44
41
  * Should the SiteHeader have a transparent background?
45
42
  */
@@ -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;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const SiteHeaderRehydrator: {
3
2
  (el: HTMLDivElement, hydrate: any): Promise<JSX.Element>;
4
3
  ItemGroupRehydrator: (el: HTMLLIElement, hydrate: any) => Promise<JSX.Element>;
@@ -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;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const _default: (el: HTMLLIElement, hydrate: any) => Promise<JSX.Element>;
3
2
  export default _default;
@@ -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;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const _default: (el: HTMLLIElement, hydrate: any) => Promise<JSX.Element>;
3
2
  export default _default;
@@ -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.
@@ -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
  }
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const _default: (el: HTMLLIElement, hydrate: any) => Promise<JSX.Element>;
3
2
  export default _default;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const _default: (el: HTMLDivElement, hydrate: any) => Promise<JSX.Element>;
3
2
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arc-ui/components",
3
- "version": "2.1.0",
3
+ "version": "4.0.1",
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.1.0",
27
- "@arc-ui/tokens": "^2.1.0",
28
+ "@arc-ui/fonts": "^4.0.1",
29
+ "@arc-ui/tokens": "^4.0.1",
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
  }