@arc-ui/components 11.8.0 → 11.9.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 (42) hide show
  1. package/dist/Badge/Badge.cjs.d.ts +4 -0
  2. package/dist/Badge/Badge.cjs.js +3 -3
  3. package/dist/Badge/Badge.esm.d.ts +4 -0
  4. package/dist/Badge/Badge.esm.js +3 -3
  5. package/dist/ProgressStepper/ProgressStepper.cjs.d.ts +1 -89
  6. package/dist/ProgressStepper/ProgressStepper.cjs.js +10 -144
  7. package/dist/ProgressStepper/ProgressStepper.esm.d.ts +1 -89
  8. package/dist/ProgressStepper/ProgressStepper.esm.js +9 -143
  9. package/dist/Tabs/Tabs.cjs.d.ts +1 -75
  10. package/dist/Tabs/Tabs.cjs.js +11 -505
  11. package/dist/Tabs/Tabs.esm.d.ts +1 -75
  12. package/dist/Tabs/Tabs.esm.js +10 -504
  13. package/dist/TextArea/TextArea.cjs.js +20 -8
  14. package/dist/TextArea/TextArea.esm.js +20 -8
  15. package/dist/Toast/Toast.cjs.d.ts +1 -52
  16. package/dist/Toast/Toast.cjs.js +14 -734
  17. package/dist/Toast/Toast.esm.d.ts +1 -52
  18. package/dist/Toast/Toast.esm.js +13 -733
  19. package/dist/_shared/cjs/MediaCard-9483ad5f.d.ts +60 -0
  20. package/dist/_shared/cjs/ProgressStepper-f740d7bb.d.ts +89 -0
  21. package/dist/_shared/cjs/ProgressStepper-f740d7bb.js +149 -0
  22. package/dist/_shared/cjs/Tabs-fda49692.d.ts +75 -0
  23. package/dist/_shared/cjs/Tabs-fda49692.js +510 -0
  24. package/dist/_shared/cjs/Toast-0cb23cae.d.ts +52 -0
  25. package/dist/_shared/cjs/Toast-0cb23cae.js +739 -0
  26. package/dist/_shared/esm/MediaCard-9483ad5f.d.ts +60 -0
  27. package/dist/_shared/esm/ProgressStepper-7ab88f4c.d.ts +89 -0
  28. package/dist/_shared/esm/ProgressStepper-7ab88f4c.js +143 -0
  29. package/dist/_shared/esm/Tabs-5af0b940.d.ts +75 -0
  30. package/dist/_shared/esm/Tabs-5af0b940.js +504 -0
  31. package/dist/_shared/esm/Toast-43795e91.d.ts +52 -0
  32. package/dist/_shared/esm/Toast-43795e91.js +733 -0
  33. package/dist/index.es.js +2312 -407
  34. package/dist/index.es.js.map +1 -1
  35. package/dist/index.js +2667 -751
  36. package/dist/index.js.map +1 -1
  37. package/dist/styles.css +1 -1
  38. package/dist/types/components/Badge/Badge.d.ts +4 -0
  39. package/dist/types/components/Toast/Toast.d.ts +2 -2
  40. package/dist/types/components/Toast/ToastNotification.d.ts +1 -1
  41. package/dist/types/components/index.d.ts +17 -6
  42. package/package.json +4 -4
@@ -22,5 +22,9 @@ interface BadgeProps {
22
22
  * Aria label for accessibility
23
23
  */
24
24
  ariaLabel?: string;
25
+ /**
26
+ * Aria Role for accessibility
27
+ */
28
+ ariaRole?: "status" | "alert";
25
29
  }
26
30
  export { Badge };
@@ -16,16 +16,16 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
16
16
  /** Use `Badge` component to visually display a small amount of information, such as notification counts or status indicators. */
17
17
  var Badge = function (_a) {
18
18
  var _b, _c;
19
- var children = _a.children, _d = _a.state, state = _d === void 0 ? "default" : _d, _e = _a.size, size = _e === void 0 ? "default" : _e, _f = _a.fill, fill = _f === void 0 ? "solid" : _f, ariaLabel = _a.ariaLabel, props = filterDataAttrs.__rest(_a, ["children", "state", "size", "fill", "ariaLabel"]);
19
+ var children = _a.children, _d = _a.state, state = _d === void 0 ? "default" : _d, _e = _a.size, size = _e === void 0 ? "default" : _e, _f = _a.fill, fill = _f === void 0 ? "solid" : _f, ariaLabel = _a.ariaLabel, ariaRole = _a.ariaRole, props = filterDataAttrs.__rest(_a, ["children", "state", "size", "fill", "ariaLabel", "ariaRole"]);
20
20
  var surface = React.useContext(Surface.Context).surface;
21
- return (React__default["default"].createElement("div", filterDataAttrs.__assign({}, (ariaLabel && { "aria-label": ariaLabel }), { className: index.classNames((_b = {
21
+ return (React__default["default"].createElement("div", filterDataAttrs.__assign({ className: index.classNames((_b = {
22
22
  "arc-Badge": true,
23
23
  "arc-Badge--onDarkSurface": surface === "dark",
24
24
  "arc-Badge--large": size === "large",
25
25
  "arc-Badge--outline": fill === "outlined"
26
26
  },
27
27
  _b[suffixModifier.suffixModifier("arc-Badge--state", state)] = state !== "default",
28
- _b)), role: state === "error" ? "alert" : "status" }, filterDataAttrs.filterDataAttrs(props)),
28
+ _b)) }, (ariaLabel && { "aria-label": ariaLabel }), (ariaRole && { role: ariaRole }), filterDataAttrs.filterDataAttrs(props)),
29
29
  React__default["default"].createElement("div", { className: index.classNames((_c = {
30
30
  "arc-Badge-text": true
31
31
  },
@@ -22,5 +22,9 @@ interface BadgeProps {
22
22
  * Aria label for accessibility
23
23
  */
24
24
  ariaLabel?: string;
25
+ /**
26
+ * Aria Role for accessibility
27
+ */
28
+ ariaRole?: "status" | "alert";
25
29
  }
26
30
  export { Badge };
@@ -8,16 +8,16 @@ import { T as Text } from '../_shared/esm/Text-40457811.js';
8
8
  /** Use `Badge` component to visually display a small amount of information, such as notification counts or status indicators. */
9
9
  var Badge = function (_a) {
10
10
  var _b, _c;
11
- var children = _a.children, _d = _a.state, state = _d === void 0 ? "default" : _d, _e = _a.size, size = _e === void 0 ? "default" : _e, _f = _a.fill, fill = _f === void 0 ? "solid" : _f, ariaLabel = _a.ariaLabel, props = __rest(_a, ["children", "state", "size", "fill", "ariaLabel"]);
11
+ var children = _a.children, _d = _a.state, state = _d === void 0 ? "default" : _d, _e = _a.size, size = _e === void 0 ? "default" : _e, _f = _a.fill, fill = _f === void 0 ? "solid" : _f, ariaLabel = _a.ariaLabel, ariaRole = _a.ariaRole, props = __rest(_a, ["children", "state", "size", "fill", "ariaLabel", "ariaRole"]);
12
12
  var surface = useContext(Context).surface;
13
- return (React__default.createElement("div", __assign({}, (ariaLabel && { "aria-label": ariaLabel }), { className: classNames((_b = {
13
+ return (React__default.createElement("div", __assign({ className: classNames((_b = {
14
14
  "arc-Badge": true,
15
15
  "arc-Badge--onDarkSurface": surface === "dark",
16
16
  "arc-Badge--large": size === "large",
17
17
  "arc-Badge--outline": fill === "outlined"
18
18
  },
19
19
  _b[suffixModifier("arc-Badge--state", state)] = state !== "default",
20
- _b)), role: state === "error" ? "alert" : "status" }, filterDataAttrs(props)),
20
+ _b)) }, (ariaLabel && { "aria-label": ariaLabel }), (ariaRole && { role: ariaRole }), filterDataAttrs(props)),
21
21
  React__default.createElement("div", { className: classNames((_c = {
22
22
  "arc-Badge-text": true
23
23
  },
@@ -1,89 +1 @@
1
- import { FC, ReactNode } from "react";
2
- type ProgressStatus = "completed" | "current" | "warning" | "error" | "todo";
3
- declare const ProgressStepperItem: FC<ProgressStepperItemProps>;
4
- interface ProgressStepperItemProps {
5
- /**
6
- * Determine a title for `<ProgressStepper.Item />`
7
- */
8
- title: string;
9
- /**
10
- * Determine a title for `<ProgressStepper.Item />`
11
- */
12
- titleHref?: string;
13
- /**
14
- * Text to override `linkTitle` with additional, more precise information
15
- * specifically for screen reader users.
16
- */
17
- ariaLabel?: string;
18
- /**
19
- * Execute a function on title click `<ProgressStepper.Item />`
20
- */
21
- onClick?: () => void;
22
- /**
23
- * Determine a sub title for `<ProgressStepper.Item />`
24
- */
25
- subTitle?: string;
26
- /**
27
- * Determine a direction for `<ProgressStepper.Item />`
28
- */
29
- direction?: "horizontal" | "vertical";
30
- /**
31
- * Determine the position of the step `<ProgressStepper.Item />`
32
- */
33
- position?: "first" | "middle" | "last";
34
- /**
35
- * Determine a status for `<ProgressStepper.Item />`
36
- */
37
- status?: ProgressStatus;
38
- /**
39
- * Determine the size for `<ProgressStepper.Item />`
40
- */
41
- size?: "small" | "large";
42
- /**
43
- * Determine if `<ProgressStepper.Item /> should be Fluid`
44
- */
45
- isFluid?: boolean;
46
- /**
47
- * Determine the context `<ProgressStepper.Item /> should b`
48
- */
49
- previousStep?: ProgressStatus;
50
- /**
51
- * Determine if `<ProgressStepper.Item /> should have expandable content`
52
- */
53
- isExpandable?: boolean;
54
- /**
55
- * Determine what content to display in `<ProgressStepper.Item />. To use this option isExpandable must be `true``
56
- */
57
- stepContent?: ReactNode;
58
- /**
59
- * Determine if `stepContent` is hidden
60
- */
61
- isStepContentHidden?: boolean;
62
- }
63
- /** 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. */
64
- declare const ProgressStepper: FC<ProgressStepperProps> & {
65
- Item: typeof ProgressStepperItem;
66
- };
67
- interface ProgressStepperProps {
68
- /**
69
- * Children of `<ProgressStepper />` should only contain `<ProgressStepper.Item />`
70
- */
71
- children?: ReactNode;
72
- /**
73
- * Determine a direction for `<ProgressStepper.Item />`
74
- */
75
- direction?: "horizontal" | "vertical";
76
- /**
77
- * Determine the size for `<ProgressStepper.Item />`
78
- */
79
- size?: "small" | "large";
80
- /**
81
- * Determine if `<ProgressStepper.Item />` should be Fluid. Only appliciable for `horizontal direction.`
82
- */
83
- isFluid?: boolean;
84
- /**
85
- * Determine if `<ProgressStepper.Item />` should be able to expand. This only is appliciable when direction is set to vertical
86
- */
87
- isExpandable?: boolean;
88
- }
89
- export { ProgressStepper };
1
+ export { ProgressStepper } from "../_shared/cjs/ProgressStepper-f740d7bb";
@@ -2,151 +2,17 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var filterDataAttrs = require('../_shared/cjs/filter-data-attrs-a30dcf5f.js');
6
- var React$3 = require('react');
7
- var index = require('../_shared/cjs/index-45bfb67b.js');
8
- var BtIconAlert = require('../_shared/cjs/BtIconAlert-637db790.js');
9
- var Icon = require('../_shared/cjs/Icon-e1dd45eb.js');
10
- var Surface = require('../_shared/cjs/Surface-b7c51b2b.js');
11
- var VerticalSpace = require('../_shared/cjs/VerticalSpace-86f697e7.js');
12
- var VisuallyHidden = require('../_shared/cjs/VisuallyHidden-e2c8b291.js');
5
+ var ProgressStepper = require('../_shared/cjs/ProgressStepper-f740d7bb.js');
6
+ require('../_shared/cjs/filter-data-attrs-a30dcf5f.js');
7
+ require('react');
8
+ require('../_shared/cjs/index-45bfb67b.js');
9
+ require('../_shared/cjs/BtIconAlert-637db790.js');
10
+ require('../_shared/cjs/Icon-e1dd45eb.js');
13
11
  require('../_shared/cjs/suffix-modifier-1ee2da04.js');
12
+ require('../_shared/cjs/Surface-b7c51b2b.js');
13
+ require('../_shared/cjs/VerticalSpace-86f697e7.js');
14
+ require('../_shared/cjs/VisuallyHidden-e2c8b291.js');
14
15
 
15
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
16
16
 
17
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React$3);
18
17
 
19
- const React$2 = React__default["default"];
20
- const BtIconTickVariant = props =>
21
- /*#__PURE__*/ React$2.createElement(
22
- "svg",
23
- Object.assign(
24
- {
25
- xmlns: "http://www.w3.org/2000/svg",
26
- viewBox: "0 0 32 32"
27
- },
28
- props
29
- ),
30
- /*#__PURE__*/ React$2.createElement("defs", null),
31
- /*#__PURE__*/ React$2.createElement("path", {
32
- d:
33
- "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",
34
- fill: "currentColor"
35
- })
36
- );
37
- var BtIconTickVariant_2 = BtIconTickVariant;
38
-
39
- const React$1 = React__default["default"];
40
- const BtIconCrossAlt = props =>
41
- /*#__PURE__*/ React$1.createElement(
42
- "svg",
43
- Object.assign(
44
- {
45
- xmlns: "http://www.w3.org/2000/svg",
46
- viewBox: "0 0 32 32"
47
- },
48
- props
49
- ),
50
- /*#__PURE__*/ React$1.createElement("defs", null),
51
- /*#__PURE__*/ React$1.createElement("path", {
52
- d:
53
- "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",
54
- fill: "currentColor"
55
- })
56
- );
57
- var BtIconCrossAlt_2 = BtIconCrossAlt;
58
-
59
- const React = React__default["default"];
60
- const BtIconCircle = props =>
61
- /*#__PURE__*/ React.createElement(
62
- "svg",
63
- Object.assign(
64
- {
65
- viewBox: "0 0 32 32",
66
- fill: "none",
67
- xmlns: "http://www.w3.org/2000/svg"
68
- },
69
- props
70
- ),
71
- /*#__PURE__*/ React.createElement("path", {
72
- fillRule: "evenodd",
73
- clipRule: "evenodd",
74
- d:
75
- "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",
76
- fill: "currentColor"
77
- })
78
- );
79
- var BtIconCircle_2 = BtIconCircle;
80
-
81
- var ProgressStepperItem = function (_a) {
82
- var _b, _c;
83
- var title = _a.title, titleHref = _a.titleHref, subTitle = _a.subTitle, _d = _a.direction, direction = _d === void 0 ? "horizontal" : _d, _e = _a.status, status = _e === void 0 ? "todo" : _e, _f = _a.size, size = _f === void 0 ? "large" : _f, _g = _a.position, position = _g === void 0 ? "middle" : _g, 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"]);
84
- var surface = React$3.useContext(Surface.Context).surface;
85
- var statusIcons = {
86
- completed: BtIconTickVariant_2,
87
- current: BtIconCircle_2,
88
- warning: BtIconAlert.BtIconAlert_2,
89
- error: BtIconCrossAlt_2
90
- };
91
- var onClickHandler = function (event) {
92
- event.preventDefault();
93
- onClick && onClick();
94
- };
95
- var capitaliseFirstLetter = function (word) {
96
- return word.charAt(0).toUpperCase() + word.slice(1);
97
- };
98
- return (React__default["default"].createElement("div", filterDataAttrs.__assign({ className: index.classNames("arc-ProgressStepperItem", (_b = {
99
- "arc-ProgressStepperItem--vertical": direction === "vertical",
100
- "arc-ProgressStepperItem--isFluid": isFluid,
101
- "arc-ProgressStepperItem--onDarkSurface": surface === "dark",
102
- "arc-ProgressStepperItem--previousStepCompleted": previousStep === "completed"
103
- },
104
- _b["arc-ProgressStepperItem--".concat(status)] = status !== "todo",
105
- _b["arc-ProgressStepperItem--".concat(size)] = size === "small",
106
- _b)) }, filterDataAttrs.filterDataAttrs(props)),
107
- React__default["default"].createElement("div", { className: index.classNames("arc-ProgressStepperItem-iconSection", (_c = {},
108
- _c["arc-ProgressStepperItem-iconSection--".concat(position)] = position !== "middle",
109
- _c)) },
110
- React__default["default"].createElement("div", { className: "arc-ProgressStepperItem-iconSectionTrailBefore" }),
111
- React__default["default"].createElement("div", { className: "arc-ProgressStepperItem-iconWrapper" }, statusIcons[status] === undefined ? (React__default["default"].createElement("div", { style: {
112
- width: size === "small" ? "16px" : "32px",
113
- height: size === "small" ? "16px" : "32px"
114
- } })) : (React__default["default"].createElement(Icon.Icon, { size: size === "small" ? 16 : 32, icon: statusIcons[status] }))),
115
- React__default["default"].createElement("div", { className: "arc-ProgressStepperItem-iconSectionTrailAfter" })),
116
- React__default["default"].createElement("div", { className: "arc-ProgressStepperItem-textSection" },
117
- status !== "todo" && (React__default["default"].createElement(VisuallyHidden.VisuallyHidden, null,
118
- capitaliseFirstLetter(status),
119
- ":")),
120
- 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)),
121
- React__default["default"].createElement("div", { className: "arc-ProgressStepperItem-subTitle" }, subTitle),
122
- isExpandable && direction === "vertical" && (React__default["default"].createElement(React__default["default"].Fragment, null,
123
- React__default["default"].createElement("div", { className: "arc-ProgressStepperItem-nodeItem" },
124
- React__default["default"].createElement("div", { className: "arc-ProgressStepperItem-keyline" }),
125
- stepContent && !isStepContentHidden && (React__default["default"].createElement(React__default["default"].Fragment, null,
126
- React__default["default"].createElement(VerticalSpace.VerticalSpace, { size: "8" }),
127
- stepContent))))))));
128
- };
129
-
130
- /** 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. */
131
- var ProgressStepper = function (_a) {
132
- 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"]);
133
- var items = React__default["default"].Children.toArray(children);
134
- var getStepStatus = function (item) {
135
- var _a;
136
- return (_a = item === null || item === void 0 ? void 0 : item.props) === null || _a === void 0 ? void 0 : _a.status;
137
- };
138
- return (React__default["default"].createElement("div", filterDataAttrs.__assign({ className: index.classNames("arc-ProgressStepper", {
139
- "arc-ProgressStepper--vertical": direction === "vertical"
140
- }) }, filterDataAttrs.filterDataAttrs(props)), items.map(function (item, index) {
141
- var currentPosition = index === 0
142
- ? "first"
143
- : index === React__default["default"].Children.count(children) - 1
144
- ? "last"
145
- : undefined;
146
- return (React__default["default"].createElement(React__default["default"].Fragment, { key: "StepperItem-".concat(index) },
147
- 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)))));
148
- })));
149
- };
150
- ProgressStepper.Item = ProgressStepperItem;
151
-
152
- exports.ProgressStepper = ProgressStepper;
18
+ exports.ProgressStepper = ProgressStepper.ProgressStepper;
@@ -1,89 +1 @@
1
- import { FC, ReactNode } from "react";
2
- type ProgressStatus = "completed" | "current" | "warning" | "error" | "todo";
3
- declare const ProgressStepperItem: FC<ProgressStepperItemProps>;
4
- interface ProgressStepperItemProps {
5
- /**
6
- * Determine a title for `<ProgressStepper.Item />`
7
- */
8
- title: string;
9
- /**
10
- * Determine a title for `<ProgressStepper.Item />`
11
- */
12
- titleHref?: string;
13
- /**
14
- * Text to override `linkTitle` with additional, more precise information
15
- * specifically for screen reader users.
16
- */
17
- ariaLabel?: string;
18
- /**
19
- * Execute a function on title click `<ProgressStepper.Item />`
20
- */
21
- onClick?: () => void;
22
- /**
23
- * Determine a sub title for `<ProgressStepper.Item />`
24
- */
25
- subTitle?: string;
26
- /**
27
- * Determine a direction for `<ProgressStepper.Item />`
28
- */
29
- direction?: "horizontal" | "vertical";
30
- /**
31
- * Determine the position of the step `<ProgressStepper.Item />`
32
- */
33
- position?: "first" | "middle" | "last";
34
- /**
35
- * Determine a status for `<ProgressStepper.Item />`
36
- */
37
- status?: ProgressStatus;
38
- /**
39
- * Determine the size for `<ProgressStepper.Item />`
40
- */
41
- size?: "small" | "large";
42
- /**
43
- * Determine if `<ProgressStepper.Item /> should be Fluid`
44
- */
45
- isFluid?: boolean;
46
- /**
47
- * Determine the context `<ProgressStepper.Item /> should b`
48
- */
49
- previousStep?: ProgressStatus;
50
- /**
51
- * Determine if `<ProgressStepper.Item /> should have expandable content`
52
- */
53
- isExpandable?: boolean;
54
- /**
55
- * Determine what content to display in `<ProgressStepper.Item />. To use this option isExpandable must be `true``
56
- */
57
- stepContent?: ReactNode;
58
- /**
59
- * Determine if `stepContent` is hidden
60
- */
61
- isStepContentHidden?: boolean;
62
- }
63
- /** 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. */
64
- declare const ProgressStepper: FC<ProgressStepperProps> & {
65
- Item: typeof ProgressStepperItem;
66
- };
67
- interface ProgressStepperProps {
68
- /**
69
- * Children of `<ProgressStepper />` should only contain `<ProgressStepper.Item />`
70
- */
71
- children?: ReactNode;
72
- /**
73
- * Determine a direction for `<ProgressStepper.Item />`
74
- */
75
- direction?: "horizontal" | "vertical";
76
- /**
77
- * Determine the size for `<ProgressStepper.Item />`
78
- */
79
- size?: "small" | "large";
80
- /**
81
- * Determine if `<ProgressStepper.Item />` should be Fluid. Only appliciable for `horizontal direction.`
82
- */
83
- isFluid?: boolean;
84
- /**
85
- * Determine if `<ProgressStepper.Item />` should be able to expand. This only is appliciable when direction is set to vertical
86
- */
87
- isExpandable?: boolean;
88
- }
89
- export { ProgressStepper };
1
+ export { ProgressStepper } from "../_shared/esm/ProgressStepper-7ab88f4c";
@@ -1,144 +1,10 @@
1
- import { _ as __rest, a as __assign, f as filterDataAttrs } from '../_shared/esm/filter-data-attrs-afdb7d32.js';
2
- import React__default, { useContext } from 'react';
3
- import { c as classNames } from '../_shared/esm/index-2ae58626.js';
4
- import { B as BtIconAlert_2 } from '../_shared/esm/BtIconAlert-55a6ed5c.js';
5
- import { I as Icon } from '../_shared/esm/Icon-c1af47bc.js';
6
- import { C as Context } from '../_shared/esm/Surface-dde51789.js';
7
- import { V as VerticalSpace } from '../_shared/esm/VerticalSpace-93980c9c.js';
8
- import { V as VisuallyHidden } from '../_shared/esm/VisuallyHidden-b9eebf71.js';
1
+ export { P as ProgressStepper } from '../_shared/esm/ProgressStepper-7ab88f4c.js';
2
+ import '../_shared/esm/filter-data-attrs-afdb7d32.js';
3
+ import 'react';
4
+ import '../_shared/esm/index-2ae58626.js';
5
+ import '../_shared/esm/BtIconAlert-55a6ed5c.js';
6
+ import '../_shared/esm/Icon-c1af47bc.js';
9
7
  import '../_shared/esm/suffix-modifier-7e640670.js';
10
-
11
- const React$2 = React__default;
12
- const BtIconTickVariant = props =>
13
- /*#__PURE__*/ React$2.createElement(
14
- "svg",
15
- Object.assign(
16
- {
17
- xmlns: "http://www.w3.org/2000/svg",
18
- viewBox: "0 0 32 32"
19
- },
20
- props
21
- ),
22
- /*#__PURE__*/ React$2.createElement("defs", null),
23
- /*#__PURE__*/ React$2.createElement("path", {
24
- d:
25
- "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",
26
- fill: "currentColor"
27
- })
28
- );
29
- var BtIconTickVariant_2 = BtIconTickVariant;
30
-
31
- const React$1 = React__default;
32
- const BtIconCrossAlt = props =>
33
- /*#__PURE__*/ React$1.createElement(
34
- "svg",
35
- Object.assign(
36
- {
37
- xmlns: "http://www.w3.org/2000/svg",
38
- viewBox: "0 0 32 32"
39
- },
40
- props
41
- ),
42
- /*#__PURE__*/ React$1.createElement("defs", null),
43
- /*#__PURE__*/ React$1.createElement("path", {
44
- d:
45
- "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
- var BtIconCrossAlt_2 = BtIconCrossAlt;
50
-
51
- const React = React__default;
52
- const BtIconCircle = props =>
53
- /*#__PURE__*/ React.createElement(
54
- "svg",
55
- Object.assign(
56
- {
57
- viewBox: "0 0 32 32",
58
- fill: "none",
59
- xmlns: "http://www.w3.org/2000/svg"
60
- },
61
- props
62
- ),
63
- /*#__PURE__*/ React.createElement("path", {
64
- fillRule: "evenodd",
65
- clipRule: "evenodd",
66
- d:
67
- "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",
68
- fill: "currentColor"
69
- })
70
- );
71
- var BtIconCircle_2 = BtIconCircle;
72
-
73
- var ProgressStepperItem = function (_a) {
74
- var _b, _c;
75
- var title = _a.title, titleHref = _a.titleHref, subTitle = _a.subTitle, _d = _a.direction, direction = _d === void 0 ? "horizontal" : _d, _e = _a.status, status = _e === void 0 ? "todo" : _e, _f = _a.size, size = _f === void 0 ? "large" : _f, _g = _a.position, position = _g === void 0 ? "middle" : _g, 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"]);
76
- var surface = useContext(Context).surface;
77
- var statusIcons = {
78
- completed: BtIconTickVariant_2,
79
- current: BtIconCircle_2,
80
- warning: BtIconAlert_2,
81
- error: BtIconCrossAlt_2
82
- };
83
- var onClickHandler = function (event) {
84
- event.preventDefault();
85
- onClick && onClick();
86
- };
87
- var capitaliseFirstLetter = function (word) {
88
- return word.charAt(0).toUpperCase() + word.slice(1);
89
- };
90
- return (React__default.createElement("div", __assign({ className: classNames("arc-ProgressStepperItem", (_b = {
91
- "arc-ProgressStepperItem--vertical": direction === "vertical",
92
- "arc-ProgressStepperItem--isFluid": isFluid,
93
- "arc-ProgressStepperItem--onDarkSurface": surface === "dark",
94
- "arc-ProgressStepperItem--previousStepCompleted": previousStep === "completed"
95
- },
96
- _b["arc-ProgressStepperItem--".concat(status)] = status !== "todo",
97
- _b["arc-ProgressStepperItem--".concat(size)] = size === "small",
98
- _b)) }, filterDataAttrs(props)),
99
- React__default.createElement("div", { className: classNames("arc-ProgressStepperItem-iconSection", (_c = {},
100
- _c["arc-ProgressStepperItem-iconSection--".concat(position)] = position !== "middle",
101
- _c)) },
102
- React__default.createElement("div", { className: "arc-ProgressStepperItem-iconSectionTrailBefore" }),
103
- React__default.createElement("div", { className: "arc-ProgressStepperItem-iconWrapper" }, statusIcons[status] === undefined ? (React__default.createElement("div", { style: {
104
- width: size === "small" ? "16px" : "32px",
105
- height: size === "small" ? "16px" : "32px"
106
- } })) : (React__default.createElement(Icon, { size: size === "small" ? 16 : 32, icon: statusIcons[status] }))),
107
- React__default.createElement("div", { className: "arc-ProgressStepperItem-iconSectionTrailAfter" })),
108
- React__default.createElement("div", { className: "arc-ProgressStepperItem-textSection" },
109
- status !== "todo" && (React__default.createElement(VisuallyHidden, null,
110
- capitaliseFirstLetter(status),
111
- ":")),
112
- 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)),
113
- React__default.createElement("div", { className: "arc-ProgressStepperItem-subTitle" }, subTitle),
114
- isExpandable && direction === "vertical" && (React__default.createElement(React__default.Fragment, null,
115
- React__default.createElement("div", { className: "arc-ProgressStepperItem-nodeItem" },
116
- React__default.createElement("div", { className: "arc-ProgressStepperItem-keyline" }),
117
- stepContent && !isStepContentHidden && (React__default.createElement(React__default.Fragment, null,
118
- React__default.createElement(VerticalSpace, { size: "8" }),
119
- stepContent))))))));
120
- };
121
-
122
- /** 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. */
123
- var ProgressStepper = function (_a) {
124
- var children = _a.children, size = _a.size, isFluid = _a.isFluid, direction = _a.direction, isExpandable = _a.isExpandable, props = __rest(_a, ["children", "size", "isFluid", "direction", "isExpandable"]);
125
- var items = React__default.Children.toArray(children);
126
- var getStepStatus = function (item) {
127
- var _a;
128
- return (_a = item === null || item === void 0 ? void 0 : item.props) === null || _a === void 0 ? void 0 : _a.status;
129
- };
130
- return (React__default.createElement("div", __assign({ className: classNames("arc-ProgressStepper", {
131
- "arc-ProgressStepper--vertical": direction === "vertical"
132
- }) }, filterDataAttrs(props)), items.map(function (item, index) {
133
- var currentPosition = index === 0
134
- ? "first"
135
- : index === React__default.Children.count(children) - 1
136
- ? "last"
137
- : undefined;
138
- return (React__default.createElement(React__default.Fragment, { key: "StepperItem-".concat(index) },
139
- 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)))));
140
- })));
141
- };
142
- ProgressStepper.Item = ProgressStepperItem;
143
-
144
- export { ProgressStepper };
8
+ import '../_shared/esm/Surface-dde51789.js';
9
+ import '../_shared/esm/VerticalSpace-93980c9c.js';
10
+ import '../_shared/esm/VisuallyHidden-b9eebf71.js';
@@ -1,75 +1 @@
1
- import { FC, ReactNode } from "react";
2
- import { ArcIcon } from "../_shared/cjs/arc-icon-17594b2f";
3
- declare const Tab: FC<TabProps>;
4
- interface TabProps {
5
- /**
6
- * Label to display on the Tab
7
- */
8
- label: string;
9
- /**
10
- * Value to link `Tab` to `TabContent`
11
- */
12
- value: string;
13
- /**
14
- * Determine what icon to display within the Tab.
15
- */
16
- icon?: ArcIcon;
17
- /**
18
- * Determine what to display when `Tab` is active
19
- */
20
- iconActive?: ArcIcon;
21
- }
22
- declare const TabContent: FC<TabContentProps>;
23
- interface TabContentProps {
24
- /**
25
- * Content to display
26
- */
27
- children: ReactNode;
28
- /**
29
- * This value links the `TabContent` with `Tab`
30
- */
31
- value: string;
32
- }
33
- declare const TabsList: FC<TabsListProps>;
34
- interface TabsListProps {
35
- /**
36
- * Contents of the `Tabs` Should contain `Tab`
37
- */
38
- children: ReactNode;
39
- /**
40
- * Determine if `Tabs` should be justified
41
- */
42
- isJustified?: boolean;
43
- /**
44
- * Determine the type of `Tabs`. Default is standard
45
- */
46
- type?: "standard" | "contained";
47
- /**
48
- * Determine a accessible label for `Tabs`
49
- */
50
- ariaLabel?: string;
51
- }
52
- declare const Tabs: FC<TabsProps> & {
53
- Tab: typeof Tab;
54
- Content: typeof TabContent;
55
- List: typeof TabsList;
56
- };
57
- interface TabsProps {
58
- /**
59
- * Render children
60
- */
61
- children: ReactNode;
62
- /**
63
- * Default to an inital value of a tab. If this is left blank it is possible for there to be no active tabs
64
- */
65
- defaultValue?: string;
66
- /**
67
- * Event handler called when the value changes.
68
- */
69
- onValueChange?: (value: string) => void;
70
- /**
71
- * When automatic, tabs are activated when receiving focus. When manual, tabs are activated when clicked.
72
- */
73
- activationMode?: "automatic" | "manual";
74
- }
75
- export { Tabs };
1
+ export { Tabs } from "../_shared/cjs/Tabs-fda49692";