@lobehub/ui 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 (111) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +144 -0
  3. package/es/ActionIcon/index.d.ts +15 -0
  4. package/es/ActionIcon/index.js +84 -0
  5. package/es/DraggablePanel/index.d.ts +26 -0
  6. package/es/DraggablePanel/index.js +197 -0
  7. package/es/DraggablePanel/style.d.ts +18 -0
  8. package/es/DraggablePanel/style.js +30 -0
  9. package/es/DraggablePanel/utils.d.ts +2 -0
  10. package/es/DraggablePanel/utils.js +12 -0
  11. package/es/Logo/Logo3D.d.ts +4 -0
  12. package/es/Logo/Logo3D.js +11 -0
  13. package/es/Logo/LogoFlat.d.ts +4 -0
  14. package/es/Logo/LogoFlat.js +104 -0
  15. package/es/Logo/LogoHighContrast.d.ts +4 -0
  16. package/es/Logo/LogoHighContrast.js +26 -0
  17. package/es/Logo/LogoText.d.ts +4 -0
  18. package/es/Logo/LogoText.js +18 -0
  19. package/es/Logo/index.d.ts +8 -0
  20. package/es/Logo/index.js +54 -0
  21. package/es/SideNav/index.d.ts +9 -0
  22. package/es/SideNav/index.js +44 -0
  23. package/es/Template/index.d.ts +7 -0
  24. package/es/Template/index.js +15 -0
  25. package/es/ThemeProvider/GlobalStyle.d.ts +3 -0
  26. package/es/ThemeProvider/GlobalStyle.js +19 -0
  27. package/es/ThemeProvider/index.d.ts +11 -0
  28. package/es/ThemeProvider/index.js +40 -0
  29. package/es/ThemeProvider/token.d.ts +3 -0
  30. package/es/ThemeProvider/token.js +45 -0
  31. package/es/index.d.ts +6 -0
  32. package/es/index.js +6 -0
  33. package/es/styles/algorithms/colorRelationship.d.ts +6 -0
  34. package/es/styles/algorithms/colorRelationship.js +88 -0
  35. package/es/styles/algorithms/index.d.ts +15 -0
  36. package/es/styles/algorithms/index.js +67 -0
  37. package/es/styles/algorithms/paletteGenerator.d.ts +51 -0
  38. package/es/styles/algorithms/paletteGenerator.js +74 -0
  39. package/es/styles/antdTheme.d.ts +2 -0
  40. package/es/styles/antdTheme.js +4 -0
  41. package/es/styles/customStylish.d.ts +17 -0
  42. package/es/styles/customStylish.js +19 -0
  43. package/es/styles/customToken.d.ts +65 -0
  44. package/es/styles/customToken.js +24 -0
  45. package/es/styles/index.d.ts +3 -0
  46. package/es/styles/index.js +3 -0
  47. package/es/styles/theme/dark.d.ts +4 -0
  48. package/es/styles/theme/dark.js +82 -0
  49. package/es/styles/theme/index.d.ts +2 -0
  50. package/es/styles/theme/index.js +2 -0
  51. package/es/styles/theme/light.d.ts +4 -0
  52. package/es/styles/theme/light.js +36 -0
  53. package/es/types/index.d.ts +9 -0
  54. package/es/types/index.js +1 -0
  55. package/es/utils/colorUtils.d.ts +1 -0
  56. package/es/utils/colorUtils.js +10 -0
  57. package/lib/ActionIcon/index.d.ts +15 -0
  58. package/lib/ActionIcon/index.js +110 -0
  59. package/lib/DraggablePanel/index.d.ts +26 -0
  60. package/lib/DraggablePanel/index.js +217 -0
  61. package/lib/DraggablePanel/style.d.ts +18 -0
  62. package/lib/DraggablePanel/style.js +287 -0
  63. package/lib/DraggablePanel/utils.d.ts +2 -0
  64. package/lib/DraggablePanel/utils.js +40 -0
  65. package/lib/Logo/Logo3D.d.ts +4 -0
  66. package/lib/Logo/Logo3D.js +45 -0
  67. package/lib/Logo/LogoFlat.d.ts +4 -0
  68. package/lib/Logo/LogoFlat.js +130 -0
  69. package/lib/Logo/LogoHighContrast.d.ts +4 -0
  70. package/lib/Logo/LogoHighContrast.js +58 -0
  71. package/lib/Logo/LogoText.d.ts +4 -0
  72. package/lib/Logo/LogoText.js +49 -0
  73. package/lib/Logo/index.d.ts +8 -0
  74. package/lib/Logo/index.js +54 -0
  75. package/lib/SideNav/index.d.ts +9 -0
  76. package/lib/SideNav/index.js +58 -0
  77. package/lib/Template/index.d.ts +7 -0
  78. package/lib/Template/index.js +41 -0
  79. package/lib/ThemeProvider/GlobalStyle.d.ts +3 -0
  80. package/lib/ThemeProvider/GlobalStyle.js +80 -0
  81. package/lib/ThemeProvider/index.d.ts +11 -0
  82. package/lib/ThemeProvider/index.js +68 -0
  83. package/lib/ThemeProvider/token.d.ts +3 -0
  84. package/lib/ThemeProvider/token.js +73 -0
  85. package/lib/index.d.ts +6 -0
  86. package/lib/index.js +54 -0
  87. package/lib/styles/algorithms/colorRelationship.d.ts +6 -0
  88. package/lib/styles/algorithms/colorRelationship.js +87 -0
  89. package/lib/styles/algorithms/index.d.ts +15 -0
  90. package/lib/styles/algorithms/index.js +81 -0
  91. package/lib/styles/algorithms/paletteGenerator.d.ts +51 -0
  92. package/lib/styles/algorithms/paletteGenerator.js +91 -0
  93. package/lib/styles/antdTheme.d.ts +2 -0
  94. package/lib/styles/antdTheme.js +30 -0
  95. package/lib/styles/customStylish.d.ts +17 -0
  96. package/lib/styles/customStylish.js +117 -0
  97. package/lib/styles/customToken.d.ts +65 -0
  98. package/lib/styles/customToken.js +54 -0
  99. package/lib/styles/index.d.ts +3 -0
  100. package/lib/styles/index.js +21 -0
  101. package/lib/styles/theme/dark.d.ts +4 -0
  102. package/lib/styles/theme/dark.js +131 -0
  103. package/lib/styles/theme/index.d.ts +2 -0
  104. package/lib/styles/theme/index.js +32 -0
  105. package/lib/styles/theme/light.d.ts +4 -0
  106. package/lib/styles/theme/light.js +64 -0
  107. package/lib/types/index.d.ts +9 -0
  108. package/lib/types/index.js +17 -0
  109. package/lib/utils/colorUtils.d.ts +1 -0
  110. package/lib/utils/colorUtils.js +52 -0
  111. package/package.json +122 -0
@@ -0,0 +1,15 @@
1
+ import { DivProps } from "../types";
2
+ import { LucideIcon } from 'lucide-react';
3
+ import React from 'react';
4
+ export interface ActionIconProps extends DivProps {
5
+ active?: boolean;
6
+ size?: 'large' | 'normal' | 'small' | {
7
+ blockSize: number;
8
+ fontSize: number;
9
+ strokeWidth: number;
10
+ borderRadius: number;
11
+ };
12
+ icon: LucideIcon;
13
+ }
14
+ declare const _default: React.NamedExoticComponent<ActionIconProps>;
15
+ export default _default;
@@ -0,0 +1,110 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/ActionIcon/index.tsx
30
+ var ActionIcon_exports = {};
31
+ __export(ActionIcon_exports, {
32
+ default: () => ActionIcon_default
33
+ });
34
+ module.exports = __toCommonJS(ActionIcon_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_styled_components = __toESM(require("styled-components"));
37
+ var Block = import_styled_components.default.div`
38
+ cursor: pointer;
39
+
40
+ display: flex;
41
+ flex: none;
42
+ align-items: center;
43
+ justify-content: center;
44
+
45
+ color: ${({ active, theme }) => active ? theme.colorText : theme.colorTextQuaternary};
46
+
47
+ background: ${({ active, theme }) => active ? theme.colorFill : "transparent"};
48
+
49
+ transition: all 0.2s ${({ theme }) => theme.motionEaseOut};
50
+
51
+ &:hover {
52
+ background: ${({ theme }) => theme.colorFillTertiary};
53
+ }
54
+
55
+ &:active {
56
+ color: ${({ theme }) => theme.colorText};
57
+ background: ${({ theme }) => theme.colorFill};
58
+ }
59
+ `;
60
+ var ActionIcon = ({
61
+ active,
62
+ icon,
63
+ size = "normal",
64
+ style,
65
+ ...props
66
+ }) => {
67
+ let blockSize;
68
+ let fontSize;
69
+ let strokeWidth;
70
+ let borderRadius;
71
+ const Icon = icon;
72
+ switch (size) {
73
+ case "large":
74
+ blockSize = 44;
75
+ fontSize = 24;
76
+ strokeWidth = 2;
77
+ borderRadius = 8;
78
+ break;
79
+ case "normal":
80
+ blockSize = 36;
81
+ fontSize = 24;
82
+ strokeWidth = 2;
83
+ borderRadius = 5;
84
+ break;
85
+ case "small":
86
+ blockSize = 28;
87
+ fontSize = 20;
88
+ strokeWidth = 1.5;
89
+ borderRadius = 5;
90
+ break;
91
+ default:
92
+ blockSize = (size == null ? void 0 : size.blockSize) || 36;
93
+ fontSize = (size == null ? void 0 : size.fontSize) || 24;
94
+ strokeWidth = (size == null ? void 0 : size.strokeWidth) || 2;
95
+ borderRadius = (size == null ? void 0 : size.borderRadius) || 5;
96
+ break;
97
+ }
98
+ return /* @__PURE__ */ import_react.default.createElement(
99
+ Block,
100
+ {
101
+ active,
102
+ style: { width: blockSize, height: blockSize, borderRadius, ...style },
103
+ ...props
104
+ },
105
+ /* @__PURE__ */ import_react.default.createElement(Icon, { size: fontSize, strokeWidth })
106
+ );
107
+ };
108
+ var ActionIcon_default = import_react.default.memo(ActionIcon);
109
+ // Annotate the CommonJS export names for ESM import in node:
110
+ 0 && (module.exports = {});
@@ -0,0 +1,26 @@
1
+ import type { DivProps } from "../types";
2
+ import type { NumberSize, Size } from 're-resizable';
3
+ import React from 'react';
4
+ import type { Props as RndProps } from 'react-rnd';
5
+ export declare type placementType = 'right' | 'left' | 'top' | 'bottom';
6
+ export interface DraggablePanelProps extends DivProps {
7
+ pin?: boolean;
8
+ mode?: 'fixed' | 'float';
9
+ placement: placementType;
10
+ minWidth?: number;
11
+ minHeight?: number;
12
+ resize?: RndProps['enableResizing'];
13
+ size?: Partial<Size>;
14
+ onSizeChange?: (delta: NumberSize, size?: Size) => void;
15
+ onSizeDragging?: (delta: NumberSize, size?: Size) => void;
16
+ expandable?: boolean;
17
+ expand?: boolean;
18
+ defaultExpand?: boolean;
19
+ onExpandChange?: (expand: boolean) => void;
20
+ defaultSize?: Partial<Size>;
21
+ destroyOnClose?: boolean;
22
+ showHandlerWhenUnexpand?: boolean;
23
+ hanlderStyle?: React.CSSProperties;
24
+ }
25
+ declare const _default: React.NamedExoticComponent<DraggablePanelProps>;
26
+ export default _default;
@@ -0,0 +1,217 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/DraggablePanel/index.tsx
30
+ var DraggablePanel_exports = {};
31
+ __export(DraggablePanel_exports, {
32
+ default: () => DraggablePanel_default
33
+ });
34
+ module.exports = __toCommonJS(DraggablePanel_exports);
35
+ var import_ahooks = require("ahooks");
36
+ var import_lucide_react = require("lucide-react");
37
+ var import_re_resizable = require("re-resizable");
38
+ var import_react = __toESM(require("react"));
39
+ var import_react_layout_kit = require("react-layout-kit");
40
+ var import_use_merge_value = __toESM(require("use-merge-value"));
41
+ var import_style = require("./style");
42
+ var import_utils = require("./utils");
43
+ var DEFAULT_HEIGHT = 180;
44
+ var DEFAULT_WIDTH = 280;
45
+ var DraggablePanel = ({
46
+ pin = "true",
47
+ mode = "fixed",
48
+ children,
49
+ placement = "right",
50
+ resize,
51
+ style,
52
+ size,
53
+ defaultSize: customizeDefaultSize,
54
+ minWidth,
55
+ minHeight,
56
+ onSizeChange,
57
+ onSizeDragging,
58
+ expandable = true,
59
+ expand,
60
+ defaultExpand = true,
61
+ onExpandChange,
62
+ className,
63
+ showHandlerWhenUnexpand,
64
+ destroyOnClose,
65
+ hanlderStyle
66
+ }) => {
67
+ const ref = (0, import_react.useRef)(null);
68
+ const isHovering = (0, import_ahooks.useHover)(ref);
69
+ const isVertical = placement === "top" || placement === "bottom";
70
+ const { styles, cx } = (0, import_style.useStyle)("draggable-panel");
71
+ const [isExpand, setIsExpand] = (0, import_use_merge_value.default)(defaultExpand, {
72
+ value: expand,
73
+ onChange: onExpandChange
74
+ });
75
+ (0, import_react.useEffect)(() => {
76
+ if (pin)
77
+ return;
78
+ if (isHovering && !isExpand) {
79
+ setIsExpand(true);
80
+ } else if (!isHovering && isExpand) {
81
+ setIsExpand(false);
82
+ }
83
+ }, [pin, isHovering, isExpand]);
84
+ const [showExpand, setShowExpand] = (0, import_react.useState)(true);
85
+ const canResizing = resize !== false && isExpand;
86
+ const resizeHandleClassNames = (0, import_react.useMemo)(() => {
87
+ if (!canResizing)
88
+ return {};
89
+ return {
90
+ [(0, import_utils.revesePlacement)(placement)]: styles[`${(0, import_utils.revesePlacement)(placement)}Handle`]
91
+ };
92
+ }, [canResizing, placement]);
93
+ const resizing = {
94
+ top: false,
95
+ bottom: false,
96
+ right: false,
97
+ left: false,
98
+ topRight: false,
99
+ bottomRight: false,
100
+ bottomLeft: false,
101
+ topLeft: false,
102
+ [(0, import_utils.revesePlacement)(placement)]: true,
103
+ ...resize
104
+ };
105
+ const defaultSize = (0, import_react.useMemo)(() => {
106
+ if (isVertical)
107
+ return {
108
+ width: "100%",
109
+ height: DEFAULT_HEIGHT,
110
+ ...customizeDefaultSize
111
+ };
112
+ return {
113
+ width: DEFAULT_WIDTH,
114
+ height: "100%",
115
+ ...customizeDefaultSize
116
+ };
117
+ }, [isVertical]);
118
+ const sizeProps = isExpand ? {
119
+ minWidth: typeof minWidth === "number" ? Math.max(minWidth, 0) : 280,
120
+ minHeight: typeof minHeight === "number" ? Math.max(minHeight, 0) : void 0,
121
+ defaultSize,
122
+ size
123
+ } : isVertical ? {
124
+ minHeight: 0,
125
+ size: { height: 0 }
126
+ } : {
127
+ minWidth: 0,
128
+ size: { width: 0 }
129
+ };
130
+ const { Arrow, className: arrowPlacement } = (0, import_react.useMemo)(() => {
131
+ switch (placement) {
132
+ case "top":
133
+ return { className: "Bottom", Arrow: import_lucide_react.ChevronDown };
134
+ case "bottom":
135
+ return { className: "Top", Arrow: import_lucide_react.ChevronUp };
136
+ case "right":
137
+ return { className: "Left", Arrow: import_lucide_react.ChevronLeft };
138
+ case "left":
139
+ return { className: "Right", Arrow: import_lucide_react.ChevronRight };
140
+ }
141
+ }, [styles, placement]);
142
+ const handler = (
143
+ // @ts-ignore
144
+ /* @__PURE__ */ import_react.default.createElement(
145
+ import_react_layout_kit.Center,
146
+ {
147
+ className: cx(styles[`toggle${arrowPlacement}`]),
148
+ style: { opacity: isExpand ? !pin ? 0 : void 0 : showHandlerWhenUnexpand ? 1 : 0 }
149
+ },
150
+ /* @__PURE__ */ import_react.default.createElement(
151
+ import_react_layout_kit.Center,
152
+ {
153
+ style: hanlderStyle,
154
+ onClick: () => {
155
+ setIsExpand(!isExpand);
156
+ }
157
+ },
158
+ /* @__PURE__ */ import_react.default.createElement(
159
+ "div",
160
+ {
161
+ className: styles.handlerIcon,
162
+ style: { transform: `rotate(${isExpand ? 180 : 0}deg)` }
163
+ },
164
+ /* @__PURE__ */ import_react.default.createElement(Arrow, { size: 16, strokeWidth: 1.5 })
165
+ )
166
+ )
167
+ )
168
+ );
169
+ const inner = (
170
+ // @ts-ignore
171
+ /* @__PURE__ */ import_react.default.createElement(
172
+ import_re_resizable.Resizable,
173
+ {
174
+ ...sizeProps,
175
+ style,
176
+ className: styles.panel,
177
+ enable: canResizing ? resizing : void 0,
178
+ handleClasses: resizeHandleClassNames,
179
+ onResizeStop: (e, direction, ref2, delta) => {
180
+ setShowExpand(true);
181
+ onSizeChange == null ? void 0 : onSizeChange(delta, {
182
+ width: ref2.style.width,
183
+ height: ref2.style.height
184
+ });
185
+ },
186
+ onResizeStart: () => {
187
+ setShowExpand(false);
188
+ },
189
+ onResize: (_, direction, ref2, delta) => {
190
+ onSizeDragging == null ? void 0 : onSizeDragging(delta, {
191
+ width: ref2.style.width,
192
+ height: ref2.style.height
193
+ });
194
+ }
195
+ },
196
+ children
197
+ )
198
+ );
199
+ return /* @__PURE__ */ import_react.default.createElement(
200
+ "div",
201
+ {
202
+ ref,
203
+ className: cx(
204
+ styles.container,
205
+ // @ts-ignore
206
+ styles[mode === "fixed" ? "fixed" : `${placement}Float`],
207
+ className
208
+ ),
209
+ style: { [`border${arrowPlacement}Width`]: 1 }
210
+ },
211
+ expandable && showExpand && handler,
212
+ destroyOnClose ? isExpand && inner : inner
213
+ );
214
+ };
215
+ var DraggablePanel_default = import_react.default.memo(DraggablePanel);
216
+ // Annotate the CommonJS export names for ESM import in node:
217
+ 0 && (module.exports = {});
@@ -0,0 +1,18 @@
1
+ export declare const useStyle: (props?: string | undefined) => import("antd-style").ReturnStyles<{
2
+ container: string;
3
+ fixed: import("antd-style").SerializedStyles;
4
+ leftFloat: string;
5
+ rightFloat: string;
6
+ topFloat: string;
7
+ bottomFloat: string;
8
+ toggleLeft: string;
9
+ toggleRight: string;
10
+ toggleTop: string;
11
+ toggleBottom: string;
12
+ panel: string;
13
+ handlerIcon: import("antd-style").SerializedStyles;
14
+ leftHandle: string;
15
+ rightHandle: string;
16
+ topHandle: string;
17
+ bottomHandle: string;
18
+ }>;
@@ -0,0 +1,287 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/DraggablePanel/style.ts
20
+ var style_exports = {};
21
+ __export(style_exports, {
22
+ useStyle: () => useStyle
23
+ });
24
+ module.exports = __toCommonJS(style_exports);
25
+ var import_antd_style = require("antd-style");
26
+ var offset = 16;
27
+ var toggleLength = 40;
28
+ var toggleShort = 16;
29
+ var useStyle = (0, import_antd_style.createStyles)(({ token }, prefix) => {
30
+ const commonHandle = import_antd_style.css`
31
+ position: relative;
32
+ &::before {
33
+ content: '';
34
+ position: absolute;
35
+ z-index: 50;
36
+ transition: all 0.2s ${token.motionEaseOut};
37
+ }
38
+
39
+ &:hover,
40
+ &:active {
41
+ &::before {
42
+ background: ${token.colorPrimary};
43
+ }
44
+ }
45
+ `;
46
+ const commonToggle = import_antd_style.css`
47
+ position: absolute;
48
+ z-index: 1001;
49
+ opacity: 0;
50
+ transition: all 0.2s ${token.motionEaseOut};
51
+
52
+ &:hover {
53
+ opacity: 1 !important;
54
+ }
55
+
56
+ &:active {
57
+ opacity: 1 !important;
58
+ }
59
+
60
+ > div {
61
+ cursor: pointer;
62
+
63
+ position: absolute;
64
+
65
+ color: ${token.colorTextTertiary};
66
+
67
+ background: ${token.colorFillTertiary};
68
+ border-color: ${token.colorBorderSecondary};
69
+ border-style: solid;
70
+ border-width: 1px;
71
+ border-radius: 4px;
72
+
73
+ transition: all 0.2s ${token.motionEaseOut};
74
+
75
+ &:hover {
76
+ color: ${token.colorTextSecondary};
77
+ background: ${token.colorFillSecondary};
78
+ }
79
+
80
+ &:active {
81
+ color: ${token.colorText};
82
+ background: ${token.colorFill};
83
+ }
84
+ }
85
+ `;
86
+ const float = import_antd_style.css`
87
+ position: absolute;
88
+ z-index: 2000;
89
+ `;
90
+ return {
91
+ container: (0, import_antd_style.cx)(
92
+ prefix,
93
+ import_antd_style.css`
94
+ flex-shrink: 0;
95
+ border: 0 solid ${token.colorBorderSecondary};
96
+
97
+ &:hover {
98
+ .${prefix}-toggle {
99
+ opacity: 1;
100
+ }
101
+ }
102
+ `
103
+ ),
104
+ fixed: import_antd_style.css`
105
+ position: relative;
106
+ `,
107
+ leftFloat: (0, import_antd_style.cx)(
108
+ float,
109
+ import_antd_style.css`
110
+ top: 0;
111
+ bottom: 0;
112
+ left: 0;
113
+ height: 100%;
114
+ `
115
+ ),
116
+ rightFloat: (0, import_antd_style.cx)(
117
+ float,
118
+ import_antd_style.css`
119
+ top: 0;
120
+ right: 0;
121
+ bottom: 0;
122
+ height: 100%;
123
+ `
124
+ ),
125
+ topFloat: (0, import_antd_style.cx)(
126
+ float,
127
+ import_antd_style.css`
128
+ top: 0;
129
+ right: 0;
130
+ left: 0;
131
+ width: 100%;
132
+ `
133
+ ),
134
+ bottomFloat: (0, import_antd_style.cx)(
135
+ float,
136
+ import_antd_style.css`
137
+ right: 0;
138
+ bottom: 0;
139
+ left: 0;
140
+ width: 100%;
141
+ `
142
+ ),
143
+ toggleLeft: (0, import_antd_style.cx)(
144
+ `${prefix}-toggle`,
145
+ `${prefix}-toggle-left`,
146
+ commonToggle,
147
+ import_antd_style.css`
148
+ left: -${offset}px;
149
+ width: ${toggleShort}px;
150
+ height: 100%;
151
+ > div {
152
+ top: 50%;
153
+
154
+ width: ${toggleShort}px;
155
+ height: ${toggleLength}px;
156
+ margin-top: -20px;
157
+
158
+ border-radius: 4px 0 0 4px;
159
+ }
160
+ `
161
+ ),
162
+ toggleRight: (0, import_antd_style.cx)(
163
+ `${prefix}-toggle`,
164
+ `${prefix}-toggle-right`,
165
+ commonToggle,
166
+ import_antd_style.css`
167
+ right: -${offset}px;
168
+ width: ${toggleShort}px;
169
+ height: 100%;
170
+ > div {
171
+ top: 50%;
172
+
173
+ width: ${toggleShort}px;
174
+ height: ${toggleLength}px;
175
+ margin-top: -20px;
176
+
177
+ border-radius: 0 4px 4px 0;
178
+ }
179
+ `
180
+ ),
181
+ toggleTop: (0, import_antd_style.cx)(
182
+ `${prefix}-toggle`,
183
+ `${prefix}-toggle-top`,
184
+ commonToggle,
185
+ import_antd_style.css`
186
+ top: -${offset}px;
187
+ width: 100%;
188
+ height: ${toggleShort}px;
189
+
190
+ > div {
191
+ left: 50%;
192
+
193
+ width: ${toggleLength}px;
194
+ height: ${toggleShort}px;
195
+ margin-left: -20px;
196
+
197
+ border-radius: 4px 4px 0 0;
198
+ }
199
+ `
200
+ ),
201
+ toggleBottom: (0, import_antd_style.cx)(
202
+ `${prefix}-toggle`,
203
+ `${prefix}-toggle-bottom`,
204
+ commonToggle,
205
+ import_antd_style.css`
206
+ bottom: -${offset}px;
207
+ width: 100%;
208
+ height: ${toggleShort}px;
209
+
210
+ > div {
211
+ left: 50%;
212
+
213
+ width: ${toggleLength}px;
214
+ height: 16px;
215
+ margin-left: -20px;
216
+
217
+ border-radius: 0 0 4px 4px;
218
+ }
219
+ `
220
+ ),
221
+ panel: (0, import_antd_style.cx)(
222
+ `${prefix}-fixed`,
223
+ import_antd_style.css`
224
+ overflow: hidden;
225
+ background: ${token.colorBgContainer};
226
+ transition: all 0.2s ${token.motionEaseOut};
227
+ `
228
+ ),
229
+ handlerIcon: import_antd_style.css`
230
+ display: flex;
231
+ align-items: center;
232
+ justify-content: center;
233
+ transition: all 0.2s ${token.motionEaseOut};
234
+ `,
235
+ leftHandle: (0, import_antd_style.cx)(
236
+ import_antd_style.css`
237
+ ${commonHandle};
238
+
239
+ &::before {
240
+ left: 50%;
241
+ width: 2px;
242
+ height: 100%;
243
+ }
244
+ `,
245
+ `${prefix}-left-handle`
246
+ ),
247
+ rightHandle: (0, import_antd_style.cx)(
248
+ import_antd_style.css`
249
+ ${commonHandle};
250
+ &::before {
251
+ right: 50%;
252
+ width: 2px;
253
+ height: 100%;
254
+ }
255
+ `,
256
+ `${prefix}-right-handle`
257
+ ),
258
+ topHandle: (0, import_antd_style.cx)(
259
+ `${prefix}-top-handle`,
260
+ import_antd_style.css`
261
+ ${commonHandle};
262
+
263
+ &::before {
264
+ top: 50%;
265
+ width: 100%;
266
+ height: 2px;
267
+ }
268
+ `
269
+ ),
270
+ bottomHandle: (0, import_antd_style.cx)(
271
+ `${prefix}-bottom-handle`,
272
+ import_antd_style.css`
273
+ ${commonHandle};
274
+
275
+ &::before {
276
+ bottom: 50%;
277
+ width: 100%;
278
+ height: 2px;
279
+ }
280
+ `
281
+ )
282
+ };
283
+ });
284
+ // Annotate the CommonJS export names for ESM import in node:
285
+ 0 && (module.exports = {
286
+ useStyle
287
+ });
@@ -0,0 +1,2 @@
1
+ import { placementType } from './index';
2
+ export declare const revesePlacement: (placement: placementType) => "left" | "right" | "bottom" | "top";