@lobehub/ui 1.159.0 → 1.161.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/es/A/index.js +2 -2
- package/es/ActionIcon/index.d.ts +5 -2
- package/es/ActionIcon/index.js +25 -19
- package/es/ActionIconGroup/index.js +47 -45
- package/es/Alert/index.js +50 -43
- package/es/Avatar/index.js +12 -10
- package/es/Burger/index.js +35 -30
- package/es/CodeEditor/index.js +43 -38
- package/es/Collapse/index.js +3 -3
- package/es/ColorScales/ScaleRow.js +43 -39
- package/es/ColorScales/index.js +59 -57
- package/es/ConfigProvider/index.js +5 -3
- package/es/ContextMenu/index.js +3 -2
- package/es/CopyButton/index.js +4 -3
- package/es/DraggablePanel/components/DraggablePanelBody.js +3 -2
- package/es/DraggablePanel/components/DraggablePanelContainer.js +3 -2
- package/es/DraggablePanel/components/DraggablePanelFooter.js +3 -2
- package/es/DraggablePanel/components/DraggablePanelHeader.js +9 -5
- package/es/DraggablePanel/index.js +32 -25
- package/es/EditableText/index.js +16 -13
- package/es/EmojiPicker/AvatarUploader.js +71 -60
- package/es/EmojiPicker/index.js +110 -101
- package/es/EmptyCard/index.js +31 -23
- package/es/FileTypeIcon/index.js +55 -44
- package/es/FluentEmoji/index.js +6 -4
- package/es/Footer/index.js +10 -8
- package/es/Form/components/FormDivider.js +2 -2
- package/es/Form/components/FormFlatGroup.js +9 -4
- package/es/Form/components/FormFooter.js +6 -3
- package/es/Form/components/FormGroup.js +21 -15
- package/es/Form/components/FormItem.js +17 -10
- package/es/Form/components/FormTitle.js +23 -15
- package/es/Form/index.js +30 -26
- package/es/FormModal/index.js +34 -30
- package/es/Grid/index.js +6 -3
- package/es/Header/index.js +65 -49
- package/es/Highlighter/FullFeatured.js +51 -41
- package/es/Highlighter/SyntaxHighlighter/index.js +30 -19
- package/es/Highlighter/index.js +29 -19
- package/es/Icon/icons/DiscordIcon.js +3 -2
- package/es/Icon/index.js +16 -13
- package/es/Image/ImageGallery.js +5 -3
- package/es/Image/Preview.js +5 -3
- package/es/Image/index.js +38 -34
- package/es/Image/usePreview.js +37 -33
- package/es/Img/index.js +2 -2
- package/es/Input/index.js +3 -3
- package/es/Layout/index.js +63 -35
- package/es/List/ListItem/index.js +67 -53
- package/es/Markdown/CodeBlock.js +16 -10
- package/es/Markdown/Typography.js +6 -3
- package/es/Markdown/index.js +22 -18
- package/es/MaterialFileTypeIcon/index.js +20 -17
- package/es/MaterialFileTypeIcon/utils.d.ts +2 -2
- package/es/Mermaid/FullFeatured.js +45 -35
- package/es/Mermaid/index.js +26 -17
- package/es/Mermaid/useMermaid.d.ts +1 -2
- package/es/Mermaid/useMermaid.js +5 -3
- package/es/Modal/index.js +60 -48
- package/es/SearchBar/index.js +51 -47
- package/es/SelectWithImg/index.js +40 -34
- package/es/SideNav/index.js +22 -15
- package/es/SliderWithInput/index.js +38 -35
- package/es/Snippet/index.js +15 -10
- package/es/SortableList/DragHandle.js +3 -3
- package/es/SortableList/SortableItem.js +19 -16
- package/es/SortableList/SortableOverlay.js +5 -3
- package/es/SortableList/index.js +23 -15
- package/es/Swatches/index.js +20 -18
- package/es/TabsNav/index.js +3 -2
- package/es/Tag/index.js +12 -7
- package/es/ThemeProvider/Meta.js +58 -53
- package/es/ThemeProvider/index.js +23 -17
- package/es/ThemeSwitch/index.js +19 -15
- package/es/Toc/TocMobile.js +52 -47
- package/es/Toc/index.js +13 -8
- package/es/Tooltip/index.js +6 -3
- package/es/Video/index.js +47 -41
- package/es/awesome/AuroraBackground/index.js +18 -11
- package/es/awesome/Features/Item.js +45 -37
- package/es/awesome/Features/index.js +4 -5
- package/es/awesome/GaussianBackground/index.js +13 -8
- package/es/awesome/Giscus/index.js +15 -13
- package/es/awesome/GradientButton/index.js +9 -5
- package/es/awesome/GridBackground/Grid.js +61 -49
- package/es/awesome/GridBackground/GridShowcase.js +28 -24
- package/es/awesome/GridBackground/index.js +33 -27
- package/es/awesome/Hero/index.js +74 -63
- package/es/awesome/Spline/ParentSize.js +8 -7
- package/es/awesome/Spline/index.js +13 -10
- package/es/awesome/Spotlight/index.js +3 -2
- package/es/awesome/SpotlightCard/SpotlightCardItem.js +8 -5
- package/es/awesome/SpotlightCard/index.js +12 -9
- package/es/brand/BrandLoading/index.js +3 -2
- package/es/brand/LobeChat/index.js +38 -29
- package/es/brand/LobeChatText/index.js +13 -8
- package/es/brand/LobeHub/index.js +38 -29
- package/es/brand/LobeHubText/index.js +9 -4
- package/es/brand/Logo3d/index.js +3 -2
- package/es/brand/LogoFlat/index.js +49 -44
- package/es/brand/LogoMono/index.js +53 -48
- package/es/brand/LogoThree/Loading.js +11 -9
- package/es/brand/LogoThree/LogoSpline.js +12 -10
- package/es/brand/LogoThree/index.js +25 -23
- package/es/brand/components/Divider.js +6 -4
- package/es/chat/BackBottom/index.js +6 -4
- package/es/chat/ChatHeader/ChatHeaderTitle.js +31 -22
- package/es/chat/ChatHeader/index.js +42 -35
- package/es/chat/ChatInputArea/ChatInputActionBar.js +21 -16
- package/es/chat/ChatInputArea/ChatInputArea.js +23 -19
- package/es/chat/ChatInputArea/ChatInputAreaInner.js +3 -2
- package/es/chat/ChatInputArea/SendButton.js +51 -36
- package/es/chat/ChatItem/components/Actions.js +5 -3
- package/es/chat/ChatItem/components/Avatar.js +21 -17
- package/es/chat/ChatItem/components/BorderSpacing.js +2 -1
- package/es/chat/ChatItem/components/ErrorContent.js +11 -9
- package/es/chat/ChatItem/components/Loading.js +12 -10
- package/es/chat/ChatItem/components/MessageContent.js +10 -6
- package/es/chat/ChatItem/components/Title.js +8 -3
- package/es/chat/ChatItem/index.js +53 -47
- package/es/chat/ChatList/ActionsBar.js +3 -2
- package/es/chat/ChatList/HistoryDivider.js +11 -6
- package/es/chat/ChatList/Item.js +12 -14
- package/es/chat/ChatList/index.js +29 -25
- package/es/chat/EditableMessage/index.js +32 -26
- package/es/chat/EditableMessageList/index.js +76 -72
- package/es/chat/MessageInput/index.js +43 -35
- package/es/chat/MessageModal/index.js +51 -41
- package/es/chat/TokenTag/index.js +11 -7
- package/es/components/ControlInput.js +22 -18
- package/es/hooks/useHighlight.d.ts +1 -1
- package/es/mdx/Callout/index.js +19 -13
- package/es/mdx/Cards/Card.js +59 -46
- package/es/mdx/Cards/index.js +6 -3
- package/es/mdx/FileTree/File.js +11 -5
- package/es/mdx/FileTree/Folder.js +22 -13
- package/es/mdx/FileTree/index.js +6 -3
- package/es/mdx/Mdx/index.js +9 -7
- package/es/mdx/Steps/index.js +6 -3
- package/es/mdx/Tabs/Tab.js +8 -3
- package/es/mdx/Tabs/index.js +21 -17
- package/es/mdx/mdxComponents/CodeBlock.js +14 -9
- package/es/mdx/mdxComponents/Image.js +2 -2
- package/es/mdx/mdxComponents/Link.js +3 -2
- package/es/mdx/mdxComponents/Pre.js +14 -7
- package/es/mdx/mdxComponents/Video.js +2 -2
- package/es/mobile/MobileChatInputArea/SendButton.js +4 -3
- package/es/mobile/MobileChatInputArea/index.js +79 -69
- package/es/mobile/MobileNavBar/MobileNavBarTitle.js +37 -26
- package/es/mobile/MobileNavBar/index.js +48 -41
- package/es/mobile/MobileSafeArea/index.js +3 -2
- package/es/mobile/MobileTabBar/index.js +35 -29
- package/es/storybook/StoryBook/index.js +26 -19
- package/package.json +21 -22
package/es/SearchBar/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
5
5
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
6
6
|
var _excluded = ["defaultValue", "spotlight", "className", "value", "onInputChange", "placeholder", "enableShortKey", "shortKey", "onSearch", "loading", "style", "onChange", "onBlur", "onPressEnter", "onFocus", "styles", "classNames"];
|
|
@@ -12,6 +12,8 @@ import { Input } from "../Input";
|
|
|
12
12
|
import Tag from "../Tag";
|
|
13
13
|
import Spotlight from "../awesome/Spotlight";
|
|
14
14
|
import { useStyles } from "./style";
|
|
15
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
17
|
var SearchBar = /*#__PURE__*/memo(function (_ref) {
|
|
16
18
|
var defaultValue = _ref.defaultValue,
|
|
17
19
|
spotlight = _ref.spotlight,
|
|
@@ -77,53 +79,55 @@ var SearchBar = /*#__PURE__*/memo(function (_ref) {
|
|
|
77
79
|
return document.removeEventListener('keydown', handler);
|
|
78
80
|
};
|
|
79
81
|
}, []);
|
|
80
|
-
return /*#__PURE__*/
|
|
82
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
81
83
|
className: cx(styles.search, className),
|
|
82
|
-
style: style
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
84
|
+
style: style,
|
|
85
|
+
children: [spotlight && /*#__PURE__*/_jsx(Spotlight, {}), /*#__PURE__*/_jsx(Input, _objectSpread({
|
|
86
|
+
allowClear: true,
|
|
87
|
+
className: cx(styles.input, inputClassName),
|
|
88
|
+
onBlur: function onBlur(e) {
|
|
89
|
+
_onBlur === null || _onBlur === void 0 || _onBlur(e);
|
|
90
|
+
setInputValue(e.target.value);
|
|
91
|
+
if (!e.target.value) {
|
|
92
|
+
setShowTag(true);
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
onChange: function onChange(e) {
|
|
96
|
+
_onChange === null || _onChange === void 0 || _onChange(e);
|
|
97
|
+
setInputValue(e.target.value);
|
|
98
|
+
if (e.target.value) {
|
|
99
|
+
setShowTag(false);
|
|
100
|
+
} else {
|
|
101
|
+
setShowTag(true);
|
|
102
|
+
onSearch === null || onSearch === void 0 || onSearch(e.target.value);
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
onFocus: function onFocus(e) {
|
|
106
|
+
_onFocus === null || _onFocus === void 0 || _onFocus(e);
|
|
97
107
|
setShowTag(false);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
})
|
|
121
|
-
|
|
122
|
-
style: inputStyle,
|
|
123
|
-
value: value
|
|
124
|
-
}, rest)), enableShortKey && showTag && !inputValue && /*#__PURE__*/React.createElement(Tag, {
|
|
125
|
-
className: cx(styles.tag, shortKeyClassName),
|
|
126
|
-
style: shortKeyStyle
|
|
127
|
-
}, symbol, " ", shortKey.toUpperCase()));
|
|
108
|
+
},
|
|
109
|
+
onPressEnter: function onPressEnter(e) {
|
|
110
|
+
_onPressEnter === null || _onPressEnter === void 0 || _onPressEnter(e);
|
|
111
|
+
onSearch === null || onSearch === void 0 || onSearch(inputValue);
|
|
112
|
+
},
|
|
113
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : 'Type keywords...',
|
|
114
|
+
prefix: /*#__PURE__*/_jsx(Icon, {
|
|
115
|
+
className: styles.icon,
|
|
116
|
+
icon: loading ? LucideLoader2 : Search,
|
|
117
|
+
size: "small",
|
|
118
|
+
spin: loading,
|
|
119
|
+
style: {
|
|
120
|
+
marginRight: 4
|
|
121
|
+
}
|
|
122
|
+
}),
|
|
123
|
+
ref: inputReference,
|
|
124
|
+
style: inputStyle,
|
|
125
|
+
value: value
|
|
126
|
+
}, rest)), enableShortKey && showTag && !inputValue && /*#__PURE__*/_jsxs(Tag, {
|
|
127
|
+
className: cx(styles.tag, shortKeyClassName),
|
|
128
|
+
style: shortKeyStyle,
|
|
129
|
+
children: [symbol, " ", shortKey.toUpperCase()]
|
|
130
|
+
})]
|
|
131
|
+
});
|
|
128
132
|
});
|
|
129
133
|
export default SearchBar;
|
|
@@ -8,6 +8,8 @@ import useControlledState from 'use-merge-value';
|
|
|
8
8
|
import Icon from "../Icon";
|
|
9
9
|
import Img from "../Img";
|
|
10
10
|
import { useStyles } from "./styles";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
13
|
var SelectWithImg = /*#__PURE__*/memo(function (_ref) {
|
|
12
14
|
var className = _ref.className,
|
|
13
15
|
style = _ref.style,
|
|
@@ -35,42 +37,46 @@ var SelectWithImg = /*#__PURE__*/memo(function (_ref) {
|
|
|
35
37
|
var _useStyles = useStyles(),
|
|
36
38
|
styles = _useStyles.styles,
|
|
37
39
|
cx = _useStyles.cx;
|
|
38
|
-
return /*#__PURE__*/
|
|
40
|
+
return /*#__PURE__*/_jsx(Flexbox, {
|
|
39
41
|
className: className,
|
|
40
42
|
gap: 16,
|
|
41
43
|
horizontal: true,
|
|
42
|
-
style: style
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
44
|
+
style: style,
|
|
45
|
+
children: options === null || options === void 0 ? void 0 : options.map(function (item) {
|
|
46
|
+
var isActive = item.value === currentValue;
|
|
47
|
+
return /*#__PURE__*/_jsxs(Flexbox, {
|
|
48
|
+
align: 'center',
|
|
49
|
+
className: cx(styles.container, isActive && styles.active),
|
|
50
|
+
gap: 4,
|
|
51
|
+
onClick: function onClick() {
|
|
52
|
+
return setCurrentValue(item.value);
|
|
53
|
+
},
|
|
54
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
55
|
+
className: cx(styles.imgCtn, isActive && styles.imgActive, classNames.img),
|
|
56
|
+
style: _objectSpread(_objectSpread({}, outStyles.img), {}, {
|
|
57
|
+
height: height,
|
|
58
|
+
width: width
|
|
59
|
+
}),
|
|
60
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
61
|
+
className: styles.img,
|
|
62
|
+
children: /*#__PURE__*/_jsx(Img, {
|
|
63
|
+
alt: typeof item.label === 'string' ? item.label : item.ariaLabel,
|
|
64
|
+
height: height,
|
|
65
|
+
src: item.img,
|
|
66
|
+
unoptimized: unoptimized,
|
|
67
|
+
width: width
|
|
68
|
+
})
|
|
69
|
+
})
|
|
70
|
+
}), /*#__PURE__*/_jsxs(Flexbox, {
|
|
71
|
+
align: 'center',
|
|
72
|
+
gap: 4,
|
|
73
|
+
horizontal: true,
|
|
74
|
+
children: [item.icon && /*#__PURE__*/_jsx(Icon, {
|
|
75
|
+
icon: item.icon
|
|
76
|
+
}), item.label]
|
|
77
|
+
})]
|
|
78
|
+
}, item.value);
|
|
79
|
+
})
|
|
80
|
+
});
|
|
75
81
|
});
|
|
76
82
|
export default SelectWithImg;
|
package/es/SideNav/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
5
|
var _excluded = ["className", "avatar", "topActions", "bottomActions"];
|
|
6
6
|
import { memo } from 'react';
|
|
7
7
|
import { Flexbox } from 'react-layout-kit';
|
|
8
8
|
import { useStyles } from "./style";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
11
|
var SideNav = /*#__PURE__*/memo(function (_ref) {
|
|
10
12
|
var className = _ref.className,
|
|
11
13
|
avatar = _ref.avatar,
|
|
@@ -15,23 +17,28 @@ var SideNav = /*#__PURE__*/memo(function (_ref) {
|
|
|
15
17
|
var _useStyles = useStyles(),
|
|
16
18
|
styles = _useStyles.styles,
|
|
17
19
|
cx = _useStyles.cx;
|
|
18
|
-
return /*#__PURE__*/
|
|
20
|
+
return /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
|
|
19
21
|
align: 'center',
|
|
20
22
|
className: cx(styles, className),
|
|
21
23
|
flex: 'none',
|
|
22
24
|
justify: 'space-between'
|
|
23
|
-
}, rest),
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
}, rest), {}, {
|
|
26
|
+
children: [/*#__PURE__*/_jsxs(Flexbox, {
|
|
27
|
+
align: "center",
|
|
28
|
+
direction: "vertical",
|
|
29
|
+
gap: 16,
|
|
30
|
+
children: [avatar, /*#__PURE__*/_jsx(Flexbox, {
|
|
31
|
+
align: "center",
|
|
32
|
+
direction: "vertical",
|
|
33
|
+
gap: 8,
|
|
34
|
+
children: topActions
|
|
35
|
+
})]
|
|
36
|
+
}), /*#__PURE__*/_jsx(Flexbox, {
|
|
37
|
+
align: "center",
|
|
38
|
+
direction: "vertical",
|
|
39
|
+
gap: 4,
|
|
40
|
+
children: bottomActions
|
|
41
|
+
})]
|
|
42
|
+
}));
|
|
36
43
|
});
|
|
37
44
|
export default SideNav;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
5
|
var _excluded = ["step", "value", "onChange", "max", "min", "defaultValue", "size", "controls", "gap", "style", "className", "disabled"];
|
|
6
6
|
import { InputNumber, Slider } from 'antd';
|
|
7
7
|
import { isNull } from 'lodash-es';
|
|
8
8
|
import { memo, useCallback } from 'react';
|
|
9
9
|
import { Flexbox } from 'react-layout-kit';
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
12
|
var SliderWithInput = /*#__PURE__*/memo(function (_ref) {
|
|
11
13
|
var step = _ref.step,
|
|
12
14
|
value = _ref.value,
|
|
@@ -26,43 +28,44 @@ var SliderWithInput = /*#__PURE__*/memo(function (_ref) {
|
|
|
26
28
|
if (Number.isNaN(value) || isNull(value)) return;
|
|
27
29
|
onChange === null || onChange === void 0 || onChange(value);
|
|
28
30
|
}, []);
|
|
29
|
-
return /*#__PURE__*/
|
|
31
|
+
return /*#__PURE__*/_jsxs(Flexbox, {
|
|
30
32
|
align: 'center',
|
|
31
33
|
className: className,
|
|
32
34
|
direction: 'horizontal',
|
|
33
35
|
gap: gap,
|
|
34
|
-
style: style
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
36
|
+
style: style,
|
|
37
|
+
children: [/*#__PURE__*/_jsx(Slider, _objectSpread({
|
|
38
|
+
defaultValue: defaultValue,
|
|
39
|
+
disabled: disabled,
|
|
40
|
+
max: max,
|
|
41
|
+
min: min,
|
|
42
|
+
onChange: handleOnchange,
|
|
43
|
+
step: step,
|
|
44
|
+
style: size === 'small' ? {
|
|
45
|
+
flex: 1,
|
|
46
|
+
margin: 0
|
|
47
|
+
} : {
|
|
48
|
+
flex: 1
|
|
49
|
+
},
|
|
50
|
+
tooltip: {
|
|
51
|
+
open: false
|
|
52
|
+
},
|
|
53
|
+
value: typeof value === 'number' ? value : 0
|
|
54
|
+
}, rest)), /*#__PURE__*/_jsx(InputNumber, {
|
|
55
|
+
controls: size !== 'small' || controls,
|
|
56
|
+
defaultValue: defaultValue,
|
|
57
|
+
disabled: disabled,
|
|
58
|
+
max: max,
|
|
59
|
+
min: min,
|
|
60
|
+
onChange: handleOnchange,
|
|
61
|
+
size: size,
|
|
62
|
+
step: Number.isNaN(step) || isNull(step) ? undefined : step,
|
|
63
|
+
style: {
|
|
64
|
+
flex: 1,
|
|
65
|
+
maxWidth: size === 'small' ? 40 : 64
|
|
66
|
+
},
|
|
67
|
+
value: typeof value === 'number' ? value : 0
|
|
68
|
+
})]
|
|
69
|
+
});
|
|
67
70
|
});
|
|
68
71
|
export default SliderWithInput;
|
package/es/Snippet/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
5
|
var _excluded = ["symbol", "language", "children", "copyable", "type", "spotlight", "className"];
|
|
6
6
|
import { memo } from 'react';
|
|
@@ -9,6 +9,8 @@ import CopyButton from "../CopyButton";
|
|
|
9
9
|
import SyntaxHighlighter from "../Highlighter/SyntaxHighlighter";
|
|
10
10
|
import Spotlight from "../awesome/Spotlight";
|
|
11
11
|
import { useStyles } from "./style";
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
14
|
var Snippet = /*#__PURE__*/memo(function (_ref) {
|
|
13
15
|
var symbol = _ref.symbol,
|
|
14
16
|
_ref$language = _ref.language,
|
|
@@ -25,19 +27,22 @@ var Snippet = /*#__PURE__*/memo(function (_ref) {
|
|
|
25
27
|
styles = _useStyles.styles,
|
|
26
28
|
cx = _useStyles.cx;
|
|
27
29
|
var tirmedChildren = children.trim();
|
|
28
|
-
return /*#__PURE__*/
|
|
30
|
+
return /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
|
|
29
31
|
align: 'center',
|
|
30
32
|
className: cx(styles.container, className),
|
|
31
33
|
gap: 8,
|
|
32
34
|
horizontal: true
|
|
33
|
-
}, rest),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
}, rest), {}, {
|
|
36
|
+
children: [spotlight && /*#__PURE__*/_jsx(Spotlight, {}), /*#__PURE__*/_jsx(SyntaxHighlighter, {
|
|
37
|
+
language: language,
|
|
38
|
+
children: [symbol, tirmedChildren].filter(Boolean).join(' ')
|
|
39
|
+
}), copyable && /*#__PURE__*/_jsx(CopyButton, {
|
|
40
|
+
content: tirmedChildren,
|
|
41
|
+
size: {
|
|
42
|
+
blockSize: 24,
|
|
43
|
+
fontSize: 14
|
|
44
|
+
}
|
|
45
|
+
})]
|
|
41
46
|
}));
|
|
42
47
|
});
|
|
43
48
|
export default Snippet;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
@@ -7,6 +6,7 @@ import { GripVertical } from 'lucide-react';
|
|
|
7
6
|
import React, { memo, useContext, useState } from 'react';
|
|
8
7
|
import ActionIcon from "../ActionIcon";
|
|
9
8
|
import { SortableItemContext } from "./SortableItem";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
10
|
var DragHandle = /*#__PURE__*/memo(function (_ref) {
|
|
11
11
|
var style = _ref.style,
|
|
12
12
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -18,7 +18,7 @@ var DragHandle = /*#__PURE__*/memo(function (_ref) {
|
|
|
18
18
|
attributes = _useContext.attributes,
|
|
19
19
|
listeners = _useContext.listeners,
|
|
20
20
|
ref = _useContext.ref;
|
|
21
|
-
return /*#__PURE__*/
|
|
21
|
+
return /*#__PURE__*/_jsx(ActionIcon, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
22
22
|
"data-cypress": "draggable-handle",
|
|
23
23
|
glass: true,
|
|
24
24
|
icon: GripVertical,
|
|
@@ -32,7 +32,7 @@ var DragHandle = /*#__PURE__*/memo(function (_ref) {
|
|
|
32
32
|
style: _objectSpread({
|
|
33
33
|
cursor: grab ? 'grab' : 'grabbing'
|
|
34
34
|
}, style)
|
|
35
|
-
}, rest, attributes, listeners, {
|
|
35
|
+
}, rest), attributes), listeners), {}, {
|
|
36
36
|
ref: ref
|
|
37
37
|
}));
|
|
38
38
|
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
3
|
var _excluded = ["children", "id", "style"];
|
|
@@ -7,6 +6,7 @@ import { CSS } from '@dnd-kit/utilities';
|
|
|
7
6
|
import { createContext, memo, useMemo } from 'react';
|
|
8
7
|
import { Flexbox } from 'react-layout-kit';
|
|
9
8
|
import { useStyles } from "./style";
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
10
|
export var SortableItemContext = /*#__PURE__*/createContext({
|
|
11
11
|
attributes: {},
|
|
12
12
|
listeners: undefined,
|
|
@@ -36,20 +36,23 @@ var SortableItem = /*#__PURE__*/memo(function (_ref) {
|
|
|
36
36
|
ref: setActivatorNodeRef
|
|
37
37
|
};
|
|
38
38
|
}, [attributes, listeners, setActivatorNodeRef]);
|
|
39
|
-
return /*#__PURE__*/
|
|
40
|
-
value: context
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
39
|
+
return /*#__PURE__*/_jsx(SortableItemContext.Provider, {
|
|
40
|
+
value: context,
|
|
41
|
+
children: /*#__PURE__*/_jsx(Flexbox, _objectSpread(_objectSpread({
|
|
42
|
+
align: 'center',
|
|
43
|
+
as: 'li',
|
|
44
|
+
className: styles.item,
|
|
45
|
+
gap: 4,
|
|
46
|
+
horizontal: true,
|
|
47
|
+
ref: setNodeRef,
|
|
48
|
+
style: _objectSpread({
|
|
49
|
+
opacity: isDragging ? 0.4 : undefined,
|
|
50
|
+
transform: CSS.Translate.toString(transform),
|
|
51
|
+
transition: transition
|
|
52
|
+
}, style)
|
|
53
|
+
}, rest), {}, {
|
|
54
|
+
children: children
|
|
55
|
+
}))
|
|
56
|
+
});
|
|
54
57
|
});
|
|
55
58
|
export default SortableItem;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DragOverlay, defaultDropAnimationSideEffects } from '@dnd-kit/core';
|
|
2
2
|
import { memo } from 'react';
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
4
|
var dropAnimationConfig = {
|
|
4
5
|
sideEffects: defaultDropAnimationSideEffects({
|
|
5
6
|
styles: {
|
|
@@ -11,8 +12,9 @@ var dropAnimationConfig = {
|
|
|
11
12
|
};
|
|
12
13
|
var SortableOverlay = /*#__PURE__*/memo(function (_ref) {
|
|
13
14
|
var children = _ref.children;
|
|
14
|
-
return /*#__PURE__*/
|
|
15
|
-
dropAnimation: dropAnimationConfig
|
|
16
|
-
|
|
15
|
+
return /*#__PURE__*/_jsx(DragOverlay, {
|
|
16
|
+
dropAnimation: dropAnimationConfig,
|
|
17
|
+
children: children
|
|
18
|
+
});
|
|
17
19
|
});
|
|
18
20
|
export default SortableOverlay;
|
package/es/SortableList/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
5
5
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
6
6
|
var _excluded = ["items", "onChange", "renderItem", "gap"];
|
|
@@ -13,6 +13,8 @@ import DragHandle from "./DragHandle";
|
|
|
13
13
|
import SortableItem from "./SortableItem";
|
|
14
14
|
import SortableOverlay from "./SortableOverlay";
|
|
15
15
|
import { useStyles } from "./style";
|
|
16
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
18
|
var SortableListParent = /*#__PURE__*/memo(function (_ref) {
|
|
17
19
|
var items = _ref.items,
|
|
18
20
|
onChange = _ref.onChange,
|
|
@@ -34,7 +36,7 @@ var SortableListParent = /*#__PURE__*/memo(function (_ref) {
|
|
|
34
36
|
var sensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, {
|
|
35
37
|
coordinateGetter: sortableKeyboardCoordinates
|
|
36
38
|
}));
|
|
37
|
-
return /*#__PURE__*/
|
|
39
|
+
return /*#__PURE__*/_jsxs(DndContext, {
|
|
38
40
|
modifiers: [restrictToVerticalAxis, restrictToWindowEdges],
|
|
39
41
|
onDragCancel: function onDragCancel() {
|
|
40
42
|
setActive(null);
|
|
@@ -59,19 +61,25 @@ var SortableListParent = /*#__PURE__*/memo(function (_ref) {
|
|
|
59
61
|
var active = _ref5.active;
|
|
60
62
|
setActive(active);
|
|
61
63
|
},
|
|
62
|
-
sensors: sensors
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
64
|
+
sensors: sensors,
|
|
65
|
+
children: [/*#__PURE__*/_jsx(SortableContext, {
|
|
66
|
+
items: items,
|
|
67
|
+
strategy: verticalListSortingStrategy,
|
|
68
|
+
children: /*#__PURE__*/_jsx(Flexbox, _objectSpread(_objectSpread({
|
|
69
|
+
as: 'ul',
|
|
70
|
+
className: styles.container,
|
|
71
|
+
gap: gap
|
|
72
|
+
}, rest), {}, {
|
|
73
|
+
children: items.map(function (item) {
|
|
74
|
+
return /*#__PURE__*/_jsx(Fragment, {
|
|
75
|
+
children: renderItem(item)
|
|
76
|
+
}, item.id);
|
|
77
|
+
})
|
|
78
|
+
}))
|
|
79
|
+
}), /*#__PURE__*/_jsx(SortableOverlay, {
|
|
80
|
+
children: activeItem ? renderItem(activeItem) : null
|
|
81
|
+
})]
|
|
82
|
+
});
|
|
75
83
|
});
|
|
76
84
|
var SortableList = SortableListParent;
|
|
77
85
|
SortableList.Item = SortableItem;
|
package/es/Swatches/index.js
CHANGED
|
@@ -4,6 +4,8 @@ import { useTheme } from 'antd-style';
|
|
|
4
4
|
import { memo } from 'react';
|
|
5
5
|
import { Flexbox } from 'react-layout-kit';
|
|
6
6
|
import { useStyles } from "./style";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
9
|
var Swatches = /*#__PURE__*/memo(function (_ref) {
|
|
8
10
|
var colors = _ref.colors,
|
|
9
11
|
activeColor = _ref.activeColor,
|
|
@@ -14,32 +16,32 @@ var Swatches = /*#__PURE__*/memo(function (_ref) {
|
|
|
14
16
|
var _useStyles = useStyles(size),
|
|
15
17
|
cx = _useStyles.cx,
|
|
16
18
|
styles = _useStyles.styles;
|
|
17
|
-
return /*#__PURE__*/
|
|
19
|
+
return /*#__PURE__*/_jsxs(Flexbox, {
|
|
18
20
|
gap: 8,
|
|
19
21
|
horizontal: true,
|
|
20
22
|
style: {
|
|
21
23
|
flexWrap: 'wrap'
|
|
22
|
-
}
|
|
23
|
-
}, /*#__PURE__*/React.createElement(Flexbox, {
|
|
24
|
-
className: cx(styles.container, !activeColor && styles.active),
|
|
25
|
-
onClick: function onClick() {
|
|
26
|
-
onSelect === null || onSelect === void 0 || onSelect();
|
|
27
24
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
}), colors.map(function (c) {
|
|
32
|
-
var isActive = c === activeColor;
|
|
33
|
-
return /*#__PURE__*/React.createElement(Flexbox, {
|
|
34
|
-
className: cx(styles.container, isActive && styles.active),
|
|
35
|
-
key: c,
|
|
25
|
+
children: [/*#__PURE__*/_jsx(Flexbox, {
|
|
26
|
+
className: cx(styles.container, !activeColor && styles.active),
|
|
36
27
|
onClick: function onClick() {
|
|
37
|
-
onSelect === null || onSelect === void 0 || onSelect(
|
|
28
|
+
onSelect === null || onSelect === void 0 || onSelect();
|
|
38
29
|
},
|
|
39
30
|
style: {
|
|
40
|
-
background:
|
|
31
|
+
background: theme.colorBgContainer
|
|
41
32
|
}
|
|
42
|
-
})
|
|
43
|
-
|
|
33
|
+
}), colors.map(function (c) {
|
|
34
|
+
var isActive = c === activeColor;
|
|
35
|
+
return /*#__PURE__*/_jsx(Flexbox, {
|
|
36
|
+
className: cx(styles.container, isActive && styles.active),
|
|
37
|
+
onClick: function onClick() {
|
|
38
|
+
onSelect === null || onSelect === void 0 || onSelect(c);
|
|
39
|
+
},
|
|
40
|
+
style: {
|
|
41
|
+
background: c
|
|
42
|
+
}
|
|
43
|
+
}, c);
|
|
44
|
+
})]
|
|
45
|
+
});
|
|
44
46
|
});
|
|
45
47
|
export default Swatches;
|