@carbon/react 1.77.0 → 1.78.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 (144) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +1038 -916
  2. package/es/components/Accordion/AccordionItem.js +1 -1
  3. package/es/components/BadgeIndicator/index.d.ts +23 -0
  4. package/es/components/BadgeIndicator/index.js +45 -0
  5. package/es/components/Breadcrumb/Breadcrumb.d.ts +5 -0
  6. package/es/components/Breadcrumb/Breadcrumb.js +8 -2
  7. package/es/components/Button/Button.d.ts +9 -0
  8. package/es/components/Button/Button.js +13 -0
  9. package/es/components/ComboBox/ComboBox.js +19 -15
  10. package/es/components/ComboButton/index.js +0 -1
  11. package/es/components/ContextMenu/useContextMenu.d.ts +0 -1
  12. package/es/components/ContextMenu/useContextMenu.js +1 -2
  13. package/es/components/Dropdown/Dropdown.d.ts +1 -1
  14. package/es/components/Dropdown/Dropdown.js +3 -2
  15. package/es/components/FileUploader/FileUploader.js +1 -1
  16. package/es/components/FileUploader/FileUploaderItem.js +1 -1
  17. package/es/components/IconButton/index.d.ts +7 -1
  18. package/es/components/IconButton/index.js +18 -2
  19. package/es/components/IconIndicator/index.d.ts +1 -1
  20. package/es/components/InlineLoading/InlineLoading.js +2 -5
  21. package/es/components/Menu/Menu.d.ts +1 -0
  22. package/es/components/Menu/Menu.js +5 -7
  23. package/es/components/Menu/MenuContext.d.ts +4 -4
  24. package/es/components/Menu/MenuContext.js +6 -1
  25. package/es/components/Menu/MenuItem.d.ts +1 -1
  26. package/es/components/Menu/MenuItem.js +15 -23
  27. package/es/components/MenuButton/index.js +14 -2
  28. package/es/components/Modal/Modal.d.ts +3 -3
  29. package/es/components/Modal/Modal.js +9 -3
  30. package/es/components/Modal/next/index.d.ts +1 -5
  31. package/es/components/MultiSelect/MultiSelect.js +3 -2
  32. package/es/components/MultiSelect/MultiSelectPropTypes.d.ts +5 -2
  33. package/es/components/MultiSelect/tools/sorting.js +8 -7
  34. package/es/components/Notification/Notification.js +5 -6
  35. package/es/components/NumberInput/NumberInput.js +12 -12
  36. package/es/components/OverflowMenu/OverflowMenu.d.ts +8 -20
  37. package/es/components/OverflowMenu/OverflowMenu.js +7 -9
  38. package/es/components/OverflowMenuItem/OverflowMenuItem.js +1 -1
  39. package/es/components/ProgressIndicator/ProgressIndicator.js +1 -1
  40. package/es/components/RadioTile/RadioTile.js +1 -1
  41. package/es/components/Select/Select.js +11 -2
  42. package/es/components/ShapeIndicator/index.d.ts +29 -0
  43. package/es/components/ShapeIndicator/index.js +92 -0
  44. package/es/components/Tabs/Tabs.d.ts +6 -4
  45. package/es/components/Tabs/Tabs.js +27 -8
  46. package/es/components/Tag/OperationalTag.d.ts +1 -36
  47. package/es/components/Tag/OperationalTag.js +7 -5
  48. package/es/components/Text/Text.d.ts +11 -9
  49. package/es/components/Text/Text.js +6 -6
  50. package/es/components/Text/TextDirection.d.ts +7 -9
  51. package/es/components/Text/TextDirection.js +5 -2
  52. package/es/components/Text/TextDirectionContext.d.ts +14 -0
  53. package/es/components/Text/TextDirectionContext.js +6 -2
  54. package/es/components/Text/createTextComponent.d.ts +5 -5
  55. package/es/components/Text/createTextComponent.js +5 -4
  56. package/es/components/Text/index.d.ts +6 -7
  57. package/es/components/Text/index.js +3 -2
  58. package/es/components/Tile/Tile.d.ts +6 -0
  59. package/es/components/Tile/Tile.js +5 -9
  60. package/es/components/Toggletip/index.d.ts +3 -2
  61. package/es/components/Tooltip/DefinitionTooltip.d.ts +4 -0
  62. package/es/components/Tooltip/DefinitionTooltip.js +7 -1
  63. package/es/components/Tooltip/Tooltip.d.ts +5 -66
  64. package/es/components/Tooltip/Tooltip.js +26 -26
  65. package/es/components/UIShell/HeaderGlobalAction.d.ts +9 -0
  66. package/es/components/UIShell/HeaderGlobalAction.js +16 -1
  67. package/es/index.d.ts +4 -1
  68. package/es/index.js +2 -1
  69. package/es/internal/FloatingMenu.d.ts +83 -0
  70. package/es/internal/FloatingMenu.js +216 -408
  71. package/es/internal/wrapFocus.js +1 -1
  72. package/lib/components/Accordion/AccordionItem.js +1 -1
  73. package/lib/components/BadgeIndicator/index.d.ts +23 -0
  74. package/lib/components/BadgeIndicator/index.js +56 -0
  75. package/lib/components/Breadcrumb/Breadcrumb.d.ts +5 -0
  76. package/lib/components/Breadcrumb/Breadcrumb.js +8 -2
  77. package/lib/components/Button/Button.d.ts +9 -0
  78. package/lib/components/Button/Button.js +13 -0
  79. package/lib/components/ComboBox/ComboBox.js +19 -15
  80. package/lib/components/ComboButton/index.js +0 -1
  81. package/lib/components/ContextMenu/useContextMenu.d.ts +0 -1
  82. package/lib/components/ContextMenu/useContextMenu.js +1 -2
  83. package/lib/components/Dropdown/Dropdown.d.ts +1 -1
  84. package/lib/components/Dropdown/Dropdown.js +2 -1
  85. package/lib/components/FileUploader/FileUploader.js +1 -1
  86. package/lib/components/FileUploader/FileUploaderItem.js +1 -1
  87. package/lib/components/IconButton/index.d.ts +7 -1
  88. package/lib/components/IconButton/index.js +18 -2
  89. package/lib/components/IconIndicator/index.d.ts +1 -1
  90. package/lib/components/InlineLoading/InlineLoading.js +2 -5
  91. package/lib/components/Menu/Menu.d.ts +1 -0
  92. package/lib/components/Menu/Menu.js +5 -7
  93. package/lib/components/Menu/MenuContext.d.ts +4 -4
  94. package/lib/components/Menu/MenuContext.js +6 -1
  95. package/lib/components/Menu/MenuItem.d.ts +1 -1
  96. package/lib/components/Menu/MenuItem.js +14 -22
  97. package/lib/components/MenuButton/index.js +14 -2
  98. package/lib/components/Modal/Modal.d.ts +3 -3
  99. package/lib/components/Modal/Modal.js +9 -3
  100. package/lib/components/Modal/next/index.d.ts +1 -5
  101. package/lib/components/MultiSelect/MultiSelect.js +2 -1
  102. package/lib/components/MultiSelect/MultiSelectPropTypes.d.ts +5 -2
  103. package/lib/components/MultiSelect/tools/sorting.js +8 -7
  104. package/lib/components/Notification/Notification.js +5 -6
  105. package/lib/components/NumberInput/NumberInput.js +12 -12
  106. package/lib/components/OverflowMenu/OverflowMenu.d.ts +8 -20
  107. package/lib/components/OverflowMenu/OverflowMenu.js +7 -9
  108. package/lib/components/OverflowMenuItem/OverflowMenuItem.js +1 -1
  109. package/lib/components/ProgressIndicator/ProgressIndicator.js +1 -1
  110. package/lib/components/RadioTile/RadioTile.js +1 -1
  111. package/lib/components/Select/Select.js +11 -2
  112. package/lib/components/ShapeIndicator/index.d.ts +29 -0
  113. package/lib/components/ShapeIndicator/index.js +104 -0
  114. package/lib/components/Tabs/Tabs.d.ts +6 -4
  115. package/lib/components/Tabs/Tabs.js +42 -23
  116. package/lib/components/Tag/OperationalTag.d.ts +1 -36
  117. package/lib/components/Tag/OperationalTag.js +6 -4
  118. package/lib/components/Text/Text.d.ts +11 -9
  119. package/lib/components/Text/Text.js +5 -5
  120. package/lib/components/Text/TextDirection.d.ts +7 -9
  121. package/lib/components/Text/TextDirection.js +5 -2
  122. package/lib/components/Text/TextDirectionContext.d.ts +14 -0
  123. package/lib/components/Text/TextDirectionContext.js +6 -2
  124. package/lib/components/Text/createTextComponent.d.ts +5 -5
  125. package/lib/components/Text/createTextComponent.js +5 -4
  126. package/lib/components/Text/index.d.ts +6 -7
  127. package/lib/components/Text/index.js +4 -3
  128. package/lib/components/Tile/Tile.d.ts +6 -0
  129. package/lib/components/Tile/Tile.js +5 -9
  130. package/lib/components/Toggletip/index.d.ts +3 -2
  131. package/lib/components/Tooltip/DefinitionTooltip.d.ts +4 -0
  132. package/lib/components/Tooltip/DefinitionTooltip.js +7 -1
  133. package/lib/components/Tooltip/Tooltip.d.ts +5 -66
  134. package/lib/components/Tooltip/Tooltip.js +26 -26
  135. package/lib/components/UIShell/HeaderGlobalAction.d.ts +9 -0
  136. package/lib/components/UIShell/HeaderGlobalAction.js +16 -1
  137. package/lib/index.d.ts +4 -1
  138. package/lib/index.js +42 -40
  139. package/lib/internal/FloatingMenu.d.ts +83 -0
  140. package/lib/internal/FloatingMenu.js +216 -409
  141. package/lib/internal/wrapFocus.js +1 -1
  142. package/package.json +5 -5
  143. package/scss/components/badge-indicator/_badge-indicator.scss +9 -0
  144. package/scss/components/badge-indicator/_index.scss +9 -0
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2025
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import { type CSSProperties, type ReactElement, type RefObject } from 'react';
8
+ export declare const DIRECTION_LEFT = "left";
9
+ export declare const DIRECTION_TOP = "top";
10
+ export declare const DIRECTION_RIGHT = "right";
11
+ export declare const DIRECTION_BOTTOM = "bottom";
12
+ export interface Offset {
13
+ top?: number;
14
+ left?: number;
15
+ }
16
+ interface Container {
17
+ rect: DOMRect;
18
+ position: string;
19
+ }
20
+ export type MenuDirection = typeof DIRECTION_LEFT | typeof DIRECTION_TOP | typeof DIRECTION_RIGHT | typeof DIRECTION_BOTTOM;
21
+ export type MenuOffset = Offset | ((menuBody: HTMLElement, menuDirection: MenuDirection, triggerEl?: HTMLElement | null, flipped?: boolean) => Offset);
22
+ interface FloatingMenuProps {
23
+ /**
24
+ * Contents of the floating menu.
25
+ */
26
+ children: ReactElement;
27
+ /**
28
+ * Whether the menu alignment should be flipped.
29
+ */
30
+ flipped?: boolean;
31
+ /**
32
+ * Enable or disable focus trap behavior.
33
+ */
34
+ focusTrap?: boolean;
35
+ /**
36
+ * Where to put the menu relative to the trigger.
37
+ */
38
+ menuDirection?: MenuDirection;
39
+ /**
40
+ * The adjustment of the floating menu's position.
41
+ */
42
+ menuOffset?: MenuOffset;
43
+ /**
44
+ * Callback when the menu body is mounted/unmounted.
45
+ */
46
+ menuRef?: (menuBody: HTMLElement | null) => void;
47
+ /**
48
+ * Callback when the menu body has been placed.
49
+ */
50
+ onPlace?: (menuBody: HTMLElement) => void;
51
+ /**
52
+ * CSS selector for the element to focus when the menu opens.
53
+ */
54
+ selectorPrimaryFocus?: string;
55
+ /**
56
+ * Additional styles to apply to the menu.
57
+ */
58
+ styles?: CSSProperties;
59
+ /**
60
+ * Function returning the element where the floating menu is rendered.
61
+ * @default () => document.body
62
+ */
63
+ target?: () => Element;
64
+ /**
65
+ * The `ref` of the tooltip’s trigger element. It is assumed to be a
66
+ * `RefObject` pointing to an `HTMLElement`.
67
+ */
68
+ triggerRef: RefObject<HTMLElement>;
69
+ /**
70
+ * Optional function to adjust orientation
71
+ */
72
+ updateOrientation?: (params: {
73
+ menuSize: DOMRect;
74
+ refPosition: DOMRect | undefined;
75
+ direction: string;
76
+ offset: Offset;
77
+ scrollX: number;
78
+ scrollY: number;
79
+ container: Container;
80
+ }) => void;
81
+ }
82
+ export declare const FloatingMenu: ({ children, flipped, focusTrap, menuDirection, menuOffset, menuRef: externalMenuRef, onPlace, selectorPrimaryFocus, styles, target, triggerRef, updateOrientation, }: FloatingMenuProps) => any;
83
+ export {};