rsuite 6.0.0-canary-2025031415 → 6.0.0-canary-20250315

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.
@@ -77,91 +77,53 @@
77
77
  :where(.rs-box)[style*='--rs-box-shadow'] {
78
78
  box-shadow: var(--rs-box-shadow);
79
79
  }
80
- :where(.rs-box-visible-xs) {
81
- display: none !important;
82
- }
83
80
  @media (max-width: 575px) {
84
- :where(.rs-box-visible-xs) {
85
- display: var(--rs-box-display, inherit) !important;
86
- }
87
- }
88
- :where(.rs-box-visible-sm) {
89
- display: none !important;
90
- }
91
- @media (max-width: 767px) {
92
- :where(.rs-box-visible-sm) {
93
- display: var(--rs-box-display, inherit) !important;
94
- }
95
- }
96
- :where(.rs-box-visible-md) {
97
- display: none !important;
98
- }
99
- @media (max-width: 991px) {
100
- :where(.rs-box-visible-md) {
101
- display: var(--rs-box-display, inherit) !important;
102
- }
103
- }
104
- :where(.rs-box-visible-lg) {
105
- display: none !important;
106
- }
107
- @media (max-width: 1199px) {
108
- :where(.rs-box-visible-lg) {
109
- display: var(--rs-box-display, inherit) !important;
110
- }
111
- }
112
- :where(.rs-box-visible-xl) {
113
- display: none !important;
114
- }
115
- @media (max-width: 1399px) {
116
- :where(.rs-box-visible-xl) {
117
- display: var(--rs-box-display, inherit) !important;
81
+ :where(.rs-box-visible-from-xs) {
82
+ display: none !important;
118
83
  }
119
84
  }
120
- :where(.rs-box-visible-xxl) {
121
- display: none !important;
122
- display: var(--rs-box-display, inherit) !important;
123
- }
124
- :where(.rs-box-hidden-xs) {
125
- display: var(--rs-box-display, inherit) !important;
126
- }
127
- @media (max-width: 575px) {
128
- :where(.rs-box-hidden-xs) {
85
+ @media (min-width: 576px) {
86
+ :where(.rs-box-hidden-from-xs) {
129
87
  display: none !important;
130
88
  }
131
89
  }
132
- :where(.rs-box-hidden-sm) {
133
- display: var(--rs-box-display, inherit) !important;
134
- }
135
90
  @media (max-width: 767px) {
136
- :where(.rs-box-hidden-sm) {
91
+ :where(.rs-box-visible-from-sm) {
137
92
  display: none !important;
138
93
  }
139
94
  }
140
- :where(.rs-box-hidden-md) {
141
- display: var(--rs-box-display, inherit) !important;
95
+ @media (min-width: 768px) {
96
+ :where(.rs-box-hidden-from-sm) {
97
+ display: none !important;
98
+ }
142
99
  }
143
100
  @media (max-width: 991px) {
144
- :where(.rs-box-hidden-md) {
101
+ :where(.rs-box-visible-from-md) {
145
102
  display: none !important;
146
103
  }
147
104
  }
148
- :where(.rs-box-hidden-lg) {
149
- display: var(--rs-box-display, inherit) !important;
105
+ @media (min-width: 992px) {
106
+ :where(.rs-box-hidden-from-md) {
107
+ display: none !important;
108
+ }
150
109
  }
151
110
  @media (max-width: 1199px) {
152
- :where(.rs-box-hidden-lg) {
111
+ :where(.rs-box-visible-from-lg) {
153
112
  display: none !important;
154
113
  }
155
114
  }
156
- :where(.rs-box-hidden-xl) {
157
- display: var(--rs-box-display, inherit) !important;
115
+ @media (min-width: 1200px) {
116
+ :where(.rs-box-hidden-from-lg) {
117
+ display: none !important;
118
+ }
158
119
  }
159
120
  @media (max-width: 1399px) {
160
- :where(.rs-box-hidden-xl) {
121
+ :where(.rs-box-visible-from-xl) {
161
122
  display: none !important;
162
123
  }
163
124
  }
164
- :where(.rs-box-hidden-xxl) {
165
- display: var(--rs-box-display, inherit) !important;
166
- display: none !important;
125
+ @media (min-width: 1400px) {
126
+ :where(.rs-box-hidden-from-xl) {
127
+ display: none !important;
128
+ }
167
129
  }
package/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## [5.78.1](https://github.com/rsuite/rsuite/compare/v5.78.0...v5.78.1) (2025-03-14)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **Uploader:** refine children prop type and improve class handling ([#4175](https://github.com/rsuite/rsuite/issues/4175)) ([58d3eea](https://github.com/rsuite/rsuite/commit/58d3eea86e186590586a14068773a8418fb5f3f9))
7
+
8
+
9
+
1
10
  # [5.78.0](https://github.com/rsuite/rsuite/compare/v5.77.1...v5.78.0) (2025-02-21)
2
11
 
3
12
 
@@ -139,7 +139,7 @@
139
139
  transition: opacity 0.1s linear, transform 0.1s ease-out;
140
140
  }
141
141
  .rs-popover.rs-anim-in {
142
- opacity: 1;
142
+ --rs-popover-opacity: 1;
143
143
  transition: opacity 0.15s linear, transform 0.15s ease-in;
144
144
  }
145
145
  .rs-theme-high-contrast .rs-popover {
@@ -36,7 +36,8 @@
36
36
  }
37
37
 
38
38
  &.rs-anim-in {
39
- opacity: 1;
39
+ --rs-popover-opacity: 1;
40
+
40
41
  transition:
41
42
  opacity 0.15s linear,
42
43
  transform 0.15s ease-in;
@@ -30,14 +30,16 @@ const NavbarMegaMenu = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
30
30
  withPrefix
31
31
  } = (0, _hooks.useStyles)(classPrefix);
32
32
  const classes = merge(className, withPrefix());
33
- const renderMenu = (0, _react.useCallback)((_ref, ref) => {
34
- let {
35
- onClose
36
- } = _ref;
33
+ const renderMenu = (0, _react.useCallback)((menuProps, ref) => {
34
+ const {
35
+ onClose,
36
+ className
37
+ } = menuProps;
37
38
  return /*#__PURE__*/_react.default.createElement(_Popover.default, {
38
39
  ref: ref,
39
40
  full: true,
40
- arrow: false
41
+ arrow: false,
42
+ className: className
41
43
  }, typeof children === 'function' ? children({
42
44
  onClose
43
45
  }) : children);
@@ -2,9 +2,11 @@ import React from 'react';
2
2
  import { ButtonProps } from '../Button';
3
3
  import type { UploaderLocale } from '../locales';
4
4
  export interface UploadTriggerProps extends ButtonProps {
5
+ children?: React.ReactElement<any>;
6
+ className?: string;
7
+ disabled?: boolean;
5
8
  name?: string;
6
9
  multiple?: boolean;
7
- disabled?: boolean;
8
10
  readOnly?: boolean;
9
11
  draggable?: boolean;
10
12
  accept?: string;
@@ -8,9 +8,11 @@ var _react = _interopRequireWildcard(require("react"));
8
8
  var _Button = _interopRequireDefault(require("../Button"));
9
9
  var _hooks = require("../internals/hooks");
10
10
  var _utils = require("../internals/utils");
11
+ var _classnames = _interopRequireDefault(require("classnames"));
11
12
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
12
13
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
14
  const UploadTrigger = (0, _utils.forwardRef)((props, ref) => {
15
+ var _children$props;
14
16
  const {
15
17
  as: Component = _Button.default,
16
18
  name,
@@ -34,11 +36,10 @@ const UploadTrigger = (0, _utils.forwardRef)((props, ref) => {
34
36
  const [dragOver, setDragOver] = (0, _react.useState)(false);
35
37
  const inputRef = (0, _react.useRef)(null);
36
38
  const {
37
- merge,
38
39
  withPrefix,
39
40
  prefix
40
41
  } = (0, _hooks.useStyles)(classPrefix);
41
- const classes = merge(className, withPrefix({
42
+ const classes = (0, _classnames.default)(className, withPrefix({
42
43
  disabled,
43
44
  customize: children,
44
45
  'drag-over': dragOver
@@ -82,19 +83,25 @@ const UploadTrigger = (0, _utils.forwardRef)((props, ref) => {
82
83
  root: rootRef.current,
83
84
  clearInput: handleClearInput
84
85
  }));
86
+
87
+ // Prepare button props with event handlers conditionally applied
85
88
  const buttonProps = {
86
89
  ...rest,
87
90
  disabled,
88
- className: prefix('btn')
91
+ className: prefix('btn'),
92
+ // Only add event handlers if component is interactive
93
+ ...(!disabled && !readOnly && {
94
+ onClick: handleClick,
95
+ onDragEnter: handleDragEnter,
96
+ onDragLeave: handleDragLeave,
97
+ onDragOver: handleDragOver,
98
+ onDrop: handleDrop
99
+ })
89
100
  };
90
- if (!disabled && !readOnly) {
91
- buttonProps.onClick = handleClick;
92
- buttonProps.onDragEnter = handleDragEnter;
93
- buttonProps.onDragLeave = handleDragLeave;
94
- buttonProps.onDragOver = handleDragOver;
95
- buttonProps.onDrop = handleDrop;
96
- }
97
- const trigger = children ? (/*#__PURE__*/_react.default.cloneElement(_react.default.Children.only(children), buttonProps)) : /*#__PURE__*/_react.default.createElement(Component, buttonProps, locale === null || locale === void 0 ? void 0 : locale.upload);
101
+ const trigger = children ? (/*#__PURE__*/_react.default.cloneElement(children, {
102
+ ...buttonProps,
103
+ className: (0, _classnames.default)((_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.className, prefix('btn'))
104
+ })) : /*#__PURE__*/_react.default.createElement(Component, buttonProps, locale === null || locale === void 0 ? void 0 : locale.upload);
98
105
  return /*#__PURE__*/_react.default.createElement("div", {
99
106
  ref: rootRef,
100
107
  className: classes
@@ -33,7 +33,7 @@ export interface UploaderProps extends WithAsProps, Omit<UploadTriggerProps, 'on
33
33
  /** Automatically upload files after selecting them */
34
34
  autoUpload?: boolean;
35
35
  /** Primary content */
36
- children?: React.ReactNode;
36
+ children?: React.ReactElement;
37
37
  /** List of uploaded files */
38
38
  defaultFileList?: FileType[];
39
39
  /** List of uploaded files (Controlled) */
@@ -3,9 +3,9 @@ import type { WithAsProps, Breakpoints, ColorScheme, Size } from '../types';
3
3
  export interface BoxProps extends WithAsProps {
4
4
  /** Override the 'as' prop when Box is used as a base component */
5
5
  componentAs?: WithAsProps['as'];
6
- /** Display element */
6
+ /** Breakpoint below which the component is hidden with `display: none` */
7
7
  visible?: Breakpoints;
8
- /** Hide element */
8
+ /** Breakpoint above which the component is hidden with `display: none` */
9
9
  hidden?: Breakpoints;
10
10
  /** Display property */
11
11
  display?: CSS['display'];
@@ -15,7 +15,6 @@ const Box = (0, _utils.forwardRef)((props, ref) => {
15
15
  classPrefix = 'box',
16
16
  className,
17
17
  children,
18
- componentAs,
19
18
  visible,
20
19
  hidden,
21
20
  style,
@@ -28,13 +27,12 @@ const Box = (0, _utils.forwardRef)((props, ref) => {
28
27
  withPrefix
29
28
  } = (0, _hooks.useStyles)(classPrefix);
30
29
  const classes = merge(className, withPrefix({
31
- [`visible-${visible}`]: visible,
32
- [`hidden-${hidden}`]: hidden
30
+ [`visible-from-${visible}`]: visible,
31
+ [`hidden-from-${hidden}`]: hidden
33
32
  }));
34
33
  const boxCSSVars = (0, _utils2.getBoxCSSVariables)(boxProps);
35
34
  const boxStyle = (0, _utils.mergeStyles)(style, boxCSSVars);
36
- const FinalComponent = componentAs || Component;
37
- return /*#__PURE__*/_react.default.createElement(FinalComponent, (0, _extends2.default)({
35
+ return /*#__PURE__*/_react.default.createElement(Component, (0, _extends2.default)({
38
36
  ref: ref,
39
37
  className: classes,
40
38
  style: boxStyle
@@ -10295,7 +10295,7 @@ textarea.rs-input {
10295
10295
  transition: opacity 0.1s linear, transform 0.1s ease-out;
10296
10296
  }
10297
10297
  .rs-popover.rs-anim-in {
10298
- opacity: 1;
10298
+ --rs-popover-opacity: 1;
10299
10299
  transition: opacity 0.15s linear, transform 0.15s ease-in;
10300
10300
  }
10301
10301
  .rs-theme-high-contrast .rs-popover {
@@ -14916,91 +14916,53 @@ kbd.rs-text {
14916
14916
  :where(.rs-box)[style*='--rs-box-shadow'] {
14917
14917
  box-shadow: var(--rs-box-shadow);
14918
14918
  }
14919
- :where(.rs-box-visible-xs) {
14920
- display: none !important;
14921
- }
14922
14919
  @media (max-width: 575px) {
14923
- :where(.rs-box-visible-xs) {
14924
- display: var(--rs-box-display, inherit) !important;
14925
- }
14926
- }
14927
- :where(.rs-box-visible-sm) {
14928
- display: none !important;
14929
- }
14930
- @media (max-width: 767px) {
14931
- :where(.rs-box-visible-sm) {
14932
- display: var(--rs-box-display, inherit) !important;
14933
- }
14934
- }
14935
- :where(.rs-box-visible-md) {
14936
- display: none !important;
14937
- }
14938
- @media (max-width: 991px) {
14939
- :where(.rs-box-visible-md) {
14940
- display: var(--rs-box-display, inherit) !important;
14941
- }
14942
- }
14943
- :where(.rs-box-visible-lg) {
14944
- display: none !important;
14945
- }
14946
- @media (max-width: 1199px) {
14947
- :where(.rs-box-visible-lg) {
14948
- display: var(--rs-box-display, inherit) !important;
14949
- }
14950
- }
14951
- :where(.rs-box-visible-xl) {
14952
- display: none !important;
14953
- }
14954
- @media (max-width: 1399px) {
14955
- :where(.rs-box-visible-xl) {
14956
- display: var(--rs-box-display, inherit) !important;
14920
+ :where(.rs-box-visible-from-xs) {
14921
+ display: none !important;
14957
14922
  }
14958
14923
  }
14959
- :where(.rs-box-visible-xxl) {
14960
- display: none !important;
14961
- display: var(--rs-box-display, inherit) !important;
14962
- }
14963
- :where(.rs-box-hidden-xs) {
14964
- display: var(--rs-box-display, inherit) !important;
14965
- }
14966
- @media (max-width: 575px) {
14967
- :where(.rs-box-hidden-xs) {
14924
+ @media (min-width: 576px) {
14925
+ :where(.rs-box-hidden-from-xs) {
14968
14926
  display: none !important;
14969
14927
  }
14970
14928
  }
14971
- :where(.rs-box-hidden-sm) {
14972
- display: var(--rs-box-display, inherit) !important;
14973
- }
14974
14929
  @media (max-width: 767px) {
14975
- :where(.rs-box-hidden-sm) {
14930
+ :where(.rs-box-visible-from-sm) {
14976
14931
  display: none !important;
14977
14932
  }
14978
14933
  }
14979
- :where(.rs-box-hidden-md) {
14980
- display: var(--rs-box-display, inherit) !important;
14934
+ @media (min-width: 768px) {
14935
+ :where(.rs-box-hidden-from-sm) {
14936
+ display: none !important;
14937
+ }
14981
14938
  }
14982
14939
  @media (max-width: 991px) {
14983
- :where(.rs-box-hidden-md) {
14940
+ :where(.rs-box-visible-from-md) {
14984
14941
  display: none !important;
14985
14942
  }
14986
14943
  }
14987
- :where(.rs-box-hidden-lg) {
14988
- display: var(--rs-box-display, inherit) !important;
14944
+ @media (min-width: 992px) {
14945
+ :where(.rs-box-hidden-from-md) {
14946
+ display: none !important;
14947
+ }
14989
14948
  }
14990
14949
  @media (max-width: 1199px) {
14991
- :where(.rs-box-hidden-lg) {
14950
+ :where(.rs-box-visible-from-lg) {
14992
14951
  display: none !important;
14993
14952
  }
14994
14953
  }
14995
- :where(.rs-box-hidden-xl) {
14996
- display: var(--rs-box-display, inherit) !important;
14954
+ @media (min-width: 1200px) {
14955
+ :where(.rs-box-hidden-from-lg) {
14956
+ display: none !important;
14957
+ }
14997
14958
  }
14998
14959
  @media (max-width: 1399px) {
14999
- :where(.rs-box-hidden-xl) {
14960
+ :where(.rs-box-visible-from-xl) {
15000
14961
  display: none !important;
15001
14962
  }
15002
14963
  }
15003
- :where(.rs-box-hidden-xxl) {
15004
- display: var(--rs-box-display, inherit) !important;
15005
- display: none !important;
14964
+ @media (min-width: 1400px) {
14965
+ :where(.rs-box-hidden-from-xl) {
14966
+ display: none !important;
14967
+ }
15006
14968
  }