carbon-react 111.16.0 → 111.17.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.
- package/esm/components/confirm/confirm.component.d.ts +37 -0
- package/esm/components/confirm/confirm.component.js +46 -113
- package/esm/components/confirm/confirm.config.d.ts +1 -0
- package/esm/components/confirm/confirm.style.d.ts +5 -0
- package/esm/components/confirm/confirm.style.js +1 -5
- package/esm/components/confirm/index.d.ts +2 -1
- package/esm/components/dialog-full-screen/content.style.d.ts +7 -0
- package/esm/components/dialog-full-screen/dialog-full-screen.component.d.ts +55 -0
- package/esm/components/dialog-full-screen/dialog-full-screen.component.js +45 -80
- package/esm/components/dialog-full-screen/dialog-full-screen.style.d.ts +4 -0
- package/esm/components/dialog-full-screen/index.d.ts +2 -1
- package/esm/components/modal/modal.component.d.ts +2 -1
- package/esm/components/modal/modal.component.js +3 -0
- package/esm/components/tile/tile-footer/tile-footer.component.js +3 -5
- package/esm/components/tile/tile-footer/tile-footer.d.ts +1 -1
- package/esm/components/tile/tile-footer/tile-footer.style.js +15 -1
- package/esm/components/tile/tile.component.js +10 -3
- package/esm/components/tile/tile.d.ts +15 -0
- package/esm/components/tile/tile.style.js +30 -3
- package/esm/style/design-tokens/debug-theme.util.d.ts +15 -1
- package/esm/style/themes/sage/index.d.ts +15 -1
- package/lib/components/confirm/confirm.component.d.ts +37 -0
- package/lib/components/confirm/confirm.component.js +47 -114
- package/lib/components/confirm/confirm.config.d.ts +1 -0
- package/lib/components/confirm/confirm.style.d.ts +5 -0
- package/lib/components/confirm/confirm.style.js +1 -6
- package/lib/components/confirm/index.d.ts +2 -1
- package/lib/components/dialog-full-screen/content.style.d.ts +7 -0
- package/lib/components/dialog-full-screen/dialog-full-screen.component.d.ts +55 -0
- package/lib/components/dialog-full-screen/dialog-full-screen.component.js +46 -81
- package/lib/components/dialog-full-screen/dialog-full-screen.style.d.ts +4 -0
- package/lib/components/dialog-full-screen/index.d.ts +2 -1
- package/lib/components/modal/modal.component.d.ts +2 -1
- package/lib/components/modal/modal.component.js +3 -0
- package/lib/components/tile/tile-footer/tile-footer.component.js +4 -3
- package/lib/components/tile/tile-footer/tile-footer.d.ts +1 -1
- package/lib/components/tile/tile-footer/tile-footer.style.js +14 -1
- package/lib/components/tile/tile.component.js +12 -2
- package/lib/components/tile/tile.d.ts +15 -0
- package/lib/components/tile/tile.style.js +29 -3
- package/lib/style/design-tokens/debug-theme.util.d.ts +15 -1
- package/lib/style/themes/sage/index.d.ts +15 -1
- package/package.json +3 -3
- package/esm/components/confirm/confirm.d.ts +0 -50
- package/esm/components/dialog-full-screen/dialog-full-screen.d.ts +0 -52
- package/lib/components/confirm/confirm.d.ts +0 -50
- package/lib/components/dialog-full-screen/dialog-full-screen.d.ts +0 -52
|
@@ -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
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
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
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
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
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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
|
-
|
|
193
|
-
role: PropTypes.string,
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
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
|
-
|
|
201
|
-
|
|
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;
|
|
@@ -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
|
-
/**
|
|
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(
|
|
@@ -1,13 +1,27 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
2
|
import { padding } from "styled-system";
|
|
3
3
|
import { baseTheme } from "../../../style/themes";
|
|
4
|
+
|
|
5
|
+
const getBackgroundColor = variant => {
|
|
6
|
+
switch (variant) {
|
|
7
|
+
case "transparent":
|
|
8
|
+
return "transparent";
|
|
9
|
+
|
|
10
|
+
case "black":
|
|
11
|
+
return "var(--colorsUtilityYin100)";
|
|
12
|
+
|
|
13
|
+
default:
|
|
14
|
+
return "var(--colorsUtilityMajor100)";
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
4
18
|
const StyledTileFooter = styled.div`
|
|
5
19
|
${padding}
|
|
6
20
|
|
|
7
21
|
${({
|
|
8
22
|
variant
|
|
9
23
|
}) => css`
|
|
10
|
-
background: ${variant
|
|
24
|
+
background: ${getBackgroundColor(variant)};
|
|
11
25
|
border-top: 1px solid var(--colorsUtilityMajor100);
|
|
12
26
|
`}
|
|
13
27
|
`;
|
|
@@ -4,8 +4,7 @@ import React from "react";
|
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
5
|
import propTypes from "@styled-system/prop-types";
|
|
6
6
|
import { StyledTile, TileContent } from "./tile.style.js";
|
|
7
|
-
|
|
8
|
-
const Tile = ({
|
|
7
|
+
export const Tile = ({
|
|
9
8
|
variant = "tile",
|
|
10
9
|
p = 3,
|
|
11
10
|
children,
|
|
@@ -48,6 +47,8 @@ const Tile = ({
|
|
|
48
47
|
p: p
|
|
49
48
|
}, props), wrappedChildren);
|
|
50
49
|
};
|
|
50
|
+
/** TODO: When we convert this to typescript, dynamically pull the border tokens for borderWidth
|
|
51
|
+
* See how the Box component does this with boxShadows for an example */
|
|
51
52
|
|
|
52
53
|
Tile.propTypes = {
|
|
53
54
|
/** Styled system spacing props */
|
|
@@ -72,6 +73,12 @@ Tile.propTypes = {
|
|
|
72
73
|
* Set a percentage-based width for the whole Tile component, relative to its parent.
|
|
73
74
|
* If unset or zero, this will default to 100%.
|
|
74
75
|
*/
|
|
75
|
-
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
76
|
+
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
77
|
+
|
|
78
|
+
/** Sets the border width by using these design tokens */
|
|
79
|
+
borderWidth: PropTypes.oneOf(["borderWidth000", "borderWidth100", "borderWidth200", "borderWidth300", "borderWidth400"]),
|
|
80
|
+
|
|
81
|
+
/** Sets the border variant that should be used */
|
|
82
|
+
borderVariant: PropTypes.oneOf(["default", "selected", "positive", "negative", "caution", "info"])
|
|
76
83
|
};
|
|
77
84
|
export default Tile;
|
|
@@ -24,6 +24,21 @@ export interface TileProps extends SpaceProps {
|
|
|
24
24
|
* If unset or zero, this will default to 100%.
|
|
25
25
|
*/
|
|
26
26
|
width?: string | number;
|
|
27
|
+
/** Sets the border width by using these design tokens */
|
|
28
|
+
borderWidth?:
|
|
29
|
+
| "borderWidth000"
|
|
30
|
+
| "borderWidth100"
|
|
31
|
+
| "borderWidth200"
|
|
32
|
+
| "borderWidth300"
|
|
33
|
+
| "borderWidth400";
|
|
34
|
+
/** Sets the border variant that should be used */
|
|
35
|
+
borderVariant?:
|
|
36
|
+
| "default"
|
|
37
|
+
| "selected"
|
|
38
|
+
| "positive"
|
|
39
|
+
| "negative"
|
|
40
|
+
| "caution"
|
|
41
|
+
| "info";
|
|
27
42
|
}
|
|
28
43
|
|
|
29
44
|
declare function Tile(props: TileProps): JSX.Element;
|