@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.
- package/es/Anthropic/components/Avatar.d.ts +5 -0
- package/es/Anthropic/components/Avatar.js +20 -0
- package/es/Anthropic/components/Mono.d.ts +3 -0
- package/es/Anthropic/components/Mono.js +31 -0
- package/es/Anthropic/components/Text.d.ts +3 -0
- package/es/Anthropic/components/Text.js +31 -0
- package/es/Anthropic/index.d.ts +11 -0
- package/es/Anthropic/index.js +9 -0
- package/es/Anthropic/style.d.ts +3 -0
- package/es/Anthropic/style.js +3 -0
- package/es/ChatGLM/components/Avatar.d.ts +5 -0
- package/es/ChatGLM/components/Avatar.js +26 -0
- package/es/ChatGLM/components/Color.d.ts +3 -0
- package/es/ChatGLM/components/Color.js +51 -0
- package/es/ChatGLM/components/Combine.d.ts +7 -0
- package/es/ChatGLM/components/Combine.js +25 -0
- package/es/ChatGLM/components/Mono.d.ts +3 -0
- package/es/ChatGLM/components/Mono.js +31 -0
- package/es/ChatGLM/components/Text.d.ts +3 -0
- package/es/ChatGLM/components/Text.js +31 -0
- package/es/ChatGLM/index.d.ts +16 -0
- package/es/ChatGLM/index.js +14 -0
- package/es/ChatGLM/style.d.ts +4 -0
- package/es/ChatGLM/style.js +4 -0
- package/es/Dalle/components/Combine.d.ts +5 -0
- package/es/Dalle/components/Combine.js +29 -0
- package/es/Dalle/components/Mono.d.ts +3 -0
- package/es/Dalle/components/Mono.js +31 -0
- package/es/Dalle/components/Text.d.ts +3 -0
- package/es/Dalle/components/Text.js +31 -0
- package/es/Dalle/index.d.ts +10 -0
- package/es/Dalle/index.js +9 -0
- package/es/Dalle/style.d.ts +3 -0
- package/es/Dalle/style.js +3 -0
- package/es/Gemini/components/Avatar.d.ts +5 -0
- package/es/Gemini/components/Avatar.js +20 -0
- package/es/Gemini/components/BrandColor.d.ts +3 -0
- package/es/Gemini/components/BrandColor.js +53 -0
- package/es/Gemini/components/BrandMono.d.ts +3 -0
- package/es/Gemini/components/BrandMono.js +31 -0
- package/es/Gemini/components/Color.d.ts +3 -0
- package/es/Gemini/components/Color.js +54 -0
- package/es/Gemini/components/Combine.d.ts +7 -0
- package/es/Gemini/components/Combine.js +25 -0
- package/es/Gemini/components/Mono.d.ts +3 -0
- package/es/Gemini/components/Mono.js +31 -0
- package/es/Gemini/components/Text.d.ts +3 -0
- package/es/Gemini/components/Text.js +31 -0
- package/es/Gemini/index.d.ts +20 -0
- package/es/Gemini/index.js +18 -0
- package/es/Gemini/style.d.ts +4 -0
- package/es/Gemini/style.js +4 -0
- package/es/IconAvatar/index.d.ts +15 -0
- package/es/IconAvatar/index.js +38 -0
- package/es/IconCombine/index.d.ts +17 -0
- package/es/IconCombine/index.js +49 -0
- package/es/OpenAI/components/Avatar.d.ts +7 -0
- package/es/OpenAI/components/Avatar.js +38 -0
- package/es/OpenAI/components/Combine.d.ts +5 -0
- package/es/OpenAI/components/Combine.js +25 -0
- package/es/OpenAI/components/Mono.d.ts +3 -0
- package/es/OpenAI/components/Mono.js +31 -0
- package/es/OpenAI/components/Text.d.ts +3 -0
- package/es/OpenAI/components/Text.js +31 -0
- package/es/OpenAI/index.d.ts +15 -0
- package/es/OpenAI/index.js +13 -0
- package/es/OpenAI/style.d.ts +5 -0
- package/es/OpenAI/style.js +5 -0
- package/es/Tongyi/components/Avatar.d.ts +5 -0
- package/es/Tongyi/components/Avatar.js +19 -0
- package/es/Tongyi/components/Color.d.ts +3 -0
- package/es/Tongyi/components/Color.js +53 -0
- package/es/Tongyi/components/Combine.d.ts +7 -0
- package/es/Tongyi/components/Combine.js +29 -0
- package/es/Tongyi/components/Mono.d.ts +3 -0
- package/es/Tongyi/components/Mono.js +31 -0
- package/es/Tongyi/components/Text.d.ts +3 -0
- package/es/Tongyi/components/Text.js +31 -0
- package/es/Tongyi/index.d.ts +16 -0
- package/es/Tongyi/index.js +14 -0
- package/es/Tongyi/style.d.ts +4 -0
- package/es/Tongyi/style.js +4 -0
- package/es/Wenxin/components/Avatar.d.ts +5 -0
- package/es/Wenxin/components/Avatar.js +19 -0
- package/es/Wenxin/components/Color.d.ts +3 -0
- package/es/Wenxin/components/Color.js +57 -0
- package/es/Wenxin/components/Combine.d.ts +7 -0
- package/es/Wenxin/components/Combine.js +25 -0
- package/es/Wenxin/components/Mono.d.ts +3 -0
- package/es/Wenxin/components/Mono.js +31 -0
- package/es/Wenxin/components/Text.d.ts +3 -0
- package/es/Wenxin/components/Text.js +31 -0
- package/es/Wenxin/index.d.ts +16 -0
- package/es/Wenxin/index.js +14 -0
- package/es/Wenxin/style.d.ts +4 -0
- package/es/Wenxin/style.js +4 -0
- package/es/Zhipu/components/Avatar.d.ts +2 -1
- package/es/Zhipu/components/Avatar.js +6 -15
- package/es/Zhipu/components/Combine.d.ts +2 -3
- package/es/Zhipu/components/Combine.js +9 -18
- package/es/Zhipu/components/Text.js +2 -1
- package/es/Zhipu/index.d.ts +15 -6
- package/es/Zhipu/index.js +13 -6
- package/es/components/ColorPreview/index.js +40 -0
- package/es/{Editor/Preview.d.ts → components/Editor/Color.d.ts} +1 -2
- package/es/components/Editor/Color.js +47 -0
- package/es/components/Editor/Mono.d.ts +8 -0
- package/es/components/Editor/Mono.js +47 -0
- package/es/components/Editor/Preview.d.ts +8 -0
- package/es/components/Editor/Preview.js +57 -0
- package/es/components/Editor/index.js +122 -0
- package/es/components/Editor/useSvgo.d.ts +6 -0
- package/es/components/Editor/useSvgo.js +51 -0
- package/es/components/IconPreview/ColorPreview.d.ts +6 -0
- package/es/{IconPreview → components/IconPreview}/ColorPreview.js +1 -2
- package/es/hooks/useFillId.d.ts +4 -0
- package/es/hooks/useFillId.js +7 -0
- package/es/index.d.ts +11 -4
- package/es/index.js +10 -5
- package/package.json +7 -9
- package/es/Editor/Preview.js +0 -93
- package/es/Editor/index.js +0 -67
- package/es/IconShowcase/index.d.ts +0 -11
- package/es/IconShowcase/index.js +0 -91
- /package/es/{IconPreview/ColorPreview.d.ts → components/ColorPreview/index.d.ts} +0 -0
- /package/es/{Editor → components/Editor}/data.d.ts +0 -0
- /package/es/{Editor → components/Editor}/data.js +0 -0
- /package/es/{Editor → components/Editor}/index.d.ts +0 -0
- /package/es/{Editor → components/Editor}/svgo.d.ts +0 -0
- /package/es/{Editor → components/Editor}/svgo.js +0 -0
- /package/es/{IconPreview → components/IconPreview}/index.d.ts +0 -0
- /package/es/{IconPreview → components/IconPreview}/index.js +0 -0
package/es/Editor/Preview.js
DELETED
|
@@ -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;
|
package/es/Editor/index.js
DELETED
|
@@ -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;
|
package/es/IconShowcase/index.js
DELETED
|
@@ -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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|