@itwin/itwinui-react 3.0.0-dev.7 → 3.0.0-dev.8

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 (189) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/cjs/core/Alert/Alert.d.ts +20 -9
  3. package/cjs/core/Alert/Alert.js +48 -10
  4. package/cjs/core/ButtonGroup/ButtonGroup.js +41 -36
  5. package/cjs/core/Buttons/IconButton/IconButton.js +27 -44
  6. package/cjs/core/Buttons/SplitButton/SplitButton.js +3 -0
  7. package/cjs/core/ColorPicker/ColorInputPanel.js +172 -231
  8. package/cjs/core/ComboBox/ComboBox.js +3 -3
  9. package/cjs/core/ComboBox/ComboBoxDropdown.js +4 -9
  10. package/cjs/core/ComboBox/ComboBoxEndIcon.js +3 -22
  11. package/cjs/core/ComboBox/ComboBoxMenu.d.ts +2 -2
  12. package/cjs/core/ComboBox/ComboBoxMenuItem.d.ts +1 -1
  13. package/cjs/core/ComboBox/ComboBoxMenuItem.js +8 -6
  14. package/cjs/core/ComboBox/helpers.d.ts +1 -2
  15. package/cjs/core/DatePicker/DatePicker.d.ts +30 -8
  16. package/cjs/core/DatePicker/DatePicker.js +40 -5
  17. package/cjs/core/Dialog/Dialog.js +10 -16
  18. package/cjs/core/Dialog/DialogContext.d.ts +3 -4
  19. package/cjs/core/ExpandableBlock/ExpandableBlock.d.ts +20 -14
  20. package/cjs/core/ExpandableBlock/ExpandableBlock.js +38 -15
  21. package/cjs/core/Header/HeaderSplitButton.js +1 -0
  22. package/cjs/core/Input/Input.d.ts +4 -0
  23. package/cjs/core/Input/Input.js +2 -1
  24. package/cjs/core/InputGrid/InputGrid.d.ts +25 -0
  25. package/cjs/core/InputGrid/InputGrid.js +39 -0
  26. package/cjs/core/InputGrid/index.d.ts +3 -0
  27. package/cjs/core/InputGrid/index.js +15 -0
  28. package/cjs/core/InputGroup/InputGroup.d.ts +13 -0
  29. package/cjs/core/InputGroup/InputGroup.js +35 -9
  30. package/cjs/core/InputWithDecorations/InputWithDecorations.d.ts +39 -0
  31. package/cjs/core/InputWithDecorations/InputWithDecorations.js +81 -0
  32. package/cjs/core/InputWithDecorations/index.d.ts +3 -0
  33. package/cjs/core/InputWithDecorations/index.js +15 -0
  34. package/cjs/core/Label/Label.d.ts +5 -0
  35. package/cjs/core/Label/Label.js +2 -0
  36. package/cjs/core/LabeledInput/LabeledInput.d.ts +22 -16
  37. package/cjs/core/LabeledInput/LabeledInput.js +52 -29
  38. package/cjs/core/LabeledSelect/LabeledSelect.d.ts +17 -7
  39. package/cjs/core/LabeledSelect/LabeledSelect.js +36 -17
  40. package/cjs/core/LabeledTextarea/LabeledTextarea.d.ts +15 -5
  41. package/cjs/core/LabeledTextarea/LabeledTextarea.js +12 -45
  42. package/cjs/core/Menu/Menu.d.ts +1 -1
  43. package/cjs/core/Menu/Menu.js +1 -1
  44. package/cjs/core/Menu/MenuDivider.d.ts +2 -1
  45. package/cjs/core/Menu/MenuDivider.js +1 -1
  46. package/cjs/core/Menu/MenuItem.d.ts +1 -1
  47. package/cjs/core/Menu/MenuItem.js +1 -0
  48. package/cjs/core/Menu/MenuItemSkeleton.d.ts +1 -1
  49. package/cjs/core/Menu/MenuItemSkeleton.js +0 -1
  50. package/cjs/core/SearchBox/SearchBox.js +1 -1
  51. package/cjs/core/Select/Select.d.ts +4 -0
  52. package/cjs/core/Select/Select.js +10 -9
  53. package/cjs/core/SideNavigation/SideNavigation.js +2 -0
  54. package/cjs/core/Slider/Thumb.js +1 -0
  55. package/cjs/core/StatusMessage/StatusMessage.d.ts +12 -2
  56. package/cjs/core/StatusMessage/StatusMessage.js +23 -9
  57. package/cjs/core/Table/SubRowExpander.js +2 -0
  58. package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.d.ts +6 -1
  59. package/cjs/core/Table/filters/DateRangeFilter/DatePickerInput.js +46 -18
  60. package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.d.ts +2 -0
  61. package/cjs/core/Table/filters/DateRangeFilter/DateRangeFilter.js +2 -0
  62. package/cjs/core/Textarea/Textarea.d.ts +7 -1
  63. package/cjs/core/Textarea/Textarea.js +6 -11
  64. package/cjs/core/ThemeProvider/ThemeProvider.js +1 -1
  65. package/cjs/core/Tile/Tile.d.ts +139 -15
  66. package/cjs/core/Tile/Tile.js +107 -16
  67. package/cjs/core/Toast/Toast.d.ts +12 -4
  68. package/cjs/core/Toast/Toast.js +20 -4
  69. package/cjs/core/Tooltip/Tooltip.d.ts +35 -28
  70. package/cjs/core/Tooltip/Tooltip.js +116 -117
  71. package/cjs/core/TransferList/TransferList.js +4 -12
  72. package/cjs/core/index.d.ts +2 -0
  73. package/cjs/core/index.js +20 -4
  74. package/cjs/core/utils/components/Icon.d.ts +5 -0
  75. package/cjs/core/utils/components/Icon.js +8 -1
  76. package/cjs/core/utils/components/InputContainer.d.ts +0 -1
  77. package/cjs/core/utils/components/InputContainer.js +14 -34
  78. package/cjs/core/utils/components/InputFlexContainer.d.ts +1 -0
  79. package/cjs/core/utils/components/InputFlexContainer.js +3 -1
  80. package/cjs/core/utils/components/Portal.d.ts +27 -0
  81. package/cjs/core/utils/components/Portal.js +43 -0
  82. package/cjs/core/utils/components/index.d.ts +1 -0
  83. package/cjs/core/utils/components/index.js +1 -0
  84. package/cjs/core/utils/functions/index.d.ts +1 -0
  85. package/cjs/core/utils/functions/index.js +1 -0
  86. package/cjs/core/utils/functions/react.d.ts +8 -0
  87. package/cjs/core/utils/functions/react.js +40 -0
  88. package/cjs/core/utils/hooks/index.d.ts +1 -1
  89. package/cjs/core/utils/hooks/index.js +1 -1
  90. package/cjs/core/utils/hooks/useControlledState.d.ts +13 -0
  91. package/cjs/core/utils/hooks/useControlledState.js +39 -0
  92. package/cjs/styles.js +10 -28
  93. package/esm/core/Alert/Alert.d.ts +20 -9
  94. package/esm/core/Alert/Alert.js +49 -10
  95. package/esm/core/ButtonGroup/ButtonGroup.js +41 -36
  96. package/esm/core/Buttons/IconButton/IconButton.js +25 -40
  97. package/esm/core/Buttons/SplitButton/SplitButton.js +9 -1
  98. package/esm/core/ColorPicker/ColorInputPanel.js +173 -232
  99. package/esm/core/ComboBox/ComboBox.js +3 -3
  100. package/esm/core/ComboBox/ComboBoxDropdown.js +4 -9
  101. package/esm/core/ComboBox/ComboBoxEndIcon.js +4 -25
  102. package/esm/core/ComboBox/ComboBoxMenu.d.ts +2 -2
  103. package/esm/core/ComboBox/ComboBoxMenuItem.d.ts +1 -1
  104. package/esm/core/ComboBox/ComboBoxMenuItem.js +9 -7
  105. package/esm/core/ComboBox/helpers.d.ts +1 -2
  106. package/esm/core/DatePicker/DatePicker.d.ts +30 -8
  107. package/esm/core/DatePicker/DatePicker.js +25 -5
  108. package/esm/core/Dialog/Dialog.js +11 -23
  109. package/esm/core/Dialog/DialogContext.d.ts +3 -4
  110. package/esm/core/ExpandableBlock/ExpandableBlock.d.ts +20 -14
  111. package/esm/core/ExpandableBlock/ExpandableBlock.js +39 -17
  112. package/esm/core/Header/HeaderSplitButton.js +1 -0
  113. package/esm/core/Input/Input.d.ts +4 -0
  114. package/esm/core/Input/Input.js +2 -1
  115. package/esm/core/InputGrid/InputGrid.d.ts +25 -0
  116. package/esm/core/InputGrid/InputGrid.js +35 -0
  117. package/esm/core/InputGrid/index.d.ts +3 -0
  118. package/esm/core/InputGrid/index.js +6 -0
  119. package/esm/core/InputGroup/InputGroup.d.ts +13 -0
  120. package/esm/core/InputGroup/InputGroup.js +34 -10
  121. package/esm/core/InputWithDecorations/InputWithDecorations.d.ts +39 -0
  122. package/esm/core/InputWithDecorations/InputWithDecorations.js +80 -0
  123. package/esm/core/InputWithDecorations/index.d.ts +3 -0
  124. package/esm/core/InputWithDecorations/index.js +6 -0
  125. package/esm/core/Label/Label.d.ts +5 -0
  126. package/esm/core/Label/Label.js +2 -0
  127. package/esm/core/LabeledInput/LabeledInput.d.ts +22 -16
  128. package/esm/core/LabeledInput/LabeledInput.js +53 -29
  129. package/esm/core/LabeledSelect/LabeledSelect.d.ts +17 -7
  130. package/esm/core/LabeledSelect/LabeledSelect.js +37 -18
  131. package/esm/core/LabeledTextarea/LabeledTextarea.d.ts +15 -5
  132. package/esm/core/LabeledTextarea/LabeledTextarea.js +14 -45
  133. package/esm/core/Menu/Menu.d.ts +1 -1
  134. package/esm/core/Menu/Menu.js +1 -1
  135. package/esm/core/Menu/MenuDivider.d.ts +2 -1
  136. package/esm/core/Menu/MenuDivider.js +1 -1
  137. package/esm/core/Menu/MenuItem.d.ts +1 -1
  138. package/esm/core/Menu/MenuItem.js +1 -0
  139. package/esm/core/Menu/MenuItemSkeleton.d.ts +1 -1
  140. package/esm/core/Menu/MenuItemSkeleton.js +0 -1
  141. package/esm/core/SearchBox/SearchBox.js +1 -1
  142. package/esm/core/Select/Select.d.ts +4 -0
  143. package/esm/core/Select/Select.js +10 -9
  144. package/esm/core/SideNavigation/SideNavigation.js +2 -0
  145. package/esm/core/Slider/Thumb.js +1 -0
  146. package/esm/core/StatusMessage/StatusMessage.d.ts +12 -2
  147. package/esm/core/StatusMessage/StatusMessage.js +23 -16
  148. package/esm/core/Table/SubRowExpander.js +2 -0
  149. package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.d.ts +6 -1
  150. package/esm/core/Table/filters/DateRangeFilter/DatePickerInput.js +45 -17
  151. package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.d.ts +2 -0
  152. package/esm/core/Table/filters/DateRangeFilter/DateRangeFilter.js +2 -0
  153. package/esm/core/Textarea/Textarea.d.ts +7 -1
  154. package/esm/core/Textarea/Textarea.js +6 -11
  155. package/esm/core/ThemeProvider/ThemeProvider.js +4 -3
  156. package/esm/core/Tile/Tile.d.ts +139 -15
  157. package/esm/core/Tile/Tile.js +107 -16
  158. package/esm/core/Toast/Toast.d.ts +12 -4
  159. package/esm/core/Toast/Toast.js +21 -4
  160. package/esm/core/Tooltip/Tooltip.d.ts +35 -28
  161. package/esm/core/Tooltip/Tooltip.js +119 -116
  162. package/esm/core/TransferList/TransferList.js +4 -9
  163. package/esm/core/index.d.ts +2 -0
  164. package/esm/core/index.js +2 -0
  165. package/esm/core/utils/components/Icon.d.ts +5 -0
  166. package/esm/core/utils/components/Icon.js +8 -1
  167. package/esm/core/utils/components/InputContainer.d.ts +0 -1
  168. package/esm/core/utils/components/InputContainer.js +14 -30
  169. package/esm/core/utils/components/InputFlexContainer.d.ts +1 -0
  170. package/esm/core/utils/components/InputFlexContainer.js +3 -1
  171. package/esm/core/utils/components/Portal.d.ts +27 -0
  172. package/esm/core/utils/components/Portal.js +36 -0
  173. package/esm/core/utils/components/index.d.ts +1 -0
  174. package/esm/core/utils/components/index.js +1 -0
  175. package/esm/core/utils/functions/index.d.ts +1 -0
  176. package/esm/core/utils/functions/index.js +1 -0
  177. package/esm/core/utils/functions/react.d.ts +8 -0
  178. package/esm/core/utils/functions/react.js +35 -0
  179. package/esm/core/utils/hooks/index.d.ts +1 -1
  180. package/esm/core/utils/hooks/index.js +1 -1
  181. package/esm/core/utils/hooks/useControlledState.d.ts +13 -0
  182. package/esm/core/utils/hooks/useControlledState.js +34 -0
  183. package/esm/styles.js +10 -28
  184. package/package.json +3 -3
  185. package/styles.css +22 -19
  186. package/cjs/core/utils/hooks/useUncontrolledState.d.ts +0 -6
  187. package/cjs/core/utils/hooks/useUncontrolledState.js +0 -18
  188. package/esm/core/utils/hooks/useUncontrolledState.d.ts +0 -6
  189. package/esm/core/utils/hooks/useUncontrolledState.js +0 -13
package/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.0.0-dev.8
4
+
5
+ ### Major Changes
6
+
7
+ - [#1544](https://github.com/iTwin/iTwinUI/pull/1544): Removed `iconDisplayStyle` prop from `LabeledInput` and `LabeledTextarea` components. `svgIcon` is now added inline. Users must use `StatusMessage` to add custom icon to the message.
8
+ - [#1355](https://github.com/iTwin/iTwinUI/pull/1355): Removed `inputStyle` and `inputClassName` props from `LabeledInput`; style and className props are being passed down to input. Added `wrapperProps`, `labelProps`, `messageProps`, `messageIconProps`, `inputWrapperProps` to pass props to sub elements.
9
+ - [#1355](https://github.com/iTwin/iTwinUI/pull/1355): Removed `selectStyle` and `selectClassName` props from `LabeledSelect`; style and className props are being passed down to textarea. Added `wrapperProps`, `labelProps`, `messageProps`, `messageIconProps` to pass props to sub elements.
10
+ - [#1355](https://github.com/iTwin/iTwinUI/pull/1355): Removed `textareaStyle` and `textareaClassName` props from `LabeledTextarea`; style and className props are being passed down to textarea. Added `wrapperProps`, `labelProps`, `messageProps`, `messageIconProps` to pass props to sub elements.
11
+
12
+ ### Minor Changes
13
+
14
+ - [#1355](https://github.com/iTwin/iTwinUI/pull/1355): Added `status` prop to `Input`, `Textarea` and `Select`.
15
+ - [#1510](https://github.com/iTwin/iTwinUI/pull/1510): Added `domProps` to allow Toast's DOM customisation.
16
+ - [#1355](https://github.com/iTwin/iTwinUI/pull/1355): Added two new components for building complex input layouts.
17
+
18
+ - `InputGrid` for the "outer" layout (label, inputs and statusMessage)
19
+ - `InputWithDecorations` for the "inner" layout (start icon/button, end icon/button)
20
+
21
+ `LabeledInput`, `LabeledSelect`, `LabeledTextarea` and table `DatePickerInput` have been updated to make use of these new components internally.
22
+
23
+ - [#1531](https://github.com/iTwin/iTwinUI/pull/1531): Selected options in Select/ComboBox will now have a checkmark.
24
+ - [#1355](https://github.com/iTwin/iTwinUI/pull/1355): Added new `padded` prop to `Icon`.
25
+ - [#1466](https://github.com/iTwin/iTwinUI/pull/1466): Adding the ability for every DOM node inside DatePicker component to have a custom className passed to it.
26
+ - [#1523](https://github.com/iTwin/iTwinUI/pull/1523): Added `ariaStrategy` prop to Tooltip. Can be used to change how the tooltip is associated with the trigger element.
27
+
28
+ ### Patch Changes
29
+
30
+ - [#1533](https://github.com/iTwin/iTwinUI/pull/1533): Fixed missing accessible name in SplitButton.
31
+ - [#1495](https://github.com/iTwin/iTwinUI/pull/1495): Added accessible name to dropdown menu button in HeaderSplitButton.
32
+ - [#1496](https://github.com/iTwin/iTwinUI/pull/1496): Added accessible button name to SideNavigation expand button.
33
+ - [#1505](https://github.com/iTwin/iTwinUI/pull/1505): Gave accessible label to the sub-row toggle in <Table>.
34
+
3
35
  ## 3.0.0-dev.7
4
36
 
5
37
  ### Major Changes
@@ -146,6 +178,30 @@
146
178
  - Updated dependencies:
147
179
  - @itwin/itwinui-css@2.0.0-dev.0
148
180
 
181
+ ## 2.12.7
182
+
183
+ ### Patch Changes
184
+
185
+ - [#1545](https://github.com/iTwin/iTwinUI/pull/1545): `tableFilters.DateRangeFilter` now supports localizing the date picker using `translatedLabels.datePicker`.
186
+
187
+ ## 2.12.6
188
+
189
+ ### Patch Changes
190
+
191
+ - [#1516](https://github.com/iTwin/iTwinUI/pull/1516): Update SearchBox placeholder color to match Input.
192
+
193
+ ## 2.12.5
194
+
195
+ ### Patch Changes
196
+
197
+ - [#1511](https://github.com/iTwin/iTwinUI/pull/1511): Fix high-visibility button background on hover.
198
+
199
+ ## 2.12.4
200
+
201
+ ### Patch Changes
202
+
203
+ - [#1508](https://github.com/iTwin/iTwinUI/pull/1508): Fixed an issue where styles were not included in CommonJS environments.
204
+
149
205
  ## 2.12.3
150
206
 
151
207
  ### Patch Changes
@@ -12,20 +12,26 @@ type AlertOwnProps = {
12
12
  */
13
13
  isSticky?: boolean;
14
14
  };
15
+ type AlertLegacyProps = {
16
+ /** @deprecated Use `Alert.Action` subcomponent. */
17
+ clickableText?: React.ReactNode;
18
+ /** @deprecated Use `Alert.Action` subcomponent. */
19
+ clickableTextProps?: React.ComponentPropsWithoutRef<'a'>;
20
+ /** @deprecated Use `Alert.CloseButton` subcomponent. */
21
+ onClose?: () => void;
22
+ };
15
23
  /**
16
24
  * A small box to quickly grab user attention and communicate a brief message
17
25
  * @example
18
- * <Alert>
19
- * <Alert.Message>This is an alert.</Alert.Message>
20
- * </Alert>
26
+ * <Alert>This is an alert.</Alert>
21
27
  * @example
22
- * <Alert type='informational'>
28
+ * <Alert.Wrapper type='informational'>
23
29
  * <Alert.Icon />
24
30
  * <Alert.Message>This is an informational alert.</Alert.Message>
25
31
  * <Alert.CloseButton onClick={() => {}} />
26
- * </Alert>
32
+ * </Alert.Wrapper>
27
33
  * @example
28
- * <Alert type='positive'>
34
+ * <Alert.Wrapper type='positive'>
29
35
  * <Alert.Icon>
30
36
  * <SvgSmileyHappy />
31
37
  * </Alert.Icon>
@@ -36,17 +42,22 @@ type AlertOwnProps = {
36
42
  * <Alert.CloseButton onClick={() => {}}>
37
43
  * <SvgCollapse />
38
44
  * </Alert.CloseButton>
39
- * </Alert>
45
+ * </Alert.Wrapper>
40
46
  */
41
- export declare const Alert: PolymorphicForwardRefComponent<"div", AlertOwnProps> & {
47
+ export declare const Alert: PolymorphicForwardRefComponent<"div", AlertOwnProps & AlertLegacyProps> & {
48
+ /**
49
+ * Alert wrapper subcomponent
50
+ */
51
+ Wrapper: PolymorphicForwardRefComponent<"div", AlertOwnProps>;
42
52
  /**
43
53
  * Alert icon subcomponent
44
54
  */
45
55
  Icon: PolymorphicForwardRefComponent<"span", Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
46
56
  ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
47
- }, "fill" | "as" | "key" | "size" | keyof React.HTMLAttributes<HTMLSpanElement>> & {
57
+ }, "fill" | "as" | "key" | "size" | keyof React.HTMLAttributes<HTMLSpanElement> | "padded"> & {
48
58
  size?: "small" | "large" | "auto" | "medium" | import("../utils/types.js").AnyString | undefined;
49
59
  fill?: "default" | "informational" | "negative" | "positive" | "warning" | import("../utils/types.js").AnyString | undefined;
60
+ padded?: boolean | undefined;
50
61
  } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
51
62
  as?: "span" | undefined;
52
63
  }>;
@@ -11,7 +11,43 @@ const React = tslib_1.__importStar(require('react'));
11
11
  const index_js_1 = require('../utils/index.js');
12
12
  const index_js_2 = require('../Buttons/index.js');
13
13
  const AlertContext = React.createContext(undefined);
14
- const AlertComponent = React.forwardRef((props, ref) => {
14
+ // ----------------------------------------------------------------------------
15
+ // Alert component
16
+ const AlertComponent = React.forwardRef((props, forwardedRef) => {
17
+ const {
18
+ children,
19
+ type = 'informational',
20
+ isSticky = false,
21
+ clickableText,
22
+ clickableTextProps,
23
+ onClose,
24
+ ...rest
25
+ } = props;
26
+ return React.createElement(
27
+ exports.Alert.Wrapper,
28
+ { type: type, isSticky: isSticky, ref: forwardedRef, ...rest },
29
+ React.createElement(exports.Alert.Icon, null),
30
+ React.createElement(
31
+ exports.Alert.Message,
32
+ null,
33
+ children,
34
+ clickableText
35
+ ? React.createElement(
36
+ exports.Alert.Action,
37
+ { ...clickableTextProps },
38
+ clickableText,
39
+ )
40
+ : null,
41
+ ),
42
+ onClose
43
+ ? React.createElement(exports.Alert.CloseButton, { onClick: onClose })
44
+ : null,
45
+ );
46
+ });
47
+ AlertComponent.displayName = 'Alert';
48
+ // ----------------------------------------------------------------------------
49
+ // Alert.Wrapper component
50
+ const AlertWrapper = React.forwardRef((props, ref) => {
15
51
  const {
16
52
  children,
17
53
  className,
@@ -31,7 +67,7 @@ const AlertComponent = React.forwardRef((props, ref) => {
31
67
  React.createElement(AlertContext.Provider, { value: { type } }, children),
32
68
  );
33
69
  });
34
- AlertComponent.displayName = 'Alert';
70
+ AlertWrapper.displayName = 'Alert.Wrapper';
35
71
  // ----------------------------------------------------------------------------
36
72
  // Alert.Icon component
37
73
  const AlertIcon = React.forwardRef((props, ref) => {
@@ -54,7 +90,7 @@ AlertMessage.displayName = 'Alert.Message';
54
90
  const AlertAction = React.forwardRef((props, ref) => {
55
91
  const { children, className, ...rest } = props;
56
92
  return React.createElement(
57
- index_js_1.Box,
93
+ index_js_1.ButtonBase,
58
94
  {
59
95
  as: !!props.href ? 'a' : 'button',
60
96
  className: (0, classnames_1.default)('iui-alert-link', className),
@@ -85,17 +121,15 @@ AlertCloseButton.displayName = 'Alert.CloseButton';
85
121
  /**
86
122
  * A small box to quickly grab user attention and communicate a brief message
87
123
  * @example
88
- * <Alert>
89
- * <Alert.Message>This is an alert.</Alert.Message>
90
- * </Alert>
124
+ * <Alert>This is an alert.</Alert>
91
125
  * @example
92
- * <Alert type='informational'>
126
+ * <Alert.Wrapper type='informational'>
93
127
  * <Alert.Icon />
94
128
  * <Alert.Message>This is an informational alert.</Alert.Message>
95
129
  * <Alert.CloseButton onClick={() => {}} />
96
- * </Alert>
130
+ * </Alert.Wrapper>
97
131
  * @example
98
- * <Alert type='positive'>
132
+ * <Alert.Wrapper type='positive'>
99
133
  * <Alert.Icon>
100
134
  * <SvgSmileyHappy />
101
135
  * </Alert.Icon>
@@ -106,9 +140,13 @@ AlertCloseButton.displayName = 'Alert.CloseButton';
106
140
  * <Alert.CloseButton onClick={() => {}}>
107
141
  * <SvgCollapse />
108
142
  * </Alert.CloseButton>
109
- * </Alert>
143
+ * </Alert.Wrapper>
110
144
  */
111
145
  exports.Alert = Object.assign(AlertComponent, {
146
+ /**
147
+ * Alert wrapper subcomponent
148
+ */
149
+ Wrapper: AlertWrapper,
112
150
  /**
113
151
  * Alert icon subcomponent
114
152
  */
@@ -9,6 +9,7 @@ const tslib_1 = require('tslib');
9
9
  const React = tslib_1.__importStar(require('react'));
10
10
  const classnames_1 = tslib_1.__importDefault(require('classnames'));
11
11
  const index_js_1 = require('../utils/index.js');
12
+ const react_1 = require('@floating-ui/react');
12
13
  /**
13
14
  * Group buttons together for common actions.
14
15
  * Handles responsive overflow when the `overflowButton` prop is specified.
@@ -60,42 +61,46 @@ exports.ButtonGroup = React.forwardRef((props, ref) => {
60
61
  );
61
62
  const refs = (0, index_js_1.useMergedRefs)(overflowRef, ref);
62
63
  return React.createElement(
63
- index_js_1.Box,
64
- {
65
- className: (0, classnames_1.default)(
66
- {
67
- 'iui-button-group': orientation === 'horizontal',
68
- 'iui-button-group-vertical': orientation === 'vertical',
69
- 'iui-button-group-overflow-x':
70
- !!overflowButton && orientation === 'horizontal',
71
- },
72
- className,
73
- ),
74
- ref: refs,
75
- ...rest,
76
- },
77
- (() => {
78
- if (!(visibleCount < items.length)) {
79
- return items;
80
- }
81
- const overflowStart =
82
- overflowPlacement === 'start'
83
- ? items.length - visibleCount
84
- : visibleCount - 1;
85
- return React.createElement(
86
- React.Fragment,
87
- null,
88
- overflowButton &&
89
- overflowPlacement === 'start' &&
90
- React.createElement('div', null, overflowButton(overflowStart)),
91
- overflowPlacement === 'start'
92
- ? items.slice(overflowStart + 1)
93
- : items.slice(0, Math.max(0, overflowStart)),
94
- overflowButton &&
95
- overflowPlacement === 'end' &&
96
- React.createElement('div', null, overflowButton(overflowStart)),
97
- );
98
- })(),
64
+ react_1.FloatingDelayGroup,
65
+ { delay: { open: 50, close: 250 } },
66
+ React.createElement(
67
+ index_js_1.Box,
68
+ {
69
+ className: (0, classnames_1.default)(
70
+ {
71
+ 'iui-button-group': orientation === 'horizontal',
72
+ 'iui-button-group-vertical': orientation === 'vertical',
73
+ 'iui-button-group-overflow-x':
74
+ !!overflowButton && orientation === 'horizontal',
75
+ },
76
+ className,
77
+ ),
78
+ ref: refs,
79
+ ...rest,
80
+ },
81
+ (() => {
82
+ if (!(visibleCount < items.length)) {
83
+ return items;
84
+ }
85
+ const overflowStart =
86
+ overflowPlacement === 'start'
87
+ ? items.length - visibleCount
88
+ : visibleCount - 1;
89
+ return React.createElement(
90
+ React.Fragment,
91
+ null,
92
+ overflowButton &&
93
+ overflowPlacement === 'start' &&
94
+ React.createElement('div', null, overflowButton(overflowStart)),
95
+ overflowPlacement === 'start'
96
+ ? items.slice(overflowStart + 1)
97
+ : items.slice(0, Math.max(0, overflowStart)),
98
+ overflowButton &&
99
+ overflowPlacement === 'end' &&
100
+ React.createElement('div', null, overflowButton(overflowStart)),
101
+ );
102
+ })(),
103
+ ),
99
104
  );
100
105
  });
101
106
  exports.default = exports.ButtonGroup;
@@ -9,6 +9,7 @@ const tslib_1 = require('tslib');
9
9
  const classnames_1 = tslib_1.__importDefault(require('classnames'));
10
10
  const React = tslib_1.__importStar(require('react'));
11
11
  const index_js_1 = require('../../utils/index.js');
12
+ const Tooltip_js_1 = require('../../Tooltip/Tooltip.js');
12
13
  /**
13
14
  * Icon button
14
15
  * @example
@@ -27,56 +28,38 @@ exports.IconButton = React.forwardRef((props, ref) => {
27
28
  iconProps,
28
29
  ...rest
29
30
  } = props;
30
- return React.createElement(
31
- IconButtonTooltip,
32
- { label: label },
31
+ const button = React.createElement(
32
+ index_js_1.ButtonBase,
33
+ {
34
+ ref: ref,
35
+ className: (0, classnames_1.default)('iui-button', className),
36
+ 'data-iui-variant': styleType !== 'default' ? styleType : undefined,
37
+ 'data-iui-size': size,
38
+ 'data-iui-active': isActive,
39
+ 'aria-pressed': isActive,
40
+ ...rest,
41
+ },
33
42
  React.createElement(
34
- index_js_1.ButtonBase,
43
+ index_js_1.Box,
35
44
  {
36
- ref: ref,
37
- className: (0, classnames_1.default)('iui-button', className),
38
- 'data-iui-variant': styleType !== 'default' ? styleType : undefined,
39
- 'data-iui-size': size,
40
- 'data-iui-active': isActive,
41
- 'aria-pressed': isActive,
42
- ...rest,
45
+ as: 'span',
46
+ 'aria-hidden': true,
47
+ ...iconProps,
48
+ className: (0, classnames_1.default)(
49
+ 'iui-button-icon',
50
+ iconProps?.className,
51
+ ),
43
52
  },
44
- React.createElement(
45
- index_js_1.Box,
46
- {
47
- as: 'span',
48
- 'aria-hidden': true,
49
- ...iconProps,
50
- className: (0, classnames_1.default)(
51
- 'iui-button-icon',
52
- iconProps?.className,
53
- ),
54
- },
55
- children,
56
- ),
57
- label
58
- ? React.createElement(index_js_1.VisuallyHidden, null, label)
59
- : null,
53
+ children,
60
54
  ),
55
+ label ? React.createElement(index_js_1.VisuallyHidden, null, label) : null,
61
56
  );
62
- });
63
- const IconButtonTooltip = (props) => {
64
- const { label, children } = props;
65
57
  return label
66
58
  ? React.createElement(
67
- index_js_1.Popover,
68
- {
69
- interactive: false,
70
- offset: [0, 4],
71
- aria: { content: null },
72
- content: React.createElement(
73
- index_js_1.Box,
74
- { 'aria-hidden': 'true', className: 'iui-tooltip' },
75
- label,
76
- ),
77
- },
78
- children,
59
+ Tooltip_js_1.Tooltip,
60
+ { content: label, ariaStrategy: 'none' },
61
+ button,
79
62
  )
80
- : children;
81
- };
63
+ : button;
64
+ });
82
65
  exports.default = exports.IconButton;
@@ -47,6 +47,7 @@ exports.SplitButton = React.forwardRef((props, forwardedRef) => {
47
47
  setMenuWidth(wrapperRef.current.offsetWidth);
48
48
  }
49
49
  }, [children, size]);
50
+ const labelId = (0, index_js_4.useId)();
50
51
  return React.createElement(
51
52
  index_js_4.Box,
52
53
  {
@@ -69,6 +70,7 @@ exports.SplitButton = React.forwardRef((props, forwardedRef) => {
69
70
  onClick: onClick,
70
71
  ref: forwardedRef,
71
72
  ...rest,
73
+ labelProps: { id: labelId, ...props.labelProps },
72
74
  },
73
75
  children,
74
76
  ),
@@ -87,6 +89,7 @@ exports.SplitButton = React.forwardRef((props, forwardedRef) => {
87
89
  styleType: styleType,
88
90
  size: size,
89
91
  disabled: props.disabled,
92
+ 'aria-labelledby': props.labelProps?.id || labelId,
90
93
  ...menuButtonProps,
91
94
  },
92
95
  isMenuOpen