@lobehub/ui 2.8.3 → 2.8.5

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.
@@ -114,8 +114,8 @@ var Collapse = /*#__PURE__*/memo(function (_ref) {
114
114
  theme: {
115
115
  components: {
116
116
  Collapse: {
117
- contentPadding: _typeof(padding) === 'object' ? getPadding(padding === null || padding === void 0 ? void 0 : padding.body) : padding,
118
- headerPadding: _typeof(padding) === 'object' ? getPadding(padding === null || padding === void 0 ? void 0 : padding.header) : padding
117
+ contentPadding: getPadding(_typeof(padding) === 'object' ? padding === null || padding === void 0 ? void 0 : padding.body : padding),
118
+ headerPadding: getPadding(_typeof(padding) === 'object' ? padding === null || padding === void 0 ? void 0 : padding.header : padding)
119
119
  }
120
120
  }
121
121
  },
@@ -1,5 +1,5 @@
1
1
  export declare const DEFAULT_PADDING = "12px 16px";
2
- export declare const getPadding: (padding?: number | string) => string | number;
2
+ export declare const getPadding: (padding?: number | string) => string;
3
3
  export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
4
4
  borderless: import("antd-style").SerializedStyles;
5
5
  desc: import("antd-style").SerializedStyles;
@@ -3,7 +3,7 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
3
3
  import { createStyles } from 'antd-style';
4
4
  export var DEFAULT_PADDING = '12px 16px';
5
5
  export var getPadding = function getPadding(padding) {
6
- return !padding && padding !== 0 ? DEFAULT_PADDING : padding;
6
+ return !padding && padding !== 0 ? DEFAULT_PADDING : "".concat(typeof padding === 'string' ? padding : "".concat(padding, "px"), " !important");
7
7
  };
8
8
  export var useStyles = createStyles(function (_ref) {
9
9
  var css = _ref.css,
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
- var _excluded = ["className", "children", "orientation", "hideScrollBar", "size", "offset", "visibility", "isEnabled", "onVisibilityChange", "style"];
4
+ var _excluded = ["className", "children", "orientation", "hideScrollBar", "size", "offset", "visibility", "isEnabled", "onVisibilityChange", "style", "ref"];
5
5
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6
6
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
7
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -12,6 +12,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
12
12
  import { cva } from 'class-variance-authority';
13
13
  import { memo, useMemo, useRef } from 'react';
14
14
  import { Flexbox } from 'react-layout-kit';
15
+ import { mergeRefs } from 'react-merge-refs';
15
16
  import { useStyles } from "./style";
16
17
  import { useScrollOverflow } from "./useScrollOverflow";
17
18
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -32,6 +33,7 @@ var ScrollShadow = /*#__PURE__*/memo(function (_ref) {
32
33
  isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled,
33
34
  onVisibilityChange = _ref.onVisibilityChange,
34
35
  style = _ref.style,
36
+ ref = _ref.ref,
35
37
  rest = _objectWithoutProperties(_ref, _excluded);
36
38
  var _useStyles = useStyles(size),
37
39
  cx = _useStyles.cx,
@@ -143,7 +145,7 @@ var ScrollShadow = /*#__PURE__*/memo(function (_ref) {
143
145
  orientation: orientation,
144
146
  scrollPosition: scrollPosition
145
147
  }), className),
146
- ref: domRef,
148
+ ref: mergeRefs([domRef, ref]),
147
149
  style: style
148
150
  }, dataAttributes), rest), {}, {
149
151
  children: children
@@ -1,3 +1,4 @@
1
+ import type { Ref } from 'react';
1
2
  import type { FlexboxProps } from 'react-layout-kit';
2
3
  export interface ScrollShadowProps extends FlexboxProps {
3
4
  hideScrollBar?: boolean;
@@ -10,6 +11,7 @@ export interface ScrollShadowProps extends FlexboxProps {
10
11
  top?: boolean;
11
12
  }) => void;
12
13
  orientation?: 'vertical' | 'horizontal';
14
+ ref?: Ref<HTMLDivElement>;
13
15
  size?: number;
14
16
  visibility?: 'auto' | 'always' | 'never';
15
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "2.8.3",
3
+ "version": "2.8.5",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",