@lobehub/ui 1.14.2 → 1.16.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/Avatar/index.d.ts +17 -0
- package/es/Avatar/index.js +9 -19
- package/es/Avatar/style.d.ts +4 -0
- package/es/Avatar/style.js +11 -0
- package/es/ContextMenu/index.d.ts +9 -0
- package/es/Conversation/App.d.ts +4 -2
- package/es/Conversation/index.d.ts +4 -0
- package/es/DraggablePanel/style.js +1 -1
- package/es/EditableMessage/index.d.ts +19 -10
- package/es/EditableMessageList/index.d.ts +11 -0
- package/es/Icon/index.js +8 -4
- package/es/MessageModal/index.d.ts +20 -0
- package/es/MessageModal/index.js +10 -20
- package/es/MessageModal/style.d.ts +4 -0
- package/es/MessageModal/style.js +11 -0
- package/es/SearchBar/index.d.ts +8 -0
- package/es/StroyBook/index.js +10 -7
- package/es/StroyBook/style.d.ts +1 -0
- package/es/StroyBook/style.js +3 -2
- package/es/Swatches/index.d.ts +11 -0
- package/es/styles/algorithms/generateColorPalette.js +4 -4
- package/es/styles/algorithms/generateCustomStylish.js +1 -1
- package/es/styles/algorithms/generateCustomToken.js +3 -2
- package/es/styles/colors.js +2 -2
- package/package.json +1 -1
package/es/Avatar/index.d.ts
CHANGED
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
export interface AvatarProps {
|
|
3
|
+
/**
|
|
4
|
+
* @description The URL or base64 data of the avatar image
|
|
5
|
+
*/
|
|
3
6
|
avatar?: string;
|
|
7
|
+
/**
|
|
8
|
+
* @description The title text to display if avatar is not provided
|
|
9
|
+
*/
|
|
4
10
|
title?: string;
|
|
11
|
+
/**
|
|
12
|
+
* @description The size of the avatar in pixels
|
|
13
|
+
* @default 40
|
|
14
|
+
*/
|
|
5
15
|
size?: number;
|
|
16
|
+
/**
|
|
17
|
+
* @description The shape of the avatar
|
|
18
|
+
* @default 'circle'
|
|
19
|
+
*/
|
|
6
20
|
shape?: 'circle' | 'square';
|
|
21
|
+
/**
|
|
22
|
+
* @description The background color of the avatar
|
|
23
|
+
*/
|
|
7
24
|
background?: string;
|
|
8
25
|
}
|
|
9
26
|
declare const Avatar: FC<AvatarProps>;
|
package/es/Avatar/index.js
CHANGED
|
@@ -1,25 +1,15 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2;
|
|
3
1
|
import { Avatar as A } from 'antd';
|
|
4
|
-
import { createStyles } from 'antd-style';
|
|
5
2
|
import { Center } from 'react-layout-kit';
|
|
3
|
+
import { useStyles } from "./style";
|
|
6
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var Avatar = function Avatar(_ref2) {
|
|
16
|
-
var avatar = _ref2.avatar,
|
|
17
|
-
title = _ref2.title,
|
|
18
|
-
_ref2$size = _ref2.size,
|
|
19
|
-
size = _ref2$size === void 0 ? 40 : _ref2$size,
|
|
20
|
-
_ref2$shape = _ref2.shape,
|
|
21
|
-
shape = _ref2$shape === void 0 ? 'circle' : _ref2$shape,
|
|
22
|
-
background = _ref2.background;
|
|
5
|
+
var Avatar = function Avatar(_ref) {
|
|
6
|
+
var avatar = _ref.avatar,
|
|
7
|
+
title = _ref.title,
|
|
8
|
+
_ref$size = _ref.size,
|
|
9
|
+
size = _ref$size === void 0 ? 40 : _ref$size,
|
|
10
|
+
_ref$shape = _ref.shape,
|
|
11
|
+
shape = _ref$shape === void 0 ? 'circle' : _ref$shape,
|
|
12
|
+
background = _ref.background;
|
|
23
13
|
var _useStyles = useStyles(),
|
|
24
14
|
styles = _useStyles.styles,
|
|
25
15
|
theme = _useStyles.theme;
|
|
@@ -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) {
|
|
5
|
+
var css = _ref.css,
|
|
6
|
+
token = _ref.token;
|
|
7
|
+
return {
|
|
8
|
+
container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n\n > * {\n cursor: pointer;\n }\n "]))),
|
|
9
|
+
border: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n border: 1px solid ", ";\n "])), token.colorBorder)
|
|
10
|
+
};
|
|
11
|
+
});
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import { HTMLProps } from 'react';
|
|
2
2
|
import { MenuItemType } from './types';
|
|
3
3
|
export interface ContextMenuProps {
|
|
4
|
+
/**
|
|
5
|
+
* @description Label for the context menu
|
|
6
|
+
*/
|
|
4
7
|
label?: string;
|
|
8
|
+
/**
|
|
9
|
+
* @description Items to be displayed in the context menu
|
|
10
|
+
*/
|
|
5
11
|
items: MenuItemType[];
|
|
12
|
+
/**
|
|
13
|
+
* @description Container element for the context menu
|
|
14
|
+
*/
|
|
6
15
|
container?: HTMLElement;
|
|
7
16
|
}
|
|
8
17
|
declare const ContextMenu: import("react").ForwardRefExoticComponent<Omit<ContextMenuProps & HTMLProps<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
package/es/Conversation/App.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface AppProps {
|
|
3
3
|
/**
|
|
4
|
-
* @
|
|
4
|
+
* @description Whether the component is in readonly mode.
|
|
5
|
+
* @default false
|
|
5
6
|
*/
|
|
6
7
|
readonly?: boolean;
|
|
7
8
|
/**
|
|
8
|
-
* @
|
|
9
|
+
* @description Whether to include system messages in the chat.
|
|
10
|
+
* @default true
|
|
9
11
|
*/
|
|
10
12
|
includeSystem?: boolean;
|
|
11
13
|
}
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
import { AppProps } from './App';
|
|
3
3
|
import { StoreUpdaterProps } from './StoreUpdater';
|
|
4
4
|
export interface ConversationProps extends StoreUpdaterProps, AppProps {
|
|
5
|
+
/**
|
|
6
|
+
* @description Whether to enable devtools or not
|
|
7
|
+
* @default false
|
|
8
|
+
*/
|
|
5
9
|
devtools?: boolean;
|
|
6
10
|
}
|
|
7
11
|
declare const Conversation: import("react").NamedExoticComponent<ConversationProps>;
|
|
@@ -6,7 +6,7 @@ var toggleLength = 40;
|
|
|
6
6
|
var toggleShort = 16;
|
|
7
7
|
export var useStyle = createStyles(function (_ref, prefix) {
|
|
8
8
|
var token = _ref.token;
|
|
9
|
-
var commonHandle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n &::before {\n content: '';\n position: absolute;\n z-index: 50;\n transition: all 0.2s ", ";\n }\n\n &:hover,\n &:active {\n &::before {\n background: ", ";\n }\n }\n "])), token.motionEaseOut, token.colorPrimary);
|
|
9
|
+
var commonHandle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n &::before {\n content: '';\n position: absolute;\n z-index: 50;\n transition: all 0.2s ", ";\n }\n\n &:hover,\n &:active {\n &::before {\n background: ", " !important;\n }\n }\n "])), token.motionEaseOut, token.colorPrimary);
|
|
10
10
|
var commonToggle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 1001;\n opacity: 0;\n transition: all 0.2s ", ";\n\n &:hover {\n opacity: 1 !important;\n }\n\n &:active {\n opacity: 1 !important;\n }\n\n > div {\n cursor: pointer;\n\n position: absolute;\n\n color: ", ";\n\n background: ", ";\n border-color: ", ";\n border-style: solid;\n border-width: 1px;\n border-radius: 4px;\n\n transition: all 0.2s ", ";\n\n &:hover {\n color: ", ";\n background: ", ";\n }\n\n &:active {\n color: ", ";\n background: ", ";\n }\n }\n "])), token.motionEaseOut, token.colorTextTertiary, token.colorFillTertiary, token.colorBorderSecondary, token.motionEaseOut, token.colorTextSecondary, token.colorFillSecondary, token.colorText, token.colorFill);
|
|
11
11
|
var float = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 2000;\n "])));
|
|
12
12
|
return {
|
|
@@ -1,41 +1,50 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface EditableMessageProps {
|
|
3
3
|
/**
|
|
4
|
-
* @title
|
|
4
|
+
* @title The current text value
|
|
5
5
|
*/
|
|
6
6
|
value: string;
|
|
7
7
|
/**
|
|
8
|
-
* @title
|
|
9
|
-
* @param value -
|
|
8
|
+
* @title Callback function when the value changes
|
|
9
|
+
* @param value - The new value
|
|
10
10
|
*/
|
|
11
11
|
onChange?: (value: string) => void;
|
|
12
12
|
/**
|
|
13
|
-
* @title
|
|
13
|
+
* @title Whether the modal is open or not
|
|
14
14
|
* @default false
|
|
15
15
|
*/
|
|
16
16
|
openModal?: boolean;
|
|
17
17
|
/**
|
|
18
|
-
* @title
|
|
19
|
-
* @param open -
|
|
18
|
+
* @title Callback function when the modal open state changes
|
|
19
|
+
* @param open - Whether the modal is open or not
|
|
20
20
|
*/
|
|
21
21
|
onOpenChange?: (open: boolean) => void;
|
|
22
22
|
/**
|
|
23
|
-
* @title
|
|
23
|
+
* @title Whether the component is in edit mode or not
|
|
24
24
|
* @default false
|
|
25
25
|
*/
|
|
26
26
|
editing?: boolean;
|
|
27
27
|
/**
|
|
28
|
-
* @title
|
|
29
|
-
* @param editing -
|
|
28
|
+
* @title Callback function when the editing state changes
|
|
29
|
+
* @param editing - Whether the component is in edit mode or not
|
|
30
30
|
*/
|
|
31
31
|
onEditingChange?: (editing: boolean) => void;
|
|
32
32
|
/**
|
|
33
|
-
* @title
|
|
33
|
+
* @title Whether to show the edit button when the text value is empty
|
|
34
34
|
* @default false
|
|
35
35
|
*/
|
|
36
36
|
showEditWhenEmpty?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* @title The class name for the Markdown and MessageInput component
|
|
39
|
+
*/
|
|
37
40
|
classNames?: {
|
|
41
|
+
/**
|
|
42
|
+
* @title The class name for the Markdown component
|
|
43
|
+
*/
|
|
38
44
|
markdown?: string;
|
|
45
|
+
/**
|
|
46
|
+
* @title The class name for the MessageInput component
|
|
47
|
+
*/
|
|
39
48
|
input?: string;
|
|
40
49
|
};
|
|
41
50
|
}
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ChatMessage } from "../Chat";
|
|
3
3
|
export interface EditableMessageListProps {
|
|
4
|
+
/**
|
|
5
|
+
* @description The data sources to be rendered
|
|
6
|
+
*/
|
|
4
7
|
dataSources: ChatMessage[];
|
|
8
|
+
/**
|
|
9
|
+
* @description Callback function triggered when the data sources are changed
|
|
10
|
+
* @param chatMessages - the updated data sources
|
|
11
|
+
*/
|
|
5
12
|
onChange?: (chatMessages: ChatMessage[]) => void;
|
|
13
|
+
/**
|
|
14
|
+
* @description Whether the component is disabled or not
|
|
15
|
+
* @default false
|
|
16
|
+
*/
|
|
6
17
|
disabled?: boolean;
|
|
7
18
|
}
|
|
8
19
|
export declare const EditableMessageList: import("react").NamedExoticComponent<EditableMessageListProps>;
|
package/es/Icon/index.js
CHANGED
|
@@ -5,8 +5,7 @@ import { memo } from 'react';
|
|
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
6
|
var Icon = function Icon(_ref) {
|
|
7
7
|
var icon = _ref.icon,
|
|
8
|
-
|
|
9
|
-
size = _ref$size === void 0 ? 'normal' : _ref$size,
|
|
8
|
+
size = _ref.size,
|
|
10
9
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
11
10
|
var fontSize;
|
|
12
11
|
var strokeWidth;
|
|
@@ -25,8 +24,13 @@ var Icon = function Icon(_ref) {
|
|
|
25
24
|
strokeWidth = 1.5;
|
|
26
25
|
break;
|
|
27
26
|
default:
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
if (size) {
|
|
28
|
+
fontSize = (size === null || size === void 0 ? void 0 : size.fontSize) || 24;
|
|
29
|
+
strokeWidth = (size === null || size === void 0 ? void 0 : size.strokeWidth) || 2;
|
|
30
|
+
} else {
|
|
31
|
+
fontSize = '1em';
|
|
32
|
+
strokeWidth = 2;
|
|
33
|
+
}
|
|
30
34
|
break;
|
|
31
35
|
}
|
|
32
36
|
return /*#__PURE__*/_jsx(SvgIcon, _objectSpread({
|
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface MessageModalProps {
|
|
3
|
+
/**
|
|
4
|
+
* @description Whether the modal is open or not
|
|
5
|
+
* @default false
|
|
6
|
+
*/
|
|
3
7
|
open?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* @description Callback fired when open state is changed
|
|
10
|
+
*/
|
|
4
11
|
onOpenChange?: (open: boolean) => void;
|
|
12
|
+
/**
|
|
13
|
+
* @description Whether the message is being edited or not
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
5
16
|
editing?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* @description Callback fired when editing state is changed
|
|
19
|
+
*/
|
|
6
20
|
onEditingChange?: (editing: boolean) => void;
|
|
21
|
+
/**
|
|
22
|
+
* @description Callback fired when message content is changed
|
|
23
|
+
*/
|
|
7
24
|
onChange?: (text: string) => void;
|
|
25
|
+
/**
|
|
26
|
+
* @description The value of the message content
|
|
27
|
+
*/
|
|
8
28
|
value: string;
|
|
9
29
|
}
|
|
10
30
|
declare const MessageModal: import("react").NamedExoticComponent<MessageModalProps>;
|
package/es/MessageModal/index.js
CHANGED
|
@@ -1,31 +1,21 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import Markdown from "../Markdown";
|
|
3
|
+
import MessageInput from "../MessageInput";
|
|
4
4
|
import { AimOutlined } from '@ant-design/icons';
|
|
5
5
|
import { Modal } from 'antd';
|
|
6
|
-
import { createStyles } from 'antd-style';
|
|
7
6
|
import { memo } from 'react';
|
|
8
7
|
import { Flexbox } from 'react-layout-kit';
|
|
9
8
|
import useControlledState from 'use-merge-value';
|
|
10
|
-
import
|
|
11
|
-
import MessageInput from "../MessageInput";
|
|
9
|
+
import { useStyles } from "./style";
|
|
12
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
11
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
});
|
|
22
|
-
var MessageModal = /*#__PURE__*/memo(function (_ref2) {
|
|
23
|
-
var editing = _ref2.editing,
|
|
24
|
-
open = _ref2.open,
|
|
25
|
-
onOpenChange = _ref2.onOpenChange,
|
|
26
|
-
onEditingChange = _ref2.onEditingChange,
|
|
27
|
-
value = _ref2.value,
|
|
28
|
-
onChange = _ref2.onChange;
|
|
12
|
+
var MessageModal = /*#__PURE__*/memo(function (_ref) {
|
|
13
|
+
var editing = _ref.editing,
|
|
14
|
+
open = _ref.open,
|
|
15
|
+
onOpenChange = _ref.onOpenChange,
|
|
16
|
+
onEditingChange = _ref.onEditingChange,
|
|
17
|
+
value = _ref.value,
|
|
18
|
+
onChange = _ref.onChange;
|
|
29
19
|
var _useStyles = useStyles(),
|
|
30
20
|
styles = _useStyles.styles;
|
|
31
21
|
var _useControlledState = useControlledState(false, {
|
|
@@ -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) {
|
|
5
|
+
var css = _ref.css,
|
|
6
|
+
prefixCls = _ref.prefixCls;
|
|
7
|
+
return {
|
|
8
|
+
modal: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: 70%;\n .", "-modal-header {\n margin-bottom: 24px;\n }\n "])), prefixCls),
|
|
9
|
+
body: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n overflow-y: scroll;\n max-height: 70vh;\n "])))
|
|
10
|
+
};
|
|
11
|
+
});
|
package/es/SearchBar/index.d.ts
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { InputProps } from "../index";
|
|
3
3
|
export interface SearchBarProps extends InputProps {
|
|
4
|
+
/**
|
|
5
|
+
* @description The shortcut key to focus on the input. Only works if `enableShortKey` is true
|
|
6
|
+
* @default 'f'
|
|
7
|
+
*/
|
|
4
8
|
shortKey?: string;
|
|
9
|
+
/**
|
|
10
|
+
* @description Whether to enable the shortcut key to focus on the input
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
5
13
|
enableShortKey?: boolean;
|
|
6
14
|
}
|
|
7
15
|
declare const SearchBar: import("react").NamedExoticComponent<SearchBarProps>;
|
package/es/StroyBook/index.js
CHANGED
|
@@ -29,16 +29,19 @@ export var StroyBook = /*#__PURE__*/memo(function (_ref) {
|
|
|
29
29
|
children: [/*#__PURE__*/_jsx("div", {
|
|
30
30
|
className: styles.left,
|
|
31
31
|
children: children
|
|
32
|
-
}), /*#__PURE__*/
|
|
32
|
+
}), /*#__PURE__*/_jsx(DraggablePanel, {
|
|
33
33
|
className: styles.right,
|
|
34
34
|
placement: mobile ? 'bottom' : 'right',
|
|
35
35
|
minWidth: 280,
|
|
36
|
-
children:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
37
|
+
className: styles.leva,
|
|
38
|
+
children: [/*#__PURE__*/_jsx(LevaPanel, {
|
|
39
|
+
fill: true,
|
|
40
|
+
store: levaStore,
|
|
41
|
+
titleBar: false,
|
|
42
|
+
flat: true
|
|
43
|
+
}), ' ']
|
|
44
|
+
})
|
|
42
45
|
})]
|
|
43
46
|
}));
|
|
44
47
|
});
|
package/es/StroyBook/style.d.ts
CHANGED
package/es/StroyBook/style.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
2
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
3
3
|
import { createStyles } from 'antd-style';
|
|
4
4
|
export var useStyles = createStyles(function (_ref, _ref2) {
|
|
5
5
|
var css = _ref.css,
|
|
@@ -9,6 +9,7 @@ export var useStyles = createStyles(function (_ref, _ref2) {
|
|
|
9
9
|
return {
|
|
10
10
|
editor: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: stretch;\n justify-content: stretch;\n\n width: inherit;\n min-height: inherit;\n ", "\n "])), mobile && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex-direction: column;\n "])))),
|
|
11
11
|
left: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n overflow: auto;\n display: flex;\n flex: 1;\n align-items: center;\n justify-content: center;\n\n ", "\n "])), !noPadding && css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding: 40px 24px;\n "])))),
|
|
12
|
-
right: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n
|
|
12
|
+
right: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n background: ", ";\n "])), token.colorBgLayout),
|
|
13
|
+
leva: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n --leva-sizes-controlWidth: 66%;\n --leva-colors-elevation1: ", ";\n --leva-colors-elevation2: transparent;\n --leva-colors-elevation3: ", ";\n --leva-colors-accent1: ", ";\n --leva-colors-accent2: ", ";\n --leva-colors-accent3: ", ";\n --leva-colors-highlight1: ", ";\n --leva-colors-highlight2: ", ";\n --leva-colors-highlight3: ", ";\n --leva-colors-vivid1: ", ";\n --leva-shadows-level1: unset;\n --leva-shadows-level2: unset;\n --leva-fonts-mono: ", ";\n\n overflow: auto;\n width: 100%;\n height: 100%;\n padding: 6px 0;\n\n > div {\n background: transparent;\n > div {\n background: transparent;\n }\n }\n\n input:checked + label > svg {\n stroke: ", ";\n }\n\n button {\n --leva-colors-accent2: ", ";\n }\n "])), token.colorFillSecondary, token.colorFillSecondary, token.colorPrimary, token.colorPrimaryHover, token.colorPrimaryActive, token.colorTextTertiary, token.colorTextSecondary, token.colorText, token.colorWarning, token.fontFamilyCode, token.colorBgLayout, token.colorFillSecondary)
|
|
13
14
|
};
|
|
14
15
|
});
|
package/es/Swatches/index.d.ts
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface SwatchesProps {
|
|
3
|
+
/**
|
|
4
|
+
* @description An array of colors to be displayed as swatches
|
|
5
|
+
*/
|
|
3
6
|
colors: string[];
|
|
7
|
+
/**
|
|
8
|
+
* @description The currently active color
|
|
9
|
+
* @default undefined
|
|
10
|
+
*/
|
|
4
11
|
activeColor?: string;
|
|
12
|
+
/**
|
|
13
|
+
* @description A function to be called when a swatch is selected
|
|
14
|
+
* @default undefined
|
|
15
|
+
*/
|
|
5
16
|
onSelect?: (c: string | null) => void;
|
|
6
17
|
}
|
|
7
18
|
declare const Swatches: import("react").NamedExoticComponent<SwatchesProps>;
|
|
@@ -12,10 +12,10 @@ export var generateColorNeutralPalette = function generateColorNeutralPalette(_r
|
|
|
12
12
|
var scale = _ref3.scale,
|
|
13
13
|
appearance = _ref3.appearance;
|
|
14
14
|
return {
|
|
15
|
-
colorText: scale[
|
|
16
|
-
colorTextSecondary: scale[
|
|
17
|
-
colorTextTertiary: scale[
|
|
18
|
-
colorTextQuaternary: scale[
|
|
15
|
+
colorText: scale[appearance][12],
|
|
16
|
+
colorTextSecondary: scale[appearance][10],
|
|
17
|
+
colorTextTertiary: scale[appearance][8],
|
|
18
|
+
colorTextQuaternary: scale[appearance][6],
|
|
19
19
|
colorBorder: scale[appearance][4],
|
|
20
20
|
colorBorderSecondary: scale[appearance][3],
|
|
21
21
|
colorFill: scale["".concat(appearance, "A")][3],
|
|
@@ -14,6 +14,6 @@ export var generateCustomStylish = function generateCustomStylish(_ref) {
|
|
|
14
14
|
heroBlurBall: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n will-change: transform;\n\n background: linear-gradient(\n 135deg,\n ", " 0%,\n ", " 30%,\n ", " 70%,\n ", " 100%\n );\n background-size: 200% 200%;\n filter: blur(69px);\n\n animation: glow 10s ease infinite;\n\n @keyframes glow {\n 0% {\n background-position: 0 -100%;\n }\n\n 50% {\n background-position: 200% 50%;\n }\n\n 100% {\n background-position: 0 -100%;\n }\n }\n "])), token.gradientColor3, token.gradientColor1, token.red, token.cyan),
|
|
15
15
|
iconGradientDefault: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n background-image: radial-gradient(\n 100% 100% at 50% 0,\n ", " 0,\n ", " 100%\n );\n "])), rgba(token.colorSolid, 0.2), rgba(token.colorSolid, 0.1)),
|
|
16
16
|
blur: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n backdrop-filter: blur(7px);\n "]))),
|
|
17
|
-
markdown: css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n color: ", ";\n\n h1,\n h2,\n h3,\n h4,\n h5 {\n font-weight: 600;\n }\n\n p {\n margin: 20px auto;\n\n font-size: 14px;\n line-height: 1.8;\n color: ", ";\n text-align: justify;\n word-wrap: break-word;\n }\n\n blockquote {\n margin: 16px 0;\n padding: 0 12px;\n p {\n font-style: italic;\n color: ", ";\n }\n }\n\n p:not(:last-child) {\n margin-bottom: 1em;\n }\n\n a {\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n\n &:active {\n color: ", ";\n }\n }\n\n img {\n max-width: 100%;\n }\n\n
|
|
17
|
+
markdown: css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n color: ", ";\n\n h1,\n h2,\n h3,\n h4,\n h5 {\n font-weight: 600;\n }\n\n p {\n margin: 20px auto;\n\n font-size: 14px;\n line-height: 1.8;\n color: ", ";\n text-align: justify;\n word-wrap: break-word;\n }\n\n blockquote {\n margin: 16px 0;\n padding: 0 12px;\n p {\n font-style: italic;\n color: ", ";\n }\n }\n\n p:not(:last-child) {\n margin-bottom: 1em;\n }\n\n a {\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n\n &:active {\n color: ", ";\n }\n }\n\n img {\n max-width: 100%;\n }\n\n pre {\n border-radius: ", "px;\n }\n\n > :not([data-code-type='highlighter']) code {\n padding: 2px 6px;\n\n font-size: ", "px;\n color: ", ";\n\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n }\n\n table {\n border-spacing: 0;\n\n width: 100%;\n margin-block-start: 1em;\n margin-block-end: 1em;\n margin-inline-start: 0px;\n margin-inline-end: 0px;\n padding: 8px;\n\n border: 1px solid ", ";\n border-radius: ", "px;\n }\n\n th,\n td {\n padding-block-start: 10px;\n padding-block-end: 10px;\n padding-inline-start: 16px;\n padding-inline-end: 16px;\n }\n\n thead {\n tr {\n th {\n background: ", ";\n &:first-child {\n border-top-left-radius: ", "px;\n border-bottom-left-radius: ", "px;\n }\n &:last-child {\n border-top-right-radius: ", "px;\n border-bottom-right-radius: ", "px;\n }\n }\n }\n }\n\n ul li {\n line-height: 1.8;\n }\n "])), isDarkMode ? token.colorTextSecondary : token.colorText, token.colorText, token.colorTextDescription, token.colorLink, token.colorLinkHover, token.colorLinkActive, token.borderRadius, token.fontSizeSM, isDarkMode ? token.cyan9A : token.cyan10A, isDarkMode ? token.cyan1A : token.cyan3A, isDarkMode ? token.cyan1A : token.cyan4A, token.borderRadiusSM, token.colorBorderSecondary, token.borderRadius, token.colorFillTertiary, token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius)
|
|
18
18
|
};
|
|
19
19
|
};
|
|
@@ -32,7 +32,8 @@ var generateCustomColorPalette = function generateCustomColorPalette(_ref3) {
|
|
|
32
32
|
|
|
33
33
|
// @ts-ignore
|
|
34
34
|
export var generateCustomToken = function generateCustomToken(_ref4) {
|
|
35
|
-
var isDarkMode = _ref4.isDarkMode
|
|
35
|
+
var isDarkMode = _ref4.isDarkMode,
|
|
36
|
+
token = _ref4.token;
|
|
36
37
|
var colorCustomToken = {};
|
|
37
38
|
Object.entries(colorScales).forEach(function (_ref5) {
|
|
38
39
|
var _ref6 = _slicedToArray(_ref5, 2),
|
|
@@ -48,7 +49,7 @@ export var generateCustomToken = function generateCustomToken(_ref4) {
|
|
|
48
49
|
var gradientColor2 = isDarkMode ? colorScales.magenta.darkA[8] : colorScales.cyan.darkA[8];
|
|
49
50
|
var gradientColor3 = colorScales.purple.darkA[8];
|
|
50
51
|
var colorSolid = isDarkMode ? '#fff' : '#000';
|
|
51
|
-
return _objectSpread(_objectSpread({}, colorCustomToken), {}, {
|
|
52
|
+
return _objectSpread(_objectSpread(_objectSpread({}, token), colorCustomToken), {}, {
|
|
52
53
|
headerHeight: 64,
|
|
53
54
|
footerHeight: 300,
|
|
54
55
|
sidebarWidth: 240,
|
package/es/styles/colors.js
CHANGED
|
@@ -73,9 +73,9 @@ export var colorScales = {
|
|
|
73
73
|
},
|
|
74
74
|
gray: {
|
|
75
75
|
light: ['#ffffff', '#f8f8f8', '#eeeeee', '#e3e3e3', '#dddddd', '#cccccc', '#bbbbbb', '#aaaaaa', '#999999', '#888888', '#666666', '#333333', '#080808'],
|
|
76
|
-
lightA: ['rgba(0, 0, 0, 0.
|
|
76
|
+
lightA: ['rgba(0, 0, 0, 0.015)', 'rgba(0, 0, 0, 0.03)', 'rgba(0, 0, 0, 0.06)', 'rgba(0, 0, 0, 0.12)', 'rgba(0, 0, 0, 0.18)', 'rgba(0, 0, 0, 0.24)', 'rgba(0, 0, 0, 0.32)', 'rgba(0, 0, 0, 0.38)', 'rgba(0, 0, 0, 0.44)', 'rgba(0, 0, 0, 0.5)', 'rgba(0, 0, 0, 0.68)', 'rgba(0, 0, 0, 0.84)', 'rgba(0, 0, 0, 0.98)'],
|
|
77
77
|
dark: ['#000000', '#111111', '#222222', '#2d2d2d', '#333333', '#444444', '#555555', '#666666', '#6f6f6f', '#777777', '#aaaaaa', '#dddddd', '#ffffff'],
|
|
78
|
-
darkA: ['rgba(255, 255, 255, 0.02)', 'rgba(255, 255, 255, 0.
|
|
78
|
+
darkA: ['rgba(255, 255, 255, 0.02)', 'rgba(255, 255, 255, 0.04)', 'rgba(255, 255, 255, 0.08)', 'rgba(255, 255, 255, 0.16)', 'rgba(255, 255, 255, 0.24)', 'rgba(255, 255, 255, 0.28)', 'rgba(255, 255, 255, 0.32)', 'rgba(255, 255, 255, 0.38)', 'rgba(255, 255, 255, 0.44)', 'rgba(255, 255, 255, 0.5)', 'rgba(255, 255, 255, 0.66)', 'rgba(255, 255, 255, 0.84)', '#ffffff']
|
|
79
79
|
},
|
|
80
80
|
bnw: {
|
|
81
81
|
light: ['#ffffff', '#f5f5f5', '#eeeeee', '#cccccc', '#aaaaaa', '#888888', '#666666', '#444444', '#333333', '#222222', '#111111', '#111111', '#111111'],
|