@aloudata/aloudata-design 2.10.6 → 2.11.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.
- package/dist/Dropdown/index.d.ts +2 -1
- package/dist/Dropdown/index.js +5 -2
- package/dist/List/Item.d.ts +31 -0
- package/dist/List/Item.js +75 -0
- package/dist/List/index.d.ts +18 -0
- package/dist/List/index.js +135 -0
- package/dist/List/style/index.d.ts +2 -0
- package/dist/List/style/index.js +2 -0
- package/dist/List/style/index.less +120 -0
- package/dist/ScrollArea/index.js +3 -1
- package/dist/Spin/index.d.ts +1 -0
- package/dist/Spin/index.js +4 -3
- package/dist/ald.min.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.less +1 -0
- package/package.json +1 -1
package/dist/Dropdown/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OffsetOptions } from '@floating-ui/react';
|
|
1
|
+
import { OffsetOptions, UseHoverProps } from '@floating-ui/react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { MenuProps } from '../Menu';
|
|
4
4
|
import './style/index.less';
|
|
@@ -67,5 +67,6 @@ export interface IDropdownProps {
|
|
|
67
67
|
* @default false
|
|
68
68
|
*/
|
|
69
69
|
disabled?: boolean;
|
|
70
|
+
delay?: UseHoverProps['delay'];
|
|
70
71
|
}
|
|
71
72
|
export default function Dropdown(props: IDropdownProps): React.JSX.Element;
|
package/dist/Dropdown/index.js
CHANGED
|
@@ -37,7 +37,9 @@ export default function Dropdown(props) {
|
|
|
37
37
|
dropdownRender = props.dropdownRender,
|
|
38
38
|
disabled = props.disabled,
|
|
39
39
|
_props$offset = props.offset,
|
|
40
|
-
offsetProps = _props$offset === void 0 ? 4 : _props$offset
|
|
40
|
+
offsetProps = _props$offset === void 0 ? 4 : _props$offset,
|
|
41
|
+
_props$delay = props.delay,
|
|
42
|
+
delay = _props$delay === void 0 ? 0 : _props$delay;
|
|
41
43
|
var _useState = useState(open || false),
|
|
42
44
|
_useState2 = _slicedToArray(_useState, 2),
|
|
43
45
|
isOpen = _useState2[0],
|
|
@@ -69,7 +71,8 @@ export default function Dropdown(props) {
|
|
|
69
71
|
var click = useClick(context);
|
|
70
72
|
var hover = useHover(context, {
|
|
71
73
|
enabled: trigger === 'hover',
|
|
72
|
-
handleClose: safePolygon({})
|
|
74
|
+
handleClose: safePolygon({}),
|
|
75
|
+
delay: delay
|
|
73
76
|
});
|
|
74
77
|
var dismiss = useDismiss(context);
|
|
75
78
|
var role = useRole(context);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React, { CSSProperties, FC, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface ListItemProps extends Omit<HTMLAttributes<HTMLDivElement>, 'prefix'> {
|
|
3
|
+
className?: string;
|
|
4
|
+
classNames?: {
|
|
5
|
+
actions?: string;
|
|
6
|
+
prefix?: string;
|
|
7
|
+
};
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
style?: CSSProperties;
|
|
10
|
+
styles?: {
|
|
11
|
+
actions?: CSSProperties;
|
|
12
|
+
prefix?: CSSProperties;
|
|
13
|
+
};
|
|
14
|
+
actions?: ReactNode[];
|
|
15
|
+
prefix?: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
export interface ListItemMetaProps {
|
|
18
|
+
avatar?: ReactNode;
|
|
19
|
+
className?: string;
|
|
20
|
+
children?: ReactNode;
|
|
21
|
+
description?: ReactNode;
|
|
22
|
+
style?: CSSProperties;
|
|
23
|
+
title?: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export declare const Meta: FC<ListItemMetaProps>;
|
|
26
|
+
declare const InternalItem: React.ForwardRefExoticComponent<ListItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
27
|
+
export type ListItemTypeProps = typeof InternalItem & {
|
|
28
|
+
Meta: typeof Meta;
|
|
29
|
+
};
|
|
30
|
+
declare const Item: ListItemTypeProps;
|
|
31
|
+
export default Item;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["className", "avatar", "title", "description"],
|
|
3
|
+
_excluded2 = ["children", "actions", "styles", "className", "prefix", "classNames"];
|
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
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; }
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
9
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
10
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
11
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
12
|
+
import classnames from 'classnames';
|
|
13
|
+
import React from 'react';
|
|
14
|
+
export var Meta = function Meta(_ref) {
|
|
15
|
+
var className = _ref.className,
|
|
16
|
+
avatar = _ref.avatar,
|
|
17
|
+
title = _ref.title,
|
|
18
|
+
description = _ref.description,
|
|
19
|
+
others = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
+
var prefixCls = 'ald-list';
|
|
21
|
+
var classString = classnames("".concat(prefixCls, "-item-meta"), className);
|
|
22
|
+
var content = /*#__PURE__*/React.createElement("div", {
|
|
23
|
+
className: "".concat(prefixCls, "-item-meta-content")
|
|
24
|
+
}, title && /*#__PURE__*/React.createElement("div", {
|
|
25
|
+
className: classnames("".concat(prefixCls, "-item-meta-content-title"), _defineProperty({}, "".concat(prefixCls, "-item-meta-content-title-no-description"), !description))
|
|
26
|
+
}, title), description && /*#__PURE__*/React.createElement("div", {
|
|
27
|
+
className: "".concat(prefixCls, "-item-meta-content-description"),
|
|
28
|
+
title: typeof description === 'string' ? description : ''
|
|
29
|
+
}, description));
|
|
30
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, others, {
|
|
31
|
+
className: classString
|
|
32
|
+
}), avatar && /*#__PURE__*/React.createElement("div", {
|
|
33
|
+
className: "".concat(prefixCls, "-item-meta-avatar")
|
|
34
|
+
}, avatar), (title || description) && content);
|
|
35
|
+
};
|
|
36
|
+
var InternalItem = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
37
|
+
var children = props.children,
|
|
38
|
+
actions = props.actions,
|
|
39
|
+
styles = props.styles,
|
|
40
|
+
className = props.className,
|
|
41
|
+
prefix = props.prefix,
|
|
42
|
+
customizeClassNames = props.classNames,
|
|
43
|
+
others = _objectWithoutProperties(props, _excluded2);
|
|
44
|
+
var moduleClass = function moduleClass(moduleName) {
|
|
45
|
+
return classnames(customizeClassNames === null || customizeClassNames === void 0 ? void 0 : customizeClassNames[moduleName]);
|
|
46
|
+
};
|
|
47
|
+
var moduleStyle = function moduleStyle(moduleName) {
|
|
48
|
+
return _objectSpread({}, styles === null || styles === void 0 ? void 0 : styles[moduleName]);
|
|
49
|
+
};
|
|
50
|
+
var prefixCls = 'ald-list';
|
|
51
|
+
var actionsContent = actions && actions.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
52
|
+
className: classnames("".concat(prefixCls, "-item-action"), moduleClass('actions')),
|
|
53
|
+
key: "actions",
|
|
54
|
+
style: moduleStyle('actions')
|
|
55
|
+
}, actions.map(function (action, i) {
|
|
56
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
57
|
+
key: "".concat(prefixCls, "-item-action-").concat(i)
|
|
58
|
+
}, action, i !== actions.length - 1 && /*#__PURE__*/React.createElement("em", {
|
|
59
|
+
className: "".concat(prefixCls, "-item-action-split")
|
|
60
|
+
}));
|
|
61
|
+
}));
|
|
62
|
+
var prefixContent = prefix && /*#__PURE__*/React.createElement("div", {
|
|
63
|
+
className: classnames("".concat(prefixCls, "-item-prefix"), moduleClass('prefix')),
|
|
64
|
+
style: moduleStyle('prefix'),
|
|
65
|
+
key: "prefix"
|
|
66
|
+
}, prefix);
|
|
67
|
+
var itemChildren = /*#__PURE__*/React.createElement("div", _extends({}, others, {
|
|
68
|
+
ref: ref,
|
|
69
|
+
className: classnames("".concat(prefixCls, "-item"), className)
|
|
70
|
+
}), [prefixContent, children, actionsContent]);
|
|
71
|
+
return itemChildren;
|
|
72
|
+
});
|
|
73
|
+
var Item = InternalItem;
|
|
74
|
+
Item.Meta = Meta;
|
|
75
|
+
export default Item;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare function List<T>(props: ListProps<T>): React.JSX.Element;
|
|
3
|
+
declare namespace List {
|
|
4
|
+
var Item: import("./Item").ListItemTypeProps;
|
|
5
|
+
}
|
|
6
|
+
export default List;
|
|
7
|
+
export interface ListProps<T> {
|
|
8
|
+
size?: 'default' | 'small';
|
|
9
|
+
rowKey?: ((item: T) => React.Key) | keyof T;
|
|
10
|
+
renderItem?: (item: T, index: number) => React.ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
dataSource?: T[];
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
loading?: boolean;
|
|
15
|
+
dividerGap?: number;
|
|
16
|
+
virtual?: boolean;
|
|
17
|
+
itemHeight?: number | ((item: T) => number);
|
|
18
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
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; }
|
|
3
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
4
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
5
|
+
import { useVirtualizer } from '@tanstack/react-virtual';
|
|
6
|
+
import classNames from 'classnames';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import ScrollArea from "../ScrollArea";
|
|
9
|
+
import Spin from "../Spin";
|
|
10
|
+
import Item from "./Item";
|
|
11
|
+
function List(props) {
|
|
12
|
+
var _props$dataSource = props.dataSource,
|
|
13
|
+
dataSource = _props$dataSource === void 0 ? [] : _props$dataSource,
|
|
14
|
+
renderItem = props.renderItem,
|
|
15
|
+
bordered = props.bordered,
|
|
16
|
+
customizeSize = props.size,
|
|
17
|
+
rowKey = props.rowKey,
|
|
18
|
+
children = props.children,
|
|
19
|
+
className = props.className,
|
|
20
|
+
_props$dividerGap = props.dividerGap,
|
|
21
|
+
dividerGap = _props$dividerGap === void 0 ? 0 : _props$dividerGap,
|
|
22
|
+
_props$loading = props.loading,
|
|
23
|
+
loading = _props$loading === void 0 ? false : _props$loading,
|
|
24
|
+
virtual = props.virtual,
|
|
25
|
+
_props$itemHeight = props.itemHeight,
|
|
26
|
+
itemHeight = _props$itemHeight === void 0 ? 50 : _props$itemHeight;
|
|
27
|
+
var parentRef = React.useRef(null);
|
|
28
|
+
var measureElement = function measureElement(element) {
|
|
29
|
+
return element.offsetHeight;
|
|
30
|
+
};
|
|
31
|
+
var rowVirtualizer = useVirtualizer({
|
|
32
|
+
count: dividerGap === 0 ? dataSource.length : dataSource.length * 2 - 1,
|
|
33
|
+
getScrollElement: function getScrollElement() {
|
|
34
|
+
return parentRef.current;
|
|
35
|
+
},
|
|
36
|
+
estimateSize: function estimateSize(index) {
|
|
37
|
+
if (dividerGap === 0) {
|
|
38
|
+
return typeof itemHeight === 'function' ? itemHeight(dataSource[index]) : itemHeight;
|
|
39
|
+
}
|
|
40
|
+
if (index % 2 === 0) {
|
|
41
|
+
return typeof itemHeight === 'function' ? itemHeight(dataSource[Math.floor(index / 2)]) : itemHeight;
|
|
42
|
+
}
|
|
43
|
+
return 1;
|
|
44
|
+
},
|
|
45
|
+
measureElement: measureElement,
|
|
46
|
+
gap: dividerGap
|
|
47
|
+
});
|
|
48
|
+
function getKey(currentItem, currentIndex) {
|
|
49
|
+
var key;
|
|
50
|
+
if (typeof rowKey === 'function') {
|
|
51
|
+
key = rowKey(currentItem);
|
|
52
|
+
} else if (rowKey) {
|
|
53
|
+
key = currentItem[rowKey];
|
|
54
|
+
} else {
|
|
55
|
+
key = currentItem.key;
|
|
56
|
+
}
|
|
57
|
+
if (!key) {
|
|
58
|
+
key = "list-item-".concat(currentIndex);
|
|
59
|
+
}
|
|
60
|
+
return key;
|
|
61
|
+
}
|
|
62
|
+
var size = customizeSize || 'default';
|
|
63
|
+
var customizeClassNames = classNames('ald-list', _defineProperty({
|
|
64
|
+
'ald-list-bordered': bordered
|
|
65
|
+
}, "ald-list-".concat(size), size), className);
|
|
66
|
+
if (virtual) {
|
|
67
|
+
var renderInnerItem = function renderInnerItem(index) {
|
|
68
|
+
if (!renderItem) return null;
|
|
69
|
+
if (dividerGap === 0) {
|
|
70
|
+
var _item = dataSource[index];
|
|
71
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
72
|
+
key: getKey(_item, index)
|
|
73
|
+
}, renderItem(_item, index));
|
|
74
|
+
} else {
|
|
75
|
+
var isDivider = index % 2 === 1;
|
|
76
|
+
if (isDivider) {
|
|
77
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
78
|
+
className: "ald-list-divider",
|
|
79
|
+
key: "divider-".concat(index)
|
|
80
|
+
});
|
|
81
|
+
} else {
|
|
82
|
+
var itemIndex = Math.floor(index / 2);
|
|
83
|
+
var _item2 = dataSource[itemIndex];
|
|
84
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
85
|
+
key: getKey(_item2, itemIndex)
|
|
86
|
+
}, renderItem(_item2, itemIndex));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
return /*#__PURE__*/React.createElement(ScrollArea, {
|
|
91
|
+
ref: parentRef,
|
|
92
|
+
asChild: true,
|
|
93
|
+
className: "ald-list-virtual",
|
|
94
|
+
innerClassName: customizeClassNames
|
|
95
|
+
}, /*#__PURE__*/React.createElement(Spin, {
|
|
96
|
+
spinning: loading,
|
|
97
|
+
wrapperClassName: "ald-list-item-wrap",
|
|
98
|
+
style: {
|
|
99
|
+
rowGap: dividerGap,
|
|
100
|
+
height: "".concat(rowVirtualizer.getTotalSize(), "px")
|
|
101
|
+
}
|
|
102
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, rowVirtualizer.getVirtualItems().map(function (virtualItem) {
|
|
103
|
+
var index = virtualItem.index;
|
|
104
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
105
|
+
key: virtualItem.key,
|
|
106
|
+
style: {
|
|
107
|
+
position: 'absolute',
|
|
108
|
+
top: 0,
|
|
109
|
+
left: 0,
|
|
110
|
+
width: '100%',
|
|
111
|
+
height: "".concat(virtualItem.size, "px"),
|
|
112
|
+
transform: "translateY(".concat(virtualItem.start, "px)")
|
|
113
|
+
}
|
|
114
|
+
}, renderInnerItem(index));
|
|
115
|
+
}), children)));
|
|
116
|
+
}
|
|
117
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
118
|
+
ref: parentRef,
|
|
119
|
+
className: customizeClassNames
|
|
120
|
+
}, /*#__PURE__*/React.createElement(Spin, {
|
|
121
|
+
spinning: loading,
|
|
122
|
+
wrapperClassName: "ald-list-item-wrap",
|
|
123
|
+
style: {
|
|
124
|
+
rowGap: dividerGap
|
|
125
|
+
}
|
|
126
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, dataSource.map(function (item, index) {
|
|
127
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
128
|
+
key: getKey(item, index)
|
|
129
|
+
}, renderItem ? renderItem(item, index) : null, index !== dataSource.length - 1 && dividerGap > 0 && /*#__PURE__*/React.createElement("div", {
|
|
130
|
+
className: "ald-list-divider"
|
|
131
|
+
}));
|
|
132
|
+
}), children)));
|
|
133
|
+
}
|
|
134
|
+
List.Item = Item;
|
|
135
|
+
export default List;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
@import '../../style/index.less';
|
|
2
|
+
@import '../../Spin/style/index.less';
|
|
3
|
+
@import '../../ScrollArea/style/index.less';
|
|
4
|
+
|
|
5
|
+
.ald-list-virtual {
|
|
6
|
+
.ald-list {
|
|
7
|
+
height: 100%;
|
|
8
|
+
display: block !important;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.ald-list {
|
|
13
|
+
font-size: 14px;
|
|
14
|
+
|
|
15
|
+
&-item {
|
|
16
|
+
display: flex;
|
|
17
|
+
padding: var(--alias-padding-75, 6px) var(--alias-padding-100, 8px);
|
|
18
|
+
align-items: center;
|
|
19
|
+
border-radius: var(--alias-radius-75, 6px);
|
|
20
|
+
gap: var(--alias-spacing-75, 6px);
|
|
21
|
+
|
|
22
|
+
&-prefix {
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: flex-start;
|
|
25
|
+
align-self: stretch;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
padding: 2px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&-meta {
|
|
31
|
+
flex: 1;
|
|
32
|
+
min-width: 0;
|
|
33
|
+
display: flex;
|
|
34
|
+
gap: var(--alias-spacing-75, 6px);
|
|
35
|
+
align-items: center;
|
|
36
|
+
|
|
37
|
+
&-avatar {
|
|
38
|
+
display: flex;
|
|
39
|
+
align-self: stretch;
|
|
40
|
+
align-items: flex-start;
|
|
41
|
+
justify-content: center;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
flex: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&-content {
|
|
47
|
+
min-width: 0;
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
gap: var(--alias-spacing-50, 4px);
|
|
51
|
+
align-items: flex-start;
|
|
52
|
+
justify-content: stretch;
|
|
53
|
+
|
|
54
|
+
&-title {
|
|
55
|
+
font-size: 14px;
|
|
56
|
+
font-weight: 500;
|
|
57
|
+
line-height: 20px;
|
|
58
|
+
overflow: hidden;
|
|
59
|
+
white-space: nowrap;
|
|
60
|
+
text-overflow: ellipsis;
|
|
61
|
+
max-width: 100%;
|
|
62
|
+
|
|
63
|
+
&-no-description {
|
|
64
|
+
font-weight: 400;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&-description {
|
|
69
|
+
font-size: 12px;
|
|
70
|
+
font-weight: 400;
|
|
71
|
+
line-height: 16px;
|
|
72
|
+
overflow: hidden;
|
|
73
|
+
white-space: nowrap;
|
|
74
|
+
text-overflow: ellipsis;
|
|
75
|
+
max-width: 100%;
|
|
76
|
+
color: var(--alias-colors-text-subtlest, #9ca3af);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&-action {
|
|
82
|
+
display: flex;
|
|
83
|
+
gap: var(--alias-spacing-100, 8px);
|
|
84
|
+
align-items: center;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&-divider {
|
|
89
|
+
height: 1px;
|
|
90
|
+
background-color: var(--alias-colors-border-subtle, #f3f4f6);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.ald-list-item-wrap {
|
|
94
|
+
display: flex;
|
|
95
|
+
flex-direction: column;
|
|
96
|
+
align-items: stretch;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.ald-list-small {
|
|
101
|
+
.ald-list-item {
|
|
102
|
+
gap: var(--alias-spacing-75, 6px);
|
|
103
|
+
|
|
104
|
+
&-meta {
|
|
105
|
+
gap: var(--alias-spacing-75, 6px);
|
|
106
|
+
|
|
107
|
+
&-avatar {
|
|
108
|
+
padding: 2px 0;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&-content {
|
|
112
|
+
gap: var(--alias-spacing-25, 2px);
|
|
113
|
+
|
|
114
|
+
&-title {
|
|
115
|
+
font-size: 12px;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
package/dist/ScrollArea/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["children", "className", "innerClassName", "horizontalScrollBarClassName", "verticalScrollBarClassName", "onViewportScroll", "contentDeterminesWidth", "scrollBarHidden"];
|
|
1
|
+
var _excluded = ["children", "className", "innerClassName", "horizontalScrollBarClassName", "verticalScrollBarClassName", "onViewportScroll", "contentDeterminesWidth", "scrollBarHidden", "asChild"];
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -14,6 +14,7 @@ var ScrollArea = function ScrollArea(props, ref) {
|
|
|
14
14
|
onViewportScroll = props.onViewportScroll,
|
|
15
15
|
contentDeterminesWidth = props.contentDeterminesWidth,
|
|
16
16
|
scrollBarHidden = props.scrollBarHidden,
|
|
17
|
+
asChild = props.asChild,
|
|
17
18
|
rest = _objectWithoutProperties(props, _excluded);
|
|
18
19
|
var isHorizontalScrollBarHidden = scrollBarHidden === null || scrollBarHidden === void 0 ? void 0 : scrollBarHidden.includes('horizontal');
|
|
19
20
|
var isVerticalScrollBarHidden = scrollBarHidden === null || scrollBarHidden === void 0 ? void 0 : scrollBarHidden.includes('vertical');
|
|
@@ -21,6 +22,7 @@ var ScrollArea = function ScrollArea(props, ref) {
|
|
|
21
22
|
scrollHideDelay: 50,
|
|
22
23
|
className: classNames('ald-scroll-area', className)
|
|
23
24
|
}), /*#__PURE__*/React.createElement(ScrollAreaComponent.Viewport, {
|
|
25
|
+
asChild: asChild,
|
|
24
26
|
className: classNames('ald-scroll-area-inner', {
|
|
25
27
|
'ald-scroll-area-width-auto': !contentDeterminesWidth
|
|
26
28
|
}, innerClassName),
|
package/dist/Spin/index.d.ts
CHANGED
package/dist/Spin/index.js
CHANGED
|
@@ -16,7 +16,8 @@ function CustomSpin(props) {
|
|
|
16
16
|
children = props.children,
|
|
17
17
|
spinning = props.spinning,
|
|
18
18
|
wrapperClassName = props.wrapperClassName,
|
|
19
|
-
className = props.className
|
|
19
|
+
className = props.className,
|
|
20
|
+
style = props.style;
|
|
20
21
|
if (!children) {
|
|
21
22
|
return CustomIcon({
|
|
22
23
|
size: size,
|
|
@@ -31,9 +32,9 @@ function CustomSpin(props) {
|
|
|
31
32
|
}
|
|
32
33
|
if (isFragment(children) || isReactComponent(children)) {
|
|
33
34
|
return /*#__PURE__*/React.createElement('div', {
|
|
34
|
-
style: {
|
|
35
|
+
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
35
36
|
position: 'relative'
|
|
36
|
-
},
|
|
37
|
+
}),
|
|
37
38
|
className: classNames(wrapperClassName)
|
|
38
39
|
}, [children, CustomIcon({
|
|
39
40
|
size: size,
|