@lobehub/ui 1.158.1 → 1.160.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.
Files changed (153) hide show
  1. package/es/A/index.js +2 -2
  2. package/es/ActionIcon/index.js +15 -11
  3. package/es/ActionIconGroup/index.js +47 -45
  4. package/es/Alert/index.js +50 -43
  5. package/es/Avatar/index.js +12 -10
  6. package/es/Burger/index.js +35 -30
  7. package/es/CodeEditor/index.js +43 -38
  8. package/es/Collapse/index.js +3 -3
  9. package/es/ColorScales/ScaleRow.js +43 -39
  10. package/es/ColorScales/index.js +59 -57
  11. package/es/ConfigProvider/index.js +5 -3
  12. package/es/ContextMenu/index.js +3 -2
  13. package/es/CopyButton/index.js +4 -3
  14. package/es/DraggablePanel/components/DraggablePanelBody.js +3 -2
  15. package/es/DraggablePanel/components/DraggablePanelContainer.js +3 -2
  16. package/es/DraggablePanel/components/DraggablePanelFooter.js +3 -2
  17. package/es/DraggablePanel/components/DraggablePanelHeader.js +9 -5
  18. package/es/DraggablePanel/index.js +32 -25
  19. package/es/EditableText/index.js +16 -13
  20. package/es/EmojiPicker/AvatarUploader.js +71 -60
  21. package/es/EmojiPicker/index.js +110 -101
  22. package/es/EmptyCard/index.js +31 -23
  23. package/es/FileTypeIcon/index.js +55 -44
  24. package/es/FluentEmoji/index.js +6 -4
  25. package/es/Footer/index.js +10 -8
  26. package/es/Form/components/FormDivider.js +2 -2
  27. package/es/Form/components/FormFlatGroup.js +9 -4
  28. package/es/Form/components/FormFooter.js +6 -3
  29. package/es/Form/components/FormGroup.js +21 -15
  30. package/es/Form/components/FormItem.js +17 -10
  31. package/es/Form/components/FormTitle.js +23 -15
  32. package/es/Form/index.js +30 -26
  33. package/es/FormModal/index.js +34 -30
  34. package/es/Grid/index.js +6 -3
  35. package/es/Header/index.js +65 -49
  36. package/es/Highlighter/FullFeatured.js +51 -41
  37. package/es/Highlighter/SyntaxHighlighter/index.js +30 -19
  38. package/es/Highlighter/index.js +29 -19
  39. package/es/Icon/icons/DiscordIcon.js +3 -2
  40. package/es/Icon/index.js +16 -13
  41. package/es/Image/ImageGallery.js +5 -3
  42. package/es/Image/Preview.js +5 -3
  43. package/es/Image/index.js +38 -34
  44. package/es/Image/usePreview.js +37 -33
  45. package/es/Img/index.js +2 -2
  46. package/es/Input/index.js +3 -3
  47. package/es/Layout/index.js +63 -35
  48. package/es/List/ListItem/index.js +67 -53
  49. package/es/Markdown/CodeBlock.js +16 -10
  50. package/es/Markdown/Typography.js +6 -3
  51. package/es/Markdown/index.js +22 -18
  52. package/es/MaterialFileTypeIcon/index.js +20 -17
  53. package/es/MaterialFileTypeIcon/utils.d.ts +2 -2
  54. package/es/Mermaid/FullFeatured.js +45 -35
  55. package/es/Mermaid/index.js +26 -17
  56. package/es/Mermaid/useMermaid.d.ts +1 -2
  57. package/es/Mermaid/useMermaid.js +5 -3
  58. package/es/Modal/index.js +60 -48
  59. package/es/SearchBar/index.js +51 -47
  60. package/es/SelectWithImg/index.js +40 -34
  61. package/es/SideNav/index.js +22 -15
  62. package/es/SliderWithInput/index.js +38 -35
  63. package/es/Snippet/index.js +15 -10
  64. package/es/SortableList/DragHandle.js +3 -3
  65. package/es/SortableList/SortableItem.js +19 -16
  66. package/es/SortableList/SortableOverlay.js +5 -3
  67. package/es/SortableList/index.js +23 -15
  68. package/es/Swatches/index.js +20 -18
  69. package/es/TabsNav/index.js +3 -2
  70. package/es/Tag/index.js +12 -7
  71. package/es/ThemeProvider/Meta.js +58 -53
  72. package/es/ThemeProvider/index.js +23 -17
  73. package/es/ThemeSwitch/index.js +19 -15
  74. package/es/Toc/TocMobile.js +52 -47
  75. package/es/Toc/index.js +13 -8
  76. package/es/Tooltip/index.js +3 -2
  77. package/es/Video/index.js +47 -41
  78. package/es/awesome/AuroraBackground/index.js +18 -11
  79. package/es/awesome/Features/Item.js +45 -37
  80. package/es/awesome/Features/index.js +4 -5
  81. package/es/awesome/GaussianBackground/index.js +13 -8
  82. package/es/awesome/Giscus/index.js +15 -13
  83. package/es/awesome/GradientButton/index.js +9 -5
  84. package/es/awesome/GridBackground/Grid.js +61 -49
  85. package/es/awesome/GridBackground/GridShowcase.js +28 -24
  86. package/es/awesome/GridBackground/index.js +33 -27
  87. package/es/awesome/Hero/index.js +74 -63
  88. package/es/awesome/Spline/ParentSize.js +8 -7
  89. package/es/awesome/Spline/index.js +13 -10
  90. package/es/awesome/Spotlight/index.js +3 -2
  91. package/es/awesome/SpotlightCard/SpotlightCardItem.js +8 -5
  92. package/es/awesome/SpotlightCard/index.js +12 -9
  93. package/es/brand/BrandLoading/index.js +3 -2
  94. package/es/brand/LobeChat/index.js +38 -29
  95. package/es/brand/LobeChatText/index.js +13 -8
  96. package/es/brand/LobeHub/index.js +38 -29
  97. package/es/brand/LobeHubText/index.js +9 -4
  98. package/es/brand/Logo3d/index.js +3 -2
  99. package/es/brand/LogoFlat/index.js +49 -44
  100. package/es/brand/LogoMono/index.js +53 -48
  101. package/es/brand/LogoThree/Loading.js +11 -9
  102. package/es/brand/LogoThree/LogoSpline.js +12 -10
  103. package/es/brand/LogoThree/index.js +25 -23
  104. package/es/brand/components/Divider.js +6 -4
  105. package/es/chat/BackBottom/index.js +6 -4
  106. package/es/chat/ChatHeader/ChatHeaderTitle.js +31 -22
  107. package/es/chat/ChatHeader/index.js +42 -35
  108. package/es/chat/ChatInputArea/ChatInputActionBar.js +21 -16
  109. package/es/chat/ChatInputArea/ChatInputArea.js +23 -19
  110. package/es/chat/ChatInputArea/ChatInputAreaInner.js +3 -2
  111. package/es/chat/ChatInputArea/SendButton.js +51 -36
  112. package/es/chat/ChatItem/components/Actions.js +5 -3
  113. package/es/chat/ChatItem/components/Avatar.js +21 -17
  114. package/es/chat/ChatItem/components/BorderSpacing.js +2 -1
  115. package/es/chat/ChatItem/components/ErrorContent.js +11 -9
  116. package/es/chat/ChatItem/components/Loading.js +12 -10
  117. package/es/chat/ChatItem/components/MessageContent.js +10 -6
  118. package/es/chat/ChatItem/components/Title.js +8 -3
  119. package/es/chat/ChatItem/index.js +53 -47
  120. package/es/chat/ChatList/ActionsBar.js +3 -2
  121. package/es/chat/ChatList/HistoryDivider.js +11 -6
  122. package/es/chat/ChatList/Item.js +12 -14
  123. package/es/chat/ChatList/index.js +29 -25
  124. package/es/chat/EditableMessage/index.js +32 -26
  125. package/es/chat/EditableMessageList/index.js +76 -72
  126. package/es/chat/MessageInput/index.js +43 -35
  127. package/es/chat/MessageModal/index.js +51 -41
  128. package/es/chat/TokenTag/index.js +11 -7
  129. package/es/components/ControlInput.js +22 -18
  130. package/es/hooks/useHighlight.d.ts +1 -1
  131. package/es/mdx/Callout/index.js +19 -13
  132. package/es/mdx/Cards/Card.js +59 -46
  133. package/es/mdx/Cards/index.js +6 -3
  134. package/es/mdx/FileTree/File.js +11 -5
  135. package/es/mdx/FileTree/Folder.js +22 -13
  136. package/es/mdx/FileTree/index.js +6 -3
  137. package/es/mdx/Mdx/index.js +9 -7
  138. package/es/mdx/Steps/index.js +6 -3
  139. package/es/mdx/Tabs/Tab.js +8 -3
  140. package/es/mdx/Tabs/index.js +21 -17
  141. package/es/mdx/mdxComponents/CodeBlock.js +14 -9
  142. package/es/mdx/mdxComponents/Image.js +2 -2
  143. package/es/mdx/mdxComponents/Link.js +3 -2
  144. package/es/mdx/mdxComponents/Pre.js +14 -7
  145. package/es/mdx/mdxComponents/Video.js +2 -2
  146. package/es/mobile/MobileChatInputArea/SendButton.js +4 -3
  147. package/es/mobile/MobileChatInputArea/index.js +79 -69
  148. package/es/mobile/MobileNavBar/MobileNavBarTitle.js +37 -26
  149. package/es/mobile/MobileNavBar/index.js +48 -41
  150. package/es/mobile/MobileSafeArea/index.js +3 -2
  151. package/es/mobile/MobileTabBar/index.js +35 -29
  152. package/es/storybook/StoryBook/index.js +26 -19
  153. package/package.json +1 -90
@@ -1,5 +1,6 @@
1
1
  'use client';
2
2
 
3
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
5
  import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
5
6
  var _excluded = ["children"];
@@ -7,6 +8,8 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
7
8
  import { createStyles, keyframes } from 'antd-style';
8
9
  import { memo } from 'react';
9
10
  import { Flexbox } from 'react-layout-kit';
11
+ import { jsx as _jsx } from "react/jsx-runtime";
12
+ import { jsxs as _jsxs } from "react/jsx-runtime";
10
13
  var useStyles = createStyles(function (_ref) {
11
14
  var isDarkMode = _ref.isDarkMode,
12
15
  css = _ref.css,
@@ -25,16 +28,20 @@ var AuroraBackground = /*#__PURE__*/memo(function (_ref2) {
25
28
  rest = _objectWithoutProperties(_ref2, _excluded);
26
29
  var _useStyles = useStyles(),
27
30
  styles = _useStyles.styles;
28
- return /*#__PURE__*/React.createElement(Flexbox, rest, /*#__PURE__*/React.createElement(Flexbox, {
29
- className: styles.wrapper
30
- }, /*#__PURE__*/React.createElement("div", {
31
- className: styles.bg
32
- })), /*#__PURE__*/React.createElement(Flexbox, {
33
- flex: 1,
34
- style: {
35
- zIndex: 1
36
- },
37
- width: '100%'
38
- }, children));
31
+ return /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({}, rest), {}, {
32
+ children: [/*#__PURE__*/_jsx(Flexbox, {
33
+ className: styles.wrapper,
34
+ children: /*#__PURE__*/_jsx("div", {
35
+ className: styles.bg
36
+ })
37
+ }), /*#__PURE__*/_jsx(Flexbox, {
38
+ flex: 1,
39
+ style: {
40
+ zIndex: 1
41
+ },
42
+ width: '100%',
43
+ children: children
44
+ })]
45
+ }));
39
46
  });
40
47
  export default AuroraBackground;
@@ -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 = ["style", "className", "row", "column", "description", "image", "title", "link", "icon", "imageStyle", "openExternal"];
@@ -10,21 +9,23 @@ import Img from "../../Img";
10
9
  import { useStyles } from "./style";
11
10
 
12
11
  // @ts-ignore
13
-
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { jsxs as _jsxs } from "react/jsx-runtime";
14
14
  var Image = /*#__PURE__*/memo(function (_ref) {
15
15
  var image = _ref.image,
16
16
  className = _ref.className,
17
17
  title = _ref.title,
18
18
  style = _ref.style;
19
- return image.startsWith('http') ? /*#__PURE__*/React.createElement(Img, {
19
+ return image.startsWith('http') ? /*#__PURE__*/_jsx(Img, {
20
20
  alt: title,
21
21
  className: className,
22
22
  src: image,
23
23
  style: style
24
- }) : /*#__PURE__*/React.createElement(Center, {
24
+ }) : /*#__PURE__*/_jsx(Center, {
25
25
  className: className,
26
- style: style
27
- }, image);
26
+ style: style,
27
+ children: image
28
+ });
28
29
  });
29
30
  var Item = /*#__PURE__*/memo(function (_ref2) {
30
31
  var style = _ref2.style,
@@ -46,41 +47,48 @@ var Item = /*#__PURE__*/memo(function (_ref2) {
46
47
  }),
47
48
  styles = _useStyles.styles,
48
49
  cx = _useStyles.cx;
49
- return /*#__PURE__*/React.createElement("div", _extends({
50
+ return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
50
51
  className: cx(styles.container, className),
51
52
  style: _objectSpread({
52
53
  gridColumn: "span ".concat(column || 1),
53
54
  gridRow: "span ".concat(rowNumber)
54
55
  }, style)
55
- }, rest), /*#__PURE__*/React.createElement("div", {
56
- className: styles.cell
57
- }, image || icon && /*#__PURE__*/React.createElement(Center, {
58
- className: styles.imgContainer,
59
- style: imageStyle
60
- }, icon && /*#__PURE__*/React.createElement(Icon, {
61
- className: styles.img,
62
- icon: icon
63
- }), image && /*#__PURE__*/React.createElement(Image, {
64
- className: styles.img,
65
- image: image,
66
- title: title
67
- })), title && /*#__PURE__*/React.createElement(Flexbox, {
68
- align: 'center',
69
- as: 'h3',
70
- className: styles.title,
71
- gap: 8,
72
- horizontal: true
73
- }, title), description && /*#__PURE__*/React.createElement("p", {
74
- className: styles.desc,
75
- dangerouslySetInnerHTML: {
76
- __html: description
77
- }
78
- }), link && /*#__PURE__*/React.createElement("div", {
79
- className: styles.link
80
- }, /*#__PURE__*/React.createElement(A, {
81
- href: link,
82
- rel: "noreferrer",
83
- target: openExternal ? '_blank' : undefined
84
- }, "Read More"))));
56
+ }, rest), {}, {
57
+ children: /*#__PURE__*/_jsxs("div", {
58
+ className: styles.cell,
59
+ children: [image || icon && /*#__PURE__*/_jsxs(Center, {
60
+ className: styles.imgContainer,
61
+ style: imageStyle,
62
+ children: [icon && /*#__PURE__*/_jsx(Icon, {
63
+ className: styles.img,
64
+ icon: icon
65
+ }), image && /*#__PURE__*/_jsx(Image, {
66
+ className: styles.img,
67
+ image: image,
68
+ title: title
69
+ })]
70
+ }), title && /*#__PURE__*/_jsx(Flexbox, {
71
+ align: 'center',
72
+ as: 'h3',
73
+ className: styles.title,
74
+ gap: 8,
75
+ horizontal: true,
76
+ children: title
77
+ }), description && /*#__PURE__*/_jsx("p", {
78
+ className: styles.desc,
79
+ dangerouslySetInnerHTML: {
80
+ __html: description
81
+ }
82
+ }), link && /*#__PURE__*/_jsx("div", {
83
+ className: styles.link,
84
+ children: /*#__PURE__*/_jsx(A, {
85
+ href: link,
86
+ rel: "noreferrer",
87
+ target: openExternal ? '_blank' : undefined,
88
+ children: "Read More"
89
+ })
90
+ })]
91
+ })
92
+ }));
85
93
  });
86
94
  export default Item;
@@ -1,12 +1,12 @@
1
1
  'use client';
2
2
 
3
3
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
- import _extends from "@babel/runtime/helpers/esm/extends";
5
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
6
5
  var _excluded = ["items", "className", "itemClassName", "itemStyle", "maxWidth", "style"];
7
6
  import { memo } from 'react';
8
7
  import SpotlightCard from "../SpotlightCard";
9
8
  import { default as Item } from "./Item";
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
10
  var Features = /*#__PURE__*/memo(function (_ref) {
11
11
  var items = _ref.items,
12
12
  className = _ref.className,
@@ -17,15 +17,14 @@ var Features = /*#__PURE__*/memo(function (_ref) {
17
17
  style = _ref.style,
18
18
  rest = _objectWithoutProperties(_ref, _excluded);
19
19
  if (!(items !== null && items !== void 0 && items.length)) return;
20
- return /*#__PURE__*/React.createElement(SpotlightCard, _extends({
20
+ return /*#__PURE__*/_jsx(SpotlightCard, _objectSpread({
21
21
  className: className,
22
22
  items: items,
23
23
  renderItem: function renderItem(item) {
24
- return /*#__PURE__*/React.createElement(Item, _extends({
24
+ return /*#__PURE__*/_jsx(Item, _objectSpread({
25
25
  className: itemClassName,
26
- key: item.title,
27
26
  style: itemStyle
28
- }, item));
27
+ }, item), item.title);
29
28
  },
30
29
  style: _objectSpread({
31
30
  maxWidth: maxWidth
@@ -1,12 +1,14 @@
1
1
  'use client';
2
2
 
3
- import _extends from "@babel/runtime/helpers/esm/extends";
3
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
5
  var _excluded = ["layers", "options", "className", "children", "classNames", "style"];
6
6
  import { memo, useEffect, useRef } from 'react';
7
7
  import { Flexbox } from 'react-layout-kit';
8
8
  import { useStyles } from "./style";
9
9
  import { useGaussianBackground } from "./useGaussianBackground";
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ import { jsxs as _jsxs } from "react/jsx-runtime";
10
12
  var DEFAULT_OPTIONS = {
11
13
  blurRadius: 16,
12
14
  fpsCap: 60,
@@ -30,14 +32,17 @@ var GaussianBackground = /*#__PURE__*/memo(function (_ref) {
30
32
  if (!run) return;
31
33
  run(layers, options);
32
34
  }, [run, options, layers]);
33
- return /*#__PURE__*/React.createElement("div", _extends({
35
+ return /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
34
36
  className: cx(styles.container, className),
35
37
  style: style
36
- }, rest), /*#__PURE__*/React.createElement("canvas", {
37
- className: cx(styles.canvas, classNames === null || classNames === void 0 ? void 0 : classNames.canvas),
38
- ref: ref
39
- }), /*#__PURE__*/React.createElement(Flexbox, {
40
- className: cx(styles.content, classNames === null || classNames === void 0 ? void 0 : classNames.content)
41
- }, children));
38
+ }, rest), {}, {
39
+ children: [/*#__PURE__*/_jsx("canvas", {
40
+ className: cx(styles.canvas, classNames === null || classNames === void 0 ? void 0 : classNames.canvas),
41
+ ref: ref
42
+ }), /*#__PURE__*/_jsx(Flexbox, {
43
+ className: cx(styles.content, classNames === null || classNames === void 0 ? void 0 : classNames.content),
44
+ children: children
45
+ })]
46
+ }));
42
47
  });
43
48
  export default GaussianBackground;
@@ -1,12 +1,13 @@
1
1
  'use client';
2
2
 
3
- import _extends from "@babel/runtime/helpers/esm/extends";
3
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
5
  var _excluded = ["style", "className", "reactionsEnabled", "mapping", "lang", "inputPosition", "id", "loading", "emitMetadata"];
6
6
  import GiscusComponent from '@giscus/react';
7
7
  import { useTheme, useThemeMode } from 'antd-style';
8
8
  import { memo, useMemo } from 'react';
9
9
  import { formatLang, genStyles } from "./style";
10
+ import { jsx as _jsx } from "react/jsx-runtime";
10
11
  var Giscus = /*#__PURE__*/memo(function (_ref) {
11
12
  var style = _ref.style,
12
13
  className = _ref.className,
@@ -31,18 +32,19 @@ var Giscus = /*#__PURE__*/memo(function (_ref) {
31
32
  var giscusTheme = useMemo(function () {
32
33
  return btoa(genStyles(token, isDarkMode).styles);
33
34
  }, [isDarkMode, token]);
34
- return /*#__PURE__*/React.createElement("div", {
35
+ return /*#__PURE__*/_jsx("div", {
35
36
  className: className,
36
- style: style
37
- }, /*#__PURE__*/React.createElement(GiscusComponent, _extends({
38
- emitMetadata: emitMetadata,
39
- id: id,
40
- inputPosition: inputPosition,
41
- lang: formatLang(lang),
42
- loading: loading,
43
- mapping: mapping,
44
- reactionsEnabled: reactionsEnabled,
45
- theme: "data:text/css;base64,".concat(giscusTheme)
46
- }, rest)));
37
+ style: style,
38
+ children: /*#__PURE__*/_jsx(GiscusComponent, _objectSpread({
39
+ emitMetadata: emitMetadata,
40
+ id: id,
41
+ inputPosition: inputPosition,
42
+ lang: formatLang(lang),
43
+ loading: loading,
44
+ mapping: mapping,
45
+ reactionsEnabled: reactionsEnabled,
46
+ theme: "data:text/css;base64,".concat(giscusTheme)
47
+ }, rest))
48
+ });
47
49
  });
48
50
  export default Giscus;
@@ -1,11 +1,13 @@
1
1
  'use client';
2
2
 
3
- import _extends from "@babel/runtime/helpers/esm/extends";
3
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
5
  var _excluded = ["glow", "children", "className", "size"];
6
6
  import { Button } from 'antd';
7
7
  import { memo } from 'react';
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 GradientButton = /*#__PURE__*/memo(function (_ref) {
10
12
  var _ref$glow = _ref.glow,
11
13
  glow = _ref$glow === void 0 ? true : _ref$glow,
@@ -17,11 +19,13 @@ var GradientButton = /*#__PURE__*/memo(function (_ref) {
17
19
  var _useStyles = useStyles(size),
18
20
  styles = _useStyles.styles,
19
21
  cx = _useStyles.cx;
20
- return /*#__PURE__*/React.createElement(Button, _extends({
22
+ return /*#__PURE__*/_jsxs(Button, _objectSpread(_objectSpread({
21
23
  className: cx(styles.button, className),
22
24
  size: size
23
- }, rest), glow && /*#__PURE__*/React.createElement("div", {
24
- className: styles.glow
25
- }), children);
25
+ }, rest), {}, {
26
+ children: [glow && /*#__PURE__*/_jsx("div", {
27
+ className: styles.glow
28
+ }), children]
29
+ }));
26
30
  });
27
31
  export default GradientButton;
@@ -1,7 +1,11 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
1
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
3
  var _excluded = ["color", "strokeWidth", "linePick"];
3
4
  import { isUndefined } from 'lodash-es';
4
5
  import { memo, useCallback } from 'react';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ import { Fragment as _Fragment } from "react/jsx-runtime";
8
+ import { jsxs as _jsxs } from "react/jsx-runtime";
5
9
  var Line = /*#__PURE__*/function (Line) {
6
10
  Line[Line["l7"] = 0] = "l7";
7
11
  Line[Line["l6"] = 1] = "l6";
@@ -31,55 +35,63 @@ var Grid = /*#__PURE__*/memo(function (_ref) {
31
35
  var showLine = useCallback(function (l) {
32
36
  return isUnpick || linePick === l;
33
37
  }, [linePick]);
34
- var vLine = /*#__PURE__*/React.createElement(React.Fragment, null, showLine(Line.l7) && /*#__PURE__*/React.createElement("path", {
35
- d: "M2 420v-60.343c0-21.82 14.15-41.12 34.959-47.684L1026 0h0"
36
- }), showLine(Line.l6) && /*#__PURE__*/React.createElement("path", {
37
- d: "M268 420v-62.077c0-20.977 13.094-39.724 32.789-46.944L1149 0h0"
38
- }), showLine(Line.l5) && /*#__PURE__*/React.createElement("path", {
39
- d: "M534 420v-64.358a50 50 0 0129.884-45.775L1269 0h0"
40
- }), showLine(Line.l4) && /*#__PURE__*/React.createElement("path", {
41
- d: "M800 420v-67.395a50 50 0 0125.958-43.84L1389 0h0"
42
- }), showLine(Line.l3) && /*#__PURE__*/React.createElement("path", {
43
- d: "M1066 420v-71.645a50 50 0 0120.456-40.337L1507 0h0"
44
- }), showLine(Line.l2) && /*#__PURE__*/React.createElement("path", {
45
- d: "M1332 420v-77.506a50 50 0 0113.194-33.843L1629 0h0"
46
- }), showLine(Line.l1) && /*#__PURE__*/React.createElement("path", {
47
- d: "M1598 420v-86.225a50 50 0 014.438-20.594L1744 0h0"
48
- }), showLine(Line.center) && /*#__PURE__*/React.createElement("path", {
49
- d: "M1864 420V0h0"
50
- }), showLine(Line.r1) && /*#__PURE__*/React.createElement("path", {
51
- d: "M2130 420v-86.225a50 50 0 00-4.438-20.594L1984 0h0"
52
- }), showLine(Line.r2) && /*#__PURE__*/React.createElement("path", {
53
- d: "M2396 420v-77.506a50 50 0 00-13.194-33.843L2099 0h0"
54
- }), showLine(Line.r3) && /*#__PURE__*/React.createElement("path", {
55
- d: "M2662 420v-71.645a50 50 0 00-20.456-40.337L2221 0h0"
56
- }), showLine(Line.r4) && /*#__PURE__*/React.createElement("path", {
57
- d: "M2928 420v-67.395a50 50 0 00-25.958-43.84L2339 0h0"
58
- }), showLine(Line.r5) && /*#__PURE__*/React.createElement("path", {
59
- d: "M3194 420v-64.358a50 50 0 00-29.884-45.775L2459 0h0"
60
- }), showLine(Line.r6) && /*#__PURE__*/React.createElement("path", {
61
- d: "M3460 420v-62.077c0-20.977-13.094-39.724-32.789-46.944L2579 0h0"
62
- }), showLine(Line.r7) && /*#__PURE__*/React.createElement("path", {
63
- d: "M3726 420v-60.343c0-21.82-14.15-41.12-34.959-47.684L2702 0h0"
38
+ var vLine = /*#__PURE__*/_jsxs(_Fragment, {
39
+ children: [showLine(Line.l7) && /*#__PURE__*/_jsx("path", {
40
+ d: "M2 420v-60.343c0-21.82 14.15-41.12 34.959-47.684L1026 0h0"
41
+ }), showLine(Line.l6) && /*#__PURE__*/_jsx("path", {
42
+ d: "M268 420v-62.077c0-20.977 13.094-39.724 32.789-46.944L1149 0h0"
43
+ }), showLine(Line.l5) && /*#__PURE__*/_jsx("path", {
44
+ d: "M534 420v-64.358a50 50 0 0129.884-45.775L1269 0h0"
45
+ }), showLine(Line.l4) && /*#__PURE__*/_jsx("path", {
46
+ d: "M800 420v-67.395a50 50 0 0125.958-43.84L1389 0h0"
47
+ }), showLine(Line.l3) && /*#__PURE__*/_jsx("path", {
48
+ d: "M1066 420v-71.645a50 50 0 0120.456-40.337L1507 0h0"
49
+ }), showLine(Line.l2) && /*#__PURE__*/_jsx("path", {
50
+ d: "M1332 420v-77.506a50 50 0 0113.194-33.843L1629 0h0"
51
+ }), showLine(Line.l1) && /*#__PURE__*/_jsx("path", {
52
+ d: "M1598 420v-86.225a50 50 0 014.438-20.594L1744 0h0"
53
+ }), showLine(Line.center) && /*#__PURE__*/_jsx("path", {
54
+ d: "M1864 420V0h0"
55
+ }), showLine(Line.r1) && /*#__PURE__*/_jsx("path", {
56
+ d: "M2130 420v-86.225a50 50 0 00-4.438-20.594L1984 0h0"
57
+ }), showLine(Line.r2) && /*#__PURE__*/_jsx("path", {
58
+ d: "M2396 420v-77.506a50 50 0 00-13.194-33.843L2099 0h0"
59
+ }), showLine(Line.r3) && /*#__PURE__*/_jsx("path", {
60
+ d: "M2662 420v-71.645a50 50 0 00-20.456-40.337L2221 0h0"
61
+ }), showLine(Line.r4) && /*#__PURE__*/_jsx("path", {
62
+ d: "M2928 420v-67.395a50 50 0 00-25.958-43.84L2339 0h0"
63
+ }), showLine(Line.r5) && /*#__PURE__*/_jsx("path", {
64
+ d: "M3194 420v-64.358a50 50 0 00-29.884-45.775L2459 0h0"
65
+ }), showLine(Line.r6) && /*#__PURE__*/_jsx("path", {
66
+ d: "M3460 420v-62.077c0-20.977-13.094-39.724-32.789-46.944L2579 0h0"
67
+ }), showLine(Line.r7) && /*#__PURE__*/_jsx("path", {
68
+ d: "M3726 420v-60.343c0-21.82-14.15-41.12-34.959-47.684L2702 0h0"
69
+ })]
70
+ });
71
+ var hLine = isUnpick && /*#__PURE__*/_jsxs(_Fragment, {
72
+ children: [/*#__PURE__*/_jsx("path", {
73
+ d: "M2835 42H892"
74
+ }), /*#__PURE__*/_jsx("path", {
75
+ d: "M595 136h2538"
76
+ }), /*#__PURE__*/_jsx("path", {
77
+ d: "M237 249h3254"
78
+ })]
79
+ });
80
+ return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({}, rest), {}, {
81
+ children: /*#__PURE__*/_jsx("svg", {
82
+ style: {
83
+ width: '100%'
84
+ },
85
+ viewBox: "0 0 3728 422",
86
+ xmlns: "http://www.w3.org/2000/svg",
87
+ children: /*#__PURE__*/_jsxs("g", {
88
+ fill: "none",
89
+ fillRule: "evenodd",
90
+ stroke: color,
91
+ strokeWidth: strokeWidth,
92
+ children: [vLine, hLine]
93
+ })
94
+ })
64
95
  }));
65
- var hLine = isUnpick && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("path", {
66
- d: "M2835 42H892"
67
- }), /*#__PURE__*/React.createElement("path", {
68
- d: "M595 136h2538"
69
- }), /*#__PURE__*/React.createElement("path", {
70
- d: "M237 249h3254"
71
- }));
72
- return /*#__PURE__*/React.createElement("div", rest, /*#__PURE__*/React.createElement("svg", {
73
- style: {
74
- width: '100%'
75
- },
76
- viewBox: "0 0 3728 422",
77
- xmlns: "http://www.w3.org/2000/svg"
78
- }, /*#__PURE__*/React.createElement("g", {
79
- fill: "none",
80
- fillRule: "evenodd",
81
- stroke: color,
82
- strokeWidth: strokeWidth
83
- }, vLine, hLine)));
84
96
  });
85
97
  export default Grid;
@@ -1,6 +1,5 @@
1
1
  'use client';
2
2
 
3
- import _extends from "@babel/runtime/helpers/esm/extends";
4
3
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
5
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
6
5
  var _excluded = ["style", "children", "backgroundColor", "innerProps"];
@@ -9,6 +8,8 @@ import { rgba } from 'polished';
9
8
  import { memo } from 'react';
10
9
  import { Flexbox } from 'react-layout-kit';
11
10
  import GridBackground from "./index";
11
+ import { jsx as _jsx } from "react/jsx-runtime";
12
+ import { jsxs as _jsxs } from "react/jsx-runtime";
12
13
  var GridShowcase = /*#__PURE__*/memo(function (_ref) {
13
14
  var style = _ref.style,
14
15
  children = _ref.children,
@@ -17,32 +18,35 @@ var GridShowcase = /*#__PURE__*/memo(function (_ref) {
17
18
  innerProps = _ref.innerProps,
18
19
  rest = _objectWithoutProperties(_ref, _excluded);
19
20
  var theme = useTheme();
20
- return /*#__PURE__*/React.createElement(Flexbox, _extends({
21
+ return /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
21
22
  style: _objectSpread({
22
23
  position: 'relative'
23
24
  }, style)
24
- }, rest), /*#__PURE__*/React.createElement(GridBackground, {
25
- animation: true,
26
- colorBack: rgba(theme.colorText, 0.12),
27
- colorFront: rgba(theme.colorText, 0.6),
28
- flip: true
29
- }), /*#__PURE__*/React.createElement(Flexbox, _extends({
30
- align: 'center'
31
- }, innerProps, {
32
- style: _objectSpread({
33
- zIndex: 4
34
- }, innerProps === null || innerProps === void 0 ? void 0 : innerProps.style)
35
- }), children), /*#__PURE__*/React.createElement(GridBackground, {
36
- animation: true,
37
- backgroundColor: backgroundColor,
38
- colorBack: rgba(theme.colorText, 0.24),
39
- colorFront: theme.colorText,
40
- random: true,
41
- reverse: true,
42
- showBackground: true,
43
- style: {
44
- zIndex: 0
45
- }
25
+ }, rest), {}, {
26
+ children: [/*#__PURE__*/_jsx(GridBackground, {
27
+ animation: true,
28
+ colorBack: rgba(theme.colorText, 0.12),
29
+ colorFront: rgba(theme.colorText, 0.6),
30
+ flip: true
31
+ }), /*#__PURE__*/_jsx(Flexbox, _objectSpread(_objectSpread({
32
+ align: 'center'
33
+ }, innerProps), {}, {
34
+ style: _objectSpread({
35
+ zIndex: 4
36
+ }, innerProps === null || innerProps === void 0 ? void 0 : innerProps.style),
37
+ children: children
38
+ })), /*#__PURE__*/_jsx(GridBackground, {
39
+ animation: true,
40
+ backgroundColor: backgroundColor,
41
+ colorBack: rgba(theme.colorText, 0.24),
42
+ colorFront: theme.colorText,
43
+ random: true,
44
+ reverse: true,
45
+ showBackground: true,
46
+ style: {
47
+ zIndex: 0
48
+ }
49
+ })]
46
50
  }));
47
51
  });
48
52
  export default GridShowcase;
@@ -1,7 +1,6 @@
1
1
  'use client';
2
2
 
3
3
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
- import _extends from "@babel/runtime/helpers/esm/extends";
5
4
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
6
5
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
7
6
  var _excluded = ["flip", "reverse", "showBackground", "backgroundColor", "random", "animationDuration", "className", "colorFront", "colorBack", "strokeWidth", "style", "animation"];
@@ -10,6 +9,9 @@ import { shuffle } from 'lodash-es';
10
9
  import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
11
10
  import Grid from "./Grid";
12
11
  import { useStyles } from "./style";
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { Fragment as _Fragment } from "react/jsx-runtime";
14
+ import { jsxs as _jsxs } from "react/jsx-runtime";
13
15
  var initialGroup = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14];
14
16
  var GridBackground = /*#__PURE__*/memo(function (_ref) {
15
17
  var flip = _ref.flip,
@@ -50,41 +52,45 @@ var GridBackground = /*#__PURE__*/memo(function (_ref) {
50
52
  setGroup(random ? shuffle(initialGroup) : undefined);
51
53
  }, [random]);
52
54
  var HighlightGrid = useCallback(function () {
53
- if (!group) return /*#__PURE__*/React.createElement(Grid, _extends({
55
+ if (!group) return /*#__PURE__*/_jsx(Grid, _objectSpread({
54
56
  style: {
55
57
  '--duration': "".concat(animationDuration, "s")
56
58
  }
57
59
  }, gridProps));
58
- return /*#__PURE__*/React.createElement(React.Fragment, null, group.map(function (item, index) {
59
- return /*#__PURE__*/React.createElement(Grid, _extends({
60
- key: item,
61
- linePick: item,
62
- style: {
63
- '--delay': "".concat(index + Math.random(), "s"),
64
- '--duration': "".concat(animationDuration, "s")
65
- }
66
- }, gridProps));
67
- }));
60
+ return /*#__PURE__*/_jsx(_Fragment, {
61
+ children: group.map(function (item, index) {
62
+ return /*#__PURE__*/_jsx(Grid, _objectSpread({
63
+ linePick: item,
64
+ style: {
65
+ '--delay': "".concat(index + Math.random(), "s"),
66
+ '--duration': "".concat(animationDuration, "s")
67
+ }
68
+ }, gridProps), item);
69
+ })
70
+ });
68
71
  }, [group, animationDuration, gridProps]);
69
- return /*#__PURE__*/React.createElement("div", _extends({
72
+ return /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
70
73
  className: cx(styles.container, className),
71
74
  ref: ref,
72
75
  style: flip ? _objectSpread({
73
76
  transform: 'scaleY(-1)'
74
77
  }, style) : style
75
- }, rest), /*#__PURE__*/React.createElement(Grid, {
76
- color: colorBack || theme.colorBorder,
77
- strokeWidth: strokeWidth,
78
- style: {
79
- zIndex: 2
80
- }
81
- }), animation && /*#__PURE__*/React.createElement(HighlightGrid, null), showBackground && /*#__PURE__*/React.createElement("div", {
82
- className: styles.backgroundContainer,
83
- style: size ? {
84
- fontSize: size.width / 80
85
- } : {}
86
- }, /*#__PURE__*/React.createElement("div", {
87
- className: styles.background
88
- })));
78
+ }, rest), {}, {
79
+ children: [/*#__PURE__*/_jsx(Grid, {
80
+ color: colorBack || theme.colorBorder,
81
+ strokeWidth: strokeWidth,
82
+ style: {
83
+ zIndex: 2
84
+ }
85
+ }), animation && /*#__PURE__*/_jsx(HighlightGrid, {}), showBackground && /*#__PURE__*/_jsx("div", {
86
+ className: styles.backgroundContainer,
87
+ style: size ? {
88
+ fontSize: size.width / 80
89
+ } : {},
90
+ children: /*#__PURE__*/_jsx("div", {
91
+ className: styles.background
92
+ })
93
+ })]
94
+ }));
89
95
  });
90
96
  export default GridBackground;