@carbon/react 1.94.0-rc.0 → 1.94.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.
@@ -155,7 +155,9 @@ const ComposedModalDialog = /*#__PURE__*/React.forwardRef(function ComposedModal
155
155
  const modalState = useComposedModalState(open);
156
156
  const [isOpen, setIsOpen] = presenceContext?.modalState ?? modalState;
157
157
  const enableDialogElement = useFeatureFlag('enable-dialog-element');
158
- const focusTrapWithoutSentinels = useFeatureFlag('enable-experimental-focus-wrap-without-sentinels');
158
+ const deprecatedFlag = useFeatureFlag('enable-experimental-focus-wrap-without-sentinels');
159
+ const focusTrapWithoutSentinelsFlag = useFeatureFlag('enable-focus-wrap-without-sentinels');
160
+ const focusTrapWithoutSentinels = deprecatedFlag || focusTrapWithoutSentinelsFlag;
159
161
  process.env.NODE_ENV !== "production" ? warning(!(focusTrapWithoutSentinels && enableDialogElement), '`<Modal>` detected both `focusTrapWithoutSentinels` and ' + '`enableDialogElement` feature flags are enabled. The native dialog ' + 'element handles focus, so `enableDialogElement` must be off for ' + '`focusTrapWithoutSentinels` to have any effect.') : void 0;
160
162
 
161
163
  // Propagate open/close state to the document.body
@@ -23,6 +23,7 @@ import { useSavedCallback } from '../../internal/useSavedCallback.js';
23
23
  import '../FluidForm/FluidForm.js';
24
24
  import { FormContext } from '../FluidForm/FormContext.js';
25
25
  import { WarningFilled, WarningAltFilled } from '@carbon/icons-react';
26
+ import { datePartsOrder } from '@carbon/utilities';
26
27
 
27
28
  // Weekdays shorthand for English locale
28
29
  // Ensure localization exists before trying to access it
@@ -55,6 +56,7 @@ const monthToStr = (monthNumber, shorthand, locale) => locale.months[shorthand ?
55
56
  * @param {string} config.selectorFlatpickrYearContainer The CSS selector for the container of year selection UI.
56
57
  * @param {string} config.selectorFlatpickrCurrentMonth The CSS selector for the text-based month selection UI.
57
58
  * @param {string} config.classFlatpickrCurrentMonth The CSS class for the text-based month selection UI.
59
+ * @param {string} config.locale The locale code.
58
60
  * @returns {Plugin} A Flatpickr plugin to use text instead of `<select>` for month picker.
59
61
  */
60
62
  const carbonFlatpickrMonthSelectPlugin = config => fp => {
@@ -71,7 +73,13 @@ const carbonFlatpickrMonthSelectPlugin = config => fp => {
71
73
  fp.monthElements.splice(0, fp.monthElements.length, ...fp.monthElements.map(() => {
72
74
  const monthElement = fp._createElement('span', config.classFlatpickrCurrentMonth);
73
75
  monthElement.textContent = monthToStr(fp.currentMonth, config.shorthand === true, fp.l10n);
74
- fp.yearElements[0].closest(config.selectorFlatpickrMonthYearContainer).insertBefore(monthElement, fp.yearElements[0].closest(config.selectorFlatpickrYearContainer));
76
+
77
+ // Depending on the locale, toggle the order of the month and year
78
+ if (datePartsOrder.isMonthFirst(config.locale)) {
79
+ fp.yearElements[0].closest(config.selectorFlatpickrMonthYearContainer).insertBefore(monthElement, fp.yearElements[0].closest(config.selectorFlatpickrYearContainer));
80
+ } else {
81
+ fp.yearElements[0].closest(config.selectorFlatpickrMonthYearContainer).insertAdjacentElement('afterend', monthElement);
82
+ }
75
83
  return monthElement;
76
84
  }));
77
85
  };
@@ -376,7 +384,8 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
376
384
  }) : () => {}, carbonFlatpickrMonthSelectPlugin({
377
385
  selectorFlatpickrMonthYearContainer: '.flatpickr-current-month',
378
386
  selectorFlatpickrYearContainer: '.numInputWrapper',
379
- classFlatpickrCurrentMonth: 'cur-month'
387
+ classFlatpickrCurrentMonth: 'cur-month',
388
+ locale: locale
380
389
  }), carbonFlatpickrFixEventsPlugin({
381
390
  inputFrom: startInputField.current,
382
391
  inputTo: endInputField.current,
@@ -14,6 +14,7 @@ export interface FeatureFlagsProps {
14
14
  enableV12Overflowmenu?: boolean;
15
15
  enableTreeviewControllable?: boolean;
16
16
  enableExperimentalFocusWrapWithoutSentinels?: boolean;
17
+ enableFocusWrapWithoutSentinels?: boolean;
17
18
  enableDialogElement?: boolean;
18
19
  enableV12DynamicFloatingStyles?: boolean;
19
20
  enableEnhancedFileUploader?: boolean;
@@ -29,7 +30,7 @@ declare const FeatureFlagContext: React.Context<any>;
29
30
  * along with the current `FeatureFlagContext` to provide consumers to check if
30
31
  * a feature flag is enabled or disabled in a given React tree
31
32
  */
32
- declare function FeatureFlags({ children, flags, enableV12TileDefaultIcons, enableV12TileRadioIcons, enableV12Overflowmenu, enableTreeviewControllable, enableExperimentalFocusWrapWithoutSentinels, enableDialogElement, enableV12DynamicFloatingStyles, enableEnhancedFileUploader, enablePresence, }: FeatureFlagsProps): JSX.Element;
33
+ declare function FeatureFlags({ children, flags, enableV12TileDefaultIcons, enableV12TileRadioIcons, enableV12Overflowmenu, enableTreeviewControllable, enableExperimentalFocusWrapWithoutSentinels, enableFocusWrapWithoutSentinels, enableDialogElement, enableV12DynamicFloatingStyles, enableEnhancedFileUploader, enablePresence, }: FeatureFlagsProps): JSX.Element;
33
34
  declare namespace FeatureFlags {
34
35
  var propTypes: {
35
36
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
@@ -42,9 +43,11 @@ declare namespace FeatureFlags {
42
43
  enableV12Overflowmenu: PropTypes.Requireable<boolean>;
43
44
  enableTreeviewControllable: PropTypes.Requireable<boolean>;
44
45
  enableExperimentalFocusWrapWithoutSentinels: PropTypes.Requireable<boolean>;
46
+ enableFocusWrapWithoutSentinels: PropTypes.Requireable<boolean>;
45
47
  enableDialogElement: PropTypes.Requireable<boolean>;
46
48
  enableV12DynamicFloatingStyles: PropTypes.Requireable<boolean>;
47
49
  enableEnhancedFileUploader: PropTypes.Requireable<boolean>;
50
+ enablePresence: PropTypes.Requireable<boolean>;
48
51
  };
49
52
  }
50
53
  /**
@@ -30,6 +30,7 @@ function FeatureFlags({
30
30
  enableV12Overflowmenu = false,
31
31
  enableTreeviewControllable = false,
32
32
  enableExperimentalFocusWrapWithoutSentinels = false,
33
+ enableFocusWrapWithoutSentinels = false,
33
34
  enableDialogElement = false,
34
35
  enableV12DynamicFloatingStyles = false,
35
36
  enableEnhancedFileUploader = false,
@@ -43,6 +44,7 @@ function FeatureFlags({
43
44
  'enable-v12-overflowmenu': enableV12Overflowmenu,
44
45
  'enable-treeview-controllable': enableTreeviewControllable,
45
46
  'enable-experimental-focus-wrap-without-sentinels': enableExperimentalFocusWrapWithoutSentinels,
47
+ 'enable-focus-wrap-without-sentinels': enableFocusWrapWithoutSentinels,
46
48
  'enable-dialog-element': enableDialogElement,
47
49
  'enable-v12-dynamic-floating-styles': enableV12DynamicFloatingStyles,
48
50
  'enable-enhanced-file-uploader': enableEnhancedFileUploader,
@@ -84,9 +86,11 @@ FeatureFlags.propTypes = {
84
86
  enableV12Overflowmenu: PropTypes.bool,
85
87
  enableTreeviewControllable: PropTypes.bool,
86
88
  enableExperimentalFocusWrapWithoutSentinels: PropTypes.bool,
89
+ enableFocusWrapWithoutSentinels: PropTypes.bool,
87
90
  enableDialogElement: PropTypes.bool,
88
91
  enableV12DynamicFloatingStyles: PropTypes.bool,
89
- enableEnhancedFileUploader: PropTypes.bool
92
+ enableEnhancedFileUploader: PropTypes.bool,
93
+ enablePresence: PropTypes.bool
90
94
  };
91
95
 
92
96
  /**
@@ -127,7 +127,9 @@ const ModalDialog = /*#__PURE__*/React.forwardRef(function ModalDialog({
127
127
  // always mark as open when mounted with presence
128
128
  const open = externalOpen || enablePresence;
129
129
  const prevOpen = usePreviousValue(open);
130
- const focusTrapWithoutSentinels = useFeatureFlag('enable-experimental-focus-wrap-without-sentinels');
130
+ const deprecatedFlag = useFeatureFlag('enable-experimental-focus-wrap-without-sentinels');
131
+ const focusTrapWithoutSentinelsFlag = useFeatureFlag('enable-focus-wrap-without-sentinels');
132
+ const focusTrapWithoutSentinels = focusTrapWithoutSentinelsFlag || deprecatedFlag;
131
133
  const enableDialogElement = useFeatureFlag('enable-dialog-element');
132
134
  process.env.NODE_ENV !== "production" ? warning(!(focusTrapWithoutSentinels && enableDialogElement), '`<Modal>` detected both `focusTrapWithoutSentinels` and ' + '`enableDialogElement` feature flags are enabled. The native dialog ' + 'element handles focus, so `enableDialogElement` must be off for ' + '`focusTrapWithoutSentinels` to have any effect.') : void 0;
133
135
  process.env.NODE_ENV !== "production" ? warning(!(!passiveModal && preventCloseOnClickOutside === false), invalidOutsideClickMessage) : void 0;
@@ -552,7 +552,7 @@ const FilterableMultiSelect = /*#__PURE__*/forwardRef(function FilterableMultiSe
552
552
  });
553
553
  const inputProp = getInputProps(getDropdownProps({
554
554
  'aria-controls': isOpen ? menuId : undefined,
555
- 'aria-describedby': helperText ? helperId : undefined,
555
+ 'aria-describedby': helperText && !invalid && !warn ? helperId : undefined,
556
556
  'aria-haspopup': 'listbox',
557
557
  // Remove excess aria `aria-labelledby`. HTML <label for>
558
558
  // provides this aria information.
@@ -504,7 +504,9 @@ function ActionableNotification({
504
504
  const startTrap = useRef(null);
505
505
  const endTrap = useRef(null);
506
506
  const ref = useRef(null);
507
- const focusTrapWithoutSentinels = useFeatureFlag('enable-experimental-focus-wrap-without-sentinels');
507
+ const deprecatedFlag = useFeatureFlag('enable-experimental-focus-wrap-without-sentinels');
508
+ const focusTrapWithoutSentinelsFlag = useFeatureFlag('enable-focus-wrap-without-sentinels');
509
+ const focusTrapWithoutSentinels = focusTrapWithoutSentinelsFlag || deprecatedFlag;
508
510
  useIsomorphicEffect(() => {
509
511
  if (hasFocus && role === 'alertdialog') {
510
512
  const button = document.querySelector('button.cds--actionable-notification__action-button');
@@ -29,6 +29,10 @@ export interface PopoverBaseProps {
29
29
  * **Experimental:** Provide an offset value for alignment axis. Only takes effect when `autoalign` is enabled.
30
30
  */
31
31
  alignmentAxisOffset?: number;
32
+ /**
33
+ * Specify the background token to use. Default is 'layer'.
34
+ */
35
+ backgroundToken?: 'layer' | 'background';
32
36
  /**
33
37
  * Will auto-align the popover on first render if it is not visible. This prop
34
38
  * is currently experimental and is subject to future changes. Requires
@@ -44,6 +48,10 @@ export interface PopoverBaseProps {
44
48
  * Specify whether a caret should be rendered
45
49
  */
46
50
  caret?: boolean;
51
+ /**
52
+ * Specify whether a border should be rendered on the popover
53
+ */
54
+ border?: boolean;
47
55
  /**
48
56
  * Provide elements to be rendered inside of the component
49
57
  */
@@ -39,9 +39,11 @@ const Popover = /*#__PURE__*/React.forwardRef(function PopoverRenderFunction({
39
39
  as: BaseComponent = 'span',
40
40
  autoAlign = false,
41
41
  autoAlignBoundary,
42
+ backgroundToken = 'layer',
42
43
  caret = isTabTip ? false : true,
43
44
  className: customClassName,
44
45
  children,
46
+ border = false,
45
47
  dropShadow = true,
46
48
  highContrast = false,
47
49
  onRequestClose,
@@ -211,11 +213,13 @@ forwardRef) {
211
213
  [`${prefix}--popover-container`]: true,
212
214
  [`${prefix}--popover--caret`]: caret,
213
215
  [`${prefix}--popover--drop-shadow`]: dropShadow,
216
+ [`${prefix}--popover--border`]: border,
214
217
  [`${prefix}--popover--high-contrast`]: highContrast,
215
218
  [`${prefix}--popover--open`]: open,
216
219
  [`${prefix}--popover--auto-align ${prefix}--autoalign`]: enableFloatingStyles,
217
220
  [`${prefix}--popover--${currentAlignment}`]: true,
218
- [`${prefix}--popover--tab-tip`]: isTabTip
221
+ [`${prefix}--popover--tab-tip`]: isTabTip,
222
+ [`${prefix}--popover--background-token__background`]: backgroundToken === 'background' && !highContrast
219
223
  }, customClassName);
220
224
  const mappedChildren = React.Children.map(children, child => {
221
225
  // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
@@ -327,6 +331,10 @@ Popover.propTypes = {
327
331
  * @see https://github.com/carbon-design-system/carbon/issues/18714
328
332
  */
329
333
  autoAlign: PropTypes.bool,
334
+ /**
335
+ * Specify the background token to use. Default is 'layer'.
336
+ */
337
+ backgroundToken: PropTypes.oneOf(['layer', 'background']),
330
338
  /**
331
339
  * Specify a bounding element to be used for autoAlign calculations. The viewport is used by default. This prop is currently experimental and is subject to future changes.
332
340
  */
@@ -340,6 +348,10 @@ Popover.propTypes = {
340
348
  * Specify whether a caret should be rendered
341
349
  */
342
350
  caret: PropTypes.bool,
351
+ /**
352
+ * Specify whether a border should be rendered on the popover
353
+ */
354
+ border: PropTypes.bool,
343
355
  /**
344
356
  * Provide elements to be rendered inside of the component
345
357
  */
@@ -54,9 +54,11 @@ export declare namespace Toggletip {
54
54
  defaultOpen: PropTypes.Requireable<boolean>;
55
55
  align?: PopoverAlignment;
56
56
  alignmentAxisOffset?: number;
57
+ backgroundToken?: "layer" | "background";
57
58
  autoAlign?: boolean;
58
59
  autoAlignBoundary?: import("@floating-ui/dom").Boundary;
59
60
  caret?: boolean;
61
+ border?: boolean;
60
62
  children?: React.ReactNode;
61
63
  className?: string;
62
64
  dropShadow?: boolean;
@@ -12,6 +12,7 @@ FeatureFlags.merge({
12
12
  'enable-css-grid': true,
13
13
  'enable-v11-release': true,
14
14
  'enable-experimental-tile-contrast': false,
15
+ 'enable-tile-contrast': false,
15
16
  'enable-v12-tile-radio-icons': false,
16
17
  'enable-v12-structured-list-visible-icons': false,
17
18
  'enable-v12-dynamic-floating-styles': false
@@ -274,7 +274,9 @@ const FloatingMenu = ({
274
274
  });
275
275
  }
276
276
  };
277
- const focusTrapWithoutSentinels = FeatureFlags.enabled('enable-experimental-focus-wrap-without-sentinels');
277
+ const deprecatedFlag = FeatureFlags.enabled('enable-experimental-focus-wrap-without-sentinels');
278
+ const focusTrapWithoutSentinelsFlag = FeatureFlags.enabled('enable-focus-wrap-without-sentinels');
279
+ const focusTrapWithoutSentinels = deprecatedFlag || focusTrapWithoutSentinelsFlag;
278
280
  if (typeof document !== 'undefined') {
279
281
  const portalTarget = target ? target() : document.body;
280
282
  return /*#__PURE__*/ReactDOM.createPortal(
@@ -159,7 +159,9 @@ const ComposedModalDialog = /*#__PURE__*/React.forwardRef(function ComposedModal
159
159
  const modalState = useComposedModalState.useComposedModalState(open);
160
160
  const [isOpen, setIsOpen] = presenceContext?.modalState ?? modalState;
161
161
  const enableDialogElement = index$1.useFeatureFlag('enable-dialog-element');
162
- const focusTrapWithoutSentinels = index$1.useFeatureFlag('enable-experimental-focus-wrap-without-sentinels');
162
+ const deprecatedFlag = index$1.useFeatureFlag('enable-experimental-focus-wrap-without-sentinels');
163
+ const focusTrapWithoutSentinelsFlag = index$1.useFeatureFlag('enable-focus-wrap-without-sentinels');
164
+ const focusTrapWithoutSentinels = deprecatedFlag || focusTrapWithoutSentinelsFlag;
163
165
  process.env.NODE_ENV !== "production" ? warning.warning(!(focusTrapWithoutSentinels && enableDialogElement), '`<Modal>` detected both `focusTrapWithoutSentinels` and ' + '`enableDialogElement` feature flags are enabled. The native dialog ' + 'element handles focus, so `enableDialogElement` must be off for ' + '`focusTrapWithoutSentinels` to have any effect.') : void 0;
164
166
 
165
167
  // Propagate open/close state to the document.body
@@ -27,6 +27,7 @@ var useSavedCallback = require('../../internal/useSavedCallback.js');
27
27
  require('../FluidForm/FluidForm.js');
28
28
  var FormContext = require('../FluidForm/FormContext.js');
29
29
  var iconsReact = require('@carbon/icons-react');
30
+ var utilities = require('@carbon/utilities');
30
31
 
31
32
  // Weekdays shorthand for English locale
32
33
  // Ensure localization exists before trying to access it
@@ -59,6 +60,7 @@ const monthToStr = (monthNumber, shorthand, locale) => locale.months[shorthand ?
59
60
  * @param {string} config.selectorFlatpickrYearContainer The CSS selector for the container of year selection UI.
60
61
  * @param {string} config.selectorFlatpickrCurrentMonth The CSS selector for the text-based month selection UI.
61
62
  * @param {string} config.classFlatpickrCurrentMonth The CSS class for the text-based month selection UI.
63
+ * @param {string} config.locale The locale code.
62
64
  * @returns {Plugin} A Flatpickr plugin to use text instead of `<select>` for month picker.
63
65
  */
64
66
  const carbonFlatpickrMonthSelectPlugin = config => fp => {
@@ -75,7 +77,13 @@ const carbonFlatpickrMonthSelectPlugin = config => fp => {
75
77
  fp.monthElements.splice(0, fp.monthElements.length, ...fp.monthElements.map(() => {
76
78
  const monthElement = fp._createElement('span', config.classFlatpickrCurrentMonth);
77
79
  monthElement.textContent = monthToStr(fp.currentMonth, config.shorthand === true, fp.l10n);
78
- fp.yearElements[0].closest(config.selectorFlatpickrMonthYearContainer).insertBefore(monthElement, fp.yearElements[0].closest(config.selectorFlatpickrYearContainer));
80
+
81
+ // Depending on the locale, toggle the order of the month and year
82
+ if (utilities.datePartsOrder.isMonthFirst(config.locale)) {
83
+ fp.yearElements[0].closest(config.selectorFlatpickrMonthYearContainer).insertBefore(monthElement, fp.yearElements[0].closest(config.selectorFlatpickrYearContainer));
84
+ } else {
85
+ fp.yearElements[0].closest(config.selectorFlatpickrMonthYearContainer).insertAdjacentElement('afterend', monthElement);
86
+ }
79
87
  return monthElement;
80
88
  }));
81
89
  };
@@ -380,7 +388,8 @@ const DatePicker = /*#__PURE__*/React.forwardRef(function DatePicker({
380
388
  }) : () => {}, carbonFlatpickrMonthSelectPlugin({
381
389
  selectorFlatpickrMonthYearContainer: '.flatpickr-current-month',
382
390
  selectorFlatpickrYearContainer: '.numInputWrapper',
383
- classFlatpickrCurrentMonth: 'cur-month'
391
+ classFlatpickrCurrentMonth: 'cur-month',
392
+ locale: locale
384
393
  }), fixEventsPlugin.default({
385
394
  inputFrom: startInputField.current,
386
395
  inputTo: endInputField.current,
@@ -14,6 +14,7 @@ export interface FeatureFlagsProps {
14
14
  enableV12Overflowmenu?: boolean;
15
15
  enableTreeviewControllable?: boolean;
16
16
  enableExperimentalFocusWrapWithoutSentinels?: boolean;
17
+ enableFocusWrapWithoutSentinels?: boolean;
17
18
  enableDialogElement?: boolean;
18
19
  enableV12DynamicFloatingStyles?: boolean;
19
20
  enableEnhancedFileUploader?: boolean;
@@ -29,7 +30,7 @@ declare const FeatureFlagContext: React.Context<any>;
29
30
  * along with the current `FeatureFlagContext` to provide consumers to check if
30
31
  * a feature flag is enabled or disabled in a given React tree
31
32
  */
32
- declare function FeatureFlags({ children, flags, enableV12TileDefaultIcons, enableV12TileRadioIcons, enableV12Overflowmenu, enableTreeviewControllable, enableExperimentalFocusWrapWithoutSentinels, enableDialogElement, enableV12DynamicFloatingStyles, enableEnhancedFileUploader, enablePresence, }: FeatureFlagsProps): JSX.Element;
33
+ declare function FeatureFlags({ children, flags, enableV12TileDefaultIcons, enableV12TileRadioIcons, enableV12Overflowmenu, enableTreeviewControllable, enableExperimentalFocusWrapWithoutSentinels, enableFocusWrapWithoutSentinels, enableDialogElement, enableV12DynamicFloatingStyles, enableEnhancedFileUploader, enablePresence, }: FeatureFlagsProps): JSX.Element;
33
34
  declare namespace FeatureFlags {
34
35
  var propTypes: {
35
36
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
@@ -42,9 +43,11 @@ declare namespace FeatureFlags {
42
43
  enableV12Overflowmenu: PropTypes.Requireable<boolean>;
43
44
  enableTreeviewControllable: PropTypes.Requireable<boolean>;
44
45
  enableExperimentalFocusWrapWithoutSentinels: PropTypes.Requireable<boolean>;
46
+ enableFocusWrapWithoutSentinels: PropTypes.Requireable<boolean>;
45
47
  enableDialogElement: PropTypes.Requireable<boolean>;
46
48
  enableV12DynamicFloatingStyles: PropTypes.Requireable<boolean>;
47
49
  enableEnhancedFileUploader: PropTypes.Requireable<boolean>;
50
+ enablePresence: PropTypes.Requireable<boolean>;
48
51
  };
49
52
  }
50
53
  /**
@@ -32,6 +32,7 @@ function FeatureFlags({
32
32
  enableV12Overflowmenu = false,
33
33
  enableTreeviewControllable = false,
34
34
  enableExperimentalFocusWrapWithoutSentinels = false,
35
+ enableFocusWrapWithoutSentinels = false,
35
36
  enableDialogElement = false,
36
37
  enableV12DynamicFloatingStyles = false,
37
38
  enableEnhancedFileUploader = false,
@@ -45,6 +46,7 @@ function FeatureFlags({
45
46
  'enable-v12-overflowmenu': enableV12Overflowmenu,
46
47
  'enable-treeview-controllable': enableTreeviewControllable,
47
48
  'enable-experimental-focus-wrap-without-sentinels': enableExperimentalFocusWrapWithoutSentinels,
49
+ 'enable-focus-wrap-without-sentinels': enableFocusWrapWithoutSentinels,
48
50
  'enable-dialog-element': enableDialogElement,
49
51
  'enable-v12-dynamic-floating-styles': enableV12DynamicFloatingStyles,
50
52
  'enable-enhanced-file-uploader': enableEnhancedFileUploader,
@@ -86,9 +88,11 @@ FeatureFlags.propTypes = {
86
88
  enableV12Overflowmenu: PropTypes.bool,
87
89
  enableTreeviewControllable: PropTypes.bool,
88
90
  enableExperimentalFocusWrapWithoutSentinels: PropTypes.bool,
91
+ enableFocusWrapWithoutSentinels: PropTypes.bool,
89
92
  enableDialogElement: PropTypes.bool,
90
93
  enableV12DynamicFloatingStyles: PropTypes.bool,
91
- enableEnhancedFileUploader: PropTypes.bool
94
+ enableEnhancedFileUploader: PropTypes.bool,
95
+ enablePresence: PropTypes.bool
92
96
  };
93
97
 
94
98
  /**
@@ -131,7 +131,9 @@ const ModalDialog = /*#__PURE__*/React.forwardRef(function ModalDialog({
131
131
  // always mark as open when mounted with presence
132
132
  const open = externalOpen || enablePresence;
133
133
  const prevOpen = usePreviousValue.usePreviousValue(open);
134
- const focusTrapWithoutSentinels = index.useFeatureFlag('enable-experimental-focus-wrap-without-sentinels');
134
+ const deprecatedFlag = index.useFeatureFlag('enable-experimental-focus-wrap-without-sentinels');
135
+ const focusTrapWithoutSentinelsFlag = index.useFeatureFlag('enable-focus-wrap-without-sentinels');
136
+ const focusTrapWithoutSentinels = focusTrapWithoutSentinelsFlag || deprecatedFlag;
135
137
  const enableDialogElement = index.useFeatureFlag('enable-dialog-element');
136
138
  process.env.NODE_ENV !== "production" ? warning.warning(!(focusTrapWithoutSentinels && enableDialogElement), '`<Modal>` detected both `focusTrapWithoutSentinels` and ' + '`enableDialogElement` feature flags are enabled. The native dialog ' + 'element handles focus, so `enableDialogElement` must be off for ' + '`focusTrapWithoutSentinels` to have any effect.') : void 0;
137
139
  process.env.NODE_ENV !== "production" ? warning.warning(!(!passiveModal && preventCloseOnClickOutside === false), invalidOutsideClickMessage) : void 0;
@@ -554,7 +554,7 @@ const FilterableMultiSelect = /*#__PURE__*/React.forwardRef(function FilterableM
554
554
  });
555
555
  const inputProp = getInputProps(getDropdownProps({
556
556
  'aria-controls': isOpen ? menuId : undefined,
557
- 'aria-describedby': helperText ? helperId : undefined,
557
+ 'aria-describedby': helperText && !invalid && !warn ? helperId : undefined,
558
558
  'aria-haspopup': 'listbox',
559
559
  // Remove excess aria `aria-labelledby`. HTML <label for>
560
560
  // provides this aria information.
@@ -506,7 +506,9 @@ function ActionableNotification({
506
506
  const startTrap = React.useRef(null);
507
507
  const endTrap = React.useRef(null);
508
508
  const ref = React.useRef(null);
509
- const focusTrapWithoutSentinels = index.useFeatureFlag('enable-experimental-focus-wrap-without-sentinels');
509
+ const deprecatedFlag = index.useFeatureFlag('enable-experimental-focus-wrap-without-sentinels');
510
+ const focusTrapWithoutSentinelsFlag = index.useFeatureFlag('enable-focus-wrap-without-sentinels');
511
+ const focusTrapWithoutSentinels = focusTrapWithoutSentinelsFlag || deprecatedFlag;
510
512
  useIsomorphicEffect.default(() => {
511
513
  if (hasFocus && role === 'alertdialog') {
512
514
  const button = document.querySelector('button.cds--actionable-notification__action-button');
@@ -29,6 +29,10 @@ export interface PopoverBaseProps {
29
29
  * **Experimental:** Provide an offset value for alignment axis. Only takes effect when `autoalign` is enabled.
30
30
  */
31
31
  alignmentAxisOffset?: number;
32
+ /**
33
+ * Specify the background token to use. Default is 'layer'.
34
+ */
35
+ backgroundToken?: 'layer' | 'background';
32
36
  /**
33
37
  * Will auto-align the popover on first render if it is not visible. This prop
34
38
  * is currently experimental and is subject to future changes. Requires
@@ -44,6 +48,10 @@ export interface PopoverBaseProps {
44
48
  * Specify whether a caret should be rendered
45
49
  */
46
50
  caret?: boolean;
51
+ /**
52
+ * Specify whether a border should be rendered on the popover
53
+ */
54
+ border?: boolean;
47
55
  /**
48
56
  * Provide elements to be rendered inside of the component
49
57
  */
@@ -41,9 +41,11 @@ const Popover = /*#__PURE__*/React.forwardRef(function PopoverRenderFunction({
41
41
  as: BaseComponent = 'span',
42
42
  autoAlign = false,
43
43
  autoAlignBoundary,
44
+ backgroundToken = 'layer',
44
45
  caret = isTabTip ? false : true,
45
46
  className: customClassName,
46
47
  children,
48
+ border = false,
47
49
  dropShadow = true,
48
50
  highContrast = false,
49
51
  onRequestClose,
@@ -213,11 +215,13 @@ forwardRef) {
213
215
  [`${prefix}--popover-container`]: true,
214
216
  [`${prefix}--popover--caret`]: caret,
215
217
  [`${prefix}--popover--drop-shadow`]: dropShadow,
218
+ [`${prefix}--popover--border`]: border,
216
219
  [`${prefix}--popover--high-contrast`]: highContrast,
217
220
  [`${prefix}--popover--open`]: open,
218
221
  [`${prefix}--popover--auto-align ${prefix}--autoalign`]: enableFloatingStyles,
219
222
  [`${prefix}--popover--${currentAlignment}`]: true,
220
- [`${prefix}--popover--tab-tip`]: isTabTip
223
+ [`${prefix}--popover--tab-tip`]: isTabTip,
224
+ [`${prefix}--popover--background-token__background`]: backgroundToken === 'background' && !highContrast
221
225
  }, customClassName);
222
226
  const mappedChildren = React.Children.map(children, child => {
223
227
  // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
@@ -329,6 +333,10 @@ Popover.propTypes = {
329
333
  * @see https://github.com/carbon-design-system/carbon/issues/18714
330
334
  */
331
335
  autoAlign: PropTypes.bool,
336
+ /**
337
+ * Specify the background token to use. Default is 'layer'.
338
+ */
339
+ backgroundToken: PropTypes.oneOf(['layer', 'background']),
332
340
  /**
333
341
  * Specify a bounding element to be used for autoAlign calculations. The viewport is used by default. This prop is currently experimental and is subject to future changes.
334
342
  */
@@ -342,6 +350,10 @@ Popover.propTypes = {
342
350
  * Specify whether a caret should be rendered
343
351
  */
344
352
  caret: PropTypes.bool,
353
+ /**
354
+ * Specify whether a border should be rendered on the popover
355
+ */
356
+ border: PropTypes.bool,
345
357
  /**
346
358
  * Provide elements to be rendered inside of the component
347
359
  */
@@ -54,9 +54,11 @@ export declare namespace Toggletip {
54
54
  defaultOpen: PropTypes.Requireable<boolean>;
55
55
  align?: PopoverAlignment;
56
56
  alignmentAxisOffset?: number;
57
+ backgroundToken?: "layer" | "background";
57
58
  autoAlign?: boolean;
58
59
  autoAlignBoundary?: import("@floating-ui/dom").Boundary;
59
60
  caret?: boolean;
61
+ border?: boolean;
60
62
  children?: React.ReactNode;
61
63
  className?: string;
62
64
  dropShadow?: boolean;
@@ -33,6 +33,7 @@ FeatureFlags__namespace.merge({
33
33
  'enable-css-grid': true,
34
34
  'enable-v11-release': true,
35
35
  'enable-experimental-tile-contrast': false,
36
+ 'enable-tile-contrast': false,
36
37
  'enable-v12-tile-radio-icons': false,
37
38
  'enable-v12-structured-list-visible-icons': false,
38
39
  'enable-v12-dynamic-floating-styles': false
@@ -295,7 +295,9 @@ const FloatingMenu = ({
295
295
  });
296
296
  }
297
297
  };
298
- const focusTrapWithoutSentinels = FeatureFlags__namespace.enabled('enable-experimental-focus-wrap-without-sentinels');
298
+ const deprecatedFlag = FeatureFlags__namespace.enabled('enable-experimental-focus-wrap-without-sentinels');
299
+ const focusTrapWithoutSentinelsFlag = FeatureFlags__namespace.enabled('enable-focus-wrap-without-sentinels');
300
+ const focusTrapWithoutSentinels = deprecatedFlag || focusTrapWithoutSentinelsFlag;
299
301
  if (typeof document !== 'undefined') {
300
302
  const portalTarget = target ? target() : document.body;
301
303
  return /*#__PURE__*/ReactDOM.createPortal(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/react",
3
3
  "description": "React components for the Carbon Design System",
4
- "version": "1.94.0-rc.0",
4
+ "version": "1.94.0",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
@@ -52,11 +52,11 @@
52
52
  },
53
53
  "dependencies": {
54
54
  "@babel/runtime": "^7.27.3",
55
- "@carbon/feature-flags": "^0.31.0",
56
- "@carbon/icons-react": "^11.70.0-rc.0",
55
+ "@carbon/feature-flags": "^0.32.0",
56
+ "@carbon/icons-react": "^11.70.0",
57
57
  "@carbon/layout": "^11.43.0",
58
- "@carbon/styles": "^1.93.0-rc.0",
59
- "@carbon/utilities": "^0.11.0",
58
+ "@carbon/styles": "^1.93.0",
59
+ "@carbon/utilities": "^0.12.0",
60
60
  "@floating-ui/react": "^0.27.4",
61
61
  "@ibm/telemetry-js": "^1.5.0",
62
62
  "classnames": "2.5.1",
@@ -139,5 +139,5 @@
139
139
  "**/*.scss",
140
140
  "**/*.css"
141
141
  ],
142
- "gitHead": "dff507858b43de91b300a98fa1bec24d38aaeb48"
142
+ "gitHead": "44f7fd230585f66d32c839d1c11d2992d5929294"
143
143
  }
package/telemetry.yml CHANGED
@@ -27,6 +27,7 @@ collect:
27
27
  - as
28
28
  - autoAlign
29
29
  - autoComplete
30
+ - border
30
31
  - buttonKind
31
32
  - caption
32
33
  - checked
@@ -347,6 +348,7 @@ collect:
347
348
  - enableDialogElement
348
349
  - enableEnhancedFileUploader
349
350
  - enableExperimentalFocusWrapWithoutSentinels
351
+ - enableFocusWrapWithoutSentinels
350
352
  - enablePresence
351
353
  - enableTreeviewControllable
352
354
  - enableV12DynamicFloatingStyles
@@ -469,7 +471,6 @@ collect:
469
471
  - requireTitle
470
472
  - wrapperClassName
471
473
  # PageHeaderBreadcrumbBar
472
- - border
473
474
  - contentActions
474
475
  - contentActionsFlush
475
476
  - pageActionsFlush
@@ -505,6 +506,7 @@ collect:
505
506
  # Popover
506
507
  - alignmentAxisOffset
507
508
  - autoAlignBoundary
509
+ - backgroundToken
508
510
  - caret
509
511
  - isTabTip
510
512
  # ProgressIndicator
@@ -937,6 +939,9 @@ collect:
937
939
  - toast
938
940
  # Popover - autoAlignBoundary
939
941
  - clippingAncestors
942
+ # Popover - backgroundToken
943
+ - background
944
+ - layer
940
945
  # ShapeIndicator - textSize
941
946
  - "12"
942
947
  - "14"