@lobehub/ui 1.12.0 → 1.13.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.
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  export interface IScaleRow {
3
+ name: string;
3
4
  title: 'light' | 'lightA' | 'dark' | 'darkA';
4
5
  scale: string[];
5
6
  }
@@ -5,23 +5,27 @@ import { alphaBg, useStyles } from "./style";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  import { jsxs as _jsxs } from "react/jsx-runtime";
7
7
  var ScaleRow = /*#__PURE__*/memo(function (_ref) {
8
- var title = _ref.title,
8
+ var name = _ref.name,
9
+ title = _ref.title,
9
10
  scale = _ref.scale;
10
11
  var _useStyles = useStyles(),
11
12
  styles = _useStyles.styles;
12
13
  var style = {};
14
+ var isAlpha = false;
13
15
  switch (title) {
14
16
  case 'lightA':
15
17
  style = {
16
18
  backgroundColor: '#fff',
17
19
  background: alphaBg.light
18
20
  };
21
+ isAlpha = true;
19
22
  break;
20
23
  case 'darkA':
21
24
  style = {
22
25
  backgroundColor: '#000',
23
26
  background: alphaBg.dark
24
27
  };
28
+ isAlpha = true;
25
29
  break;
26
30
  default:
27
31
  break;
@@ -40,8 +44,9 @@ var ScaleRow = /*#__PURE__*/memo(function (_ref) {
40
44
  title: color,
41
45
  style: style,
42
46
  onClick: function onClick() {
43
- copy(color);
44
- message.success(color);
47
+ var content = "token.".concat(name).concat(index + 1).concat(isAlpha ? 'A' : '', " /* ").concat(color, " */");
48
+ copy(content);
49
+ message.success(content);
45
50
  },
46
51
  children: /*#__PURE__*/_jsx("div", {
47
52
  className: styles.scaleItem,
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { ColorScaleItem } from "../styles/colors";
3
3
  export interface ColorScalesProps {
4
+ name: string;
4
5
  scale: ColorScaleItem;
5
6
  midHighLight: number;
6
7
  }
@@ -5,7 +5,8 @@ import { useStyles } from "./style";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  import { jsxs as _jsxs } from "react/jsx-runtime";
7
7
  var ColorScales = /*#__PURE__*/memo(function (_ref) {
8
- var scale = _ref.scale,
8
+ var name = _ref.name,
9
+ scale = _ref.scale,
9
10
  midHighLight = _ref.midHighLight;
10
11
  var _useStyles = useStyles(),
11
12
  styles = _useStyles.styles;
@@ -40,15 +41,19 @@ var ColorScales = /*#__PURE__*/memo(function (_ref) {
40
41
  }, 'num' + index);
41
42
  })]
42
43
  }, "scale-title"), /*#__PURE__*/_jsx(ScaleRow, {
44
+ name: name,
43
45
  title: "light",
44
46
  scale: scale.light
45
47
  }, "light"), /*#__PURE__*/_jsx(ScaleRow, {
48
+ name: name,
46
49
  title: "lightA",
47
50
  scale: scale.lightA
48
51
  }, "lightA"), /*#__PURE__*/_jsx(ScaleRow, {
52
+ name: name,
49
53
  title: "dark",
50
54
  scale: scale.dark
51
55
  }, "dark"), /*#__PURE__*/_jsx(ScaleRow, {
56
+ name: name,
52
57
  title: "darkA",
53
58
  scale: scale.darkA
54
59
  }, "darkA")]
@@ -4,7 +4,6 @@ import { Loading3QuartersOutlined as Loading } from '@ant-design/icons';
4
4
  import { memo, useEffect } from 'react';
5
5
  import { Center } from 'react-layout-kit';
6
6
  import { shallow } from 'zustand/shallow';
7
- import { Prism } from "./Prism";
8
7
  import { useThemeMode } from 'antd-style';
9
8
  import { useStyles } from "./style";
10
9
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -12,14 +11,12 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
12
11
  import { Fragment as _Fragment } from "react/jsx-runtime";
13
12
  var SyntaxHighlighter = /*#__PURE__*/memo(function (_ref) {
14
13
  var children = _ref.children,
15
- language = _ref.language,
16
- appearance = _ref.theme;
14
+ language = _ref.language;
17
15
  var _useStyles = useStyles(),
18
16
  styles = _useStyles.styles,
19
17
  theme = _useStyles.theme;
20
18
  var _useThemeMode = useThemeMode(),
21
19
  isDarkMode = _useThemeMode.isDarkMode;
22
- var isDarkTheme = appearance ? appearance === 'dark' : isDarkMode;
23
20
  var _useHighlight = useHighlight(function (s) {
24
21
  return [s.codeToHtml, !s.highlighter];
25
22
  }, shallow),
@@ -32,10 +29,10 @@ var SyntaxHighlighter = /*#__PURE__*/memo(function (_ref) {
32
29
  return /*#__PURE__*/_jsxs(_Fragment, {
33
30
  children: [isLoading ? /*#__PURE__*/_jsx("div", {
34
31
  className: styles.prism,
35
- children: /*#__PURE__*/_jsx(Prism, {
36
- language: language,
37
- isDarkMode: isDarkTheme,
38
- children: children
32
+ children: /*#__PURE__*/_jsx("pre", {
33
+ children: /*#__PURE__*/_jsx("code", {
34
+ children: children
35
+ })
39
36
  })
40
37
  }) : /*#__PURE__*/_jsx("div", {
41
38
  dangerouslySetInnerHTML: {