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.
@@ -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
  }
@@ -61,4 +61,11 @@ React.createElement(CheckPicker, {
61
61
  onChange: function onChange(newValue) {
62
62
  expectType(newValue);
63
63
  }
64
+ });
65
+ var pickerRef = /*#__PURE__*/React.createRef();
66
+
67
+ /*#__PURE__*/
68
+ React.createElement(CheckPicker, {
69
+ ref: pickerRef,
70
+ data: []
64
71
  });
@@ -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
  }
@@ -49,4 +49,11 @@ React.createElement(SelectPicker, {
49
49
  onChange: function onChange(newValue) {
50
50
  expectType(newValue);
51
51
  }
52
+ });
53
+ var pickerRef = /*#__PURE__*/React.createRef();
54
+
55
+ /*#__PURE__*/
56
+ React.createElement(SelectPicker, {
57
+ ref: pickerRef,
58
+ data: []
52
59
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rsuite",
3
- "version": "5.4.2",
3
+ "version": "5.4.3",
4
4
  "description": "A suite of react components",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",
@@ -37,7 +37,7 @@
37
37
  "lodash": "^4.17.11",
38
38
  "prop-types": "^15.7.2",
39
39
  "react-virtualized": "^9.22.3",
40
- "rsuite-table": "^5.2.2",
40
+ "rsuite-table": "^5.3.0",
41
41
  "schema-typed": "^2.0.2"
42
42
  },
43
43
  "peerDependencies": {
@@ -27,6 +27,7 @@
27
27
  --rs-bg-active: @H700;
28
28
  --rs-bg-backdrop: fade(@B900, 80%);
29
29
  --rs-state-hover-bg: @B600;
30
+ --rs-color-focus-ring: 0 0 0 3px fade(@H500, 25%);
30
31
  --rs-state-focus-shadow: 0 0 0 3px fade(@H500, 25%);
31
32
  --rs-state-focus-outline: 3px solid fade(@H500, 25%);
32
33
  --rs-shadow-overlay: 0 4px 4px rgba(0, 0, 0, 0.12), 0 0 10px rgba(0, 0, 0, 0.06);
@@ -27,6 +27,7 @@
27
27
  --rs-bg-active: @H500;
28
28
  --rs-bg-backdrop: fade(@B900, 80%);
29
29
  --rs-state-hover-bg: @B600;
30
+ --rs-color-focus-ring: @B000;
30
31
  --rs-state-focus-shadow: 0 0 0 3px @B900, 0 0 0 5px @B000;
31
32
  --rs-state-focus-shadow-slim: 0 0 0 2px @B000;
32
33
  --rs-state-focus-outline: 3px solid fade(@H500, 25%);
@@ -34,6 +34,7 @@
34
34
  --rs-bg-active: @H500;
35
35
  --rs-bg-backdrop: fade(@B900, 30%);
36
36
  --rs-state-hover-bg: @H050;
37
+ --rs-color-focus-ring: fade(@H500, 25%);
37
38
  --rs-state-focus-shadow: 0 0 0 3px fade(@H500, 25%);
38
39
  --rs-state-focus-outline: 3px solid fade(@H500, 25%);
39
40
  --rs-shadow-overlay: 0 4px 4px rgba(0, 0, 0, 0.12), 0 0 10px rgba(0, 0, 0, 0.06);
@@ -122,26 +122,38 @@
122
122
 
123
123
  // Useful when adding focus ring to an element
124
124
  .with-focus-ring() {
125
- &:focus {
125
+ &:focus-visible {
126
126
  .focus-ring();
127
127
  }
128
128
  }
129
129
 
130
130
  // Useful when appending the ring into an existing :focus rule
131
131
  .focus-ring() {
132
- box-shadow: var(--rs-state-focus-shadow);
132
+ outline: 3px solid var(--rs-color-focus-ring);
133
+ // box-shadow: var(--rs-state-focus-shadow);
134
+
135
+ .high-contrast-mode({
136
+ outline-offset: 2px;
137
+ });
133
138
  }
134
139
 
135
140
  .focus-ring(slim) {
136
- box-shadow: var(--rs-state-focus-shadow-slim);
141
+ .focus-ring();
142
+
143
+ outline-width: 2px;
144
+ outline-offset: 0;
137
145
  }
138
146
 
139
147
  .focus-ring(inset) {
140
- box-shadow: inset var(--rs-state-focus-shadow);
148
+ .focus-ring();
149
+
150
+ outline-offset: -3px;
141
151
  }
142
152
 
143
153
  .focus-ring(slim-inset) {
144
- box-shadow: inset var(--rs-state-focus-shadow-slim);
154
+ .focus-ring(inset);
155
+
156
+ outline-width: 2px;
145
157
  }
146
158
 
147
159
  .focus-ring(outline) {