rsuite 5.48.0 → 5.49.0

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 (146) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/Cascader/styles/index.less +1 -0
  3. package/DatePicker/styles/index.less +18 -11
  4. package/DateRangeInput/package.json +7 -0
  5. package/DateRangePicker/styles/index.less +10 -0
  6. package/InputGroup/styles/index.less +1 -0
  7. package/Picker/styles/index.less +20 -0
  8. package/README.md +34 -24
  9. package/Sidenav/styles/index.less +2 -0
  10. package/cjs/Calendar/CalendarContainer.d.ts +2 -0
  11. package/cjs/Calendar/CalendarContainer.js +11 -4
  12. package/cjs/Calendar/CalendarHeader.js +2 -0
  13. package/cjs/Calendar/MonthDropdown.js +7 -2
  14. package/cjs/Calendar/MonthDropdownItem.js +2 -2
  15. package/cjs/Calendar/Table.js +6 -1
  16. package/cjs/Calendar/TimeDropdown.js +17 -10
  17. package/cjs/Calendar/types.d.ts +1 -0
  18. package/cjs/CustomProvider/CustomProvider.d.ts +13 -0
  19. package/cjs/CustomProvider/CustomProvider.js +2 -2
  20. package/cjs/DateInput/DateField.d.ts +9 -31
  21. package/cjs/DateInput/DateField.js +61 -12
  22. package/cjs/DateInput/DateInput.d.ts +7 -2
  23. package/cjs/DateInput/DateInput.js +74 -92
  24. package/cjs/DateInput/index.d.ts +4 -0
  25. package/cjs/DateInput/index.js +19 -1
  26. package/cjs/DateInput/useDateInputState.d.ts +7 -31
  27. package/cjs/DateInput/useDateInputState.js +39 -15
  28. package/cjs/DateInput/useIsFocused.d.ts +7 -0
  29. package/cjs/DateInput/useIsFocused.js +28 -0
  30. package/cjs/DateInput/useKeyboardInputEvent.d.ts +10 -0
  31. package/cjs/DateInput/useKeyboardInputEvent.js +44 -0
  32. package/cjs/DateInput/utils.d.ts +23 -1
  33. package/cjs/DateInput/utils.js +155 -51
  34. package/cjs/DatePicker/DatePicker.d.ts +20 -7
  35. package/cjs/DatePicker/DatePicker.js +215 -245
  36. package/cjs/DatePicker/PickerIndicator.d.ts +10 -0
  37. package/cjs/DatePicker/PickerIndicator.js +48 -0
  38. package/cjs/DatePicker/PickerLabel.d.ts +9 -0
  39. package/cjs/DatePicker/PickerLabel.js +23 -0
  40. package/cjs/DatePicker/Toolbar.js +3 -21
  41. package/cjs/DatePicker/utils.d.ts +5 -1
  42. package/cjs/DatePicker/utils.js +17 -1
  43. package/cjs/DateRangeInput/DateRangeInput.d.ts +29 -0
  44. package/cjs/DateRangeInput/DateRangeInput.js +244 -0
  45. package/cjs/DateRangeInput/index.d.ts +3 -0
  46. package/cjs/DateRangeInput/index.js +9 -0
  47. package/cjs/DateRangeInput/utils.d.ts +61 -0
  48. package/cjs/DateRangeInput/utils.js +146 -0
  49. package/cjs/DateRangePicker/DateRangePicker.js +12 -2
  50. package/cjs/FormControl/FormControl.js +2 -1
  51. package/cjs/Input/Input.d.ts +11 -0
  52. package/cjs/Input/Input.js +11 -8
  53. package/cjs/MultiCascader/MultiCascader.js +3 -1
  54. package/cjs/Overlay/OverlayTrigger.d.ts +3 -0
  55. package/cjs/Overlay/OverlayTrigger.js +5 -0
  56. package/cjs/Picker/PickerToggle.js +2 -1
  57. package/cjs/Picker/usePickerRef.d.ts +17 -0
  58. package/cjs/Picker/usePickerRef.js +82 -0
  59. package/cjs/index.d.ts +2 -0
  60. package/cjs/index.js +3 -1
  61. package/cjs/locales/index.d.ts +2 -2
  62. package/cjs/useMediaQuery/useMediaQuery.js +2 -2
  63. package/cjs/utils/index.d.ts +2 -0
  64. package/cjs/utils/index.js +8 -2
  65. package/cjs/utils/useCustom.js +1 -1
  66. package/cjs/utils/useIsomorphicLayoutEffect.d.ts +3 -0
  67. package/cjs/utils/useIsomorphicLayoutEffect.js +9 -0
  68. package/dist/rsuite-no-reset-rtl.css +51 -141
  69. package/dist/rsuite-no-reset-rtl.min.css +1 -1
  70. package/dist/rsuite-no-reset-rtl.min.css.map +1 -1
  71. package/dist/rsuite-no-reset.css +51 -141
  72. package/dist/rsuite-no-reset.min.css +1 -1
  73. package/dist/rsuite-no-reset.min.css.map +1 -1
  74. package/dist/rsuite-rtl.css +51 -9
  75. package/dist/rsuite-rtl.min.css +1 -1
  76. package/dist/rsuite-rtl.min.css.map +1 -1
  77. package/dist/rsuite.css +51 -9
  78. package/dist/rsuite.js +4804 -250
  79. package/dist/rsuite.js.map +1 -1
  80. package/dist/rsuite.min.css +1 -1
  81. package/dist/rsuite.min.css.map +1 -1
  82. package/dist/rsuite.min.js +1 -1
  83. package/dist/rsuite.min.js.map +1 -1
  84. package/esm/Calendar/CalendarContainer.d.ts +2 -0
  85. package/esm/Calendar/CalendarContainer.js +12 -5
  86. package/esm/Calendar/CalendarHeader.js +2 -0
  87. package/esm/Calendar/MonthDropdown.js +7 -2
  88. package/esm/Calendar/MonthDropdownItem.js +2 -2
  89. package/esm/Calendar/Table.js +6 -1
  90. package/esm/Calendar/TimeDropdown.js +17 -10
  91. package/esm/Calendar/types.d.ts +1 -0
  92. package/esm/CustomProvider/CustomProvider.d.ts +13 -0
  93. package/esm/CustomProvider/CustomProvider.js +3 -3
  94. package/esm/DateInput/DateField.d.ts +9 -31
  95. package/esm/DateInput/DateField.js +61 -12
  96. package/esm/DateInput/DateInput.d.ts +7 -2
  97. package/esm/DateInput/DateInput.js +77 -95
  98. package/esm/DateInput/index.d.ts +4 -0
  99. package/esm/DateInput/index.js +4 -0
  100. package/esm/DateInput/useDateInputState.d.ts +7 -31
  101. package/esm/DateInput/useDateInputState.js +41 -18
  102. package/esm/DateInput/useIsFocused.d.ts +7 -0
  103. package/esm/DateInput/useIsFocused.js +22 -0
  104. package/esm/DateInput/useKeyboardInputEvent.d.ts +10 -0
  105. package/esm/DateInput/useKeyboardInputEvent.js +38 -0
  106. package/esm/DateInput/utils.d.ts +23 -1
  107. package/esm/DateInput/utils.js +150 -51
  108. package/esm/DatePicker/DatePicker.d.ts +20 -7
  109. package/esm/DatePicker/DatePicker.js +218 -248
  110. package/esm/DatePicker/PickerIndicator.d.ts +10 -0
  111. package/esm/DatePicker/PickerIndicator.js +42 -0
  112. package/esm/DatePicker/PickerLabel.d.ts +9 -0
  113. package/esm/DatePicker/PickerLabel.js +17 -0
  114. package/esm/DatePicker/Toolbar.js +3 -21
  115. package/esm/DatePicker/utils.d.ts +5 -1
  116. package/esm/DatePicker/utils.js +16 -1
  117. package/esm/DateRangeInput/DateRangeInput.d.ts +29 -0
  118. package/esm/DateRangeInput/DateRangeInput.js +237 -0
  119. package/esm/DateRangeInput/index.d.ts +3 -0
  120. package/esm/DateRangeInput/index.js +3 -0
  121. package/esm/DateRangeInput/utils.d.ts +61 -0
  122. package/esm/DateRangeInput/utils.js +137 -0
  123. package/esm/DateRangePicker/DateRangePicker.js +12 -2
  124. package/esm/FormControl/FormControl.js +2 -1
  125. package/esm/Input/Input.d.ts +11 -0
  126. package/esm/Input/Input.js +12 -9
  127. package/esm/MultiCascader/MultiCascader.js +4 -2
  128. package/esm/Overlay/OverlayTrigger.d.ts +3 -0
  129. package/esm/Overlay/OverlayTrigger.js +5 -0
  130. package/esm/Picker/PickerToggle.js +2 -1
  131. package/esm/Picker/usePickerRef.d.ts +17 -0
  132. package/esm/Picker/usePickerRef.js +77 -0
  133. package/esm/index.d.ts +2 -0
  134. package/esm/index.js +1 -0
  135. package/esm/locales/index.d.ts +2 -2
  136. package/esm/useMediaQuery/useMediaQuery.js +2 -2
  137. package/esm/utils/index.d.ts +2 -0
  138. package/esm/utils/index.js +3 -1
  139. package/esm/utils/useCustom.js +2 -2
  140. package/esm/utils/useIsomorphicLayoutEffect.d.ts +3 -0
  141. package/esm/utils/useIsomorphicLayoutEffect.js +4 -0
  142. package/package.json +1 -1
  143. package/styles/color-modes/dark.less +1 -0
  144. package/styles/color-modes/high-contrast.less +1 -0
  145. package/styles/color-modes/light.less +1 -0
  146. package/styles/normalize.less +230 -231
@@ -6,243 +6,242 @@
6
6
  // Heads up! This reset may cause conflicts with some third-party widgets.
7
7
  // For recommendations on resolving such conflicts, see
8
8
  // http://getbootstrap.com/getting-started/#third-box-sizing
9
- * {
9
+ *[class*='rs-'] {
10
10
  box-sizing: border-box;
11
- }
12
-
13
- *::before,
14
- *::after {
15
- box-sizing: border-box;
16
- }
17
-
18
- body {
19
- // Remove default margin.
20
- margin: 0;
21
- // Optimize for the retina screen
22
- -webkit-font-smoothing: antialiased;
23
- -moz-osx-font-smoothing: grayscale;
24
- }
25
-
26
- // Address `[hidden]` styling not present in IE 10.
27
- // Hide the `template` element in IE 10/11, Safari, and Firefox < 22.
28
- [hidden],
29
- template {
30
- display: none;
31
- }
32
-
33
- // Links
34
- // ==========================================================================
35
-
36
- // Remove the gray background color from active links in IE 10.
37
- a {
38
- background-color: transparent;
39
- }
40
-
41
- // Improve readability of focused elements when they are also in an
42
- // active/hover state.
43
- a:active,
44
- a:hover {
45
- outline: 0;
46
- }
47
-
48
- // Text-level semantics
49
- // ==========================================================================
50
-
51
- // Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
52
- b,
53
- strong {
54
- font-weight: bold;
55
- }
56
-
57
- // Prevent `sub` and `sup` affecting `line-height` in all browsers.
58
- sub,
59
- sup {
60
- font-size: 75%;
61
- line-height: 0;
62
- position: relative;
63
- vertical-align: baseline;
64
- }
65
-
66
- sup {
67
- top: -0.5em;
68
- }
69
-
70
- sub {
71
- bottom: -0.25em;
72
- }
73
-
74
- // Embedded content
75
- // ==========================================================================
76
-
77
- // Remove border when inside `a` element in IE 10.
78
- img {
79
- border: 0;
80
- }
81
-
82
- // Correct overflow not hidden in IE 10/11.
83
- svg:not(:root) {
84
- overflow: hidden;
85
- }
86
-
87
- // Address differences between Firefox and other browsers.
88
- hr {
89
- box-sizing: content-box;
90
- height: 0;
91
- }
92
-
93
- // Contain overflow in all browsers.
94
- pre {
95
- overflow: auto;
96
- }
97
-
98
- // Forms
99
- // ==========================================================================
100
-
101
- // Known limitation: by default, Chrome and Safari on OS X allow very limited
102
- // styling of `select`, unless a `border` property is set.
103
-
104
- // 1. Correct color not being inherited.
105
- // Known issue: affects color of disabled elements.
106
- // 2. Correct font properties not being inherited.
107
- // 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
108
- button,
109
- input,
110
- optgroup,
111
- select,
112
- textarea {
113
- color: inherit; // 1
114
- font: inherit; // 2
115
- margin: 0; // 3
116
- }
117
-
118
- // Address `overflow` set to `hidden` in IE 10/11.
119
- button {
120
- overflow: visible;
121
- }
122
11
 
123
- // Remove border radius in Chrome 62+
124
- button {
125
- border-radius: 0;
126
- }
127
-
128
- // Address inconsistent `text-transform` inheritance for `button` and `select`.
129
- // All other form control elements do not inherit `text-transform` values.
130
- // Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
131
- // Correct `select` style inheritance in Firefox.
132
- button,
133
- select {
134
- text-transform: none;
135
- }
136
-
137
- // 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
138
- // and `video` controls.
139
- // 2. Correct inability to style clickable `input` types in iOS.
140
- // 3. Improve usability and consistency of cursor style between image-type
141
- // `input` and others.
142
- button,
143
- html input[type='button'],
144
- input[type='reset'],
145
- input[type='submit'] {
146
- -webkit-appearance: button; // 2
147
- cursor: pointer; // 3
148
- }
149
-
150
- // Re-set default cursor for disabled elements.
151
- button[disabled],
152
- html input[disabled] {
153
- cursor: not-allowed;
154
- }
155
-
156
- // Remove inner padding and border in Firefox 4+.
157
- button::-moz-focus-inner,
158
- input::-moz-focus-inner {
159
- border: 0;
160
- padding: 0;
161
- }
162
-
163
- // Address Firefox 4+ setting `line-height` on `input` using `!important` in
164
- // the UA stylesheet.
165
- input {
166
- line-height: normal;
167
- }
168
-
169
- // It's recommended that you don't attempt to style these elements.
170
- // Firefox's implementation doesn't respect box-sizing, padding, or width.
171
- //
172
- // 1. Address box sizing set to `content-box` in IE 10.
173
- // 2. Remove excess padding in IE 10.
174
- input[type='checkbox'],
175
- input[type='radio'] {
176
- box-sizing: border-box; // 1
177
- padding: 0; // 2
178
- }
179
-
180
- // Fix the cursor style for Chrome's increment/decrement buttons. For certain
181
- // `font-size` values of the `input`, it causes the cursor style of the
182
- // decrement button to change from `default` to `text`.
183
- input[type='number']::-webkit-inner-spin-button,
184
- input[type='number']::-webkit-outer-spin-button {
185
- height: auto;
186
- }
187
-
188
- // Remove default vertical scrollbar in IE 10/11.
189
- textarea {
190
- overflow: auto;
191
- }
192
-
193
- // Tables
194
- // ==========================================================================
195
-
196
- // Remove most spacing between table cells.
197
- table {
198
- border-collapse: collapse;
199
- border-spacing: 0;
200
- }
201
-
202
- td,
203
- th {
204
- padding: 0;
205
- }
206
-
207
- // Remove tabIndex component outline
208
- [tabindex='-1'] {
209
- outline: none;
210
- }
211
-
212
- // Remove Default button Style
213
- input[type='button'],
214
- input[type='submit'],
215
- input[type='reset'],
216
- button {
217
- border-width: 0;
218
- }
219
-
220
- // Remove IE10's “clear field” X button on certain inputs
221
- input::-ms-clear {
222
- display: none;
223
- }
224
-
225
- // Remove File button Style
226
- input[type='file']::-webkit-file-upload-button,
227
- input[type='file']::-ms-browse {
228
- border-width: 0;
229
- background: transparent;
230
- color: currentColor;
231
- }
232
-
233
- // Reset fonts for relevant elements
234
- input,
235
- button,
236
- select,
237
- textarea {
238
- font-family: inherit;
239
- font-size: inherit;
240
- line-height: inherit;
12
+ &::before,
13
+ &::after {
14
+ box-sizing: border-box;
15
+ }
241
16
  }
242
17
 
243
18
  // import reset styles
244
19
  & when (@enable-css-reset = true) {
20
+ body {
21
+ // Remove default margin.
22
+ margin: 0;
23
+ // Optimize for the retina screen
24
+ -webkit-font-smoothing: antialiased;
25
+ -moz-osx-font-smoothing: grayscale;
26
+ }
27
+
28
+ // Address `[hidden]` styling not present in IE 10.
29
+ // Hide the `template` element in IE 10/11, Safari, and Firefox < 22.
30
+ [hidden],
31
+ template {
32
+ display: none;
33
+ }
34
+
35
+ // Links
36
+ // ==========================================================================
37
+
38
+ // Remove the gray background color from active links in IE 10.
39
+ a {
40
+ background-color: transparent;
41
+ }
42
+
43
+ // Improve readability of focused elements when they are also in an
44
+ // active/hover state.
45
+ a:active,
46
+ a:hover {
47
+ outline: 0;
48
+ }
49
+
50
+ // Text-level semantics
51
+ // ==========================================================================
52
+
53
+ // Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
54
+ b,
55
+ strong {
56
+ font-weight: bold;
57
+ }
58
+
59
+ // Prevent `sub` and `sup` affecting `line-height` in all browsers.
60
+ sub,
61
+ sup {
62
+ font-size: 75%;
63
+ line-height: 0;
64
+ position: relative;
65
+ vertical-align: baseline;
66
+ }
67
+
68
+ sup {
69
+ top: -0.5em;
70
+ }
71
+
72
+ sub {
73
+ bottom: -0.25em;
74
+ }
75
+
76
+ // Embedded content
77
+ // ==========================================================================
78
+
79
+ // Remove border when inside `a` element in IE 10.
80
+ img {
81
+ border: 0;
82
+ }
83
+
84
+ // Correct overflow not hidden in IE 10/11.
85
+ svg:not(:root) {
86
+ overflow: hidden;
87
+ }
88
+
89
+ // Address differences between Firefox and other browsers.
90
+ hr {
91
+ box-sizing: content-box;
92
+ height: 0;
93
+ }
94
+
95
+ // Contain overflow in all browsers.
96
+ pre {
97
+ overflow: auto;
98
+ }
99
+
100
+ // Forms
101
+ // ==========================================================================
102
+
103
+ // Known limitation: by default, Chrome and Safari on OS X allow very limited
104
+ // styling of `select`, unless a `border` property is set.
105
+
106
+ // 1. Correct color not being inherited.
107
+ // Known issue: affects color of disabled elements.
108
+ // 2. Correct font properties not being inherited.
109
+ // 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
110
+ button,
111
+ input,
112
+ optgroup,
113
+ select,
114
+ textarea {
115
+ color: inherit; // 1
116
+ font: inherit; // 2
117
+ margin: 0; // 3
118
+ }
119
+
120
+ // Address `overflow` set to `hidden` in IE 10/11.
121
+ button {
122
+ overflow: visible;
123
+ }
124
+
125
+ // Remove border radius in Chrome 62+
126
+ button {
127
+ border-radius: 0;
128
+ }
129
+
130
+ // Address inconsistent `text-transform` inheritance for `button` and `select`.
131
+ // All other form control elements do not inherit `text-transform` values.
132
+ // Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
133
+ // Correct `select` style inheritance in Firefox.
134
+ button,
135
+ select {
136
+ text-transform: none;
137
+ }
138
+
139
+ // 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
140
+ // and `video` controls.
141
+ // 2. Correct inability to style clickable `input` types in iOS.
142
+ // 3. Improve usability and consistency of cursor style between image-type
143
+ // `input` and others.
144
+ button,
145
+ html input[type='button'],
146
+ input[type='reset'],
147
+ input[type='submit'] {
148
+ -webkit-appearance: button; // 2
149
+ cursor: pointer; // 3
150
+ }
151
+
152
+ // Re-set default cursor for disabled elements.
153
+ button[disabled],
154
+ html input[disabled] {
155
+ cursor: not-allowed;
156
+ }
157
+
158
+ // Remove inner padding and border in Firefox 4+.
159
+ button::-moz-focus-inner,
160
+ input::-moz-focus-inner {
161
+ border: 0;
162
+ padding: 0;
163
+ }
164
+
165
+ // Address Firefox 4+ setting `line-height` on `input` using `!important` in
166
+ // the UA stylesheet.
167
+ input {
168
+ line-height: normal;
169
+ }
170
+
171
+ // It's recommended that you don't attempt to style these elements.
172
+ // Firefox's implementation doesn't respect box-sizing, padding, or width.
173
+ //
174
+ // 1. Address box sizing set to `content-box` in IE 10.
175
+ // 2. Remove excess padding in IE 10.
176
+ input[type='checkbox'],
177
+ input[type='radio'] {
178
+ box-sizing: border-box; // 1
179
+ padding: 0; // 2
180
+ }
181
+
182
+ // Fix the cursor style for Chrome's increment/decrement buttons. For certain
183
+ // `font-size` values of the `input`, it causes the cursor style of the
184
+ // decrement button to change from `default` to `text`.
185
+ input[type='number']::-webkit-inner-spin-button,
186
+ input[type='number']::-webkit-outer-spin-button {
187
+ height: auto;
188
+ }
189
+
190
+ // Remove default vertical scrollbar in IE 10/11.
191
+ textarea {
192
+ overflow: auto;
193
+ }
194
+
195
+ // Tables
196
+ // ==========================================================================
197
+
198
+ // Remove most spacing between table cells.
199
+ table {
200
+ border-collapse: collapse;
201
+ border-spacing: 0;
202
+ }
203
+
204
+ td,
205
+ th {
206
+ padding: 0;
207
+ }
208
+
209
+ // Remove tabIndex component outline
210
+ [tabindex='-1'] {
211
+ outline: none;
212
+ }
213
+
214
+ // Remove Default button Style
215
+ input[type='button'],
216
+ input[type='submit'],
217
+ input[type='reset'],
218
+ button {
219
+ border-width: 0;
220
+ }
221
+
222
+ // Remove IE10's “clear field” X button on certain inputs
223
+ input::-ms-clear {
224
+ display: none;
225
+ }
226
+
227
+ // Remove File button Style
228
+ input[type='file']::-webkit-file-upload-button,
229
+ input[type='file']::-ms-browse {
230
+ border-width: 0;
231
+ background: transparent;
232
+ color: currentColor;
233
+ }
234
+
235
+ // Reset fonts for relevant elements
236
+ input,
237
+ button,
238
+ select,
239
+ textarea {
240
+ font-family: inherit;
241
+ font-size: inherit;
242
+ line-height: inherit;
243
+ }
244
+
245
245
  @import 'scaffolding';
246
246
  @import 'typography';
247
247
  }
248
-