@arc-ui/components 11.19.0 → 11.20.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 (80) hide show
  1. package/dist/Avatar/Avatar.cjs.js +18 -0
  2. package/dist/Avatar/Avatar.esm.js +10 -0
  3. package/dist/Avatar/package.json +7 -0
  4. package/dist/AvatarGroup/AvatarGroup.cjs.js +37 -0
  5. package/dist/AvatarGroup/AvatarGroup.esm.js +29 -0
  6. package/dist/AvatarGroup/package.json +7 -0
  7. package/dist/Checkbox/Checkbox.cjs.js +2 -2
  8. package/dist/Checkbox/Checkbox.esm.js +2 -2
  9. package/dist/DatePicker/DatePicker.cjs.js +2 -2
  10. package/dist/DatePicker/DatePicker.esm.js +2 -2
  11. package/dist/FormControl/FormControl.cjs.js +1 -1
  12. package/dist/FormControl/FormControl.esm.js +1 -1
  13. package/dist/InformationCard/InformationCard.cjs.js +4 -4
  14. package/dist/InformationCard/InformationCard.esm.js +1 -1
  15. package/dist/MediaCard/MediaCard.cjs.js +6 -10
  16. package/dist/MediaCard/MediaCard.esm.js +3 -7
  17. package/dist/RadioGroup/RadioGroup.cjs.js +2 -2
  18. package/dist/RadioGroup/RadioGroup.esm.js +2 -2
  19. package/dist/Rule/Rule.cjs.js +11 -7
  20. package/dist/Rule/Rule.esm.js +11 -7
  21. package/dist/ScrollToTop/ScrollToTop.cjs.js +1 -1
  22. package/dist/ScrollToTop/ScrollToTop.esm.js +1 -1
  23. package/dist/Select/Select.cjs.js +8 -6
  24. package/dist/Select/Select.esm.js +8 -6
  25. package/dist/SiteHeaderV2/SiteHeaderV2.cjs.js +1 -1
  26. package/dist/SiteHeaderV2/SiteHeaderV2.esm.js +1 -1
  27. package/dist/SkipLink/SkipLink.cjs.js +23 -0
  28. package/dist/SkipLink/SkipLink.esm.js +15 -0
  29. package/dist/SkipLink/package.json +7 -0
  30. package/dist/Switch/Switch.cjs.js +1 -1
  31. package/dist/Switch/Switch.esm.js +1 -1
  32. package/dist/TextArea/TextArea.cjs.js +6 -6
  33. package/dist/TextArea/TextArea.esm.js +6 -6
  34. package/dist/TextInput/TextInput.cjs.js +2 -2
  35. package/dist/TextInput/TextInput.esm.js +2 -2
  36. package/dist/TypographyCard/TypographyCard.cjs.js +4 -4
  37. package/dist/TypographyCard/TypographyCard.esm.js +2 -2
  38. package/dist/_shared/cjs/Avatar-12ece0dd.js +65 -0
  39. package/dist/_shared/cjs/{CardFooter-f6cba651.js → CardFooter-4a68a862.js} +2 -2
  40. package/dist/_shared/cjs/{Checkbox-4d4b432f.js → Checkbox-8915fcd9.js} +1 -1
  41. package/dist/_shared/cjs/ConditionalWrapper-be3b2625.js +14 -0
  42. package/dist/_shared/cjs/{FormControl-b26ad353.js → FormControl-5f3b6ce4.js} +9 -4
  43. package/dist/_shared/cjs/{RadioGroup-60845bb3.js → RadioGroup-07bb155e.js} +3 -2
  44. package/dist/_shared/cjs/{SiteHeaderV2-8c8f3f5c.js → SiteHeaderV2-301c765c.js} +9 -25
  45. package/dist/_shared/cjs/{TextInput-acbd8eda.js → TextInput-5da70ec2.js} +1 -1
  46. package/dist/_shared/esm/Avatar-d01e2b7b.js +59 -0
  47. package/dist/_shared/esm/{CardFooter-55ae9a37.js → CardFooter-a08b70ee.js} +1 -1
  48. package/dist/_shared/esm/{Checkbox-720b074d.js → Checkbox-0e051546.js} +1 -1
  49. package/dist/_shared/esm/ConditionalWrapper-59be8f35.js +8 -0
  50. package/dist/_shared/esm/{FormControl-f0b8fe91.js → FormControl-cc99cde0.js} +9 -4
  51. package/dist/_shared/esm/{RadioGroup-d42dba3a.js → RadioGroup-362be63f.js} +3 -2
  52. package/dist/_shared/esm/{SiteHeaderV2-6d0ff35b.js → SiteHeaderV2-0096e25b.js} +9 -25
  53. package/dist/_shared/esm/{TextInput-ddf4cc7a.js → TextInput-1d1c5fd6.js} +1 -1
  54. package/dist/index.es.js +267 -205
  55. package/dist/index.es.js.map +1 -1
  56. package/dist/index.js +267 -203
  57. package/dist/index.js.map +1 -1
  58. package/dist/styles.css +4 -4
  59. package/dist/types/components/Avatar/Avatar.d.ts +13 -0
  60. package/dist/types/components/Avatar/components/AvatarContent/AvatarContent.d.ts +9 -0
  61. package/dist/types/components/Avatar/index.d.ts +1 -0
  62. package/dist/types/components/Avatar/types/avatar-icon-size.d.ts +1 -0
  63. package/dist/types/components/Avatar/types/avatar-image.d.ts +2 -0
  64. package/dist/types/components/Avatar/types/avatar-size.d.ts +1 -0
  65. package/dist/types/components/Avatar/types/avatar-text-size.d.ts +2 -0
  66. package/dist/types/components/AvatarGroup/AvatarGroup.d.ts +13 -0
  67. package/dist/types/components/AvatarGroup/index.d.ts +1 -0
  68. package/dist/types/components/AvatarGroup/types/group-avatar.d.ts +2 -0
  69. package/dist/types/components/AvatarGroup/utils/get-avatars.d.ts +2 -0
  70. package/dist/types/components/Rule/Rule.d.ts +2 -1
  71. package/dist/types/components/Select/Select.d.ts +4 -0
  72. package/dist/types/components/SkipLink/SkipLink.d.ts +11 -0
  73. package/dist/types/components/SkipLink/SkipLinkItem/SkipLinkItem.d.ts +16 -0
  74. package/dist/types/components/SkipLink/index.d.ts +1 -0
  75. package/dist/types/components/index.d.ts +2 -0
  76. package/dist/types/private-components/ConditionalWrapper/ConditionalWrapper.d.ts +1 -0
  77. package/dist/types/styles.d.ts +3 -0
  78. package/package.json +2 -2
  79. package/dist/_shared/cjs/{CardLabel-768abf20.js → BtIconArrowRight.esm-50d96943.js} +20 -20
  80. package/dist/_shared/esm/{CardLabel-d6d71407.js → BtIconArrowRight.esm-9b181878.js} +20 -20
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import { type AvatarImage } from "./types/avatar-image";
3
+ import { type AvatarSize } from "./types/avatar-size";
4
+ export declare const Avatar: React.FC<AvatarProps>;
5
+ export interface AvatarProps {
6
+ initials?: string;
7
+ href?: string;
8
+ title?: string;
9
+ ariaLabel?: string;
10
+ onClick?: (e: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void;
11
+ img?: AvatarImage;
12
+ size?: AvatarSize;
13
+ }
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import { type AvatarImage } from "../../types/avatar-image";
3
+ import { type AvatarSize } from "../../types/avatar-size";
4
+ export declare const AvatarContent: React.FC<AvatarContentProps>;
5
+ export interface AvatarContentProps {
6
+ initials?: string;
7
+ img?: AvatarImage;
8
+ size?: AvatarSize;
9
+ }
@@ -0,0 +1 @@
1
+ export { Avatar } from "./Avatar";
@@ -0,0 +1 @@
1
+ export type AvatarIconSize = 16 | 24 | 32 | 40;
@@ -0,0 +1,2 @@
1
+ import { type ImageProps } from "../../Image/Image";
2
+ export type AvatarImage = Pick<ImageProps, "src" | "loading" | "sizes" | "srcSet" | "width" | "height" | "alt">;
@@ -0,0 +1 @@
1
+ export type AvatarSize = "s" | "m" | "l" | "xl";
@@ -0,0 +1,2 @@
1
+ import { type HeadingSize } from "../../Heading/Heading";
2
+ export type AvatarTextSize = Extract<HeadingSize, "xxxs" | "xxs" | "xs" | "s">;
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import { type AvatarSize } from "../Avatar/types/avatar-size";
3
+ import { type GroupAvatar } from "./types/group-avatar";
4
+ export declare const AvatarGroup: React.FC<AvatarGroupProps>;
5
+ export interface AvatarGroupProps {
6
+ avatars: GroupAvatar[];
7
+ size?: AvatarSize;
8
+ max?: number;
9
+ title?: string;
10
+ ariaLabel?: string;
11
+ href?: string;
12
+ onClick?: (e: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void;
13
+ }
@@ -0,0 +1 @@
1
+ export { AvatarGroup } from "./AvatarGroup";
@@ -0,0 +1,2 @@
1
+ import { AvatarProps } from "../../Avatar/Avatar";
2
+ export type GroupAvatar = Omit<AvatarProps, "size" | "title" | "href" | "onClick">;
@@ -0,0 +1,2 @@
1
+ import { type GroupAvatar } from "../types/group-avatar";
2
+ export declare const getAvatars: (avatars: GroupAvatar[], max?: number) => GroupAvatar[];
@@ -1,7 +1,8 @@
1
1
  import { FC } from "react";
2
2
  /**
3
- * Use `Rule` to display a horizontal rule.
3
+ * Use `Rule` to display a horizontal or vertical rule.
4
4
  */
5
5
  export declare const Rule: FC<RuleProps>;
6
6
  export interface RuleProps {
7
+ orientation?: "horizontal" | "vertical";
7
8
  }
@@ -26,6 +26,10 @@ export interface SelectProps extends Omit<FormControlProps, "children" | "elemen
26
26
  name: string;
27
27
  value: string;
28
28
  }[];
29
+ /**
30
+ * value for the Select. Passing a value makes the Select a controlled component.
31
+ */
32
+ value?: string;
29
33
  /**
30
34
  * error message for the Select.
31
35
  */
@@ -0,0 +1,11 @@
1
+ import { FC, ReactNode } from "react";
2
+ import { SkipLinkItem } from "./SkipLinkItem/SkipLinkItem";
3
+ export declare const SkipLink: FC<SkipLinkProps> & {
4
+ Item: typeof SkipLinkItem;
5
+ };
6
+ export interface SkipLinkProps {
7
+ /**
8
+ * Links to display in the SkipLink.Item.
9
+ */
10
+ children?: ReactNode;
11
+ }
@@ -0,0 +1,16 @@
1
+ import { FC } from "react";
2
+ export declare const SkipLinkItem: FC<SkipLinkItemProps>;
3
+ export interface SkipLinkItemProps {
4
+ /**
5
+ * The label to display for SkipLink.Item.
6
+ */
7
+ label: string;
8
+ /**
9
+ * The URL the skip link navigates to.
10
+ */
11
+ href?: string;
12
+ /**
13
+ * The ID attribute of the target element the skip link navigates to.
14
+ */
15
+ id?: string;
16
+ }
@@ -0,0 +1 @@
1
+ export { SkipLink } from "./SkipLink";
@@ -1,5 +1,7 @@
1
1
  export { Align } from "./Align";
2
2
  export { Alert } from "./Alert";
3
+ export { Avatar } from "./Avatar";
4
+ export { AvatarGroup } from "./AvatarGroup";
3
5
  export { Badge } from "./Badge";
4
6
  export { Base } from "./Base";
5
7
  export { Box } from "./Box";
@@ -2,5 +2,6 @@ import React from "react";
2
2
  export declare const ConditionalWrapper: React.FC<{
3
3
  condition: boolean;
4
4
  wrapper: (children: React.ReactNode) => React.ReactNode;
5
+ fallback?: (children: React.ReactNode) => React.ReactNode;
5
6
  children: React.ReactNode;
6
7
  }>;
@@ -33,6 +33,7 @@ import "./components/ScrollToTop/ScrollToTop.css";
33
33
  import "./components/Section/Section.css";
34
34
  import "./components/Select/Select.css";
35
35
  import "./components/SiteFooter/SiteFooter.css";
36
+ import "./components/SkipLink/SkipLink.css";
36
37
  import "./components/SiteHeader/SiteHeader.css";
37
38
  import "./components/SiteHeaderV2/SiteHeaderV2.css";
38
39
  import "./components/Surface/Surface.css";
@@ -78,6 +79,8 @@ import "./components/Calendar/Calendar.css";
78
79
  import "./components/DatePicker/DatePicker.css";
79
80
  import "./components/InformationCard/InformationCard.css";
80
81
  import "./components/TypographyCard/TypographyCard.css";
82
+ import "./components/Avatar/Avatar.css";
83
+ import "./components/AvatarGroup/AvatarGroup.css";
81
84
  import "./private-components/CardHeading/CardHeading.css";
82
85
  import "./private-components/CardLabel/CardLabel.css";
83
86
  import "./private-components/CardFooter/CardFooter.css";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arc-ui/components",
3
- "version": "11.19.0",
3
+ "version": "11.20.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",
@@ -77,7 +77,7 @@
77
77
  "camelcase": "^6.2.1",
78
78
  "classnames": "^2.2.6",
79
79
  "countries-list": "^2.6.1",
80
- "cypress": "^13.3.0",
80
+ "cypress": "^13.3.1",
81
81
  "formik": "^2.2.9",
82
82
  "lodash": "^4.17.21",
83
83
  "postcss": "^8.0.0",
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var React = require('react');
4
3
  var filterDataAttrs = require('./filter-data-attrs-1c9a530c.js');
4
+ var React = require('react');
5
5
  var index = require('./index-9947ac13.js');
6
6
  var suffixModifier = require('./suffix-modifier-64dcd338.js');
7
7
 
@@ -9,6 +9,25 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
9
9
 
10
10
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
11
11
 
12
+ var CardHeading = function (_a) {
13
+ var onClick = _a.onClick, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave, onBlur = _a.onBlur, onFocus = _a.onFocus, href = _a.href, heading = _a.heading, _b = _a.size, size = _b === void 0 ? "s" : _b, _c = _a.isDarkPathway, isDarkPathway = _c === void 0 ? false : _c, _d = _a.linkData, linkData = _d === void 0 ? {} : _d, _e = _a.headingLevel, headingLevel = _e === void 0 ? "2" : _e;
14
+ var HeadingElement = "h".concat(headingLevel);
15
+ return (React__default["default"].createElement(HeadingElement, { className: index.classNames("arc-CardHeading", "arc-CardHeading--".concat(size), {
16
+ "arc-CardHeading--darkPathway": isDarkPathway
17
+ }) }, href ? (React__default["default"].createElement("a", filterDataAttrs.__assign({ className: "arc-CardHeading-link", href: href, onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onFocus: onFocus, onBlur: onBlur }, filterDataAttrs.filterDataAttrs(linkData)), heading)) : (heading)));
18
+ };
19
+
20
+ var CardLabel = function (_a) {
21
+ var _b;
22
+ var text = _a.text, _c = _a.color, color = _c === void 0 ? "muted" : _c, _d = _a.isBold, isBold = _d === void 0 ? true : _d, _e = _a.isDarkPathway, isDarkPathway = _e === void 0 ? false : _e;
23
+ return (React__default["default"].createElement(React__default["default"].Fragment, null,
24
+ React__default["default"].createElement("span", { className: index.classNames("arc-CardLabel", (_b = {},
25
+ _b[suffixModifier.suffixModifier("arc-CardLabel--color", color)] = !isDarkPathway,
26
+ _b["arc-CardLabel--bold"] = isBold,
27
+ _b["arc-CardLabel--darkPathway"] = isDarkPathway,
28
+ _b)) }, text)));
29
+ };
30
+
12
31
  const BtIconArrowRight = (props) =>
13
32
  /*#__PURE__*/ React__default["default"].createElement(
14
33
  "svg",
@@ -30,25 +49,6 @@ const BtIconArrowRight = (props) =>
30
49
  }),
31
50
  );
32
51
 
33
- var CardHeading = function (_a) {
34
- var onClick = _a.onClick, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave, onBlur = _a.onBlur, onFocus = _a.onFocus, href = _a.href, heading = _a.heading, _b = _a.size, size = _b === void 0 ? "s" : _b, _c = _a.isDarkPathway, isDarkPathway = _c === void 0 ? false : _c, _d = _a.linkData, linkData = _d === void 0 ? {} : _d, _e = _a.headingLevel, headingLevel = _e === void 0 ? "2" : _e;
35
- var HeadingElement = "h".concat(headingLevel);
36
- return (React__default["default"].createElement(HeadingElement, { className: index.classNames("arc-CardHeading", "arc-CardHeading--".concat(size), {
37
- "arc-CardHeading--darkPathway": isDarkPathway
38
- }) }, href ? (React__default["default"].createElement("a", filterDataAttrs.__assign({ className: "arc-CardHeading-link", href: href, onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onFocus: onFocus, onBlur: onBlur }, filterDataAttrs.filterDataAttrs(linkData)), heading)) : (heading)));
39
- };
40
-
41
- var CardLabel = function (_a) {
42
- var _b;
43
- var text = _a.text, _c = _a.color, color = _c === void 0 ? "muted" : _c, _d = _a.isBold, isBold = _d === void 0 ? true : _d, _e = _a.isDarkPathway, isDarkPathway = _e === void 0 ? false : _e;
44
- return (React__default["default"].createElement(React__default["default"].Fragment, null,
45
- React__default["default"].createElement("span", { className: index.classNames("arc-CardLabel", (_b = {},
46
- _b[suffixModifier.suffixModifier("arc-CardLabel--color", color)] = !isDarkPathway,
47
- _b["arc-CardLabel--bold"] = isBold,
48
- _b["arc-CardLabel--darkPathway"] = isDarkPathway,
49
- _b)) }, text)));
50
- };
51
-
52
52
  exports.BtIconArrowRight = BtIconArrowRight;
53
53
  exports.CardHeading = CardHeading;
54
54
  exports.CardLabel = CardLabel;
@@ -1,8 +1,27 @@
1
- import React__default from 'react';
2
1
  import { a as __assign, f as filterDataAttrs } from './filter-data-attrs-ea8f4ed4.js';
2
+ import React__default from 'react';
3
3
  import { c as classNames } from './index-2e73c2e9.js';
4
4
  import { s as suffixModifier } from './suffix-modifier-3d548e45.js';
5
5
 
6
+ var CardHeading = function (_a) {
7
+ var onClick = _a.onClick, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave, onBlur = _a.onBlur, onFocus = _a.onFocus, href = _a.href, heading = _a.heading, _b = _a.size, size = _b === void 0 ? "s" : _b, _c = _a.isDarkPathway, isDarkPathway = _c === void 0 ? false : _c, _d = _a.linkData, linkData = _d === void 0 ? {} : _d, _e = _a.headingLevel, headingLevel = _e === void 0 ? "2" : _e;
8
+ var HeadingElement = "h".concat(headingLevel);
9
+ return (React__default.createElement(HeadingElement, { className: classNames("arc-CardHeading", "arc-CardHeading--".concat(size), {
10
+ "arc-CardHeading--darkPathway": isDarkPathway
11
+ }) }, href ? (React__default.createElement("a", __assign({ className: "arc-CardHeading-link", href: href, onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onFocus: onFocus, onBlur: onBlur }, filterDataAttrs(linkData)), heading)) : (heading)));
12
+ };
13
+
14
+ var CardLabel = function (_a) {
15
+ var _b;
16
+ var text = _a.text, _c = _a.color, color = _c === void 0 ? "muted" : _c, _d = _a.isBold, isBold = _d === void 0 ? true : _d, _e = _a.isDarkPathway, isDarkPathway = _e === void 0 ? false : _e;
17
+ return (React__default.createElement(React__default.Fragment, null,
18
+ React__default.createElement("span", { className: classNames("arc-CardLabel", (_b = {},
19
+ _b[suffixModifier("arc-CardLabel--color", color)] = !isDarkPathway,
20
+ _b["arc-CardLabel--bold"] = isBold,
21
+ _b["arc-CardLabel--darkPathway"] = isDarkPathway,
22
+ _b)) }, text)));
23
+ };
24
+
6
25
  const BtIconArrowRight = (props) =>
7
26
  /*#__PURE__*/ React__default.createElement(
8
27
  "svg",
@@ -24,23 +43,4 @@ const BtIconArrowRight = (props) =>
24
43
  }),
25
44
  );
26
45
 
27
- var CardHeading = function (_a) {
28
- var onClick = _a.onClick, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave, onBlur = _a.onBlur, onFocus = _a.onFocus, href = _a.href, heading = _a.heading, _b = _a.size, size = _b === void 0 ? "s" : _b, _c = _a.isDarkPathway, isDarkPathway = _c === void 0 ? false : _c, _d = _a.linkData, linkData = _d === void 0 ? {} : _d, _e = _a.headingLevel, headingLevel = _e === void 0 ? "2" : _e;
29
- var HeadingElement = "h".concat(headingLevel);
30
- return (React__default.createElement(HeadingElement, { className: classNames("arc-CardHeading", "arc-CardHeading--".concat(size), {
31
- "arc-CardHeading--darkPathway": isDarkPathway
32
- }) }, href ? (React__default.createElement("a", __assign({ className: "arc-CardHeading-link", href: href, onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onFocus: onFocus, onBlur: onBlur }, filterDataAttrs(linkData)), heading)) : (heading)));
33
- };
34
-
35
- var CardLabel = function (_a) {
36
- var _b;
37
- var text = _a.text, _c = _a.color, color = _c === void 0 ? "muted" : _c, _d = _a.isBold, isBold = _d === void 0 ? true : _d, _e = _a.isDarkPathway, isDarkPathway = _e === void 0 ? false : _e;
38
- return (React__default.createElement(React__default.Fragment, null,
39
- React__default.createElement("span", { className: classNames("arc-CardLabel", (_b = {},
40
- _b[suffixModifier("arc-CardLabel--color", color)] = !isDarkPathway,
41
- _b["arc-CardLabel--bold"] = isBold,
42
- _b["arc-CardLabel--darkPathway"] = isDarkPathway,
43
- _b)) }, text)));
44
- };
45
-
46
46
  export { BtIconArrowRight as B, CardLabel as C, CardHeading as a };