carbon-react 134.0.0 → 134.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -62,6 +62,12 @@ export interface ButtonProps extends SpaceProps, TagProps {
62
62
  target?: string;
63
63
  /** HTML rel attribute */
64
64
  rel?: string;
65
+ /**
66
+ * @private
67
+ * @internal
68
+ * Set a class name on the button element
69
+ */
70
+ className?: string;
65
71
  }
66
72
  declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
67
73
  export default Button;
@@ -170,6 +170,7 @@ if (process.env.NODE_ENV !== "production") {
170
170
  "aria-labelledby": PropTypes.string,
171
171
  "buttonType": PropTypes.oneOf(["darkBackground", "gradient-grey", "gradient-white", "primary", "secondary", "tertiary"]),
172
172
  "children": PropTypes.node,
173
+ "className": PropTypes.string,
173
174
  "data-component": PropTypes.string,
174
175
  "data-element": PropTypes.string,
175
176
  "data-role": PropTypes.string,
@@ -1,3 +1,3 @@
1
1
  import { FlatTableProps } from "..";
2
- declare const getAlternativeBackgroundColor: (colorTheme: FlatTableProps["colorTheme"]) => "var(--colorsActionMinor100)" | "var(--colorsUtilityMajor025)" | "var(--colorsUtilityYang100)" | "var(--colorsActionMinor550)";
2
+ declare const getAlternativeBackgroundColor: (colorTheme: FlatTableProps["colorTheme"]) => "var(--colorsActionMinor100)" | "var(--colorsUtilityYang100)" | "var(--colorsUtilityMajor025)" | "var(--colorsActionMinor550)";
3
3
  export default getAlternativeBackgroundColor;
@@ -1,6 +1,7 @@
1
1
  import styled, { css } from "styled-components";
2
2
  import baseTheme from "../../style/themes/base";
3
3
  import StyledIcon from "../icon/icon.style";
4
+ import StyledButton from "../button/button.style";
4
5
  const colorMap = {
5
6
  light: variant => {
6
7
  let color = "var(--colorsActionMajor500)";
@@ -173,7 +174,7 @@ const StyledLink = styled.span`
173
174
  border-bottom-right-radius: var(--borderRadius025);
174
175
  `}
175
176
 
176
- > button {
177
+ > button, ${StyledButton}:not(.search-button) {
177
178
  background-color: transparent;
178
179
  border: none;
179
180
  padding: 0;
@@ -160,7 +160,8 @@ const Search = /*#__PURE__*/React.forwardRef(({
160
160
  px: 2,
161
161
  buttonType: "primary",
162
162
  iconPosition: "before",
163
- iconType: "search"
163
+ iconType: "search",
164
+ className: "search-button"
164
165
  }, buttonProps), searchButtonText)));
165
166
  });
166
167
  if (process.env.NODE_ENV !== "production") {
@@ -137,7 +137,7 @@ const SimpleSelect = /*#__PURE__*/React.forwardRef(({
137
137
  if (readOnly) {
138
138
  return;
139
139
  }
140
- if (key === "Enter" || key === " " || isNavigationKey(key)) {
140
+ if (key === " " || isNavigationKey(key)) {
141
141
  event.preventDefault();
142
142
  setOpenState(isAlreadyOpen => {
143
143
  if (!isAlreadyOpen && onOpen) {
@@ -62,6 +62,12 @@ export interface ButtonProps extends SpaceProps, TagProps {
62
62
  target?: string;
63
63
  /** HTML rel attribute */
64
64
  rel?: string;
65
+ /**
66
+ * @private
67
+ * @internal
68
+ * Set a class name on the button element
69
+ */
70
+ className?: string;
65
71
  }
66
72
  declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
67
73
  export default Button;
@@ -179,6 +179,7 @@ if (process.env.NODE_ENV !== "production") {
179
179
  "aria-labelledby": _propTypes.default.string,
180
180
  "buttonType": _propTypes.default.oneOf(["darkBackground", "gradient-grey", "gradient-white", "primary", "secondary", "tertiary"]),
181
181
  "children": _propTypes.default.node,
182
+ "className": _propTypes.default.string,
182
183
  "data-component": _propTypes.default.string,
183
184
  "data-element": _propTypes.default.string,
184
185
  "data-role": _propTypes.default.string,
@@ -1,3 +1,3 @@
1
1
  import { FlatTableProps } from "..";
2
- declare const getAlternativeBackgroundColor: (colorTheme: FlatTableProps["colorTheme"]) => "var(--colorsActionMinor100)" | "var(--colorsUtilityMajor025)" | "var(--colorsUtilityYang100)" | "var(--colorsActionMinor550)";
2
+ declare const getAlternativeBackgroundColor: (colorTheme: FlatTableProps["colorTheme"]) => "var(--colorsActionMinor100)" | "var(--colorsUtilityYang100)" | "var(--colorsUtilityMajor025)" | "var(--colorsActionMinor550)";
3
3
  export default getAlternativeBackgroundColor;
@@ -7,6 +7,7 @@ exports.StyledLink = exports.StyledContent = void 0;
7
7
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
8
8
  var _base = _interopRequireDefault(require("../../style/themes/base"));
9
9
  var _icon = _interopRequireDefault(require("../icon/icon.style"));
10
+ var _button = _interopRequireDefault(require("../button/button.style"));
10
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
12
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
12
13
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -182,7 +183,7 @@ const StyledLink = exports.StyledLink = _styledComponents.default.span`
182
183
  border-bottom-right-radius: var(--borderRadius025);
183
184
  `}
184
185
 
185
- > button {
186
+ > button, ${_button.default}:not(.search-button) {
186
187
  background-color: transparent;
187
188
  border: none;
188
189
  padding: 0;
@@ -169,7 +169,8 @@ const Search = exports.Search = /*#__PURE__*/_react.default.forwardRef(({
169
169
  px: 2,
170
170
  buttonType: "primary",
171
171
  iconPosition: "before",
172
- iconType: "search"
172
+ iconType: "search",
173
+ className: "search-button"
173
174
  }, buttonProps), searchButtonText)));
174
175
  });
175
176
  if (process.env.NODE_ENV !== "production") {
@@ -146,7 +146,7 @@ const SimpleSelect = exports.SimpleSelect = /*#__PURE__*/_react.default.forwardR
146
146
  if (readOnly) {
147
147
  return;
148
148
  }
149
- if (key === "Enter" || key === " " || (0, _isNavigationKey.default)(key)) {
149
+ if (key === " " || (0, _isNavigationKey.default)(key)) {
150
150
  event.preventDefault();
151
151
  setOpenState(isAlreadyOpen => {
152
152
  if (!isAlreadyOpen && onOpen) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "134.0.0",
3
+ "version": "134.0.2",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "files": [
6
6
  "lib",
@@ -24,7 +24,6 @@
24
24
  "build-storybook": "cross-env STORYBOOK_BUILD=true storybook build -c .storybook",
25
25
  "start-storybook": "cross-env STORYBOOK_BUILD=true storybook dev -c .storybook",
26
26
  "start:static": "npx http-server -p 9001 ./storybook-static",
27
- "babel": "cross-env NODE_ENV=production babel ./src --config-file ./babel.config.js --out-dir ./lib --ignore '**/*.spec.js','**/*.spec.ts','**/*.spec.tsx','**/*.d.ts' --quiet --extensions '.js','.ts','.tsx'",
28
27
  "clean-lib": "rimraf ./lib && rimraf ./esm",
29
28
  "commit": "git-cz",
30
29
  "generate-metadata": "node ./scripts/generate_metadata/index.mjs",
@@ -134,13 +133,14 @@
134
133
  "eslint-config-prettier": "^9.1.0",
135
134
  "eslint-plugin-import": "^2.29.0",
136
135
  "eslint-plugin-jest": "^27.6.0",
137
- "eslint-plugin-jest-dom": "^5.1.0",
136
+ "eslint-plugin-jest-dom": "^5.2.0",
138
137
  "eslint-plugin-jsx-a11y": "^6.8.0",
139
138
  "eslint-plugin-mdx": "^3.0.0",
140
139
  "eslint-plugin-no-unsanitized": "^4.0.2",
141
140
  "eslint-plugin-playwright": "^1.6.0",
142
141
  "eslint-plugin-react": "^7.33.2",
143
142
  "eslint-plugin-react-hooks": "^4.6.0",
143
+ "eslint-plugin-testing-library": "^6.2.2",
144
144
  "events": "~1.1.1",
145
145
  "fast-glob": "^3.3.2",
146
146
  "file-loader": "^6.2.0",