carbon-react 110.4.1 → 110.5.2

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 (102) hide show
  1. package/esm/components/flat-table/flat-table-header/flat-table-header-utils.js +18 -0
  2. package/esm/components/flat-table/flat-table-header/flat-table-header.component.js +6 -1
  3. package/esm/components/flat-table/flat-table-header/flat-table-header.style.js +7 -5
  4. package/esm/components/icon/icon.component.js +22 -9
  5. package/esm/components/message/index.d.ts +2 -1
  6. package/esm/components/message/message-content/message-content.component.d.ts +9 -0
  7. package/esm/components/message/message-content/message-content.component.js +4 -5
  8. package/esm/components/message/message-content/message-content.style.d.ts +2 -0
  9. package/esm/components/message/message-content/message-content.style.js +0 -3
  10. package/esm/components/message/message.component.d.ts +27 -0
  11. package/esm/components/message/message.component.js +169 -37
  12. package/esm/components/message/message.style.d.ts +8 -0
  13. package/esm/components/message/message.style.js +1 -8
  14. package/esm/components/message/type-icon/type-icon.component.d.ts +10 -0
  15. package/esm/components/message/type-icon/type-icon.component.js +4 -8
  16. package/esm/components/message/type-icon/type-icon.style.d.ts +9 -0
  17. package/esm/components/message/type-icon/type-icon.style.js +0 -10
  18. package/esm/components/search/search.component.js +28 -2
  19. package/esm/components/search/search.d.ts +3 -1
  20. package/esm/components/sidebar/__internal__/sidebar-header/index.d.ts +1 -0
  21. package/esm/components/sidebar/__internal__/sidebar-header/sidebar-header.component.d.ts +9 -0
  22. package/esm/components/sidebar/__internal__/sidebar-header/sidebar-header.component.js +7 -18
  23. package/esm/components/sidebar/__internal__/sidebar-header/sidebar-header.style.d.ts +2 -0
  24. package/esm/components/sidebar/index.d.ts +2 -1
  25. package/esm/components/sidebar/index.js +1 -2
  26. package/esm/components/sidebar/sidebar.component.d.ts +44 -0
  27. package/esm/components/sidebar/sidebar.component.js +187 -48
  28. package/esm/components/sidebar/sidebar.config.d.ts +11 -0
  29. package/esm/components/sidebar/sidebar.style.d.ts +8 -0
  30. package/esm/components/step-sequence/index.d.ts +4 -2
  31. package/esm/components/step-sequence/step-sequence-item/index.d.ts +2 -0
  32. package/esm/components/step-sequence/step-sequence-item/step-sequence-item.component.d.ts +19 -0
  33. package/esm/components/step-sequence/step-sequence-item/step-sequence-item.component.js +26 -41
  34. package/esm/components/step-sequence/step-sequence-item/step-sequence-item.style.d.ts +9 -0
  35. package/esm/components/step-sequence/step-sequence-item/step-sequence-item.style.js +18 -2
  36. package/esm/components/step-sequence/step-sequence.component.d.ts +13 -0
  37. package/esm/components/step-sequence/step-sequence.component.js +170 -18
  38. package/esm/components/step-sequence/step-sequence.config.d.ts +2 -0
  39. package/esm/components/step-sequence/step-sequence.style.d.ts +4 -0
  40. package/esm/components/tabs/__internal__/tab-title/tab-title.component.d.ts +4 -0
  41. package/esm/components/tabs/__internal__/tab-title/tab-title.component.js +34 -4
  42. package/esm/components/tabs/__internal__/tab-title/tab-title.d.ts +6 -0
  43. package/esm/components/tabs/__internal__/tab-title/tab-title.style.d.ts +4 -0
  44. package/lib/components/flat-table/flat-table-header/flat-table-header-utils.js +26 -0
  45. package/lib/components/flat-table/flat-table-header/flat-table-header.component.js +6 -0
  46. package/lib/components/flat-table/flat-table-header/flat-table-header.style.js +10 -5
  47. package/lib/components/icon/icon.component.js +22 -8
  48. package/lib/components/message/index.d.ts +2 -1
  49. package/lib/components/message/message-content/message-content.component.d.ts +9 -0
  50. package/lib/components/message/message-content/message-content.component.js +5 -6
  51. package/lib/components/message/message-content/message-content.style.d.ts +2 -0
  52. package/lib/components/message/message-content/message-content.style.js +0 -4
  53. package/lib/components/message/message.component.d.ts +27 -0
  54. package/lib/components/message/message.component.js +170 -40
  55. package/lib/components/message/message.style.d.ts +8 -0
  56. package/lib/components/message/message.style.js +1 -9
  57. package/lib/components/message/type-icon/type-icon.component.d.ts +10 -0
  58. package/lib/components/message/type-icon/type-icon.component.js +4 -8
  59. package/lib/components/message/type-icon/type-icon.style.d.ts +9 -0
  60. package/lib/components/message/type-icon/type-icon.style.js +0 -13
  61. package/lib/components/search/search.component.js +28 -2
  62. package/lib/components/search/search.d.ts +3 -1
  63. package/lib/components/sidebar/__internal__/sidebar-header/index.d.ts +1 -0
  64. package/lib/components/sidebar/__internal__/sidebar-header/sidebar-header.component.d.ts +9 -0
  65. package/lib/components/sidebar/__internal__/sidebar-header/sidebar-header.component.js +7 -19
  66. package/lib/components/sidebar/__internal__/sidebar-header/sidebar-header.style.d.ts +2 -0
  67. package/lib/components/sidebar/index.d.ts +2 -1
  68. package/lib/components/sidebar/sidebar.component.d.ts +44 -0
  69. package/lib/components/sidebar/sidebar.component.js +187 -50
  70. package/lib/components/sidebar/sidebar.config.d.ts +11 -0
  71. package/lib/components/sidebar/sidebar.style.d.ts +8 -0
  72. package/lib/components/step-sequence/index.d.ts +4 -2
  73. package/lib/components/step-sequence/step-sequence-item/index.d.ts +2 -0
  74. package/lib/components/step-sequence/step-sequence-item/step-sequence-item.component.d.ts +19 -0
  75. package/lib/components/step-sequence/step-sequence-item/step-sequence-item.component.js +30 -48
  76. package/lib/components/step-sequence/step-sequence-item/step-sequence-item.style.d.ts +9 -0
  77. package/lib/components/step-sequence/step-sequence-item/step-sequence-item.style.js +22 -3
  78. package/lib/components/step-sequence/step-sequence.component.d.ts +13 -0
  79. package/lib/components/step-sequence/step-sequence.component.js +171 -21
  80. package/lib/components/step-sequence/step-sequence.config.d.ts +2 -0
  81. package/lib/components/step-sequence/step-sequence.style.d.ts +4 -0
  82. package/lib/components/tabs/__internal__/tab-title/tab-title.component.d.ts +4 -0
  83. package/lib/components/tabs/__internal__/tab-title/tab-title.component.js +38 -4
  84. package/lib/components/tabs/__internal__/tab-title/tab-title.d.ts +6 -0
  85. package/lib/components/tabs/__internal__/tab-title/tab-title.style.d.ts +4 -0
  86. package/package.json +1 -1
  87. package/esm/components/message/message.d.ts +0 -29
  88. package/esm/components/sidebar/__internal__/sidebar-header/__definition__.js +0 -13
  89. package/esm/components/sidebar/sidebar.d.ts +0 -57
  90. package/esm/components/step-sequence/step-sequence-item/step-sequence-item-content.style.js +0 -5
  91. package/esm/components/step-sequence/step-sequence-item/step-sequence-item-hidden-label.style.js +0 -9
  92. package/esm/components/step-sequence/step-sequence-item/step-sequence-item-indicator.style.js +0 -9
  93. package/esm/components/step-sequence/step-sequence-item/step-sequence-item.d.ts +0 -22
  94. package/esm/components/step-sequence/step-sequence.d.ts +0 -12
  95. package/lib/components/message/message.d.ts +0 -29
  96. package/lib/components/sidebar/__internal__/sidebar-header/__definition__.js +0 -25
  97. package/lib/components/sidebar/sidebar.d.ts +0 -57
  98. package/lib/components/step-sequence/step-sequence-item/step-sequence-item-content.style.js +0 -16
  99. package/lib/components/step-sequence/step-sequence-item/step-sequence-item-hidden-label.style.js +0 -20
  100. package/lib/components/step-sequence/step-sequence-item/step-sequence-item-indicator.style.js +0 -20
  101. package/lib/components/step-sequence/step-sequence-item/step-sequence-item.d.ts +0 -22
  102. package/lib/components/step-sequence/step-sequence.d.ts +0 -12
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ interface SidebarHeaderProps {
3
+ /** This component supports children. */
4
+ children?: React.ReactNode;
5
+ /** A custom id. */
6
+ id: string;
7
+ }
8
+ declare const SidebarHeader: ({ children, id }: SidebarHeaderProps) => JSX.Element;
9
+ export default SidebarHeader;
@@ -1,28 +1,17 @@
1
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
1
  import React from "react";
4
2
  import PropTypes from "prop-types";
5
- import tagComponent from "../../../../__internal__/utils/helpers/tags/tags";
6
3
  import SidebarHeaderStyle from "./sidebar-header.style";
7
4
 
8
5
  const SidebarHeader = ({
9
- className,
10
6
  children,
11
- id,
12
- ...props
13
- }) => /*#__PURE__*/React.createElement(SidebarHeaderStyle, _extends({
14
- className: className,
15
- id: id
16
- }, tagComponent("sidebar-header", props)), children);
7
+ id
8
+ }) => /*#__PURE__*/React.createElement(SidebarHeaderStyle, {
9
+ id: id,
10
+ "data-component": "sidebar-header"
11
+ }, children);
17
12
 
18
13
  SidebarHeader.propTypes = {
19
- /** This component supports children. */
20
- children: PropTypes.node,
21
-
22
- /** A custom class name. */
23
- className: PropTypes.string,
24
-
25
- /** A custom id. */
26
- id: PropTypes.string
14
+ "children": PropTypes.node,
15
+ "id": PropTypes.string.isRequired
27
16
  };
28
17
  export default SidebarHeader;
@@ -0,0 +1,2 @@
1
+ declare const SidebarHeaderStyle: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export default SidebarHeaderStyle;
@@ -1 +1,2 @@
1
- export { default, SidebarContext } from "./sidebar";
1
+ export { default, SidebarContext } from "./sidebar.component";
2
+ export type { SidebarProps } from "./sidebar.component";
@@ -1,2 +1 @@
1
- export { default } from "./sidebar.component";
2
- export { SidebarContext } from "./sidebar.component";
1
+ export { default, SidebarContext } from "./sidebar.component";
@@ -0,0 +1,44 @@
1
+ import React from "react";
2
+ import { PaddingProps } from "styled-system";
3
+ import { TagProps } from "../../__internal__/utils/helpers/tags/tags";
4
+ export interface SidebarContextProps {
5
+ isInSidebar?: boolean;
6
+ }
7
+ export declare const SidebarContext: React.Context<SidebarContextProps>;
8
+ export interface SidebarProps extends PaddingProps, TagProps {
9
+ /** Prop to specify the aria-describedby property of the component */
10
+ "aria-describedby"?: string;
11
+ /**
12
+ * Prop to specify the aria-label of the component.
13
+ * To be used only when the title prop is not defined, and the component is not labelled by any internal element.
14
+ */
15
+ "aria-label"?: string;
16
+ /**
17
+ * Prop to specify the aria-labeledby property of the component
18
+ * To be used when the title prop is a custom React Node,
19
+ * or the component is labelled by an internal element other than the title.
20
+ */
21
+ "aria-labelledby"?: string;
22
+ /** Modal content */
23
+ children?: React.ReactNode;
24
+ /** Determines if the Esc Key closes the modal */
25
+ disableEscKey?: boolean;
26
+ /** Set this prop to false to hide the translucent background when the dialog is open. */
27
+ enableBackgroundUI?: boolean;
28
+ /** Node that will be used as sidebar header. */
29
+ header?: React.ReactNode;
30
+ /** A custom close event handler */
31
+ onCancel?: (ev: React.KeyboardEvent<HTMLElement> | React.MouseEvent<HTMLElement>) => void;
32
+ /** Sets the open state of the modal */
33
+ open: boolean;
34
+ /** Sets the position of sidebar, either left or right. */
35
+ position?: "left" | "right";
36
+ /** The ARIA role to be applied to the component container */
37
+ role?: string;
38
+ /** Sets the size of the sidebar when open. */
39
+ size?: "extra-small" | "small" | "medium-small" | "medium" | "medium-large" | "large" | "extra-large";
40
+ /** an optional array of refs to containers whose content should also be reachable by tabbing from the sidebar */
41
+ focusableContainers?: React.MutableRefObject<HTMLElement>[];
42
+ }
43
+ export declare const Sidebar: React.ForwardRefExoticComponent<Pick<SidebarProps, keyof SidebarProps> & React.RefAttributes<HTMLDivElement>>;
44
+ export default Sidebar;
@@ -1,8 +1,7 @@
1
1
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
 
3
- import React, { useRef } from "react";
3
+ import React, { useRef, useCallback } from "react";
4
4
  import PropTypes from "prop-types";
5
- import styledSystemPropTypes from "@styled-system/prop-types";
6
5
  import Modal from "../modal";
7
6
  import StyledSidebar from "./sidebar.style";
8
7
  import IconButton from "../icon-button";
@@ -13,7 +12,6 @@ import Box from "../box";
13
12
  import createGuid from "../../__internal__/utils/helpers/guid";
14
13
  import useLocale from "../../hooks/__internal__/useLocale";
15
14
  import { filterStyledSystemPaddingProps } from "../../style/utils";
16
- const paddingPropTypes = filterStyledSystemPaddingProps(styledSystemPropTypes.space);
17
15
  export const SidebarContext = /*#__PURE__*/React.createContext({});
18
16
  const Sidebar = /*#__PURE__*/React.forwardRef(({
19
17
  "aria-describedby": ariaDescribedBy,
@@ -35,8 +33,13 @@ const Sidebar = /*#__PURE__*/React.forwardRef(({
35
33
  const {
36
34
  current: titleId
37
35
  } = useRef(createGuid());
38
- let sidebarRef = useRef(null);
39
- if (ref) sidebarRef = ref;
36
+ const sidebarRef = useRef(null);
37
+ const setRefs = useCallback(reference => {
38
+ sidebarRef.current = reference;
39
+ if (!ref) return;
40
+ if (typeof ref === "object") ref.current = reference;
41
+ if (typeof ref === "function") ref(reference);
42
+ }, [ref]);
40
43
 
41
44
  const closeIcon = () => {
42
45
  if (!onCancel) return null;
@@ -59,7 +62,7 @@ const Sidebar = /*#__PURE__*/React.forwardRef(({
59
62
  "aria-describedby": ariaDescribedBy,
60
63
  "aria-label": ariaLabel,
61
64
  "aria-labelledby": !ariaLabelledBy && !ariaLabel ? titleId : ariaLabelledBy,
62
- ref: sidebarRef,
65
+ ref: setRefs,
63
66
  position: position,
64
67
  size: size,
65
68
  "data-element": "sidebar",
@@ -85,8 +88,7 @@ const Sidebar = /*#__PURE__*/React.forwardRef(({
85
88
  open: open,
86
89
  onCancel: onCancel,
87
90
  disableEscKey: disableEscKey,
88
- enableBackgroundUI: enableBackgroundUI,
89
- className: "carbon-sidebar"
91
+ enableBackgroundUI: enableBackgroundUI
90
92
  }, componentTags), enableBackgroundUI ? sidebar : /*#__PURE__*/React.createElement(FocusTrap, {
91
93
  wrapperRef: sidebarRef,
92
94
  isOpen: open,
@@ -94,48 +96,185 @@ const Sidebar = /*#__PURE__*/React.forwardRef(({
94
96
  }, sidebar));
95
97
  });
96
98
  Sidebar.propTypes = {
97
- /** Styled system padding props to apply to Sidebar content */
98
- ...paddingPropTypes,
99
-
100
- /** Prop to specify the aria-describedby property of the component */
101
99
  "aria-describedby": PropTypes.string,
102
-
103
- /** Prop to specify the aria-label of the component */
104
100
  "aria-label": PropTypes.string,
105
-
106
- /** Prop to specify the aria-labeledby property of the component */
107
101
  "aria-labelledby": PropTypes.string,
108
-
109
- /** Modal content */
110
- children: PropTypes.node,
111
-
112
- /** A custom close event handler */
113
- onCancel: PropTypes.func,
114
-
115
- /** Determines if the Esc Key closes the modal */
116
- disableEscKey: PropTypes.bool,
117
-
118
- /** A boolean to track the open state of the dialog */
119
- open: PropTypes.bool.isRequired,
120
-
121
- /** Set this prop to false to hide the translucent background when the dialog is open. */
122
- enableBackgroundUI: PropTypes.bool,
123
-
124
- /** Sets the position of sidebar, either left or right. */
125
- position: PropTypes.oneOf(["left", "right"]),
126
-
127
- /** Sets the size of the sidebar when open. */
128
- size: PropTypes.oneOf(["extra-small", "small", "medium-small", "medium", "medium-large", "large", "extra-large"]),
129
-
130
- /** Node that will be used as sidebar header. */
131
- header: PropTypes.node,
132
-
133
- /** The ARIA role to be applied to the container */
134
- role: PropTypes.string,
135
-
136
- /** an optional array of refs to containers whose content should also be reachable by tabbing from the sidebar */
137
- focusableContainers: PropTypes.arrayOf(PropTypes.shape({
138
- current: PropTypes.any
139
- }))
102
+ "children": PropTypes.node,
103
+ "data-component": PropTypes.string,
104
+ "data-element": PropTypes.string,
105
+ "data-role": PropTypes.string,
106
+ "disableEscKey": PropTypes.bool,
107
+ "enableBackgroundUI": PropTypes.bool,
108
+ "focusableContainers": PropTypes.arrayOf(PropTypes.shape({
109
+ "current": function (props, propName) {
110
+ if (props[propName] == null) {
111
+ return new Error("Prop '" + propName + "' is required but wasn't specified");
112
+ } else if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) {
113
+ return new Error("Expected prop '" + propName + "' to be of type Element");
114
+ }
115
+ }
116
+ })),
117
+ "header": PropTypes.node,
118
+ "onCancel": PropTypes.func,
119
+ "open": PropTypes.bool.isRequired,
120
+ "p": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
121
+ "__@toStringTag": PropTypes.string.isRequired,
122
+ "description": PropTypes.string,
123
+ "toString": PropTypes.func.isRequired,
124
+ "valueOf": PropTypes.func.isRequired
125
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
126
+ "__@toStringTag": PropTypes.string.isRequired,
127
+ "description": PropTypes.string,
128
+ "toString": PropTypes.func.isRequired,
129
+ "valueOf": PropTypes.func.isRequired
130
+ }), PropTypes.string]),
131
+ "padding": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
132
+ "__@toStringTag": PropTypes.string.isRequired,
133
+ "description": PropTypes.string,
134
+ "toString": PropTypes.func.isRequired,
135
+ "valueOf": PropTypes.func.isRequired
136
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
137
+ "__@toStringTag": PropTypes.string.isRequired,
138
+ "description": PropTypes.string,
139
+ "toString": PropTypes.func.isRequired,
140
+ "valueOf": PropTypes.func.isRequired
141
+ }), PropTypes.string]),
142
+ "paddingBottom": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
143
+ "__@toStringTag": PropTypes.string.isRequired,
144
+ "description": PropTypes.string,
145
+ "toString": PropTypes.func.isRequired,
146
+ "valueOf": PropTypes.func.isRequired
147
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
148
+ "__@toStringTag": PropTypes.string.isRequired,
149
+ "description": PropTypes.string,
150
+ "toString": PropTypes.func.isRequired,
151
+ "valueOf": PropTypes.func.isRequired
152
+ }), PropTypes.string]),
153
+ "paddingLeft": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
154
+ "__@toStringTag": PropTypes.string.isRequired,
155
+ "description": PropTypes.string,
156
+ "toString": PropTypes.func.isRequired,
157
+ "valueOf": PropTypes.func.isRequired
158
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
159
+ "__@toStringTag": PropTypes.string.isRequired,
160
+ "description": PropTypes.string,
161
+ "toString": PropTypes.func.isRequired,
162
+ "valueOf": PropTypes.func.isRequired
163
+ }), PropTypes.string]),
164
+ "paddingRight": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
165
+ "__@toStringTag": PropTypes.string.isRequired,
166
+ "description": PropTypes.string,
167
+ "toString": PropTypes.func.isRequired,
168
+ "valueOf": PropTypes.func.isRequired
169
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
170
+ "__@toStringTag": PropTypes.string.isRequired,
171
+ "description": PropTypes.string,
172
+ "toString": PropTypes.func.isRequired,
173
+ "valueOf": PropTypes.func.isRequired
174
+ }), PropTypes.string]),
175
+ "paddingTop": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
176
+ "__@toStringTag": PropTypes.string.isRequired,
177
+ "description": PropTypes.string,
178
+ "toString": PropTypes.func.isRequired,
179
+ "valueOf": PropTypes.func.isRequired
180
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
181
+ "__@toStringTag": PropTypes.string.isRequired,
182
+ "description": PropTypes.string,
183
+ "toString": PropTypes.func.isRequired,
184
+ "valueOf": PropTypes.func.isRequired
185
+ }), PropTypes.string]),
186
+ "paddingX": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
187
+ "__@toStringTag": PropTypes.string.isRequired,
188
+ "description": PropTypes.string,
189
+ "toString": PropTypes.func.isRequired,
190
+ "valueOf": PropTypes.func.isRequired
191
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
192
+ "__@toStringTag": PropTypes.string.isRequired,
193
+ "description": PropTypes.string,
194
+ "toString": PropTypes.func.isRequired,
195
+ "valueOf": PropTypes.func.isRequired
196
+ }), PropTypes.string]),
197
+ "paddingY": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
198
+ "__@toStringTag": PropTypes.string.isRequired,
199
+ "description": PropTypes.string,
200
+ "toString": PropTypes.func.isRequired,
201
+ "valueOf": PropTypes.func.isRequired
202
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
203
+ "__@toStringTag": PropTypes.string.isRequired,
204
+ "description": PropTypes.string,
205
+ "toString": PropTypes.func.isRequired,
206
+ "valueOf": PropTypes.func.isRequired
207
+ }), PropTypes.string]),
208
+ "pb": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
209
+ "__@toStringTag": PropTypes.string.isRequired,
210
+ "description": PropTypes.string,
211
+ "toString": PropTypes.func.isRequired,
212
+ "valueOf": PropTypes.func.isRequired
213
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
214
+ "__@toStringTag": PropTypes.string.isRequired,
215
+ "description": PropTypes.string,
216
+ "toString": PropTypes.func.isRequired,
217
+ "valueOf": PropTypes.func.isRequired
218
+ }), PropTypes.string]),
219
+ "pl": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
220
+ "__@toStringTag": PropTypes.string.isRequired,
221
+ "description": PropTypes.string,
222
+ "toString": PropTypes.func.isRequired,
223
+ "valueOf": PropTypes.func.isRequired
224
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
225
+ "__@toStringTag": PropTypes.string.isRequired,
226
+ "description": PropTypes.string,
227
+ "toString": PropTypes.func.isRequired,
228
+ "valueOf": PropTypes.func.isRequired
229
+ }), PropTypes.string]),
230
+ "position": PropTypes.oneOf(["left", "right"]),
231
+ "pr": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
232
+ "__@toStringTag": PropTypes.string.isRequired,
233
+ "description": PropTypes.string,
234
+ "toString": PropTypes.func.isRequired,
235
+ "valueOf": PropTypes.func.isRequired
236
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
237
+ "__@toStringTag": PropTypes.string.isRequired,
238
+ "description": PropTypes.string,
239
+ "toString": PropTypes.func.isRequired,
240
+ "valueOf": PropTypes.func.isRequired
241
+ }), PropTypes.string]),
242
+ "pt": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
243
+ "__@toStringTag": PropTypes.string.isRequired,
244
+ "description": PropTypes.string,
245
+ "toString": PropTypes.func.isRequired,
246
+ "valueOf": PropTypes.func.isRequired
247
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
248
+ "__@toStringTag": PropTypes.string.isRequired,
249
+ "description": PropTypes.string,
250
+ "toString": PropTypes.func.isRequired,
251
+ "valueOf": PropTypes.func.isRequired
252
+ }), PropTypes.string]),
253
+ "px": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
254
+ "__@toStringTag": PropTypes.string.isRequired,
255
+ "description": PropTypes.string,
256
+ "toString": PropTypes.func.isRequired,
257
+ "valueOf": PropTypes.func.isRequired
258
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
259
+ "__@toStringTag": PropTypes.string.isRequired,
260
+ "description": PropTypes.string,
261
+ "toString": PropTypes.func.isRequired,
262
+ "valueOf": PropTypes.func.isRequired
263
+ }), PropTypes.string]),
264
+ "py": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
265
+ "__@toStringTag": PropTypes.string.isRequired,
266
+ "description": PropTypes.string,
267
+ "toString": PropTypes.func.isRequired,
268
+ "valueOf": PropTypes.func.isRequired
269
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
270
+ "__@toStringTag": PropTypes.string.isRequired,
271
+ "description": PropTypes.string,
272
+ "toString": PropTypes.func.isRequired,
273
+ "valueOf": PropTypes.func.isRequired
274
+ }), PropTypes.string]),
275
+ "role": PropTypes.string,
276
+ "size": PropTypes.oneOf(["extra-large", "extra-small", "large", "medium-large", "medium-small", "medium", "small"])
140
277
  };
278
+ export { Sidebar };
279
+ Sidebar.displayName = "Sidebar";
141
280
  export default Sidebar;
@@ -0,0 +1,11 @@
1
+ export declare const SIDEBAR_SIZES_CSS: {
2
+ "extra-small": string;
3
+ small: string;
4
+ "medium-small": string;
5
+ medium: string;
6
+ "medium-large": string;
7
+ large: string;
8
+ "extra-large": string;
9
+ };
10
+ export declare const SIDEBAR_SIZES: string[];
11
+ export declare const SIDEBAR_ALIGNMENTS: string[];
@@ -0,0 +1,8 @@
1
+ import { SidebarProps } from "./sidebar.component";
2
+ declare type StyledSidebarProps = {
3
+ onCancel?: SidebarProps["onCancel"];
4
+ position?: SidebarProps["position"];
5
+ size?: SidebarProps["size"];
6
+ };
7
+ declare const StyledSidebar: import("styled-components").StyledComponent<"div", any, StyledSidebarProps, never>;
8
+ export default StyledSidebar;
@@ -1,2 +1,4 @@
1
- export { default as StepSequence } from "./step-sequence";
2
- export { default as StepSequenceItem } from "./step-sequence-item/step-sequence-item";
1
+ export { default as StepSequence } from "./step-sequence.component";
2
+ export type { StepSequenceProps } from "./step-sequence.component";
3
+ export { default as StepSequenceItem } from "./step-sequence-item";
4
+ export type { StepSequenceItemProps } from "./step-sequence-item";
@@ -0,0 +1,2 @@
1
+ export { default } from "./step-sequence-item.component";
2
+ export type { StepSequenceItemProps } from "./step-sequence-item.component";
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ export interface StepSequenceItemProps {
3
+ /** Aria label */
4
+ ariaLabel?: string;
5
+ /** Hidden label to be displayed if item is complete */
6
+ hiddenCompleteLabel?: string;
7
+ /** Hidden label to be displayed if item is current */
8
+ hiddenCurrentLabel?: string;
9
+ /** Value to be displayed before text for uncomplete steps */
10
+ indicator: string;
11
+ /** Flag to hide the indicator for uncomplete steps */
12
+ hideIndicator?: boolean;
13
+ /** Status for the step */
14
+ status?: "complete" | "current" | "incomplete";
15
+ /** Content to be displayed */
16
+ children: React.ReactNode;
17
+ }
18
+ export declare const StepSequenceItem: ({ hideIndicator, indicator, status, hiddenCompleteLabel, hiddenCurrentLabel, children, ariaLabel, ...rest }: StepSequenceItemProps) => JSX.Element;
19
+ export default StepSequenceItem;
@@ -2,33 +2,33 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
2
2
 
3
3
  import React, { useContext } from "react";
4
4
  import PropTypes from "prop-types";
5
- import StepSequenceItemStyle from "./step-sequence-item.style";
6
- import StepSequenceItemContentStyle from "./step-sequence-item-content.style";
7
- import StepSequenceItemIndicatorStyle from "./step-sequence-item-indicator.style";
8
- import StepSequenceItemHiddenLabelStyle from "./step-sequence-item-hidden-label.style";
5
+ import { StepSequenceItemStyle, StepSequenceItemContentStyle, StepSequenceItemIndicatorStyle, StepSequenceItemHiddenLabelStyle } from "./step-sequence-item.style";
9
6
  import Icon from "../../icon";
10
7
  import { StepSequenceContext } from "../step-sequence.component";
11
8
 
12
- const StepSequenceItem = props => {
9
+ const StepSequenceItem = ({
10
+ hideIndicator = false,
11
+ indicator,
12
+ status = "incomplete",
13
+ hiddenCompleteLabel,
14
+ hiddenCurrentLabel,
15
+ children,
16
+ ariaLabel,
17
+ ...rest
18
+ }) => {
13
19
  const {
14
20
  orientation
15
21
  } = useContext(StepSequenceContext);
16
22
 
17
23
  const indicatorText = () => {
18
- return !props.hideIndicator ? /*#__PURE__*/React.createElement(StepSequenceItemIndicatorStyle, null, props.indicator) : null;
24
+ return !hideIndicator ? /*#__PURE__*/React.createElement(StepSequenceItemIndicatorStyle, null, indicator) : null;
19
25
  };
20
26
 
21
- const icon = () => props.status === "complete" ? /*#__PURE__*/React.createElement(Icon, {
27
+ const icon = () => status === "complete" ? /*#__PURE__*/React.createElement(Icon, {
22
28
  type: "tick"
23
29
  }) : indicatorText();
24
30
 
25
31
  const hiddenLabel = () => {
26
- const {
27
- status,
28
- hiddenCompleteLabel,
29
- hiddenCurrentLabel
30
- } = props;
31
-
32
32
  if (hiddenCompleteLabel && status === "complete") {
33
33
  return /*#__PURE__*/React.createElement(StepSequenceItemHiddenLabelStyle, null, hiddenCompleteLabel);
34
34
  }
@@ -41,37 +41,22 @@ const StepSequenceItem = props => {
41
41
  };
42
42
 
43
43
  return /*#__PURE__*/React.createElement(StepSequenceItemStyle, _extends({
44
- "data-component": "step-sequence-item"
45
- }, props, {
44
+ "data-component": "step-sequence-item",
46
45
  orientation: orientation,
47
- key: `step-seq-item-${props.indicator}`
48
- }), hiddenLabel(), /*#__PURE__*/React.createElement(StepSequenceItemContentStyle, null, icon(), /*#__PURE__*/React.createElement("span", null, props.children)));
46
+ status: status,
47
+ key: `step-seq-item-${indicator}`,
48
+ "aria-label": ariaLabel
49
+ }, rest), hiddenLabel(), /*#__PURE__*/React.createElement(StepSequenceItemContentStyle, null, icon(), /*#__PURE__*/React.createElement("span", null, children)));
49
50
  };
50
51
 
51
52
  StepSequenceItem.propTypes = {
52
- /** Text content for the step item */
53
- children: PropTypes.node.isRequired,
54
-
55
- /** Value to be displayed before text for uncompleted steps */
56
- indicator: PropTypes.string.isRequired,
57
-
58
- /** Flag to hide the indicator for uncompleted steps */
59
- hideIndicator: PropTypes.bool,
60
-
61
- /** Aria label */
62
- ariaLabel: PropTypes.string,
63
-
64
- /** Status for the step */
65
- status: PropTypes.oneOf(["complete", "current", "incomplete"]),
66
-
67
- /** Hidden label to be displayed if item is complete */
68
- hiddenCompleteLabel: PropTypes.string,
69
-
70
- /** Hidden label to be displayed if item is current */
71
- hiddenCurrentLabel: PropTypes.string
72
- };
73
- StepSequenceItem.defaultProps = {
74
- status: "incomplete",
75
- hideIndicator: false
53
+ "ariaLabel": PropTypes.string,
54
+ "children": PropTypes.node,
55
+ "hiddenCompleteLabel": PropTypes.string,
56
+ "hiddenCurrentLabel": PropTypes.string,
57
+ "hideIndicator": PropTypes.bool,
58
+ "indicator": PropTypes.string.isRequired,
59
+ "status": PropTypes.oneOf(["complete", "current", "incomplete"])
76
60
  };
61
+ export { StepSequenceItem };
77
62
  export default StepSequenceItem;
@@ -0,0 +1,9 @@
1
+ declare type StepSequenceItemStyle = {
2
+ status: "complete" | "current" | "incomplete";
3
+ orientation: "horizontal" | "vertical";
4
+ };
5
+ export declare const StepSequenceItemStyle: import("styled-components").StyledComponent<"li", any, StepSequenceItemStyle, never>;
6
+ export declare const StepSequenceItemContentStyle: import("styled-components").StyledComponent<"span", any, {}, never>;
7
+ export declare const StepSequenceItemHiddenLabelStyle: import("styled-components").StyledComponent<"span", any, {}, never>;
8
+ export declare const StepSequenceItemIndicatorStyle: import("styled-components").StyledComponent<"span", any, {}, never>;
9
+ export {};
@@ -1,6 +1,6 @@
1
1
  import styled, { css } from "styled-components";
2
2
  import StyledIcon from "../../icon/icon.style";
3
- const StepSequenceItemStyle = styled.li`
3
+ export const StepSequenceItemStyle = styled.li`
4
4
  display: flex;
5
5
  align-items: center;
6
6
  flex-grow: 1;
@@ -73,4 +73,20 @@ const StepSequenceItemStyle = styled.li`
73
73
  }
74
74
  `}
75
75
  `;
76
- export default StepSequenceItemStyle;
76
+ export const StepSequenceItemContentStyle = styled.span`
77
+ display: flex;
78
+ `;
79
+ export const StepSequenceItemHiddenLabelStyle = styled.span`
80
+ position: absolute !important;
81
+ height: 1px;
82
+ width: 1px;
83
+ overflow: hidden;
84
+ clip: rect(1px, 1px, 1px, 1px);
85
+ `;
86
+ export const StepSequenceItemIndicatorStyle = styled.span`
87
+ display: block;
88
+ min-width: 16px;
89
+ height: 16px;
90
+ margin-right: 8px;
91
+ text-align: center;
92
+ `;
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import { MarginProps } from "styled-system";
3
+ export declare const StepSequenceContext: React.Context<{
4
+ orientation: "horizontal" | "vertical";
5
+ }>;
6
+ export interface StepSequenceProps extends MarginProps {
7
+ /** Step sequence items to be rendered */
8
+ children: React.ReactNode;
9
+ /** The direction that step sequence items should be rendered */
10
+ orientation?: "horizontal" | "vertical";
11
+ }
12
+ export declare const StepSequence: ({ children, orientation, ...props }: StepSequenceProps) => JSX.Element;
13
+ export default StepSequence;