@arc-ui/components 11.19.0 → 11.21.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 (93) 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/ProgressStepper/ProgressStepper.cjs.js +1 -3
  18. package/dist/ProgressStepper/ProgressStepper.esm.js +1 -3
  19. package/dist/RadioGroup/RadioGroup.cjs.js +2 -2
  20. package/dist/RadioGroup/RadioGroup.esm.js +2 -2
  21. package/dist/Rule/Rule.cjs.js +11 -7
  22. package/dist/Rule/Rule.esm.js +11 -7
  23. package/dist/ScrollToTop/ScrollToTop.cjs.js +1 -1
  24. package/dist/ScrollToTop/ScrollToTop.esm.js +1 -1
  25. package/dist/Select/Select.cjs.js +8 -6
  26. package/dist/Select/Select.esm.js +8 -6
  27. package/dist/SiteHeaderV2/SiteHeaderV2.cjs.js +1 -1
  28. package/dist/SiteHeaderV2/SiteHeaderV2.esm.js +1 -1
  29. package/dist/SkipLink/SkipLink.cjs.js +23 -0
  30. package/dist/SkipLink/SkipLink.esm.js +15 -0
  31. package/dist/SkipLink/package.json +7 -0
  32. package/dist/Switch/Switch.cjs.js +1 -1
  33. package/dist/Switch/Switch.esm.js +1 -1
  34. package/dist/TextArea/TextArea.cjs.js +7 -8
  35. package/dist/TextArea/TextArea.esm.js +7 -8
  36. package/dist/TextInput/TextInput.cjs.js +2 -2
  37. package/dist/TextInput/TextInput.esm.js +2 -2
  38. package/dist/TypographyCard/TypographyCard.cjs.js +4 -4
  39. package/dist/TypographyCard/TypographyCard.esm.js +2 -2
  40. package/dist/_shared/cjs/Avatar-12ece0dd.js +65 -0
  41. package/dist/_shared/cjs/{CardFooter-f6cba651.js → CardFooter-4a68a862.js} +2 -2
  42. package/dist/_shared/cjs/{Checkbox-4d4b432f.js → Checkbox-8915fcd9.js} +1 -1
  43. package/dist/_shared/cjs/ConditionalWrapper-be3b2625.js +14 -0
  44. package/dist/_shared/cjs/{FormControl-b26ad353.js → FormControl-5f3b6ce4.js} +9 -4
  45. package/dist/_shared/cjs/ProgressStepper-20a61620.js +100 -0
  46. package/dist/_shared/cjs/{RadioGroup-60845bb3.js → RadioGroup-07bb155e.js} +3 -2
  47. package/dist/_shared/cjs/{SiteHeaderV2-8c8f3f5c.js → SiteHeaderV2-301c765c.js} +9 -25
  48. package/dist/_shared/cjs/{TextInput-acbd8eda.js → TextInput-5da70ec2.js} +1 -1
  49. package/dist/_shared/esm/Avatar-d01e2b7b.js +59 -0
  50. package/dist/_shared/esm/{CardFooter-55ae9a37.js → CardFooter-a08b70ee.js} +1 -1
  51. package/dist/_shared/esm/{Checkbox-720b074d.js → Checkbox-0e051546.js} +1 -1
  52. package/dist/_shared/esm/ConditionalWrapper-59be8f35.js +8 -0
  53. package/dist/_shared/esm/{FormControl-f0b8fe91.js → FormControl-cc99cde0.js} +9 -4
  54. package/dist/_shared/esm/ProgressStepper-74d48612.js +94 -0
  55. package/dist/_shared/esm/{RadioGroup-d42dba3a.js → RadioGroup-362be63f.js} +3 -2
  56. package/dist/_shared/esm/{SiteHeaderV2-6d0ff35b.js → SiteHeaderV2-0096e25b.js} +9 -25
  57. package/dist/_shared/esm/{TextInput-ddf4cc7a.js → TextInput-1d1c5fd6.js} +1 -1
  58. package/dist/index.es.js +317 -294
  59. package/dist/index.es.js.map +1 -1
  60. package/dist/index.js +317 -292
  61. package/dist/index.js.map +1 -1
  62. package/dist/styles.css +4 -4
  63. package/dist/types/components/Avatar/Avatar.d.ts +13 -0
  64. package/dist/types/components/Avatar/components/AvatarContent/AvatarContent.d.ts +9 -0
  65. package/dist/types/components/Avatar/index.d.ts +1 -0
  66. package/dist/types/components/Avatar/types/avatar-icon-size.d.ts +1 -0
  67. package/dist/types/components/Avatar/types/avatar-image.d.ts +2 -0
  68. package/dist/types/components/Avatar/types/avatar-size.d.ts +1 -0
  69. package/dist/types/components/Avatar/types/avatar-text-size.d.ts +2 -0
  70. package/dist/types/components/AvatarGroup/AvatarGroup.d.ts +13 -0
  71. package/dist/types/components/AvatarGroup/index.d.ts +1 -0
  72. package/dist/types/components/AvatarGroup/types/group-avatar.d.ts +2 -0
  73. package/dist/types/components/AvatarGroup/utils/get-avatars.d.ts +2 -0
  74. package/dist/types/components/ProgressStepper/ProgressStepper.d.ts +1 -1
  75. package/dist/types/components/ProgressStepper/ProgressStepperItem/ProgressStepperItem.d.ts +3 -7
  76. package/dist/types/components/ProgressStepper/ProgressStepperItem/icons/Complete.d.ts +2 -0
  77. package/dist/types/components/ProgressStepper/ProgressStepperItem/icons/Current.d.ts +2 -0
  78. package/dist/types/components/ProgressStepper/ProgressStepperItem/icons/Error.d.ts +2 -0
  79. package/dist/types/components/ProgressStepper/ProgressStepperItem/icons/Todo.d.ts +2 -0
  80. package/dist/types/components/ProgressStepper/ProgressStepperItem/icons/Warning.d.ts +2 -0
  81. package/dist/types/components/Rule/Rule.d.ts +2 -1
  82. package/dist/types/components/Select/Select.d.ts +4 -0
  83. package/dist/types/components/SkipLink/SkipLink.d.ts +11 -0
  84. package/dist/types/components/SkipLink/SkipLinkItem/SkipLinkItem.d.ts +16 -0
  85. package/dist/types/components/SkipLink/index.d.ts +1 -0
  86. package/dist/types/components/index.d.ts +2 -0
  87. package/dist/types/private-components/ConditionalWrapper/ConditionalWrapper.d.ts +1 -0
  88. package/dist/types/styles.d.ts +3 -0
  89. package/package.json +2 -2
  90. package/dist/_shared/cjs/ProgressStepper-3af8a210.js +0 -141
  91. package/dist/_shared/esm/ProgressStepper-d4c5b6d9.js +0 -135
  92. package/dist/_shared/cjs/{CardLabel-768abf20.js → BtIconArrowRight.esm-50d96943.js} +20 -20
  93. 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[];
@@ -22,7 +22,7 @@ export interface ProgressStepperProps {
22
22
  */
23
23
  isFluid?: boolean;
24
24
  /**
25
- * Determine if `<ProgressStepper.Item />` should be able to expand. This only is appliciable when direction is set to vertical
25
+ * <b>DEPRECATED</b>: This will be removed in a future release.
26
26
  */
27
27
  isExpandable?: boolean;
28
28
  }
@@ -1,5 +1,5 @@
1
1
  import { FC, ReactNode } from "react";
2
- import { ProgressStatus } from "../progressStatus";
2
+ import { type ProgressStatus } from "../progressStatus";
3
3
  export declare const ProgressStepperItem: FC<ProgressStepperItemProps>;
4
4
  export interface ProgressStepperItemProps {
5
5
  /**
@@ -27,10 +27,6 @@ export interface ProgressStepperItemProps {
27
27
  * Determine a direction for `<ProgressStepper.Item />`
28
28
  */
29
29
  direction?: "horizontal" | "vertical";
30
- /**
31
- * Determine the position of the step `<ProgressStepper.Item />`
32
- */
33
- position?: "first" | "middle" | "last";
34
30
  /**
35
31
  * Determine a status for `<ProgressStepper.Item />`
36
32
  */
@@ -44,11 +40,11 @@ export interface ProgressStepperItemProps {
44
40
  */
45
41
  isFluid?: boolean;
46
42
  /**
47
- * Determine the context `<ProgressStepper.Item /> should b`
43
+ * Determine the context `<ProgressStepper.Item /> should be`
48
44
  */
49
45
  previousStep?: ProgressStatus;
50
46
  /**
51
- * Determine if `<ProgressStepper.Item /> should have expandable content`
47
+ * DEPRECATED: Determine if `<ProgressStepper.Item /> should have expandable content`
52
48
  */
53
49
  isExpandable?: boolean;
54
50
  /**
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare const Complete: React.FC;
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare const Current: React.FC;
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare const Error: React.FC;
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare const Todo: React.FC;
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare const Warning: React.FC;
@@ -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.21.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,141 +0,0 @@
1
- 'use strict';
2
-
3
- var filterDataAttrs = require('./filter-data-attrs-1c9a530c.js');
4
- var React = require('react');
5
- var index = require('./index-9947ac13.js');
6
- var BtIconAlert_esm = require('./BtIconAlert.esm-1a0ff9f0.js');
7
- var Icon = require('./Icon-b46897a3.js');
8
- var Surface = require('./Surface-038db6e1.js');
9
- var VerticalSpace = require('./VerticalSpace-dc53bb70.js');
10
- var VisuallyHidden = require('./VisuallyHidden-e2c8b291.js');
11
-
12
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
-
14
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
15
-
16
- const BtIconTickVariant = (props) =>
17
- /*#__PURE__*/ React__default["default"].createElement(
18
- "svg",
19
- Object.assign(
20
- {
21
- xmlns: "http://www.w3.org/2000/svg",
22
- viewBox: "0 0 32 32",
23
- },
24
- props,
25
- ),
26
- /*#__PURE__*/ React__default["default"].createElement("defs", null),
27
- /*#__PURE__*/ React__default["default"].createElement("path", {
28
- d: "M13.5,21.207,9.14648,16.85352a.5.5,0,0,1,.707-.707L13.5,19.793l8.64648-8.64649a.5.5,0,0,1,.707.707Z",
29
- fill: "currentColor",
30
- }),
31
- );
32
-
33
- const BtIconCrossAlt = (props) =>
34
- /*#__PURE__*/ React__default["default"].createElement(
35
- "svg",
36
- Object.assign(
37
- {
38
- xmlns: "http://www.w3.org/2000/svg",
39
- viewBox: "0 0 32 32",
40
- },
41
- props,
42
- ),
43
- /*#__PURE__*/ React__default["default"].createElement("defs", null),
44
- /*#__PURE__*/ React__default["default"].createElement("path", {
45
- d: "M16.70709,16.02l4.48236-4.49365a.4996.4996,0,1,0-.707-.70606l-4.481,4.49225-4.481-4.49225a.4996.4996,0,1,0-.707.70606L15.29584,16.02l-4.48236,4.49365a.4996.4996,0,1,0,.707.70606l4.481-4.49225,4.481,4.49225a.4996.4996,0,1,0,.707-.70606Z",
46
- fill: "currentColor",
47
- }),
48
- );
49
-
50
- const BtIconCircle = (props) =>
51
- /*#__PURE__*/ React__default["default"].createElement(
52
- "svg",
53
- Object.assign(
54
- {
55
- viewBox: "0 0 32 32",
56
- fill: "none",
57
- xmlns: "http://www.w3.org/2000/svg",
58
- },
59
- props,
60
- ),
61
- /*#__PURE__*/ React__default["default"].createElement("path", {
62
- fillRule: "evenodd",
63
- clipRule: "evenodd",
64
- d: "M9 16C9 19.87 12.13 23 16 23C19.87 23 23 19.87 23 16C23 12.13 19.87 9 16 9C12.13 9 9 12.13 9 16ZM16 7C11.03 7 7 11.03 7 16C7 20.97 11.03 25 16 25C20.97 25 25 20.97 25 16C25 11.03 20.97 7 16 7Z",
65
- fill: "currentColor",
66
- }),
67
- );
68
-
69
- var ProgressStepperItem = function (_a) {
70
- var _b, _c, _d;
71
- var title = _a.title, titleHref = _a.titleHref, subTitle = _a.subTitle, _e = _a.direction, direction = _e === void 0 ? "horizontal" : _e, _f = _a.status, status = _f === void 0 ? "todo" : _f, _g = _a.size, size = _g === void 0 ? "large" : _g, _h = _a.position, position = _h === void 0 ? "middle" : _h, isFluid = _a.isFluid, ariaLabel = _a.ariaLabel, onClick = _a.onClick, previousStep = _a.previousStep, isExpandable = _a.isExpandable, stepContent = _a.stepContent, isStepContentHidden = _a.isStepContentHidden, props = filterDataAttrs.__rest(_a, ["title", "titleHref", "subTitle", "direction", "status", "size", "position", "isFluid", "ariaLabel", "onClick", "previousStep", "isExpandable", "stepContent", "isStepContentHidden"]);
72
- var surface = React.useContext(Surface.Context).surface;
73
- var statusIcons = {
74
- completed: BtIconTickVariant,
75
- current: BtIconCircle,
76
- warning: BtIconAlert_esm.BtIconAlert,
77
- error: BtIconCrossAlt
78
- };
79
- var onClickHandler = function (event) {
80
- event.preventDefault();
81
- onClick && onClick();
82
- };
83
- var capitaliseFirstLetter = function (word) {
84
- return word.charAt(0).toUpperCase() + word.slice(1);
85
- };
86
- return (React__default["default"].createElement("div", filterDataAttrs.__assign({ className: index.classNames("arc-ProgressStepperItem", (_b = {
87
- "arc-ProgressStepperItem--vertical": direction === "vertical",
88
- "arc-ProgressStepperItem--isFluid": isFluid,
89
- "arc-ProgressStepperItem--onDarkSurface": surface === "dark",
90
- "arc-ProgressStepperItem--previousStepCompleted": previousStep === "completed"
91
- },
92
- _b["arc-ProgressStepperItem--".concat(size)] = size === "small",
93
- _b)) }, filterDataAttrs.filterDataAttrs(props)),
94
- React__default["default"].createElement("div", { className: index.classNames("arc-ProgressStepperItem-iconSection", (_c = {},
95
- _c["arc-ProgressStepperItem-iconSection--".concat(position)] = position !== "middle",
96
- _c)) },
97
- React__default["default"].createElement("div", { className: "arc-ProgressStepperItem-iconSectionTrailBefore" }),
98
- React__default["default"].createElement("div", { className: index.classNames("arc-ProgressStepperItem-iconWrapper", (_d = {},
99
- _d["arc-ProgressStepperItem-iconWrapper--".concat(status)] = status !== "todo",
100
- _d)), "data-testid": "arc-ProgressStepperItem-iconWrapper" }, statusIcons[status] === undefined ? (React__default["default"].createElement("div", { style: {
101
- width: size === "small" ? "16px" : "32px",
102
- height: size === "small" ? "16px" : "32px"
103
- } })) : (React__default["default"].createElement(Icon.Icon, { size: size === "small" ? 16 : 32, icon: statusIcons[status] }))),
104
- React__default["default"].createElement("div", { className: "arc-ProgressStepperItem-iconSectionTrailAfter" })),
105
- React__default["default"].createElement("div", { className: "arc-ProgressStepperItem-textSection" },
106
- status !== "todo" && (React__default["default"].createElement(VisuallyHidden.VisuallyHidden, null,
107
- capitaliseFirstLetter(status),
108
- ":")),
109
- titleHref ? (React__default["default"].createElement("a", { href: titleHref, "aria-label": ariaLabel, className: "arc-ProgressStepperItem-title", onClick: onClickHandler }, title)) : (React__default["default"].createElement("div", { className: "arc-ProgressStepperItem-title" }, title)),
110
- React__default["default"].createElement("div", { className: "arc-ProgressStepperItem-subTitle" }, subTitle),
111
- isExpandable && direction === "vertical" && (React__default["default"].createElement(React__default["default"].Fragment, null,
112
- React__default["default"].createElement("div", { className: "arc-ProgressStepperItem-nodeItem" },
113
- React__default["default"].createElement("div", { className: "arc-ProgressStepperItem-keyline" }),
114
- stepContent && !isStepContentHidden && (React__default["default"].createElement(React__default["default"].Fragment, null,
115
- React__default["default"].createElement(VerticalSpace.VerticalSpace, { size: "8" }),
116
- stepContent))))))));
117
- };
118
-
119
- /** Use `ProgressStepper` to illustrate the progress of a specific task within a page, by displaying a step-by-step progress through the user journey. This is commonly used in multi-step processes or wizards. */
120
- var ProgressStepper = function (_a) {
121
- var children = _a.children, size = _a.size, isFluid = _a.isFluid, direction = _a.direction, isExpandable = _a.isExpandable, props = filterDataAttrs.__rest(_a, ["children", "size", "isFluid", "direction", "isExpandable"]);
122
- var items = React__default["default"].Children.toArray(children);
123
- var getStepStatus = function (item) {
124
- var _a;
125
- return (_a = item === null || item === void 0 ? void 0 : item.props) === null || _a === void 0 ? void 0 : _a.status;
126
- };
127
- return (React__default["default"].createElement("div", filterDataAttrs.__assign({ className: index.classNames("arc-ProgressStepper", {
128
- "arc-ProgressStepper--vertical": direction === "vertical"
129
- }) }, filterDataAttrs.filterDataAttrs(props)), items.map(function (item, index) {
130
- var currentPosition = index === 0
131
- ? "first"
132
- : index === React__default["default"].Children.count(children) - 1
133
- ? "last"
134
- : undefined;
135
- return (React__default["default"].createElement(React__default["default"].Fragment, { key: "StepperItem-".concat(index) },
136
- React__default["default"].createElement(ProgressStepperItem, filterDataAttrs.__assign({ title: item.props.title, titleHref: item.props.titleHref, subTitle: item.props.subTitle, status: item.props.status, stepContent: item.props.stepContent, isStepContentHidden: item.props.isStepContentHidden, onClick: item.props.onClick, isFluid: isFluid, direction: direction, isExpandable: isExpandable, size: size, position: currentPosition, previousStep: getStepStatus(items[index - 1]) }, filterDataAttrs.filterDataAttrs(item.props)))));
137
- })));
138
- };
139
- ProgressStepper.Item = ProgressStepperItem;
140
-
141
- exports.ProgressStepper = ProgressStepper;
@@ -1,135 +0,0 @@
1
- import { _ as __rest, a as __assign, f as filterDataAttrs } from './filter-data-attrs-ea8f4ed4.js';
2
- import React__default, { useContext } from 'react';
3
- import { c as classNames } from './index-2e73c2e9.js';
4
- import { B as BtIconAlert } from './BtIconAlert.esm-a4608d47.js';
5
- import { I as Icon } from './Icon-15799695.js';
6
- import { C as Context } from './Surface-0ca6817d.js';
7
- import { V as VerticalSpace } from './VerticalSpace-43cd9138.js';
8
- import { V as VisuallyHidden } from './VisuallyHidden-b9eebf71.js';
9
-
10
- const BtIconTickVariant = (props) =>
11
- /*#__PURE__*/ React__default.createElement(
12
- "svg",
13
- Object.assign(
14
- {
15
- xmlns: "http://www.w3.org/2000/svg",
16
- viewBox: "0 0 32 32",
17
- },
18
- props,
19
- ),
20
- /*#__PURE__*/ React__default.createElement("defs", null),
21
- /*#__PURE__*/ React__default.createElement("path", {
22
- d: "M13.5,21.207,9.14648,16.85352a.5.5,0,0,1,.707-.707L13.5,19.793l8.64648-8.64649a.5.5,0,0,1,.707.707Z",
23
- fill: "currentColor",
24
- }),
25
- );
26
-
27
- const BtIconCrossAlt = (props) =>
28
- /*#__PURE__*/ React__default.createElement(
29
- "svg",
30
- Object.assign(
31
- {
32
- xmlns: "http://www.w3.org/2000/svg",
33
- viewBox: "0 0 32 32",
34
- },
35
- props,
36
- ),
37
- /*#__PURE__*/ React__default.createElement("defs", null),
38
- /*#__PURE__*/ React__default.createElement("path", {
39
- d: "M16.70709,16.02l4.48236-4.49365a.4996.4996,0,1,0-.707-.70606l-4.481,4.49225-4.481-4.49225a.4996.4996,0,1,0-.707.70606L15.29584,16.02l-4.48236,4.49365a.4996.4996,0,1,0,.707.70606l4.481-4.49225,4.481,4.49225a.4996.4996,0,1,0,.707-.70606Z",
40
- fill: "currentColor",
41
- }),
42
- );
43
-
44
- const BtIconCircle = (props) =>
45
- /*#__PURE__*/ React__default.createElement(
46
- "svg",
47
- Object.assign(
48
- {
49
- viewBox: "0 0 32 32",
50
- fill: "none",
51
- xmlns: "http://www.w3.org/2000/svg",
52
- },
53
- props,
54
- ),
55
- /*#__PURE__*/ React__default.createElement("path", {
56
- fillRule: "evenodd",
57
- clipRule: "evenodd",
58
- d: "M9 16C9 19.87 12.13 23 16 23C19.87 23 23 19.87 23 16C23 12.13 19.87 9 16 9C12.13 9 9 12.13 9 16ZM16 7C11.03 7 7 11.03 7 16C7 20.97 11.03 25 16 25C20.97 25 25 20.97 25 16C25 11.03 20.97 7 16 7Z",
59
- fill: "currentColor",
60
- }),
61
- );
62
-
63
- var ProgressStepperItem = function (_a) {
64
- var _b, _c, _d;
65
- var title = _a.title, titleHref = _a.titleHref, subTitle = _a.subTitle, _e = _a.direction, direction = _e === void 0 ? "horizontal" : _e, _f = _a.status, status = _f === void 0 ? "todo" : _f, _g = _a.size, size = _g === void 0 ? "large" : _g, _h = _a.position, position = _h === void 0 ? "middle" : _h, isFluid = _a.isFluid, ariaLabel = _a.ariaLabel, onClick = _a.onClick, previousStep = _a.previousStep, isExpandable = _a.isExpandable, stepContent = _a.stepContent, isStepContentHidden = _a.isStepContentHidden, props = __rest(_a, ["title", "titleHref", "subTitle", "direction", "status", "size", "position", "isFluid", "ariaLabel", "onClick", "previousStep", "isExpandable", "stepContent", "isStepContentHidden"]);
66
- var surface = useContext(Context).surface;
67
- var statusIcons = {
68
- completed: BtIconTickVariant,
69
- current: BtIconCircle,
70
- warning: BtIconAlert,
71
- error: BtIconCrossAlt
72
- };
73
- var onClickHandler = function (event) {
74
- event.preventDefault();
75
- onClick && onClick();
76
- };
77
- var capitaliseFirstLetter = function (word) {
78
- return word.charAt(0).toUpperCase() + word.slice(1);
79
- };
80
- return (React__default.createElement("div", __assign({ className: classNames("arc-ProgressStepperItem", (_b = {
81
- "arc-ProgressStepperItem--vertical": direction === "vertical",
82
- "arc-ProgressStepperItem--isFluid": isFluid,
83
- "arc-ProgressStepperItem--onDarkSurface": surface === "dark",
84
- "arc-ProgressStepperItem--previousStepCompleted": previousStep === "completed"
85
- },
86
- _b["arc-ProgressStepperItem--".concat(size)] = size === "small",
87
- _b)) }, filterDataAttrs(props)),
88
- React__default.createElement("div", { className: classNames("arc-ProgressStepperItem-iconSection", (_c = {},
89
- _c["arc-ProgressStepperItem-iconSection--".concat(position)] = position !== "middle",
90
- _c)) },
91
- React__default.createElement("div", { className: "arc-ProgressStepperItem-iconSectionTrailBefore" }),
92
- React__default.createElement("div", { className: classNames("arc-ProgressStepperItem-iconWrapper", (_d = {},
93
- _d["arc-ProgressStepperItem-iconWrapper--".concat(status)] = status !== "todo",
94
- _d)), "data-testid": "arc-ProgressStepperItem-iconWrapper" }, statusIcons[status] === undefined ? (React__default.createElement("div", { style: {
95
- width: size === "small" ? "16px" : "32px",
96
- height: size === "small" ? "16px" : "32px"
97
- } })) : (React__default.createElement(Icon, { size: size === "small" ? 16 : 32, icon: statusIcons[status] }))),
98
- React__default.createElement("div", { className: "arc-ProgressStepperItem-iconSectionTrailAfter" })),
99
- React__default.createElement("div", { className: "arc-ProgressStepperItem-textSection" },
100
- status !== "todo" && (React__default.createElement(VisuallyHidden, null,
101
- capitaliseFirstLetter(status),
102
- ":")),
103
- titleHref ? (React__default.createElement("a", { href: titleHref, "aria-label": ariaLabel, className: "arc-ProgressStepperItem-title", onClick: onClickHandler }, title)) : (React__default.createElement("div", { className: "arc-ProgressStepperItem-title" }, title)),
104
- React__default.createElement("div", { className: "arc-ProgressStepperItem-subTitle" }, subTitle),
105
- isExpandable && direction === "vertical" && (React__default.createElement(React__default.Fragment, null,
106
- React__default.createElement("div", { className: "arc-ProgressStepperItem-nodeItem" },
107
- React__default.createElement("div", { className: "arc-ProgressStepperItem-keyline" }),
108
- stepContent && !isStepContentHidden && (React__default.createElement(React__default.Fragment, null,
109
- React__default.createElement(VerticalSpace, { size: "8" }),
110
- stepContent))))))));
111
- };
112
-
113
- /** Use `ProgressStepper` to illustrate the progress of a specific task within a page, by displaying a step-by-step progress through the user journey. This is commonly used in multi-step processes or wizards. */
114
- var ProgressStepper = function (_a) {
115
- var children = _a.children, size = _a.size, isFluid = _a.isFluid, direction = _a.direction, isExpandable = _a.isExpandable, props = __rest(_a, ["children", "size", "isFluid", "direction", "isExpandable"]);
116
- var items = React__default.Children.toArray(children);
117
- var getStepStatus = function (item) {
118
- var _a;
119
- return (_a = item === null || item === void 0 ? void 0 : item.props) === null || _a === void 0 ? void 0 : _a.status;
120
- };
121
- return (React__default.createElement("div", __assign({ className: classNames("arc-ProgressStepper", {
122
- "arc-ProgressStepper--vertical": direction === "vertical"
123
- }) }, filterDataAttrs(props)), items.map(function (item, index) {
124
- var currentPosition = index === 0
125
- ? "first"
126
- : index === React__default.Children.count(children) - 1
127
- ? "last"
128
- : undefined;
129
- return (React__default.createElement(React__default.Fragment, { key: "StepperItem-".concat(index) },
130
- React__default.createElement(ProgressStepperItem, __assign({ title: item.props.title, titleHref: item.props.titleHref, subTitle: item.props.subTitle, status: item.props.status, stepContent: item.props.stepContent, isStepContentHidden: item.props.isStepContentHidden, onClick: item.props.onClick, isFluid: isFluid, direction: direction, isExpandable: isExpandable, size: size, position: currentPosition, previousStep: getStepStatus(items[index - 1]) }, filterDataAttrs(item.props)))));
131
- })));
132
- };
133
- ProgressStepper.Item = ProgressStepperItem;
134
-
135
- export { ProgressStepper as P };
@@ -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;