@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
@@ -17,7 +17,14 @@ const index_js_1 = require('../utils/index.js');
17
17
  * <FileUpload dragContent='Drop file here' onFileDropped={console.log}><Textarea /></FileUpload>
18
18
  */
19
19
  exports.FileUpload = React.forwardRef((props, ref) => {
20
- const { dragContent, children, onFileDropped, className, ...rest } = props;
20
+ const {
21
+ dragContent,
22
+ children,
23
+ onFileDropped,
24
+ className,
25
+ contentProps,
26
+ ...rest
27
+ } = props;
21
28
  const [isDragActive, setIsDragActive] = React.useState(false);
22
29
  const fileUploadRef = React.useRef(null);
23
30
  const refs = (0, index_js_1.useMergedRefs)(fileUploadRef, ref);
@@ -68,13 +75,27 @@ exports.FileUpload = React.forwardRef((props, ref) => {
68
75
  ? children
69
76
  : React.createElement(
70
77
  index_js_1.Box,
71
- { className: 'iui-content' },
78
+ {
79
+ as: 'div',
80
+ ...contentProps,
81
+ className: (0, classnames_1.default)(
82
+ 'iui-content',
83
+ contentProps?.className,
84
+ ),
85
+ },
72
86
  children,
73
87
  ),
74
88
  dragContent &&
75
89
  React.createElement(
76
90
  index_js_1.Box,
77
- { className: 'iui-content' },
91
+ {
92
+ as: 'div',
93
+ ...contentProps,
94
+ className: (0, classnames_1.default)(
95
+ 'iui-content',
96
+ contentProps?.className,
97
+ ),
98
+ },
78
99
  dragContent,
79
100
  ),
80
101
  );
@@ -10,31 +10,18 @@ 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
12
  exports.HeaderBasicButton = React.forwardRef((props, ref) => {
13
- const {
14
- onClick,
15
- className,
16
- children,
17
- style,
18
- startIcon,
19
- endIcon,
20
- styleType,
21
- size,
22
- ...rest
23
- } = props;
13
+ const { className, children, startIcon, endIcon, styleType, size, ...rest } =
14
+ props;
24
15
  styleType; // To omit and prevent eslint error.
25
16
  size; // To omit and prevent eslint error.
26
17
  return React.createElement(
27
- index_js_1.Box,
18
+ index_js_1.ButtonBase,
28
19
  {
29
- as: 'button',
30
20
  className: (0, classnames_1.default)(
31
21
  'iui-header-breadcrumb-button',
32
22
  className,
33
23
  ),
34
- onClick: onClick,
35
24
  ref: ref,
36
- type: 'button',
37
- style: style,
38
25
  ...rest,
39
26
  },
40
27
  startIcon,
@@ -26,7 +26,7 @@ exports.HeaderDropdownButton = React.forwardRef((props, ref) => {
26
26
  index_js_1.DropdownMenu,
27
27
  {
28
28
  menuItems: menuItems,
29
- style: { minWidth: menuWidth },
29
+ style: { minInlineSize: menuWidth },
30
30
  onShow: () => setIsMenuOpen(true),
31
31
  onHide: () => setIsMenuOpen(false),
32
32
  },
@@ -47,15 +47,13 @@ exports.HeaderSplitButton = React.forwardRef((props, forwardedRef) => {
47
47
  {
48
48
  placement: menuPlacement,
49
49
  menuItems: menuItems,
50
- style: { minWidth: menuWidth },
50
+ style: { minInlineSize: menuWidth },
51
51
  onShow: React.useCallback(() => setIsMenuOpen(true), []),
52
52
  onHide: React.useCallback(() => setIsMenuOpen(false), []),
53
53
  },
54
54
  React.createElement(
55
- index_js_2.Box,
55
+ index_js_2.ButtonBase,
56
56
  {
57
- as: 'button',
58
- type: 'button',
59
57
  className:
60
58
  'iui-header-breadcrumb-button iui-header-breadcrumb-button-split',
61
59
  disabled: disabled,
@@ -24,6 +24,10 @@ type ProgressLinearProps = {
24
24
  * Status of progress.
25
25
  */
26
26
  status?: 'positive' | 'negative';
27
+ /**
28
+ * Pass props to ProgressLinear label group.
29
+ */
30
+ labelGroupProps?: React.ComponentProps<'div'>;
27
31
  };
28
32
  /**
29
33
  * Shows progress on a linear bar
@@ -32,6 +32,7 @@ exports.ProgressLinear = React.forwardRef((props, forwardedRef) => {
32
32
  isAnimated = false,
33
33
  status,
34
34
  className,
35
+ labelGroupProps,
35
36
  ...rest
36
37
  } = props;
37
38
  const boundedValue = (0, index_js_1.getBoundedValue)(value ?? 100, 0, 100);
@@ -54,7 +55,14 @@ exports.ProgressLinear = React.forwardRef((props, forwardedRef) => {
54
55
  labels.length > 0 &&
55
56
  React.createElement(
56
57
  index_js_1.Box,
57
- { className: 'iui-progress-indicator-linear-label' },
58
+ {
59
+ as: 'div',
60
+ ...labelGroupProps,
61
+ className: (0, classnames_1.default)(
62
+ 'iui-progress-indicator-linear-label',
63
+ labelGroupProps?.className,
64
+ ),
65
+ },
58
66
  labels.map((label, index) =>
59
67
  React.createElement('span', { key: index }, label),
60
68
  ),
@@ -214,8 +214,8 @@ const Select = (props) => {
214
214
  role: 'listbox',
215
215
  className: (0, classnames_1.default)('iui-scroll', menuClassName),
216
216
  style: {
217
- minWidth,
218
- maxWidth: `min(${minWidth * 2}px, 90vw)`,
217
+ minInlineSize: minWidth,
218
+ maxInlineSize: `min(${minWidth * 2}px, 90vw)`,
219
219
  ...menuStyle,
220
220
  },
221
221
  id: `${uid}-menu`,
@@ -48,6 +48,22 @@ type SideNavigationProps = {
48
48
  * @default false
49
49
  */
50
50
  isSubmenuOpen?: boolean;
51
+ /**
52
+ * Passes props for SideNav wrapper.
53
+ */
54
+ wrapperProps?: React.ComponentProps<'div'>;
55
+ /**
56
+ * Passes props for SideNav content.
57
+ */
58
+ contentProps?: React.ComponentProps<'div'>;
59
+ /**
60
+ * Passes props for SideNav top.
61
+ */
62
+ topProps?: React.ComponentProps<'div'>;
63
+ /**
64
+ * Passes props for SideNav bottom.
65
+ */
66
+ bottomProps?: React.ComponentProps<'div'>;
51
67
  };
52
68
  /**
53
69
  * Left side navigation menu component.
@@ -35,6 +35,10 @@ exports.SideNavigation = React.forwardRef((props, forwardedRef) => {
35
35
  onExpanderClick,
36
36
  submenu,
37
37
  isSubmenuOpen = false,
38
+ wrapperProps,
39
+ contentProps,
40
+ topProps,
41
+ bottomProps,
38
42
  ...rest
39
43
  } = props;
40
44
  const [_isExpanded, _setIsExpanded] = React.useState(isExpanded);
@@ -55,28 +59,48 @@ exports.SideNavigation = React.forwardRef((props, forwardedRef) => {
55
59
  return React.createElement(
56
60
  index_js_1.Box,
57
61
  {
62
+ ...wrapperProps,
58
63
  className: (0, classnames_1.default)(
59
64
  'iui-side-navigation-wrapper',
60
- className,
65
+ wrapperProps?.className,
61
66
  ),
62
67
  ref: forwardedRef,
63
- ...rest,
64
68
  },
65
69
  React.createElement(
66
70
  index_js_1.Box,
67
71
  {
68
- className: (0, classnames_1.default)('iui-side-navigation', {
69
- 'iui-expanded': _isExpanded,
70
- 'iui-collapsed': !_isExpanded,
71
- }),
72
+ as: 'div',
73
+ className: (0, classnames_1.default)(
74
+ 'iui-side-navigation',
75
+ {
76
+ 'iui-expanded': _isExpanded,
77
+ 'iui-collapsed': !_isExpanded,
78
+ },
79
+ className,
80
+ ),
81
+ ...rest,
72
82
  },
73
83
  expanderPlacement === 'top' && ExpandButton,
74
84
  React.createElement(
75
85
  index_js_1.Box,
76
- { className: 'iui-sidenav-content' },
86
+ {
87
+ as: 'div',
88
+ ...contentProps,
89
+ className: (0, classnames_1.default)(
90
+ 'iui-sidenav-content',
91
+ contentProps?.className,
92
+ ),
93
+ },
77
94
  React.createElement(
78
95
  index_js_1.Box,
79
- { className: 'iui-top' },
96
+ {
97
+ as: 'div',
98
+ ...topProps,
99
+ className: (0, classnames_1.default)(
100
+ 'iui-top',
101
+ topProps?.className,
102
+ ),
103
+ },
80
104
  items.map((sidenavButton, index) =>
81
105
  !_isExpanded
82
106
  ? React.createElement(
@@ -93,7 +117,14 @@ exports.SideNavigation = React.forwardRef((props, forwardedRef) => {
93
117
  ),
94
118
  React.createElement(
95
119
  index_js_1.Box,
96
- { className: 'iui-bottom' },
120
+ {
121
+ as: 'div',
122
+ ...bottomProps,
123
+ className: (0, classnames_1.default)(
124
+ 'iui-bottom',
125
+ bottomProps?.className,
126
+ ),
127
+ },
97
128
  secondaryItems?.map((sidenavButton, index) =>
98
129
  !_isExpanded
99
130
  ? React.createElement(
@@ -68,6 +68,30 @@ export type SliderProps = {
68
68
  * Additional props for container `<div>` that hold the slider rail, thumbs, and tracks.
69
69
  */
70
70
  railContainerProps?: React.HTMLAttributes<HTMLDivElement>;
71
+ /**
72
+ * Allows props to be passed for slider-min
73
+ */
74
+ minProps?: React.ComponentProps<'span'>;
75
+ /**
76
+ * Allows props to be passed for slider-max
77
+ */
78
+ maxProps?: React.ComponentProps<'span'>;
79
+ /**
80
+ * Allows props to be passed for slider-rail
81
+ */
82
+ railProps?: React.ComponentProps<'div'>;
83
+ /**
84
+ * Allows props to be passed for slider-track
85
+ */
86
+ trackProps?: React.ComponentProps<'div'>;
87
+ /**
88
+ * Allows props to be passed for slider-tick
89
+ */
90
+ tickProps?: React.ComponentProps<'span'>;
91
+ /**
92
+ * Allows props to be passed for slider-ticks
93
+ */
94
+ ticksProps?: React.ComponentProps<'div'>;
71
95
  /**
72
96
  * Defines the allowed behavior when moving Thumbs when multiple Thumbs are
73
97
  * shown. It controls if a Thumb movement should be limited to only move in
@@ -91,6 +91,12 @@ exports.Slider = React.forwardRef((props, ref) => {
91
91
  thumbProps,
92
92
  className,
93
93
  railContainerProps,
94
+ minProps,
95
+ maxProps,
96
+ railProps,
97
+ trackProps,
98
+ tickProps,
99
+ ticksProps,
94
100
  orientation = 'horizontal',
95
101
  ...rest
96
102
  } = props;
@@ -283,18 +289,33 @@ exports.Slider = React.forwardRef((props, ref) => {
283
289
  if (Array.isArray(tickLabels)) {
284
290
  return React.createElement(
285
291
  index_js_1.Box,
286
- { className: 'iui-slider-ticks' },
292
+ {
293
+ as: 'div',
294
+ ...ticksProps,
295
+ className: (0, classnames_1.default)(
296
+ 'iui-slider-ticks',
297
+ ticksProps?.className,
298
+ ),
299
+ },
287
300
  tickLabels.map((label, index) =>
288
301
  React.createElement(
289
302
  index_js_1.Box,
290
- { as: 'span', key: index, className: 'iui-slider-tick' },
303
+ {
304
+ as: 'span',
305
+ ...tickProps,
306
+ key: index,
307
+ className: (0, classnames_1.default)(
308
+ 'iui-slider-tick',
309
+ tickProps?.className,
310
+ ),
311
+ },
291
312
  label,
292
313
  ),
293
314
  ),
294
315
  );
295
316
  }
296
317
  return tickLabels;
297
- }, [tickLabels]);
318
+ }, [tickLabels, tickProps, ticksProps]);
298
319
  const generateTooltipProps = React.useCallback(
299
320
  (index, val) => {
300
321
  const outProps = tooltipProps ? tooltipProps(index, val, step) : {};
@@ -322,20 +343,39 @@ exports.Slider = React.forwardRef((props, ref) => {
322
343
  minValueLabel &&
323
344
  React.createElement(
324
345
  index_js_1.Box,
325
- { as: 'span', className: 'iui-slider-min' },
346
+ {
347
+ as: 'span',
348
+ ...minProps,
349
+ className: (0, classnames_1.default)(
350
+ 'iui-slider-min',
351
+ minProps?.className,
352
+ ),
353
+ },
326
354
  minValueLabel,
327
355
  ),
328
356
  React.createElement(
329
357
  index_js_1.Box,
330
358
  {
359
+ as: 'div',
331
360
  ref: containerRef,
332
- className: (0, classnames_1.default)('iui-slider-container', {
333
- 'iui-grabbing': undefined !== activeThumbIndex,
334
- }),
335
- onPointerDown: handlePointerDownOnSlider,
336
361
  ...railContainerProps,
362
+ className: (0, classnames_1.default)(
363
+ 'iui-slider-container',
364
+ {
365
+ 'iui-grabbing': undefined !== activeThumbIndex,
366
+ },
367
+ railContainerProps?.className,
368
+ ),
369
+ onPointerDown: handlePointerDownOnSlider,
337
370
  },
338
- React.createElement(index_js_1.Box, { className: 'iui-slider-rail' }),
371
+ React.createElement(index_js_1.Box, {
372
+ as: 'div',
373
+ ...railProps,
374
+ className: (0, classnames_1.default)(
375
+ 'iui-slider-rail',
376
+ railProps?.className,
377
+ ),
378
+ }),
339
379
  currentValues.map((thumbValue, index) => {
340
380
  const [minVal, maxVal] = getAllowableThumbRange(index);
341
381
  const thisThumbProps = thumbProps?.(index);
@@ -363,13 +403,21 @@ exports.Slider = React.forwardRef((props, ref) => {
363
403
  sliderMax: max,
364
404
  values: currentValues,
365
405
  orientation: orientation,
406
+ ...trackProps,
366
407
  }),
367
408
  tickMarkArea,
368
409
  ),
369
410
  maxValueLabel &&
370
411
  React.createElement(
371
412
  index_js_1.Box,
372
- { as: 'span', className: 'iui-slider-max' },
413
+ {
414
+ as: 'span',
415
+ ...maxProps,
416
+ className: (0, classnames_1.default)(
417
+ 'iui-slider-max',
418
+ maxProps?.className,
419
+ ),
420
+ },
373
421
  maxValueLabel,
374
422
  ),
375
423
  );
@@ -101,8 +101,8 @@ const Thumb = (props) => {
101
101
  style: {
102
102
  ...style,
103
103
  ...(orientation === 'horizontal'
104
- ? { left: `${lowPercent}%` }
105
- : { bottom: `${lowPercent}%` }),
104
+ ? { insetInlineStart: `${lowPercent}%` }
105
+ : { insetBlockEnd: `${lowPercent}%` }),
106
106
  },
107
107
  className: (0, classnames_1.default)(
108
108
  'iui-slider-thumb',
@@ -6,7 +6,7 @@ export type TrackProps = {
6
6
  sliderMax: number;
7
7
  values: number[];
8
8
  orientation: SliderProps['orientation'];
9
- };
9
+ } & React.HTMLAttributes<HTMLDivElement>;
10
10
  /**
11
11
  * Track displays color segments above Rail. Which, if any, segments that are
12
12
  * colorized is based on `trackDisplayMode`.
@@ -7,6 +7,7 @@ const tslib_1 = require('tslib');
7
7
  * See LICENSE.md in the project root for license terms and full copyright notice.
8
8
  *--------------------------------------------------------------------------------------------*/
9
9
  const React = tslib_1.__importStar(require('react'));
10
+ const classnames_1 = tslib_1.__importDefault(require('classnames'));
10
11
  const index_js_1 = require('../utils/index.js');
11
12
  function shouldDisplaySegment(segmentIndex, mode) {
12
13
  if ('odd-segments' === mode && 0 === (segmentIndex + 1) % 2) {
@@ -41,7 +42,14 @@ function generateSegments(values, min, max) {
41
42
  * colorized is based on `trackDisplayMode`.
42
43
  */
43
44
  const Track = (props) => {
44
- const { trackDisplayMode, sliderMin, sliderMax, values, orientation } = props;
45
+ const {
46
+ className,
47
+ trackDisplayMode,
48
+ sliderMin,
49
+ sliderMax,
50
+ values,
51
+ orientation,
52
+ } = props;
45
53
  const [segments, setSegments] = React.useState(() =>
46
54
  generateSegments(values, sliderMin, sliderMax),
47
55
  );
@@ -67,16 +75,19 @@ const Track = (props) => {
67
75
  { key: index },
68
76
  shouldDisplaySegment(index, trackDisplayMode)
69
77
  ? React.createElement(index_js_1.Box, {
70
- className: 'iui-slider-track',
78
+ className: (0, classnames_1.default)(
79
+ 'iui-slider-track',
80
+ className,
81
+ ),
71
82
  style: {
72
83
  ...(orientation === 'horizontal'
73
84
  ? {
74
- left: `${lowPercent}%`,
75
- right: `${highPercent}%`,
85
+ insetInlineStart: `${lowPercent}%`,
86
+ insetInlineEnd: `${highPercent}%`,
76
87
  }
77
88
  : {
78
- top: `${highPercent}%`,
79
- bottom: `${lowPercent}%`,
89
+ insetBlockStart: `${highPercent}%`,
90
+ insetBlockEnd: `${lowPercent}%`,
80
91
  }),
81
92
  },
82
93
  })
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import type { PolymorphicForwardRefComponent } from '../utils/index.js';
2
3
  export type StepperLocalization = {
3
4
  stepsCountLabel: (currentStep: number, totalSteps: number) => string;
@@ -11,7 +12,7 @@ export type StepProperties = {
11
12
  * A tooltip giving detailed description to this step.
12
13
  */
13
14
  description?: string;
14
- };
15
+ } & React.ComponentProps<'li'>;
15
16
  export type StepperProps = {
16
17
  /**
17
18
  * Current step index, 0 - based.
@@ -34,6 +35,30 @@ export type StepperProps = {
34
35
  * Click handler on completed step.
35
36
  */
36
37
  onStepClick?: (clickedIndex: number) => void;
38
+ /**
39
+ * Callback that can provide additional props for `<li>` representing a step.
40
+ */
41
+ stepProps?: (index: number) => React.ComponentProps<'li'>;
42
+ /**
43
+ * Allows props to be passed for track content.
44
+ */
45
+ trackContentProps?: (index: number) => React.ComponentProps<'div'>;
46
+ /**
47
+ * Allows props to be passed for circle.
48
+ */
49
+ circleProps?: (index: number) => React.ComponentProps<'span'>;
50
+ /**
51
+ * Allows props to be passed for name.
52
+ */
53
+ nameProps?: (index: number) => React.ComponentProps<'span'>;
54
+ /**
55
+ * Allows props to be passed for label.
56
+ */
57
+ labelProps?: React.ComponentProps<'div'>;
58
+ /**
59
+ * Allows props to be passed for label count.
60
+ */
61
+ labelCountProps?: React.ComponentProps<'span'>;
37
62
  };
38
63
  export declare const Stepper: PolymorphicForwardRefComponent<"div", StepperProps>;
39
64
  export default Stepper;
@@ -6,6 +6,7 @@ const tslib_1 = require('tslib');
6
6
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
7
7
  * See LICENSE.md in the project root for license terms and full copyright notice.
8
8
  *--------------------------------------------------------------------------------------------*/
9
+ const classnames_1 = tslib_1.__importDefault(require('classnames'));
9
10
  const React = tslib_1.__importStar(require('react'));
10
11
  const index_js_1 = require('../utils/index.js');
11
12
  const StepperStep_js_1 = require('./StepperStep.js');
@@ -20,6 +21,12 @@ exports.Stepper = React.forwardRef((props, ref) => {
20
21
  type = 'default',
21
22
  localization = defaultStepperLocalization,
22
23
  onStepClick,
24
+ stepProps,
25
+ trackContentProps,
26
+ circleProps,
27
+ nameProps,
28
+ labelProps,
29
+ labelCountProps,
23
30
  ...rest
24
31
  } = props;
25
32
  const boundedCurrentStep = Math.min(
@@ -32,8 +39,16 @@ exports.Stepper = React.forwardRef((props, ref) => {
32
39
  React.createElement(
33
40
  'ol',
34
41
  null,
35
- steps.map((s, index) =>
36
- React.createElement(StepperStep_js_1.StepperStep, {
42
+ steps.map((s, index) => {
43
+ const thisStepProps = stepProps?.(index);
44
+ const thisTrackContentProps = trackContentProps?.(index);
45
+ const thisCircleProps = circleProps?.(index);
46
+ const thisNameProps = nameProps?.(index);
47
+ return React.createElement(StepperStep_js_1.StepperStep, {
48
+ stepProps: thisStepProps,
49
+ trackContentProps: thisTrackContentProps,
50
+ circleProps: thisCircleProps,
51
+ nameProps: thisNameProps,
37
52
  key: index,
38
53
  index: index,
39
54
  title: type === 'long' ? '' : s.name,
@@ -42,16 +57,30 @@ exports.Stepper = React.forwardRef((props, ref) => {
42
57
  type: type,
43
58
  onClick: onStepClick,
44
59
  description: s.description,
45
- }),
46
- ),
60
+ });
61
+ }),
47
62
  ),
48
63
  type === 'long' &&
49
64
  React.createElement(
50
65
  index_js_1.Box,
51
- { className: 'iui-stepper-steps-label' },
66
+ {
67
+ as: 'div',
68
+ ...labelProps,
69
+ className: (0, classnames_1.default)(
70
+ 'iui-stepper-steps-label',
71
+ labelProps?.className,
72
+ ),
73
+ },
52
74
  React.createElement(
53
75
  index_js_1.Box,
54
- { as: 'span', className: 'iui-stepper-steps-label-count' },
76
+ {
77
+ as: 'span',
78
+ ...labelCountProps,
79
+ className: (0, classnames_1.default)(
80
+ 'iui-stepper-steps-label-count',
81
+ labelCountProps?.className,
82
+ ),
83
+ },
55
84
  localization.stepsCountLabel(boundedCurrentStep + 1, steps.length),
56
85
  ),
57
86
  steps[boundedCurrentStep].name,
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  import type { PolymorphicForwardRefComponent } from '../utils/index.js';
2
3
  export type StepperStepProps = {
3
4
  /**
@@ -28,5 +29,21 @@ export type StepperStepProps = {
28
29
  * A tooltip giving detailed description to this step.
29
30
  */
30
31
  description?: string;
32
+ /**
33
+ * Allows props to be passed for stepper step.
34
+ */
35
+ stepProps?: React.ComponentProps<'li'>;
36
+ /**
37
+ * Allows props to be passed for track content.
38
+ */
39
+ trackContentProps?: React.ComponentProps<'div'>;
40
+ /**
41
+ * Allows props to be passed for stepper-step circle.
42
+ */
43
+ circleProps?: React.ComponentProps<'span'>;
44
+ /**
45
+ * Allows props to be passed for stepper name.
46
+ */
47
+ nameProps?: React.ComponentProps<'span'>;
31
48
  };
32
49
  export declare const StepperStep: PolymorphicForwardRefComponent<"li", StepperStepProps>;