carbon-react 111.16.0 → 111.18.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 (55) hide show
  1. package/esm/components/card/card.component.d.ts +3 -1
  2. package/esm/components/card/card.component.js +4 -1
  3. package/esm/components/card/card.style.d.ts +1 -0
  4. package/esm/components/card/card.style.js +6 -1
  5. package/esm/components/confirm/confirm.component.d.ts +37 -0
  6. package/esm/components/confirm/confirm.component.js +46 -113
  7. package/esm/components/confirm/confirm.config.d.ts +1 -0
  8. package/esm/components/confirm/confirm.style.d.ts +5 -0
  9. package/esm/components/confirm/confirm.style.js +1 -5
  10. package/esm/components/confirm/index.d.ts +2 -1
  11. package/esm/components/dialog-full-screen/content.style.d.ts +7 -0
  12. package/esm/components/dialog-full-screen/dialog-full-screen.component.d.ts +55 -0
  13. package/esm/components/dialog-full-screen/dialog-full-screen.component.js +45 -80
  14. package/esm/components/dialog-full-screen/dialog-full-screen.style.d.ts +4 -0
  15. package/esm/components/dialog-full-screen/index.d.ts +2 -1
  16. package/esm/components/modal/modal.component.d.ts +2 -1
  17. package/esm/components/modal/modal.component.js +3 -0
  18. package/esm/components/tile/tile-footer/tile-footer.component.js +3 -5
  19. package/esm/components/tile/tile-footer/tile-footer.d.ts +1 -1
  20. package/esm/components/tile/tile-footer/tile-footer.style.js +15 -1
  21. package/esm/components/tile/tile.component.js +10 -3
  22. package/esm/components/tile/tile.d.ts +15 -0
  23. package/esm/components/tile/tile.style.js +30 -3
  24. package/esm/style/design-tokens/debug-theme.util.d.ts +15 -1
  25. package/esm/style/themes/sage/index.d.ts +15 -1
  26. package/lib/components/card/card.component.d.ts +3 -1
  27. package/lib/components/card/card.component.js +4 -1
  28. package/lib/components/card/card.style.d.ts +1 -0
  29. package/lib/components/card/card.style.js +6 -1
  30. package/lib/components/confirm/confirm.component.d.ts +37 -0
  31. package/lib/components/confirm/confirm.component.js +47 -114
  32. package/lib/components/confirm/confirm.config.d.ts +1 -0
  33. package/lib/components/confirm/confirm.style.d.ts +5 -0
  34. package/lib/components/confirm/confirm.style.js +1 -6
  35. package/lib/components/confirm/index.d.ts +2 -1
  36. package/lib/components/dialog-full-screen/content.style.d.ts +7 -0
  37. package/lib/components/dialog-full-screen/dialog-full-screen.component.d.ts +55 -0
  38. package/lib/components/dialog-full-screen/dialog-full-screen.component.js +46 -81
  39. package/lib/components/dialog-full-screen/dialog-full-screen.style.d.ts +4 -0
  40. package/lib/components/dialog-full-screen/index.d.ts +2 -1
  41. package/lib/components/modal/modal.component.d.ts +2 -1
  42. package/lib/components/modal/modal.component.js +3 -0
  43. package/lib/components/tile/tile-footer/tile-footer.component.js +4 -3
  44. package/lib/components/tile/tile-footer/tile-footer.d.ts +1 -1
  45. package/lib/components/tile/tile-footer/tile-footer.style.js +14 -1
  46. package/lib/components/tile/tile.component.js +12 -2
  47. package/lib/components/tile/tile.d.ts +15 -0
  48. package/lib/components/tile/tile.style.js +29 -3
  49. package/lib/style/design-tokens/debug-theme.util.d.ts +15 -1
  50. package/lib/style/themes/sage/index.d.ts +15 -1
  51. package/package.json +3 -3
  52. package/esm/components/confirm/confirm.d.ts +0 -50
  53. package/esm/components/dialog-full-screen/dialog-full-screen.d.ts +0 -52
  54. package/lib/components/confirm/confirm.d.ts +0 -50
  55. package/lib/components/dialog-full-screen/dialog-full-screen.d.ts +0 -52
@@ -22,6 +22,8 @@ export interface CardProps extends MarginProps {
22
22
  children: React.ReactNode;
23
23
  /** Flag to indicate if card is draggable */
24
24
  draggable?: boolean;
25
+ /** Height of the component (any valid CSS value) */
26
+ height?: string;
25
27
  /** Flag to indicate if card is interactive */
26
28
  interactive?: boolean;
27
29
  /** Size of card for applying padding */
@@ -32,7 +34,7 @@ export interface CardProps extends MarginProps {
32
34
  hoverBoxShadow?: BoxShadowsType;
33
35
  }
34
36
  declare const Card: {
35
- ({ "data-element": dataElement, "data-role": dataRole, dataRole: oldDataRole, action, children, cardWidth, draggable, interactive, spacing, boxShadow, hoverBoxShadow, ...rest }: CardProps): JSX.Element;
37
+ ({ "data-element": dataElement, "data-role": dataRole, dataRole: oldDataRole, action, children, cardWidth, draggable, height, interactive, spacing, boxShadow, hoverBoxShadow, ...rest }: CardProps): JSX.Element;
36
38
  displayName: string;
37
39
  };
38
40
  export default Card;
@@ -22,6 +22,7 @@ const Card = ({
22
22
  children,
23
23
  cardWidth = "500px",
24
24
  draggable,
25
+ height,
25
26
  interactive,
26
27
  spacing = "medium",
27
28
  boxShadow,
@@ -60,7 +61,8 @@ const Card = ({
60
61
  spacing: spacing,
61
62
  boxShadow: boxShadow,
62
63
  hoverBoxShadow: hoverBoxShadow,
63
- onClick: interactive && !draggable ? action : undefined
64
+ onClick: interactive && !draggable ? action : undefined,
65
+ height: height
64
66
  }, interactive && {
65
67
  tabIndex: 0,
66
68
  type: "button"
@@ -78,6 +80,7 @@ Card.propTypes = {
78
80
  "data-role": PropTypes.string,
79
81
  "dataRole": PropTypes.string,
80
82
  "draggable": PropTypes.bool,
83
+ "height": PropTypes.string,
81
84
  "hoverBoxShadow": PropTypes.any,
82
85
  "interactive": PropTypes.bool,
83
86
  "m": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
@@ -7,6 +7,7 @@ export interface StyledCardProps extends MarginProps {
7
7
  cardWidth: string;
8
8
  interactive: boolean;
9
9
  draggable: boolean;
10
+ height?: string;
10
11
  spacing: CardSpacing;
11
12
  boxShadow?: BoxShadowsType;
12
13
  hoverBoxShadow?: BoxShadowsType;
@@ -11,6 +11,7 @@ const StyledCard = styled.div`
11
11
  cardWidth,
12
12
  interactive,
13
13
  draggable,
14
+ height,
14
15
  spacing,
15
16
  boxShadow = "boxShadow050",
16
17
  hoverBoxShadow = "boxShadow100"
@@ -19,12 +20,16 @@ const StyledCard = styled.div`
19
20
  border: none;
20
21
  box-shadow: var(--${boxShadow});
21
22
  color: var(--colorsUtilityYin090);
23
+ display: flex;
24
+ flex-direction: column;
25
+ height: ${height};
26
+ justify-content: space-between;
22
27
  margin: 25px;
28
+ outline: none;
23
29
  padding: ${paddingSizes[spacing]};
24
30
  transition: all 0.3s ease-in-out;
25
31
  vertical-align: top;
26
32
  width: ${cardWidth};
27
- outline: none;
28
33
  ${margin}
29
34
 
30
35
  ${interactive && css`
@@ -0,0 +1,37 @@
1
+ import React from "react";
2
+ import { DialogProps } from "../dialog";
3
+ import { IconType } from "../icon";
4
+ export interface ConfirmProps extends Omit<DialogProps, "className" | "disableFocusTrap" | "bespokeFocusTrap" | "focusableSelectors" | "help" | "role" | "contentPadding" | "focusableContainers" | "ariaRole" | "timeout" | "enableBackgroundUI" | "disableClose"> {
5
+ /** Color variants for new business themes: "primary" | "secondary" | "tertiary" | "dashed" | "darkBackground" */
6
+ cancelButtonType?: "primary" | "secondary" | "tertiary" | "dashed" | "darkBackground";
7
+ /** Color variants for new business themes: "primary" | "secondary" | "tertiary" | "dashed" | "darkBackground" */
8
+ confirmButtonType?: "primary" | "secondary" | "tertiary" | "dashed" | "darkBackground";
9
+ /** Customise the cancel button label */
10
+ cancelLabel?: string;
11
+ /** Customise the confirm button label */
12
+ confirmLabel?: string;
13
+ /** Apply destructive style to the cancel button */
14
+ cancelButtonDestructive?: boolean;
15
+ /** Apply destructive style to the confirm button */
16
+ confirmButtonDestructive?: boolean;
17
+ /** Defines a cancel button Icon position related to the children: "before" | "after" */
18
+ cancelButtonIconPosition?: "before" | "after";
19
+ /** Defines an Icon type within the cancel button (see Icon for options) */
20
+ cancelButtonIconType?: IconType;
21
+ /** Defines a cancel button Icon position related to the children: "before" | "after" */
22
+ confirmButtonIconPosition?: "before" | "after";
23
+ /** Defines an Icon type within the confirm button (see Icon for options) */
24
+ confirmButtonIconType?: IconType;
25
+ /** Makes cancel button disabled */
26
+ disableCancel?: boolean;
27
+ /** Makes confirm button disabled */
28
+ disableConfirm?: boolean;
29
+ /** Defines an Icon type within the button (see Icon for options) */
30
+ iconType?: "error" | "warning";
31
+ /** Adds isLoading state into confirm button */
32
+ isLoadingConfirm?: boolean;
33
+ /** A custom event handler when a confirmation takes place */
34
+ onConfirm: (ev: React.MouseEvent<HTMLButtonElement>) => void;
35
+ }
36
+ export declare const Confirm: ({ "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-label": ariaLabel, open, children, cancelButtonDestructive, confirmButtonDestructive, cancelButtonType, confirmButtonType, cancelButtonIconType, cancelButtonIconPosition, confirmButtonIconType, confirmButtonIconPosition, cancelLabel, onCancel, disableCancel, onConfirm, isLoadingConfirm, disableConfirm, confirmLabel, iconType, subtitle, title, size, showCloseIcon, ...rest }: ConfirmProps) => JSX.Element;
37
+ export default Confirm;
@@ -17,10 +17,10 @@ const Confirm = ({
17
17
  "aria-label": ariaLabel,
18
18
  open,
19
19
  children,
20
- cancelButtonDestructive,
21
- confirmButtonDestructive,
22
- cancelButtonType,
23
- confirmButtonType,
20
+ cancelButtonDestructive = false,
21
+ confirmButtonDestructive = false,
22
+ cancelButtonType = "secondary",
23
+ confirmButtonType = "primary",
24
24
  cancelButtonIconType,
25
25
  cancelButtonIconPosition,
26
26
  confirmButtonIconType,
@@ -35,6 +35,8 @@ const Confirm = ({
35
35
  iconType,
36
36
  subtitle,
37
37
  title,
38
+ size = "extra-small",
39
+ showCloseIcon = false,
38
40
  ...rest
39
41
  }) => {
40
42
  const l = useLocale();
@@ -112,122 +114,53 @@ const Confirm = ({
112
114
  subtitle: subtitle,
113
115
  title: getTitle(),
114
116
  "data-component": "confirm",
115
- role: "alertdialog"
117
+ role: "alertdialog",
118
+ size: size,
119
+ showCloseIcon: showCloseIcon
116
120
  }, ariaProps, rest), children, /*#__PURE__*/React.createElement(StyledConfirmButtons, null, renderCancelButton(), renderConfirmButton()));
117
121
  };
118
122
 
119
- Confirm.defaultProps = {
120
- size: "extra-small",
121
- showCloseIcon: false,
122
- cancelButtonDestructive: false,
123
- confirmButtonDestructive: false,
124
- iconType: null,
125
- cancelButtonType: "secondary",
126
- confirmButtonType: "primary"
127
- };
128
123
  Confirm.propTypes = {
129
- /** Prop to specify the aria-describedby property of the component */
130
124
  "aria-describedby": PropTypes.string,
131
-
132
- /**
133
- * Prop to specify the aria-label of the component.
134
- * To be used only when the title prop is not defined, and the component is not labelled by any internal element.
135
- */
136
125
  "aria-label": PropTypes.string,
137
-
138
- /**
139
- * Prop to specify the aria-labeledby property of the component
140
- * To be used when the title prop is a custom React Node,
141
- * or the component is labelled by an internal element other than the title.
142
- */
143
126
  "aria-labelledby": PropTypes.string,
144
-
145
- /** Confirm content */
146
- children: PropTypes.node,
147
-
148
- /** Controls the open state of the component */
149
- open: PropTypes.bool.isRequired,
150
-
151
- /** A custom close event handler */
152
- onCancel: PropTypes.func,
153
-
154
- /** Determines if the Esc Key closes the Confirm */
155
- disableEscKey: PropTypes.bool,
156
-
157
- /** Allows developers to specify a specific height for the Confirm. */
158
- height: PropTypes.string,
159
-
160
- /** Title displayed at top of component */
161
- title: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
162
-
163
- /** Subtitle displayed at top of component */
164
- subtitle: PropTypes.string,
165
-
166
- /** Size of component */
167
- size: PropTypes.oneOf(["auto", "extra-small", "small", "medium-small", "medium", "medium-large", "large", "extra-large"]),
168
-
169
- /** Determines if the close icon is shown */
170
- showCloseIcon: PropTypes.bool,
171
-
172
- /** Optional reference to an element meant to be focused on open */
173
- focusFirstElement: PropTypes.shape({
174
- current: PropTypes.any
127
+ "cancelButtonDestructive": PropTypes.bool,
128
+ "cancelButtonIconPosition": PropTypes.oneOf(["after", "before"]),
129
+ "cancelButtonIconType": PropTypes.oneOf(["add", "admin", "alert_on", "alert", "analysis", "arrow_down", "arrow_left_boxed", "arrow_left_right_small", "arrow_left_small", "arrow_left", "arrow_right_small", "arrow_right", "arrow_up", "arrow", "attach", "bank", "basket_with_squares", "basket", "bin", "block_arrow_right", "blocked_square", "blocked", "bold", "box_arrow_left", "boxed_shapes", "bulk_destroy", "bullet_list_dotted", "bullet_list_numbers", "bullet_list", "business", "calendar_today", "calendar", "call", "camera", "card_view", "caret_down", "caret_large_down", "caret_large_left", "caret_large_right", "caret_large_up", "caret_left", "caret_right", "caret_up", "cart", "chart_bar", "chart_line", "chart_pie", "chat_notes", "chat", "chevron_down_thick", "chevron_down", "chevron_left_thick", "chevron_left", "chevron_right_thick", "chevron_right", "chevron_up_thick", "chevron_up", "circle_with_dots", "circles_connection", "clock", "close", "coins", "collaborate", "computer_clock", "connect", "contacts", "copy", "create", "credit_card_slash", "credit_card", "cross_circle", "cross", "csv", "delete", "delivery", "disconnect", "disputed", "document_right_align", "document_tick", "document_vertical_lines", "download", "draft", "drag_vertical", "drag", "dropdown", "duplicate", "edit", "edited", "ellipsis_horizontal", "ellipsis_vertical", "email_switch", "email", "entry", "envelope_dollar", "envelope_euro", "error_square", "error", "euro", "expand", "factory", "favourite_lined", "favourite", "fax", "feedback", "file_excel", "file_generic", "file_image", "file_pdf", "file_word", "files_leaning", "filter_new", "filter", "fit_height", "fit_width", "flag", "folder", "gift", "go", "graph", "grid", "help", "hide", "home", "image", "in_progress", "in_transit", "individual", "info", "italic", "key", "ledger_arrow_left", "ledger_arrow_right", "ledger", "lightbulb_off", "lightbulb_on", "link", "list_view", "location", "locked", "logout", "lookup", "marker", "message", "minus_large", "minus", "mobile", "money_bag", "none", "old_warning", "palm_tree", "pause_circle", "pause", "pdf", "people_switch", "people", "person_info", "person_tick", "person", "phone", "piggy_bank", "play_circle", "play", "plus_large", "plus", "pound", "print", "progress", "progressed", "question_hollow", "question_mark", "question", "refresh_clock", "refresh", "remove", "sage_coin", "save", "scan", "search", "services", "settings_old", "settings", "share", "shop", "sort_down", "sort_up", "spanner", "split_container", "split", "square_dot", "squares_nine", "stacked_boxes", "stacked_squares", "submitted", "sync", "tag", "talk", "three_boxes", "tick_circle", "tick_thick", "tick", "true_tick", "u_turn_left", "u_turn_right", "undo", "unlocked", "upload", "uploaded", "video", "view", "warning"]),
130
+ "cancelButtonType": PropTypes.oneOf(["darkBackground", "dashed", "primary", "secondary", "tertiary"]),
131
+ "cancelLabel": PropTypes.string,
132
+ "children": PropTypes.node,
133
+ "confirmButtonDestructive": PropTypes.bool,
134
+ "confirmButtonIconPosition": PropTypes.oneOf(["after", "before"]),
135
+ "confirmButtonIconType": PropTypes.oneOf(["add", "admin", "alert_on", "alert", "analysis", "arrow_down", "arrow_left_boxed", "arrow_left_right_small", "arrow_left_small", "arrow_left", "arrow_right_small", "arrow_right", "arrow_up", "arrow", "attach", "bank", "basket_with_squares", "basket", "bin", "block_arrow_right", "blocked_square", "blocked", "bold", "box_arrow_left", "boxed_shapes", "bulk_destroy", "bullet_list_dotted", "bullet_list_numbers", "bullet_list", "business", "calendar_today", "calendar", "call", "camera", "card_view", "caret_down", "caret_large_down", "caret_large_left", "caret_large_right", "caret_large_up", "caret_left", "caret_right", "caret_up", "cart", "chart_bar", "chart_line", "chart_pie", "chat_notes", "chat", "chevron_down_thick", "chevron_down", "chevron_left_thick", "chevron_left", "chevron_right_thick", "chevron_right", "chevron_up_thick", "chevron_up", "circle_with_dots", "circles_connection", "clock", "close", "coins", "collaborate", "computer_clock", "connect", "contacts", "copy", "create", "credit_card_slash", "credit_card", "cross_circle", "cross", "csv", "delete", "delivery", "disconnect", "disputed", "document_right_align", "document_tick", "document_vertical_lines", "download", "draft", "drag_vertical", "drag", "dropdown", "duplicate", "edit", "edited", "ellipsis_horizontal", "ellipsis_vertical", "email_switch", "email", "entry", "envelope_dollar", "envelope_euro", "error_square", "error", "euro", "expand", "factory", "favourite_lined", "favourite", "fax", "feedback", "file_excel", "file_generic", "file_image", "file_pdf", "file_word", "files_leaning", "filter_new", "filter", "fit_height", "fit_width", "flag", "folder", "gift", "go", "graph", "grid", "help", "hide", "home", "image", "in_progress", "in_transit", "individual", "info", "italic", "key", "ledger_arrow_left", "ledger_arrow_right", "ledger", "lightbulb_off", "lightbulb_on", "link", "list_view", "location", "locked", "logout", "lookup", "marker", "message", "minus_large", "minus", "mobile", "money_bag", "none", "old_warning", "palm_tree", "pause_circle", "pause", "pdf", "people_switch", "people", "person_info", "person_tick", "person", "phone", "piggy_bank", "play_circle", "play", "plus_large", "plus", "pound", "print", "progress", "progressed", "question_hollow", "question_mark", "question", "refresh_clock", "refresh", "remove", "sage_coin", "save", "scan", "search", "services", "settings_old", "settings", "share", "shop", "sort_down", "sort_up", "spanner", "split_container", "split", "square_dot", "squares_nine", "stacked_boxes", "stacked_squares", "submitted", "sync", "tag", "talk", "three_boxes", "tick_circle", "tick_thick", "tick", "true_tick", "u_turn_left", "u_turn_right", "undo", "unlocked", "upload", "uploaded", "video", "view", "warning"]),
136
+ "confirmButtonType": PropTypes.oneOf(["darkBackground", "dashed", "primary", "secondary", "tertiary"]),
137
+ "confirmLabel": PropTypes.string,
138
+ "data-component": PropTypes.string,
139
+ "data-element": PropTypes.string,
140
+ "data-role": PropTypes.string,
141
+ "disableAutoFocus": PropTypes.bool,
142
+ "disableCancel": PropTypes.bool,
143
+ "disableConfirm": PropTypes.bool,
144
+ "disableEscKey": PropTypes.bool,
145
+ "focusFirstElement": PropTypes.shape({
146
+ "current": PropTypes.oneOfType([PropTypes.oneOf([null]), function (props, propName) {
147
+ if (props[propName] == null) {
148
+ return new Error("Prop '" + propName + "' is required but wasn't specified");
149
+ } else if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) {
150
+ return new Error("Expected prop '" + propName + "' to be of type Element");
151
+ }
152
+ }]).isRequired
175
153
  }),
176
-
177
- /** Disables auto focus functionality on child elements */
178
- disableAutoFocus: PropTypes.bool,
179
-
180
- /** A custom event handler when a confirmation takes place */
181
- onConfirm: PropTypes.func.isRequired,
182
-
183
- /** Customise the confirm button label */
184
- confirmLabel: PropTypes.string,
185
-
186
- /** Customise the cancel button label */
187
- cancelLabel: PropTypes.string,
188
-
189
- /** Apply destructive style to the cancel button */
190
- cancelButtonDestructive: PropTypes.bool,
191
-
192
- /** Apply destructive style to the confirm button */
193
- confirmButtonDestructive: PropTypes.bool,
194
-
195
- /** Defines a cancel button Icon position related to the children: "before" | "after" */
196
- cancelButtonIconPosition: PropTypes.oneOf(["before", "after"]),
197
-
198
- /**
199
- * <a href="https://brand.sage.com/d/NdbrveWvNheA/foundations#/icons/icons" target="_blank">List of supported icons</a>
200
- *
201
- * Defines an Icon type within the cancel button (see Icon for options)
202
- * */
203
- cancelButtonIconType: PropTypes.string,
204
-
205
- /** Defines a confirm button Icon position related to the children: "before" | "after" */
206
- confirmButtonIconPosition: PropTypes.oneOf(["before", "after"]),
207
-
208
- /**
209
- * <a href="https://brand.sage.com/d/NdbrveWvNheA/foundations#/icons/icons" target="_blank">List of supported icons</a>
210
- *
211
- * Defines an Icon type within the confirm button (see Icon for options)
212
- * */
213
- confirmButtonIconType: PropTypes.string,
214
-
215
- /** Defines an Icon type within the button (see Icon for options) */
216
- iconType: PropTypes.oneOf(["error", "warning"]),
217
-
218
- /** Makes cancel button disabled */
219
- disableCancel: PropTypes.bool,
220
-
221
- /** Makes confirm button disabled */
222
- disableConfirm: PropTypes.bool,
223
-
224
- /** Color variants for new business themes: "primary" | "secondary" | "tertiary" | "dashed" | "darkBackground" */
225
- cancelButtonType: PropTypes.oneOf(["primary", "secondary", "tertiary", "dashed", "darkBackground"]),
226
-
227
- /** Color variants for new business themes: "primary" | "secondary" | "tertiary" | "dashed" | "darkBackground" */
228
- confirmButtonType: PropTypes.oneOf(["primary", "secondary", "tertiary", "dashed", "darkBackground"]),
229
-
230
- /** Adds isLoading state into confirm button */
231
- isLoadingConfirm: PropTypes.bool
154
+ "height": PropTypes.string,
155
+ "iconType": PropTypes.oneOf(["error", "warning"]),
156
+ "isLoadingConfirm": PropTypes.bool,
157
+ "onCancel": PropTypes.func,
158
+ "onConfirm": PropTypes.func.isRequired,
159
+ "open": PropTypes.bool.isRequired,
160
+ "showCloseIcon": PropTypes.bool,
161
+ "size": PropTypes.oneOf(["auto", "extra-large", "extra-small", "large", "medium-large", "medium-small", "medium", "small"]),
162
+ "subtitle": PropTypes.string,
163
+ "title": PropTypes.node
232
164
  };
165
+ export { Confirm };
233
166
  export default Confirm;
@@ -0,0 +1 @@
1
+ export declare const CONFIRM_SIZES: string[];
@@ -0,0 +1,5 @@
1
+ import { ConfirmProps } from ".";
2
+ export declare const StyledConfirmButtons: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ export declare const StyledConfirmHeading: import("styled-components").StyledComponent<"div", any, {
4
+ type: ConfirmProps["iconType"];
5
+ }, never>;
@@ -1,5 +1,4 @@
1
1
  import styled, { css } from "styled-components";
2
- import PropTypes from "prop-types";
3
2
  import StyledIcon from "../icon/icon.style";
4
3
  import { StyledHeadingTitle } from "../heading/heading.style";
5
4
  export const StyledConfirmButtons = styled.div`
@@ -29,7 +28,4 @@ export const StyledConfirmHeading = styled.div`
29
28
  color: var(--colorsSemanticNegative500);
30
29
  `}
31
30
  }
32
- `;
33
- StyledConfirmHeading.propTypes = {
34
- type: PropTypes.oneOf(["error", "warning"])
35
- };
31
+ `;
@@ -1 +1,2 @@
1
- export { default } from "./confirm";
1
+ export { default } from "./confirm.component";
2
+ export type { ConfirmProps } from "./confirm.component";
@@ -0,0 +1,7 @@
1
+ declare type StyledContentProps = {
2
+ hasHeader: boolean;
3
+ hasStickyFooter: boolean;
4
+ disableContentPadding?: boolean;
5
+ };
6
+ declare const StyledContent: import("styled-components").StyledComponent<"div", any, StyledContentProps, never>;
7
+ export default StyledContent;
@@ -0,0 +1,55 @@
1
+ import React from "react";
2
+ import { ModalProps } from "../modal";
3
+ export interface DialogFullScreenProps extends ModalProps {
4
+ /** Prop to specify the aria-describedby property of the DialogFullscreen component */
5
+ "aria-describedby"?: string;
6
+ /**
7
+ * Prop to specify the aria-label of the DialogFullscreen component.
8
+ * To be used only when the title prop is not defined, and the component is not labelled by any internal element.
9
+ */
10
+ "aria-label"?: string;
11
+ /**
12
+ * Prop to specify the aria-labelledby property of the DialogFullscreen component
13
+ * To be used when the title prop is a custom React Node,
14
+ * or the component is labelled by an internal element other than the title.
15
+ */
16
+ "aria-labelledby"?: string;
17
+ /** Child elements */
18
+ children?: React.ReactNode;
19
+ /** Reference to the scrollable content element */
20
+ contentRef?: React.ForwardedRef<HTMLDivElement>;
21
+ /** Disables auto focus functionality on child elements */
22
+ disableAutoFocus?: boolean;
23
+ /** remove padding from content */
24
+ disableContentPadding?: boolean;
25
+ /** Optional reference to an element meant to be focused on open */
26
+ focusFirstElement?: React.MutableRefObject<HTMLElement | null>;
27
+ /**
28
+ * Function to replace focus trap
29
+ * @ignore
30
+ * @private
31
+ */
32
+ bespokeFocusTrap?: (ev: KeyboardEvent, firstElement?: HTMLElement, lastElement?: HTMLElement) => void;
33
+ /** Container for components to be displayed in the header */
34
+ headerChildren?: React.ReactNode;
35
+ /** Adds Help tooltip to Header */
36
+ help?: string;
37
+ /** For legacy styling when used with Pages component. Do not use this unless using Pages within a DialogFullScreen */
38
+ pagesStyling?: boolean;
39
+ /** Determines if the close icon is shown */
40
+ showCloseIcon?: boolean;
41
+ /** Subtitle displayed at top of dialog */
42
+ subtitle?: string;
43
+ /** Title displayed at top of dialog */
44
+ title?: React.ReactNode;
45
+ /** The ARIA role to be applied to the DialogFullscreen container */
46
+ role?: string;
47
+ /** an optional array of refs to containers whose content should also be reachable by tabbing from the dialog */
48
+ focusableContainers?: React.MutableRefObject<HTMLElement | null>[];
49
+ /** Optional selector to identify the focusable elements, if not provided a default selector is used */
50
+ focusableSelectors?: string;
51
+ /** A custom close event handler */
52
+ onCancel?: (ev: React.KeyboardEvent<HTMLElement> | React.MouseEvent<HTMLButtonElement>) => void;
53
+ }
54
+ export declare const DialogFullScreen: ({ "aria-describedby": ariaDescribedBy, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, disableAutoFocus, focusFirstElement, bespokeFocusTrap, open, children, title, subtitle, pagesStyling, headerChildren, showCloseIcon, disableContentPadding, disableEscKey, onCancel, contentRef, help, role, focusableContainers, focusableSelectors, ...rest }: DialogFullScreenProps) => JSX.Element;
55
+ export default DialogFullScreen;
@@ -19,7 +19,7 @@ const DialogFullScreen = ({
19
19
  "aria-describedby": ariaDescribedBy,
20
20
  "aria-label": ariaLabel,
21
21
  "aria-labelledby": ariaLabelledBy,
22
- disableAutoFocus,
22
+ disableAutoFocus = false,
23
23
  focusFirstElement,
24
24
  bespokeFocusTrap,
25
25
  open,
@@ -28,7 +28,7 @@ const DialogFullScreen = ({
28
28
  subtitle,
29
29
  pagesStyling,
30
30
  headerChildren,
31
- showCloseIcon,
31
+ showCloseIcon = true,
32
32
  disableContentPadding,
33
33
  disableEscKey,
34
34
  onCancel,
@@ -115,89 +115,54 @@ const DialogFullScreen = ({
115
115
  }, children))));
116
116
  };
117
117
 
118
- DialogFullScreen.defaultProps = {
119
- showCloseIcon: true,
120
- disableAutoFocus: false
121
- };
122
118
  DialogFullScreen.propTypes = {
123
- /** Prop to specify the aria-describedby property of the DialogFullscreen component */
124
119
  "aria-describedby": PropTypes.string,
125
-
126
- /**
127
- * Prop to specify the aria-label of the DialogFullscreen component.
128
- * To be used only when the title prop is not defined, and the component is not labelled by any internal element.
129
- */
130
120
  "aria-label": PropTypes.string,
131
-
132
- /**
133
- * Prop to specify the aria-labelledby property of the DialogFullscreen component
134
- * To be used when the title prop is a custom React Node,
135
- * or the component is labelled by an internal element other than the title.
136
- */
137
121
  "aria-labelledby": PropTypes.string,
138
-
139
- /** Controls the open state of the component */
140
- open: PropTypes.bool.isRequired,
141
-
142
- /** A custom close event handler */
143
- onCancel: PropTypes.func,
144
-
145
- /** Optional reference to an element meant to be focused on open */
146
- focusFirstElement: PropTypes.shape({
147
- current: PropTypes.any
148
- }),
149
-
150
- /** Disables auto focus functionality on child elements */
151
- disableAutoFocus: PropTypes.bool,
152
-
153
- /**
154
- * Function to replace focus trap
155
- * @ignore
156
- * @private
157
- */
158
- bespokeFocusTrap: PropTypes.func,
159
-
160
- /** Determines if the Esc Key closes the Dialog */
161
- disableEscKey: PropTypes.bool,
162
-
163
- /** Adds Help tooltip to Header */
164
- help: PropTypes.string,
165
-
166
- /** remove padding from content */
167
- disableContentPadding: PropTypes.bool,
168
-
169
- /** Child elements */
170
- children: PropTypes.node,
171
-
172
- /** Title displayed at top of dialog */
173
- title: PropTypes.node,
174
-
175
- /** Subtitle displayed at top of dialog */
176
- subtitle: PropTypes.string,
177
-
178
- /** Determines if the close icon is shown */
179
- showCloseIcon: PropTypes.bool,
180
-
181
- /** Container for components to be displayed in the header */
182
- headerChildren: PropTypes.node,
183
-
184
- /** For legacy styling when used with Pages component. Do not use this unless using Pages within a DialogFullScreen */
185
- pagesStyling: PropTypes.bool,
186
-
187
- /** Reference to the scrollable content element */
188
- contentRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
189
- current: PropTypes.instanceOf(Element)
122
+ "ariaRole": PropTypes.string,
123
+ "bespokeFocusTrap": PropTypes.func,
124
+ "children": PropTypes.node,
125
+ "className": PropTypes.string,
126
+ "contentRef": PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
127
+ "current": PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.object]).isRequired
190
128
  })]),
191
-
192
- /** The ARIA role to be applied to the DialogFullscreen container */
193
- role: PropTypes.string,
194
-
195
- /** an optional array of refs to containers whose content should also be reachable by tabbing from the dialog */
196
- focusableContainers: PropTypes.arrayOf(PropTypes.shape({
197
- current: PropTypes.any
129
+ "data-component": PropTypes.string,
130
+ "data-element": PropTypes.string,
131
+ "data-role": PropTypes.string,
132
+ "disableAutoFocus": PropTypes.bool,
133
+ "disableClose": PropTypes.bool,
134
+ "disableContentPadding": PropTypes.bool,
135
+ "disableEscKey": PropTypes.bool,
136
+ "enableBackgroundUI": PropTypes.bool,
137
+ "focusableContainers": PropTypes.arrayOf(PropTypes.shape({
138
+ "current": PropTypes.oneOfType([PropTypes.oneOf([null]), function (props, propName) {
139
+ if (props[propName] == null) {
140
+ return new Error("Prop '" + propName + "' is required but wasn't specified");
141
+ } else if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) {
142
+ return new Error("Expected prop '" + propName + "' to be of type Element");
143
+ }
144
+ }]).isRequired
198
145
  })),
199
-
200
- /** Optional selector to identify the focusable elements, if not provided a default selector is used */
201
- focusableSelectors: PropTypes.string
146
+ "focusableSelectors": PropTypes.string,
147
+ "focusFirstElement": PropTypes.shape({
148
+ "current": PropTypes.oneOfType([PropTypes.oneOf([null]), function (props, propName) {
149
+ if (props[propName] == null) {
150
+ return new Error("Prop '" + propName + "' is required but wasn't specified");
151
+ } else if (typeof props[propName] !== 'object' || props[propName].nodeType !== 1) {
152
+ return new Error("Expected prop '" + propName + "' to be of type Element");
153
+ }
154
+ }]).isRequired
155
+ }),
156
+ "headerChildren": PropTypes.node,
157
+ "help": PropTypes.string,
158
+ "onCancel": PropTypes.func,
159
+ "open": PropTypes.bool.isRequired,
160
+ "pagesStyling": PropTypes.bool,
161
+ "role": PropTypes.string,
162
+ "showCloseIcon": PropTypes.bool,
163
+ "subtitle": PropTypes.string,
164
+ "timeout": PropTypes.number,
165
+ "title": PropTypes.node
202
166
  };
167
+ export { DialogFullScreen };
203
168
  export default DialogFullScreen;
@@ -0,0 +1,4 @@
1
+ declare const StyledDialogFullScreen: import("styled-components").StyledComponent<"div", any, {
2
+ pagesStyling?: boolean | undefined;
3
+ }, never>;
4
+ export default StyledDialogFullScreen;
@@ -1 +1,2 @@
1
- export { default } from "./dialog-full-screen";
1
+ export { default } from "./dialog-full-screen.component";
2
+ export type { DialogFullScreenProps } from "./dialog-full-screen.component";
@@ -1,11 +1,12 @@
1
1
  import React from "react";
2
+ import { TagProps } from "../../__internal__/utils/helpers/tags";
2
3
  export interface ModalContextProps {
3
4
  isInModal?: boolean;
4
5
  isAnimationComplete?: boolean;
5
6
  triggerRefocusFlag?: boolean;
6
7
  }
7
8
  export declare const ModalContext: React.Context<ModalContextProps>;
8
- export interface ModalProps {
9
+ export interface ModalProps extends TagProps {
9
10
  /** Custom class name */
10
11
  className?: string;
11
12
  /** Modal content */
@@ -100,6 +100,9 @@ Modal.propTypes = {
100
100
  "ariaRole": PropTypes.string,
101
101
  "children": PropTypes.node,
102
102
  "className": PropTypes.string,
103
+ "data-component": PropTypes.string,
104
+ "data-element": PropTypes.string,
105
+ "data-role": PropTypes.string,
103
106
  "disableClose": PropTypes.bool,
104
107
  "disableEscKey": PropTypes.bool,
105
108
  "enableBackgroundUI": PropTypes.bool,
@@ -6,8 +6,7 @@ import styledSystemPropTypes from "@styled-system/prop-types";
6
6
  import StyledTileFooter from "./tile-footer.style";
7
7
  import { filterStyledSystemPaddingProps } from "../../../style/utils";
8
8
  const paddingPropTypes = filterStyledSystemPaddingProps(styledSystemPropTypes.space);
9
-
10
- const TileFooter = ({
9
+ export const TileFooter = ({
11
10
  variant,
12
11
  children,
13
12
  ...props
@@ -17,11 +16,10 @@ const TileFooter = ({
17
16
  variant: variant
18
17
  }, props), children);
19
18
  };
20
-
21
19
  TileFooter.propTypes = { ...paddingPropTypes,
22
20
 
23
- /** set which background color variant should be used */
24
- variant: PropTypes.oneOf(["default", "transparent"]),
21
+ /** Sets which background color variant should be used */
22
+ variant: PropTypes.oneOf(["default", "black", "transparent"]),
25
23
  children: PropTypes.node
26
24
  };
27
25
  export default TileFooter;
@@ -3,7 +3,7 @@ import { PaddingProps } from "styled-system";
3
3
 
4
4
  export interface TileFooterProps extends PaddingProps {
5
5
  /** set which background color variant should be used */
6
- variant?: "default" | "transparent";
6
+ variant?: "default" | "black" | "transparent";
7
7
  }
8
8
 
9
9
  declare function TileFooter(