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

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 (145) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/cjs/core/Avatar/Avatar.d.ts +3 -2
  3. package/cjs/core/Avatar/Avatar.js +21 -19
  4. package/cjs/core/AvatarGroup/AvatarGroup.js +3 -8
  5. package/cjs/core/Buttons/Button/Button.d.ts +15 -2
  6. package/cjs/core/Buttons/Button/Button.js +23 -9
  7. package/cjs/core/Buttons/DropdownButton/DropdownButton.js +1 -1
  8. package/cjs/core/Buttons/IconButton/IconButton.d.ts +5 -1
  9. package/cjs/core/Buttons/IconButton/IconButton.js +11 -5
  10. package/cjs/core/Buttons/SplitButton/SplitButton.d.ts +9 -0
  11. package/cjs/core/Buttons/SplitButton/SplitButton.js +22 -13
  12. package/cjs/core/Carousel/Carousel.d.ts +6 -4
  13. package/cjs/core/Carousel/Carousel.js +2 -2
  14. package/cjs/core/Carousel/CarouselDot.js +1 -3
  15. package/cjs/core/Carousel/CarouselNavigation.d.ts +6 -4
  16. package/cjs/core/ColorPicker/ColorBuilder.js +2 -1
  17. package/cjs/core/ComboBox/ComboBoxInput.js +1 -1
  18. package/cjs/core/ComboBox/ComboBoxMenu.js +5 -5
  19. package/cjs/core/DatePicker/DatePicker.js +7 -1
  20. package/cjs/core/Dialog/Dialog.js +1 -2
  21. package/cjs/core/Dialog/DialogMain.js +5 -5
  22. package/cjs/core/ExpandableBlock/ExpandableBlock.js +1 -3
  23. package/cjs/core/FileUpload/FileUpload.d.ts +4 -0
  24. package/cjs/core/FileUpload/FileUpload.js +24 -3
  25. package/cjs/core/Header/HeaderBasicButton.js +3 -16
  26. package/cjs/core/Header/HeaderDropdownButton.js +1 -1
  27. package/cjs/core/Header/HeaderSplitButton.js +2 -4
  28. package/cjs/core/ProgressIndicators/ProgressLinear.d.ts +4 -0
  29. package/cjs/core/ProgressIndicators/ProgressLinear.js +9 -1
  30. package/cjs/core/Select/Select.js +2 -2
  31. package/cjs/core/SideNavigation/SideNavigation.d.ts +16 -0
  32. package/cjs/core/SideNavigation/SideNavigation.js +40 -9
  33. package/cjs/core/Slider/Slider.d.ts +24 -0
  34. package/cjs/core/Slider/Slider.js +58 -10
  35. package/cjs/core/Slider/Thumb.js +2 -2
  36. package/cjs/core/Slider/Track.d.ts +1 -1
  37. package/cjs/core/Slider/Track.js +17 -6
  38. package/cjs/core/Stepper/Stepper.d.ts +26 -1
  39. package/cjs/core/Stepper/Stepper.js +35 -6
  40. package/cjs/core/Stepper/StepperStep.d.ts +17 -0
  41. package/cjs/core/Stepper/StepperStep.js +33 -8
  42. package/cjs/core/Stepper/WorkflowDiagram.d.ts +11 -1
  43. package/cjs/core/Stepper/WorkflowDiagram.js +23 -10
  44. package/cjs/core/Stepper/WorkflowDiagramStep.d.ts +6 -1
  45. package/cjs/core/Stepper/WorkflowDiagramStep.js +9 -2
  46. package/cjs/core/Table/SubRowExpander.js +1 -1
  47. package/cjs/core/Table/Table.js +0 -1
  48. package/cjs/core/Table/TableCell.js +1 -1
  49. package/cjs/core/Table/TablePaginator.js +1 -3
  50. package/cjs/core/Tabs/Tab.js +1 -2
  51. package/cjs/core/ThemeProvider/ThemeContext.d.ts +1 -1
  52. package/cjs/core/ThemeProvider/ThemeProvider.d.ts +23 -3
  53. package/cjs/core/ThemeProvider/ThemeProvider.js +56 -23
  54. package/cjs/core/Tile/Tile.d.ts +3 -2
  55. package/cjs/core/Toast/Toast.js +4 -9
  56. package/cjs/core/Tooltip/Tooltip.d.ts +1 -1
  57. package/cjs/core/Tooltip/Tooltip.js +1 -2
  58. package/cjs/core/Tree/TreeNode.js +1 -1
  59. package/cjs/core/utils/components/ButtonBase.d.ts +14 -0
  60. package/cjs/core/utils/components/ButtonBase.js +46 -0
  61. package/cjs/core/utils/components/Popover.js +5 -3
  62. package/cjs/core/utils/components/VirtualScroll.js +4 -4
  63. package/cjs/core/utils/components/index.d.ts +1 -0
  64. package/cjs/core/utils/components/index.js +1 -0
  65. package/cjs/core/utils/functions/colors.d.ts +1 -1
  66. package/cjs/core/utils/functions/colors.js +1 -13
  67. package/cjs/core/utils/hooks/index.d.ts +1 -0
  68. package/cjs/core/utils/hooks/index.js +1 -0
  69. package/cjs/core/utils/hooks/useGlobals.d.ts +1 -1
  70. package/cjs/core/utils/hooks/useUncontrolledState.d.ts +6 -0
  71. package/cjs/core/utils/hooks/useUncontrolledState.js +18 -0
  72. package/cjs/styles.js +3 -9
  73. package/esm/core/Avatar/Avatar.d.ts +3 -2
  74. package/esm/core/Avatar/Avatar.js +21 -17
  75. package/esm/core/AvatarGroup/AvatarGroup.js +3 -8
  76. package/esm/core/Buttons/Button/Button.d.ts +15 -2
  77. package/esm/core/Buttons/Button/Button.js +18 -10
  78. package/esm/core/Buttons/DropdownButton/DropdownButton.js +1 -1
  79. package/esm/core/Buttons/IconButton/IconButton.d.ts +5 -1
  80. package/esm/core/Buttons/IconButton/IconButton.js +9 -6
  81. package/esm/core/Buttons/SplitButton/SplitButton.d.ts +9 -0
  82. package/esm/core/Buttons/SplitButton/SplitButton.js +22 -13
  83. package/esm/core/Carousel/Carousel.d.ts +6 -4
  84. package/esm/core/Carousel/Carousel.js +8 -3
  85. package/esm/core/Carousel/CarouselDot.js +2 -4
  86. package/esm/core/Carousel/CarouselNavigation.d.ts +6 -4
  87. package/esm/core/ColorPicker/ColorBuilder.js +2 -1
  88. package/esm/core/ComboBox/ComboBoxInput.js +1 -1
  89. package/esm/core/ComboBox/ComboBoxMenu.js +5 -5
  90. package/esm/core/DatePicker/DatePicker.js +8 -1
  91. package/esm/core/Dialog/Dialog.js +1 -1
  92. package/esm/core/Dialog/DialogMain.js +5 -5
  93. package/esm/core/ExpandableBlock/ExpandableBlock.js +2 -3
  94. package/esm/core/FileUpload/FileUpload.d.ts +4 -0
  95. package/esm/core/FileUpload/FileUpload.js +26 -3
  96. package/esm/core/Header/HeaderBasicButton.js +4 -17
  97. package/esm/core/Header/HeaderDropdownButton.js +1 -1
  98. package/esm/core/Header/HeaderSplitButton.js +8 -5
  99. package/esm/core/ProgressIndicators/ProgressLinear.d.ts +4 -0
  100. package/esm/core/ProgressIndicators/ProgressLinear.js +9 -1
  101. package/esm/core/Select/Select.js +2 -2
  102. package/esm/core/SideNavigation/SideNavigation.d.ts +16 -0
  103. package/esm/core/SideNavigation/SideNavigation.js +31 -9
  104. package/esm/core/Slider/Slider.d.ts +24 -0
  105. package/esm/core/Slider/Slider.js +43 -10
  106. package/esm/core/Slider/Thumb.js +2 -2
  107. package/esm/core/Slider/Track.d.ts +1 -1
  108. package/esm/core/Slider/Track.js +14 -6
  109. package/esm/core/Stepper/Stepper.d.ts +26 -1
  110. package/esm/core/Stepper/Stepper.js +32 -6
  111. package/esm/core/Stepper/StepperStep.d.ts +17 -0
  112. package/esm/core/Stepper/StepperStep.js +27 -8
  113. package/esm/core/Stepper/WorkflowDiagram.d.ts +11 -1
  114. package/esm/core/Stepper/WorkflowDiagram.js +10 -7
  115. package/esm/core/Stepper/WorkflowDiagramStep.d.ts +6 -1
  116. package/esm/core/Stepper/WorkflowDiagramStep.js +6 -2
  117. package/esm/core/Table/SubRowExpander.js +1 -1
  118. package/esm/core/Table/Table.js +0 -1
  119. package/esm/core/Table/TableCell.js +1 -1
  120. package/esm/core/Table/TablePaginator.js +2 -3
  121. package/esm/core/Tabs/Tab.js +2 -3
  122. package/esm/core/ThemeProvider/ThemeContext.d.ts +1 -1
  123. package/esm/core/ThemeProvider/ThemeProvider.d.ts +23 -3
  124. package/esm/core/ThemeProvider/ThemeProvider.js +64 -24
  125. package/esm/core/Tile/Tile.d.ts +3 -2
  126. package/esm/core/Toast/Toast.js +5 -9
  127. package/esm/core/Tooltip/Tooltip.d.ts +1 -1
  128. package/esm/core/Tooltip/Tooltip.js +1 -1
  129. package/esm/core/Tree/TreeNode.js +1 -1
  130. package/esm/core/utils/components/ButtonBase.d.ts +14 -0
  131. package/esm/core/utils/components/ButtonBase.js +42 -0
  132. package/esm/core/utils/components/Popover.js +5 -3
  133. package/esm/core/utils/components/VirtualScroll.js +4 -4
  134. package/esm/core/utils/components/index.d.ts +1 -0
  135. package/esm/core/utils/components/index.js +1 -0
  136. package/esm/core/utils/functions/colors.d.ts +1 -1
  137. package/esm/core/utils/functions/colors.js +1 -13
  138. package/esm/core/utils/hooks/index.d.ts +1 -0
  139. package/esm/core/utils/hooks/index.js +1 -0
  140. package/esm/core/utils/hooks/useGlobals.d.ts +1 -1
  141. package/esm/core/utils/hooks/useUncontrolledState.d.ts +6 -0
  142. package/esm/core/utils/hooks/useUncontrolledState.js +13 -0
  143. package/esm/styles.js +3 -9
  144. package/package.json +2 -2
  145. package/styles.css +37 -37
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.0.0-dev.7
4
+
5
+ ### Major Changes
6
+
7
+ - [#1478](https://github.com/iTwin/iTwinUI/pull/1478): ThemeProvider now defaults the `theme` value to `"inherit"` and falls back to `"light"` there is no parent theme found. Also the inherit behavior has been made more resilient for cases where react context fails.
8
+ - [#1458](https://github.com/iTwin/iTwinUI/pull/1458): Added wrapperProps, contentProps, topProps, and bottomProps to Side Navigation component to improve customization. Top-level props (className, styling, etc) now passed to SideNav button instead of to the wrapper.
9
+ - [#1435](https://github.com/iTwin/iTwinUI/pull/1435): Improving customization of SplitButton with wrapperProps and menuButtonProps. ClassName now passed to the button instead of the component wrapper.
10
+ - [#1461](https://github.com/iTwin/iTwinUI/pull/1461): Changed disabled button behavior to make them focusable and use `aria-disabled` instead of `disabled` attribute.
11
+
12
+ ### Minor Changes
13
+
14
+ - [#1440](https://github.com/iTwin/iTwinUI/pull/1440): Adding the ability for every DOM node to have a custom className passed to it.
15
+ New prop for `FileUpload` component: `contentProps`
16
+ - [#1430](https://github.com/iTwin/iTwinUI/pull/1430): Adding the ability for each node element in `Stepper` to have a custom `prop`.
17
+ New props include: `stepProps`, `trackContentProps`, `circleProps`, `nameProps`, `labelProps`, `labelCountProps`
18
+ - [#1435](https://github.com/iTwin/iTwinUI/pull/1435): Improving customization of Button with new props: labelProps, startIconProps, and endIconProps.
19
+ Improving customization of IconButton with iconProps.
20
+ - [#1477](https://github.com/iTwin/iTwinUI/pull/1477): Added a new `portalContainer` prop to `ThemeProvider`. When specified, all floating elements (tooltips, toats, dialogs) under the ThemeProvider will read this prop from context and portal into it.
21
+
22
+ ### Patch Changes
23
+
24
+ - [#1446](https://github.com/iTwin/iTwinUI/pull/1446): Avatar has been refactored to be a single `<span>`. The colors have been updated to pass AAA contrast ratio.
25
+ - [#1492](https://github.com/iTwin/iTwinUI/pull/1492): Fixed `aria-owns` syntax for `TreeNode`
26
+ - [#1486](https://github.com/iTwin/iTwinUI/pull/1486): DatePicker date tables now have accessible labels.
27
+ - [#1499](https://github.com/iTwin/iTwinUI/pull/1499): Removed special handling of iPhone notch in Header and SideNavigation.
28
+
3
29
  ## 3.0.0-dev.6
4
30
 
5
31
  ### Major Changes
@@ -120,6 +146,25 @@
120
146
  - Updated dependencies:
121
147
  - @itwin/itwinui-css@2.0.0-dev.0
122
148
 
149
+ ## 2.12.3
150
+
151
+ ### Patch Changes
152
+
153
+ - [#1485](https://github.com/iTwin/iTwinUI/pull/1485): Improved color contrast for input and select placeholder text.
154
+ - [#1501](https://github.com/iTwin/iTwinUI/pull/1501): Fixed a small misalignment in Table when using sticky columns.
155
+
156
+ ## 2.12.2
157
+
158
+ ### Patch Changes
159
+
160
+ - [#1494](https://github.com/iTwin/iTwinUI/pull/1494): Updated color-picker dot so its outline adapts dynamically to the backgrounds for better contrast.
161
+
162
+ ## 2.12.1
163
+
164
+ ### Patch Changes
165
+
166
+ - [#1467](https://github.com/iTwin/iTwinUI/pull/1467): Fixed an issue in Carousel where latest `onSlideChange` callback was being ignored.
167
+
123
168
  ## 2.12.0
124
169
 
125
170
  ### Minor Changes
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
- import type { PolymorphicForwardRefComponent } from '../utils/index.js';
2
+ import { SoftBackgrounds } from '../utils/index.js';
3
+ import type { AnyString, PolymorphicForwardRefComponent } from '../utils/index.js';
3
4
  export type AvatarStatus = 'online' | 'busy' | 'away' | 'offline';
4
5
  type StatusTitles = {
5
6
  [key in Exclude<AvatarStatus, ''>]: string;
@@ -29,7 +30,7 @@ type AvatarProps = {
29
30
  /**
30
31
  * Color of the icon. You can use `getUserColor` function to generate color from user name or email. If not provided, default background color from CSS styling will be used (hsl(72, 51%, 56%) / olive green).
31
32
  */
32
- backgroundColor?: string;
33
+ backgroundColor?: keyof typeof SoftBackgrounds | AnyString;
33
34
  /**
34
35
  * Translated status messages shown on hover.
35
36
  */
@@ -9,6 +9,17 @@ 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
+ /**
13
+ * Helper function that returns one of the preset badge color values.
14
+ */
15
+ const getBackground = (color) => {
16
+ if (!color) {
17
+ return '';
18
+ }
19
+ return (0, index_js_1.isSoftBackground)(color)
20
+ ? index_js_1.SoftBackgrounds[color]
21
+ : color;
22
+ };
12
23
  exports.defaultStatusTitles = {
13
24
  away: 'Away',
14
25
  busy: 'Busy',
@@ -56,30 +67,21 @@ exports.Avatar = React.forwardRef((props, ref) => {
56
67
  { [`iui-${size}`]: size !== 'medium' },
57
68
  className,
58
69
  ),
70
+ 'data-iui-status': status,
59
71
  title: title,
60
- style: { backgroundColor, ...style },
72
+ style: { backgroundColor: getBackground(backgroundColor), ...style },
61
73
  ref: ref,
62
74
  ...rest,
63
75
  },
64
- !image &&
65
- React.createElement(
66
- index_js_1.Box,
67
- { as: 'abbr', className: 'iui-initials' },
68
- abbreviation?.substring(0, 2),
69
- ),
76
+ !image ? abbreviation?.substring(0, 2) : null,
70
77
  image,
71
- React.createElement(index_js_1.Box, {
72
- as: 'span',
73
- className: 'iui-stroke',
74
- }),
75
- status &&
76
- React.createElement(index_js_1.Box, {
77
- as: 'span',
78
- title: statusTitles[status],
79
- className: (0, classnames_1.default)('iui-status', {
80
- [`iui-${status}`]: !!status,
81
- }),
82
- }),
78
+ status
79
+ ? React.createElement(
80
+ index_js_1.VisuallyHidden,
81
+ null,
82
+ statusTitles[status],
83
+ )
84
+ : null,
83
85
  );
84
86
  });
85
87
  exports.default = exports.Avatar;
@@ -89,14 +89,9 @@ exports.AvatarGroup = React.forwardRef((props, ref) => {
89
89
  countIconProps?.className,
90
90
  ),
91
91
  },
92
- React.createElement(
93
- index_js_1.Box,
94
- { as: 'abbr', className: 'iui-initials' },
95
- childrenLength <= maxLength
96
- ? `${childrenLength - maxIcons}`
97
- : `${maxLength}+`,
98
- ),
99
- React.createElement(index_js_1.Box, { className: 'iui-stroke' }),
92
+ childrenLength <= maxLength
93
+ ? `${childrenLength - maxIcons}`
94
+ : `${maxLength}+`,
100
95
  ),
101
96
  ),
102
97
  );
@@ -1,4 +1,5 @@
1
- /// <reference types="react" />
1
+ import * as React from 'react';
2
+ import { ButtonBase } from '../../utils/index.js';
2
3
  import type { PolymorphicForwardRefComponent } from '../../utils/index.js';
3
4
  export type ButtonProps = {
4
5
  /**
@@ -19,7 +20,19 @@ export type ButtonProps = {
19
20
  * Icon shown after the main button content.
20
21
  */
21
22
  endIcon?: JSX.Element;
22
- };
23
+ /**
24
+ * Passes props to the button label.
25
+ */
26
+ labelProps?: React.ComponentProps<'span'>;
27
+ /**
28
+ * Passes props to the start icon.
29
+ */
30
+ startIconProps?: React.ComponentProps<'span'>;
31
+ /**
32
+ * Passes props to the end icon.
33
+ */
34
+ endIconProps?: React.ComponentProps<'span'>;
35
+ } & Pick<React.ComponentProps<typeof ButtonBase>, 'htmlDisabled'>;
23
36
  /**
24
37
  * Generic button component
25
38
  * @example
@@ -23,36 +23,50 @@ exports.Button = React.forwardRef((props, ref) => {
23
23
  children,
24
24
  className,
25
25
  size,
26
- style,
27
26
  styleType = 'default',
28
- type = 'button',
29
27
  startIcon,
30
28
  endIcon,
29
+ labelProps,
30
+ startIconProps,
31
+ endIconProps,
31
32
  ...rest
32
33
  } = props;
33
34
  return React.createElement(
34
- index_js_1.Box,
35
+ index_js_1.ButtonBase,
35
36
  {
36
- as: 'button',
37
37
  ref: ref,
38
38
  className: (0, classnames_1.default)('iui-button', className),
39
39
  'data-iui-variant': styleType !== 'default' ? styleType : undefined,
40
40
  'data-iui-size': size,
41
- style: style,
42
- type: type,
43
41
  ...rest,
44
42
  },
45
43
  startIcon &&
46
44
  React.createElement(
47
45
  index_js_1.Box,
48
- { as: 'span', className: 'iui-button-icon', 'aria-hidden': true },
46
+ {
47
+ as: 'span',
48
+ 'aria-hidden': true,
49
+ ...startIconProps,
50
+ className: (0, classnames_1.default)(
51
+ 'iui-button-icon',
52
+ startIconProps?.className,
53
+ ),
54
+ },
49
55
  startIcon,
50
56
  ),
51
- children && React.createElement('span', null, children),
57
+ children && React.createElement('span', { ...labelProps }, children),
52
58
  endIcon &&
53
59
  React.createElement(
54
60
  index_js_1.Box,
55
- { as: 'span', className: 'iui-button-icon', 'aria-hidden': true },
61
+ {
62
+ as: 'span',
63
+ 'aria-hidden': true,
64
+ ...endIconProps,
65
+ className: (0, classnames_1.default)(
66
+ 'iui-button-icon',
67
+ endIconProps?.className,
68
+ ),
69
+ },
56
70
  endIcon,
57
71
  ),
58
72
  );
@@ -52,7 +52,7 @@ exports.DropdownButton = React.forwardRef((props, ref) => {
52
52
  setIsMenuOpen(false);
53
53
  dropdownMenuProps?.onHide?.(i);
54
54
  },
55
- style: { minWidth: menuWidth, ...dropdownMenuProps?.style },
55
+ style: { minInlineSize: menuWidth, ...dropdownMenuProps?.style },
56
56
  },
57
57
  React.createElement(
58
58
  index_js_1.Button,
@@ -11,7 +11,11 @@ export type IconButtonProps = {
11
11
  * Name of the button, shown in a tooltip and exposed to assistive technologies.
12
12
  */
13
13
  label?: React.ReactNode;
14
- } & Omit<ButtonProps, 'startIcon' | 'endIcon'>;
14
+ /**
15
+ * Passes props to IconButton icon.
16
+ */
17
+ iconProps?: React.ComponentProps<'span'>;
18
+ } & Omit<ButtonProps, 'startIcon' | 'endIcon' | 'startIconProps' | 'endIconProps' | 'labelProps'>;
15
19
  /**
16
20
  * Icon button
17
21
  * @example
@@ -22,30 +22,36 @@ exports.IconButton = React.forwardRef((props, ref) => {
22
22
  children,
23
23
  styleType = 'default',
24
24
  size,
25
- type = 'button',
26
25
  className,
27
26
  label,
27
+ iconProps,
28
28
  ...rest
29
29
  } = props;
30
30
  return React.createElement(
31
31
  IconButtonTooltip,
32
32
  { label: label },
33
33
  React.createElement(
34
- index_js_1.Box,
34
+ index_js_1.ButtonBase,
35
35
  {
36
- as: 'button',
37
36
  ref: ref,
38
37
  className: (0, classnames_1.default)('iui-button', className),
39
38
  'data-iui-variant': styleType !== 'default' ? styleType : undefined,
40
39
  'data-iui-size': size,
41
40
  'data-iui-active': isActive,
42
41
  'aria-pressed': isActive,
43
- type: type,
44
42
  ...rest,
45
43
  },
46
44
  React.createElement(
47
45
  index_js_1.Box,
48
- { as: 'span', className: 'iui-button-icon', 'aria-hidden': true },
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
+ },
49
55
  children,
50
56
  ),
51
57
  label
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import type { ButtonProps } from '../Button/Button.js';
3
+ import { IconButton } from '../IconButton/index.js';
3
4
  import type { Placement } from 'tippy.js';
4
5
  import type { PolymorphicForwardRefComponent } from '../../utils/index.js';
5
6
  export type SplitButtonProps = ButtonProps & {
@@ -18,6 +19,14 @@ export type SplitButtonProps = ButtonProps & {
18
19
  * Content of primary button.
19
20
  */
20
21
  children: React.ReactNode;
22
+ /**
23
+ * Passes props to SplitButton wrapper.
24
+ */
25
+ wrapperProps?: React.ComponentProps<'div'>;
26
+ /**
27
+ * Passes props to SplitButton menu button.
28
+ */
29
+ menuButtonProps?: React.ComponentProps<typeof IconButton>;
21
30
  };
22
31
  /**
23
32
  * Split button component with a DropdownMenu.
@@ -35,31 +35,35 @@ exports.SplitButton = React.forwardRef((props, forwardedRef) => {
35
35
  styleType = 'default',
36
36
  size,
37
37
  children,
38
- style,
39
- title,
38
+ wrapperProps,
39
+ menuButtonProps,
40
40
  ...rest
41
41
  } = props;
42
42
  const [isMenuOpen, setIsMenuOpen] = React.useState(false);
43
43
  const [menuWidth, setMenuWidth] = React.useState(0);
44
- const ref = React.useRef(null);
44
+ const wrapperRef = React.useRef(null);
45
45
  React.useEffect(() => {
46
- if (ref.current) {
47
- setMenuWidth(ref.current.offsetWidth);
46
+ if (wrapperRef.current) {
47
+ setMenuWidth(wrapperRef.current.offsetWidth);
48
48
  }
49
49
  }, [children, size]);
50
50
  return React.createElement(
51
51
  index_js_4.Box,
52
52
  {
53
- className: (0, classnames_1.default)(className, 'iui-button-split', {
54
- 'iui-disabled': props.disabled,
55
- }),
56
- style: style,
57
- title: title,
58
- ref: ref,
53
+ ...wrapperProps,
54
+ className: (0, classnames_1.default)(
55
+ 'iui-button-split',
56
+ {
57
+ 'iui-disabled': props.disabled,
58
+ },
59
+ wrapperProps?.className,
60
+ ),
61
+ ref: wrapperRef,
59
62
  },
60
63
  React.createElement(
61
64
  index_js_1.Button,
62
65
  {
66
+ className: className,
63
67
  styleType: styleType,
64
68
  size: size,
65
69
  onClick: onClick,
@@ -73,13 +77,18 @@ exports.SplitButton = React.forwardRef((props, forwardedRef) => {
73
77
  {
74
78
  placement: menuPlacement,
75
79
  menuItems: menuItems,
76
- style: { minWidth: menuWidth },
80
+ style: { minInlineSize: menuWidth },
77
81
  onShow: React.useCallback(() => setIsMenuOpen(true), []),
78
82
  onHide: React.useCallback(() => setIsMenuOpen(false), []),
79
83
  },
80
84
  React.createElement(
81
85
  index_js_2.IconButton,
82
- { styleType: styleType, size: size, disabled: props.disabled },
86
+ {
87
+ styleType: styleType,
88
+ size: size,
89
+ disabled: props.disabled,
90
+ ...menuButtonProps,
91
+ },
83
92
  isMenuOpen
84
93
  ? React.createElement(index_js_4.SvgCaretUpSmall, null)
85
94
  : React.createElement(index_js_4.SvgCaretDownSmall, null),
@@ -38,18 +38,20 @@ export declare const Carousel: PolymorphicForwardRefComponent<"section", Carouse
38
38
  Navigation: PolymorphicForwardRefComponent<"nav", {}> & {
39
39
  PreviousButton: PolymorphicForwardRefComponent<"button", Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
40
40
  ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
41
- }, "label" | "as" | "size" | "styleType" | "isActive"> & {
41
+ }, "label" | "as" | "size" | "htmlDisabled" | "styleType" | "isActive" | "iconProps"> & {
42
42
  isActive?: boolean | undefined;
43
43
  label?: React.ReactNode;
44
- } & Omit<import("../Buttons/Button/Button.js").ButtonProps, "startIcon" | "endIcon"> & {
44
+ iconProps?: React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement> | undefined;
45
+ } & Omit<import("../Buttons/Button/Button.js").ButtonProps, "startIcon" | "endIcon" | "labelProps" | "startIconProps" | "endIconProps"> & {
45
46
  as?: "button" | undefined;
46
47
  }>;
47
48
  NextButton: PolymorphicForwardRefComponent<"button", Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
48
49
  ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
49
- }, "label" | "as" | "size" | "styleType" | "isActive"> & {
50
+ }, "label" | "as" | "size" | "htmlDisabled" | "styleType" | "isActive" | "iconProps"> & {
50
51
  isActive?: boolean | undefined;
51
52
  label?: React.ReactNode;
52
- } & Omit<import("../Buttons/Button/Button.js").ButtonProps, "startIcon" | "endIcon"> & {
53
+ iconProps?: React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement> | undefined;
54
+ } & Omit<import("../Buttons/Button/Button.js").ButtonProps, "startIcon" | "endIcon" | "labelProps" | "startIconProps" | "endIconProps"> & {
53
55
  as?: "button" | undefined;
54
56
  }>;
55
57
  };
@@ -74,10 +74,10 @@ const CarouselComponent = React.forwardRef((props, ref) => {
74
74
  }
75
75
  }
76
76
  };
77
- const userOnSlideChange = React.useRef(onSlideChange);
77
+ const userOnSlideChange = (0, index_js_1.useLatestRef)(onSlideChange);
78
78
  React.useEffect(() => {
79
79
  userOnSlideChange.current?.(currentIndex);
80
- }, [currentIndex]);
80
+ }, [userOnSlideChange, currentIndex]);
81
81
  return React.createElement(
82
82
  index_js_1.Box,
83
83
  {
@@ -15,9 +15,7 @@ const index_js_1 = require('../utils/index.js');
15
15
  */
16
16
  exports.CarouselDot = React.forwardRef((props, ref) => {
17
17
  const { isActive, isSmaller, isSmall, className, ...rest } = props;
18
- return React.createElement(index_js_1.Box, {
19
- as: 'button',
20
- type: 'button',
18
+ return React.createElement(index_js_1.ButtonBase, {
21
19
  role: 'tab',
22
20
  tabIndex: -1,
23
21
  className: (0, classnames_1.default)(
@@ -9,18 +9,20 @@ import type { PolymorphicForwardRefComponent } from '../utils/index.js';
9
9
  export declare const CarouselNavigation: PolymorphicForwardRefComponent<"nav", {}> & {
10
10
  PreviousButton: PolymorphicForwardRefComponent<"button", Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
11
11
  ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
12
- }, "label" | "as" | "size" | "styleType" | "isActive"> & {
12
+ }, "label" | "as" | "size" | "htmlDisabled" | "styleType" | "isActive" | "iconProps"> & {
13
13
  isActive?: boolean | undefined;
14
14
  label?: React.ReactNode;
15
- } & Omit<import("../Buttons/Button/Button.js").ButtonProps, "startIcon" | "endIcon"> & {
15
+ iconProps?: React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement> | undefined;
16
+ } & Omit<import("../Buttons/Button/Button.js").ButtonProps, "startIcon" | "endIcon" | "labelProps" | "startIconProps" | "endIconProps"> & {
16
17
  as?: "button" | undefined;
17
18
  }>;
18
19
  NextButton: PolymorphicForwardRefComponent<"button", Omit<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
19
20
  ref?: ((instance: HTMLButtonElement | null) => void) | React.RefObject<HTMLButtonElement> | null | undefined;
20
- }, "label" | "as" | "size" | "styleType" | "isActive"> & {
21
+ }, "label" | "as" | "size" | "htmlDisabled" | "styleType" | "isActive" | "iconProps"> & {
21
22
  isActive?: boolean | undefined;
22
23
  label?: React.ReactNode;
23
- } & Omit<import("../Buttons/Button/Button.js").ButtonProps, "startIcon" | "endIcon"> & {
24
+ iconProps?: React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement> | undefined;
25
+ } & Omit<import("../Buttons/Button/Button.js").ButtonProps, "startIcon" | "endIcon" | "labelProps" | "startIconProps" | "endIconProps"> & {
24
26
  as?: "button" | undefined;
25
27
  }>;
26
28
  };
@@ -254,7 +254,8 @@ exports.ColorBuilder = React.forwardRef((props, ref) => {
254
254
  React.createElement(index_js_1.Box, {
255
255
  className: 'iui-color-dot',
256
256
  style: {
257
- '--iui-color-dot-inset': `${squareTop.toString()}% auto auto ${squareLeft.toString()}%`,
257
+ '--iui-color-dot-inset-block': `${squareTop.toString()}% auto`,
258
+ '--iui-color-dot-inset-inline': `${squareLeft.toString()}% auto`,
258
259
  },
259
260
  onPointerDown: () => {
260
261
  setColorDotActive(true);
@@ -195,7 +195,7 @@ exports.ComboBoxInput = React.forwardRef((props, forwardedRef) => {
195
195
  spellCheck: false,
196
196
  autoCapitalize: 'none',
197
197
  autoCorrect: 'off',
198
- style: multiple ? { paddingLeft: tagContainerWidth + 18 } : {},
198
+ style: multiple ? { paddingInlineStart: tagContainerWidth + 18 } : {},
199
199
  'aria-describedby': multiple ? `${id}-selected-live` : undefined,
200
200
  ...rest,
201
201
  }),
@@ -48,11 +48,11 @@ const VirtualizedComboBoxMenu = React.forwardRef(
48
48
  scrollToIndex: focusedVisibleIndex,
49
49
  });
50
50
  const surfaceStyles = {
51
- minWidth,
51
+ minInlineSize: minWidth,
52
52
  // set as constant because we don't want it shifting when items are unmounted
53
- maxWidth: minWidth,
53
+ maxInlineSize: minWidth,
54
54
  // max-height must be on the outermost element for virtual scroll
55
- maxHeight: 'calc((var(--iui-component-height) - 1px) * 8.5)',
55
+ maxBlockSize: 'calc((var(--iui-component-height) - 1px) * 8.5)',
56
56
  overflowY: isOverflowOverlaySupported() ? 'overlay' : 'auto',
57
57
  ...style,
58
58
  };
@@ -94,8 +94,8 @@ exports.ComboBoxMenu = React.forwardRef((props, forwardedRef) => {
94
94
  const refs = (0, index_js_3.useMergedRefs)(menuRef, forwardedRef);
95
95
  const styles = React.useMemo(
96
96
  () => ({
97
- minWidth,
98
- maxWidth: `min(${minWidth * 2}px, 90vw)`,
97
+ minInlineSize: minWidth,
98
+ maxInlineSize: `min(${minWidth * 2}px, 90vw)`,
99
99
  }),
100
100
  [minWidth],
101
101
  );
@@ -407,6 +407,7 @@ exports.DatePicker = React.forwardRef((props, forwardedRef) => {
407
407
  }
408
408
  return dayClass;
409
409
  };
410
+ const dateTableId = (0, index_js_1.useId)();
410
411
  return React.createElement(
411
412
  index_js_1.Box,
412
413
  {
@@ -449,6 +450,7 @@ exports.DatePicker = React.forwardRef((props, forwardedRef) => {
449
450
  {
450
451
  as: 'span',
451
452
  className: 'iui-calendar-month',
453
+ id: dateTableId,
452
454
  title: monthNames[displayedMonthIndex],
453
455
  },
454
456
  monthNames[displayedMonthIndex],
@@ -487,7 +489,11 @@ exports.DatePicker = React.forwardRef((props, forwardedRef) => {
487
489
  ),
488
490
  React.createElement(
489
491
  'div',
490
- { onKeyDown: handleCalendarKeyDown, role: 'listbox' },
492
+ {
493
+ onKeyDown: handleCalendarKeyDown,
494
+ role: 'listbox',
495
+ 'aria-labelledby': dateTableId,
496
+ },
491
497
  weeks.map((weekDays, weekIndex) => {
492
498
  return React.createElement(
493
499
  index_js_1.Box,
@@ -41,8 +41,7 @@ const DialogComponent = React.forwardRef((props, ref) => {
41
41
  typeof portal !== 'boolean'
42
42
  ? portal.to
43
43
  : portal
44
- ? context?.portalContainerRef?.current ??
45
- (0, index_js_1.getDocument)()?.body
44
+ ? context?.portalContainer || (0, index_js_1.getDocument)()?.body
46
45
  : null;
47
46
  const dialog = React.createElement(index_js_1.Box, {
48
47
  className: (0, classnames_1.default)('iui-dialog-wrapper', className),
@@ -122,10 +122,10 @@ exports.DialogMain = React.forwardRef((props, ref) => {
122
122
  );
123
123
  setStyle((oldStyle) => ({
124
124
  ...oldStyle,
125
- width: rect?.width,
126
- height: rect?.height,
127
- left: dialogRef.current?.offsetLeft,
128
- top: dialogRef.current?.offsetTop,
125
+ inlineSize: rect?.width,
126
+ blockSize: rect?.height,
127
+ insetInlineStart: dialogRef.current?.offsetLeft,
128
+ insetBlockStart: dialogRef.current?.offsetTop,
129
129
  transform: `translate(${translateX}px,${translateY}px)`,
130
130
  }));
131
131
  }, [isDraggable, isOpen]);
@@ -167,7 +167,7 @@ exports.DialogMain = React.forwardRef((props, ref) => {
167
167
  onResizeStart: () => {
168
168
  if (!hasBeenResized.current) {
169
169
  hasBeenResized.current = true;
170
- setResizeStyle({ maxWidth: '100%' });
170
+ setResizeStyle({ maxInlineSize: '100%' });
171
171
  }
172
172
  },
173
173
  onResizeEnd: setResizeStyle,
@@ -68,10 +68,8 @@ const ExpandableBlockHeader = React.forwardRef((props, forwardedRef) => {
68
68
  const { isExpanded, setExpanded, disabled, onToggle } = (0,
69
69
  index_js_1.useSafeContext)(ExpandableBlockContext);
70
70
  return React.createElement(
71
- index_js_1.Box,
71
+ index_js_1.ButtonBase,
72
72
  {
73
- as: 'button',
74
- type: 'button',
75
73
  className: (0, classnames_1.default)('iui-expandable-header', className),
76
74
  'aria-expanded': isExpanded,
77
75
  'aria-disabled': disabled,
@@ -15,6 +15,10 @@ type FileUploadProps = {
15
15
  * Either pass `FileUploadCard` (for default state) or a different component to wrap.
16
16
  */
17
17
  children: React.ReactNode;
18
+ /**
19
+ * Allows for custom prop to be passed for content.
20
+ */
21
+ contentProps?: React.ComponentProps<'div'>;
18
22
  };
19
23
  /**
20
24
  * File upload component to be wrapped around `FileUploadCard` or any arbitrary component.