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