@lobehub/ui 1.27.0 → 1.27.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.
@@ -9,6 +9,6 @@ export var useStyles = createStyles(function (_ref, _ref2) {
9
9
  var active = _ref2.active,
10
10
  glass = _ref2.glass;
11
11
  return {
12
- block: cx(glass && stylish.blur, css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n\n position: relative;\n\n display: flex;\n flex: none;\n align-items: center;\n justify-content: center;\n\n color: ", ";\n\n background: ", ";\n\n transition: color 600ms ", ", transform 400ms ", ",\n background-color 100ms ", ";\n\n &:hover {\n color: ", ";\n background-color: ", ";\n }\n\n &:active {\n transform: scale(0.8);\n color: ", ";\n background-color: ", ";\n }\n "])), active ? token.colorText : token.colorTextTertiary, active ? token.colorFillTertiary : 'transparent', token.motionEaseOut, token.motionEaseOut, token.motionEaseOut, token.colorText, token.colorFillSecondary, token.colorText, token.colorFill))
12
+ block: cx(glass && stylish.blur, css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n\n position: relative;\n\n display: flex;\n flex: none;\n align-items: center;\n justify-content: center;\n\n color: ", ";\n\n background: ", ";\n\n transition: color 600ms ", ", scale 400ms ", ",\n background-color 100ms ", ";\n\n &:hover {\n color: ", ";\n background-color: ", ";\n }\n\n &:active {\n scale: 0.8;\n color: ", ";\n background-color: ", ";\n }\n "])), active ? token.colorText : token.colorTextTertiary, active ? token.colorFillTertiary : 'transparent', token.motionEaseOut, token.motionEaseOut, token.motionEaseOut, token.colorText, token.colorFillSecondary, token.colorText, token.colorFill))
13
13
  };
14
14
  });
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import { MenuProps } from 'antd';
3
+ import { DivProps } from "../types";
4
+ export interface BurgerProps extends DivProps {
5
+ headerHeight?: number;
6
+ items: MenuProps['items'];
7
+ openKeys?: MenuProps['openKeys'];
8
+ opened: boolean;
9
+ selectedKeys?: MenuProps['selectedKeys'];
10
+ setOpened: (state: boolean) => void;
11
+ }
12
+ declare const Burger: import("react").NamedExoticComponent<BurgerProps>;
13
+ export default Burger;
@@ -0,0 +1,61 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ var _excluded = ["items", "openKeys", "selectedKeys", "opened", "setOpened", "className", "headerHeight"];
4
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
+ import { Drawer, Menu } from 'antd';
7
+ import { MenuIcon, X } from 'lucide-react';
8
+ import { memo } from 'react';
9
+ import { Center } from 'react-layout-kit';
10
+ import ActionIcon from "../ActionIcon";
11
+ import { useStyles } from "./style";
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { jsxs as _jsxs } from "react/jsx-runtime";
14
+ var Burger = /*#__PURE__*/memo(function (_ref) {
15
+ var items = _ref.items,
16
+ openKeys = _ref.openKeys,
17
+ selectedKeys = _ref.selectedKeys,
18
+ opened = _ref.opened,
19
+ setOpened = _ref.setOpened,
20
+ className = _ref.className,
21
+ _ref$headerHeight = _ref.headerHeight,
22
+ headerHeight = _ref$headerHeight === void 0 ? 64 : _ref$headerHeight,
23
+ props = _objectWithoutProperties(_ref, _excluded);
24
+ var _useStyles = useStyles(headerHeight),
25
+ cx = _useStyles.cx,
26
+ styles = _useStyles.styles;
27
+ return /*#__PURE__*/_jsxs(Center, _objectSpread(_objectSpread({
28
+ className: cx(styles.container, className),
29
+ onClick: function onClick() {
30
+ setOpened(!opened);
31
+ }
32
+ }, props), {}, {
33
+ children: [/*#__PURE__*/_jsx(ActionIcon, {
34
+ icon: opened ? X : MenuIcon,
35
+ size: "site"
36
+ }), /*#__PURE__*/_jsxs(Drawer, {
37
+ bodyStyle: {
38
+ padding: 0
39
+ },
40
+ className: styles.drawer,
41
+ closeIcon: undefined,
42
+ headerStyle: {
43
+ display: 'none'
44
+ },
45
+ open: opened,
46
+ placement: 'left',
47
+ rootClassName: styles.drawerRoot,
48
+ width: '100vw',
49
+ children: [/*#__PURE__*/_jsx(Menu, {
50
+ className: styles.menu,
51
+ items: items,
52
+ mode: 'inline',
53
+ openKeys: openKeys,
54
+ selectedKeys: selectedKeys
55
+ }), /*#__PURE__*/_jsx("div", {
56
+ className: styles.fillRect
57
+ })]
58
+ })]
59
+ }));
60
+ });
61
+ export default Burger;
@@ -0,0 +1,7 @@
1
+ export declare const useStyles: (props?: number | undefined) => import("antd-style").ReturnStyles<{
2
+ container: import("antd-style").SerializedStyles;
3
+ drawer: import("antd-style").SerializedStyles;
4
+ drawerRoot: import("antd-style").SerializedStyles;
5
+ fillRect: import("antd-style").SerializedStyles;
6
+ menu: import("antd-style").SerializedStyles;
7
+ }>;
@@ -0,0 +1,16 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
2
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
3
+ import { createStyles } from 'antd-style';
4
+ import { rgba } from 'polished';
5
+ export var useStyles = createStyles(function (_ref, headerHeight) {
6
+ var token = _ref.token,
7
+ css = _ref.css,
8
+ stylish = _ref.stylish;
9
+ return {
10
+ container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n width: ", "px;\n height: ", "px;\n border-radius: ", "px;\n "])), token.controlHeight, token.controlHeight, token.borderRadius),
11
+ drawer: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n &.ant-drawer-content {\n background: transparent;\n }\n\n .ant-drawer-body {\n display: flex;\n flex-direction: column;\n }\n "]))),
12
+ drawerRoot: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n top: ", "px;\n\n :focus-visible {\n outline: none;\n }\n\n .ant-drawer {\n &-mask {\n ", ";\n background-color: ", ";\n }\n\n &-content-wrapper {\n box-shadow: none;\n }\n }\n "])), headerHeight + 1, stylish.blur, rgba(token.colorBgLayout, 0.5)),
13
+ fillRect: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n flex: 1;\n width: 100%;\n border-top: none;\n "]))),
14
+ menu: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n background: transparent;\n border-inline-end: transparent !important;\n\n > .ant-menu-item-only-child,\n .ant-menu-submenu-title {\n width: 100%;\n margin: 0 !important;\n border-top: none;\n border-radius: 0;\n\n &:active {\n color: ", ";\n background-color: ", ";\n }\n }\n\n .ant-menu-item-only-child:first-child {\n border-top: none;\n }\n\n .ant-menu-submenu-title[aria-expanded='true'] {\n a {\n font-weight: 600;\n color: ", " !important;\n }\n }\n\n .ant-menu-item-group-title {\n padding-top: 4px;\n padding-bottom: 4px;\n\n font-size: 12px;\n font-weight: 500;\n text-overflow: ellipsis;\n text-transform: uppercase;\n white-space: nowrap;\n\n background: ", ";\n }\n\n .ant-menu-item {\n width: calc(100% - 16px) !important;\n margin: 8px !important;\n border-radius: ", "px;\n\n &:hover,\n &:active {\n color: ", " !important;\n background: ", " !important;\n }\n }\n\n .ant-menu-item-active {\n width: calc(100% - 16px) !important;\n margin: 8px !important;\n background: ", ";\n border-radius: ", "px;\n }\n\n .ant-menu-item-selected {\n font-weight: 600;\n color: ", ";\n background: ", ";\n\n &:hover,\n &:active {\n color: ", " !important;\n background: ", " !important;\n }\n }\n "])), token.colorText, token.colorFill, token.colorText, token.colorFillSecondary, token.borderRadius, token.colorText, token.colorFillSecondary, token.colorFillSecondary, token.borderRadius, token.colorBgLayout, token.colorText, token.colorBgLayout, token.colorText)
15
+ };
16
+ });
@@ -6,9 +6,10 @@ export var alphaBg = {
6
6
  light: 'url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAFpJREFUWAntljEKADAIA23p6v//qQ+wfUEcCu1yriEgp0FHRJSJcnehmmWm1Dv/lO4HIg1AAAKjTqm03ea88zMCCEDgO4HV5bS757f+7wRoAAIQ4B9gByAAgQ3pfiDmXmAeEwAAAABJRU5ErkJggg==) 0% 0% / 26px'
7
7
  };
8
8
  export var useStyles = createStyles(function (_ref) {
9
- var css = _ref.css;
9
+ var css = _ref.css,
10
+ token = _ref.token;
10
11
  return {
11
- scaleBox: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n\n position: relative;\n\n width: 48px;\n height: 32px;\n\n background-position: 0 0, 0 8px, 8px -8px, -8px 0;\n background-size: 16px 16px;\n\n &:active {\n transform: scale(0.95);\n }\n "]))),
12
+ scaleBox: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n\n position: relative;\n\n width: 48px;\n height: 32px;\n\n background-position: 0 0, 0 8px, 8px -8px, -8px 0;\n background-size: 16px 16px;\n\n transition: scale 400ms ", ";\n\n &:active {\n scale: 0.8;\n }\n "])), token.motionEaseOut),
12
13
  scaleItem: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 100%;\n height: 100%;\n "]))),
13
14
  scaleRowTitle: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n width: 64px;\n height: 32px;\n "]))),
14
15
  text: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n opacity: 0.5;\n "]))),
package/es/Hero/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { GradientButton, Icon } from "./..";
2
- import { Button, ConfigProvider, Space } from 'antd';
2
+ import { Button, ConfigProvider } from 'antd';
3
3
  import { useResponsive } from 'antd-style';
4
4
  import * as LucideIcon from 'lucide-react';
5
5
  import { memo, useCallback } from 'react';
@@ -16,10 +16,8 @@ var Hero = /*#__PURE__*/memo(function (_ref) {
16
16
  var _useResponsive = useResponsive(),
17
17
  mobile = _useResponsive.mobile;
18
18
  var ButtonGroups = useCallback(function () {
19
- return Boolean(actions === null || actions === void 0 ? void 0 : actions.length) && /*#__PURE__*/_jsx(Space, {
19
+ return Boolean(actions === null || actions === void 0 ? void 0 : actions.length) && /*#__PURE__*/_jsx("div", {
20
20
  className: styles.actions,
21
- direction: mobile ? 'vertical' : 'horizontal',
22
- size: 24,
23
21
  children: actions.map(function (_ref2, index) {
24
22
  var text = _ref2.text,
25
23
  link = _ref2.link,
@@ -33,12 +31,14 @@ var Hero = /*#__PURE__*/memo(function (_ref) {
33
31
  rel: "noreferrer",
34
32
  target: openExternal ? '_blank' : undefined,
35
33
  children: type === 'primary' ? /*#__PURE__*/_jsx(GradientButton, {
34
+ block: mobile,
36
35
  icon: ButtonIcon && /*#__PURE__*/_jsx(Icon, {
37
36
  icon: ButtonIcon
38
37
  }),
39
38
  size: "large",
40
39
  children: text
41
40
  }, index) : /*#__PURE__*/_jsx(Button, {
41
+ block: mobile,
42
42
  icon: ButtonIcon && /*#__PURE__*/_jsx(Icon, {
43
43
  icon: ButtonIcon
44
44
  }),
package/es/Hero/style.js CHANGED
@@ -8,11 +8,7 @@ export var useStyles = createStyles(function (_ref) {
8
8
  token = _ref.token,
9
9
  stylish = _ref.stylish;
10
10
  return {
11
- actions: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n margin-top: 24px;\n\n button {\n padding-inline: 32px !important;\n font-weight: 500;\n }\n\n ", "\n "])), responsive({
12
- mobile: {
13
- marginTop: 24
14
- }
15
- })),
11
+ actions: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n gap: 24px;\n justify-content: center;\n margin-top: 24px;\n\n button {\n padding-inline: 32px !important;\n font-weight: 500;\n }\n\n ", " {\n flex-direction: column;\n gap: 16px;\n width: 100%;\n margin-top: 24px;\n\n button {\n width: 100%;\n }\n }\n "])), responsive.mobile),
16
12
  canvas: cx(stylish.gradientAnimation, css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n pointer-events: none;\n\n position: absolute;\n z-index: 10;\n top: -250px;\n left: 50%;\n transform: translateX(-50%) scale(1.5);\n\n width: 600px;\n height: 400px;\n\n opacity: 0.2;\n filter: blur(100px);\n\n ", " {\n width: 200px;\n height: 300px;\n }\n "])), responsive.mobile)),
17
13
  container: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n box-sizing: border-box;\n text-align: center;\n "]))),
18
14
  desc: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n margin-top: 0;\n font-size: ", "px;\n color: ", ";\n text-align: center;\n\n ", " {\n margin: 24px 16px;\n font-size: ", "px;\n }\n "])), token.fontSizeHeading3, token.colorTextSecondary, responsive.mobile, token.fontSizeHeading5),
package/es/Icon/style.js CHANGED
@@ -3,7 +3,7 @@ var _templateObject, _templateObject2;
3
3
  import { createStyles, keyframes } from 'antd-style';
4
4
  export var useStyles = createStyles(function (_ref) {
5
5
  var css = _ref.css;
6
- var spin = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n "])));
6
+ var spin = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n rotate: 0deg;\n }\n 100% {\n rotate: 360deg;\n }\n "])));
7
7
  return {
8
8
  spin: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n animation: ", " 1s linear infinite;\n "])), spin)
9
9
  };
@@ -1,12 +1,12 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
2
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
- var _excluded = ["headerHeight", "children"],
5
- _excluded2 = ["children"],
6
- _excluded3 = ["headerHeight", "children"],
7
- _excluded4 = ["headerHeight", "children"],
8
- _excluded5 = ["tocWidth", "children"],
9
- _excluded6 = ["children"];
4
+ var _excluded = ["headerHeight", "children", "className", "style"],
5
+ _excluded2 = ["children", "className"],
6
+ _excluded3 = ["headerHeight", "children", "className", "style"],
7
+ _excluded4 = ["headerHeight", "children", "className"],
8
+ _excluded5 = ["tocWidth", "style", "className", "children"],
9
+ _excluded6 = ["children", "className"];
10
10
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
11
11
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
12
12
  import { useResponsive } from 'antd-style';
@@ -19,14 +19,17 @@ import { Fragment as _Fragment } from "react/jsx-runtime";
19
19
  export var LayoutHeader = /*#__PURE__*/memo(function (_ref) {
20
20
  var headerHeight = _ref.headerHeight,
21
21
  children = _ref.children,
22
+ className = _ref.className,
23
+ style = _ref.style,
22
24
  props = _objectWithoutProperties(_ref, _excluded);
23
25
  var _useStyles = useStyles(headerHeight),
26
+ cx = _useStyles.cx,
24
27
  styles = _useStyles.styles;
25
28
  return /*#__PURE__*/_jsxs("header", _objectSpread(_objectSpread({
26
- className: styles.header,
27
- style: {
29
+ className: cx(styles.header, className),
30
+ style: _objectSpread({
28
31
  height: headerHeight
29
- }
32
+ }, style)
30
33
  }, props), {}, {
31
34
  children: [/*#__PURE__*/_jsx("div", {
32
35
  className: styles.glass
@@ -35,11 +38,13 @@ export var LayoutHeader = /*#__PURE__*/memo(function (_ref) {
35
38
  });
36
39
  export var LayoutMain = /*#__PURE__*/memo(function (_ref2) {
37
40
  var children = _ref2.children,
41
+ className = _ref2.className,
38
42
  props = _objectWithoutProperties(_ref2, _excluded2);
39
43
  var _useStyles2 = useStyles(),
44
+ cx = _useStyles2.cx,
40
45
  styles = _useStyles2.styles;
41
46
  return /*#__PURE__*/_jsx("main", _objectSpread(_objectSpread({
42
- className: styles.main
47
+ className: cx(styles.main, className)
43
48
  }, props), {}, {
44
49
  children: children
45
50
  }));
@@ -47,14 +52,17 @@ export var LayoutMain = /*#__PURE__*/memo(function (_ref2) {
47
52
  export var LayoutSidebar = /*#__PURE__*/memo(function (_ref3) {
48
53
  var headerHeight = _ref3.headerHeight,
49
54
  children = _ref3.children,
55
+ className = _ref3.className,
56
+ style = _ref3.style,
50
57
  props = _objectWithoutProperties(_ref3, _excluded3);
51
58
  var _useStyles3 = useStyles(headerHeight),
59
+ cx = _useStyles3.cx,
52
60
  styles = _useStyles3.styles;
53
61
  return /*#__PURE__*/_jsx("aside", _objectSpread(_objectSpread({
54
- className: styles.aside,
55
- style: {
62
+ className: cx(styles.aside, className),
63
+ style: _objectSpread({
56
64
  top: headerHeight
57
- }
65
+ }, style)
58
66
  }, props), {}, {
59
67
  children: children
60
68
  }));
@@ -62,37 +70,44 @@ export var LayoutSidebar = /*#__PURE__*/memo(function (_ref3) {
62
70
  export var LayoutSidebarInner = /*#__PURE__*/memo(function (_ref4) {
63
71
  var headerHeight = _ref4.headerHeight,
64
72
  children = _ref4.children,
73
+ className = _ref4.className,
65
74
  props = _objectWithoutProperties(_ref4, _excluded4);
66
75
  var _useStyles4 = useStyles(headerHeight),
76
+ cx = _useStyles4.cx,
67
77
  styles = _useStyles4.styles;
68
78
  return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
69
- className: styles.asideInner
79
+ className: cx(styles.asideInner, className)
70
80
  }, props), {}, {
71
81
  children: children
72
82
  }));
73
83
  });
74
84
  export var LayoutToc = /*#__PURE__*/memo(function (_ref5) {
75
85
  var tocWidth = _ref5.tocWidth,
86
+ style = _ref5.style,
87
+ className = _ref5.className,
76
88
  children = _ref5.children,
77
89
  props = _objectWithoutProperties(_ref5, _excluded5);
78
90
  var _useStyles5 = useStyles(),
91
+ cx = _useStyles5.cx,
79
92
  styles = _useStyles5.styles;
80
93
  return /*#__PURE__*/_jsx("nav", _objectSpread(_objectSpread({
81
- className: styles.toc,
82
- style: {
94
+ className: cx(styles.toc, className),
95
+ style: tocWidth ? _objectSpread({
83
96
  width: tocWidth
84
- }
97
+ }, style) : style
85
98
  }, props), {}, {
86
99
  children: children
87
100
  }));
88
101
  });
89
102
  export var LayoutFooter = /*#__PURE__*/memo(function (_ref6) {
90
103
  var children = _ref6.children,
104
+ className = _ref6.className,
91
105
  props = _objectWithoutProperties(_ref6, _excluded6);
92
106
  var _useStyles6 = useStyles(),
107
+ cx = _useStyles6.cx,
93
108
  styles = _useStyles6.styles;
94
109
  return /*#__PURE__*/_jsx("footer", _objectSpread(_objectSpread({
95
- className: styles.footer
110
+ className: cx(styles.footer, className)
96
111
  }, props), {}, {
97
112
  children: children
98
113
  }));
@@ -124,7 +139,6 @@ var Layout = /*#__PURE__*/memo(function (_ref7) {
124
139
  children: [helmet, header && /*#__PURE__*/_jsxs(LayoutHeader, {
125
140
  headerHeight: headerHeight,
126
141
  children: [header, mobile && toc && /*#__PURE__*/_jsx(LayoutToc, {
127
- tocWidth: tocWidth,
128
142
  children: toc
129
143
  })]
130
144
  }), /*#__PURE__*/_jsxs(LayoutMain, {
@@ -14,6 +14,11 @@ export interface SwatchesProps {
14
14
  * @default undefined
15
15
  */
16
16
  onSelect?: (c?: string | undefined) => void;
17
+ /**
18
+ * @description The size of swatch
19
+ * @default 24
20
+ */
21
+ size?: number;
17
22
  }
18
23
  declare const Swatches: import("react").NamedExoticComponent<SwatchesProps>;
19
24
  export default Swatches;
@@ -1,41 +1,39 @@
1
1
  import { useTheme } from 'antd-style';
2
2
  import { memo } from 'react';
3
3
  import { Flexbox } from 'react-layout-kit';
4
+ import { useStyles } from "./style";
4
5
  import { jsx as _jsx } from "react/jsx-runtime";
5
6
  import { jsxs as _jsxs } from "react/jsx-runtime";
6
7
  var Swatches = /*#__PURE__*/memo(function (_ref) {
7
8
  var colors = _ref.colors,
8
9
  activeColor = _ref.activeColor,
9
- onSelect = _ref.onSelect;
10
+ onSelect = _ref.onSelect,
11
+ _ref$size = _ref.size,
12
+ size = _ref$size === void 0 ? 24 : _ref$size;
10
13
  var theme = useTheme();
14
+ var _useStyles = useStyles(size),
15
+ cx = _useStyles.cx,
16
+ styles = _useStyles.styles;
11
17
  return /*#__PURE__*/_jsxs(Flexbox, {
12
18
  gap: 8,
13
19
  horizontal: true,
14
20
  children: [/*#__PURE__*/_jsx(Flexbox, {
21
+ className: cx(styles.container, !activeColor && styles.active),
15
22
  onClick: function onClick() {
16
23
  onSelect === null || onSelect === void 0 ? void 0 : onSelect();
17
24
  },
18
25
  style: {
19
- background: theme.colorBgContainer,
20
- borderRadius: '50%',
21
- boxShadow: "inset 0 0 0px 2px ".concat(activeColor ? 'rgba(0,0,0,0.1)' : theme.colorPrimary),
22
- cursor: 'pointer',
23
- height: 24,
24
- width: 24
26
+ background: theme.colorBgContainer
25
27
  }
26
28
  }), colors.map(function (c) {
27
- var borderColor = c === activeColor ? theme.colorPrimary : 'rgba(0,0,0,0.1)';
29
+ var isActive = c === activeColor;
28
30
  return /*#__PURE__*/_jsx(Flexbox, {
31
+ className: cx(styles.container, isActive && styles.active),
29
32
  onClick: function onClick() {
30
33
  onSelect === null || onSelect === void 0 ? void 0 : onSelect(c);
31
34
  },
32
35
  style: {
33
- background: c,
34
- borderRadius: '50%',
35
- boxShadow: "inset 0 0 0px 2px ".concat(borderColor),
36
- cursor: 'pointer',
37
- height: 24,
38
- width: 24
36
+ background: c
39
37
  }
40
38
  }, c);
41
39
  })]
@@ -0,0 +1,4 @@
1
+ export declare const useStyles: (props?: number | undefined) => import("antd-style").ReturnStyles<{
2
+ active: import("antd-style").SerializedStyles;
3
+ container: import("antd-style").SerializedStyles;
4
+ }>;
@@ -0,0 +1,11 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
2
+ var _templateObject, _templateObject2;
3
+ import { createStyles } from 'antd-style';
4
+ export var useStyles = createStyles(function (_ref, size) {
5
+ var css = _ref.css,
6
+ token = _ref.token;
7
+ return {
8
+ active: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n box-shadow: inset 0 0 0 2px ", ";\n "])), token.colorPrimary),
9
+ container: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n cursor: pointer;\n\n width: ", "px;\n height: ", "px;\n\n background: ", ";\n border-radius: 50%;\n box-shadow: inset 0 0 0 1px ", ";\n\n transition: scale 400ms ", ";\n\n &:active {\n scale: 0.8;\n }\n "])), size, size, token.colorBgContainer, token.colorFill, token.motionEaseOut)
10
+ };
11
+ });
@@ -1,7 +1,7 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
2
2
  var _templateObject;
3
3
  import { createGlobalStyle } from 'antd-style';
4
- var GlobalStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\n html,body {\n --font-settings: \"cv01\", \"tnum\", \"kern\";\n --font-variations: \"opsz\" auto, tabular-nums;\n\n overflow-x: hidden;\n overflow-y: auto;\n\n margin: 0;\n padding: 0;\n\n font-family: ", ";\n font-size: ", "px;\n font-feature-settings: var(--font-settings);\n font-variation-settings: var(--font-variations);\n line-height: 1;\n color: ", ";\n text-size-adjust: none;\n text-rendering: optimizelegibility;\n vertical-align: baseline;\n\n color-scheme: dark;\n background-color: ", ";\n\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n -webkit-overflow-scrolling:touch;\n -webkit-tap-highlight-color: transparent;\n }\n\n body {\n overflow-x: hidden;\n height: 100vh;\n }\n\n #root {\n min-height: 100vh;\n }\n\n code {\n font-family: ", " !important;\n\n span {\n font-family: ", " !important;\n }\n }\n\n p {\n text-align: justify;\n word-wrap: break-word;\n }\n\n ::selection {\n color: #000;\n background: ", ";\n }\n\n @media only screen and (min-width: 574px) {\n * {\n box-sizing: border-box;\n vertical-align: baseline;\n\n ::-webkit-scrollbar {\n cursor: pointer;\n width: 4px;\n height: 4px;\n background-color: transparent;\n }\n\n ::-webkit-scrollbar-thumb {\n cursor: pointer;\n background-color: transparent;\n border-radius: 2px;\n transition: background-color 500ms ", ";\n\n &:hover {\n background-color: ", ";\n }\n }\n\n ::-webkit-scrollbar-corner {\n display: none;\n width: 0;\n height: 0;\n }\n\n &:hover {\n ::-webkit-scrollbar-thumb {\n background-color: ", ";\n }\n }\n }\n }\n"])), function (_ref) {
4
+ var GlobalStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\n html,body {\n --font-settings: \"cv01\", \"tnum\", \"kern\";\n --font-variations: \"opsz\" auto, tabular-nums;\n\n overflow-x: hidden;\n overflow-y: auto;\n\n margin: 0;\n padding: 0;\n\n font-family: ", ";\n font-size: ", "px;\n font-feature-settings: var(--font-settings);\n font-variation-settings: var(--font-variations);\n line-height: 1;\n color: ", ";\n text-size-adjust: none;\n text-rendering: optimizelegibility;\n vertical-align: baseline;\n\n color-scheme: dark;\n background-color: ", ";\n\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n -webkit-overflow-scrolling:touch;\n -webkit-tap-highlight-color: transparent;\n }\n\n body {\n overflow-x: hidden;\n height: 100vh;\n }\n\n #root {\n min-height: 100vh;\n }\n\n code {\n font-family: ", " !important;\n\n span {\n font-family: ", " !important;\n }\n }\n\n p {\n text-align: justify;\n word-wrap: break-word;\n }\n\n ::selection {\n color: #000;\n background: ", ";\n }\n\n * {\n\t box-sizing: border-box;\n\t vertical-align: baseline;\n }\n\n @media only screen and (min-width: 574px) {\n * {\n ::-webkit-scrollbar {\n cursor: pointer;\n width: 4px;\n height: 4px;\n background-color: transparent;\n }\n\n ::-webkit-scrollbar-thumb {\n cursor: pointer;\n background-color: transparent;\n border-radius: 2px;\n transition: background-color 500ms ", ";\n\n &:hover {\n background-color: ", ";\n }\n }\n\n ::-webkit-scrollbar-corner {\n display: none;\n width: 0;\n height: 0;\n }\n\n &:hover {\n ::-webkit-scrollbar-thumb {\n background-color: ", ";\n }\n }\n }\n }\n"])), function (_ref) {
5
5
  var theme = _ref.theme;
6
6
  return theme.fontFamily;
7
7
  }, function (_ref2) {
package/es/Toc/style.js CHANGED
@@ -14,7 +14,7 @@ export var useStyles = createStyles(function (_ref, _ref2) {
14
14
  return {
15
15
  anchor: cx(stylish.blur, css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n overflow-x: hidden;\n overflow-y: auto;\n max-height: 60vh !important;\n "])))),
16
16
  container: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: sticky;\n top: ", "px;\n\n overscroll-behavior: contain;\n grid-area: toc;\n\n width: ", "px;\n margin-inline-end: 24px;\n\n border-radius: 3px;\n\n -webkit-overflow-scrolling: touch;\n\n ", " {\n position: relative;\n left: 0;\n width: 100%;\n margin-top: 0;\n }\n\n > h4 {\n margin: 0 0 8px;\n font-size: 12px;\n line-height: 1;\n color: ", ";\n }\n "])), headerHeight + 64, tocWidth, responsive.mobile, token.colorTextDescription),
17
- expand: cx(stylish.blur, css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: 100%;\n\n background-color: ", ";\n border-bottom: 1px solid ", ";\n border-radius: 0;\n box-shadow: ", ";\n\n .ant-collapse-content {\n overflow: auto;\n }\n\n .ant-collapse-header {\n z-index: 10;\n padding: 8px 16px !important;\n\n &[aria-expanded='true'] {\n box-shadow: ", ";\n }\n }\n "])), rgba(token.colorBgLayout, 0.5), token.colorSplit, token.boxShadowSecondary, token.boxShadowSecondary)),
17
+ expand: cx(stylish.blur, css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: 100%;\n\n background-color: ", ";\n border-bottom: 1px solid ", ";\n border-radius: 0;\n box-shadow: ", ";\n\n .ant-collapse-content {\n overflow: auto;\n }\n\n .ant-collapse-header {\n z-index: 10;\n padding: 8px 16px !important;\n }\n "])), rgba(token.colorBgLayout, 0.5), token.colorSplit, token.boxShadowSecondary)),
18
18
  mobileCtn: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n width: 100%;\n height: ", "px;\n\n .ant-collapse-expand-icon {\n color: ", ";\n }\n "])), fixHeight, token.colorTextQuaternary)
19
19
  };
20
20
  });
package/es/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export { default as ActionIcon, type ActionIconProps, type ActionIconSize } from './ActionIcon';
2
2
  export { default as ActionIconGroup, type ActionIconGroupProps } from './ActionIconGroup';
3
3
  export { default as Avatar, type AvatarProps } from './Avatar';
4
+ export { default as Burger, type BurgerProps } from './Burger';
4
5
  export type { ChatMessage, MessageRoleType } from './Chat';
5
6
  export { default as ChatInputArea, type ChatInputAreaProps } from './ChatInputArea';
6
7
  export { default as ChatItem, type ChatItemProps } from './ChatItem';
@@ -41,5 +42,4 @@ export { default as ThemeSwitch, type ThemeSwitchProps } from './ThemeSwitch';
41
42
  export { default as Toc, type TocProps } from './Toc';
42
43
  export { default as TokenTag, type TokenTagProps } from './TokenTag';
43
44
  export { default as Tooltip, type TooltipProps } from './Tooltip';
44
- export { type LobeCustomStylish } from './types/customStylish';
45
- export { type LobeCustomToken } from './types/customToken';
45
+ export type * from './types';
package/es/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  export { default as ActionIcon } from "./ActionIcon";
2
2
  export { default as ActionIconGroup } from "./ActionIconGroup";
3
3
  export { default as Avatar } from "./Avatar";
4
+ export { default as Burger } from "./Burger";
4
5
  export { default as ChatInputArea } from "./ChatInputArea";
5
6
  export { default as ChatItem } from "./ChatItem";
6
7
  export { default as ChatList } from "./ChatList";
@@ -1,8 +1,8 @@
1
1
  export interface LobeCustomStylish {
2
- blur: string;
3
- bottomScrollbar: string;
4
- gradientAnimation: string;
5
- markdown: string;
6
- noScrollbar: string;
7
- resetLinkColor: string;
2
+ blur: string;
3
+ bottomScrollbar: string;
4
+ gradientAnimation: string;
5
+ markdown: string;
6
+ noScrollbar: string;
7
+ resetLinkColor: string;
8
8
  }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,48 +1,17 @@
1
- const PresetColors = [
2
- 'red',
3
- 'volcano',
4
- 'orange',
5
- 'gold',
6
- 'yellow',
7
- 'lime',
8
- 'green',
9
- 'cyan',
10
- 'blue',
11
- 'geekblue',
12
- 'purple',
13
- 'magenta',
14
- 'gray',
15
- ] as const;
16
-
17
- export type PresetColorKey = (typeof PresetColors)[number];
18
-
19
- export type PresetColorType = Record<PresetColorKey, string>;
20
-
21
- type ColorPaletteKeyIndex = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11;
22
-
23
- type ColorTokenKey =
24
- | 'Bg'
25
- | 'BgHover'
26
- | 'Border'
27
- | 'BorderSecondary'
28
- | 'BorderHover'
29
- | 'Hover'
30
- | ''
31
- | 'Active'
32
- | 'TextHover'
33
- | 'Text'
34
- | 'TextActive';
35
-
36
- export type ColorToken = {
37
- [key in `${keyof PresetColorType}${ColorTokenKey}`]: string;
1
+ declare const PresetColors: readonly ["red", "volcano", "orange", "gold", "yellow", "lime", "green", "cyan", "blue", "geekblue", "purple", "magenta", "gray"];
2
+ export declare type PresetColorKey = (typeof PresetColors)[number];
3
+ export declare type PresetColorType = Record<PresetColorKey, string>;
4
+ declare type ColorPaletteKeyIndex = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11;
5
+ declare type ColorTokenKey = 'Bg' | 'BgHover' | 'Border' | 'BorderSecondary' | 'BorderHover' | 'Hover' | '' | 'Active' | 'TextHover' | 'Text' | 'TextActive';
6
+ export declare type ColorToken = {
7
+ [key in `${keyof PresetColorType}${ColorTokenKey}`]: string;
38
8
  };
39
-
40
- export type ColorPalettes = {
41
- [key in `${keyof PresetColorType}${ColorPaletteKeyIndex}`]: string;
9
+ export declare type ColorPalettes = {
10
+ [key in `${keyof PresetColorType}${ColorPaletteKeyIndex}`]: string;
42
11
  };
43
-
44
- export type ColorPalettesAlpha = {
45
- [key in `${keyof PresetColorType}${ColorPaletteKeyIndex}A`]: string;
12
+ export declare type ColorPalettesAlpha = {
13
+ [key in `${keyof PresetColorType}${ColorPaletteKeyIndex}A`]: string;
46
14
  };
47
-
48
- export interface LobeCustomToken extends ColorToken, ColorPalettes, ColorPalettesAlpha {}
15
+ export interface LobeCustomToken extends ColorToken, ColorPalettes, ColorPalettesAlpha {
16
+ }
17
+ export {};
@@ -0,0 +1,2 @@
1
+ var PresetColors = ['red', 'volcano', 'orange', 'gold', 'yellow', 'lime', 'green', 'cyan', 'blue', 'geekblue', 'purple', 'magenta', 'gray'];
2
+ export {};
@@ -1,4 +1,9 @@
1
1
  import { type HTMLAttributes } from 'react';
2
+ export * from './chatMessage';
3
+ export * from './customStylish';
4
+ export * from './customToken';
5
+ export * from './llm';
6
+ export * from './meta';
2
7
  export declare type DivProps = HTMLAttributes<HTMLDivElement>;
3
8
  export declare type SvgProps = HTMLAttributes<SVGSVGElement>;
4
9
  export declare type ImgProps = HTMLAttributes<HTMLImageElement>;
package/es/types/index.js CHANGED
@@ -1 +1,6 @@
1
+ export * from "./chatMessage";
2
+ export * from "./customStylish";
3
+ export * from "./customToken";
4
+ export * from "./llm";
5
+ export * from "./meta";
1
6
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "1.27.0",
3
+ "version": "1.27.1",
4
4
  "description": "Lobe UI is an open-source UI component library for building chatbot web apps",
5
5
  "keywords": [
6
6
  "lobehub",