carbon-react 140.0.0 → 140.0.1

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.
@@ -83,7 +83,8 @@ export const ValidationIcon = ({
83
83
  isPartOfInput: isPartOfInput,
84
84
  inputSize: size,
85
85
  id: iconId,
86
- focusable: tabIndex !== -1
86
+ focusable: tabIndex !== -1,
87
+ "data-role": `icon-${validationType}`
87
88
  }));
88
89
  };
89
90
  export default ValidationIcon;
@@ -30,11 +30,11 @@ export const DatePicker = ({
30
30
  setOpen,
31
31
  pickerTabGuardId
32
32
  }) => {
33
- const l = useLocale();
33
+ const locale = useLocale();
34
34
  const {
35
35
  localize,
36
36
  options
37
- } = l.date.dateFnsLocale();
37
+ } = locale.date.dateFnsLocale();
38
38
  const {
39
39
  weekStartsOn
40
40
  } = options || /* istanbul ignore next */{};
@@ -53,7 +53,7 @@ export const DatePicker = ({
53
53
  length: 7
54
54
  }).map((_, i) => localize?.day(i)), [localize]);
55
55
  const weekdaysShort = useMemo(() => {
56
- const isGivenLocale = str => l.locale().includes(str);
56
+ const isGivenLocale = str => locale.locale().includes(str);
57
57
  return Array.from({
58
58
  length: 7
59
59
  }).map((_, i) => localize?.day(i, ["de", "pl"].some(isGivenLocale) ? {
@@ -61,7 +61,7 @@ export const DatePicker = ({
61
61
  } : {
62
62
  width: "abbreviated"
63
63
  }).substring(0, isGivenLocale("de") ? 2 : 3));
64
- }, [l, localize]);
64
+ }, [locale, localize]);
65
65
  const ref = useRef(null);
66
66
  useEffect(() => {
67
67
  if (open) {
@@ -178,7 +178,7 @@ export const DatePicker = ({
178
178
  fixedWeeks: true,
179
179
  initialMonth: selectedDays || undefined,
180
180
  disabledDays: getDisabledDays(minDate, maxDate),
181
- locale: l.locale(),
181
+ locale: locale.locale(),
182
182
  localeUtils: localeUtils,
183
183
  onDayKeyDown: handleOnDayKeyDown
184
184
  }, pickerProps))));
@@ -22,7 +22,8 @@ export const Navbar = ({
22
22
  }
23
23
  };
24
24
  return /*#__PURE__*/React.createElement(StyledNavbar, {
25
- className: className
25
+ className: className,
26
+ "data-role": "date-navbar"
26
27
  }, /*#__PURE__*/React.createElement(StyledButton, {
27
28
  "aria-label": previousMonthButton(),
28
29
  onClick: () => onPreviousClick?.(),
@@ -48,10 +48,10 @@ const DateInput = /*#__PURE__*/React.forwardRef(({
48
48
  const alreadyFocused = useRef(false);
49
49
  const isBlurBlocked = useRef(false);
50
50
  const focusedViaPicker = useRef(false);
51
- const l = useLocale();
51
+ const locale = useLocale();
52
52
  const {
53
53
  dateFnsLocale
54
- } = l.date;
54
+ } = locale.date;
55
55
  const {
56
56
  format,
57
57
  formats
@@ -60,8 +60,9 @@ const StyledProgressBar = styled.span`
60
60
  })};
61
61
  border-radius: ${theme.roundedCornersOptOut ? "25px" : "var(--borderRadius400)"};
62
62
  overflow-x: hidden;
63
- height: ${getHeight(size)};
64
- width: 100%;
63
+ width: 100%
64
+ min-height: fit-content;
65
+ box-sizing: border-box;
65
66
  `}
66
67
  `;
67
68
  const fontSizes = {
@@ -161,6 +161,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef(({
161
161
  ref: handleTargetRef
162
162
  }), showTooltip ? /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(StyledTooltip, _extends({
163
163
  "data-element": "tooltip",
164
+ "data-role": "tooltip",
164
165
  role: "tooltip",
165
166
  tabIndex: -1,
166
167
  type: type,
@@ -92,7 +92,8 @@ const ValidationIcon = ({
92
92
  isPartOfInput: isPartOfInput,
93
93
  inputSize: size,
94
94
  id: iconId,
95
- focusable: tabIndex !== -1
95
+ focusable: tabIndex !== -1,
96
+ "data-role": `icon-${validationType}`
96
97
  }));
97
98
  };
98
99
  exports.ValidationIcon = ValidationIcon;
@@ -38,11 +38,11 @@ const DatePicker = ({
38
38
  setOpen,
39
39
  pickerTabGuardId
40
40
  }) => {
41
- const l = (0, _useLocale.default)();
41
+ const locale = (0, _useLocale.default)();
42
42
  const {
43
43
  localize,
44
44
  options
45
- } = l.date.dateFnsLocale();
45
+ } = locale.date.dateFnsLocale();
46
46
  const {
47
47
  weekStartsOn
48
48
  } = options || /* istanbul ignore next */{};
@@ -61,7 +61,7 @@ const DatePicker = ({
61
61
  length: 7
62
62
  }).map((_, i) => localize?.day(i)), [localize]);
63
63
  const weekdaysShort = (0, _react.useMemo)(() => {
64
- const isGivenLocale = str => l.locale().includes(str);
64
+ const isGivenLocale = str => locale.locale().includes(str);
65
65
  return Array.from({
66
66
  length: 7
67
67
  }).map((_, i) => localize?.day(i, ["de", "pl"].some(isGivenLocale) ? {
@@ -69,7 +69,7 @@ const DatePicker = ({
69
69
  } : {
70
70
  width: "abbreviated"
71
71
  }).substring(0, isGivenLocale("de") ? 2 : 3));
72
- }, [l, localize]);
72
+ }, [locale, localize]);
73
73
  const ref = (0, _react.useRef)(null);
74
74
  (0, _react.useEffect)(() => {
75
75
  if (open) {
@@ -186,7 +186,7 @@ const DatePicker = ({
186
186
  fixedWeeks: true,
187
187
  initialMonth: selectedDays || undefined,
188
188
  disabledDays: (0, _utils.getDisabledDays)(minDate, maxDate),
189
- locale: l.locale(),
189
+ locale: locale.locale(),
190
190
  localeUtils: localeUtils,
191
191
  onDayKeyDown: handleOnDayKeyDown
192
192
  }, pickerProps))));
@@ -29,7 +29,8 @@ const Navbar = ({
29
29
  }
30
30
  };
31
31
  return /*#__PURE__*/_react.default.createElement(_navbar.default, {
32
- className: className
32
+ className: className,
33
+ "data-role": "date-navbar"
33
34
  }, /*#__PURE__*/_react.default.createElement(_button.default, {
34
35
  "aria-label": previousMonthButton(),
35
36
  onClick: () => onPreviousClick?.(),
@@ -57,10 +57,10 @@ const DateInput = exports.DateInput = /*#__PURE__*/_react.default.forwardRef(({
57
57
  const alreadyFocused = (0, _react.useRef)(false);
58
58
  const isBlurBlocked = (0, _react.useRef)(false);
59
59
  const focusedViaPicker = (0, _react.useRef)(false);
60
- const l = (0, _useLocale.default)();
60
+ const locale = (0, _useLocale.default)();
61
61
  const {
62
62
  dateFnsLocale
63
- } = l.date;
63
+ } = locale.date;
64
64
  const {
65
65
  format,
66
66
  formats
@@ -69,8 +69,9 @@ const StyledProgressBar = exports.StyledProgressBar = _styledComponents.default.
69
69
  })};
70
70
  border-radius: ${theme.roundedCornersOptOut ? "25px" : "var(--borderRadius400)"};
71
71
  overflow-x: hidden;
72
- height: ${getHeight(size)};
73
- width: 100%;
72
+ width: 100%
73
+ min-height: fit-content;
74
+ box-sizing: border-box;
74
75
  `}
75
76
  `;
76
77
  const fontSizes = {
@@ -170,6 +170,7 @@ const Tooltip = exports.Tooltip = /*#__PURE__*/_react.default.forwardRef(({
170
170
  ref: handleTargetRef
171
171
  }), showTooltip ? /*#__PURE__*/_react.default.createElement(_portal.default, null, /*#__PURE__*/_react.default.createElement(_tooltip.default, _extends({
172
172
  "data-element": "tooltip",
173
+ "data-role": "tooltip",
173
174
  role: "tooltip",
174
175
  tabIndex: -1,
175
176
  type: type,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "140.0.0",
3
+ "version": "140.0.1",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "files": [
6
6
  "lib",