rsuite 5.4.2 → 5.4.3

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.
@@ -14,7 +14,6 @@
14
14
  text-align: center;
15
15
  vertical-align: middle;
16
16
  cursor: pointer;
17
- outline: 0 !important;
18
17
  white-space: nowrap;
19
18
  transition: @btn-transition;
20
19
  // Reset border style in all browser
@@ -31,10 +30,7 @@
31
30
 
32
31
  .rs-btn-md();
33
32
 
34
- &:focus {
35
- outline: 0;
36
- box-shadow: var(--rs-state-focus-shadow);
37
- }
33
+ .with-focus-ring();
38
34
 
39
35
  .button-activated({
40
36
  color: var(--rs-btn-default-hover-text);
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [5.4.3](https://github.com/rsuite/rsuite/compare/v5.4.2...v5.4.3) (2021-12-30)
2
+
3
+ ### Bug Fixes
4
+
5
+ - **Drawer:** fix Drawer cannot be closed when backdrop is clicked ([#2259](https://github.com/rsuite/rsuite/issues/2259)) ([a49ee03](https://github.com/rsuite/rsuite/commit/a49ee03db33c11db30597221ca61ce6daa088c4b))
6
+ - **Picker:** add ref to PickerComponentProps ([#2261](https://github.com/rsuite/rsuite/issues/2261)) ([6e3e6c5](https://github.com/rsuite/rsuite/commit/6e3e6c57932af142dc1a74da6b7fffb57ae628ca))
7
+
1
8
  ## [5.4.2](https://github.com/rsuite/rsuite/compare/v5.4.1...v5.4.2) (2021-12-24)
2
9
 
3
10
  ### Bug Fixes
@@ -6,6 +6,9 @@
6
6
  position: fixed;
7
7
  z-index: @zindex-drawer;
8
8
  top: 0;
9
+ left: 0;
10
+ width: 100%;
11
+ height: 100%;
9
12
  }
10
13
 
11
14
  // Container that the drawer scrolls within
@@ -108,6 +108,7 @@
108
108
  z-index: @zindex-dropdown + 1;
109
109
  float: left;
110
110
  box-shadow: var(--rs-dropdown-shadow);
111
+ outline: none;
111
112
 
112
113
  .high-contrast-mode({
113
114
  border: 1px solid var(--rs-border-primary);
@@ -39,8 +39,6 @@
39
39
  padding-right: @dropdown-toggle-padding-right;
40
40
  // Fixed: Content is not centered when customizing renderTitle.
41
41
  display: inline-block;
42
- // Rest `:focus` blue border.
43
- outline: none;
44
42
  cursor: pointer;
45
43
  }
46
44
 
@@ -73,8 +73,6 @@
73
73
  .rs-navbar-brand,
74
74
  .rs-navbar-item,
75
75
  .rs-navbar-nav > .rs-dropdown-item {
76
- outline: 0;
77
-
78
76
  &,
79
77
  &:hover,
80
78
  &:focus,
@@ -83,7 +81,9 @@
83
81
  }
84
82
 
85
83
  &:focus-visible {
86
- .focus-ring();
84
+ // Navbar is usually placed by the top edge of the page
85
+ // thus use an inset focus ring to prevent overflow clipping
86
+ .focus-ring(inset);
87
87
 
88
88
  .high-contrast-mode({
89
89
  .focus-ring(slim-inset);
@@ -108,6 +108,11 @@
108
108
  .rs-navbar-nav > .rs-dropdown .rs-dropdown-toggle {
109
109
  &:extend(.rs-navbar-item);
110
110
 
111
+ &:focus,
112
+ &:focus-visible {
113
+ &:extend(.rs-navbar-item:focus-visible);
114
+ }
115
+
111
116
  padding-right: @navbar-item-padding-x+ @dropdown-caret-width+ @dropdown-caret-padding;
112
117
 
113
118
  .high-contrast-mode({
@@ -110,6 +110,12 @@
110
110
  width: 100%;
111
111
  white-space: normal;
112
112
 
113
+ // Sidenav is usually placed by the left/right edge of the page
114
+ // thus use an inset focus ring to prevent overflow clipping
115
+ &:focus {
116
+ .focus-ring(inset);
117
+ }
118
+
113
119
  > .rs-icon:not(.rs-dropdown-toggle-caret) {
114
120
  font-size: @sidenav-level1-item-font-size;
115
121
  margin-right: @sidenav-icon-spacing;
@@ -1,5 +1,6 @@
1
- import React from 'react';
1
+ import React, { Ref } from 'react';
2
2
  import { PickerLocale } from '../locales';
3
+ import { PickerInstance } from '../Picker';
3
4
  import { ItemDataType, FormControlPickerProps } from '../@types/common';
4
5
  import type { MultipleSelectProps } from '../SelectPicker';
5
6
  export declare type ValueType = (number | string)[];
@@ -10,7 +11,9 @@ export interface CheckPickerProps<T> extends FormControlPickerProps<T[], PickerL
10
11
  countable?: boolean;
11
12
  }
12
13
  export interface CheckPickerComponent {
13
- <T>(props: CheckPickerProps<T>): JSX.Element | null;
14
+ <T>(props: CheckPickerProps<T> & {
15
+ ref?: Ref<PickerInstance>;
16
+ }): JSX.Element | null;
14
17
  displayName?: string;
15
18
  propTypes?: React.WeakValidationMap<CheckPickerProps<any>>;
16
19
  }
@@ -73,4 +73,12 @@ _react.default.createElement(_CheckPicker.default, {
73
73
  onChange: function onChange(newValue) {
74
74
  (0, _tsExpect.expectType)(newValue);
75
75
  }
76
+ });
77
+
78
+ var pickerRef = /*#__PURE__*/_react.default.createRef();
79
+
80
+ /*#__PURE__*/
81
+ _react.default.createElement(_CheckPicker.default, {
82
+ ref: pickerRef,
83
+ data: []
76
84
  });
@@ -1,5 +1,6 @@
1
- import React from 'react';
1
+ import React, { Ref } from 'react';
2
2
  import { PickerLocale } from '../locales';
3
+ import { PickerInstance } from '../Picker';
3
4
  import { FormControlPickerProps, ItemDataType } from '../@types/common';
4
5
  import { ListProps } from 'react-virtualized/dist/commonjs/List';
5
6
  export interface SelectProps<T> {
@@ -42,7 +43,9 @@ export interface MultipleSelectProps<T> extends Omit<SelectProps<T>, 'renderValu
42
43
  export interface SelectPickerProps<T> extends FormControlPickerProps<T, PickerLocale, ItemDataType<T>>, SelectProps<T> {
43
44
  }
44
45
  export interface SelectPickerComponent {
45
- <T>(props: SelectPickerProps<T>): JSX.Element | null;
46
+ <T>(props: SelectPickerProps<T> & {
47
+ ref?: Ref<PickerInstance>;
48
+ }): JSX.Element | null;
46
49
  displayName?: string;
47
50
  propTypes?: React.WeakValidationMap<SelectPickerProps<any>>;
48
51
  }
@@ -59,4 +59,12 @@ _react.default.createElement(_SelectPicker.default, {
59
59
  onChange: function onChange(newValue) {
60
60
  (0, _tsExpect.expectType)(newValue);
61
61
  }
62
+ });
63
+
64
+ var pickerRef = /*#__PURE__*/_react.default.createRef();
65
+
66
+ /*#__PURE__*/
67
+ _react.default.createElement(_SelectPicker.default, {
68
+ ref: pickerRef,
69
+ data: []
62
70
  });