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

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 (36) hide show
  1. package/CHANGELOG.md +53 -1
  2. package/cjs/core/Buttons/DropdownButton/DropdownButton.d.ts +1 -1
  3. package/cjs/core/Dialog/DialogContent.d.ts +2 -1
  4. package/cjs/core/Dialog/DialogContent.js +25 -1
  5. package/cjs/core/Dialog/DialogMain.js +0 -1
  6. package/cjs/core/Header/HeaderButton.d.ts +4 -0
  7. package/cjs/core/Header/HeaderButton.js +2 -0
  8. package/cjs/core/Input/Input.d.ts +5 -0
  9. package/cjs/core/Input/Input.js +2 -1
  10. package/cjs/core/Radio/Radio.d.ts +8 -0
  11. package/cjs/core/Radio/Radio.js +22 -9
  12. package/cjs/core/RadioTiles/RadioTile.d.ts +16 -0
  13. package/cjs/core/RadioTiles/RadioTile.js +61 -27
  14. package/cjs/core/Table/Table.d.ts +16 -0
  15. package/cjs/core/Table/Table.js +50 -8
  16. package/cjs/core/utils/components/Resizer.js +21 -13
  17. package/cjs/styles.js +3 -4
  18. package/esm/core/Buttons/DropdownButton/DropdownButton.d.ts +1 -1
  19. package/esm/core/Dialog/DialogContent.d.ts +2 -1
  20. package/esm/core/Dialog/DialogContent.js +25 -2
  21. package/esm/core/Dialog/DialogMain.js +0 -1
  22. package/esm/core/Header/HeaderButton.d.ts +4 -0
  23. package/esm/core/Header/HeaderButton.js +2 -0
  24. package/esm/core/Input/Input.d.ts +5 -0
  25. package/esm/core/Input/Input.js +2 -1
  26. package/esm/core/Radio/Radio.d.ts +8 -0
  27. package/esm/core/Radio/Radio.js +19 -6
  28. package/esm/core/RadioTiles/RadioTile.d.ts +16 -0
  29. package/esm/core/RadioTiles/RadioTile.js +52 -22
  30. package/esm/core/Table/Table.d.ts +16 -0
  31. package/esm/core/Table/Table.js +47 -8
  32. package/esm/core/utils/components/Resizer.js +21 -13
  33. package/esm/core/utils/functions/import.js +2 -1
  34. package/esm/styles.js +3 -4
  35. package/package.json +2 -2
  36. package/styles.css +719 -1562
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.0.0-dev.6
4
+
5
+ ### Major Changes
6
+
7
+ - [#1409](https://github.com/iTwin/iTwinUI/pull/1409): `RadioTile`'s `className` and `style` props will now be applied on the `<input>` element instead of the wrapper. Added `wrapperProps`, `iconProps`, `labelProps`, `subLabelProps` to individually customize each part of the component.
8
+
9
+ ### Minor Changes
10
+
11
+ - [#1457](https://github.com/iTwin/iTwinUI/pull/1457): Added `htmlName` prop to the `HeaderButton` subcomponent which handles the native `name` attribute in `<button>`.
12
+ - [#1437](https://github.com/iTwin/iTwinUI/pull/1437): Added headerWrapperProps, headerProps, bodyProps, and emptyTableContentProps to make each part of the Table component more customizable.
13
+ - [#1412](https://github.com/iTwin/iTwinUI/pull/1412): All styles have been wrapped inside a cascade layer named `itwinui`.
14
+ - [#1419](https://github.com/iTwin/iTwinUI/pull/1419): Added `htmlSize` prop to the `Input` component which handles the native `size` attribute in `<input>`.
15
+
16
+ ### Patch Changes
17
+
18
+ - [#1420](https://github.com/iTwin/iTwinUI/pull/1420): RadioTile DOM has been simplified to remove a content wrapper `div`.
19
+
3
20
  ## 3.0.0-dev.5
4
21
 
5
22
  ### Major Changes
@@ -103,6 +120,41 @@
103
120
  - Updated dependencies:
104
121
  - @itwin/itwinui-css@2.0.0-dev.0
105
122
 
123
+ ## 2.12.0
124
+
125
+ ### Minor Changes
126
+
127
+ - [#1415](https://github.com/iTwin/iTwinUI/pull/1415): The styling strategy has changed so there will now be a single stylesheet included at runtime, instead of separate css imports inside every component. All the styles are also wrapped in a cascade layer named `itwinui`. This behavior can be customized using the `includeCss` prop in `ThemeProvider`.
128
+
129
+ **Important note**: The dependencies on `@itwin/itwinui-css` and `@itwin/itwinui-variables` have been removed, so these packages _don't_ need to be installed if you are only using components from `@itwin/itwinui-react`.
130
+
131
+ - [#1422](https://github.com/iTwin/iTwinUI/pull/1422): Changed `all: revert` to `all: revert-layer` so that only styles from the v1 layer are reverted, thus avoiding issues with inadvertently removing browser default styles.
132
+ - [#1443](https://github.com/iTwin/iTwinUI/pull/1443): `DropdownButton` now supports `styleType='high-visibility'` to make it blue. This should be used sparingly, as a default or borderless dropdown button is the better choice in most cases.
133
+ - [#1454](https://github.com/iTwin/iTwinUI/pull/1454): Added `disabled` prop to `ExpandableBlock` to disable intersction with it.
134
+ - [#1441](https://github.com/iTwin/iTwinUI/pull/1441): Added `placement` prop to `Dialog` to allow placing it at one of the corners.
135
+
136
+ ## 2.11.11
137
+
138
+ ### Patch Changes
139
+
140
+ - [#1448](https://github.com/iTwin/iTwinUI/pull/1448): Fix resizable Dialog bug where Dialog jumped around the screen when resized on right side.
141
+
142
+ ## 2.11.10
143
+
144
+ ### Patch Changes
145
+
146
+ - [#1424](https://github.com/iTwin/iTwinUI/pull/1424), [#1427](https://github.com/iTwin/iTwinUI/pull/1427): Fixed a few different resizing issues in Dialog.
147
+ - Updated dependencies:
148
+ - @itwin/itwinui-css@1.11.5
149
+
150
+ ## 2.11.9
151
+
152
+ ### Patch Changes
153
+
154
+ - [#1421](https://github.com/iTwin/iTwinUI/pull/1421): Fixed an issue in Table where column reordering and editable cells were not working when v2 Table was used within a v1 app.
155
+ - Updated dependencies:
156
+ - @itwin/itwinui-css@1.11.4
157
+
106
158
  ## 2.11.8
107
159
 
108
160
  ### Patch Changes
@@ -636,4 +688,4 @@ If you're interested in more details about every signle change, check out a full
636
688
 
637
689
  ## 1.X
638
690
 
639
- For any changes prior to 2.0.0, check out the [1.X changelog](https://github.com/iTwin/iTwinUI-react/blob/v1/packages/iTwinUI-react/CHANGELOG.md).
691
+ For any changes prior to 2.0.0, check out the [1.X changelog](https://github.com/iTwin/iTwinUI/blob/legacy/v1-react/packages/iTwinUI-react/CHANGELOG.md).
@@ -14,7 +14,7 @@ export type DropdownButtonProps = {
14
14
  * Use 'borderless' to hide outline.
15
15
  * @default 'default'
16
16
  */
17
- styleType?: 'default' | 'borderless';
17
+ styleType?: 'default' | 'borderless' | 'high-visibility';
18
18
  /**
19
19
  * Props for the `DropdownMenu` which extends `PopoverProps`.
20
20
  */
@@ -1,3 +1,4 @@
1
+ import type { PolymorphicForwardRefComponent } from '../utils/index.js';
1
2
  /**
2
3
  * Container for content in `Dialog`. Recommended to be used as a child of `Dialog`.
3
4
  * @example
@@ -5,5 +6,5 @@
5
6
  * My dialog content
6
7
  * </Dialog.Content>
7
8
  */
8
- export declare const DialogContent: import("../utils/props.js").PolymorphicForwardRefComponent<"div", {}>;
9
+ export declare const DialogContent: PolymorphicForwardRefComponent<"div", {}>;
9
10
  export default DialogContent;
@@ -1,10 +1,13 @@
1
1
  'use strict';
2
2
  Object.defineProperty(exports, '__esModule', { value: true });
3
3
  exports.DialogContent = void 0;
4
+ const tslib_1 = require('tslib');
4
5
  /*---------------------------------------------------------------------------------------------
5
6
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
7
  * See LICENSE.md in the project root for license terms and full copyright notice.
7
8
  *--------------------------------------------------------------------------------------------*/
9
+ const React = tslib_1.__importStar(require('react'));
10
+ const classnames_1 = tslib_1.__importDefault(require('classnames'));
8
11
  const index_js_1 = require('../utils/index.js');
9
12
  /**
10
13
  * Container for content in `Dialog`. Recommended to be used as a child of `Dialog`.
@@ -13,5 +16,26 @@ const index_js_1 = require('../utils/index.js');
13
16
  * My dialog content
14
17
  * </Dialog.Content>
15
18
  */
16
- exports.DialogContent = index_js_1.polymorphic.div('iui-dialog-content');
19
+ exports.DialogContent = React.forwardRef((props, ref) => {
20
+ const { children, className, ...rest } = props;
21
+ const contentRef = React.useRef(null);
22
+ React.useEffect(() => {
23
+ // firefox hack for adding data-iui-flex in absence of :has
24
+ if (!(0, index_js_1.supportsHas)()) {
25
+ const dialog = contentRef.current?.closest('[role=dialog]');
26
+ if (dialog instanceof HTMLElement) {
27
+ dialog.dataset.iuiFlex = 'true';
28
+ }
29
+ }
30
+ }, []);
31
+ return React.createElement(
32
+ index_js_1.Box,
33
+ {
34
+ className: (0, classnames_1.default)('iui-dialog-content', className),
35
+ ref: (0, index_js_1.useMergedRefs)(contentRef, ref),
36
+ ...rest,
37
+ },
38
+ children,
39
+ );
40
+ });
17
41
  exports.default = exports.DialogContent;
@@ -155,7 +155,6 @@ exports.DialogMain = React.forwardRef((props, ref) => {
155
155
  'data-iui-placement': placement,
156
156
  style: {
157
157
  transform,
158
- overflow: 'unset',
159
158
  ...style,
160
159
  ...propStyle,
161
160
  },
@@ -16,6 +16,10 @@ type HeaderButtonProps = {
16
16
  * @default false
17
17
  */
18
18
  isActive?: boolean;
19
+ /**
20
+ * Modify the native `name` attribute of the `<button>` element.
21
+ */
22
+ htmlName?: string;
19
23
  } & Partial<Pick<DropdownButtonProps, 'menuItems'>> & Pick<ButtonProps, 'startIcon' | 'endIcon'>;
20
24
  /**
21
25
  * Header button that handles slim state of the `Header` it's in.
@@ -25,6 +25,7 @@ exports.HeaderButton = React.forwardRef((props, ref) => {
25
25
  const {
26
26
  name,
27
27
  description,
28
+ htmlName,
28
29
  isActive = false,
29
30
  startIcon,
30
31
  menuItems,
@@ -63,6 +64,7 @@ exports.HeaderButton = React.forwardRef((props, ref) => {
63
64
  ),
64
65
  ref: ref,
65
66
  disabled: disabled,
67
+ name: htmlName,
66
68
  ...(!!menuItems && { menuItems }),
67
69
  ...rest,
68
70
  }; // eslint-disable-line @typescript-eslint/no-explicit-any
@@ -4,6 +4,11 @@ export type InputProps = {
4
4
  * Modify size of the input.
5
5
  */
6
6
  size?: 'small' | 'large';
7
+ /**
8
+ * Modify the native `size` attribute of the `<input>` element.
9
+ * The `width` or `inline-size` property must be unset in order to use this prop.
10
+ */
11
+ htmlSize?: number;
7
12
  };
8
13
  /**
9
14
  * Basic input component
@@ -17,13 +17,14 @@ const index_js_1 = require('../utils/index.js');
17
17
  * <Input size='small' />
18
18
  */
19
19
  exports.Input = React.forwardRef((props, ref) => {
20
- const { size, className, ...rest } = props;
20
+ const { size, htmlSize, className, ...rest } = props;
21
21
  const inputRef = React.useRef(null);
22
22
  const refs = (0, index_js_1.useMergedRefs)(inputRef, ref);
23
23
  return React.createElement(index_js_1.Box, {
24
24
  as: 'input',
25
25
  className: (0, classnames_1.default)('iui-input', className),
26
26
  'data-iui-size': size,
27
+ size: htmlSize,
27
28
  ref: refs,
28
29
  ...rest,
29
30
  });
@@ -9,6 +9,14 @@ type RadioProps = {
9
9
  * Status of the radio.
10
10
  */
11
11
  status?: 'positive' | 'warning' | 'negative';
12
+ /**
13
+ * Passes props to Radio label.
14
+ */
15
+ labelProps?: React.ComponentProps<'span'>;
16
+ /**
17
+ * Passes props to Radio wrapper.
18
+ */
19
+ wrapperProps?: React.ComponentProps<'label'>;
12
20
  };
13
21
  /**
14
22
  * Basic radio input component
@@ -20,16 +20,22 @@ const index_js_1 = require('../utils/index.js');
20
20
  * <Radio status='negative' label='Negative' />
21
21
  */
22
22
  exports.Radio = React.forwardRef((props, ref) => {
23
- const { className, disabled = false, label, status, style, ...rest } = props;
23
+ const {
24
+ className,
25
+ disabled = false,
26
+ label,
27
+ status,
28
+ labelProps,
29
+ wrapperProps,
30
+ style,
31
+ ...rest
32
+ } = props;
24
33
  const inputElementRef = React.useRef(null);
25
34
  const refs = (0, index_js_1.useMergedRefs)(inputElementRef, ref);
26
35
  const radio = React.createElement(index_js_1.Box, {
27
36
  as: 'input',
28
- className: (0, classnames_1.default)(
29
- 'iui-radio',
30
- className && { [className]: !label },
31
- ),
32
- style: !label ? style : undefined,
37
+ className: (0, classnames_1.default)('iui-radio', className),
38
+ style: style,
33
39
  disabled: disabled,
34
40
  type: 'radio',
35
41
  ref: refs,
@@ -41,18 +47,25 @@ exports.Radio = React.forwardRef((props, ref) => {
41
47
  index_js_1.Box,
42
48
  {
43
49
  as: 'label',
50
+ ...wrapperProps,
44
51
  className: (0, classnames_1.default)(
45
52
  'iui-radio-wrapper',
46
53
  { 'iui-disabled': disabled, [`iui-${status}`]: !!status },
47
- className,
54
+ wrapperProps?.className,
48
55
  ),
49
- style: style,
50
56
  },
51
57
  radio,
52
58
  label &&
53
59
  React.createElement(
54
60
  index_js_1.Box,
55
- { as: 'span', className: 'iui-radio-label' },
61
+ {
62
+ as: 'span',
63
+ ...labelProps,
64
+ className: (0, classnames_1.default)(
65
+ 'iui-radio-label',
66
+ labelProps?.className,
67
+ ),
68
+ },
56
69
  label,
57
70
  ),
58
71
  );
@@ -13,6 +13,22 @@ type RadioTileProps = {
13
13
  * Additional description, if needed.
14
14
  */
15
15
  description?: React.ReactNode;
16
+ /**
17
+ * Passes props to tile wrapper.
18
+ */
19
+ wrapperProps?: React.ComponentProps<'label'>;
20
+ /**
21
+ * Passes props to tile icon.
22
+ */
23
+ iconProps?: React.ComponentProps<'span'>;
24
+ /**
25
+ * Passes props to tile label.
26
+ */
27
+ labelProps?: React.ComponentProps<'div'>;
28
+ /**
29
+ * Passes props to tile sublabel.
30
+ */
31
+ subLabelProps?: React.ComponentProps<'div'>;
16
32
  };
17
33
  /**
18
34
  * RadioTile component to be used in RadioTileGroup component
@@ -15,45 +15,79 @@ const index_js_1 = require('../utils/index.js');
15
15
  * <RadioTile label='My tile' description='Some info' icon={<SvgSmileyHappy />} />
16
16
  */
17
17
  exports.RadioTile = React.forwardRef((props, ref) => {
18
- const { icon, label, description, className, style, ...rest } = props;
18
+ const {
19
+ icon,
20
+ label,
21
+ description,
22
+ className,
23
+ wrapperProps,
24
+ iconProps,
25
+ labelProps,
26
+ subLabelProps,
27
+ style,
28
+ ...rest
29
+ } = props;
19
30
  const inputElementRef = React.useRef(null);
20
31
  const refs = (0, index_js_1.useMergedRefs)(inputElementRef, ref);
21
32
  return React.createElement(
22
33
  index_js_1.Box,
23
34
  {
24
35
  as: 'label',
25
- className: (0, classnames_1.default)('iui-radio-tile', className),
26
- style: style,
36
+ 'data-iui-disabled': props.disabled ? 'true' : undefined,
37
+ ...wrapperProps,
38
+ className: (0, classnames_1.default)(
39
+ 'iui-radio-tile',
40
+ wrapperProps?.className,
41
+ ),
27
42
  },
28
43
  React.createElement(index_js_1.Box, {
29
44
  as: 'input',
30
- className: 'iui-radio-tile-input',
31
- type: 'radio',
32
45
  ref: refs,
46
+ className: (0, classnames_1.default)('iui-radio-tile-input', className),
47
+ style: style,
48
+ type: 'radio',
33
49
  ...rest,
34
50
  }),
35
- React.createElement(
36
- index_js_1.Box,
37
- { className: 'iui-radio-tile-content' },
38
- icon &&
39
- React.createElement(
40
- index_js_1.Box,
41
- { as: 'span', className: 'iui-radio-tile-icon', 'aria-hidden': true },
42
- icon,
43
- ),
44
- label &&
45
- React.createElement(
46
- index_js_1.Box,
47
- { className: 'iui-radio-tile-label' },
48
- label,
49
- ),
50
- description &&
51
- React.createElement(
52
- index_js_1.Box,
53
- { className: 'iui-radio-tile-sublabel' },
54
- description,
55
- ),
56
- ),
51
+ icon &&
52
+ React.createElement(
53
+ index_js_1.Box,
54
+ {
55
+ as: 'span',
56
+ 'aria-hidden': true,
57
+ ...iconProps,
58
+ className: (0, classnames_1.default)(
59
+ 'iui-radio-tile-icon',
60
+ iconProps?.className,
61
+ ),
62
+ },
63
+ icon,
64
+ ),
65
+ label &&
66
+ React.createElement(
67
+ index_js_1.Box,
68
+ {
69
+ as: 'div',
70
+ ...labelProps,
71
+ className: (0, classnames_1.default)(
72
+ 'iui-radio-tile-label',
73
+ labelProps?.className,
74
+ ),
75
+ },
76
+ label,
77
+ ),
78
+ description &&
79
+ React.createElement(
80
+ index_js_1.Box,
81
+ {
82
+ as: 'div',
83
+ ...subLabelProps,
84
+ className: (0, classnames_1.default)(
85
+ 'iui-radio-tile-sublabel',
86
+ subLabelProps?.className,
87
+ ),
88
+ },
89
+ description,
90
+ ),
57
91
  );
58
92
  });
59
93
  exports.default = exports.RadioTile;
@@ -190,6 +190,22 @@ export type TableProps<T extends Record<string, unknown> = Record<string, unknow
190
190
  * @default false
191
191
  */
192
192
  enableColumnReordering?: boolean;
193
+ /**
194
+ * Passes props to Table header wrapper.
195
+ */
196
+ headerWrapperProps?: React.ComponentProps<'div'>;
197
+ /**
198
+ * Passes props to Table header.
199
+ */
200
+ headerProps?: React.ComponentProps<'div'>;
201
+ /**
202
+ * Passes custom props to Table body.
203
+ */
204
+ bodyProps?: React.ComponentProps<'div'>;
205
+ /**
206
+ * Passes custom props to empty table.
207
+ */
208
+ emptyTableContentProps?: React.ComponentProps<'div'>;
193
209
  /**
194
210
  * Function that returns index of the row that you want to scroll to.
195
211
  *
@@ -117,6 +117,10 @@ const Table = (props) => {
117
117
  styleType = 'default',
118
118
  enableVirtualization = false,
119
119
  enableColumnReordering = false,
120
+ headerWrapperProps,
121
+ headerProps,
122
+ bodyProps,
123
+ emptyTableContentProps,
120
124
  ...rest
121
125
  } = props;
122
126
  (0, index_js_2.useGlobals)();
@@ -580,7 +584,7 @@ const Table = (props) => {
580
584
  return React.createElement(
581
585
  index_js_2.Box,
582
586
  {
583
- className: 'iui-table-header-wrapper',
587
+ as: 'div',
584
588
  ref: headerRef,
585
589
  onScroll: () => {
586
590
  if (headerRef.current && bodyRef.current) {
@@ -589,10 +593,22 @@ const Table = (props) => {
589
593
  }
590
594
  },
591
595
  key: headerGroupProps.key,
596
+ ...headerWrapperProps,
597
+ className: (0, classnames_1.default)(
598
+ 'iui-table-header-wrapper',
599
+ headerWrapperProps?.className,
600
+ ),
592
601
  },
593
602
  React.createElement(
594
603
  index_js_2.Box,
595
- { className: 'iui-table-header' },
604
+ {
605
+ as: 'div',
606
+ ...headerProps,
607
+ className: (0, classnames_1.default)(
608
+ 'iui-table-header',
609
+ headerProps?.className,
610
+ ),
611
+ },
596
612
  React.createElement(
597
613
  index_js_2.Box,
598
614
  { ...headerGroupProps },
@@ -712,10 +728,15 @@ const Table = (props) => {
712
728
  React.createElement(
713
729
  index_js_2.Box,
714
730
  {
731
+ ...bodyProps,
715
732
  ...getTableBodyProps({
716
- className: (0, classnames_1.default)('iui-table-body', {
717
- 'iui-zebra-striping': styleType === 'zebra-rows',
718
- }),
733
+ className: (0, classnames_1.default)(
734
+ 'iui-table-body',
735
+ {
736
+ 'iui-zebra-striping': styleType === 'zebra-rows',
737
+ },
738
+ bodyProps?.className,
739
+ ),
719
740
  style: { outline: 0 },
720
741
  }),
721
742
  ref: bodyRef,
@@ -745,7 +766,14 @@ const Table = (props) => {
745
766
  data.length === 0 &&
746
767
  React.createElement(
747
768
  index_js_2.Box,
748
- { className: 'iui-table-empty' },
769
+ {
770
+ as: 'div',
771
+ ...emptyTableContentProps,
772
+ className: (0, classnames_1.default)(
773
+ 'iui-table-empty',
774
+ emptyTableContentProps?.className,
775
+ ),
776
+ },
749
777
  React.createElement(index_js_1.ProgressRadial, {
750
778
  indeterminate: true,
751
779
  }),
@@ -773,7 +801,14 @@ const Table = (props) => {
773
801
  !areFiltersSet &&
774
802
  React.createElement(
775
803
  index_js_2.Box,
776
- { className: 'iui-table-empty' },
804
+ {
805
+ as: 'div',
806
+ ...emptyTableContentProps,
807
+ className: (0, classnames_1.default)(
808
+ 'iui-table-empty',
809
+ emptyTableContentProps?.className,
810
+ ),
811
+ },
777
812
  React.createElement('div', null, emptyTableContent),
778
813
  ),
779
814
  !isLoading &&
@@ -781,7 +816,14 @@ const Table = (props) => {
781
816
  areFiltersSet &&
782
817
  React.createElement(
783
818
  index_js_2.Box,
784
- { className: 'iui-table-empty' },
819
+ {
820
+ as: 'div',
821
+ ...emptyTableContentProps,
822
+ className: (0, classnames_1.default)(
823
+ 'iui-table-empty',
824
+ emptyTableContentProps?.className,
825
+ ),
826
+ },
785
827
  React.createElement('div', null, emptyFilteredTableContent),
786
828
  ),
787
829
  ),
@@ -37,7 +37,10 @@ const Resizer = (props) => {
37
37
  let height = `${initialHeight}px`;
38
38
  let translateX = initialTranslateX;
39
39
  let translateY = initialTranslateY;
40
- const minWidth = parseFloat(getComputedStyle(elementRef.current).minWidth);
40
+ let minWidth = parseFloat(getComputedStyle(elementRef.current).minWidth);
41
+ if (Number.isNaN(minWidth)) {
42
+ minWidth = 380;
43
+ }
41
44
  const minHeight = parseFloat(
42
45
  getComputedStyle(elementRef.current).minHeight,
43
46
  );
@@ -105,6 +108,8 @@ const Resizer = (props) => {
105
108
  }
106
109
  case 'right': {
107
110
  width = elementRef.current.style.width = `${initialWidth - diffX}px`;
111
+ height = elementRef.current.style.height = `${initialHeight}px`;
112
+ elementRef.current.style.transform = `translate(${translateX}px, ${translateY}px)`;
108
113
  break;
109
114
  }
110
115
  case 'bottom-right': {
@@ -112,12 +117,14 @@ const Resizer = (props) => {
112
117
  height = elementRef.current.style.height = `${
113
118
  initialHeight - diffY
114
119
  }px`;
120
+ elementRef.current.style.transform = `translate(${translateX}px, ${translateY}px)`;
115
121
  break;
116
122
  }
117
123
  case 'bottom': {
118
124
  height = elementRef.current.style.height = `${
119
125
  initialHeight - diffY
120
126
  }px`;
127
+ elementRef.current.style.transform = `translate(${translateX}px, ${translateY}px)`;
121
128
  break;
122
129
  }
123
130
  case 'bottom-left': {
@@ -138,6 +145,7 @@ const Resizer = (props) => {
138
145
  break;
139
146
  }
140
147
  width = elementRef.current.style.width = `${newWidth}px`;
148
+ height = elementRef.current.style.height = `${initialHeight}px`;
141
149
  translateX = initialTranslateX - diffX;
142
150
  elementRef.current.style.transform = `translate(${translateX}px, ${translateY}px)`;
143
151
  break;
@@ -172,8 +180,8 @@ const Resizer = (props) => {
172
180
  onPointerDown: onResizePointerDown,
173
181
  style: {
174
182
  position: 'absolute',
175
- top: -4,
176
- left: -4,
183
+ top: 0,
184
+ left: 0,
177
185
  width: 12,
178
186
  height: 12,
179
187
  cursor: 'nw-resize',
@@ -184,7 +192,7 @@ const Resizer = (props) => {
184
192
  onPointerDown: onResizePointerDown,
185
193
  style: {
186
194
  position: 'absolute',
187
- top: -4,
195
+ top: 0,
188
196
  left: 8,
189
197
  right: 8,
190
198
  height: 8,
@@ -196,8 +204,8 @@ const Resizer = (props) => {
196
204
  onPointerDown: onResizePointerDown,
197
205
  style: {
198
206
  position: 'absolute',
199
- top: -4,
200
- right: -4,
207
+ top: 0,
208
+ right: 0,
201
209
  width: 12,
202
210
  height: 12,
203
211
  cursor: 'ne-resize',
@@ -209,7 +217,7 @@ const Resizer = (props) => {
209
217
  style: {
210
218
  position: 'absolute',
211
219
  top: 8,
212
- right: -4,
220
+ right: 0,
213
221
  bottom: 8,
214
222
  width: 8,
215
223
  cursor: 'e-resize',
@@ -220,8 +228,8 @@ const Resizer = (props) => {
220
228
  onPointerDown: onResizePointerDown,
221
229
  style: {
222
230
  position: 'absolute',
223
- bottom: -4,
224
- right: -4,
231
+ bottom: 0,
232
+ right: 0,
225
233
  width: 12,
226
234
  height: 12,
227
235
  cursor: 'se-resize',
@@ -232,7 +240,7 @@ const Resizer = (props) => {
232
240
  onPointerDown: onResizePointerDown,
233
241
  style: {
234
242
  position: 'absolute',
235
- bottom: -4,
243
+ bottom: 0,
236
244
  left: 8,
237
245
  right: 8,
238
246
  height: 8,
@@ -244,8 +252,8 @@ const Resizer = (props) => {
244
252
  onPointerDown: onResizePointerDown,
245
253
  style: {
246
254
  position: 'absolute',
247
- bottom: -4,
248
- left: -4,
255
+ bottom: 0,
256
+ left: 0,
249
257
  width: 12,
250
258
  height: 12,
251
259
  cursor: 'sw-resize',
@@ -257,7 +265,7 @@ const Resizer = (props) => {
257
265
  style: {
258
266
  position: 'absolute',
259
267
  top: 8,
260
- left: -4,
268
+ left: 0,
261
269
  bottom: 8,
262
270
  width: 8,
263
271
  cursor: 'w-resize',