@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.
- package/dist/index.es.js +348 -2444
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +510 -2606
- package/dist/index.js.map +1 -1
- package/dist/styles.bt.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.ee.css +1 -1
- package/dist/types/components/Base/Base.d.ts +1 -1
- package/dist/types/components/BrandLogo/BrandLogo.d.ts +5 -0
- package/dist/types/components/Button/Button.d.ts +6 -1
- package/dist/types/components/Card/Card.d.ts +2 -2
- package/dist/types/components/Clock/Clock.rehydrator.d.ts +0 -1
- package/dist/types/components/Icon/Icon.d.ts +1 -2
- package/dist/types/components/SiteFooter/SiteFooter.rehydrator.d.ts +0 -1
- package/dist/types/components/SiteHeader/SiteHeader.d.ts +9 -4
- package/dist/types/components/SiteHeader/SiteHeader.rehydrator.d.ts +0 -1
- package/dist/types/components/SiteHeader/components/ItemGroup/ItemGroup.d.ts +10 -0
- package/dist/types/components/SiteHeader/components/ItemGroup/ItemGroup.rehydrator.d.ts +0 -1
- package/dist/types/components/SiteHeader/components/NavItem/NavItem.d.ts +9 -10
- package/dist/types/components/SiteHeader/components/NavItem/NavItem.rehydrator.d.ts +0 -1
- package/dist/types/components/SiteHeader/components/NavItem/NavItemWithSubNav.d.ts +5 -13
- package/dist/types/components/SiteHeader/components/NavItem/NavItemWithSubNav.rehydrator.d.ts +0 -1
- package/dist/types/components/SiteHeader/components/SubNavItem/SubNavItem.rehydrator.d.ts +0 -1
- 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";
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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,
|
|
20
|
-
*
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
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 `
|
|
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;
|
|
@@ -6,18 +6,10 @@ declare const Context: React.Context<{
|
|
|
6
6
|
declare const NavItemWithSubNav: FC<NavItemWithSubNavProps>;
|
|
7
7
|
export interface NavItemWithSubNavProps {
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* The URL to link to when a top-level link inside the NavItemWithSubNav panel
|
|
10
|
+
* is clicked or touched.
|
|
10
11
|
*/
|
|
11
|
-
|
|
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 `
|
|
47
|
-
*
|
|
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
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arc-ui/components",
|
|
3
|
-
"version": "
|
|
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
|
|
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": "^
|
|
27
|
-
"@arc-ui/tokens": "^
|
|
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": "
|
|
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
|
}
|