@lobehub/icons 1.0.0 → 1.1.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 (77) hide show
  1. package/es/ChatGLM/components/Avatar.d.ts +4 -0
  2. package/es/ChatGLM/components/Avatar.js +33 -0
  3. package/es/ChatGLM/components/Color.d.ts +3 -0
  4. package/es/ChatGLM/components/Color.js +47 -0
  5. package/es/ChatGLM/components/Combine.d.ts +8 -0
  6. package/es/ChatGLM/components/Combine.js +34 -0
  7. package/es/ChatGLM/components/Mono.d.ts +3 -0
  8. package/es/ChatGLM/components/Mono.js +31 -0
  9. package/es/ChatGLM/components/Text.d.ts +3 -0
  10. package/es/ChatGLM/components/Text.js +31 -0
  11. package/es/ChatGLM/index.d.ts +15 -0
  12. package/es/ChatGLM/index.js +13 -0
  13. package/es/ChatGLM/style.d.ts +3 -0
  14. package/es/ChatGLM/style.js +3 -0
  15. package/es/IconAvatar/index.d.ts +9 -0
  16. package/es/IconAvatar/index.js +27 -0
  17. package/es/Tongyi/components/Avatar.d.ts +4 -0
  18. package/es/Tongyi/components/Avatar.js +30 -0
  19. package/es/Tongyi/components/Color.d.ts +3 -0
  20. package/es/Tongyi/components/Color.js +49 -0
  21. package/es/Tongyi/components/Combine.d.ts +8 -0
  22. package/es/Tongyi/components/Combine.js +34 -0
  23. package/es/Tongyi/components/Mono.d.ts +3 -0
  24. package/es/Tongyi/components/Mono.js +31 -0
  25. package/es/Tongyi/components/Text.d.ts +3 -0
  26. package/es/Tongyi/components/Text.js +31 -0
  27. package/es/Tongyi/index.d.ts +15 -0
  28. package/es/Tongyi/index.js +13 -0
  29. package/es/Tongyi/style.d.ts +3 -0
  30. package/es/Tongyi/style.js +3 -0
  31. package/es/Wenxin/components/Avatar.d.ts +4 -0
  32. package/es/Wenxin/components/Avatar.js +30 -0
  33. package/es/Wenxin/components/Color.d.ts +3 -0
  34. package/es/Wenxin/components/Color.js +53 -0
  35. package/es/Wenxin/components/Combine.d.ts +8 -0
  36. package/es/Wenxin/components/Combine.js +34 -0
  37. package/es/Wenxin/components/Mono.d.ts +3 -0
  38. package/es/Wenxin/components/Mono.js +47 -0
  39. package/es/Wenxin/components/Text.d.ts +3 -0
  40. package/es/Wenxin/components/Text.js +31 -0
  41. package/es/Wenxin/index.d.ts +15 -0
  42. package/es/Wenxin/index.js +13 -0
  43. package/es/Wenxin/style.d.ts +3 -0
  44. package/es/Wenxin/style.js +3 -0
  45. package/es/Zhipu/components/Avatar.d.ts +2 -2
  46. package/es/Zhipu/components/Avatar.js +13 -11
  47. package/es/Zhipu/components/Combine.js +2 -2
  48. package/es/Zhipu/components/Text.js +2 -1
  49. package/es/Zhipu/index.d.ts +15 -6
  50. package/es/Zhipu/index.js +13 -6
  51. package/es/components/ColorPreview/index.js +40 -0
  52. package/es/{Editor/Preview.d.ts → components/Editor/Color.d.ts} +1 -2
  53. package/es/components/Editor/Color.js +47 -0
  54. package/es/components/Editor/Mono.d.ts +8 -0
  55. package/es/components/Editor/Mono.js +47 -0
  56. package/es/components/Editor/Preview.d.ts +8 -0
  57. package/es/components/Editor/Preview.js +57 -0
  58. package/es/components/Editor/index.js +122 -0
  59. package/es/components/Editor/useSvgo.d.ts +6 -0
  60. package/es/components/Editor/useSvgo.js +51 -0
  61. package/es/components/IconPreview/ColorPreview.d.ts +6 -0
  62. package/es/{IconPreview → components/IconPreview}/ColorPreview.js +1 -2
  63. package/es/index.d.ts +5 -4
  64. package/es/index.js +4 -5
  65. package/package.json +7 -9
  66. package/es/Editor/Preview.js +0 -93
  67. package/es/Editor/index.js +0 -67
  68. package/es/IconShowcase/index.d.ts +0 -11
  69. package/es/IconShowcase/index.js +0 -91
  70. /package/es/{IconPreview/ColorPreview.d.ts → components/ColorPreview/index.d.ts} +0 -0
  71. /package/es/{Editor → components/Editor}/data.d.ts +0 -0
  72. /package/es/{Editor → components/Editor}/data.js +0 -0
  73. /package/es/{Editor → components/Editor}/index.d.ts +0 -0
  74. /package/es/{Editor → components/Editor}/svgo.d.ts +0 -0
  75. /package/es/{Editor → components/Editor}/svgo.js +0 -0
  76. /package/es/{IconPreview → components/IconPreview}/index.d.ts +0 -0
  77. /package/es/{IconPreview → components/IconPreview}/index.js +0 -0
@@ -0,0 +1,53 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ var _excluded = ["size", "style"];
4
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
+ import { forwardRef } from 'react';
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ import { jsxs as _jsxs } from "react/jsx-runtime";
9
+ var Icon = /*#__PURE__*/forwardRef(function (_ref, ref) {
10
+ var _ref$size = _ref.size,
11
+ size = _ref$size === void 0 ? '1em' : _ref$size,
12
+ style = _ref.style,
13
+ rest = _objectWithoutProperties(_ref, _excluded);
14
+ return /*#__PURE__*/_jsxs("svg", _objectSpread(_objectSpread({
15
+ height: size,
16
+ ref: ref,
17
+ style: _objectSpread({
18
+ flex: 'none',
19
+ lineHeight: 1
20
+ }, style),
21
+ viewBox: "0 0 24 24",
22
+ width: size,
23
+ xmlns: "http://www.w3.org/2000/svg"
24
+ }, rest), {}, {
25
+ children: [/*#__PURE__*/_jsx("defs", {
26
+ children: /*#__PURE__*/_jsxs("linearGradient", {
27
+ id: "a",
28
+ x1: "9.155%",
29
+ x2: "90.531%",
30
+ y1: "75.177%",
31
+ y2: "25.028%",
32
+ children: [/*#__PURE__*/_jsx("stop", {
33
+ offset: "0%",
34
+ stopColor: "#0A51C3"
35
+ }), /*#__PURE__*/_jsx("stop", {
36
+ offset: "100%",
37
+ stopColor: "#23A4FB"
38
+ })]
39
+ })
40
+ }), /*#__PURE__*/_jsxs("g", {
41
+ fill: "none",
42
+ fillRule: "nonzero",
43
+ children: [/*#__PURE__*/_jsx("path", {
44
+ d: "M11.32 1.176a1.4 1.4 0 011.36 0l8.64 4.843c.421.234.68.67.68 1.141v9.68c0 .472-.259.908-.68 1.143l-8.64 4.84a1.4 1.4 0 01-1.36 0l-8.64-4.84A1.31 1.31 0 012 16.84V7.159c0-.471.259-.907.68-1.142l8.64-4.84zm7.42 13.839V8.227L12.002 12 12 19.551l6.059-3.394a1.31 1.31 0 00.68-1.142zM12.68 4.833a1.393 1.393 0 00-1.36 0L5.944 7.846c-.421.235-.68.67-.68 1.142v6.027c0 .47.259.905.68 1.142l2.795 1.566V11.09a1.546 1.546 0 00.221.79 1.527 1.527 0 01-.216-.834l.004-.094.02-.15.018-.084.017-.062.039-.117.062-.142.035-.065.081-.13.094-.122.084-.091.08-.075.125-.1.071-.048.134-.076 5.87-3.29-2.796-1.566z",
45
+ fill: "url(#a)"
46
+ }), /*#__PURE__*/_jsx("path", {
47
+ d: "M12 11.088c0-.875-.73-1.584-1.631-1.584a1.66 1.66 0 00-.855.237c-.027.016-.055.033-.08.05a2.361 2.361 0 00-.123.093c-.022.02-.045.038-.066.059l-.048.045-.063.067c-.014.016-.028.031-.04.048a2.303 2.303 0 00-.094.125l-.042.069a1.7 1.7 0 00-.07.13l-.036.081a.764.764 0 00-.022.06c-.01.03-.02.058-.028.087l-.017.062a.883.883 0 00-.03.16c-.002.025-.007.05-.008.074a1.527 1.527 0 00.213.929c.302.508.85.792 1.414.792.277 0 .558-.068.814-.212l.815-.457v-.914L12 11.088z",
48
+ fill: "#012F8D"
49
+ })]
50
+ })]
51
+ }));
52
+ });
53
+ export default Icon;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { type FlexboxProps } from 'react-layout-kit';
3
+ export interface CombineProps extends FlexboxProps {
4
+ size?: number;
5
+ type?: 'color' | 'mono';
6
+ }
7
+ declare const Combine: import("react").NamedExoticComponent<CombineProps>;
8
+ export default Combine;
@@ -0,0 +1,34 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ var _excluded = ["type", "size"];
4
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
+ import { memo } from 'react';
7
+ import { Flexbox } from 'react-layout-kit';
8
+ import { SPACE_MULTIPLE, TEXT_MULTIPLE } from "../style";
9
+ import Color from "./Color";
10
+ import Mono from "./Mono";
11
+ import Text from "./Text";
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { jsxs as _jsxs } from "react/jsx-runtime";
14
+ var Combine = /*#__PURE__*/memo(function (_ref) {
15
+ var _ref$type = _ref.type,
16
+ type = _ref$type === void 0 ? 'mono' : _ref$type,
17
+ _ref$size = _ref.size,
18
+ size = _ref$size === void 0 ? 24 : _ref$size,
19
+ rest = _objectWithoutProperties(_ref, _excluded);
20
+ var Icon = type === 'color' ? Color : Mono;
21
+ return /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
22
+ align: 'center',
23
+ flex: 'none',
24
+ gap: size * SPACE_MULTIPLE,
25
+ horizontal: true
26
+ }, rest), {}, {
27
+ children: [/*#__PURE__*/_jsx(Icon, {
28
+ size: size
29
+ }), /*#__PURE__*/_jsx(Text, {
30
+ size: size * TEXT_MULTIPLE
31
+ })]
32
+ }));
33
+ });
34
+ export default Combine;
@@ -0,0 +1,3 @@
1
+ import type { IconType } from "../../types";
2
+ declare const Icon: IconType;
3
+ export default Icon;
@@ -0,0 +1,47 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ var _excluded = ["size", "style"];
4
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
+ import { forwardRef } from 'react';
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ import { jsxs as _jsxs } from "react/jsx-runtime";
9
+ var Icon = /*#__PURE__*/forwardRef(function (_ref, ref) {
10
+ var _ref$size = _ref.size,
11
+ size = _ref$size === void 0 ? '1em' : _ref$size,
12
+ style = _ref.style,
13
+ rest = _objectWithoutProperties(_ref, _excluded);
14
+ return /*#__PURE__*/_jsxs("svg", _objectSpread(_objectSpread({
15
+ fill: "currentColor",
16
+ fillRule: "evenodd",
17
+ height: size,
18
+ ref: ref,
19
+ style: _objectSpread({
20
+ flex: 'none',
21
+ lineHeight: 1
22
+ }, style),
23
+ viewBox: "0 0 24 24",
24
+ width: size,
25
+ xmlns: "http://www.w3.org/2000/svg"
26
+ }, rest), {}, {
27
+ children: [/*#__PURE__*/_jsx("defs", {
28
+ children: /*#__PURE__*/_jsxs("linearGradient", {
29
+ id: "a",
30
+ x1: "9.155%",
31
+ x2: "90.531%",
32
+ y1: "75.177%",
33
+ y2: "25.028%",
34
+ children: [/*#__PURE__*/_jsx("stop", {
35
+ offset: "0%",
36
+ stopColor: "#0A51C3"
37
+ }), /*#__PURE__*/_jsx("stop", {
38
+ offset: "100%",
39
+ stopColor: "#23A4FB"
40
+ })]
41
+ })
42
+ }), /*#__PURE__*/_jsx("path", {
43
+ d: "M11.32 1.176a1.4 1.4 0 011.36 0l8.64 4.843c.421.234.68.67.68 1.141v9.68c0 .472-.259.908-.68 1.143l-8.64 4.84a1.4 1.4 0 01-1.36 0l-8.64-4.84A1.31 1.31 0 012 16.84V7.159c0-.471.259-.907.68-1.142l8.64-4.84zm7.42 13.839V8.227L12.002 12 12 19.551l6.059-3.394a1.31 1.31 0 00.68-1.142zM12.68 4.833a1.393 1.393 0 00-1.36 0L5.944 7.846c-.421.235-.68.67-.68 1.142v6.027c0 .47.259.905.68 1.142l2.795 1.566V11.09a1.546 1.546 0 00.221.79 1.527 1.527 0 01-.216-.834l.004-.094.02-.15.018-.084.017-.062.039-.117.062-.142.035-.065.081-.13.094-.122.084-.091.08-.075.125-.1.071-.048.134-.076 5.87-3.29-2.796-1.566z"
44
+ })]
45
+ }));
46
+ });
47
+ export default Icon;
@@ -0,0 +1,3 @@
1
+ import type { IconType } from "../../types";
2
+ declare const Icon: IconType;
3
+ export default Icon;
@@ -0,0 +1,31 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ var _excluded = ["size", "style"];
4
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
+ import { forwardRef } from 'react';
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ var Icon = /*#__PURE__*/forwardRef(function (_ref, ref) {
9
+ var _ref$size = _ref.size,
10
+ size = _ref$size === void 0 ? '1em' : _ref$size,
11
+ style = _ref.style,
12
+ rest = _objectWithoutProperties(_ref, _excluded);
13
+ return /*#__PURE__*/_jsx("svg", _objectSpread(_objectSpread({
14
+ fill: "currentColor",
15
+ fillRule: "evenodd",
16
+ height: size,
17
+ ref: ref,
18
+ style: _objectSpread({
19
+ flex: 'none',
20
+ lineHeight: 1,
21
+ width: 'fit-content'
22
+ }, style),
23
+ viewBox: "0 0 47 24",
24
+ xmlns: "http://www.w3.org/2000/svg"
25
+ }, rest), {}, {
26
+ children: /*#__PURE__*/_jsx("path", {
27
+ d: "M14.205 2.235H10.59v1.878H2.149v2.28H4.75c1.415 4.332 3.262 7.642 5.478 10.077C8.038 17.998 5.307 19.063 2 19.635V22c3.878-.142 7.345-1.256 10.293-3.594 2.949 2.34 6.417 3.452 10.294 3.594v-2.365c-3.307-.572-6.038-1.637-8.229-3.165 2.217-2.435 4.064-5.745 5.478-10.076h2.75v-2.28h-8.382V2.234h.001zm-1.91 12.499c-2.137-2.165-3.541-4.958-4.26-8.339h8.522c-.718 3.38-2.123 6.174-4.26 8.339h-.002zm12.812-4.09c0 3.295-.491 7.58-.692 9.186h2.892c.227-1.867.67-5.916.67-9.186V6.173h-2.872v4.47h.002zm7.64-7.254v14.507c0 .804.436 1.377 1.396 1.377h1.244l6.023-.001v2.4h-7.202v-.026c-.338-.004-.74-.006-1.216-.006-2.554 0-3.313-.886-3.313-3.744V3.39h3.067zM43.89 6.06C44.453 9.666 45 14.418 45 19.275h-2.872c0-4.84-.582-9.655-1.153-13.213zM37.993 2c.36 2.315.733 5.556.733 9.034V16h-2.87v-4.967c0-3.5-.41-6.803-.774-9.034h2.911z"
28
+ })
29
+ }));
30
+ });
31
+ export default Icon;
@@ -0,0 +1,15 @@
1
+ import Avatar from './components/Avatar';
2
+ import Color from './components/Color';
3
+ import Combine from './components/Combine';
4
+ import Mono from './components/Mono';
5
+ import Text from './components/Text';
6
+ type CompoundedComponent = typeof Mono & {
7
+ Avatar: typeof Avatar;
8
+ Color: typeof Color;
9
+ Combine: typeof Combine;
10
+ Mono: typeof Mono;
11
+ Text: typeof Text;
12
+ colorPrimary: string;
13
+ };
14
+ declare const Icons: CompoundedComponent;
15
+ export default Icons;
@@ -0,0 +1,13 @@
1
+ import Avatar from "./components/Avatar";
2
+ import Color from "./components/Color";
3
+ import Combine from "./components/Combine";
4
+ import Mono from "./components/Mono";
5
+ import Text from "./components/Text";
6
+ import { COLOR_PRIMARY } from "./style";
7
+ var Icons = Mono;
8
+ Icons.Color = Color;
9
+ Icons.Text = Text;
10
+ Icons.Combine = Combine;
11
+ Icons.Avatar = Avatar;
12
+ Icons.colorPrimary = COLOR_PRIMARY;
13
+ export default Icons;
@@ -0,0 +1,3 @@
1
+ export declare const TEXT_MULTIPLE = 0.75;
2
+ export declare const SPACE_MULTIPLE = 0.2;
3
+ export declare const COLOR_PRIMARY = "#167ADF";
@@ -0,0 +1,3 @@
1
+ export var TEXT_MULTIPLE = 0.75;
2
+ export var SPACE_MULTIPLE = 0.2;
3
+ export var COLOR_PRIMARY = '#167ADF';
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
- import { type AvatarProps } from '@lobehub/ui';
3
- declare const Avatar: import("react").NamedExoticComponent<AvatarProps>;
2
+ import { type IconAvatarProps } from "../../IconAvatar";
3
+ declare const Avatar: import("react").NamedExoticComponent<IconAvatarProps>;
4
4
  export default Avatar;
@@ -1,28 +1,30 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["size", "style"];
3
+ var _excluded = ["size", "style", "background"];
4
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
- import { Avatar as A } from '@lobehub/ui';
7
- import { readableColor } from 'polished';
8
6
  import { memo } from 'react';
7
+ import IconAvatar from "../../IconAvatar";
9
8
  import { COLOR_PRIMARY } from "../style";
10
9
  import Mono from "./Mono";
11
10
  import { jsx as _jsx } from "react/jsx-runtime";
12
11
  var Avatar = /*#__PURE__*/memo(function (_ref) {
13
12
  var _ref$size = _ref.size,
14
- size = _ref$size === void 0 ? 64 : _ref$size,
13
+ size = _ref$size === void 0 ? 24 : _ref$size,
15
14
  style = _ref.style,
15
+ background = _ref.background,
16
16
  rest = _objectWithoutProperties(_ref, _excluded);
17
- return /*#__PURE__*/_jsx(A, _objectSpread({
18
- avatar: /*#__PURE__*/_jsx(Mono, {
19
- size: size * 0.75
20
- }),
21
- background: COLOR_PRIMARY,
17
+ var bg = background || COLOR_PRIMARY;
18
+ return /*#__PURE__*/_jsx(IconAvatar, _objectSpread(_objectSpread({
19
+ background: bg,
22
20
  size: size,
23
21
  style: _objectSpread({
24
- color: readableColor(COLOR_PRIMARY)
22
+ color: '#fff'
25
23
  }, style)
26
- }, rest));
24
+ }, rest), {}, {
25
+ children: /*#__PURE__*/_jsx(Mono, {
26
+ size: size * 0.75
27
+ })
28
+ }));
27
29
  });
28
30
  export default Avatar;
@@ -13,9 +13,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { jsxs as _jsxs } from "react/jsx-runtime";
14
14
  var Combine = /*#__PURE__*/memo(function (_ref) {
15
15
  var _ref$type = _ref.type,
16
- type = _ref$type === void 0 ? 'color' : _ref$type,
16
+ type = _ref$type === void 0 ? 'mono' : _ref$type,
17
17
  _ref$size = _ref.size,
18
- size = _ref$size === void 0 ? 64 : _ref$size,
18
+ size = _ref$size === void 0 ? 24 : _ref$size,
19
19
  rest = _objectWithoutProperties(_ref, _excluded);
20
20
  var Icon = type === 'color' ? Color : Mono;
21
21
  return /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
@@ -17,7 +17,8 @@ var Icon = /*#__PURE__*/forwardRef(function (_ref, ref) {
17
17
  ref: ref,
18
18
  style: _objectSpread({
19
19
  flex: 'none',
20
- lineHeight: 1
20
+ lineHeight: 1,
21
+ width: 'fit-content'
21
22
  }, style),
22
23
  viewBox: "0 0 86 24",
23
24
  xmlns: "http://www.w3.org/2000/svg"
@@ -1,6 +1,15 @@
1
- export { default as Avatar } from './components/Avatar';
2
- export { default as Color } from './components/Color';
3
- export { default as Combine } from './components/Combine';
4
- export { default as Mono } from './components/Mono';
5
- export { default as Text } from './components/Text';
6
- export { COLOR_PRIMARY as colorPrimary } from './style';
1
+ import Avatar from './components/Avatar';
2
+ import Color from './components/Color';
3
+ import Combine from './components/Combine';
4
+ import Mono from './components/Mono';
5
+ import Text from './components/Text';
6
+ type CompoundedComponent = typeof Mono & {
7
+ Avatar: typeof Avatar;
8
+ Color: typeof Color;
9
+ Combine: typeof Combine;
10
+ Mono: typeof Mono;
11
+ Text: typeof Text;
12
+ colorPrimary: string;
13
+ };
14
+ declare const Icons: CompoundedComponent;
15
+ export default Icons;
package/es/Zhipu/index.js CHANGED
@@ -1,6 +1,13 @@
1
- export { default as Avatar } from "./components/Avatar";
2
- export { default as Color } from "./components/Color";
3
- export { default as Combine } from "./components/Combine";
4
- export { default as Mono } from "./components/Mono";
5
- export { default as Text } from "./components/Text";
6
- export { COLOR_PRIMARY as colorPrimary } from "./style";
1
+ import Avatar from "./components/Avatar";
2
+ import Color from "./components/Color";
3
+ import Combine from "./components/Combine";
4
+ import Mono from "./components/Mono";
5
+ import Text from "./components/Text";
6
+ import { COLOR_PRIMARY } from "./style";
7
+ var Icons = Mono;
8
+ Icons.Color = Color;
9
+ Icons.Text = Text;
10
+ Icons.Combine = Combine;
11
+ Icons.Avatar = Avatar;
12
+ Icons.colorPrimary = COLOR_PRIMARY;
13
+ export default Icons;
@@ -0,0 +1,40 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
2
+ var _templateObject, _templateObject2;
3
+ import { CopyButton } from '@lobehub/ui';
4
+ import { createStyles } from 'antd-style';
5
+ import { memo } from 'react';
6
+ import { Flexbox } from 'react-layout-kit';
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ import { jsxs as _jsxs } from "react/jsx-runtime";
9
+ var useStyles = createStyles(function (_ref) {
10
+ var css = _ref.css,
11
+ token = _ref.token,
12
+ cx = _ref.cx;
13
+ return {
14
+ btn: cx('copy-button', css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n top: 4px;\n right: 4px;\n opacity: 0;\n "])))),
15
+ container: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n\n flex: none;\n\n width: 98px;\n height: 98px;\n\n font-family: ", ";\n line-height: 1;\n\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n\n &:hover {\n .copy-button {\n opacity: 1;\n }\n }\n "])), token.fontFamilyCode, token.colorBgContainer, token.colorBorder, token.borderRadius)
16
+ };
17
+ });
18
+ var IconPreview = /*#__PURE__*/memo(function (_ref2) {
19
+ var color = _ref2.color;
20
+ var _useStyles = useStyles(),
21
+ styles = _useStyles.styles;
22
+ return /*#__PURE__*/_jsxs(Flexbox, {
23
+ align: 'center',
24
+ className: styles.container,
25
+ justify: 'center',
26
+ style: {
27
+ background: color
28
+ },
29
+ children: [/*#__PURE__*/_jsx("div", {
30
+ style: {
31
+ color: '#fff'
32
+ },
33
+ children: color
34
+ }), /*#__PURE__*/_jsx(CopyButton, {
35
+ className: styles.btn,
36
+ content: color
37
+ })]
38
+ });
39
+ });
40
+ export default IconPreview;
@@ -1,9 +1,8 @@
1
1
  /// <reference types="react" />
2
- import { type SvgoConfig } from './svgo';
3
2
  interface PreviewProps {
4
- config?: SvgoConfig;
5
3
  svg: string;
6
4
  title: string;
5
+ viewbox: string;
7
6
  }
8
7
  declare const Preview: import("react").NamedExoticComponent<PreviewProps>;
9
8
  export default Preview;
@@ -0,0 +1,47 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
2
+ var _templateObject;
3
+ import { Highlighter } from '@lobehub/ui';
4
+ import { createStyles } from 'antd-style';
5
+ import { memo } from 'react';
6
+ import { Flexbox } from 'react-layout-kit';
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ import { jsxs as _jsxs } from "react/jsx-runtime";
9
+ var useStyles = createStyles(function (_ref) {
10
+ var css = _ref.css;
11
+ return {
12
+ code: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n pre {\n padding: 8px !important;\n }\n\n code {\n font-size: 12px;\n text-wrap: initial;\n }\n "])))
13
+ };
14
+ });
15
+ var Preview = /*#__PURE__*/memo(function (_ref2) {
16
+ var svg = _ref2.svg,
17
+ title = _ref2.title,
18
+ viewbox = _ref2.viewbox;
19
+ var _useStyles = useStyles(),
20
+ styles = _useStyles.styles;
21
+ return /*#__PURE__*/_jsxs(Flexbox, {
22
+ flex: 'none',
23
+ gap: 16,
24
+ style: {
25
+ position: 'relative',
26
+ width: '100%'
27
+ },
28
+ children: [/*#__PURE__*/_jsx(Flexbox, {
29
+ align: 'center',
30
+ gap: 8,
31
+ horizontal: true,
32
+ children: /*#__PURE__*/_jsx("h2", {
33
+ style: {
34
+ lineHeight: 1,
35
+ margin: 0
36
+ },
37
+ children: title
38
+ })
39
+ }), /*#__PURE__*/_jsx(Highlighter, {
40
+ className: styles.code,
41
+ language: 'tsx',
42
+ type: 'ghost',
43
+ children: "import { forwardRef } from 'react';\nimport type { IconType } from '@/types';\n\nconst Icon: IconType = forwardRef(({ size = '1em', style, ...rest }, ref) => {\n return (\n <svg\n height={size}\n ref={ref}\n style={{ flex: 'none', lineHeight: 1, ...style }}\n viewBox=\"".concat(viewbox, "\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n {...rest}\n >\n ").concat(svg, "\n </svg>\n );\n});\n\nexport default Icon;\n")
44
+ })]
45
+ });
46
+ });
47
+ export default Preview;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ interface PreviewProps {
3
+ svg: string;
4
+ title: string;
5
+ viewbox: string;
6
+ }
7
+ declare const Preview: import("react").NamedExoticComponent<PreviewProps>;
8
+ export default Preview;
@@ -0,0 +1,47 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
2
+ var _templateObject;
3
+ import { Highlighter } from '@lobehub/ui';
4
+ import { createStyles } from 'antd-style';
5
+ import { memo } from 'react';
6
+ import { Flexbox } from 'react-layout-kit';
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ import { jsxs as _jsxs } from "react/jsx-runtime";
9
+ var useStyles = createStyles(function (_ref) {
10
+ var css = _ref.css;
11
+ return {
12
+ code: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n pre {\n padding: 8px !important;\n }\n\n code {\n font-size: 12px;\n text-wrap: initial;\n }\n "])))
13
+ };
14
+ });
15
+ var Preview = /*#__PURE__*/memo(function (_ref2) {
16
+ var svg = _ref2.svg,
17
+ title = _ref2.title,
18
+ viewbox = _ref2.viewbox;
19
+ var _useStyles = useStyles(),
20
+ styles = _useStyles.styles;
21
+ return /*#__PURE__*/_jsxs(Flexbox, {
22
+ flex: 'none',
23
+ gap: 16,
24
+ style: {
25
+ position: 'relative',
26
+ width: '100%'
27
+ },
28
+ children: [/*#__PURE__*/_jsx(Flexbox, {
29
+ align: 'center',
30
+ gap: 8,
31
+ horizontal: true,
32
+ children: /*#__PURE__*/_jsx("h2", {
33
+ style: {
34
+ lineHeight: 1,
35
+ margin: 0
36
+ },
37
+ children: title
38
+ })
39
+ }), /*#__PURE__*/_jsx(Highlighter, {
40
+ className: styles.code,
41
+ language: 'tsx',
42
+ type: 'ghost',
43
+ children: "import { forwardRef } from 'react';\nimport type { IconType } from '@/types';\n\nconst Icon: IconType = forwardRef(({ size = '1em', style, ...rest }, ref) => {\n return (\n <svg\n fill=\"currentColor\"\n fillRule=\"evenodd\"\n height={size}\n ref={ref}\n style={{ flex: 'none', lineHeight: 1, ...style }}\n viewBox=\"".concat(viewbox, "\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n {...rest}\n >\n ").concat(svg, "\n </svg>\n );\n});\n\nexport default Icon;\n")
44
+ })]
45
+ });
46
+ });
47
+ export default Preview;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ interface PreviewProps {
3
+ precent?: string;
4
+ svg: string;
5
+ title: string;
6
+ }
7
+ declare const Preview: import("react").ForwardRefExoticComponent<PreviewProps & import("react").RefAttributes<HTMLDivElement>>;
8
+ export default Preview;
@@ -0,0 +1,57 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
2
+ var _templateObject;
3
+ import { Highlighter, Tag } from '@lobehub/ui';
4
+ import { createStyles } from 'antd-style';
5
+ import { forwardRef } from 'react';
6
+ import { Flexbox } from 'react-layout-kit';
7
+ import IconPreview from "../IconPreview";
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ import { jsxs as _jsxs } from "react/jsx-runtime";
10
+ var useStyles = createStyles(function (_ref) {
11
+ var css = _ref.css;
12
+ return {
13
+ code: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n flex: 1;\n height: 96px;\n\n pre {\n padding: 8px !important;\n }\n\n code {\n font-size: 12px;\n text-wrap: initial;\n }\n "])))
14
+ };
15
+ });
16
+ var Preview = /*#__PURE__*/forwardRef(function (_ref2, ref) {
17
+ var svg = _ref2.svg,
18
+ title = _ref2.title,
19
+ precent = _ref2.precent;
20
+ var _useStyles = useStyles(),
21
+ styles = _useStyles.styles;
22
+ return /*#__PURE__*/_jsxs(Flexbox, {
23
+ flex: 'none',
24
+ gap: 16,
25
+ style: {
26
+ position: 'relative',
27
+ width: '100%'
28
+ },
29
+ children: [/*#__PURE__*/_jsxs(Flexbox, {
30
+ align: 'center',
31
+ gap: 8,
32
+ horizontal: true,
33
+ children: [/*#__PURE__*/_jsx("h2", {
34
+ style: {
35
+ lineHeight: 1,
36
+ margin: 0
37
+ },
38
+ children: title
39
+ }), precent && /*#__PURE__*/_jsx(Tag, {
40
+ children: precent
41
+ })]
42
+ }), /*#__PURE__*/_jsxs(Flexbox, {
43
+ gap: 8,
44
+ horizontal: true,
45
+ ref: ref,
46
+ children: [/*#__PURE__*/_jsx(IconPreview, {
47
+ children: svg
48
+ }), /*#__PURE__*/_jsx(Highlighter, {
49
+ className: styles.code,
50
+ language: 'tsx',
51
+ type: 'ghost',
52
+ children: svg
53
+ })]
54
+ })]
55
+ });
56
+ });
57
+ export default Preview;