@lobehub/icons 1.0.0 → 1.2.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 (132) hide show
  1. package/es/Anthropic/components/Avatar.d.ts +5 -0
  2. package/es/Anthropic/components/Avatar.js +20 -0
  3. package/es/Anthropic/components/Mono.d.ts +3 -0
  4. package/es/Anthropic/components/Mono.js +31 -0
  5. package/es/Anthropic/components/Text.d.ts +3 -0
  6. package/es/Anthropic/components/Text.js +31 -0
  7. package/es/Anthropic/index.d.ts +11 -0
  8. package/es/Anthropic/index.js +9 -0
  9. package/es/Anthropic/style.d.ts +3 -0
  10. package/es/Anthropic/style.js +3 -0
  11. package/es/ChatGLM/components/Avatar.d.ts +5 -0
  12. package/es/ChatGLM/components/Avatar.js +26 -0
  13. package/es/ChatGLM/components/Color.d.ts +3 -0
  14. package/es/ChatGLM/components/Color.js +51 -0
  15. package/es/ChatGLM/components/Combine.d.ts +7 -0
  16. package/es/ChatGLM/components/Combine.js +25 -0
  17. package/es/ChatGLM/components/Mono.d.ts +3 -0
  18. package/es/ChatGLM/components/Mono.js +31 -0
  19. package/es/ChatGLM/components/Text.d.ts +3 -0
  20. package/es/ChatGLM/components/Text.js +31 -0
  21. package/es/ChatGLM/index.d.ts +16 -0
  22. package/es/ChatGLM/index.js +14 -0
  23. package/es/ChatGLM/style.d.ts +4 -0
  24. package/es/ChatGLM/style.js +4 -0
  25. package/es/Dalle/components/Combine.d.ts +5 -0
  26. package/es/Dalle/components/Combine.js +29 -0
  27. package/es/Dalle/components/Mono.d.ts +3 -0
  28. package/es/Dalle/components/Mono.js +31 -0
  29. package/es/Dalle/components/Text.d.ts +3 -0
  30. package/es/Dalle/components/Text.js +31 -0
  31. package/es/Dalle/index.d.ts +10 -0
  32. package/es/Dalle/index.js +9 -0
  33. package/es/Dalle/style.d.ts +3 -0
  34. package/es/Dalle/style.js +3 -0
  35. package/es/Gemini/components/Avatar.d.ts +5 -0
  36. package/es/Gemini/components/Avatar.js +20 -0
  37. package/es/Gemini/components/BrandColor.d.ts +3 -0
  38. package/es/Gemini/components/BrandColor.js +53 -0
  39. package/es/Gemini/components/BrandMono.d.ts +3 -0
  40. package/es/Gemini/components/BrandMono.js +31 -0
  41. package/es/Gemini/components/Color.d.ts +3 -0
  42. package/es/Gemini/components/Color.js +54 -0
  43. package/es/Gemini/components/Combine.d.ts +7 -0
  44. package/es/Gemini/components/Combine.js +25 -0
  45. package/es/Gemini/components/Mono.d.ts +3 -0
  46. package/es/Gemini/components/Mono.js +31 -0
  47. package/es/Gemini/components/Text.d.ts +3 -0
  48. package/es/Gemini/components/Text.js +31 -0
  49. package/es/Gemini/index.d.ts +20 -0
  50. package/es/Gemini/index.js +18 -0
  51. package/es/Gemini/style.d.ts +4 -0
  52. package/es/Gemini/style.js +4 -0
  53. package/es/IconAvatar/index.d.ts +15 -0
  54. package/es/IconAvatar/index.js +38 -0
  55. package/es/IconCombine/index.d.ts +17 -0
  56. package/es/IconCombine/index.js +49 -0
  57. package/es/OpenAI/components/Avatar.d.ts +7 -0
  58. package/es/OpenAI/components/Avatar.js +38 -0
  59. package/es/OpenAI/components/Combine.d.ts +5 -0
  60. package/es/OpenAI/components/Combine.js +25 -0
  61. package/es/OpenAI/components/Mono.d.ts +3 -0
  62. package/es/OpenAI/components/Mono.js +31 -0
  63. package/es/OpenAI/components/Text.d.ts +3 -0
  64. package/es/OpenAI/components/Text.js +31 -0
  65. package/es/OpenAI/index.d.ts +15 -0
  66. package/es/OpenAI/index.js +13 -0
  67. package/es/OpenAI/style.d.ts +5 -0
  68. package/es/OpenAI/style.js +5 -0
  69. package/es/Tongyi/components/Avatar.d.ts +5 -0
  70. package/es/Tongyi/components/Avatar.js +19 -0
  71. package/es/Tongyi/components/Color.d.ts +3 -0
  72. package/es/Tongyi/components/Color.js +53 -0
  73. package/es/Tongyi/components/Combine.d.ts +7 -0
  74. package/es/Tongyi/components/Combine.js +29 -0
  75. package/es/Tongyi/components/Mono.d.ts +3 -0
  76. package/es/Tongyi/components/Mono.js +31 -0
  77. package/es/Tongyi/components/Text.d.ts +3 -0
  78. package/es/Tongyi/components/Text.js +31 -0
  79. package/es/Tongyi/index.d.ts +16 -0
  80. package/es/Tongyi/index.js +14 -0
  81. package/es/Tongyi/style.d.ts +4 -0
  82. package/es/Tongyi/style.js +4 -0
  83. package/es/Wenxin/components/Avatar.d.ts +5 -0
  84. package/es/Wenxin/components/Avatar.js +19 -0
  85. package/es/Wenxin/components/Color.d.ts +3 -0
  86. package/es/Wenxin/components/Color.js +57 -0
  87. package/es/Wenxin/components/Combine.d.ts +7 -0
  88. package/es/Wenxin/components/Combine.js +25 -0
  89. package/es/Wenxin/components/Mono.d.ts +3 -0
  90. package/es/Wenxin/components/Mono.js +31 -0
  91. package/es/Wenxin/components/Text.d.ts +3 -0
  92. package/es/Wenxin/components/Text.js +31 -0
  93. package/es/Wenxin/index.d.ts +16 -0
  94. package/es/Wenxin/index.js +14 -0
  95. package/es/Wenxin/style.d.ts +4 -0
  96. package/es/Wenxin/style.js +4 -0
  97. package/es/Zhipu/components/Avatar.d.ts +2 -1
  98. package/es/Zhipu/components/Avatar.js +6 -15
  99. package/es/Zhipu/components/Combine.d.ts +2 -3
  100. package/es/Zhipu/components/Combine.js +9 -18
  101. package/es/Zhipu/components/Text.js +2 -1
  102. package/es/Zhipu/index.d.ts +15 -6
  103. package/es/Zhipu/index.js +13 -6
  104. package/es/components/ColorPreview/index.js +40 -0
  105. package/es/{Editor/Preview.d.ts → components/Editor/Color.d.ts} +1 -2
  106. package/es/components/Editor/Color.js +47 -0
  107. package/es/components/Editor/Mono.d.ts +8 -0
  108. package/es/components/Editor/Mono.js +47 -0
  109. package/es/components/Editor/Preview.d.ts +8 -0
  110. package/es/components/Editor/Preview.js +57 -0
  111. package/es/components/Editor/index.js +122 -0
  112. package/es/components/Editor/useSvgo.d.ts +6 -0
  113. package/es/components/Editor/useSvgo.js +51 -0
  114. package/es/components/IconPreview/ColorPreview.d.ts +6 -0
  115. package/es/{IconPreview → components/IconPreview}/ColorPreview.js +1 -2
  116. package/es/hooks/useFillId.d.ts +4 -0
  117. package/es/hooks/useFillId.js +7 -0
  118. package/es/index.d.ts +11 -4
  119. package/es/index.js +10 -5
  120. package/package.json +7 -9
  121. package/es/Editor/Preview.js +0 -93
  122. package/es/Editor/index.js +0 -67
  123. package/es/IconShowcase/index.d.ts +0 -11
  124. package/es/IconShowcase/index.js +0 -91
  125. /package/es/{IconPreview/ColorPreview.d.ts → components/ColorPreview/index.d.ts} +0 -0
  126. /package/es/{Editor → components/Editor}/data.d.ts +0 -0
  127. /package/es/{Editor → components/Editor}/data.js +0 -0
  128. /package/es/{Editor → components/Editor}/index.d.ts +0 -0
  129. /package/es/{Editor → components/Editor}/svgo.d.ts +0 -0
  130. /package/es/{Editor → components/Editor}/svgo.js +0 -0
  131. /package/es/{IconPreview → components/IconPreview}/index.d.ts +0 -0
  132. /package/es/{IconPreview → components/IconPreview}/index.js +0 -0
@@ -1,93 +0,0 @@
1
- import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
2
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
- import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
4
- var _templateObject;
5
- import _regeneratorRuntime from "@babel/runtime/regenerator";
6
- import { Highlighter, Tag } from '@lobehub/ui';
7
- import { createStyles } from 'antd-style';
8
- import { memo, useCallback, useEffect, useState } from 'react';
9
- import { Flexbox } from 'react-layout-kit';
10
- import { IconPreview } from "./..";
11
- import SvgoClient from "./svgo";
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- import { jsxs as _jsxs } from "react/jsx-runtime";
14
- var useStyles = createStyles(function (_ref) {
15
- var css = _ref.css;
16
- return {
17
- code: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: 96px;\n\n pre {\n padding: 8px !important;\n }\n\n code {\n font-size: 12px;\n text-wrap: initial;\n }\n "])))
18
- };
19
- });
20
- var Preview = /*#__PURE__*/memo(function (_ref2) {
21
- var svg = _ref2.svg,
22
- config = _ref2.config,
23
- title = _ref2.title;
24
- var _useState = useState(),
25
- _useState2 = _slicedToArray(_useState, 2),
26
- newSvgIcon = _useState2[0],
27
- setNewSvgIcon = _useState2[1];
28
- var _useStyles = useStyles(),
29
- styles = _useStyles.styles;
30
- var newSvg = useCallback( /*#__PURE__*/function () {
31
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(svgoInstance) {
32
- var data;
33
- return _regeneratorRuntime.wrap(function _callee$(_context) {
34
- while (1) switch (_context.prev = _context.next) {
35
- case 0:
36
- _context.next = 2;
37
- return svgoInstance.optimize(svg);
38
- case 2:
39
- data = _context.sent;
40
- setNewSvgIcon(data);
41
- case 4:
42
- case "end":
43
- return _context.stop();
44
- }
45
- }, _callee);
46
- }));
47
- return function (_x) {
48
- return _ref3.apply(this, arguments);
49
- };
50
- }(), [svg]);
51
- useEffect(function () {
52
- if (config) {
53
- var svgoInstance = new SvgoClient(config);
54
- newSvg(svgoInstance);
55
- } else {
56
- setNewSvgIcon(svg);
57
- }
58
- }, [config, svg]);
59
- return /*#__PURE__*/_jsxs(Flexbox, {
60
- flex: 1,
61
- gap: 16,
62
- style: {
63
- position: 'relative',
64
- width: '100%'
65
- },
66
- children: [/*#__PURE__*/_jsxs(Flexbox, {
67
- align: 'center',
68
- gap: 8,
69
- horizontal: true,
70
- children: [/*#__PURE__*/_jsx("h2", {
71
- style: {
72
- lineHeight: 1,
73
- margin: 0
74
- },
75
- children: title
76
- }), config && newSvgIcon && /*#__PURE__*/_jsxs(Tag, {
77
- children: [-Math.floor((1 - newSvgIcon.length / svg.length) * 100), "%"]
78
- })]
79
- }), /*#__PURE__*/_jsxs(Flexbox, {
80
- gap: 8,
81
- horizontal: true,
82
- children: [/*#__PURE__*/_jsx(IconPreview, {
83
- children: newSvgIcon
84
- }), /*#__PURE__*/_jsx(Highlighter, {
85
- className: styles.code,
86
- language: 'html',
87
- type: 'ghost',
88
- children: newSvgIcon || ''
89
- })]
90
- })]
91
- });
92
- });
93
- export default Preview;
@@ -1,67 +0,0 @@
1
- import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
- 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; }
3
- 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; }
4
- import { StoryBook, useControls, useCreateStore } from '@lobehub/ui';
5
- import { Flexbox } from 'react-layout-kit';
6
- import Preview from "./Preview";
7
- import { svgIcon } from "./data";
8
- import { defaultPlugins } from "./svgo";
9
- import { jsx as _jsx } from "react/jsx-runtime";
10
- import { jsxs as _jsxs } from "react/jsx-runtime";
11
- export default (function () {
12
- var levaStore = useCreateStore();
13
- var _useControls = useControls({
14
- svg: {
15
- rows: true,
16
- value: svgIcon
17
- }
18
- }, {
19
- store: levaStore
20
- }),
21
- svg = _useControls.svg;
22
- var config = useControls('Config', defaultPlugins, {
23
- collapsed: true
24
- }, {
25
- store: levaStore
26
- });
27
- var removeColor = {
28
- addAttributesToSVGElement: {
29
- attribute: {
30
- 'fill': 'currentColor',
31
- 'fill-rule': 'evenodd'
32
- }
33
- },
34
- collapseGroups: true,
35
- removeAttrs: {
36
- attrs: ['fill', 'color', 'stroke', 'stroke-width', 'fill-rule']
37
- }
38
- };
39
- return /*#__PURE__*/_jsx(StoryBook, {
40
- levaStore: levaStore,
41
- style: {
42
- position: 'relative'
43
- },
44
- children: /*#__PURE__*/_jsxs(Flexbox, {
45
- gap: 32,
46
- style: {
47
- flexWrap: 'wrap',
48
- height: '100%',
49
- overflow: 'hidden',
50
- position: 'relative',
51
- width: '100%'
52
- },
53
- children: [/*#__PURE__*/_jsx(Preview, {
54
- svg: svg,
55
- title: 'Original'
56
- }), /*#__PURE__*/_jsx(Preview, {
57
- config: config,
58
- svg: svg,
59
- title: 'Compression'
60
- }), /*#__PURE__*/_jsx(Preview, {
61
- config: _objectSpread(_objectSpread({}, config), removeColor),
62
- svg: svg,
63
- title: 'Monochrome'
64
- })]
65
- })
66
- });
67
- });
@@ -1,11 +0,0 @@
1
- import { ReactNode } from 'react';
2
- interface IconShowcaseProps {
3
- avatar: ReactNode;
4
- color: ReactNode;
5
- combine?: ReactNode;
6
- mono: ReactNode;
7
- primaryColor: string;
8
- text?: ReactNode;
9
- }
10
- declare const IconShowcase: import("react").NamedExoticComponent<IconShowcaseProps>;
11
- export default IconShowcase;
@@ -1,91 +0,0 @@
1
- import { memo } from 'react';
2
- import { Flexbox } from 'react-layout-kit';
3
- import IconPreview from "../IconPreview";
4
- import ColorPreview from "../IconPreview/ColorPreview";
5
- import { jsx as _jsx } from "react/jsx-runtime";
6
- import { jsxs as _jsxs } from "react/jsx-runtime";
7
- var IconShowcase = /*#__PURE__*/memo(function (_ref) {
8
- var color = _ref.color,
9
- mono = _ref.mono,
10
- combine = _ref.combine,
11
- text = _ref.text,
12
- primaryColor = _ref.primaryColor,
13
- avatar = _ref.avatar;
14
- return /*#__PURE__*/_jsxs(Flexbox, {
15
- gap: 32,
16
- style: {
17
- flexWrap: 'wrap'
18
- },
19
- children: [/*#__PURE__*/_jsxs(Flexbox, {
20
- align: 'flex-start',
21
- gap: 16,
22
- children: [/*#__PURE__*/_jsx("h2", {
23
- style: {
24
- lineHeight: 1,
25
- margin: 0
26
- },
27
- children: "Icons"
28
- }), /*#__PURE__*/_jsxs(Flexbox, {
29
- gap: 16,
30
- horizontal: true,
31
- style: {
32
- flexWrap: 'wrap'
33
- },
34
- children: [/*#__PURE__*/_jsx(IconPreview, {
35
- children: color
36
- }), /*#__PURE__*/_jsx(IconPreview, {
37
- children: mono
38
- }), avatar]
39
- })]
40
- }), text && /*#__PURE__*/_jsxs(Flexbox, {
41
- align: 'flex-start',
42
- gap: 16,
43
- children: [/*#__PURE__*/_jsx("h2", {
44
- style: {
45
- lineHeight: 1,
46
- margin: 0
47
- },
48
- children: "Texts"
49
- }), /*#__PURE__*/_jsx(IconPreview, {
50
- children: text
51
- })]
52
- }), combine && /*#__PURE__*/_jsxs(Flexbox, {
53
- align: 'flex-start',
54
- gap: 16,
55
- children: [/*#__PURE__*/_jsx("h2", {
56
- style: {
57
- lineHeight: 1,
58
- margin: 0
59
- },
60
- children: "Combines"
61
- }), /*#__PURE__*/_jsx(Flexbox, {
62
- gap: 16,
63
- horizontal: true,
64
- style: {
65
- flexWrap: 'wrap'
66
- },
67
- children: combine
68
- })]
69
- }), /*#__PURE__*/_jsxs(Flexbox, {
70
- align: 'flex-start',
71
- gap: 16,
72
- children: [/*#__PURE__*/_jsx("h2", {
73
- style: {
74
- lineHeight: 1,
75
- margin: 0
76
- },
77
- children: "Colors"
78
- }), /*#__PURE__*/_jsx(Flexbox, {
79
- gap: 16,
80
- horizontal: true,
81
- style: {
82
- flexWrap: 'wrap'
83
- },
84
- children: /*#__PURE__*/_jsx(ColorPreview, {
85
- color: primaryColor
86
- })
87
- })]
88
- })]
89
- });
90
- });
91
- export default IconShowcase;
File without changes
File without changes
File without changes
File without changes
File without changes