carbon-react 153.6.0 → 153.7.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.
- package/esm/__internal__/checkable-input/checkable-input.component.d.ts +4 -1
- package/esm/__internal__/fieldset/fieldset.component.d.ts +4 -1
- package/esm/__internal__/fieldset/fieldset.style.d.ts +4 -0
- package/esm/__internal__/form-field/form-field.component.d.ts +4 -1
- package/esm/__internal__/utils/createStrictContext.d.ts +31 -0
- package/esm/__internal__/utils/createStrictContext.js +36 -0
- package/esm/__internal__/utils/logger/index.d.ts +7 -0
- package/esm/__internal__/utils/logger/index.js +11 -9
- package/esm/components/button/button.component.js +9 -1
- package/esm/components/checkbox/checkbox-group/checkbox-group.component.d.ts +4 -1
- package/esm/components/checkbox/checkbox-group/checkbox-group.component.js +6 -0
- package/esm/components/date-range/date-range.component.d.ts +4 -1
- package/esm/components/date-range/date-range.component.js +6 -0
- package/esm/components/fieldset/fieldset.component.d.ts +4 -1
- package/esm/components/fieldset/fieldset.component.js +6 -0
- package/esm/components/fieldset/fieldset.style.d.ts +4 -1
- package/esm/components/file-input/file-input.component.d.ts +4 -1
- package/esm/components/file-input/file-input.component.js +6 -0
- package/esm/components/inline-inputs/inline-inputs.component.d.ts +4 -1
- package/esm/components/inline-inputs/inline-inputs.component.js +6 -0
- package/esm/components/menu/__internal__/menu.context.d.ts +3 -12
- package/esm/components/menu/__internal__/menu.context.js +3 -5
- package/esm/components/menu/__internal__/strict-menu.context.d.ts +14 -0
- package/esm/components/menu/__internal__/strict-menu.context.js +11 -0
- package/esm/components/menu/__internal__/submenu/submenu.component.js +3 -4
- package/esm/components/menu/__internal__/submenu/submenu.style.d.ts +1 -1
- package/esm/components/menu/index.d.ts +1 -1
- package/esm/components/menu/menu-divider/menu-divider.component.js +6 -4
- package/esm/components/menu/menu-divider/menu-divider.style.d.ts +1 -1
- package/esm/components/menu/menu-full-screen/menu-full-screen.component.js +4 -5
- package/esm/components/menu/menu-full-screen/menu-full-screen.style.d.ts +1 -1
- package/esm/components/menu/menu-item/menu-item.component.js +4 -4
- package/esm/components/menu/menu-item/menu-item.style.d.ts +1 -1
- package/esm/components/menu/menu-segment-title/menu-segment-title.component.js +10 -7
- package/esm/components/menu/menu-segment-title/menu-segment-title.style.d.ts +1 -1
- package/esm/components/menu/menu.component.d.ts +1 -9
- package/esm/components/menu/menu.component.js +9 -5
- package/esm/components/menu/menu.style.d.ts +1 -1
- package/esm/components/menu/menu.types.d.ts +10 -0
- package/esm/components/menu/menu.types.js +1 -0
- package/esm/components/menu/scrollable-block/scrollable-block.component.js +3 -3
- package/esm/components/menu/scrollable-block/scrollable-block.style.d.ts +1 -1
- package/esm/components/numeral-date/numeral-date.component.d.ts +4 -1
- package/esm/components/numeral-date/numeral-date.component.js +5 -0
- package/esm/components/radio-button/radio-button-group/radio-button-group.component.d.ts +4 -1
- package/esm/components/radio-button/radio-button-group/radio-button-group.component.js +5 -0
- package/esm/components/select/__internal__/select-textbox/select-textbox.component.d.ts +4 -1
- package/esm/components/select/filterable-select/filterable-select.component.d.ts +4 -1
- package/esm/components/select/filterable-select/filterable-select.component.js +5 -0
- package/esm/components/select/multi-select/multi-select.component.d.ts +4 -1
- package/esm/components/select/multi-select/multi-select.component.js +5 -0
- package/esm/components/select/simple-select/simple-select.component.d.ts +4 -1
- package/esm/components/select/simple-select/simple-select.component.js +5 -0
- package/esm/components/text-editor/text-editor.component.d.ts +4 -1
- package/esm/components/text-editor/text-editor.component.js +6 -0
- package/esm/components/textarea/textarea.component.d.ts +4 -1
- package/esm/components/textarea/textarea.component.js +6 -1
- package/esm/components/textbox/textbox.component.d.ts +4 -1
- package/esm/components/textbox/textbox.component.js +6 -1
- package/esm/components/time/time.component.d.ts +4 -1
- package/esm/components/time/time.component.js +6 -0
- package/esm/components/vertical-divider/vertical-divider.component.js +1 -1
- package/lib/__internal__/checkable-input/checkable-input.component.d.ts +4 -1
- package/lib/__internal__/fieldset/fieldset.component.d.ts +4 -1
- package/lib/__internal__/fieldset/fieldset.style.d.ts +4 -0
- package/lib/__internal__/form-field/form-field.component.d.ts +4 -1
- package/lib/__internal__/utils/createStrictContext.d.ts +31 -0
- package/lib/__internal__/utils/createStrictContext.js +43 -0
- package/lib/__internal__/utils/logger/index.d.ts +7 -0
- package/lib/__internal__/utils/logger/index.js +11 -9
- package/lib/components/button/button.component.js +9 -1
- package/lib/components/checkbox/checkbox-group/checkbox-group.component.d.ts +4 -1
- package/lib/components/checkbox/checkbox-group/checkbox-group.component.js +6 -0
- package/lib/components/date-range/date-range.component.d.ts +4 -1
- package/lib/components/date-range/date-range.component.js +6 -0
- package/lib/components/fieldset/fieldset.component.d.ts +4 -1
- package/lib/components/fieldset/fieldset.component.js +6 -0
- package/lib/components/fieldset/fieldset.style.d.ts +4 -1
- package/lib/components/file-input/file-input.component.d.ts +4 -1
- package/lib/components/file-input/file-input.component.js +6 -0
- package/lib/components/inline-inputs/inline-inputs.component.d.ts +4 -1
- package/lib/components/inline-inputs/inline-inputs.component.js +6 -0
- package/lib/components/menu/__internal__/menu.context.d.ts +3 -12
- package/lib/components/menu/__internal__/menu.context.js +3 -6
- package/lib/components/menu/__internal__/strict-menu.context.d.ts +14 -0
- package/lib/components/menu/__internal__/strict-menu.context.js +19 -0
- package/lib/components/menu/__internal__/submenu/submenu.component.js +3 -4
- package/lib/components/menu/__internal__/submenu/submenu.style.d.ts +1 -1
- package/lib/components/menu/index.d.ts +1 -1
- package/lib/components/menu/menu-divider/menu-divider.component.js +8 -8
- package/lib/components/menu/menu-divider/menu-divider.style.d.ts +1 -1
- package/lib/components/menu/menu-full-screen/menu-full-screen.component.js +3 -4
- package/lib/components/menu/menu-full-screen/menu-full-screen.style.d.ts +1 -1
- package/lib/components/menu/menu-item/menu-item.component.js +7 -7
- package/lib/components/menu/menu-item/menu-item.style.d.ts +1 -1
- package/lib/components/menu/menu-segment-title/menu-segment-title.component.js +12 -9
- package/lib/components/menu/menu-segment-title/menu-segment-title.style.d.ts +1 -1
- package/lib/components/menu/menu.component.d.ts +1 -9
- package/lib/components/menu/menu.component.js +9 -5
- package/lib/components/menu/menu.style.d.ts +1 -1
- package/lib/components/menu/menu.types.d.ts +10 -0
- package/lib/components/menu/menu.types.js +5 -0
- package/lib/components/menu/scrollable-block/scrollable-block.component.js +3 -5
- package/lib/components/menu/scrollable-block/scrollable-block.style.d.ts +1 -1
- package/lib/components/numeral-date/numeral-date.component.d.ts +4 -1
- package/lib/components/numeral-date/numeral-date.component.js +5 -0
- package/lib/components/radio-button/radio-button-group/radio-button-group.component.d.ts +4 -1
- package/lib/components/radio-button/radio-button-group/radio-button-group.component.js +5 -0
- package/lib/components/select/__internal__/select-textbox/select-textbox.component.d.ts +4 -1
- package/lib/components/select/filterable-select/filterable-select.component.d.ts +4 -1
- package/lib/components/select/filterable-select/filterable-select.component.js +5 -0
- package/lib/components/select/multi-select/multi-select.component.d.ts +4 -1
- package/lib/components/select/multi-select/multi-select.component.js +5 -0
- package/lib/components/select/simple-select/simple-select.component.d.ts +4 -1
- package/lib/components/select/simple-select/simple-select.component.js +5 -0
- package/lib/components/text-editor/text-editor.component.d.ts +4 -1
- package/lib/components/text-editor/text-editor.component.js +6 -0
- package/lib/components/textarea/textarea.component.d.ts +4 -1
- package/lib/components/textarea/textarea.component.js +6 -1
- package/lib/components/textbox/textbox.component.d.ts +4 -1
- package/lib/components/textbox/textbox.component.js +6 -1
- package/lib/components/time/time.component.d.ts +4 -1
- package/lib/components/time/time.component.js +6 -0
- package/lib/components/vertical-divider/vertical-divider.component.js +1 -1
- package/package.json +5 -4
|
@@ -5,9 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.Menu = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _menu = require("./menu.style");
|
|
9
8
|
var _tags = _interopRequireDefault(require("../../__internal__/utils/helpers/tags"));
|
|
10
|
-
var
|
|
9
|
+
var _menu = require("./menu.style");
|
|
10
|
+
var _strictMenu = require("./__internal__/strict-menu.context");
|
|
11
|
+
var _menu2 = _interopRequireDefault(require("../menu/__internal__/menu.context"));
|
|
11
12
|
var _keyboardNavigation = require("./__internal__/keyboard-navigation");
|
|
12
13
|
var _locators = require("./__internal__/locators");
|
|
13
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -55,10 +56,9 @@ const Menu = ({
|
|
|
55
56
|
ref: ref,
|
|
56
57
|
role: "list",
|
|
57
58
|
onKeyDown: handleKeyDown
|
|
58
|
-
}), /*#__PURE__*/_react.default.createElement(
|
|
59
|
+
}), /*#__PURE__*/_react.default.createElement(_strictMenu.StrictMenuProvider, {
|
|
59
60
|
value: {
|
|
60
61
|
menuType,
|
|
61
|
-
inMenu: true,
|
|
62
62
|
openSubmenuId,
|
|
63
63
|
setOpenSubmenuId,
|
|
64
64
|
focusId,
|
|
@@ -66,7 +66,11 @@ const Menu = ({
|
|
|
66
66
|
registerItem,
|
|
67
67
|
unregisterItem
|
|
68
68
|
}
|
|
69
|
-
},
|
|
69
|
+
}, /*#__PURE__*/_react.default.createElement(_menu2.default.Provider, {
|
|
70
|
+
value: {
|
|
71
|
+
inMenu: true
|
|
72
|
+
}
|
|
73
|
+
}, children)));
|
|
70
74
|
};
|
|
71
75
|
exports.Menu = Menu;
|
|
72
76
|
var _default = exports.default = Menu;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FlexboxProps, LayoutProps, PaddingProps } from "styled-system";
|
|
2
|
-
import { MenuProps } from "./menu.
|
|
2
|
+
import type { MenuProps } from "./menu.types";
|
|
3
3
|
interface StyledMenuProps extends Pick<MenuProps, "menuType">, FlexboxProps, LayoutProps {
|
|
4
4
|
inFullscreenView?: boolean;
|
|
5
5
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FlexboxProps, LayoutProps } from "styled-system";
|
|
3
|
+
import { TagProps } from "../../__internal__/utils/helpers/tags";
|
|
4
|
+
export type MenuType = "light" | "dark" | "white" | "black";
|
|
5
|
+
export interface MenuProps extends TagProps, Pick<LayoutProps, "width" | "minWidth" | "maxWidth" | "overflow" | "overflowX" | "verticalAlign">, FlexboxProps {
|
|
6
|
+
/** Children elements */
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/** Defines the color scheme of the component */
|
|
9
|
+
menuType?: MenuType;
|
|
10
|
+
}
|
|
@@ -4,15 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.ScrollableBlock = void 0;
|
|
7
|
-
var _react =
|
|
8
|
-
var
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _strictMenu = require("../__internal__/strict-menu.context");
|
|
9
9
|
var _menuItem = _interopRequireDefault(require("../menu-item"));
|
|
10
10
|
var _scrollableBlock = _interopRequireDefault(require("./scrollable-block.style"));
|
|
11
11
|
var _box = _interopRequireDefault(require("../../box"));
|
|
12
12
|
var _tags = _interopRequireDefault(require("../../../__internal__/utils/helpers/tags"));
|
|
13
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
-
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); }
|
|
15
|
-
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; }
|
|
16
14
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
17
15
|
const ScrollableBlock = ({
|
|
18
16
|
children,
|
|
@@ -24,7 +22,7 @@ const ScrollableBlock = ({
|
|
|
24
22
|
}) => {
|
|
25
23
|
const {
|
|
26
24
|
menuType
|
|
27
|
-
} = (0,
|
|
25
|
+
} = (0, _strictMenu.useStrictMenuContext)();
|
|
28
26
|
const scrollVariants = {
|
|
29
27
|
light: "light",
|
|
30
28
|
dark: "dark",
|
|
@@ -80,7 +80,10 @@ export interface NumeralDateProps extends ValidationProps, MarginProps, TagProps
|
|
|
80
80
|
* A React ref to pass to the input corresponding to the year
|
|
81
81
|
*/
|
|
82
82
|
yearRef?: React.ForwardedRef<HTMLInputElement>;
|
|
83
|
-
/**
|
|
83
|
+
/**
|
|
84
|
+
* [Legacy] Flag to configure component as optional.
|
|
85
|
+
* @deprecated If the value of this component is not required, use the `required` prop and set it to false instead.
|
|
86
|
+
*/
|
|
84
87
|
isOptional?: boolean;
|
|
85
88
|
}
|
|
86
89
|
export type ValidDateFormat = (typeof ALLOWED_DATE_FORMATS)[number];
|
|
@@ -87,6 +87,7 @@ const getDateLabel = (datePart, locale) => {
|
|
|
87
87
|
return locale.numeralDate.labels.day();
|
|
88
88
|
}
|
|
89
89
|
};
|
|
90
|
+
let deprecateOptionalWarnTriggered = false;
|
|
90
91
|
const NumeralDate = exports.NumeralDate = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
91
92
|
dateFormat = ["dd", "mm", "yyyy"],
|
|
92
93
|
defaultValue,
|
|
@@ -122,6 +123,10 @@ const NumeralDate = exports.NumeralDate = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
122
123
|
yearRef,
|
|
123
124
|
...rest
|
|
124
125
|
}, ref) => {
|
|
126
|
+
if (!deprecateOptionalWarnTriggered && isOptional) {
|
|
127
|
+
deprecateOptionalWarnTriggered = true;
|
|
128
|
+
_logger.default.deprecate("`isOptional` is deprecated in NumeralDate and support will soon be removed. If the value of this component is not required, use the `required` prop and set it to false instead.");
|
|
129
|
+
}
|
|
125
130
|
const locale = (0, _useLocale.default)();
|
|
126
131
|
const {
|
|
127
132
|
validationRedesignOptIn
|
|
@@ -41,7 +41,10 @@ export interface RadioButtonGroupProps extends ValidationProps, MarginProps, Tag
|
|
|
41
41
|
onChange?: (ev: React.ChangeEvent<HTMLInputElement>) => void;
|
|
42
42
|
/** Flag to configure component as mandatory */
|
|
43
43
|
required?: boolean;
|
|
44
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* [Legacy] Flag to configure component as optional.
|
|
46
|
+
* @deprecated If the value of this component is not required, use the `required` prop and set it to false instead.
|
|
47
|
+
*/
|
|
45
48
|
isOptional?: boolean;
|
|
46
49
|
/** value of the selected RadioButton */
|
|
47
50
|
value?: string;
|
|
@@ -25,6 +25,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
25
25
|
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; }
|
|
26
26
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
27
27
|
let deprecateUncontrolledWarnTriggered = false;
|
|
28
|
+
let deprecateOptionalWarnTriggered = false;
|
|
28
29
|
const RadioButtonGroup = ({
|
|
29
30
|
children,
|
|
30
31
|
id,
|
|
@@ -50,6 +51,10 @@ const RadioButtonGroup = ({
|
|
|
50
51
|
tooltipPosition,
|
|
51
52
|
...rest
|
|
52
53
|
}) => {
|
|
54
|
+
if (!deprecateOptionalWarnTriggered && isOptional) {
|
|
55
|
+
deprecateOptionalWarnTriggered = true;
|
|
56
|
+
_logger.default.deprecate("`isOptional` is deprecated in RadioButtonGroup and support will soon be removed. If the value of this component is not required, use the `required` prop and set it to false instead.");
|
|
57
|
+
}
|
|
53
58
|
const {
|
|
54
59
|
validationRedesignOptIn
|
|
55
60
|
} = (0, _react.useContext)(_newValidation.default);
|
|
@@ -56,7 +56,10 @@ export interface FormInputPropTypes extends ValidationProps, Omit<CommonTextboxP
|
|
|
56
56
|
*
|
|
57
57
|
*/
|
|
58
58
|
labelId?: string;
|
|
59
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* [Legacy] Flag to configure component as optional.
|
|
61
|
+
* @deprecated If the value of this component is not required, use the `required` prop and set it to false instead.
|
|
62
|
+
*/
|
|
60
63
|
isOptional?: boolean;
|
|
61
64
|
}
|
|
62
65
|
export interface SelectTextboxProps extends FormInputPropTypes {
|
|
@@ -56,7 +56,10 @@ export interface FilterableSelectProps extends Omit<FormInputPropTypes, "default
|
|
|
56
56
|
/** Boolean to disable automatic filtering and highlighting of options.
|
|
57
57
|
* This allows custom filtering and option styling to be performed outside of the component when the filter text changes. */
|
|
58
58
|
disableDefaultFiltering?: boolean;
|
|
59
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* [Legacy] Flag to configure component as optional.
|
|
61
|
+
* @deprecated If the value of this component is not required, use the `required` prop and set it to false instead.
|
|
62
|
+
*/
|
|
60
63
|
isOptional?: boolean;
|
|
61
64
|
/** Flag to configure component as mandatory */
|
|
62
65
|
required?: boolean;
|
|
@@ -24,6 +24,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
24
24
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
25
25
|
let deprecateUncontrolledWarnTriggered = false;
|
|
26
26
|
const FilterableSelectList = (0, _withFilter.default)(_selectList.default);
|
|
27
|
+
let deprecateOptionalWarnTriggered = false;
|
|
27
28
|
const FilterableSelect = exports.FilterableSelect = /*#__PURE__*/_react.default.forwardRef(({
|
|
28
29
|
"aria-label": ariaLabel,
|
|
29
30
|
"aria-labelledby": ariaLabelledby,
|
|
@@ -64,6 +65,10 @@ const FilterableSelect = exports.FilterableSelect = /*#__PURE__*/_react.default.
|
|
|
64
65
|
listWidth,
|
|
65
66
|
...textboxProps
|
|
66
67
|
}, ref) => {
|
|
68
|
+
if (!deprecateOptionalWarnTriggered && isOptional) {
|
|
69
|
+
deprecateOptionalWarnTriggered = true;
|
|
70
|
+
_logger.default.deprecate("`isOptional` is deprecated in FilterableSelect and support will soon be removed. If the value of this component is not required, use the `required` prop and set it to false instead.");
|
|
71
|
+
}
|
|
67
72
|
const [activeDescendantId, setActiveDescendantId] = (0, _react.useState)("");
|
|
68
73
|
const selectListId = (0, _react.useRef)((0, _guid.default)());
|
|
69
74
|
const containerRef = (0, _react.useRef)(null);
|
|
@@ -52,7 +52,10 @@ export interface MultiSelectProps extends Omit<FormInputPropTypes, "defaultValue
|
|
|
52
52
|
* Higher values make for smoother scrolling but may impact performance.
|
|
53
53
|
* Only used if the `enableVirtualScroll` prop is set. */
|
|
54
54
|
virtualScrollOverscan?: number;
|
|
55
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* [Legacy] Flag to configure component as optional.
|
|
57
|
+
* @deprecated If the value of this component is not required, use the `required` prop and set it to false instead.
|
|
58
|
+
*/
|
|
56
59
|
isOptional?: boolean;
|
|
57
60
|
/** Specify a callback triggered on change */
|
|
58
61
|
onChange?: (ev: CustomSelectChangeEvent | React.ChangeEvent<HTMLInputElement>) => void;
|
|
@@ -25,6 +25,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
25
25
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
26
26
|
let deprecateUncontrolledWarnTriggered = false;
|
|
27
27
|
const FilterableSelectList = (0, _withFilter.default)(_selectList.default);
|
|
28
|
+
let deprecateOptionalWarnTriggered = false;
|
|
28
29
|
const MultiSelect = exports.MultiSelect = /*#__PURE__*/_react.default.forwardRef(({
|
|
29
30
|
"aria-label": ariaLabel,
|
|
30
31
|
"aria-labelledby": ariaLabelledby,
|
|
@@ -65,6 +66,10 @@ const MultiSelect = exports.MultiSelect = /*#__PURE__*/_react.default.forwardRef
|
|
|
65
66
|
listWidth,
|
|
66
67
|
...textboxProps
|
|
67
68
|
}, ref) => {
|
|
69
|
+
if (!deprecateOptionalWarnTriggered && isOptional) {
|
|
70
|
+
deprecateOptionalWarnTriggered = true;
|
|
71
|
+
_logger.default.deprecate("`isOptional` is deprecated in MultiSelect and support will soon be removed. If the value of this component is not required, use the `required` prop and set it to false instead.");
|
|
72
|
+
}
|
|
68
73
|
const [activeDescendantId, setActiveDescendantId] = (0, _react.useState)("");
|
|
69
74
|
const selectListId = (0, _react.useRef)((0, _guid.default)());
|
|
70
75
|
const accessibilityLabelId = (0, _react.useRef)((0, _guid.default)());
|
|
@@ -50,7 +50,10 @@ export interface SimpleSelectProps extends Omit<FormInputPropTypes, "defaultValu
|
|
|
50
50
|
* Higher values make for smoother scrolling but may impact performance.
|
|
51
51
|
* Only used if the `enableVirtualScroll` prop is set. */
|
|
52
52
|
virtualScrollOverscan?: number;
|
|
53
|
-
/**
|
|
53
|
+
/**
|
|
54
|
+
* [Legacy] Flag to configure component as optional.
|
|
55
|
+
* @deprecated If the value of this component is not required, use the `isRequired` prop and set it to false instead.
|
|
56
|
+
*/
|
|
54
57
|
isOptional?: boolean;
|
|
55
58
|
/** Flag to configure component as mandatory */
|
|
56
59
|
isRequired?: boolean;
|
|
@@ -21,6 +21,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
21
21
|
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; }
|
|
22
22
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
23
23
|
let deprecateUncontrolledWarnTriggered = false;
|
|
24
|
+
let deprecateOptionalWarnTriggered = false;
|
|
24
25
|
const SimpleSelect = exports.SimpleSelect = /*#__PURE__*/_react.default.forwardRef(({
|
|
25
26
|
"aria-describedby": ariaDescribedBy,
|
|
26
27
|
"aria-label": ariaLabel,
|
|
@@ -58,6 +59,10 @@ const SimpleSelect = exports.SimpleSelect = /*#__PURE__*/_react.default.forwardR
|
|
|
58
59
|
listWidth,
|
|
59
60
|
...props
|
|
60
61
|
}, ref) => {
|
|
62
|
+
if (!deprecateOptionalWarnTriggered && isOptional) {
|
|
63
|
+
deprecateOptionalWarnTriggered = true;
|
|
64
|
+
_logger.default.deprecate("`isOptional` is deprecated in SimpleSelect and support will soon be removed. If the value of this component is not required, use the `required` prop and set it to false instead.");
|
|
65
|
+
}
|
|
61
66
|
const selectListId = (0, _react.useRef)((0, _guid.default)());
|
|
62
67
|
const containerRef = (0, _react.useRef)(null);
|
|
63
68
|
const listboxRef = (0, _react.useRef)(null);
|
|
@@ -14,7 +14,10 @@ export interface TextEditorProps extends MarginProps, TagProps {
|
|
|
14
14
|
header?: React.ReactNode;
|
|
15
15
|
/** A hint string rendered before the editor but after the label. Intended to describe the purpose or content of the input. */
|
|
16
16
|
inputHint?: string;
|
|
17
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* [Legacy] Whether the content of the editor can be empty
|
|
19
|
+
* @deprecated If the value of this component is not required, use the `required` prop and set it to false instead.
|
|
20
|
+
*/
|
|
18
21
|
isOptional?: boolean;
|
|
19
22
|
/** The label to display above the editor */
|
|
20
23
|
labelText: string;
|
|
@@ -19,6 +19,7 @@ var _helpers = require("./__internal__/helpers");
|
|
|
19
19
|
var _label = _interopRequireDefault(require("../../__internal__/label"));
|
|
20
20
|
var _useDebounce = _interopRequireDefault(require("../../hooks/__internal__/useDebounce"));
|
|
21
21
|
var _useLocale = _interopRequireDefault(require("../../hooks/__internal__/useLocale"));
|
|
22
|
+
var _logger = _interopRequireDefault(require("../../__internal__/utils/logger"));
|
|
22
23
|
var _constants = require("./__internal__/constants");
|
|
23
24
|
var _plugins = require("./__internal__/plugins");
|
|
24
25
|
var _textEditor = _interopRequireDefault(require("./text-editor.context"));
|
|
@@ -31,6 +32,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
31
32
|
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); }
|
|
32
33
|
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; }
|
|
33
34
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } /* eslint-disable no-console */
|
|
35
|
+
let deprecateOptionalWarnTriggered = false;
|
|
34
36
|
const TextEditor = ({
|
|
35
37
|
characterLimit = 3000,
|
|
36
38
|
error,
|
|
@@ -53,6 +55,10 @@ const TextEditor = ({
|
|
|
53
55
|
value,
|
|
54
56
|
...rest
|
|
55
57
|
}) => {
|
|
58
|
+
if (!deprecateOptionalWarnTriggered && isOptional) {
|
|
59
|
+
deprecateOptionalWarnTriggered = true;
|
|
60
|
+
_logger.default.deprecate("`isOptional` is deprecated in TextEditor and support will soon be removed. If the value of this component is not required, use the `required` prop and set it to false instead.");
|
|
61
|
+
}
|
|
56
62
|
const editorRef = (0, _react.useRef)(undefined);
|
|
57
63
|
const locale = (0, _useLocale.default)();
|
|
58
64
|
const [characterLimitWarning, setCharacterLimitWarning] = (0, _react.useState)(undefined);
|
|
@@ -77,7 +77,10 @@ export interface TextareaProps extends ValidationProps, MarginProps, Omit<Common
|
|
|
77
77
|
placeholder?: string;
|
|
78
78
|
/** Adds readOnly property */
|
|
79
79
|
readOnly?: boolean;
|
|
80
|
-
/**
|
|
80
|
+
/**
|
|
81
|
+
* [Legacy] Flag to configure component as optional.
|
|
82
|
+
* @deprecated If the value of this component is not required, use the `required` prop and set it to false instead.
|
|
83
|
+
*/
|
|
81
84
|
isOptional?: boolean;
|
|
82
85
|
/** The number of visible text lines for the control. When set, this determines the height of the textarea, and the minHeight property is ignored. */
|
|
83
86
|
rows?: number;
|
|
@@ -27,8 +27,9 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
27
27
|
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); }
|
|
28
28
|
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; }
|
|
29
29
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
30
|
-
let deprecateUncontrolledWarnTriggered = false;
|
|
31
30
|
let deprecatedAriaDescribedByWarnTriggered = false;
|
|
31
|
+
let deprecateOptionalWarnTriggered = false;
|
|
32
|
+
let deprecateUncontrolledWarnTriggered = false;
|
|
32
33
|
let warnBorderRadiusArrayTooLarge = false;
|
|
33
34
|
const Textarea = exports.OriginalTextarea = exports.Textarea = /*#__PURE__*/_react.default.forwardRef(({
|
|
34
35
|
"aria-labelledby": ariaLabelledBy,
|
|
@@ -75,6 +76,10 @@ const Textarea = exports.OriginalTextarea = exports.Textarea = /*#__PURE__*/_rea
|
|
|
75
76
|
minHeight = _textarea.DEFAULT_MIN_HEIGHT,
|
|
76
77
|
...rest
|
|
77
78
|
}, ref) => {
|
|
79
|
+
if (!deprecateOptionalWarnTriggered && isOptional) {
|
|
80
|
+
deprecateOptionalWarnTriggered = true;
|
|
81
|
+
_logger.default.deprecate("`isOptional` is deprecated in TextArea and support will soon be removed. If the value of this component is not required, use the `required` prop and set it to false instead.");
|
|
82
|
+
}
|
|
78
83
|
const {
|
|
79
84
|
validationRedesignOptIn
|
|
80
85
|
} = (0, _react.useContext)(_newValidation.default);
|
|
@@ -87,7 +87,10 @@ export interface CommonTextboxProps extends ValidationProps, MarginProps, Omit<C
|
|
|
87
87
|
tooltipPosition?: "top" | "bottom" | "left" | "right";
|
|
88
88
|
/** [Legacy] Aria label for rendered help component. */
|
|
89
89
|
helpAriaLabel?: string;
|
|
90
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* [Legacy] Flag to configure component as optional.
|
|
92
|
+
* @deprecated If the value of this component is not required, use the `required` prop and set it to false instead.
|
|
93
|
+
*/
|
|
91
94
|
isOptional?: boolean;
|
|
92
95
|
/** The id attribute for the validation tooltip */
|
|
93
96
|
tooltipId?: string;
|
|
@@ -31,8 +31,9 @@ const ALIGN_DEFAULT = exports.ALIGN_DEFAULT = "left";
|
|
|
31
31
|
const SIZE_DEFAULT = exports.SIZE_DEFAULT = "medium";
|
|
32
32
|
const LABEL_WIDTH_DEFAULT = exports.LABEL_WIDTH_DEFAULT = 30;
|
|
33
33
|
const LABEL_VALIDATION_DEFAULT = exports.LABEL_VALIDATION_DEFAULT = false;
|
|
34
|
-
let deprecateUncontrolledWarnTriggered = false;
|
|
35
34
|
let deprecatedAriaDescribedByWarnTriggered = false;
|
|
35
|
+
let deprecateOptionalWarnTriggered = false;
|
|
36
|
+
let deprecateUncontrolledWarnTriggered = false;
|
|
36
37
|
const Textbox = exports.Textbox = /*#__PURE__*/_react.default.forwardRef(({
|
|
37
38
|
"aria-labelledby": ariaLabelledBy,
|
|
38
39
|
"aria-describedby": ariaDescribedByProp,
|
|
@@ -89,6 +90,10 @@ const Textbox = exports.Textbox = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
89
90
|
tooltipId,
|
|
90
91
|
...props
|
|
91
92
|
}, ref) => {
|
|
93
|
+
if (!deprecateOptionalWarnTriggered && isOptional) {
|
|
94
|
+
deprecateOptionalWarnTriggered = true;
|
|
95
|
+
_logger.default.deprecate("`isOptional` is deprecated in Textbox and support will soon be removed. If the value of this component is not required, use the `required` prop and set it to false instead.");
|
|
96
|
+
}
|
|
92
97
|
const characterCountValue = typeof value === "string" ? value : "";
|
|
93
98
|
const [uniqueId, uniqueName] = (0, _useUniqueId.default)(id, name);
|
|
94
99
|
const [characterCountAriaLive, setCharacterCountAriaLive] = (0, _react.useState)("off");
|
|
@@ -60,7 +60,10 @@ export interface TimeProps extends TagProps, MarginProps {
|
|
|
60
60
|
onBlur?: (ev?: React.FocusEvent<HTMLInputElement>, value?: TimeValue) => void;
|
|
61
61
|
/** Flag to configure component as mandatory */
|
|
62
62
|
required?: boolean;
|
|
63
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* [Legacy] Flag to configure component as optional.
|
|
65
|
+
* @deprecated If the value of this component is not required, use the `required` prop and set it to false instead.
|
|
66
|
+
*/
|
|
64
67
|
isOptional?: boolean;
|
|
65
68
|
/** If true, the component will be disabled */
|
|
66
69
|
disabled?: boolean;
|
|
@@ -10,6 +10,7 @@ var _useLocale = _interopRequireDefault(require("../../hooks/__internal__/useLoc
|
|
|
10
10
|
var _tags = _interopRequireDefault(require("../../__internal__/utils/helpers/tags/tags"));
|
|
11
11
|
var _useInputAccessibility = _interopRequireDefault(require("../../hooks/__internal__/useInputAccessibility"));
|
|
12
12
|
var _utils = require("../../style/utils");
|
|
13
|
+
var _logger = _interopRequireDefault(require("../../__internal__/utils/logger"));
|
|
13
14
|
var _fieldset = _interopRequireDefault(require("../../__internal__/fieldset"));
|
|
14
15
|
var _box = _interopRequireDefault(require("../box"));
|
|
15
16
|
var _textbox = _interopRequireDefault(require("../textbox/textbox.style"));
|
|
@@ -23,6 +24,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
23
24
|
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); }
|
|
24
25
|
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; }
|
|
25
26
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
27
|
+
let deprecateOptionalWarnTriggered = false;
|
|
26
28
|
const Time = /*#__PURE__*/_react.default.forwardRef(({
|
|
27
29
|
label,
|
|
28
30
|
labelAlign,
|
|
@@ -42,6 +44,10 @@ const Time = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
42
44
|
toggleProps = {},
|
|
43
45
|
...rest
|
|
44
46
|
}, ref) => {
|
|
47
|
+
if (!deprecateOptionalWarnTriggered && isOptional) {
|
|
48
|
+
deprecateOptionalWarnTriggered = true;
|
|
49
|
+
_logger.default.deprecate("`isOptional` is deprecated in Time and support will soon be removed. If the value of this component is not required, use the `required` prop and set it to false instead.");
|
|
50
|
+
}
|
|
45
51
|
const {
|
|
46
52
|
id: hoursInputId,
|
|
47
53
|
label: hoursLabel,
|
|
@@ -30,7 +30,7 @@ const VerticalDivider = ({
|
|
|
30
30
|
displayInline: displayInline
|
|
31
31
|
}, props, {
|
|
32
32
|
as: inMenu ? "li" : "div",
|
|
33
|
-
"aria-hidden": inMenu
|
|
33
|
+
"aria-hidden": inMenu || ariaHidden
|
|
34
34
|
}, (0, _tags.default)("vertical-divider", props)), /*#__PURE__*/_react.default.createElement(_verticalDivider.StyledDivider, {
|
|
35
35
|
"data-role": "divider",
|
|
36
36
|
tint: tint
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "carbon-react",
|
|
3
|
-
"version": "153.
|
|
3
|
+
"version": "153.7.1",
|
|
4
4
|
"description": "A library of reusable React components for easily building user interfaces.",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib",
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
"@commitlint/cli": "^17.6.3",
|
|
70
70
|
"@commitlint/config-conventional": "^17.6.3",
|
|
71
71
|
"@dotenvx/dotenvx": "^1.25.1",
|
|
72
|
-
"@playwright/experimental-ct-react": "
|
|
73
|
-
"@playwright/test": "
|
|
72
|
+
"@playwright/experimental-ct-react": "^1.52.0",
|
|
73
|
+
"@playwright/test": "^1.52.0",
|
|
74
74
|
"@sage/design-tokens": "~4.29.0",
|
|
75
75
|
"@semantic-release/changelog": "^6.0.3",
|
|
76
76
|
"@semantic-release/exec": "^6.0.3",
|
|
@@ -167,6 +167,7 @@
|
|
|
167
167
|
"typescript": "~5.3.0",
|
|
168
168
|
"url-loader": "^4.1.1",
|
|
169
169
|
"uuid": "^8.3.2",
|
|
170
|
+
"vite": "^6.3.4",
|
|
170
171
|
"webpack-dev-server": "^4.15.1"
|
|
171
172
|
},
|
|
172
173
|
"dependencies": {
|
|
@@ -189,7 +190,7 @@
|
|
|
189
190
|
"lodash": "^4.17.21",
|
|
190
191
|
"polished": "^4.2.2",
|
|
191
192
|
"prop-types": "^15.8.1",
|
|
192
|
-
"react-day-picker": "
|
|
193
|
+
"react-day-picker": "~9.3.2",
|
|
193
194
|
"react-dnd": "^16.0.1",
|
|
194
195
|
"react-dnd-html5-backend": "^16.0.1",
|
|
195
196
|
"react-is": "^17.0.2",
|