carbon-react 132.2.1 → 133.0.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/README.md +1 -1
- package/esm/__internal__/input/input.component.d.ts +0 -2
- package/esm/__internal__/input/input.component.js +0 -8
- package/esm/components/button/button-types.style.d.ts +0 -1
- package/esm/components/button/button-types.style.js +0 -21
- package/esm/components/button/button.component.d.ts +1 -5
- package/esm/components/button/button.component.js +5 -377
- package/esm/components/button/button.config.js +1 -1
- package/esm/components/button/index.d.ts +1 -1
- package/esm/components/button/index.js +1 -1
- package/esm/components/checkbox/checkbox.component.d.ts +0 -2
- package/esm/components/checkbox/checkbox.component.js +1 -10
- package/esm/components/confirm/confirm.component.d.ts +4 -4
- package/esm/components/date/date.component.js +0 -9
- package/esm/components/decimal/decimal.component.js +1 -9
- package/esm/components/grouped-character/grouped-character.component.js +0 -8
- package/esm/components/icon/icon.component.d.ts +2 -1
- package/esm/components/icon/icon.component.js +7 -3
- package/esm/components/number/number.component.js +0 -8
- package/esm/components/radio-button/radio-button.component.d.ts +0 -2
- package/esm/components/radio-button/radio-button.component.js +1 -11
- package/esm/components/select/filterable-select/filterable-select.component.js +2 -10
- package/esm/components/select/list-action-button/list-action-button.component.js +1 -1
- package/esm/components/select/multi-select/multi-select.component.js +2 -10
- package/esm/components/select/select-textbox/select-textbox.component.js +0 -1
- package/esm/components/select/simple-select/simple-select.component.js +2 -10
- package/esm/components/switch/switch.component.d.ts +0 -2
- package/esm/components/switch/switch.component.js +2 -11
- package/esm/components/textarea/textarea.component.js +0 -8
- package/esm/components/textbox/textbox.component.js +0 -8
- package/lib/__internal__/input/input.component.d.ts +0 -2
- package/lib/__internal__/input/input.component.js +0 -8
- package/lib/components/button/button-types.style.d.ts +0 -1
- package/lib/components/button/button-types.style.js +0 -21
- package/lib/components/button/button.component.d.ts +1 -5
- package/lib/components/button/button.component.js +6 -377
- package/lib/components/button/button.config.js +1 -1
- package/lib/components/button/index.d.ts +1 -1
- package/lib/components/button/index.js +2 -9
- package/lib/components/checkbox/checkbox.component.d.ts +0 -2
- package/lib/components/checkbox/checkbox.component.js +1 -10
- package/lib/components/confirm/confirm.component.d.ts +4 -4
- package/lib/components/date/date.component.js +0 -9
- package/lib/components/decimal/decimal.component.js +1 -9
- package/lib/components/grouped-character/grouped-character.component.js +0 -8
- package/lib/components/icon/icon.component.d.ts +2 -1
- package/lib/components/icon/icon.component.js +7 -3
- package/lib/components/number/number.component.js +0 -8
- package/lib/components/radio-button/radio-button.component.d.ts +0 -2
- package/lib/components/radio-button/radio-button.component.js +1 -11
- package/lib/components/select/filterable-select/filterable-select.component.js +2 -10
- package/lib/components/select/list-action-button/list-action-button.component.js +1 -1
- package/lib/components/select/multi-select/multi-select.component.js +2 -10
- package/lib/components/select/select-textbox/select-textbox.component.js +0 -1
- package/lib/components/select/simple-select/simple-select.component.js +2 -10
- package/lib/components/switch/switch.component.d.ts +0 -2
- package/lib/components/switch/switch.component.js +2 -11
- package/lib/components/textarea/textarea.component.js +0 -8
- package/lib/components/textbox/textbox.component.js +0 -8
- package/package.json +1 -1
|
@@ -17,7 +17,6 @@ import ValidationMessage from "../../__internal__/validation-message";
|
|
|
17
17
|
import Box from "../box";
|
|
18
18
|
import Logger from "../../__internal__/utils/logger";
|
|
19
19
|
import useFormSpacing from "../../hooks/__internal__/useFormSpacing";
|
|
20
|
-
let deprecateInputRefWarnTriggered = false;
|
|
21
20
|
let deprecateUncontrolledWarnTriggered = false;
|
|
22
21
|
let warnBorderRadiusArrayTooLarge = false;
|
|
23
22
|
const Textarea = /*#__PURE__*/React.forwardRef(({
|
|
@@ -57,7 +56,6 @@ const Textarea = /*#__PURE__*/React.forwardRef(({
|
|
|
57
56
|
"data-element": dataElement,
|
|
58
57
|
"data-role": dataRole,
|
|
59
58
|
helpAriaLabel,
|
|
60
|
-
inputRef,
|
|
61
59
|
borderRadius,
|
|
62
60
|
hideBorders = false,
|
|
63
61
|
required,
|
|
@@ -83,10 +81,6 @@ const Textarea = /*#__PURE__*/React.forwardRef(({
|
|
|
83
81
|
ref(inputElement);
|
|
84
82
|
}
|
|
85
83
|
}, [ref]);
|
|
86
|
-
if (!deprecateInputRefWarnTriggered && inputRef) {
|
|
87
|
-
deprecateInputRefWarnTriggered = true;
|
|
88
|
-
Logger.deprecate("The `inputRef` prop in `Textarea` component is deprecated and will soon be removed. Please use `ref` instead.");
|
|
89
|
-
}
|
|
90
84
|
if (!deprecateUncontrolledWarnTriggered && !onChange) {
|
|
91
85
|
deprecateUncontrolledWarnTriggered = true;
|
|
92
86
|
Logger.deprecate("Uncontrolled behaviour in `Textarea` is deprecated and support will soon be removed. Please make sure all your inputs are controlled.");
|
|
@@ -185,7 +179,6 @@ const Textarea = /*#__PURE__*/React.forwardRef(({
|
|
|
185
179
|
cols: cols,
|
|
186
180
|
id: id,
|
|
187
181
|
as: "textarea",
|
|
188
|
-
inputRef: inputRef,
|
|
189
182
|
validationIconId: validationRedesignOptIn ? undefined : validationId,
|
|
190
183
|
inputBorderRadius: borderRadius,
|
|
191
184
|
required: required
|
|
@@ -350,7 +343,6 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
350
343
|
"inputHint": PropTypes.string,
|
|
351
344
|
"inputIcon": PropTypes.oneOf(["accessibility_web", "add", "admin", "alert_on", "alert", "analysis", "app_facebook", "app_instagram", "app_tiktok", "app_twitter", "app_youtube", "apps", "arrow_bottom_right_circle", "arrow_down", "arrow_left_boxed", "arrow_left_right_small", "arrow_left_small", "arrow_left", "arrow_right_small", "arrow_right", "arrow_top_left_circle", "arrow_up", "arrow", "arrows_left_right", "attach", "bank_with_card", "bank", "basket_with_squares", "basket", "bed", "bill_paid", "bill_unpaid", "bin", "block_arrow_right", "blocked_square", "blocked", "bold", "box_arrow_left", "box_arrow_right", "boxed_shapes", "bulk_destroy", "bullet_list_dotted", "bullet_list_numbers", "bullet_list", "business", "calendar_pay_date", "calendar_today", "calendar", "call", "camera", "car_lock", "car_money", "car_repair", "card_view", "card_wallet", "caret_down", "caret_large_down", "caret_large_left", "caret_large_right", "caret_large_up", "caret_left", "caret_right", "caret_up", "cart", "cash", "chart_bar", "chart_line", "chart_pie", "chat_notes", "chat", "check_all", "check_none", "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", "cloud_co2", "coins", "collaborate", "computer_clock", "connect_off", "connect", "construction", "contact_card", "contacts", "copy", "create", "credit_card_slash", "credit_card", "cross_circle", "cross", "csv", "dashboard", "delete", "delivery", "disconnect", "disputed", "document_right_align", "document_tick", "document_vertical_lines", "download", "draft", "drag_vertical", "drag", "drill", "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", "form_refresh", "gift", "go", "graduation_hat", "graph", "grid", "hand_cash_coins", "hand_cash_note", "heart_pulse", "help", "hide", "home", "image", "in_progress", "in_transit", "individual", "info", "intranet", "italic", "job_seeked", "key", "laptop", "leaf", "ledger_arrow_left", "ledger_arrow_right", "ledger", "lightbulb_off", "lightbulb_on", "like_no", "like", "link_cloud", "link_on", "link", "list_view", "location", "locked", "logout", "lookup", "marker", "message", "microphone", "minimise", "minus_large", "minus", "mobile", "money_bag", "none", "old_warning", "palm_tree", "pause_circle", "pause", "pdf", "people_switch", "people", "percentage_boxed", "person_info", "person_tick", "person", "petrol_pump", "phone", "piggy_bank", "pin", "plane", "play_circle", "play", "plus_large", "plus", "pound", "print", "progress", "progressed", "protect", "question_hollow", "question_mark", "question", "recruiting", "refresh_clock", "refresh", "remove", "sage_coin", "save", "scan", "search", "send", "services", "settings_old", "settings", "share", "shop", "sort_down", "sort_up", "spanner", "split_container", "split", "square_dot", "squares_nine", "stacked_boxes", "stacked_squares", "submitted", "support_online", "sync", "tag", "talk", "target_man", "target", "theatre_masks", "three_boxes", "tick_circle", "tick_thick", "tick", "true_tick", "u_turn_left", "u_turn_right", "undo", "unlocked", "upload", "uploaded", "video", "view", "volunteering", "warning", "website", "welfare"]),
|
|
352
345
|
"inputMode": PropTypes.oneOf(["decimal", "email", "none", "numeric", "search", "tel", "text", "url"]),
|
|
353
|
-
"inputRef": PropTypes.func,
|
|
354
346
|
"inputWidth": PropTypes.number,
|
|
355
347
|
"is": PropTypes.string,
|
|
356
348
|
"isOptional": PropTypes.bool,
|
|
@@ -22,7 +22,6 @@ export const ALIGN_DEFAULT = "left";
|
|
|
22
22
|
export const SIZE_DEFAULT = "medium";
|
|
23
23
|
export const LABEL_WIDTH_DEFAULT = 30;
|
|
24
24
|
export const LABEL_VALIDATION_DEFAULT = false;
|
|
25
|
-
let deprecateInputRefWarnTriggered = false;
|
|
26
25
|
let deprecateUncontrolledWarnTriggered = false;
|
|
27
26
|
const Textbox = /*#__PURE__*/React.forwardRef(({
|
|
28
27
|
"aria-labelledby": ariaLabelledBy,
|
|
@@ -50,7 +49,6 @@ const Textbox = /*#__PURE__*/React.forwardRef(({
|
|
|
50
49
|
value,
|
|
51
50
|
readOnly,
|
|
52
51
|
placeholder,
|
|
53
|
-
inputRef,
|
|
54
52
|
onBlur,
|
|
55
53
|
onClick,
|
|
56
54
|
onFocus,
|
|
@@ -88,10 +86,6 @@ const Textbox = /*#__PURE__*/React.forwardRef(({
|
|
|
88
86
|
disableErrorBorder
|
|
89
87
|
} = useContext(NumeralDateContext);
|
|
90
88
|
const computeLabelPropValues = prop => validationRedesignOptIn ? undefined : prop;
|
|
91
|
-
if (!deprecateInputRefWarnTriggered && inputRef) {
|
|
92
|
-
deprecateInputRefWarnTriggered = true;
|
|
93
|
-
Logger.deprecate("The `inputRef` prop in `Textbox` component is deprecated and will soon be removed. Please use `ref` instead.");
|
|
94
|
-
}
|
|
95
89
|
if (!deprecateUncontrolledWarnTriggered && !onChange) {
|
|
96
90
|
deprecateUncontrolledWarnTriggered = true;
|
|
97
91
|
Logger.deprecate("Uncontrolled behaviour in `Textbox` is deprecated and support will soon be removed. Please make sure all your inputs are controlled.");
|
|
@@ -141,7 +135,6 @@ const Textbox = /*#__PURE__*/React.forwardRef(({
|
|
|
141
135
|
deferTimeout: deferTimeout,
|
|
142
136
|
disabled: disabled,
|
|
143
137
|
id: uniqueId,
|
|
144
|
-
inputRef: inputRef,
|
|
145
138
|
ref: ref,
|
|
146
139
|
name: uniqueName,
|
|
147
140
|
onBlur: onBlur,
|
|
@@ -318,7 +311,6 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
318
311
|
"inputHint": PropTypes.string,
|
|
319
312
|
"inputIcon": PropTypes.oneOf(["accessibility_web", "add", "admin", "alert_on", "alert", "analysis", "app_facebook", "app_instagram", "app_tiktok", "app_twitter", "app_youtube", "apps", "arrow_bottom_right_circle", "arrow_down", "arrow_left_boxed", "arrow_left_right_small", "arrow_left_small", "arrow_left", "arrow_right_small", "arrow_right", "arrow_top_left_circle", "arrow_up", "arrow", "arrows_left_right", "attach", "bank_with_card", "bank", "basket_with_squares", "basket", "bed", "bill_paid", "bill_unpaid", "bin", "block_arrow_right", "blocked_square", "blocked", "bold", "box_arrow_left", "box_arrow_right", "boxed_shapes", "bulk_destroy", "bullet_list_dotted", "bullet_list_numbers", "bullet_list", "business", "calendar_pay_date", "calendar_today", "calendar", "call", "camera", "car_lock", "car_money", "car_repair", "card_view", "card_wallet", "caret_down", "caret_large_down", "caret_large_left", "caret_large_right", "caret_large_up", "caret_left", "caret_right", "caret_up", "cart", "cash", "chart_bar", "chart_line", "chart_pie", "chat_notes", "chat", "check_all", "check_none", "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", "cloud_co2", "coins", "collaborate", "computer_clock", "connect_off", "connect", "construction", "contact_card", "contacts", "copy", "create", "credit_card_slash", "credit_card", "cross_circle", "cross", "csv", "dashboard", "delete", "delivery", "disconnect", "disputed", "document_right_align", "document_tick", "document_vertical_lines", "download", "draft", "drag_vertical", "drag", "drill", "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", "form_refresh", "gift", "go", "graduation_hat", "graph", "grid", "hand_cash_coins", "hand_cash_note", "heart_pulse", "help", "hide", "home", "image", "in_progress", "in_transit", "individual", "info", "intranet", "italic", "job_seeked", "key", "laptop", "leaf", "ledger_arrow_left", "ledger_arrow_right", "ledger", "lightbulb_off", "lightbulb_on", "like_no", "like", "link_cloud", "link_on", "link", "list_view", "location", "locked", "logout", "lookup", "marker", "message", "microphone", "minimise", "minus_large", "minus", "mobile", "money_bag", "none", "old_warning", "palm_tree", "pause_circle", "pause", "pdf", "people_switch", "people", "percentage_boxed", "person_info", "person_tick", "person", "petrol_pump", "phone", "piggy_bank", "pin", "plane", "play_circle", "play", "plus_large", "plus", "pound", "print", "progress", "progressed", "protect", "question_hollow", "question_mark", "question", "recruiting", "refresh_clock", "refresh", "remove", "sage_coin", "save", "scan", "search", "send", "services", "settings_old", "settings", "share", "shop", "sort_down", "sort_up", "spanner", "split_container", "split", "square_dot", "squares_nine", "stacked_boxes", "stacked_squares", "submitted", "support_online", "sync", "tag", "talk", "target_man", "target", "theatre_masks", "three_boxes", "tick_circle", "tick_thick", "tick", "true_tick", "u_turn_left", "u_turn_right", "undo", "unlocked", "upload", "uploaded", "video", "view", "volunteering", "warning", "website", "welfare"]),
|
|
320
313
|
"inputMode": PropTypes.oneOf(["decimal", "email", "none", "numeric", "search", "tel", "text", "url"]),
|
|
321
|
-
"inputRef": PropTypes.func,
|
|
322
314
|
"inputWidth": PropTypes.number,
|
|
323
315
|
"is": PropTypes.string,
|
|
324
316
|
"isOptional": PropTypes.bool,
|
|
@@ -15,8 +15,6 @@ export interface CommonInputProps extends Omit<React.InputHTMLAttributes<HTMLInp
|
|
|
15
15
|
id?: string;
|
|
16
16
|
/** Specify a custom border radius for the input. Any valid border-radius design token, or an array of border-radius design tokens. */
|
|
17
17
|
inputBorderRadius?: BorderRadiusType | BorderRadiusType[];
|
|
18
|
-
/** A callback to retrieve the input reference */
|
|
19
|
-
inputRef?: (input: React.RefObject<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
20
18
|
/** Name of the input */
|
|
21
19
|
name?: string;
|
|
22
20
|
/** Specify a callback triggered on blur */
|
|
@@ -41,8 +41,6 @@ const Input = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
41
41
|
disabled,
|
|
42
42
|
readOnly,
|
|
43
43
|
autoFocus,
|
|
44
|
-
// TODO: remove inputRef prop from this component (and props interface) when it has been removed from all exposed input components
|
|
45
|
-
inputRef,
|
|
46
44
|
onClick,
|
|
47
45
|
onChangeDeferred,
|
|
48
46
|
onChange,
|
|
@@ -76,11 +74,6 @@ const Input = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
76
74
|
element.setAttribute("enterkeyhint", enterKeyHint);
|
|
77
75
|
}
|
|
78
76
|
}, [autoFocus, ref, enterKeyHint]);
|
|
79
|
-
(0, _react.useEffect)(() => {
|
|
80
|
-
if (inputRef) {
|
|
81
|
-
inputRef(input);
|
|
82
|
-
}
|
|
83
|
-
}, [input, inputRef]);
|
|
84
77
|
(0, _react.useEffect)(() => {
|
|
85
78
|
if (context.inputRef) {
|
|
86
79
|
context.inputRef(input);
|
|
@@ -258,7 +251,6 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
258
251
|
"inlist": _propTypes.default.any,
|
|
259
252
|
"inputBorderRadius": _propTypes.default.any,
|
|
260
253
|
"inputMode": _propTypes.default.oneOf(["decimal", "email", "none", "numeric", "search", "tel", "text", "url"]),
|
|
261
|
-
"inputRef": _propTypes.default.func,
|
|
262
254
|
"is": _propTypes.default.string,
|
|
263
255
|
"itemID": _propTypes.default.string,
|
|
264
256
|
"itemProp": _propTypes.default.string,
|
|
@@ -130,27 +130,6 @@ var _default = (isDisabled, destructive) => ({
|
|
|
130
130
|
${disabledImageStyle}
|
|
131
131
|
` : ""}
|
|
132
132
|
`,
|
|
133
|
-
dashed: `
|
|
134
|
-
background: transparent;
|
|
135
|
-
border: 2px dashed var(--colorsActionMinor500);
|
|
136
|
-
${makeColors("var(--colorsActionMinor500)")};
|
|
137
|
-
&:hover {
|
|
138
|
-
background-color: var(--colorsActionMinor200);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
${destructive ? `
|
|
142
|
-
border-color: var(--colorsSemanticNegative500);
|
|
143
|
-
` : ""}
|
|
144
|
-
|
|
145
|
-
${isDisabled ? `
|
|
146
|
-
border-color: var(--colorsActionDisabled500);
|
|
147
|
-
${makeColors("var(--colorsActionMinorYin030)")};
|
|
148
|
-
&:hover {
|
|
149
|
-
background-color: transparent;
|
|
150
|
-
}
|
|
151
|
-
${disabledImageStyle}
|
|
152
|
-
` : ""}
|
|
153
|
-
`,
|
|
154
133
|
darkBackground: `
|
|
155
134
|
background: var(--colorsActionMajorYang100);
|
|
156
135
|
border-color: transparent;
|
|
@@ -3,7 +3,7 @@ import { SpaceProps } from "styled-system";
|
|
|
3
3
|
import { IconType } from "../icon";
|
|
4
4
|
import { TagProps } from "../../__internal__/utils/helpers/tags/tags";
|
|
5
5
|
import { TooltipPositions } from "../tooltip/tooltip.config";
|
|
6
|
-
export declare type ButtonTypes = "primary" | "secondary" | "tertiary" | "
|
|
6
|
+
export declare type ButtonTypes = "primary" | "secondary" | "tertiary" | "darkBackground" | "gradient-grey" | "gradient-white";
|
|
7
7
|
export declare type SizeOptions = "small" | "medium" | "large";
|
|
8
8
|
export declare type ButtonIconPosition = "before" | "after";
|
|
9
9
|
export interface ButtonProps extends SpaceProps, TagProps {
|
|
@@ -26,8 +26,6 @@ export interface ButtonProps extends SpaceProps, TagProps {
|
|
|
26
26
|
disabled?: boolean;
|
|
27
27
|
/** Apply destructive style to the button */
|
|
28
28
|
destructive?: boolean;
|
|
29
|
-
/** Ref to be forwarded */
|
|
30
|
-
forwardRef?: React.RefCallback<HTMLButtonElement> | React.MutableRefObject<HTMLButtonElement | null> | null;
|
|
31
29
|
/** Apply fullWidth style to the button */
|
|
32
30
|
fullWidth?: boolean;
|
|
33
31
|
/** Used to transform button into anchor */
|
|
@@ -66,6 +64,4 @@ export interface ButtonProps extends SpaceProps, TagProps {
|
|
|
66
64
|
rel?: string;
|
|
67
65
|
}
|
|
68
66
|
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
69
|
-
declare const ButtonWithForwardRef: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
70
|
-
export { ButtonWithForwardRef };
|
|
71
67
|
export default Button;
|