carbon-react 114.10.1 → 114.12.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 (40) hide show
  1. package/esm/__internal__/form-field/form-field.component.d.ts +1 -1
  2. package/esm/__spec_helper__/test-utils.d.ts +1 -1
  3. package/esm/__spec_helper__/test-utils.js +1 -1
  4. package/esm/components/button/button-types.style.js +2 -2
  5. package/esm/components/button/button.component.js +1 -1
  6. package/esm/components/button/button.style.js +3 -2
  7. package/esm/components/button-minor/button-minor.component.d.ts +7 -0
  8. package/esm/components/button-minor/button-minor.component.js +355 -0
  9. package/esm/components/button-minor/button-minor.style.d.ts +3 -0
  10. package/esm/components/button-minor/button-minor.style.js +75 -0
  11. package/esm/components/button-minor/index.d.ts +2 -0
  12. package/esm/components/button-minor/index.js +1 -0
  13. package/esm/components/image/image.component.d.ts +1 -1
  14. package/esm/components/image/image.component.js +4 -1
  15. package/esm/components/image/image.style.d.ts +2 -0
  16. package/esm/components/link/link.component.d.ts +1 -1
  17. package/esm/components/menu/menu-item/menu-item.d.ts +1 -1
  18. package/esm/style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component.d.ts +1 -1
  19. package/esm/style/utils/color.d.ts +1 -1
  20. package/lib/__internal__/form-field/form-field.component.d.ts +1 -1
  21. package/lib/__spec_helper__/test-utils.d.ts +1 -1
  22. package/lib/__spec_helper__/test-utils.js +1 -1
  23. package/lib/components/button/button-types.style.js +2 -2
  24. package/lib/components/button/button.component.js +1 -1
  25. package/lib/components/button/button.style.js +3 -2
  26. package/lib/components/button-minor/button-minor.component.d.ts +7 -0
  27. package/lib/components/button-minor/button-minor.component.js +367 -0
  28. package/lib/components/button-minor/button-minor.style.d.ts +3 -0
  29. package/lib/components/button-minor/button-minor.style.js +92 -0
  30. package/lib/components/button-minor/index.d.ts +2 -0
  31. package/lib/components/button-minor/index.js +15 -0
  32. package/lib/components/button-minor/package.json +6 -0
  33. package/lib/components/image/image.component.d.ts +1 -1
  34. package/lib/components/image/image.component.js +4 -1
  35. package/lib/components/image/image.style.d.ts +2 -0
  36. package/lib/components/link/link.component.d.ts +1 -1
  37. package/lib/components/menu/menu-item/menu-item.d.ts +1 -1
  38. package/lib/style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component.d.ts +1 -1
  39. package/lib/style/utils/color.d.ts +1 -1
  40. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
- import { ValidationProps } from "__internal__/validations";
3
2
  import { MarginProps } from "styled-system";
3
+ import { ValidationProps } from "../validations";
4
4
  import { TagProps } from "../utils/helpers/tags/tags";
5
5
  import { IconType } from "../../components/icon";
6
6
  interface CommonFormFieldProps extends MarginProps, ValidationProps {
@@ -27,7 +27,7 @@ declare const assertHoverTraversal: ({ num, nonSelectables, }: {
27
27
  num: number;
28
28
  nonSelectables?: number[] | undefined;
29
29
  }) => (wrapper: ReactWrapper) => void;
30
- declare const carbonThemesJestTable: (string | Partial<import("style/themes/base/base-theme.config").ThemeObject> | undefined)[][];
30
+ declare const carbonThemesJestTable: (string | Partial<import("../style/themes/base/base-theme.config").ThemeObject> | undefined)[][];
31
31
  declare const marginProps: readonly [readonly ["m", "margin"], readonly ["ml", "marginLeft"], readonly ["mr", "marginRight"], readonly ["mt", "marginTop"], readonly ["mb", "marginBottom"], readonly ["mx", "marginLeft"], readonly ["mx", "marginRight"], readonly ["my", "marginTop"], readonly ["my", "marginBottom"]];
32
32
  declare type MarginProps = {
33
33
  [K in typeof marginProps[number][0]]?: string | number;
@@ -5,7 +5,7 @@
5
5
  /* eslint-disable jest/no-export */
6
6
  import { mount } from "enzyme";
7
7
  import { sprintf } from "sprintf-js";
8
- import { space } from "style/themes/base/base-theme.config";
8
+ import { space } from "../style/themes/base/base-theme.config";
9
9
  import { carbonThemeList } from "../style/themes";
10
10
  import { mockMatchMedia } from "./mock-match-media";
11
11
 
@@ -63,7 +63,7 @@ export default ((isDisabled, destructive) => ({
63
63
  ${makeColors("var(--colorsSemanticNegativeYang100)")};
64
64
  }
65
65
  ` : ""}
66
-
66
+
67
67
  ${isDisabled ? `
68
68
  border-color: var(--colorsActionDisabled500);
69
69
  ${makeColors("var(--colorsActionMajorYin030)")};
@@ -127,7 +127,7 @@ export default ((isDisabled, destructive) => ({
127
127
  background: var(--colorsActionMajor600);
128
128
  ${makeColors("var(--colorsActionMajorYang100)")}
129
129
  }
130
-
130
+
131
131
  ${isDisabled ? `
132
132
  background: var(--colorsActionDisabled500);
133
133
  ${makeColors("var(--colorsActionMajorYin030)")};
@@ -39,7 +39,7 @@ function renderChildren({
39
39
  };
40
40
  return /*#__PURE__*/React.createElement(React.Fragment, null, iconType && iconPosition === "before" && children && /*#__PURE__*/React.createElement(Icon, _extends({
41
41
  type: iconType
42
- }, iconProps)), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("span", {
42
+ }, iconProps)), children && /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("span", {
43
43
  "data-element": "main-text"
44
44
  }, children), size === "large" && /*#__PURE__*/React.createElement(StyledButtonSubtext, {
45
45
  "data-element": "subtext"
@@ -60,9 +60,10 @@ function stylingForType({
60
60
  `}
61
61
 
62
62
  ${size === "large" && css`
63
- font-size: 16px;
63
+ font-size: var(--fontSizes200);
64
64
  min-height: 48px;
65
65
  `}
66
+
66
67
  ${iconOnly && stylingForIconOnly(size)}
67
68
  `;
68
69
  }
@@ -89,7 +90,7 @@ const StyledButton = styled.button`
89
90
  }) => fullWidth && css`
90
91
  width: 100%;
91
92
  `}
92
-
93
+
93
94
  ${({
94
95
  iconOnly,
95
96
  iconPosition,
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { ButtonProps } from "../button";
3
+ export declare const ButtonMinor: {
4
+ ({ buttonType, size, ...rest }: ButtonProps): JSX.Element;
5
+ displayName: string;
6
+ };
7
+ export default ButtonMinor;
@@ -0,0 +1,355 @@
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
+ import React from "react";
4
+ import PropTypes from "prop-types";
5
+ import StyledButtonMinor from "./button-minor.style";
6
+
7
+ const ButtonMinor = ({
8
+ buttonType = "secondary",
9
+ size = "medium",
10
+ ...rest
11
+ }) => /*#__PURE__*/React.createElement(StyledButtonMinor, _extends({
12
+ size: size,
13
+ buttonType: buttonType
14
+ }, rest));
15
+
16
+ ButtonMinor.propTypes = {
17
+ "aria-label": PropTypes.string,
18
+ "buttonType": PropTypes.oneOf(["darkBackground", "dashed", "primary", "secondary", "tertiary"]),
19
+ "children": PropTypes.node,
20
+ "destructive": PropTypes.bool,
21
+ "disabled": PropTypes.bool,
22
+ "forwardRef": PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
23
+ "current": PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.object]).isRequired
24
+ })]),
25
+ "fullWidth": PropTypes.bool,
26
+ "href": PropTypes.string,
27
+ "iconPosition": PropTypes.oneOf(["after", "before"]),
28
+ "iconTooltipMessage": PropTypes.string,
29
+ "iconTooltipPosition": PropTypes.oneOf(["bottom", "left", "right", "top"]),
30
+ "iconType": PropTypes.oneOf(["add", "admin", "alert_on", "alert", "analysis", "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", "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", "car_lock", "car_money", "car_repair", "card_view", "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", "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", "construction", "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", "help", "hide", "home", "image", "in_progress", "in_transit", "individual", "info", "italic", "key", "laptop", "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", "percentage_boxed", "person_info", "person_tick", "person", "petrol_pump", "phone", "piggy_bank", "plane", "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", "theatre_masks", "three_boxes", "tick_circle", "tick_thick", "tick", "true_tick", "u_turn_left", "u_turn_right", "undo", "unlocked", "upload", "uploaded", "video", "view", "warning"]),
31
+ "id": PropTypes.string,
32
+ "m": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
33
+ "__@toStringTag": PropTypes.string.isRequired,
34
+ "description": PropTypes.string,
35
+ "toString": PropTypes.func.isRequired,
36
+ "valueOf": PropTypes.func.isRequired
37
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
38
+ "__@toStringTag": PropTypes.string.isRequired,
39
+ "description": PropTypes.string,
40
+ "toString": PropTypes.func.isRequired,
41
+ "valueOf": PropTypes.func.isRequired
42
+ }), PropTypes.string]),
43
+ "margin": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
44
+ "__@toStringTag": PropTypes.string.isRequired,
45
+ "description": PropTypes.string,
46
+ "toString": PropTypes.func.isRequired,
47
+ "valueOf": PropTypes.func.isRequired
48
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
49
+ "__@toStringTag": PropTypes.string.isRequired,
50
+ "description": PropTypes.string,
51
+ "toString": PropTypes.func.isRequired,
52
+ "valueOf": PropTypes.func.isRequired
53
+ }), PropTypes.string]),
54
+ "marginBottom": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
55
+ "__@toStringTag": PropTypes.string.isRequired,
56
+ "description": PropTypes.string,
57
+ "toString": PropTypes.func.isRequired,
58
+ "valueOf": PropTypes.func.isRequired
59
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
60
+ "__@toStringTag": PropTypes.string.isRequired,
61
+ "description": PropTypes.string,
62
+ "toString": PropTypes.func.isRequired,
63
+ "valueOf": PropTypes.func.isRequired
64
+ }), PropTypes.string]),
65
+ "marginLeft": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
66
+ "__@toStringTag": PropTypes.string.isRequired,
67
+ "description": PropTypes.string,
68
+ "toString": PropTypes.func.isRequired,
69
+ "valueOf": PropTypes.func.isRequired
70
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
71
+ "__@toStringTag": PropTypes.string.isRequired,
72
+ "description": PropTypes.string,
73
+ "toString": PropTypes.func.isRequired,
74
+ "valueOf": PropTypes.func.isRequired
75
+ }), PropTypes.string]),
76
+ "marginRight": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
77
+ "__@toStringTag": PropTypes.string.isRequired,
78
+ "description": PropTypes.string,
79
+ "toString": PropTypes.func.isRequired,
80
+ "valueOf": PropTypes.func.isRequired
81
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
82
+ "__@toStringTag": PropTypes.string.isRequired,
83
+ "description": PropTypes.string,
84
+ "toString": PropTypes.func.isRequired,
85
+ "valueOf": PropTypes.func.isRequired
86
+ }), PropTypes.string]),
87
+ "marginTop": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
88
+ "__@toStringTag": PropTypes.string.isRequired,
89
+ "description": PropTypes.string,
90
+ "toString": PropTypes.func.isRequired,
91
+ "valueOf": PropTypes.func.isRequired
92
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
93
+ "__@toStringTag": PropTypes.string.isRequired,
94
+ "description": PropTypes.string,
95
+ "toString": PropTypes.func.isRequired,
96
+ "valueOf": PropTypes.func.isRequired
97
+ }), PropTypes.string]),
98
+ "marginX": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
99
+ "__@toStringTag": PropTypes.string.isRequired,
100
+ "description": PropTypes.string,
101
+ "toString": PropTypes.func.isRequired,
102
+ "valueOf": PropTypes.func.isRequired
103
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
104
+ "__@toStringTag": PropTypes.string.isRequired,
105
+ "description": PropTypes.string,
106
+ "toString": PropTypes.func.isRequired,
107
+ "valueOf": PropTypes.func.isRequired
108
+ }), PropTypes.string]),
109
+ "marginY": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
110
+ "__@toStringTag": PropTypes.string.isRequired,
111
+ "description": PropTypes.string,
112
+ "toString": PropTypes.func.isRequired,
113
+ "valueOf": PropTypes.func.isRequired
114
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
115
+ "__@toStringTag": PropTypes.string.isRequired,
116
+ "description": PropTypes.string,
117
+ "toString": PropTypes.func.isRequired,
118
+ "valueOf": PropTypes.func.isRequired
119
+ }), PropTypes.string]),
120
+ "mb": 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
+ "ml": 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
+ "mr": 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
+ "mt": 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
+ "mx": 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
+ "my": 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
+ "name": PropTypes.string,
187
+ "noWrap": PropTypes.bool,
188
+ "onBlur": PropTypes.func,
189
+ "onChange": PropTypes.func,
190
+ "onClick": PropTypes.func,
191
+ "onFocus": PropTypes.func,
192
+ "onKeyDown": PropTypes.func,
193
+ "p": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
194
+ "__@toStringTag": PropTypes.string.isRequired,
195
+ "description": PropTypes.string,
196
+ "toString": PropTypes.func.isRequired,
197
+ "valueOf": PropTypes.func.isRequired
198
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
199
+ "__@toStringTag": PropTypes.string.isRequired,
200
+ "description": PropTypes.string,
201
+ "toString": PropTypes.func.isRequired,
202
+ "valueOf": PropTypes.func.isRequired
203
+ }), PropTypes.string]),
204
+ "padding": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
205
+ "__@toStringTag": PropTypes.string.isRequired,
206
+ "description": PropTypes.string,
207
+ "toString": PropTypes.func.isRequired,
208
+ "valueOf": PropTypes.func.isRequired
209
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
210
+ "__@toStringTag": PropTypes.string.isRequired,
211
+ "description": PropTypes.string,
212
+ "toString": PropTypes.func.isRequired,
213
+ "valueOf": PropTypes.func.isRequired
214
+ }), PropTypes.string]),
215
+ "paddingBottom": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
216
+ "__@toStringTag": PropTypes.string.isRequired,
217
+ "description": PropTypes.string,
218
+ "toString": PropTypes.func.isRequired,
219
+ "valueOf": PropTypes.func.isRequired
220
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
221
+ "__@toStringTag": PropTypes.string.isRequired,
222
+ "description": PropTypes.string,
223
+ "toString": PropTypes.func.isRequired,
224
+ "valueOf": PropTypes.func.isRequired
225
+ }), PropTypes.string]),
226
+ "paddingLeft": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
227
+ "__@toStringTag": PropTypes.string.isRequired,
228
+ "description": PropTypes.string,
229
+ "toString": PropTypes.func.isRequired,
230
+ "valueOf": PropTypes.func.isRequired
231
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
232
+ "__@toStringTag": PropTypes.string.isRequired,
233
+ "description": PropTypes.string,
234
+ "toString": PropTypes.func.isRequired,
235
+ "valueOf": PropTypes.func.isRequired
236
+ }), PropTypes.string]),
237
+ "paddingRight": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
238
+ "__@toStringTag": PropTypes.string.isRequired,
239
+ "description": PropTypes.string,
240
+ "toString": PropTypes.func.isRequired,
241
+ "valueOf": PropTypes.func.isRequired
242
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
243
+ "__@toStringTag": PropTypes.string.isRequired,
244
+ "description": PropTypes.string,
245
+ "toString": PropTypes.func.isRequired,
246
+ "valueOf": PropTypes.func.isRequired
247
+ }), PropTypes.string]),
248
+ "paddingTop": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
249
+ "__@toStringTag": PropTypes.string.isRequired,
250
+ "description": PropTypes.string,
251
+ "toString": PropTypes.func.isRequired,
252
+ "valueOf": PropTypes.func.isRequired
253
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
254
+ "__@toStringTag": PropTypes.string.isRequired,
255
+ "description": PropTypes.string,
256
+ "toString": PropTypes.func.isRequired,
257
+ "valueOf": PropTypes.func.isRequired
258
+ }), PropTypes.string]),
259
+ "paddingX": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
260
+ "__@toStringTag": PropTypes.string.isRequired,
261
+ "description": PropTypes.string,
262
+ "toString": PropTypes.func.isRequired,
263
+ "valueOf": PropTypes.func.isRequired
264
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
265
+ "__@toStringTag": PropTypes.string.isRequired,
266
+ "description": PropTypes.string,
267
+ "toString": PropTypes.func.isRequired,
268
+ "valueOf": PropTypes.func.isRequired
269
+ }), PropTypes.string]),
270
+ "paddingY": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
271
+ "__@toStringTag": PropTypes.string.isRequired,
272
+ "description": PropTypes.string,
273
+ "toString": PropTypes.func.isRequired,
274
+ "valueOf": PropTypes.func.isRequired
275
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
276
+ "__@toStringTag": PropTypes.string.isRequired,
277
+ "description": PropTypes.string,
278
+ "toString": PropTypes.func.isRequired,
279
+ "valueOf": PropTypes.func.isRequired
280
+ }), PropTypes.string]),
281
+ "pb": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
282
+ "__@toStringTag": PropTypes.string.isRequired,
283
+ "description": PropTypes.string,
284
+ "toString": PropTypes.func.isRequired,
285
+ "valueOf": PropTypes.func.isRequired
286
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
287
+ "__@toStringTag": PropTypes.string.isRequired,
288
+ "description": PropTypes.string,
289
+ "toString": PropTypes.func.isRequired,
290
+ "valueOf": PropTypes.func.isRequired
291
+ }), PropTypes.string]),
292
+ "pl": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
293
+ "__@toStringTag": PropTypes.string.isRequired,
294
+ "description": PropTypes.string,
295
+ "toString": PropTypes.func.isRequired,
296
+ "valueOf": PropTypes.func.isRequired
297
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
298
+ "__@toStringTag": PropTypes.string.isRequired,
299
+ "description": PropTypes.string,
300
+ "toString": PropTypes.func.isRequired,
301
+ "valueOf": PropTypes.func.isRequired
302
+ }), PropTypes.string]),
303
+ "pr": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
304
+ "__@toStringTag": PropTypes.string.isRequired,
305
+ "description": PropTypes.string,
306
+ "toString": PropTypes.func.isRequired,
307
+ "valueOf": PropTypes.func.isRequired
308
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
309
+ "__@toStringTag": PropTypes.string.isRequired,
310
+ "description": PropTypes.string,
311
+ "toString": PropTypes.func.isRequired,
312
+ "valueOf": PropTypes.func.isRequired
313
+ }), PropTypes.string]),
314
+ "pt": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
315
+ "__@toStringTag": PropTypes.string.isRequired,
316
+ "description": PropTypes.string,
317
+ "toString": PropTypes.func.isRequired,
318
+ "valueOf": PropTypes.func.isRequired
319
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
320
+ "__@toStringTag": PropTypes.string.isRequired,
321
+ "description": PropTypes.string,
322
+ "toString": PropTypes.func.isRequired,
323
+ "valueOf": PropTypes.func.isRequired
324
+ }), PropTypes.string]),
325
+ "px": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
326
+ "__@toStringTag": PropTypes.string.isRequired,
327
+ "description": PropTypes.string,
328
+ "toString": PropTypes.func.isRequired,
329
+ "valueOf": PropTypes.func.isRequired
330
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
331
+ "__@toStringTag": PropTypes.string.isRequired,
332
+ "description": PropTypes.string,
333
+ "toString": PropTypes.func.isRequired,
334
+ "valueOf": PropTypes.func.isRequired
335
+ }), PropTypes.string]),
336
+ "py": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
337
+ "__@toStringTag": PropTypes.string.isRequired,
338
+ "description": PropTypes.string,
339
+ "toString": PropTypes.func.isRequired,
340
+ "valueOf": PropTypes.func.isRequired
341
+ }), PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.shape({
342
+ "__@toStringTag": PropTypes.string.isRequired,
343
+ "description": PropTypes.string,
344
+ "toString": PropTypes.func.isRequired,
345
+ "valueOf": PropTypes.func.isRequired
346
+ }), PropTypes.string]),
347
+ "rel": PropTypes.string,
348
+ "size": PropTypes.oneOf(["large", "medium", "small"]),
349
+ "subtext": PropTypes.string,
350
+ "target": PropTypes.string,
351
+ "type": PropTypes.string
352
+ };
353
+ export { ButtonMinor };
354
+ ButtonMinor.displayName = "ButtonMinor";
355
+ export default ButtonMinor;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const StyledButtonMinor: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../button").ButtonProps & import("react").RefAttributes<HTMLButtonElement>>, any, {}, never>;
3
+ export default StyledButtonMinor;
@@ -0,0 +1,75 @@
1
+ import styled, { css } from "styled-components";
2
+ import Button from "../button";
3
+ import StyledIcon from "../icon/icon.style";
4
+ import StyledLoaderSquare from "../loader/loader-square.style";
5
+
6
+ function makeColors(color) {
7
+ return `
8
+ color: ${color};
9
+ ${StyledIcon} {
10
+ color: ${color};
11
+ }
12
+ ${StyledLoaderSquare} {
13
+ background-color: ${color};
14
+ }
15
+ `;
16
+ }
17
+
18
+ const StyledButtonMinor = styled(Button)`
19
+ ${({
20
+ buttonType,
21
+ destructive,
22
+ disabled
23
+ }) => !destructive && !disabled && css`
24
+ ${buttonType === "primary" && `
25
+ background: var(--colorsActionMinor500);
26
+ border-color: var(--colorsActionMinorTransparent);
27
+ ${makeColors("var(--colorsActionMinorYang100)")}
28
+ &:hover {
29
+ background: var(--colorsActionMinor600);
30
+ }
31
+ `}
32
+
33
+ ${buttonType === "secondary" && `
34
+ background: transparent;
35
+ padding: var(--spacing100);
36
+ border-color: var(--colorsActionMinor500);
37
+ ${makeColors("var(--colorsActionMinor500)")}
38
+ &:hover {
39
+ color: var(--colorsActionMinorYang100);
40
+ background: var(--colorsActionMinor600);
41
+ }
42
+ `}
43
+
44
+ ${buttonType === "tertiary" && `
45
+ background: transparent;
46
+ padding: var(--spacing100);
47
+ ${makeColors("var(--colorsActionMinor500)")}
48
+ &:hover {
49
+ color: var(--colorsActionMinorYang100);
50
+ background: var(--colorsActionMinor600);
51
+ }
52
+ `}
53
+ `}
54
+
55
+ ${({
56
+ size
57
+ }) => css`
58
+ ${size === "small" && `
59
+ min-height: 32px;
60
+ padding: var(--spacing000) var(--spacing100) var(--spacing000)
61
+ var(--spacing100);
62
+ `}
63
+
64
+ ${size === "medium" && `
65
+ padding-left: var(--spacing150);
66
+ padding-right: var(--spacing150);
67
+ `}
68
+
69
+ ${size === "large" && `
70
+ padding-left: var(--spacing200);
71
+ padding-right: var(--spacing200);
72
+ `}
73
+ `}
74
+ `;
75
+ export default StyledButtonMinor;
@@ -0,0 +1,2 @@
1
+ export { default } from "./button-minor.component";
2
+ export type { ButtonProps as ButtonMinorProps } from "../button";
@@ -0,0 +1 @@
1
+ export { default } from "./button-minor.component";
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { StyledImageProps } from "./image.style";
3
3
  export declare const Image: {
4
- ({ alt, src, children, ...rest }: StyledImageProps): JSX.Element;
4
+ ({ alt, decorative, src, children, ...rest }: StyledImageProps): JSX.Element;
5
5
  displayName: string;
6
6
  };
7
7
  export default Image;
@@ -7,14 +7,16 @@ import { StyledImage } from "./image.style";
7
7
 
8
8
  const Image = ({
9
9
  alt,
10
+ decorative = false,
10
11
  src,
11
12
  children,
12
13
  ...rest
13
14
  }) => {
14
15
  !(!src || !children) ? process.env.NODE_ENV !== "production" ? invariant(false, "The 'Image' component renders as an 'img' element when the 'src' prop is used and therefore does not accept children.") : invariant(false) : void 0;
15
- !(!src || alt && typeof alt === "string") ? process.env.NODE_ENV !== "production" ? invariant(false, "Please provide an 'alt' string when rendering the 'Image' component as an 'img' element.") : invariant(false) : void 0;
16
+ !(!src || alt && typeof alt === "string" || decorative) ? process.env.NODE_ENV !== "production" ? invariant(false, "Please use the 'decorative' prop if the 'alt' text should be an empty value or provide an 'alt' string when rendering the 'Image' component as an 'img' element.") : invariant(false) : void 0;
16
17
  return /*#__PURE__*/React.createElement(StyledImage, _extends({
17
18
  alt: alt,
19
+ decorative: decorative,
18
20
  src: src
19
21
  }, rest), children);
20
22
  };
@@ -527,6 +529,7 @@ Image.propTypes = {
527
529
  "valueOf": PropTypes.func.isRequired
528
530
  }), PropTypes.string]),
529
531
  "children": PropTypes.node,
532
+ "decorative": PropTypes.bool,
530
533
  "display": PropTypes.oneOfType([PropTypes.oneOf(["-moz-initial", "-ms-flexbox", "-ms-grid", "-ms-inline-flexbox", "-ms-inline-grid", "-webkit-flex", "-webkit-inline-flex", "block", "contents", "flex", "flow-root", "flow", "grid", "inherit", "initial", "inline-block", "inline-flex", "inline-grid", "inline-list-item", "inline-table", "inline", "list-item", "none", "revert", "ruby-base-container", "ruby-base", "ruby-text-container", "ruby-text", "ruby", "run-in", "table-caption", "table-cell", "table-column-group", "table-column", "table-footer-group", "table-header-group", "table-row-group", "table-row", "table", "unset"]), PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf(["-moz-initial", "-ms-flexbox", "-ms-grid", "-ms-inline-flexbox", "-ms-inline-grid", "-webkit-flex", "-webkit-inline-flex", "block", "contents", "flex", "flow-root", "flow", "grid", "inherit", "initial", "inline-block", "inline-flex", "inline-grid", "inline-list-item", "inline-table", "inline", "list-item", "none", "revert", "ruby-base-container", "ruby-base", "ruby-text-container", "ruby-text", "ruby", "run-in", "table-caption", "table-cell", "table-column-group", "table-column", "table-footer-group", "table-header-group", "table-row-group", "table-row", "table", "unset", null]), PropTypes.shape({
531
534
  "__@iterator": PropTypes.func.isRequired,
532
535
  "anchor": PropTypes.func.isRequired,
@@ -3,6 +3,8 @@ import { MarginProps, BackgroundProps, LayoutProps } from "styled-system";
3
3
  export interface StyledImageProps extends MarginProps, BackgroundProps, LayoutProps {
4
4
  /** HTML alt property to display when an img fails to load */
5
5
  alt?: string;
6
+ /** Prop to specify if the image is decorative */
7
+ decorative?: boolean;
6
8
  /** Any valid file path, passing this will render the component as an img element */
7
9
  src?: string;
8
10
  /** HTML hidden property to indicate whether to remain hidden visually and from screen readers */
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { IconType } from "components/icon/icon-type";
2
+ import { IconType } from "../icon";
3
3
  import { StyledLinkProps } from "./link.style";
4
4
  export interface LinkProps extends StyledLinkProps, React.AriaAttributes {
5
5
  /** An href for an anchor tag. */
@@ -1,6 +1,6 @@
1
- import { IconType } from "components/icon/icon-type";
2
1
  import * as React from "react";
3
2
  import { FlexboxProps, LayoutProps } from "styled-system";
3
+ import { IconType } from "../../icon";
4
4
 
5
5
  export interface MenuItemBaseProps extends LayoutProps, FlexboxProps {
6
6
  /** Custom className */
@@ -1,4 +1,4 @@
1
- import { ThemeObject } from "style/themes/base";
1
+ import { ThemeObject } from "../../themes/base";
2
2
  /**
3
3
  *
4
4
  * Converts theme properties to css variables form and set them locally for
@@ -1,4 +1,4 @@
1
- import { ThemeObject } from "style/themes/base";
1
+ import { ThemeObject } from "../themes/base";
2
2
  export declare const toColor: (theme: ThemeObject, color: string) => string;
3
3
  declare const _default: ({ color, bg, backgroundColor, ...rest }: Record<string, unknown>) => any;
4
4
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
- import { ValidationProps } from "__internal__/validations";
3
2
  import { MarginProps } from "styled-system";
3
+ import { ValidationProps } from "../validations";
4
4
  import { TagProps } from "../utils/helpers/tags/tags";
5
5
  import { IconType } from "../../components/icon";
6
6
  interface CommonFormFieldProps extends MarginProps, ValidationProps {
@@ -27,7 +27,7 @@ declare const assertHoverTraversal: ({ num, nonSelectables, }: {
27
27
  num: number;
28
28
  nonSelectables?: number[] | undefined;
29
29
  }) => (wrapper: ReactWrapper) => void;
30
- declare const carbonThemesJestTable: (string | Partial<import("style/themes/base/base-theme.config").ThemeObject> | undefined)[][];
30
+ declare const carbonThemesJestTable: (string | Partial<import("../style/themes/base/base-theme.config").ThemeObject> | undefined)[][];
31
31
  declare const marginProps: readonly [readonly ["m", "margin"], readonly ["ml", "marginLeft"], readonly ["mr", "marginRight"], readonly ["mt", "marginTop"], readonly ["mb", "marginBottom"], readonly ["mx", "marginLeft"], readonly ["mx", "marginRight"], readonly ["my", "marginTop"], readonly ["my", "marginBottom"]];
32
32
  declare type MarginProps = {
33
33
  [K in typeof marginProps[number][0]]?: string | number;