@officesdk/design 0.1.8 → 0.1.10
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/dist/components/cjs/index.d.ts +339 -13
- package/dist/components/cjs/index.js +1267 -289
- package/dist/components/cjs/index.js.map +1 -1
- package/dist/components/esm/index.d.ts +339 -13
- package/dist/components/esm/index.js +1260 -291
- package/dist/components/esm/index.js.map +1 -1
- package/dist/theme/cjs/index.js +260 -155
- package/dist/theme/cjs/index.js.map +1 -1
- package/dist/theme/esm/index.js +260 -155
- package/dist/theme/esm/index.js.map +1 -1
- package/package.json +7 -3
|
@@ -4,6 +4,11 @@ var React3 = require('react');
|
|
|
4
4
|
var baseStyled = require('styled-components');
|
|
5
5
|
var RcTooltip = require('rc-tooltip');
|
|
6
6
|
require('rc-tooltip/assets/bootstrap.css');
|
|
7
|
+
var RcMenu = require('rc-menu');
|
|
8
|
+
var VirtualList = require('rc-virtual-list');
|
|
9
|
+
require('rc-menu/assets/index.css');
|
|
10
|
+
var RcDropdown = require('rc-dropdown');
|
|
11
|
+
require('rc-dropdown/assets/index.css');
|
|
7
12
|
var ReactDOM = require('react-dom');
|
|
8
13
|
|
|
9
14
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -11,6 +16,9 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
11
16
|
var React3__default = /*#__PURE__*/_interopDefault(React3);
|
|
12
17
|
var baseStyled__default = /*#__PURE__*/_interopDefault(baseStyled);
|
|
13
18
|
var RcTooltip__default = /*#__PURE__*/_interopDefault(RcTooltip);
|
|
19
|
+
var RcMenu__default = /*#__PURE__*/_interopDefault(RcMenu);
|
|
20
|
+
var VirtualList__default = /*#__PURE__*/_interopDefault(VirtualList);
|
|
21
|
+
var RcDropdown__default = /*#__PURE__*/_interopDefault(RcDropdown);
|
|
14
22
|
var ReactDOM__default = /*#__PURE__*/_interopDefault(ReactDOM);
|
|
15
23
|
|
|
16
24
|
var __defProp = Object.defineProperty;
|
|
@@ -133,8 +141,8 @@ var init_Toast = __esm({
|
|
|
133
141
|
border: 1px solid;
|
|
134
142
|
box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.08);
|
|
135
143
|
|
|
136
|
-
${({ theme:
|
|
137
|
-
const baseConfig =
|
|
144
|
+
${({ theme: theme3 }) => {
|
|
145
|
+
const baseConfig = theme3.components.toast;
|
|
138
146
|
return `
|
|
139
147
|
padding: ${baseConfig.padding};
|
|
140
148
|
border-radius: ${baseConfig.borderRadius};
|
|
@@ -143,8 +151,8 @@ var init_Toast = __esm({
|
|
|
143
151
|
`;
|
|
144
152
|
}}
|
|
145
153
|
|
|
146
|
-
${({ $variant, theme:
|
|
147
|
-
const variantConfig =
|
|
154
|
+
${({ $variant, theme: theme3 }) => {
|
|
155
|
+
const variantConfig = theme3.components.toast[$variant];
|
|
148
156
|
return `
|
|
149
157
|
background: ${variantConfig.background};
|
|
150
158
|
border-color: ${variantConfig.borderColor};
|
|
@@ -175,12 +183,12 @@ var init_Toast = __esm({
|
|
|
175
183
|
Message = exports.styled.span`
|
|
176
184
|
font-size: 13px;
|
|
177
185
|
line-height: 20px;
|
|
178
|
-
color: ${({ theme:
|
|
186
|
+
color: ${({ theme: theme3 }) => theme3.colors.palettes.gray["100"]};
|
|
179
187
|
`;
|
|
180
188
|
Description = exports.styled.span`
|
|
181
189
|
font-size: 12px;
|
|
182
190
|
line-height: 20px;
|
|
183
|
-
color: ${({ theme:
|
|
191
|
+
color: ${({ theme: theme3 }) => theme3.colors.palettes.transparency["60"]};
|
|
184
192
|
`;
|
|
185
193
|
ActionGroup = exports.styled.div`
|
|
186
194
|
display: flex;
|
|
@@ -229,8 +237,8 @@ var init_Toast = __esm({
|
|
|
229
237
|
if (icon) {
|
|
230
238
|
return icon;
|
|
231
239
|
}
|
|
232
|
-
const
|
|
233
|
-
const themeIconUrl =
|
|
240
|
+
const theme3 = exports.getGlobalTheme();
|
|
241
|
+
const themeIconUrl = theme3?.components?.toast?.[variant]?.icon?.url;
|
|
234
242
|
if (themeIconUrl) {
|
|
235
243
|
return /* @__PURE__ */ React3__default.default.createElement(exports.Icon, { src: themeIconUrl });
|
|
236
244
|
}
|
|
@@ -315,8 +323,8 @@ var init_toastManager = __esm({
|
|
|
315
323
|
pointer-events: auto;
|
|
316
324
|
}
|
|
317
325
|
|
|
318
|
-
${({ $placement, theme:
|
|
319
|
-
const offset =
|
|
326
|
+
${({ $placement, theme: theme3 }) => {
|
|
327
|
+
const offset = theme3.components?.toast?.offset || { vertical: "24px", horizontal: "24px" };
|
|
320
328
|
const vertical = offset.vertical || "24px";
|
|
321
329
|
const horizontal = offset.horizontal || "24px";
|
|
322
330
|
const styles = {
|
|
@@ -521,8 +529,8 @@ var globalTheme, registerGlobalTheme; exports.getGlobalTheme = void 0; var globa
|
|
|
521
529
|
var init_context = __esm({
|
|
522
530
|
"src/utils/context.ts"() {
|
|
523
531
|
globalTheme = {};
|
|
524
|
-
registerGlobalTheme = (
|
|
525
|
-
Object.assign(globalTheme, { ...globalTheme, ...
|
|
532
|
+
registerGlobalTheme = (theme3) => {
|
|
533
|
+
Object.assign(globalTheme, { ...globalTheme, ...theme3 });
|
|
526
534
|
};
|
|
527
535
|
exports.getGlobalTheme = () => {
|
|
528
536
|
return globalTheme;
|
|
@@ -589,8 +597,8 @@ var init_Button = __esm({
|
|
|
589
597
|
justify-content: center;
|
|
590
598
|
flex-shrink: 0;
|
|
591
599
|
|
|
592
|
-
${({ $size, $iconPlacement, theme:
|
|
593
|
-
const buttonConfig =
|
|
600
|
+
${({ $size, $iconPlacement, theme: theme3 }) => {
|
|
601
|
+
const buttonConfig = theme3.components.button[$size || "medium"];
|
|
594
602
|
const sizeConfig = buttonConfig?.withIcon || buttonConfig;
|
|
595
603
|
const marginSide = $iconPlacement === "before" ? "margin-right" : "margin-left";
|
|
596
604
|
return `
|
|
@@ -607,8 +615,8 @@ var init_Button = __esm({
|
|
|
607
615
|
}}
|
|
608
616
|
`;
|
|
609
617
|
TextWrapper = exports.styled.span`
|
|
610
|
-
${({ $size, theme:
|
|
611
|
-
const buttonConfig =
|
|
618
|
+
${({ $size, theme: theme3 }) => {
|
|
619
|
+
const buttonConfig = theme3.components.button[$size || "medium"];
|
|
612
620
|
const sizeConfig = buttonConfig?.withIcon || buttonConfig;
|
|
613
621
|
return `
|
|
614
622
|
padding: ${sizeConfig.textPadding || "0"};
|
|
@@ -621,8 +629,8 @@ var init_Button = __esm({
|
|
|
621
629
|
justify-content: center;
|
|
622
630
|
flex-shrink: 0;
|
|
623
631
|
|
|
624
|
-
${({ $size, theme:
|
|
625
|
-
const buttonConfig =
|
|
632
|
+
${({ $size, theme: theme3 }) => {
|
|
633
|
+
const buttonConfig = theme3.components.button[$size || "medium"];
|
|
626
634
|
const sizeConfig = buttonConfig?.onlyIcon || buttonConfig;
|
|
627
635
|
return `
|
|
628
636
|
width: ${sizeConfig.iconSize?.width || "14px"};
|
|
@@ -646,14 +654,14 @@ var init_Button = __esm({
|
|
|
646
654
|
width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"};
|
|
647
655
|
|
|
648
656
|
/* Size variants */
|
|
649
|
-
${({ $size, $variant, theme:
|
|
657
|
+
${({ $size, $variant, theme: theme3 }) => {
|
|
650
658
|
const sizeName = $size || "medium";
|
|
651
|
-
const buttonConfig =
|
|
659
|
+
const buttonConfig = theme3.components.button[sizeName];
|
|
652
660
|
if ($variant === "icon") {
|
|
653
661
|
const sizeConfig2 = buttonConfig?.onlyIcon || buttonConfig;
|
|
654
662
|
return `
|
|
655
663
|
padding: ${sizeConfig2.padding || "7px"};
|
|
656
|
-
border-radius: ${sizeConfig2.borderRadius ||
|
|
664
|
+
border-radius: ${sizeConfig2.borderRadius || theme3.borderRadius.small};
|
|
657
665
|
`;
|
|
658
666
|
}
|
|
659
667
|
const sizeConfig = buttonConfig?.withIcon || buttonConfig;
|
|
@@ -667,10 +675,10 @@ var init_Button = __esm({
|
|
|
667
675
|
}}
|
|
668
676
|
|
|
669
677
|
/* Variant and color type styles */
|
|
670
|
-
${({ $variant, $colorType, $iconBordered, theme:
|
|
678
|
+
${({ $variant, $colorType, $iconBordered, theme: theme3 }) => {
|
|
671
679
|
if ($variant === "icon") {
|
|
672
680
|
const baseVariant = $iconBordered ? "outlined" : "text";
|
|
673
|
-
const styles2 =
|
|
681
|
+
const styles2 = theme3.components.button[baseVariant]["default"];
|
|
674
682
|
return `
|
|
675
683
|
background: ${styles2.background};
|
|
676
684
|
color: ${styles2.color};
|
|
@@ -708,7 +716,7 @@ var init_Button = __esm({
|
|
|
708
716
|
);
|
|
709
717
|
}
|
|
710
718
|
const effectiveColorType = colorType === "status" && variant !== "text" ? "default" : colorType;
|
|
711
|
-
const styles =
|
|
719
|
+
const styles = theme3.components.button[variant][effectiveColorType];
|
|
712
720
|
return `
|
|
713
721
|
background: ${styles.background};
|
|
714
722
|
color: ${styles.color};
|
|
@@ -791,7 +799,7 @@ var init_Slider = __esm({
|
|
|
791
799
|
left: 0;
|
|
792
800
|
right: 0;
|
|
793
801
|
height: 2px;
|
|
794
|
-
background: ${({ theme:
|
|
802
|
+
background: ${({ theme: theme3 }) => theme3.colors.palettes.transparency["20"]};
|
|
795
803
|
border-radius: 1000px;
|
|
796
804
|
top: 50%;
|
|
797
805
|
transform: translateY(-50%);
|
|
@@ -804,14 +812,14 @@ var init_Slider = __esm({
|
|
|
804
812
|
top: 50%;
|
|
805
813
|
transform: translateY(-50%);
|
|
806
814
|
width: ${({ $percentage }) => $percentage}%;
|
|
807
|
-
background: ${({ $disabled, theme:
|
|
815
|
+
background: ${({ $disabled, theme: theme3 }) => $disabled ? theme3.colors.palettes.transparency["10"] : theme3.colors.palettes.gray["100"]};
|
|
808
816
|
`;
|
|
809
817
|
SliderThumb = exports.styled.div`
|
|
810
818
|
position: absolute;
|
|
811
819
|
width: 10px;
|
|
812
820
|
height: 10px;
|
|
813
821
|
border-radius: 50%;
|
|
814
|
-
background: ${({ $disabled, theme:
|
|
822
|
+
background: ${({ $disabled, theme: theme3 }) => $disabled ? theme3.colors.palettes.transparency["30"] : theme3.colors.palettes.blue["5"]};
|
|
815
823
|
left: ${({ $percentage }) => $percentage}%;
|
|
816
824
|
top: 50%;
|
|
817
825
|
transform: translate(-50%, -50%);
|
|
@@ -983,29 +991,29 @@ var init_NumberInput = __esm({
|
|
|
983
991
|
width: 80px;
|
|
984
992
|
`}
|
|
985
993
|
|
|
986
|
-
${({ $disabled, $alert, $isFocused, theme:
|
|
994
|
+
${({ $disabled, $alert, $isFocused, theme: theme3 }) => {
|
|
987
995
|
if ($disabled) {
|
|
988
996
|
return `
|
|
989
|
-
border-color: ${
|
|
997
|
+
border-color: ${theme3.colors.palettes.transparency["10"]};
|
|
990
998
|
cursor: not-allowed;
|
|
991
999
|
`;
|
|
992
1000
|
}
|
|
993
1001
|
if ($alert) {
|
|
994
1002
|
return `
|
|
995
|
-
border-color: ${
|
|
1003
|
+
border-color: ${theme3.colors.palettes.red["6"]};
|
|
996
1004
|
`;
|
|
997
1005
|
}
|
|
998
1006
|
if ($isFocused) {
|
|
999
1007
|
return `
|
|
1000
|
-
border-color: ${
|
|
1008
|
+
border-color: ${theme3.colors.palettes.transparency["30"]};
|
|
1001
1009
|
box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.04);
|
|
1002
1010
|
`;
|
|
1003
1011
|
}
|
|
1004
1012
|
return `
|
|
1005
|
-
border-color: ${
|
|
1013
|
+
border-color: ${theme3.colors.palettes.transparency["10"]};
|
|
1006
1014
|
|
|
1007
1015
|
&:hover {
|
|
1008
|
-
border-color: ${
|
|
1016
|
+
border-color: ${theme3.colors.palettes.transparency["20"]};
|
|
1009
1017
|
box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.04);
|
|
1010
1018
|
}
|
|
1011
1019
|
`;
|
|
@@ -1031,10 +1039,10 @@ var init_NumberInput = __esm({
|
|
|
1031
1039
|
font-size: 13px;
|
|
1032
1040
|
`}
|
|
1033
1041
|
|
|
1034
|
-
${({ $disabled, theme:
|
|
1035
|
-
color: ${
|
|
1042
|
+
${({ $disabled, theme: theme3 }) => $disabled ? `
|
|
1043
|
+
color: ${theme3.colors.palettes.transparency["30"]};
|
|
1036
1044
|
` : `
|
|
1037
|
-
color: ${
|
|
1045
|
+
color: ${theme3.colors.palettes.gray["120"]};
|
|
1038
1046
|
`}
|
|
1039
1047
|
`;
|
|
1040
1048
|
StyledInput = exports.styled.input`
|
|
@@ -1054,15 +1062,15 @@ var init_NumberInput = __esm({
|
|
|
1054
1062
|
font-size: 13px;
|
|
1055
1063
|
`}
|
|
1056
1064
|
|
|
1057
|
-
${({ $disabled, theme:
|
|
1058
|
-
color: ${
|
|
1065
|
+
${({ $disabled, theme: theme3 }) => $disabled ? `
|
|
1066
|
+
color: ${theme3.colors.palettes.transparency["30"]};
|
|
1059
1067
|
cursor: not-allowed;
|
|
1060
1068
|
` : `
|
|
1061
|
-
color: ${
|
|
1069
|
+
color: ${theme3.colors.palettes.gray["120"]};
|
|
1062
1070
|
`}
|
|
1063
1071
|
|
|
1064
1072
|
&::placeholder {
|
|
1065
|
-
color: ${({ theme:
|
|
1073
|
+
color: ${({ theme: theme3 }) => theme3.colors.palettes.transparency["30"]};
|
|
1066
1074
|
}
|
|
1067
1075
|
|
|
1068
1076
|
/* Remove number input arrows */
|
|
@@ -1084,14 +1092,14 @@ var init_NumberInput = __esm({
|
|
|
1084
1092
|
border-left: 1px solid;
|
|
1085
1093
|
flex-shrink: 0;
|
|
1086
1094
|
|
|
1087
|
-
${({ $disabled, $alert, theme:
|
|
1095
|
+
${({ $disabled, $alert, theme: theme3 }) => {
|
|
1088
1096
|
if ($disabled) {
|
|
1089
|
-
return `border-color: ${
|
|
1097
|
+
return `border-color: ${theme3.colors.palettes.transparency["10"]};`;
|
|
1090
1098
|
}
|
|
1091
1099
|
if ($alert) {
|
|
1092
|
-
return `border-color: ${
|
|
1100
|
+
return `border-color: ${theme3.colors.palettes.red["6"]};`;
|
|
1093
1101
|
}
|
|
1094
|
-
return `border-color: ${
|
|
1102
|
+
return `border-color: ${theme3.colors.palettes.transparency["10"]};`;
|
|
1095
1103
|
}}
|
|
1096
1104
|
`;
|
|
1097
1105
|
StepButton = exports.styled.button`
|
|
@@ -1107,16 +1115,16 @@ var init_NumberInput = __esm({
|
|
|
1107
1115
|
min-height: 0;
|
|
1108
1116
|
overflow: hidden;
|
|
1109
1117
|
|
|
1110
|
-
${({ $position, $alert, $disabled, theme:
|
|
1118
|
+
${({ $position, $alert, $disabled, theme: theme3 }) => {
|
|
1111
1119
|
if ($position === "up") {
|
|
1112
1120
|
return `
|
|
1113
|
-
border-bottom: 1px solid ${$disabled ?
|
|
1121
|
+
border-bottom: 1px solid ${$disabled ? theme3.colors.palettes.transparency["10"] : $alert ? theme3.colors.palettes.red["6"] : theme3.colors.palettes.transparency["10"]};
|
|
1114
1122
|
`;
|
|
1115
1123
|
}
|
|
1116
1124
|
return "";
|
|
1117
1125
|
}}
|
|
1118
1126
|
|
|
1119
|
-
${({ $disabled, theme:
|
|
1127
|
+
${({ $disabled, theme: theme3 }) => {
|
|
1120
1128
|
if ($disabled) {
|
|
1121
1129
|
return `
|
|
1122
1130
|
cursor: not-allowed;
|
|
@@ -1125,11 +1133,11 @@ var init_NumberInput = __esm({
|
|
|
1125
1133
|
}
|
|
1126
1134
|
return `
|
|
1127
1135
|
&:hover {
|
|
1128
|
-
background-color: ${
|
|
1136
|
+
background-color: ${theme3.colors.palettes.transparency["5"]};
|
|
1129
1137
|
}
|
|
1130
1138
|
|
|
1131
1139
|
&:active {
|
|
1132
|
-
background-color: ${
|
|
1140
|
+
background-color: ${theme3.colors.palettes.transparency["10"]};
|
|
1133
1141
|
}
|
|
1134
1142
|
`;
|
|
1135
1143
|
}}
|
|
@@ -1137,7 +1145,7 @@ var init_NumberInput = __esm({
|
|
|
1137
1145
|
svg {
|
|
1138
1146
|
width: 14px;
|
|
1139
1147
|
height: 14px;
|
|
1140
|
-
fill: ${({ $disabled, theme:
|
|
1148
|
+
fill: ${({ $disabled, theme: theme3 }) => $disabled ? theme3.colors.palettes.transparency["30"] : theme3.colors.palettes.gray["120"]};
|
|
1141
1149
|
}
|
|
1142
1150
|
`;
|
|
1143
1151
|
UpArrow = () => /* @__PURE__ */ React3__default.default.createElement("svg", { viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React3__default.default.createElement("path", { d: "M7 4.5L10.5 8.5H3.5L7 4.5Z", fill: "currentColor" }));
|
|
@@ -1405,8 +1413,8 @@ var SwitchContainer = exports.styled.label`
|
|
|
1405
1413
|
display: inline-block;
|
|
1406
1414
|
cursor: ${({ $disabled }) => $disabled ? "not-allowed" : "pointer"};
|
|
1407
1415
|
|
|
1408
|
-
${({ $size, theme:
|
|
1409
|
-
const sizeConfig =
|
|
1416
|
+
${({ $size, theme: theme3 }) => {
|
|
1417
|
+
const sizeConfig = theme3.components.switch[$size];
|
|
1410
1418
|
return `
|
|
1411
1419
|
width: ${sizeConfig.container.width};
|
|
1412
1420
|
height: ${sizeConfig.container.height};
|
|
@@ -1426,10 +1434,10 @@ var Track = exports.styled.div`
|
|
|
1426
1434
|
top: 50%;
|
|
1427
1435
|
left: 50%;
|
|
1428
1436
|
transform: translate(-50%, -50%);
|
|
1429
|
-
transition: ${({ theme:
|
|
1437
|
+
transition: ${({ theme: theme3 }) => theme3.components.switch.transition || "all 0.2s ease"};
|
|
1430
1438
|
|
|
1431
|
-
${({ $size, theme:
|
|
1432
|
-
const sizeConfig =
|
|
1439
|
+
${({ $size, theme: theme3 }) => {
|
|
1440
|
+
const sizeConfig = theme3.components.switch[$size];
|
|
1433
1441
|
return `
|
|
1434
1442
|
border-radius: ${sizeConfig.track.borderRadius};
|
|
1435
1443
|
width: ${sizeConfig.track.width};
|
|
@@ -1437,8 +1445,8 @@ var Track = exports.styled.div`
|
|
|
1437
1445
|
`;
|
|
1438
1446
|
}}
|
|
1439
1447
|
|
|
1440
|
-
${({ $checked, $disabled, theme:
|
|
1441
|
-
const stateConfig = $checked ?
|
|
1448
|
+
${({ $checked, $disabled, theme: theme3 }) => {
|
|
1449
|
+
const stateConfig = $checked ? theme3.components.switch.on : theme3.components.switch.off;
|
|
1442
1450
|
if ($disabled) {
|
|
1443
1451
|
return `
|
|
1444
1452
|
background: ${stateConfig.track.backgroundDisabled};
|
|
@@ -1451,9 +1459,9 @@ var Track = exports.styled.div`
|
|
|
1451
1459
|
`;
|
|
1452
1460
|
}}
|
|
1453
1461
|
|
|
1454
|
-
${({ $disabled, $checked, theme:
|
|
1462
|
+
${({ $disabled, $checked, theme: theme3 }) => {
|
|
1455
1463
|
if ($disabled) return "";
|
|
1456
|
-
const stateConfig = $checked ?
|
|
1464
|
+
const stateConfig = $checked ? theme3.components.switch.on : theme3.components.switch.off;
|
|
1457
1465
|
return `
|
|
1458
1466
|
:hover {
|
|
1459
1467
|
background: ${stateConfig.track.backgroundHover};
|
|
@@ -1465,28 +1473,33 @@ var Track = exports.styled.div`
|
|
|
1465
1473
|
var Thumb = exports.styled.div`
|
|
1466
1474
|
position: absolute;
|
|
1467
1475
|
top: 50%;
|
|
1468
|
-
transform: translateY(-50%);
|
|
1469
1476
|
border-style: solid;
|
|
1470
1477
|
box-sizing: border-box;
|
|
1471
|
-
|
|
1478
|
+
left: 0;
|
|
1479
|
+
transition: ${({ theme: theme3 }) => theme3.components.switch.transition || "all 0.2s ease"};
|
|
1472
1480
|
|
|
1473
|
-
${({ $size, $checked, theme:
|
|
1474
|
-
const sizeConfig =
|
|
1481
|
+
${({ $size, $checked, theme: theme3 }) => {
|
|
1482
|
+
const sizeConfig = theme3.components.switch[$size];
|
|
1475
1483
|
const thumbSize = sizeConfig.thumb.size;
|
|
1476
1484
|
const thumbOffset = sizeConfig.thumb.offset;
|
|
1477
1485
|
const thumbBorderRadius = sizeConfig.thumb.borderRadius;
|
|
1478
1486
|
const thumbBorderWidth = sizeConfig.thumb.borderWidth;
|
|
1487
|
+
const trackWidth = sizeConfig.container.width;
|
|
1488
|
+
const thumbSizeNum = parseFloat(thumbSize);
|
|
1489
|
+
const offsetNum = parseFloat(thumbOffset);
|
|
1490
|
+
const trackWidthNum = parseFloat(trackWidth);
|
|
1491
|
+
const leftPosition = $checked ? `${trackWidthNum - thumbSizeNum - offsetNum}px` : thumbOffset;
|
|
1479
1492
|
return `
|
|
1480
1493
|
width: ${thumbSize};
|
|
1481
1494
|
height: ${thumbSize};
|
|
1482
1495
|
border-radius: ${thumbBorderRadius};
|
|
1483
1496
|
border-width: ${thumbBorderWidth};
|
|
1484
|
-
|
|
1497
|
+
transform: translate(${leftPosition}, -50%);
|
|
1485
1498
|
`;
|
|
1486
1499
|
}}
|
|
1487
1500
|
|
|
1488
|
-
${({ $checked, $disabled, theme:
|
|
1489
|
-
const stateConfig = $checked ?
|
|
1501
|
+
${({ $checked, $disabled, theme: theme3 }) => {
|
|
1502
|
+
const stateConfig = $checked ? theme3.components.switch.on : theme3.components.switch.off;
|
|
1490
1503
|
if ($disabled) {
|
|
1491
1504
|
return `
|
|
1492
1505
|
background: ${stateConfig.thumb.backgroundDisabled};
|
|
@@ -1501,9 +1514,9 @@ var Thumb = exports.styled.div`
|
|
|
1501
1514
|
`;
|
|
1502
1515
|
}}
|
|
1503
1516
|
|
|
1504
|
-
${({ $disabled, $checked, theme:
|
|
1517
|
+
${({ $disabled, $checked, theme: theme3 }) => {
|
|
1505
1518
|
if ($disabled) return "";
|
|
1506
|
-
const stateConfig = $checked ?
|
|
1519
|
+
const stateConfig = $checked ? theme3.components.switch.on : theme3.components.switch.off;
|
|
1507
1520
|
return `
|
|
1508
1521
|
:hover & {
|
|
1509
1522
|
background: ${stateConfig.thumb.backgroundHover};
|
|
@@ -1593,8 +1606,8 @@ var RadioContainer = exports.styled.label`
|
|
|
1593
1606
|
display: inline-block;
|
|
1594
1607
|
cursor: ${({ $disabled }) => $disabled ? "not-allowed" : "pointer"};
|
|
1595
1608
|
|
|
1596
|
-
${({ theme:
|
|
1597
|
-
const sizeConfig =
|
|
1609
|
+
${({ theme: theme3 }) => {
|
|
1610
|
+
const sizeConfig = theme3.components.radio.small;
|
|
1598
1611
|
return `
|
|
1599
1612
|
width: ${sizeConfig.size};
|
|
1600
1613
|
height: ${sizeConfig.size};
|
|
@@ -1615,31 +1628,31 @@ var RadioOuter = exports.styled.div`
|
|
|
1615
1628
|
border: 1px solid;
|
|
1616
1629
|
transition: all 0.2s ease;
|
|
1617
1630
|
|
|
1618
|
-
${({ $checked, $disabled, theme:
|
|
1631
|
+
${({ $checked, $disabled, theme: theme3 }) => {
|
|
1619
1632
|
if ($disabled) {
|
|
1620
|
-
const stateConfig = $checked ?
|
|
1633
|
+
const stateConfig = $checked ? theme3.components.radio.checked : theme3.components.radio.unchecked;
|
|
1621
1634
|
return `
|
|
1622
1635
|
background: ${stateConfig.backgroundDisabled};
|
|
1623
1636
|
border-color: ${stateConfig.borderColorDisabled};
|
|
1624
1637
|
`;
|
|
1625
1638
|
}
|
|
1626
1639
|
if ($checked) {
|
|
1627
|
-
const checkedConfig =
|
|
1640
|
+
const checkedConfig = theme3.components.radio.checked;
|
|
1628
1641
|
return `
|
|
1629
1642
|
background: ${checkedConfig.background};
|
|
1630
1643
|
border-color: ${checkedConfig.borderColor};
|
|
1631
1644
|
`;
|
|
1632
1645
|
}
|
|
1633
|
-
const uncheckedConfig =
|
|
1646
|
+
const uncheckedConfig = theme3.components.radio.unchecked;
|
|
1634
1647
|
return `
|
|
1635
1648
|
background: ${uncheckedConfig.background};
|
|
1636
1649
|
border-color: ${uncheckedConfig.borderColor};
|
|
1637
1650
|
`;
|
|
1638
1651
|
}}
|
|
1639
1652
|
|
|
1640
|
-
${({ $disabled, $checked, theme:
|
|
1653
|
+
${({ $disabled, $checked, theme: theme3 }) => {
|
|
1641
1654
|
if ($disabled) return "";
|
|
1642
|
-
const stateConfig = $checked ?
|
|
1655
|
+
const stateConfig = $checked ? theme3.components.radio.checked : theme3.components.radio.unchecked;
|
|
1643
1656
|
return `
|
|
1644
1657
|
${RadioContainer}:hover & {
|
|
1645
1658
|
background: ${stateConfig.backgroundHover};
|
|
@@ -1662,8 +1675,8 @@ var RadioInner = exports.styled.div`
|
|
|
1662
1675
|
opacity: ${({ $checked }) => $checked ? 1 : 0};
|
|
1663
1676
|
transition: opacity 0.2s ease;
|
|
1664
1677
|
|
|
1665
|
-
${({ theme:
|
|
1666
|
-
const dotSize =
|
|
1678
|
+
${({ theme: theme3 }) => {
|
|
1679
|
+
const dotSize = theme3.components.radio.small.dotSize;
|
|
1667
1680
|
return `
|
|
1668
1681
|
width: ${dotSize};
|
|
1669
1682
|
height: ${dotSize};
|
|
@@ -1750,8 +1763,8 @@ var CheckboxContainer = exports.styled.label`
|
|
|
1750
1763
|
display: inline-block;
|
|
1751
1764
|
cursor: ${({ $disabled }) => $disabled ? "not-allowed" : "pointer"};
|
|
1752
1765
|
|
|
1753
|
-
${({ theme:
|
|
1754
|
-
const sizeConfig =
|
|
1766
|
+
${({ theme: theme3 }) => {
|
|
1767
|
+
const sizeConfig = theme3.components.checkbox.small;
|
|
1755
1768
|
return `
|
|
1756
1769
|
width: ${sizeConfig.size};
|
|
1757
1770
|
height: ${sizeConfig.size};
|
|
@@ -1771,45 +1784,45 @@ var CheckboxBox = exports.styled.div`
|
|
|
1771
1784
|
border: 1px solid;
|
|
1772
1785
|
transition: all 0.2s ease;
|
|
1773
1786
|
|
|
1774
|
-
${({ theme:
|
|
1775
|
-
const sizeConfig =
|
|
1787
|
+
${({ theme: theme3 }) => {
|
|
1788
|
+
const sizeConfig = theme3.components.checkbox.small;
|
|
1776
1789
|
return `
|
|
1777
1790
|
border-radius: ${sizeConfig.borderRadius};
|
|
1778
1791
|
`;
|
|
1779
1792
|
}}
|
|
1780
1793
|
|
|
1781
|
-
${({ $checked, $indeterminate, $disabled, theme:
|
|
1794
|
+
${({ $checked, $indeterminate, $disabled, theme: theme3 }) => {
|
|
1782
1795
|
if ($disabled) {
|
|
1783
|
-
const stateConfig = $checked || $indeterminate ?
|
|
1796
|
+
const stateConfig = $checked || $indeterminate ? theme3.components.checkbox.checked : theme3.components.checkbox.unchecked;
|
|
1784
1797
|
return `
|
|
1785
1798
|
background: ${stateConfig.backgroundDisabled};
|
|
1786
1799
|
border-color: ${stateConfig.borderColorDisabled};
|
|
1787
1800
|
`;
|
|
1788
1801
|
}
|
|
1789
1802
|
if ($checked) {
|
|
1790
|
-
const checkedConfig =
|
|
1803
|
+
const checkedConfig = theme3.components.checkbox.checked;
|
|
1791
1804
|
return `
|
|
1792
1805
|
background: ${checkedConfig.background};
|
|
1793
1806
|
border-color: ${checkedConfig.borderColor};
|
|
1794
1807
|
`;
|
|
1795
1808
|
}
|
|
1796
1809
|
if ($indeterminate) {
|
|
1797
|
-
const indeterminateConfig =
|
|
1810
|
+
const indeterminateConfig = theme3.components.checkbox.indeterminate;
|
|
1798
1811
|
return `
|
|
1799
1812
|
background: ${indeterminateConfig.background};
|
|
1800
1813
|
border-color: ${indeterminateConfig.borderColor};
|
|
1801
1814
|
`;
|
|
1802
1815
|
}
|
|
1803
|
-
const uncheckedConfig =
|
|
1816
|
+
const uncheckedConfig = theme3.components.checkbox.unchecked;
|
|
1804
1817
|
return `
|
|
1805
1818
|
background: ${uncheckedConfig.background};
|
|
1806
1819
|
border-color: ${uncheckedConfig.borderColor};
|
|
1807
1820
|
`;
|
|
1808
1821
|
}}
|
|
1809
1822
|
|
|
1810
|
-
${({ $disabled, $checked, $indeterminate, theme:
|
|
1823
|
+
${({ $disabled, $checked, $indeterminate, theme: theme3 }) => {
|
|
1811
1824
|
if ($disabled) return "";
|
|
1812
|
-
const stateConfig = $checked || $indeterminate ?
|
|
1825
|
+
const stateConfig = $checked || $indeterminate ? theme3.components.checkbox.checked : theme3.components.checkbox.unchecked;
|
|
1813
1826
|
return `
|
|
1814
1827
|
${CheckboxContainer}:hover & {
|
|
1815
1828
|
background: ${stateConfig.backgroundHover};
|
|
@@ -1834,8 +1847,8 @@ var IconWrapper3 = exports.styled.div`
|
|
|
1834
1847
|
align-items: center;
|
|
1835
1848
|
justify-content: center;
|
|
1836
1849
|
|
|
1837
|
-
${({ theme:
|
|
1838
|
-
const iconSize =
|
|
1850
|
+
${({ theme: theme3 }) => {
|
|
1851
|
+
const iconSize = theme3.components.checkbox.small.iconSize;
|
|
1839
1852
|
return `
|
|
1840
1853
|
width: ${iconSize.width};
|
|
1841
1854
|
height: ${iconSize.height};
|
|
@@ -1933,28 +1946,51 @@ init_Slider2();
|
|
|
1933
1946
|
|
|
1934
1947
|
// src/Input/Input.tsx
|
|
1935
1948
|
init_styled();
|
|
1949
|
+
var InputContainer = exports.styled.div`
|
|
1950
|
+
display: inline-flex;
|
|
1951
|
+
flex-direction: column;
|
|
1952
|
+
width: 100%;
|
|
1953
|
+
box-sizing: border-box;
|
|
1954
|
+
position: relative;
|
|
1955
|
+
|
|
1956
|
+
${({ $size, $lineType, theme: theme3 }) => {
|
|
1957
|
+
const size = $size || "medium";
|
|
1958
|
+
const typeConfig = $lineType === "underlined" ? theme3.components?.input?.underlined : theme3.components?.input?.outlined;
|
|
1959
|
+
const sizeConfig = typeConfig?.[size];
|
|
1960
|
+
if (!sizeConfig) return "";
|
|
1961
|
+
return `
|
|
1962
|
+
height: ${sizeConfig.height};
|
|
1963
|
+
`;
|
|
1964
|
+
}}
|
|
1965
|
+
`;
|
|
1936
1966
|
var InputWrapper2 = exports.styled.div`
|
|
1937
1967
|
display: inline-flex;
|
|
1938
1968
|
align-items: center;
|
|
1939
1969
|
width: 100%;
|
|
1940
1970
|
box-sizing: border-box;
|
|
1941
1971
|
position: relative;
|
|
1972
|
+
flex: 1;
|
|
1942
1973
|
transition: all 0.2s ease;
|
|
1943
1974
|
|
|
1944
|
-
${({ $size, theme:
|
|
1975
|
+
${({ $size, $lineType, theme: theme3 }) => {
|
|
1945
1976
|
const size = $size || "medium";
|
|
1946
|
-
const
|
|
1977
|
+
const typeConfig = $lineType === "underlined" ? theme3.components?.input?.underlined : theme3.components?.input?.outlined;
|
|
1978
|
+
const sizeConfig = typeConfig?.[size];
|
|
1979
|
+
if (!sizeConfig) return "";
|
|
1947
1980
|
return `
|
|
1948
1981
|
height: ${sizeConfig.height};
|
|
1949
|
-
border-radius: ${sizeConfig.borderRadius};
|
|
1950
1982
|
padding: ${sizeConfig.padding};
|
|
1951
|
-
|
|
1952
|
-
|
|
1983
|
+
gap: ${sizeConfig.gap || "4px"};
|
|
1984
|
+
${$lineType === "outlined" ? `
|
|
1985
|
+
border-radius: ${sizeConfig.borderRadius};
|
|
1986
|
+
` : ""}
|
|
1953
1987
|
`;
|
|
1954
1988
|
}}
|
|
1955
1989
|
|
|
1956
|
-
${({ $error, $disabled, $readOnly, $isFocused, theme:
|
|
1957
|
-
const
|
|
1990
|
+
${({ $error, $disabled, $readOnly, $isFocused, $lineType, theme: theme3, $size }) => {
|
|
1991
|
+
const typeConfig = $lineType === "underlined" ? theme3.components?.input?.underlined : theme3.components?.input?.outlined;
|
|
1992
|
+
const stateConfig = typeConfig?.state;
|
|
1993
|
+
if (!stateConfig) return "";
|
|
1958
1994
|
let borderColor = stateConfig.borderColor;
|
|
1959
1995
|
let background = stateConfig.background;
|
|
1960
1996
|
let boxShadow = "none";
|
|
@@ -1962,36 +1998,69 @@ var InputWrapper2 = exports.styled.div`
|
|
|
1962
1998
|
borderColor = stateConfig.borderColorDisabled;
|
|
1963
1999
|
background = stateConfig.backgroundDisabled;
|
|
1964
2000
|
} else if ($readOnly) {
|
|
1965
|
-
borderColor = stateConfig.borderColorReadonly;
|
|
1966
|
-
background = stateConfig.backgroundReadonly;
|
|
2001
|
+
borderColor = stateConfig.borderColorReadonly || stateConfig.borderColor;
|
|
2002
|
+
background = stateConfig.backgroundReadonly || stateConfig.background;
|
|
1967
2003
|
} else if ($error) {
|
|
1968
2004
|
borderColor = stateConfig.borderColorError;
|
|
1969
|
-
background = stateConfig.backgroundActive;
|
|
2005
|
+
background = $lineType === "outlined" ? stateConfig.backgroundActive : stateConfig.background;
|
|
1970
2006
|
} else if ($isFocused) {
|
|
1971
2007
|
borderColor = stateConfig.borderColorActive;
|
|
1972
2008
|
background = stateConfig.backgroundActive;
|
|
1973
|
-
|
|
1974
|
-
|
|
2009
|
+
if ($lineType === "outlined") {
|
|
2010
|
+
const size = $size || "medium";
|
|
2011
|
+
const sizeConfig = typeConfig?.[size];
|
|
2012
|
+
boxShadow = sizeConfig?.boxShadowActive || "none";
|
|
2013
|
+
}
|
|
1975
2014
|
}
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
2015
|
+
if ($lineType === "outlined") {
|
|
2016
|
+
return `
|
|
2017
|
+
border: 1px solid ${borderColor};
|
|
2018
|
+
background: ${background};
|
|
2019
|
+
box-shadow: ${boxShadow};
|
|
1980
2020
|
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
2021
|
+
&:hover:not(:disabled) {
|
|
2022
|
+
${!$disabled && !$readOnly && !$isFocused ? `
|
|
2023
|
+
border-color: ${stateConfig.borderColorHover};
|
|
2024
|
+
background: ${stateConfig.backgroundHover};
|
|
2025
|
+
` : ""}
|
|
2026
|
+
}
|
|
2027
|
+
`;
|
|
2028
|
+
} else {
|
|
2029
|
+
return `
|
|
2030
|
+
background: ${background};
|
|
2031
|
+
border-bottom: 1px solid ${$error ? borderColor : $isFocused ? borderColor : "transparent"};
|
|
2032
|
+
|
|
2033
|
+
&:hover:not(:disabled) {
|
|
2034
|
+
${!$disabled && !$isFocused && !$error ? `
|
|
2035
|
+
border-bottom-color: ${stateConfig.borderColorHover};
|
|
2036
|
+
` : ""}
|
|
2037
|
+
}
|
|
2038
|
+
`;
|
|
2039
|
+
}
|
|
1988
2040
|
}}
|
|
1989
2041
|
|
|
1990
2042
|
${({ $disabled }) => $disabled && `
|
|
1991
2043
|
cursor: not-allowed;
|
|
1992
|
-
opacity: 1;
|
|
2044
|
+
opacity: ${$disabled ? "0.6" : "1"};
|
|
1993
2045
|
`}
|
|
1994
2046
|
`;
|
|
2047
|
+
var ContentBlock = exports.styled.div`
|
|
2048
|
+
display: flex;
|
|
2049
|
+
align-items: center;
|
|
2050
|
+
flex: 1;
|
|
2051
|
+
min-width: 0;
|
|
2052
|
+
|
|
2053
|
+
${({ $size, $lineType, theme: theme3 }) => {
|
|
2054
|
+
const size = $size || "medium";
|
|
2055
|
+
const typeConfig = $lineType === "underlined" ? theme3.components?.input?.underlined : theme3.components?.input?.outlined;
|
|
2056
|
+
const sizeConfig = typeConfig?.[size];
|
|
2057
|
+
if (!sizeConfig) return "";
|
|
2058
|
+
return `
|
|
2059
|
+
padding: ${sizeConfig.contentPadding || "0"};
|
|
2060
|
+
gap: ${sizeConfig.gap || "4px"};
|
|
2061
|
+
`;
|
|
2062
|
+
}}
|
|
2063
|
+
`;
|
|
1995
2064
|
var StyledInput2 = exports.styled.input`
|
|
1996
2065
|
flex: 1;
|
|
1997
2066
|
border: none;
|
|
@@ -2001,24 +2070,31 @@ var StyledInput2 = exports.styled.input`
|
|
|
2001
2070
|
padding: 0;
|
|
2002
2071
|
margin: 0;
|
|
2003
2072
|
font-family: inherit;
|
|
2004
|
-
color: ${({ theme: theme2 }) => theme2.components.input.outlined.state.borderColorActive};
|
|
2005
2073
|
|
|
2006
|
-
${({ $size, theme:
|
|
2074
|
+
${({ $size, $lineType, $disabled, theme: theme3 }) => {
|
|
2007
2075
|
const size = $size || "medium";
|
|
2008
|
-
const
|
|
2076
|
+
const typeConfig = $lineType === "underlined" ? theme3.components?.input?.underlined : theme3.components?.input?.outlined;
|
|
2077
|
+
const sizeConfig = typeConfig?.[size];
|
|
2078
|
+
const stateConfig = typeConfig?.state;
|
|
2079
|
+
if (!sizeConfig || !stateConfig) return "";
|
|
2080
|
+
const textColor = $disabled ? stateConfig.textColorDisabled : stateConfig.textColorNormal;
|
|
2009
2081
|
return `
|
|
2010
2082
|
font-size: ${sizeConfig.fontSize};
|
|
2011
2083
|
line-height: ${sizeConfig.lineHeight};
|
|
2084
|
+
color: ${textColor};
|
|
2012
2085
|
`;
|
|
2013
2086
|
}}
|
|
2014
2087
|
|
|
2015
2088
|
&::placeholder {
|
|
2016
|
-
color: ${({ theme:
|
|
2089
|
+
color: ${({ $isFocused, $lineType, theme: theme3 }) => {
|
|
2090
|
+
const typeConfig = $lineType === "underlined" ? theme3.components?.input?.underlined : theme3.components?.input?.outlined;
|
|
2091
|
+
const stateConfig = typeConfig?.state;
|
|
2092
|
+
return $isFocused ? stateConfig?.placeholderColorHover || "rgba(65, 70, 75, 0.3)" : stateConfig?.placeholderColorNormal || "rgba(65, 70, 75, 0.3)";
|
|
2093
|
+
}};
|
|
2017
2094
|
}
|
|
2018
2095
|
|
|
2019
|
-
${({ $disabled
|
|
2096
|
+
${({ $disabled }) => $disabled && `
|
|
2020
2097
|
cursor: not-allowed;
|
|
2021
|
-
color: ${theme2.colors.palettes.transparency["30"]};
|
|
2022
2098
|
`}
|
|
2023
2099
|
|
|
2024
2100
|
${({ $readOnly }) => $readOnly && `
|
|
@@ -2029,11 +2105,12 @@ var PrefixNode = exports.styled.div`
|
|
|
2029
2105
|
display: inline-flex;
|
|
2030
2106
|
align-items: center;
|
|
2031
2107
|
flex-shrink: 0;
|
|
2032
|
-
margin-right: 4px;
|
|
2033
2108
|
|
|
2034
|
-
${({ $size, theme:
|
|
2109
|
+
${({ $size, $lineType, theme: theme3 }) => {
|
|
2035
2110
|
const size = $size || "medium";
|
|
2036
|
-
const
|
|
2111
|
+
const typeConfig = $lineType === "underlined" ? theme3.components?.input?.underlined : theme3.components?.input?.outlined;
|
|
2112
|
+
const sizeConfig = typeConfig?.[size];
|
|
2113
|
+
if (!sizeConfig) return "";
|
|
2037
2114
|
return `
|
|
2038
2115
|
svg, img {
|
|
2039
2116
|
width: ${sizeConfig.iconSize.width};
|
|
@@ -2046,11 +2123,12 @@ var SuffixNode = exports.styled.div`
|
|
|
2046
2123
|
display: inline-flex;
|
|
2047
2124
|
align-items: center;
|
|
2048
2125
|
flex-shrink: 0;
|
|
2049
|
-
margin-left: 4px;
|
|
2050
2126
|
|
|
2051
|
-
${({ $size, theme:
|
|
2127
|
+
${({ $size, $lineType, theme: theme3 }) => {
|
|
2052
2128
|
const size = $size || "medium";
|
|
2053
|
-
const
|
|
2129
|
+
const typeConfig = $lineType === "underlined" ? theme3.components?.input?.underlined : theme3.components?.input?.outlined;
|
|
2130
|
+
const sizeConfig = typeConfig?.[size];
|
|
2131
|
+
if (!sizeConfig) return "";
|
|
2054
2132
|
return `
|
|
2055
2133
|
svg, img {
|
|
2056
2134
|
width: ${sizeConfig.iconSize.width};
|
|
@@ -2059,21 +2137,87 @@ var SuffixNode = exports.styled.div`
|
|
|
2059
2137
|
`;
|
|
2060
2138
|
}}
|
|
2061
2139
|
`;
|
|
2140
|
+
var ClearButton = exports.styled.button`
|
|
2141
|
+
display: inline-flex;
|
|
2142
|
+
align-items: center;
|
|
2143
|
+
justify-content: center;
|
|
2144
|
+
flex-shrink: 0;
|
|
2145
|
+
border: none;
|
|
2146
|
+
background: transparent;
|
|
2147
|
+
cursor: pointer;
|
|
2148
|
+
padding: 0;
|
|
2149
|
+
margin: 0;
|
|
2150
|
+
outline: none;
|
|
2151
|
+
transition: opacity 0.2s ease;
|
|
2152
|
+
|
|
2153
|
+
${({ $size, $lineType, theme: theme3 }) => {
|
|
2154
|
+
const size = $size || "medium";
|
|
2155
|
+
const typeConfig = $lineType === "underlined" ? theme3.components?.input?.underlined : theme3.components?.input?.outlined;
|
|
2156
|
+
const sizeConfig = typeConfig?.[size];
|
|
2157
|
+
const clearIconSize = sizeConfig?.clearIcon?.size;
|
|
2158
|
+
if (!clearIconSize) return "";
|
|
2159
|
+
return `
|
|
2160
|
+
width: ${clearIconSize.width};
|
|
2161
|
+
height: ${clearIconSize.height};
|
|
2162
|
+
|
|
2163
|
+
svg {
|
|
2164
|
+
width: ${clearIconSize.width};
|
|
2165
|
+
height: ${clearIconSize.height};
|
|
2166
|
+
}
|
|
2167
|
+
`;
|
|
2168
|
+
}}
|
|
2169
|
+
|
|
2170
|
+
&:hover {
|
|
2171
|
+
opacity: 0.7;
|
|
2172
|
+
}
|
|
2173
|
+
|
|
2174
|
+
&:active {
|
|
2175
|
+
opacity: 0.5;
|
|
2176
|
+
}
|
|
2177
|
+
`;
|
|
2178
|
+
var AlertLine = exports.styled.div`
|
|
2179
|
+
position: absolute;
|
|
2180
|
+
bottom: -1px;
|
|
2181
|
+
left: 0;
|
|
2182
|
+
right: 0;
|
|
2183
|
+
height: 1px;
|
|
2184
|
+
background-color: ${({ theme: theme3 }) => theme3.colors?.palettes?.red?.["6"] || "#E95555"};
|
|
2185
|
+
`;
|
|
2186
|
+
var DefaultClearIcon = () => /* @__PURE__ */ React3__default.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ React3__default.default.createElement(
|
|
2187
|
+
"path",
|
|
2188
|
+
{
|
|
2189
|
+
d: "M8.00148 8.56042L11.3306 11.8884L11.8961 11.3226L8.56774 7.99531L11.8641 4.70566L11.299 4.1394L8.00196 7.42971L4.70055 4.12939L4.13495 4.69517L7.4357 7.99483L4.10889 11.3149L4.674 11.8812L8.00148 8.56042Z",
|
|
2190
|
+
fill: "#41464B",
|
|
2191
|
+
fillOpacity: "0.6"
|
|
2192
|
+
}
|
|
2193
|
+
));
|
|
2062
2194
|
var Input = React3.forwardRef(
|
|
2063
2195
|
({
|
|
2196
|
+
lineType = "outlined",
|
|
2064
2197
|
size = "medium",
|
|
2065
2198
|
error = false,
|
|
2066
2199
|
disabled = false,
|
|
2067
2200
|
readOnly = false,
|
|
2068
2201
|
prefixNode,
|
|
2069
2202
|
suffixNode,
|
|
2203
|
+
clearable = false,
|
|
2204
|
+
onClear,
|
|
2205
|
+
clearIcon,
|
|
2070
2206
|
className,
|
|
2071
2207
|
style,
|
|
2072
2208
|
onFocus,
|
|
2073
2209
|
onBlur,
|
|
2210
|
+
value,
|
|
2211
|
+
onChange,
|
|
2074
2212
|
...rest
|
|
2075
2213
|
}, ref) => {
|
|
2076
2214
|
const [isFocused, setIsFocused] = React3.useState(false);
|
|
2215
|
+
const [internalValue, setInternalValue] = React3.useState(
|
|
2216
|
+
value !== void 0 ? value : rest.defaultValue || ""
|
|
2217
|
+
);
|
|
2218
|
+
const isControlled = value !== void 0;
|
|
2219
|
+
const currentValue = isControlled ? value : internalValue;
|
|
2220
|
+
const hasValue = !!currentValue && String(currentValue).length > 0;
|
|
2077
2221
|
const handleFocus = (e) => {
|
|
2078
2222
|
setIsFocused(true);
|
|
2079
2223
|
onFocus?.(e);
|
|
@@ -2082,189 +2226,137 @@ var Input = React3.forwardRef(
|
|
|
2082
2226
|
setIsFocused(false);
|
|
2083
2227
|
onBlur?.(e);
|
|
2084
2228
|
};
|
|
2085
|
-
|
|
2229
|
+
const handleChange = (e) => {
|
|
2230
|
+
if (!isControlled) {
|
|
2231
|
+
setInternalValue(e.target.value);
|
|
2232
|
+
}
|
|
2233
|
+
onChange?.(e);
|
|
2234
|
+
};
|
|
2235
|
+
const handleClear = (e) => {
|
|
2236
|
+
e.preventDefault();
|
|
2237
|
+
e.stopPropagation();
|
|
2238
|
+
if (!isControlled) {
|
|
2239
|
+
setInternalValue("");
|
|
2240
|
+
}
|
|
2241
|
+
if (onChange && ref && "current" in ref && ref.current) {
|
|
2242
|
+
const syntheticEvent = {
|
|
2243
|
+
target: { ...ref.current, value: "" },
|
|
2244
|
+
currentTarget: ref.current
|
|
2245
|
+
};
|
|
2246
|
+
onChange(syntheticEvent);
|
|
2247
|
+
}
|
|
2248
|
+
onClear?.();
|
|
2249
|
+
};
|
|
2250
|
+
const shouldShowClearButton = clearable && hasValue && !disabled && !readOnly;
|
|
2251
|
+
const clearButtonNode = shouldShowClearButton ? /* @__PURE__ */ React3__default.default.createElement(
|
|
2252
|
+
ClearButton,
|
|
2253
|
+
{
|
|
2254
|
+
type: "button",
|
|
2255
|
+
$size: size,
|
|
2256
|
+
$lineType: lineType,
|
|
2257
|
+
onClick: handleClear,
|
|
2258
|
+
"aria-label": "Clear",
|
|
2259
|
+
tabIndex: -1
|
|
2260
|
+
},
|
|
2261
|
+
clearIcon || /* @__PURE__ */ React3__default.default.createElement(DefaultClearIcon, null)
|
|
2262
|
+
) : null;
|
|
2263
|
+
return /* @__PURE__ */ React3__default.default.createElement(InputContainer, { $size: size, $lineType: lineType, className, style }, /* @__PURE__ */ React3__default.default.createElement(
|
|
2086
2264
|
InputWrapper2,
|
|
2087
2265
|
{
|
|
2088
2266
|
$size: size,
|
|
2267
|
+
$lineType: lineType,
|
|
2089
2268
|
$error: error,
|
|
2090
2269
|
$disabled: !!disabled,
|
|
2091
2270
|
$readOnly: !!readOnly,
|
|
2092
|
-
$isFocused: isFocused
|
|
2093
|
-
className,
|
|
2094
|
-
style
|
|
2271
|
+
$isFocused: isFocused
|
|
2095
2272
|
},
|
|
2096
|
-
prefixNode && /* @__PURE__ */ React3__default.default.createElement(PrefixNode, { $size: size }, prefixNode),
|
|
2097
|
-
/* @__PURE__ */ React3__default.default.createElement(
|
|
2273
|
+
prefixNode && /* @__PURE__ */ React3__default.default.createElement(PrefixNode, { $size: size, $lineType: lineType }, prefixNode),
|
|
2274
|
+
/* @__PURE__ */ React3__default.default.createElement(ContentBlock, { $size: size, $lineType: lineType }, /* @__PURE__ */ React3__default.default.createElement(
|
|
2098
2275
|
StyledInput2,
|
|
2099
2276
|
{
|
|
2100
2277
|
ref,
|
|
2101
2278
|
$size: size,
|
|
2279
|
+
$lineType: lineType,
|
|
2102
2280
|
$disabled: !!disabled,
|
|
2103
2281
|
$readOnly: !!readOnly,
|
|
2282
|
+
$isFocused: isFocused,
|
|
2104
2283
|
disabled,
|
|
2105
2284
|
readOnly,
|
|
2285
|
+
value: currentValue,
|
|
2286
|
+
onChange: handleChange,
|
|
2106
2287
|
onFocus: handleFocus,
|
|
2107
2288
|
onBlur: handleBlur,
|
|
2108
2289
|
...rest
|
|
2109
2290
|
}
|
|
2110
|
-
),
|
|
2111
|
-
suffixNode && /* @__PURE__ */ React3__default.default.createElement(SuffixNode, { $size: size }, suffixNode)
|
|
2112
|
-
);
|
|
2291
|
+
), clearButtonNode),
|
|
2292
|
+
suffixNode && /* @__PURE__ */ React3__default.default.createElement(SuffixNode, { $size: size, $lineType: lineType }, suffixNode)
|
|
2293
|
+
), lineType === "underlined" && error && /* @__PURE__ */ React3__default.default.createElement(AlertLine, null));
|
|
2113
2294
|
}
|
|
2114
2295
|
);
|
|
2115
2296
|
Input.displayName = "Input";
|
|
2116
2297
|
|
|
2117
2298
|
// src/Input/SearchInput.tsx
|
|
2118
2299
|
init_styled();
|
|
2300
|
+
init_Icon2();
|
|
2301
|
+
init_context();
|
|
2119
2302
|
var SearchIconWrapper = exports.styled.div`
|
|
2120
2303
|
display: inline-flex;
|
|
2121
2304
|
align-items: center;
|
|
2122
2305
|
justify-content: center;
|
|
2123
2306
|
flex-shrink: 0;
|
|
2124
2307
|
|
|
2125
|
-
${({ $size, theme: theme2 }) => {
|
|
2126
|
-
const sizeConfig = theme2.components.input.outlined[$size === "extraLarge" ? "extraLarge" : "large"];
|
|
2127
|
-
return `
|
|
2128
|
-
width: ${sizeConfig.iconSize.width};
|
|
2129
|
-
height: ${sizeConfig.iconSize.height};
|
|
2130
|
-
`;
|
|
2131
|
-
}}
|
|
2132
|
-
|
|
2133
|
-
svg {
|
|
2134
|
-
width: 100%;
|
|
2135
|
-
height: 100%;
|
|
2136
|
-
color: ${({ theme: theme2 }) => theme2.colors.palettes.transparency["100"]};
|
|
2137
|
-
}
|
|
2138
|
-
`;
|
|
2139
|
-
var ClearButton = exports.styled.button`
|
|
2140
|
-
display: inline-flex;
|
|
2141
|
-
align-items: center;
|
|
2142
|
-
justify-content: center;
|
|
2143
|
-
flex-shrink: 0;
|
|
2144
|
-
border: none;
|
|
2145
|
-
background: transparent;
|
|
2146
|
-
cursor: pointer;
|
|
2147
|
-
padding: 0;
|
|
2148
|
-
margin: 0;
|
|
2149
|
-
outline: none;
|
|
2150
|
-
transition: opacity 0.2s ease;
|
|
2151
|
-
|
|
2152
|
-
${({ $size, theme: theme2 }) => {
|
|
2153
|
-
const sizeConfig = theme2.components.input.outlined[$size === "extraLarge" ? "extraLarge" : "large"];
|
|
2154
|
-
return `
|
|
2155
|
-
width: ${sizeConfig.iconSize.width};
|
|
2156
|
-
height: ${sizeConfig.iconSize.height};
|
|
2157
|
-
`;
|
|
2158
|
-
}}
|
|
2159
|
-
|
|
2160
2308
|
svg {
|
|
2161
2309
|
width: 100%;
|
|
2162
2310
|
height: 100%;
|
|
2163
|
-
color: ${({ theme:
|
|
2164
|
-
}
|
|
2165
|
-
|
|
2166
|
-
&:hover {
|
|
2167
|
-
opacity: 0.7;
|
|
2168
|
-
}
|
|
2169
|
-
|
|
2170
|
-
&:active {
|
|
2171
|
-
opacity: 0.5;
|
|
2311
|
+
color: ${({ theme: theme3 }) => theme3.colors?.palettes?.transparency?.["100"] || "#41464b"};
|
|
2172
2312
|
}
|
|
2173
2313
|
`;
|
|
2174
|
-
var DefaultSearchIcon = () => /* @__PURE__ */ React3__default.default.createElement("svg", {
|
|
2175
|
-
"path",
|
|
2176
|
-
{
|
|
2177
|
-
d: "M7.33333 12.6667C10.2789 12.6667 12.6667 10.2789 12.6667 7.33333C12.6667 4.38781 10.2789 2 7.33333 2C4.38781 2 2 4.38781 2 7.33333C2 10.2789 4.38781 12.6667 7.33333 12.6667Z",
|
|
2178
|
-
stroke: "currentColor",
|
|
2179
|
-
strokeWidth: "1.5",
|
|
2180
|
-
strokeLinecap: "round",
|
|
2181
|
-
strokeLinejoin: "round"
|
|
2182
|
-
}
|
|
2183
|
-
), /* @__PURE__ */ React3__default.default.createElement(
|
|
2184
|
-
"path",
|
|
2185
|
-
{
|
|
2186
|
-
d: "M14 14L11.1 11.1",
|
|
2187
|
-
stroke: "currentColor",
|
|
2188
|
-
strokeWidth: "1.5",
|
|
2189
|
-
strokeLinecap: "round",
|
|
2190
|
-
strokeLinejoin: "round"
|
|
2191
|
-
}
|
|
2192
|
-
));
|
|
2193
|
-
var DefaultCloseIcon = () => /* @__PURE__ */ React3__default.default.createElement("svg", { viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React3__default.default.createElement(
|
|
2194
|
-
"path",
|
|
2195
|
-
{
|
|
2196
|
-
d: "M12 4L4 12",
|
|
2197
|
-
stroke: "currentColor",
|
|
2198
|
-
strokeWidth: "1.5",
|
|
2199
|
-
strokeLinecap: "round",
|
|
2200
|
-
strokeLinejoin: "round"
|
|
2201
|
-
}
|
|
2202
|
-
), /* @__PURE__ */ React3__default.default.createElement(
|
|
2203
|
-
"path",
|
|
2204
|
-
{
|
|
2205
|
-
d: "M4 4L12 12",
|
|
2206
|
-
stroke: "currentColor",
|
|
2207
|
-
strokeWidth: "1.5",
|
|
2208
|
-
strokeLinecap: "round",
|
|
2209
|
-
strokeLinejoin: "round"
|
|
2210
|
-
}
|
|
2211
|
-
));
|
|
2314
|
+
var DefaultSearchIcon = () => /* @__PURE__ */ React3__default.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 18 18", fill: "none" }, /* @__PURE__ */ React3__default.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.92359 14.0468C9.40656 14.0468 10.7664 13.5197 11.826 12.6426L13.0034 13.8199C12.8604 14.2604 12.9638 14.7635 13.3138 15.1134L14.4012 16.2008C14.8981 16.6977 15.7036 16.6977 16.2004 16.2008C16.6973 15.704 16.6973 14.8985 16.2004 14.4017L15.113 13.3143C14.7549 12.9562 14.2364 12.8562 13.7887 13.0143L12.6234 11.849C13.5122 10.7862 14.0471 9.41727 14.0471 7.92343C14.0471 4.54158 11.3055 1.80005 7.92359 1.80005C4.54165 1.80005 1.80005 4.54158 1.80005 7.92343C1.80005 11.3053 4.54165 14.0468 7.92359 14.0468ZM7.92359 12.6968C10.56 12.6968 12.6971 10.5597 12.6971 7.92343C12.6971 5.2872 10.56 3.15005 7.92359 3.15005C5.2872 3.15005 3.15005 5.2872 3.15005 7.92343C3.15005 10.5597 5.2872 12.6968 7.92359 12.6968Z", fill: "#41464B" }));
|
|
2212
2315
|
var SearchInput = React3.forwardRef(
|
|
2213
2316
|
({
|
|
2214
|
-
|
|
2317
|
+
lineType = "outlined",
|
|
2318
|
+
size = "medium",
|
|
2215
2319
|
clearable = true,
|
|
2216
2320
|
onClear,
|
|
2217
2321
|
searchIcon,
|
|
2218
|
-
value,
|
|
2219
|
-
defaultValue,
|
|
2220
|
-
onChange,
|
|
2221
|
-
disabled,
|
|
2222
|
-
readOnly,
|
|
2223
2322
|
...rest
|
|
2224
2323
|
}, ref) => {
|
|
2225
|
-
const
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2324
|
+
const getSearchIconElement = () => {
|
|
2325
|
+
if (searchIcon !== void 0) {
|
|
2326
|
+
if (typeof searchIcon === "string") {
|
|
2327
|
+
return /* @__PURE__ */ React3__default.default.createElement(exports.Icon, { src: searchIcon });
|
|
2328
|
+
}
|
|
2329
|
+
return searchIcon;
|
|
2231
2330
|
}
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
setInternalValue("");
|
|
2331
|
+
const theme3 = exports.getGlobalTheme();
|
|
2332
|
+
const themeIconUrl = theme3?.components?.inputSearch?.searchIcon?.url;
|
|
2333
|
+
if (themeIconUrl) {
|
|
2334
|
+
return /* @__PURE__ */ React3__default.default.createElement(exports.Icon, { src: themeIconUrl });
|
|
2237
2335
|
}
|
|
2238
|
-
|
|
2336
|
+
return /* @__PURE__ */ React3__default.default.createElement(DefaultSearchIcon, null);
|
|
2239
2337
|
};
|
|
2240
|
-
const prefixNode = /* @__PURE__ */ React3__default.default.createElement(SearchIconWrapper,
|
|
2241
|
-
const suffixNode = clearable && currentValue && !disabled && !readOnly ? /* @__PURE__ */ React3__default.default.createElement(
|
|
2242
|
-
ClearButton,
|
|
2243
|
-
{
|
|
2244
|
-
$size: size,
|
|
2245
|
-
onClick: handleClear,
|
|
2246
|
-
type: "button",
|
|
2247
|
-
tabIndex: -1
|
|
2248
|
-
},
|
|
2249
|
-
/* @__PURE__ */ React3__default.default.createElement(DefaultCloseIcon, null)
|
|
2250
|
-
) : null;
|
|
2338
|
+
const prefixNode = /* @__PURE__ */ React3__default.default.createElement(SearchIconWrapper, null, getSearchIconElement());
|
|
2251
2339
|
return /* @__PURE__ */ React3__default.default.createElement(
|
|
2252
2340
|
Input,
|
|
2253
2341
|
{
|
|
2254
2342
|
ref,
|
|
2343
|
+
lineType,
|
|
2255
2344
|
size,
|
|
2256
2345
|
prefixNode,
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
onChange: handleChange,
|
|
2260
|
-
disabled,
|
|
2261
|
-
readOnly,
|
|
2346
|
+
clearable,
|
|
2347
|
+
onClear,
|
|
2262
2348
|
...rest
|
|
2263
2349
|
}
|
|
2264
2350
|
);
|
|
2265
2351
|
}
|
|
2266
2352
|
);
|
|
2267
2353
|
SearchInput.displayName = "SearchInput";
|
|
2354
|
+
var UnderlinedInput = React3.forwardRef(
|
|
2355
|
+
(props, ref) => {
|
|
2356
|
+
return /* @__PURE__ */ React3__default.default.createElement(Input, { ...props, lineType: "underlined", ref });
|
|
2357
|
+
}
|
|
2358
|
+
);
|
|
2359
|
+
UnderlinedInput.displayName = "UnderlinedInput";
|
|
2268
2360
|
|
|
2269
2361
|
// src/index.ts
|
|
2270
2362
|
init_NumberInput2();
|
|
@@ -2289,8 +2381,8 @@ var ToastWrapper2 = exports.styled.div`
|
|
|
2289
2381
|
pointer-events: auto;
|
|
2290
2382
|
}
|
|
2291
2383
|
|
|
2292
|
-
${({ $placement, theme:
|
|
2293
|
-
const offset =
|
|
2384
|
+
${({ $placement, theme: theme3 }) => {
|
|
2385
|
+
const offset = theme3.components?.toast?.offset || { vertical: "24px", horizontal: "24px" };
|
|
2294
2386
|
const vertical = offset.vertical || "24px";
|
|
2295
2387
|
const horizontal = offset.horizontal || "24px";
|
|
2296
2388
|
const styles = {
|
|
@@ -2399,8 +2491,8 @@ var TabList = exports.styled.div`
|
|
|
2399
2491
|
align-items: center;
|
|
2400
2492
|
position: relative;
|
|
2401
2493
|
|
|
2402
|
-
${({ $variant, theme:
|
|
2403
|
-
const variantConfig =
|
|
2494
|
+
${({ $variant, theme: theme3 }) => {
|
|
2495
|
+
const variantConfig = theme3.components.tab[$variant];
|
|
2404
2496
|
return `
|
|
2405
2497
|
gap: ${variantConfig.layout.gap};
|
|
2406
2498
|
`;
|
|
@@ -2427,8 +2519,8 @@ var TabItem = exports.styled.button`
|
|
|
2427
2519
|
position: relative;
|
|
2428
2520
|
white-space: nowrap;
|
|
2429
2521
|
|
|
2430
|
-
${({ theme:
|
|
2431
|
-
const sizeConfig =
|
|
2522
|
+
${({ theme: theme3 }) => {
|
|
2523
|
+
const sizeConfig = theme3.components.tab.large;
|
|
2432
2524
|
return `
|
|
2433
2525
|
height: ${sizeConfig.height};
|
|
2434
2526
|
padding: ${sizeConfig.padding};
|
|
@@ -2439,8 +2531,8 @@ var TabItem = exports.styled.button`
|
|
|
2439
2531
|
`;
|
|
2440
2532
|
}}
|
|
2441
2533
|
|
|
2442
|
-
${({ $variant, $active, $disabled, theme:
|
|
2443
|
-
const variantConfig =
|
|
2534
|
+
${({ $variant, $active, $disabled, theme: theme3 }) => {
|
|
2535
|
+
const variantConfig = theme3.components.tab[$variant];
|
|
2444
2536
|
const itemConfig = variantConfig.item;
|
|
2445
2537
|
if ($disabled) {
|
|
2446
2538
|
return `
|
|
@@ -2463,9 +2555,9 @@ var TabItem = exports.styled.button`
|
|
|
2463
2555
|
`;
|
|
2464
2556
|
}}
|
|
2465
2557
|
|
|
2466
|
-
${({ $variant, $disabled, theme:
|
|
2558
|
+
${({ $variant, $disabled, theme: theme3 }) => {
|
|
2467
2559
|
if ($disabled) return "";
|
|
2468
|
-
const variantConfig =
|
|
2560
|
+
const variantConfig = theme3.components.tab[$variant];
|
|
2469
2561
|
const itemConfig = variantConfig.item;
|
|
2470
2562
|
return `
|
|
2471
2563
|
&:hover {
|
|
@@ -2917,8 +3009,8 @@ var ToolbarButtonContainer = exports.styled.div`
|
|
|
2917
3009
|
transition: border-color 0.15s ease;
|
|
2918
3010
|
box-sizing: border-box;
|
|
2919
3011
|
|
|
2920
|
-
${({ $disabled, $active, theme:
|
|
2921
|
-
const config =
|
|
3012
|
+
${({ $disabled, $active, theme: theme3 }) => {
|
|
3013
|
+
const config = theme3.components.toolbarButton;
|
|
2922
3014
|
if ($disabled) {
|
|
2923
3015
|
return `
|
|
2924
3016
|
border-color: ${config.border.borderColorDisabled};
|
|
@@ -2962,16 +3054,16 @@ var MainButton = exports.styled.button`
|
|
|
2962
3054
|
outline: none;
|
|
2963
3055
|
transition: background-color 0.15s ease;
|
|
2964
3056
|
|
|
2965
|
-
${({ $hasLabel, theme:
|
|
2966
|
-
const config =
|
|
3057
|
+
${({ $hasLabel, theme: theme3 }) => {
|
|
3058
|
+
const config = theme3.components.toolbarButton;
|
|
2967
3059
|
return `
|
|
2968
3060
|
height: ${config.layout.height};
|
|
2969
3061
|
padding: ${$hasLabel ? config.layout.content.padding : config.layout.padding};
|
|
2970
3062
|
`;
|
|
2971
3063
|
}}
|
|
2972
3064
|
|
|
2973
|
-
${({ $disabled, $active, theme:
|
|
2974
|
-
const config =
|
|
3065
|
+
${({ $disabled, $active, theme: theme3 }) => {
|
|
3066
|
+
const config = theme3.components.toolbarButton;
|
|
2975
3067
|
if ($disabled) {
|
|
2976
3068
|
return `
|
|
2977
3069
|
cursor: not-allowed;
|
|
@@ -3002,16 +3094,16 @@ var IconWrapper4 = exports.styled.span`
|
|
|
3002
3094
|
justify-content: center;
|
|
3003
3095
|
flex-shrink: 0;
|
|
3004
3096
|
|
|
3005
|
-
${({ theme:
|
|
3006
|
-
const config =
|
|
3097
|
+
${({ theme: theme3 }) => {
|
|
3098
|
+
const config = theme3.components.toolbarButton;
|
|
3007
3099
|
return `
|
|
3008
3100
|
width: ${config.layout.content.iconSize.width};
|
|
3009
3101
|
height: ${config.layout.content.iconSize.height};
|
|
3010
3102
|
`;
|
|
3011
3103
|
}}
|
|
3012
3104
|
|
|
3013
|
-
${({ $disabled, theme:
|
|
3014
|
-
const config =
|
|
3105
|
+
${({ $disabled, theme: theme3 }) => {
|
|
3106
|
+
const config = theme3.components.toolbarButton;
|
|
3015
3107
|
return $disabled ? `
|
|
3016
3108
|
color: ${config.color.colorDisabled};
|
|
3017
3109
|
` : `
|
|
@@ -3029,8 +3121,8 @@ var LabelText = exports.styled.span`
|
|
|
3029
3121
|
font-family: 'PingFang SC', sans-serif;
|
|
3030
3122
|
white-space: nowrap;
|
|
3031
3123
|
|
|
3032
|
-
${({ theme:
|
|
3033
|
-
const config =
|
|
3124
|
+
${({ theme: theme3 }) => {
|
|
3125
|
+
const config = theme3.components.toolbarButton;
|
|
3034
3126
|
return `
|
|
3035
3127
|
font-size: ${config.typography.fontSize};
|
|
3036
3128
|
font-weight: ${config.typography.fontWeight};
|
|
@@ -3039,8 +3131,8 @@ var LabelText = exports.styled.span`
|
|
|
3039
3131
|
`;
|
|
3040
3132
|
}}
|
|
3041
3133
|
|
|
3042
|
-
${({ $disabled, theme:
|
|
3043
|
-
const config =
|
|
3134
|
+
${({ $disabled, theme: theme3 }) => {
|
|
3135
|
+
const config = theme3.components.toolbarButton;
|
|
3044
3136
|
return $disabled ? `
|
|
3045
3137
|
color: ${config.color.colorDisabled};
|
|
3046
3138
|
` : `
|
|
@@ -3057,16 +3149,16 @@ var DropdownButton = exports.styled.button`
|
|
|
3057
3149
|
border: none;
|
|
3058
3150
|
transition: background-color 0.15s ease;
|
|
3059
3151
|
|
|
3060
|
-
${({ theme:
|
|
3061
|
-
const config =
|
|
3152
|
+
${({ theme: theme3 }) => {
|
|
3153
|
+
const config = theme3.components.toolbarButton;
|
|
3062
3154
|
return `
|
|
3063
3155
|
height: ${config.layout.height};
|
|
3064
3156
|
padding: 5px 0;
|
|
3065
3157
|
`;
|
|
3066
3158
|
}}
|
|
3067
3159
|
|
|
3068
|
-
${({ $disabled, theme:
|
|
3069
|
-
const config =
|
|
3160
|
+
${({ $disabled, theme: theme3 }) => {
|
|
3161
|
+
const config = theme3.components.toolbarButton;
|
|
3070
3162
|
if ($disabled) {
|
|
3071
3163
|
return `
|
|
3072
3164
|
cursor: not-allowed;
|
|
@@ -3092,16 +3184,16 @@ var DropdownArrow = exports.styled.span`
|
|
|
3092
3184
|
justify-content: center;
|
|
3093
3185
|
flex-shrink: 0;
|
|
3094
3186
|
|
|
3095
|
-
${({ theme:
|
|
3096
|
-
const config =
|
|
3187
|
+
${({ theme: theme3 }) => {
|
|
3188
|
+
const config = theme3.components.toolbarButton;
|
|
3097
3189
|
return `
|
|
3098
3190
|
width: ${config.layout.dropdown.iconSize.width};
|
|
3099
3191
|
height: ${config.layout.dropdown.iconSize.height};
|
|
3100
3192
|
`;
|
|
3101
3193
|
}}
|
|
3102
3194
|
|
|
3103
|
-
${({ $disabled, theme:
|
|
3104
|
-
const config =
|
|
3195
|
+
${({ $disabled, theme: theme3 }) => {
|
|
3196
|
+
const config = theme3.components.toolbarButton;
|
|
3105
3197
|
return $disabled ? `
|
|
3106
3198
|
color: ${config.color.colorDisabled};
|
|
3107
3199
|
` : `
|
|
@@ -3116,15 +3208,15 @@ var Divider = exports.styled.div`
|
|
|
3116
3208
|
width: 1px;
|
|
3117
3209
|
transition: background-color 0.15s ease;
|
|
3118
3210
|
|
|
3119
|
-
${({ theme:
|
|
3120
|
-
const config =
|
|
3211
|
+
${({ theme: theme3 }) => {
|
|
3212
|
+
const config = theme3.components.toolbarButton;
|
|
3121
3213
|
return `
|
|
3122
3214
|
height: ${config.layout.height};
|
|
3123
3215
|
`;
|
|
3124
3216
|
}}
|
|
3125
3217
|
|
|
3126
|
-
${({ $disabled, $active, theme:
|
|
3127
|
-
const config =
|
|
3218
|
+
${({ $disabled, $active, theme: theme3 }) => {
|
|
3219
|
+
const config = theme3.components.toolbarButton;
|
|
3128
3220
|
if ($disabled) {
|
|
3129
3221
|
return `
|
|
3130
3222
|
background-color: ${config.border.borderColorDisabled};
|
|
@@ -3252,6 +3344,884 @@ var ToolbarButton = ({
|
|
|
3252
3344
|
};
|
|
3253
3345
|
ToolbarButton.displayName = "ToolbarButton";
|
|
3254
3346
|
|
|
3347
|
+
// src/dropdown/DropdownButton.tsx
|
|
3348
|
+
init_styled();
|
|
3349
|
+
init_Icon2();
|
|
3350
|
+
var DropdownButtonContainer = exports.styled.button`
|
|
3351
|
+
display: inline-flex;
|
|
3352
|
+
align-items: center;
|
|
3353
|
+
cursor: pointer;
|
|
3354
|
+
border: none;
|
|
3355
|
+
outline: none;
|
|
3356
|
+
box-sizing: border-box;
|
|
3357
|
+
transition: all 0.2s ease;
|
|
3358
|
+
font-family: 'PingFang SC', sans-serif;
|
|
3359
|
+
|
|
3360
|
+
${({ $size, theme: theme3 }) => {
|
|
3361
|
+
const config = theme3.components?.dropdownButton;
|
|
3362
|
+
const sizeConfig = config?.size?.[$size];
|
|
3363
|
+
if (!sizeConfig) return "";
|
|
3364
|
+
return `
|
|
3365
|
+
height: ${sizeConfig.height};
|
|
3366
|
+
padding: ${sizeConfig.padding};
|
|
3367
|
+
gap: ${sizeConfig.gap};
|
|
3368
|
+
font-size: ${sizeConfig.fontSize};
|
|
3369
|
+
`;
|
|
3370
|
+
}}
|
|
3371
|
+
|
|
3372
|
+
${({ $variant, $disabled, $error, theme: theme3 }) => {
|
|
3373
|
+
const config = theme3.components?.dropdownButton;
|
|
3374
|
+
if (!config) return "";
|
|
3375
|
+
let background = config.background.normal;
|
|
3376
|
+
if ($disabled) {
|
|
3377
|
+
background = config.background.disabled;
|
|
3378
|
+
}
|
|
3379
|
+
let border = "none";
|
|
3380
|
+
const borderRadius = config.borderRadius || "4px";
|
|
3381
|
+
if ($variant === "framed") {
|
|
3382
|
+
const borderColor = $error ? theme3.colors?.palettes?.red?.["6"] : theme3.colors?.palettes?.transparency?.["10"];
|
|
3383
|
+
border = `1px solid ${borderColor}`;
|
|
3384
|
+
}
|
|
3385
|
+
const color = $disabled ? config.color.disabled : config.color.normal;
|
|
3386
|
+
return `
|
|
3387
|
+
background: ${background};
|
|
3388
|
+
border: ${border};
|
|
3389
|
+
border-radius: ${borderRadius};
|
|
3390
|
+
color: ${color};
|
|
3391
|
+
|
|
3392
|
+
&:hover:not(:disabled) {
|
|
3393
|
+
background: ${config.background.hover};
|
|
3394
|
+
${$variant === "framed" && !$error ? `
|
|
3395
|
+
border-color: ${theme3.colors?.palettes?.transparency?.["20"]};
|
|
3396
|
+
` : ""}
|
|
3397
|
+
}
|
|
3398
|
+
|
|
3399
|
+
&:active:not(:disabled) {
|
|
3400
|
+
background: ${config.background.active};
|
|
3401
|
+
${$variant === "framed" && !$error ? `
|
|
3402
|
+
border-color: ${theme3.colors?.palettes?.transparency?.["30"]};
|
|
3403
|
+
` : ""}
|
|
3404
|
+
}
|
|
3405
|
+
`;
|
|
3406
|
+
}}
|
|
3407
|
+
|
|
3408
|
+
${({ $disabled }) => $disabled && `
|
|
3409
|
+
cursor: not-allowed;
|
|
3410
|
+
`}
|
|
3411
|
+
`;
|
|
3412
|
+
var IconWrapper5 = exports.styled.div`
|
|
3413
|
+
display: flex;
|
|
3414
|
+
align-items: center;
|
|
3415
|
+
justify-content: center;
|
|
3416
|
+
flex-shrink: 0;
|
|
3417
|
+
|
|
3418
|
+
${({ $size, theme: theme3 }) => {
|
|
3419
|
+
const config = theme3.components?.dropdownButton;
|
|
3420
|
+
const sizeConfig = config?.size?.[$size];
|
|
3421
|
+
if (!sizeConfig) return "";
|
|
3422
|
+
return `
|
|
3423
|
+
width: ${sizeConfig.iconSize.width};
|
|
3424
|
+
height: ${sizeConfig.iconSize.height};
|
|
3425
|
+
|
|
3426
|
+
svg, img {
|
|
3427
|
+
width: ${sizeConfig.iconSize.width};
|
|
3428
|
+
height: ${sizeConfig.iconSize.height};
|
|
3429
|
+
}
|
|
3430
|
+
`;
|
|
3431
|
+
}}
|
|
3432
|
+
|
|
3433
|
+
${({ theme: theme3 }) => {
|
|
3434
|
+
const config = theme3.components?.dropdownButton;
|
|
3435
|
+
return `
|
|
3436
|
+
color: ${config?.color?.normal || "#41464b"};
|
|
3437
|
+
`;
|
|
3438
|
+
}}
|
|
3439
|
+
`;
|
|
3440
|
+
var TextContent = exports.styled.div`
|
|
3441
|
+
flex: 1;
|
|
3442
|
+
min-width: 0; /* Important: allows flex item to shrink below content size */
|
|
3443
|
+
overflow: hidden;
|
|
3444
|
+
text-overflow: ellipsis;
|
|
3445
|
+
white-space: nowrap;
|
|
3446
|
+
text-align: left;
|
|
3447
|
+
line-height: 20px;
|
|
3448
|
+
|
|
3449
|
+
${({ $hasValue, $disabled, theme: theme3 }) => {
|
|
3450
|
+
const config = theme3.components?.dropdownButton;
|
|
3451
|
+
const color = $disabled ? config?.color?.disabled : config?.color?.normal;
|
|
3452
|
+
return `
|
|
3453
|
+
color: ${color};
|
|
3454
|
+
${!$hasValue ? `opacity: 0.3;` : ""}
|
|
3455
|
+
`;
|
|
3456
|
+
}}
|
|
3457
|
+
`;
|
|
3458
|
+
var IndicatorWrapper = exports.styled.div`
|
|
3459
|
+
display: flex;
|
|
3460
|
+
align-items: center;
|
|
3461
|
+
justify-content: center;
|
|
3462
|
+
flex-shrink: 0;
|
|
3463
|
+
transition: transform 0.2s ease;
|
|
3464
|
+
|
|
3465
|
+
${({ $size, theme: theme3 }) => {
|
|
3466
|
+
const config = theme3.components?.dropdownButton;
|
|
3467
|
+
const sizeConfig = config?.size?.[$size];
|
|
3468
|
+
if (!sizeConfig) return "";
|
|
3469
|
+
return `
|
|
3470
|
+
width: ${sizeConfig.indicatorSize.width};
|
|
3471
|
+
height: ${sizeConfig.indicatorSize.height};
|
|
3472
|
+
`;
|
|
3473
|
+
}}
|
|
3474
|
+
|
|
3475
|
+
${({ $open, theme: theme3 }) => {
|
|
3476
|
+
const config = theme3.components?.dropdownButton?.indicator;
|
|
3477
|
+
const rotate = config?.rotate || "90deg";
|
|
3478
|
+
return `
|
|
3479
|
+
transform: rotate(${$open ? rotate : 0});
|
|
3480
|
+
`;
|
|
3481
|
+
}}
|
|
3482
|
+
|
|
3483
|
+
${({ $disabled, theme: theme3 }) => {
|
|
3484
|
+
const config = theme3.components?.dropdownButton?.indicator?.opacity;
|
|
3485
|
+
const opacity = $disabled ? config?.disabled || "0.3" : config?.normal || "1";
|
|
3486
|
+
return `
|
|
3487
|
+
opacity: ${opacity};
|
|
3488
|
+
color: ${theme3.components?.dropdownButton?.color?.normal || "#41464b"};
|
|
3489
|
+
`;
|
|
3490
|
+
}}
|
|
3491
|
+
`;
|
|
3492
|
+
var DefaultArrowIcon = () => /* @__PURE__ */ React3__default.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 18 18", fill: "none" }, /* @__PURE__ */ React3__default.default.createElement(
|
|
3493
|
+
"path",
|
|
3494
|
+
{
|
|
3495
|
+
d: "M11.5975 8.81186C11.7113 8.91146 11.7113 9.08854 11.5975 9.18814L7.72713 12.5747C7.56548 12.7161 7.3125 12.6013 7.3125 12.3866L7.3125 5.61344C7.3125 5.39865 7.56548 5.28386 7.72713 5.4253L11.5975 8.81186Z",
|
|
3496
|
+
fill: "#41464B"
|
|
3497
|
+
}
|
|
3498
|
+
));
|
|
3499
|
+
var DropdownButton2 = React3.forwardRef(
|
|
3500
|
+
({
|
|
3501
|
+
variant = "framed",
|
|
3502
|
+
size,
|
|
3503
|
+
value,
|
|
3504
|
+
placeholder = "Select...",
|
|
3505
|
+
icon,
|
|
3506
|
+
indicatorIcon,
|
|
3507
|
+
open = false,
|
|
3508
|
+
disabled = false,
|
|
3509
|
+
error = false,
|
|
3510
|
+
className,
|
|
3511
|
+
style,
|
|
3512
|
+
textStyle,
|
|
3513
|
+
onClick,
|
|
3514
|
+
...rest
|
|
3515
|
+
}, ref) => {
|
|
3516
|
+
const effectiveSize = size || (variant === "framed" ? "large" : "medium");
|
|
3517
|
+
const hasValue = !!value;
|
|
3518
|
+
const getIconElement = () => {
|
|
3519
|
+
if (!icon) return null;
|
|
3520
|
+
if (typeof icon === "string") {
|
|
3521
|
+
return /* @__PURE__ */ React3__default.default.createElement(exports.Icon, { src: icon });
|
|
3522
|
+
}
|
|
3523
|
+
return icon;
|
|
3524
|
+
};
|
|
3525
|
+
const iconElement = getIconElement();
|
|
3526
|
+
return /* @__PURE__ */ React3__default.default.createElement(
|
|
3527
|
+
DropdownButtonContainer,
|
|
3528
|
+
{
|
|
3529
|
+
ref,
|
|
3530
|
+
type: "button",
|
|
3531
|
+
$variant: variant,
|
|
3532
|
+
$size: effectiveSize,
|
|
3533
|
+
$disabled: disabled,
|
|
3534
|
+
$open: open,
|
|
3535
|
+
$error: error,
|
|
3536
|
+
disabled,
|
|
3537
|
+
onClick,
|
|
3538
|
+
className,
|
|
3539
|
+
style,
|
|
3540
|
+
...rest
|
|
3541
|
+
},
|
|
3542
|
+
iconElement && /* @__PURE__ */ React3__default.default.createElement(IconWrapper5, { $size: effectiveSize }, iconElement),
|
|
3543
|
+
/* @__PURE__ */ React3__default.default.createElement(TextContent, { $disabled: disabled, $hasValue: hasValue, style: textStyle }, value || placeholder),
|
|
3544
|
+
/* @__PURE__ */ React3__default.default.createElement(IndicatorWrapper, { $size: effectiveSize, $open: open, $disabled: disabled }, indicatorIcon || /* @__PURE__ */ React3__default.default.createElement(DefaultArrowIcon, null))
|
|
3545
|
+
);
|
|
3546
|
+
}
|
|
3547
|
+
);
|
|
3548
|
+
DropdownButton2.displayName = "DropdownButton";
|
|
3549
|
+
|
|
3550
|
+
// src/dropdown/Menu.tsx
|
|
3551
|
+
init_styled();
|
|
3552
|
+
init_Icon2();
|
|
3553
|
+
var MenuContainer = exports.styled.div`
|
|
3554
|
+
display: flex;
|
|
3555
|
+
flex-direction: column;
|
|
3556
|
+
box-sizing: border-box;
|
|
3557
|
+
min-width: 220px;
|
|
3558
|
+
|
|
3559
|
+
${({ theme: theme3 }) => {
|
|
3560
|
+
const dropdownConfig = theme3.components?.dropdown;
|
|
3561
|
+
const menuConfig = theme3.components?.menu;
|
|
3562
|
+
return `
|
|
3563
|
+
background: ${dropdownConfig?.background || "#fff"};
|
|
3564
|
+
border: ${menuConfig?.border?.width || "1px"} solid ${menuConfig?.border?.color || "rgba(65, 70, 75, 0.1)"};
|
|
3565
|
+
border-radius: ${menuConfig?.border?.radius || "4px"};
|
|
3566
|
+
box-shadow: ${dropdownConfig?.boxShadow || "0 2px 8px rgba(0, 0, 0, 0.15)"};
|
|
3567
|
+
`;
|
|
3568
|
+
}}
|
|
3569
|
+
|
|
3570
|
+
/* Ensure virtual list container has proper width */
|
|
3571
|
+
.rc-virtual-list {
|
|
3572
|
+
width: 100%;
|
|
3573
|
+
}
|
|
3574
|
+
|
|
3575
|
+
.rc-virtual-list-holder {
|
|
3576
|
+
width: 100%;
|
|
3577
|
+
}
|
|
3578
|
+
|
|
3579
|
+
.rc-virtual-list-holder-inner {
|
|
3580
|
+
width: 100%;
|
|
3581
|
+
}
|
|
3582
|
+
`;
|
|
3583
|
+
var SearchBoxContainer = exports.styled.div`
|
|
3584
|
+
padding: 8px 12px;
|
|
3585
|
+
border-bottom: 1px solid ${({ theme: theme3 }) => theme3.colors?.palettes?.transparency?.["10"]};
|
|
3586
|
+
`;
|
|
3587
|
+
var SearchIcon = () => /* @__PURE__ */ React3__default.default.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" }, /* @__PURE__ */ React3__default.default.createElement(
|
|
3588
|
+
"path",
|
|
3589
|
+
{
|
|
3590
|
+
d: "M7.33333 12.6667C10.2789 12.6667 12.6667 10.2789 12.6667 7.33333C12.6667 4.38781 10.2789 2 7.33333 2C4.38781 2 2 4.38781 2 7.33333C2 10.2789 4.38781 12.6667 7.33333 12.6667Z",
|
|
3591
|
+
stroke: "currentColor",
|
|
3592
|
+
strokeWidth: "1.5",
|
|
3593
|
+
strokeLinecap: "round",
|
|
3594
|
+
strokeLinejoin: "round"
|
|
3595
|
+
}
|
|
3596
|
+
), /* @__PURE__ */ React3__default.default.createElement(
|
|
3597
|
+
"path",
|
|
3598
|
+
{
|
|
3599
|
+
d: "M14 14L11.1 11.1",
|
|
3600
|
+
stroke: "currentColor",
|
|
3601
|
+
strokeWidth: "1.5",
|
|
3602
|
+
strokeLinecap: "round",
|
|
3603
|
+
strokeLinejoin: "round"
|
|
3604
|
+
}
|
|
3605
|
+
));
|
|
3606
|
+
var MenuItemContent = exports.styled.div`
|
|
3607
|
+
display: flex;
|
|
3608
|
+
align-items: center;
|
|
3609
|
+
width: 100%;
|
|
3610
|
+
|
|
3611
|
+
${({ theme: theme3 }) => {
|
|
3612
|
+
const config = theme3.components?.menu?.menuItem;
|
|
3613
|
+
return `
|
|
3614
|
+
gap: ${config?.layout?.gap || "8px"};
|
|
3615
|
+
`;
|
|
3616
|
+
}}
|
|
3617
|
+
`;
|
|
3618
|
+
var IconContainer2 = exports.styled.div`
|
|
3619
|
+
display: flex;
|
|
3620
|
+
align-items: center;
|
|
3621
|
+
justify-content: center;
|
|
3622
|
+
flex-shrink: 0;
|
|
3623
|
+
|
|
3624
|
+
${({ theme: theme3 }) => {
|
|
3625
|
+
const iconSize = theme3.components?.menu?.menuItem?.icon?.size;
|
|
3626
|
+
return `
|
|
3627
|
+
width: ${iconSize?.width || "18px"};
|
|
3628
|
+
height: ${iconSize?.height || "18px"};
|
|
3629
|
+
|
|
3630
|
+
svg, img {
|
|
3631
|
+
width: 100%;
|
|
3632
|
+
height: 100%;
|
|
3633
|
+
}
|
|
3634
|
+
`;
|
|
3635
|
+
}}
|
|
3636
|
+
`;
|
|
3637
|
+
var ContentBlock2 = exports.styled.div`
|
|
3638
|
+
display: flex;
|
|
3639
|
+
flex: 1;
|
|
3640
|
+
align-items: center;
|
|
3641
|
+
justify-content: space-between;
|
|
3642
|
+
gap: 16px;
|
|
3643
|
+
min-width: 0;
|
|
3644
|
+
`;
|
|
3645
|
+
var LabelText2 = exports.styled.div`
|
|
3646
|
+
flex: 1;
|
|
3647
|
+
min-width: 0;
|
|
3648
|
+
overflow: hidden;
|
|
3649
|
+
text-overflow: ellipsis;
|
|
3650
|
+
white-space: nowrap;
|
|
3651
|
+
line-height: 20px;
|
|
3652
|
+
|
|
3653
|
+
${({ $size, $disabled, theme: theme3 }) => {
|
|
3654
|
+
const config = theme3.components?.menu?.menuItem;
|
|
3655
|
+
const sizeConfig = config?.size?.[$size];
|
|
3656
|
+
const colorConfig = config?.label?.color;
|
|
3657
|
+
const fontSize = sizeConfig?.label?.fontSize || "13px";
|
|
3658
|
+
const color = $disabled ? colorConfig?.disabled || "rgba(65, 70, 75, 0.3)" : colorConfig?.normal || "#41464b";
|
|
3659
|
+
return `
|
|
3660
|
+
font-size: ${fontSize};
|
|
3661
|
+
color: ${color};
|
|
3662
|
+
`;
|
|
3663
|
+
}}
|
|
3664
|
+
`;
|
|
3665
|
+
var DescriptionText = exports.styled.div`
|
|
3666
|
+
flex: 0 0 auto;
|
|
3667
|
+
white-space: nowrap;
|
|
3668
|
+
line-height: 20px;
|
|
3669
|
+
text-align: right;
|
|
3670
|
+
|
|
3671
|
+
${({ $size, $disabled, theme: theme3 }) => {
|
|
3672
|
+
const config = theme3.components?.menu?.menuItem;
|
|
3673
|
+
const sizeConfig = config?.size?.[$size];
|
|
3674
|
+
const colorConfig = config?.description?.color;
|
|
3675
|
+
const fontSize = sizeConfig?.description?.fontSize || "10px";
|
|
3676
|
+
const color = $disabled ? colorConfig?.disabled || "rgba(65, 70, 75, 0.3)" : colorConfig?.normal || "rgba(65, 70, 75, 0.6)";
|
|
3677
|
+
return `
|
|
3678
|
+
font-size: ${fontSize};
|
|
3679
|
+
color: ${color};
|
|
3680
|
+
`;
|
|
3681
|
+
}}
|
|
3682
|
+
`;
|
|
3683
|
+
var ActiveIconContainer = exports.styled.div`
|
|
3684
|
+
display: flex;
|
|
3685
|
+
align-items: center;
|
|
3686
|
+
justify-content: center;
|
|
3687
|
+
flex-shrink: 0;
|
|
3688
|
+
|
|
3689
|
+
${({ $size, theme: theme3 }) => {
|
|
3690
|
+
const sizeConfig = theme3.components?.menu?.menuItem?.size?.[$size];
|
|
3691
|
+
const iconSize = sizeConfig?.activeIcon?.size;
|
|
3692
|
+
return `
|
|
3693
|
+
width: ${iconSize?.width || "18px"};
|
|
3694
|
+
height: ${iconSize?.height || "18px"};
|
|
3695
|
+
`;
|
|
3696
|
+
}}
|
|
3697
|
+
|
|
3698
|
+
${({ $visible, $placeholder }) => {
|
|
3699
|
+
if (!$visible && !$placeholder) {
|
|
3700
|
+
return "display: none;";
|
|
3701
|
+
}
|
|
3702
|
+
if ($placeholder && !$visible) {
|
|
3703
|
+
return "visibility: hidden;";
|
|
3704
|
+
}
|
|
3705
|
+
return "";
|
|
3706
|
+
}}
|
|
3707
|
+
`;
|
|
3708
|
+
var NextLevelIconContainer = exports.styled.div`
|
|
3709
|
+
display: flex;
|
|
3710
|
+
align-items: center;
|
|
3711
|
+
justify-content: center;
|
|
3712
|
+
flex-shrink: 0;
|
|
3713
|
+
|
|
3714
|
+
${({ $size, theme: theme3 }) => {
|
|
3715
|
+
const sizeConfig = theme3.components?.menu?.menuItem?.size?.[$size];
|
|
3716
|
+
const iconSize = sizeConfig?.nextLevelIcon?.size;
|
|
3717
|
+
return `
|
|
3718
|
+
width: ${iconSize?.width || "18px"};
|
|
3719
|
+
height: ${iconSize?.height || "18px"};
|
|
3720
|
+
`;
|
|
3721
|
+
}}
|
|
3722
|
+
`;
|
|
3723
|
+
var CheckmarkIcon = () => /* @__PURE__ */ React3__default.default.createElement("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none" }, /* @__PURE__ */ React3__default.default.createElement(
|
|
3724
|
+
"path",
|
|
3725
|
+
{
|
|
3726
|
+
d: "M14.25 5.25L7.125 12.375L3.75 9",
|
|
3727
|
+
stroke: "#41464B",
|
|
3728
|
+
strokeWidth: "1.5",
|
|
3729
|
+
strokeLinecap: "round",
|
|
3730
|
+
strokeLinejoin: "round"
|
|
3731
|
+
}
|
|
3732
|
+
));
|
|
3733
|
+
var ArrowIcon2 = () => /* @__PURE__ */ React3__default.default.createElement("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none" }, /* @__PURE__ */ React3__default.default.createElement(
|
|
3734
|
+
"path",
|
|
3735
|
+
{
|
|
3736
|
+
d: "M6.75 4.5L11.25 9L6.75 13.5",
|
|
3737
|
+
stroke: "#41464B",
|
|
3738
|
+
strokeWidth: "1.5",
|
|
3739
|
+
strokeLinecap: "round",
|
|
3740
|
+
strokeLinejoin: "round"
|
|
3741
|
+
}
|
|
3742
|
+
));
|
|
3743
|
+
var Menu = ({
|
|
3744
|
+
items,
|
|
3745
|
+
selectedKeys = [],
|
|
3746
|
+
openKeys,
|
|
3747
|
+
size = "large",
|
|
3748
|
+
searchable = false,
|
|
3749
|
+
searchPlaceholder = "Enter search content",
|
|
3750
|
+
maxHeight = 300,
|
|
3751
|
+
virtual = false,
|
|
3752
|
+
reserveActiveIconSpace = true,
|
|
3753
|
+
onSelect,
|
|
3754
|
+
onSearch,
|
|
3755
|
+
onOpenChange,
|
|
3756
|
+
className,
|
|
3757
|
+
style
|
|
3758
|
+
}) => {
|
|
3759
|
+
const [searchValue, setSearchValue] = React3.useState("");
|
|
3760
|
+
const handleSearch = (value) => {
|
|
3761
|
+
setSearchValue(value);
|
|
3762
|
+
onSearch?.(value);
|
|
3763
|
+
};
|
|
3764
|
+
const filteredItems = React3.useMemo(() => {
|
|
3765
|
+
if (!searchValue) return items;
|
|
3766
|
+
const searchLower = searchValue.toLowerCase();
|
|
3767
|
+
const filterMenuItem = (item) => {
|
|
3768
|
+
if (item.label.toLowerCase().includes(searchLower) || item.description?.toLowerCase().includes(searchLower)) {
|
|
3769
|
+
return item;
|
|
3770
|
+
}
|
|
3771
|
+
if (item.children && item.children.length > 0) {
|
|
3772
|
+
const filteredChildren = item.children.map((child) => filterMenuItem(child)).filter(Boolean);
|
|
3773
|
+
if (filteredChildren.length > 0) {
|
|
3774
|
+
return { ...item, children: filteredChildren };
|
|
3775
|
+
}
|
|
3776
|
+
}
|
|
3777
|
+
return null;
|
|
3778
|
+
};
|
|
3779
|
+
const filterItem = (item) => {
|
|
3780
|
+
if (item.type === "divider") return null;
|
|
3781
|
+
if (item.type === "group") {
|
|
3782
|
+
const filteredChildren = item.children.map((child) => filterMenuItem(child)).filter(Boolean);
|
|
3783
|
+
if (filteredChildren.length > 0) {
|
|
3784
|
+
return { ...item, children: filteredChildren };
|
|
3785
|
+
}
|
|
3786
|
+
return null;
|
|
3787
|
+
}
|
|
3788
|
+
return filterMenuItem(item);
|
|
3789
|
+
};
|
|
3790
|
+
return items.map((item) => filterItem(item)).filter(Boolean);
|
|
3791
|
+
}, [items, searchValue]);
|
|
3792
|
+
const renderMenuItemContent = (item, reserveSpace) => {
|
|
3793
|
+
const isSelected = item.selected || selectedKeys.includes(item.key);
|
|
3794
|
+
const isSelectable = item.selectable !== false;
|
|
3795
|
+
const shouldShowActiveIcon = isSelectable && isSelected;
|
|
3796
|
+
const shouldReserveSpace = reserveSpace || isSelectable;
|
|
3797
|
+
const iconElement = item.icon ? /* @__PURE__ */ React3__default.default.createElement(IconContainer2, { $size: size }, typeof item.icon === "string" ? /* @__PURE__ */ React3__default.default.createElement(exports.Icon, { src: item.icon }) : item.icon) : null;
|
|
3798
|
+
return /* @__PURE__ */ React3__default.default.createElement(MenuItemContent, { $size: size }, iconElement, /* @__PURE__ */ React3__default.default.createElement(ContentBlock2, null, /* @__PURE__ */ React3__default.default.createElement(LabelText2, { $size: size, $disabled: !!item.disabled }, item.label), item.description && /* @__PURE__ */ React3__default.default.createElement(DescriptionText, { $size: size, $disabled: !!item.disabled }, item.description)), /* @__PURE__ */ React3__default.default.createElement(
|
|
3799
|
+
ActiveIconContainer,
|
|
3800
|
+
{
|
|
3801
|
+
$size: size,
|
|
3802
|
+
$visible: shouldShowActiveIcon,
|
|
3803
|
+
$placeholder: shouldReserveSpace && !shouldShowActiveIcon
|
|
3804
|
+
},
|
|
3805
|
+
shouldShowActiveIcon && /* @__PURE__ */ React3__default.default.createElement(CheckmarkIcon, null)
|
|
3806
|
+
), item.children && item.children.length > 0 && /* @__PURE__ */ React3__default.default.createElement(NextLevelIconContainer, { $size: size }, /* @__PURE__ */ React3__default.default.createElement(ArrowIcon2, null)));
|
|
3807
|
+
};
|
|
3808
|
+
const renderItem = (item) => {
|
|
3809
|
+
if (item.type === "divider") {
|
|
3810
|
+
return /* @__PURE__ */ React3__default.default.createElement(RcMenu.Divider, { key: item.key });
|
|
3811
|
+
}
|
|
3812
|
+
if (item.type === "group") {
|
|
3813
|
+
return /* @__PURE__ */ React3__default.default.createElement(RcMenu.ItemGroup, { key: item.key, title: item.label }, item.children.map((child) => renderMenuItem(child)));
|
|
3814
|
+
}
|
|
3815
|
+
return renderMenuItem(item);
|
|
3816
|
+
};
|
|
3817
|
+
const renderMenuItem = (item) => {
|
|
3818
|
+
if (item.children && item.children.length > 0) {
|
|
3819
|
+
return /* @__PURE__ */ React3__default.default.createElement(
|
|
3820
|
+
RcMenu.SubMenu,
|
|
3821
|
+
{
|
|
3822
|
+
key: item.key,
|
|
3823
|
+
title: renderMenuItemContent(item, reserveActiveIconSpace),
|
|
3824
|
+
disabled: item.disabled,
|
|
3825
|
+
popupOffset: [5, 0]
|
|
3826
|
+
},
|
|
3827
|
+
item.children.map((child) => renderMenuItem(child))
|
|
3828
|
+
);
|
|
3829
|
+
}
|
|
3830
|
+
return /* @__PURE__ */ React3__default.default.createElement(
|
|
3831
|
+
RcMenu.MenuItem,
|
|
3832
|
+
{
|
|
3833
|
+
key: item.key,
|
|
3834
|
+
disabled: item.disabled,
|
|
3835
|
+
onClick: () => {
|
|
3836
|
+
item.onClick?.(item.key);
|
|
3837
|
+
onSelect?.(item.key);
|
|
3838
|
+
}
|
|
3839
|
+
},
|
|
3840
|
+
renderMenuItemContent(item, reserveActiveIconSpace)
|
|
3841
|
+
);
|
|
3842
|
+
};
|
|
3843
|
+
const itemHeight = size === "medium" ? 28 : 36;
|
|
3844
|
+
const menuKey = openKeys?.join(",") || "menu";
|
|
3845
|
+
return /* @__PURE__ */ React3__default.default.createElement(MenuContainer, { className, style }, searchable && /* @__PURE__ */ React3__default.default.createElement(SearchBoxContainer, null, /* @__PURE__ */ React3__default.default.createElement(
|
|
3846
|
+
Input,
|
|
3847
|
+
{
|
|
3848
|
+
lineType: "underlined",
|
|
3849
|
+
size: "small",
|
|
3850
|
+
placeholder: searchPlaceholder,
|
|
3851
|
+
value: searchValue,
|
|
3852
|
+
onChange: (e) => handleSearch(e.target.value),
|
|
3853
|
+
clearable: true,
|
|
3854
|
+
onClear: () => handleSearch(""),
|
|
3855
|
+
prefixNode: /* @__PURE__ */ React3__default.default.createElement(SearchIcon, null)
|
|
3856
|
+
}
|
|
3857
|
+
)), virtual && filteredItems.length > 10 ? /* @__PURE__ */ React3__default.default.createElement(
|
|
3858
|
+
VirtualList__default.default,
|
|
3859
|
+
{
|
|
3860
|
+
data: filteredItems,
|
|
3861
|
+
height: maxHeight,
|
|
3862
|
+
itemHeight,
|
|
3863
|
+
itemKey: "key",
|
|
3864
|
+
fullHeight: false,
|
|
3865
|
+
style: { width: "100%" }
|
|
3866
|
+
},
|
|
3867
|
+
(item) => /* @__PURE__ */ React3__default.default.createElement(
|
|
3868
|
+
RcMenu__default.default,
|
|
3869
|
+
{
|
|
3870
|
+
key: menuKey,
|
|
3871
|
+
prefixCls: "od-menu",
|
|
3872
|
+
mode: "vertical",
|
|
3873
|
+
selectedKeys,
|
|
3874
|
+
openKeys,
|
|
3875
|
+
onOpenChange,
|
|
3876
|
+
triggerSubMenuAction: "hover",
|
|
3877
|
+
expandIcon: null,
|
|
3878
|
+
style: {
|
|
3879
|
+
border: "none",
|
|
3880
|
+
background: "transparent",
|
|
3881
|
+
padding: 0
|
|
3882
|
+
}
|
|
3883
|
+
},
|
|
3884
|
+
renderItem(item)
|
|
3885
|
+
)
|
|
3886
|
+
) : /* @__PURE__ */ React3__default.default.createElement(
|
|
3887
|
+
RcMenu__default.default,
|
|
3888
|
+
{
|
|
3889
|
+
key: menuKey,
|
|
3890
|
+
prefixCls: "od-menu",
|
|
3891
|
+
mode: "vertical",
|
|
3892
|
+
selectedKeys,
|
|
3893
|
+
openKeys,
|
|
3894
|
+
onOpenChange,
|
|
3895
|
+
triggerSubMenuAction: "hover",
|
|
3896
|
+
expandIcon: null,
|
|
3897
|
+
style: {
|
|
3898
|
+
border: "none",
|
|
3899
|
+
background: "transparent"
|
|
3900
|
+
}
|
|
3901
|
+
},
|
|
3902
|
+
filteredItems.map(renderItem)
|
|
3903
|
+
));
|
|
3904
|
+
};
|
|
3905
|
+
Menu.displayName = "Menu";
|
|
3906
|
+
var Dropdown = ({
|
|
3907
|
+
overlay,
|
|
3908
|
+
trigger = ["click"],
|
|
3909
|
+
placement = "bottomLeft",
|
|
3910
|
+
visible: controlledVisible,
|
|
3911
|
+
defaultVisible = false,
|
|
3912
|
+
onVisibleChange,
|
|
3913
|
+
children,
|
|
3914
|
+
overlayClassName,
|
|
3915
|
+
getPopupContainer,
|
|
3916
|
+
...rest
|
|
3917
|
+
}) => {
|
|
3918
|
+
const [internalVisible, setInternalVisible] = React3.useState(defaultVisible);
|
|
3919
|
+
const isControlled = controlledVisible !== void 0;
|
|
3920
|
+
const isVisible = isControlled ? controlledVisible : internalVisible;
|
|
3921
|
+
const handleVisibleChange = (visible) => {
|
|
3922
|
+
if (!isControlled) {
|
|
3923
|
+
setInternalVisible(visible);
|
|
3924
|
+
}
|
|
3925
|
+
onVisibleChange?.(visible);
|
|
3926
|
+
};
|
|
3927
|
+
return /* @__PURE__ */ React3__default.default.createElement(
|
|
3928
|
+
RcDropdown__default.default,
|
|
3929
|
+
{
|
|
3930
|
+
overlay: overlay || /* @__PURE__ */ React3__default.default.createElement("div", null),
|
|
3931
|
+
trigger,
|
|
3932
|
+
placement,
|
|
3933
|
+
visible: isVisible,
|
|
3934
|
+
onVisibleChange: handleVisibleChange,
|
|
3935
|
+
prefixCls: "od-dropdown",
|
|
3936
|
+
overlayClassName,
|
|
3937
|
+
getPopupContainer,
|
|
3938
|
+
...rest
|
|
3939
|
+
},
|
|
3940
|
+
children
|
|
3941
|
+
);
|
|
3942
|
+
};
|
|
3943
|
+
Dropdown.displayName = "Dropdown";
|
|
3944
|
+
|
|
3945
|
+
// src/dropdown/globalStyle.ts
|
|
3946
|
+
init_context();
|
|
3947
|
+
var theme2 = exports.getGlobalTheme();
|
|
3948
|
+
var DropdownGlobalStyles = baseStyled.createGlobalStyle`
|
|
3949
|
+
/* Dropdown container */
|
|
3950
|
+
.od-dropdown {
|
|
3951
|
+
position: absolute;
|
|
3952
|
+
z-index: 1050;
|
|
3953
|
+
}
|
|
3954
|
+
|
|
3955
|
+
.od-dropdown-hidden {
|
|
3956
|
+
display: none;
|
|
3957
|
+
}
|
|
3958
|
+
|
|
3959
|
+
/* Dropdown slide animations */
|
|
3960
|
+
.od-dropdown-slide-up-enter,
|
|
3961
|
+
.od-dropdown-slide-up-appear {
|
|
3962
|
+
animation-duration: 0.2s;
|
|
3963
|
+
animation-fill-mode: both;
|
|
3964
|
+
animation-play-state: paused;
|
|
3965
|
+
}
|
|
3966
|
+
|
|
3967
|
+
.od-dropdown-slide-up-leave {
|
|
3968
|
+
animation-duration: 0.2s;
|
|
3969
|
+
animation-fill-mode: both;
|
|
3970
|
+
animation-play-state: paused;
|
|
3971
|
+
}
|
|
3972
|
+
|
|
3973
|
+
.od-dropdown-slide-up-enter.od-dropdown-slide-up-enter-active,
|
|
3974
|
+
.od-dropdown-slide-up-appear.od-dropdown-slide-up-appear-active {
|
|
3975
|
+
animation-name: rcDropdownSlideUpIn;
|
|
3976
|
+
animation-play-state: running;
|
|
3977
|
+
}
|
|
3978
|
+
|
|
3979
|
+
.od-dropdown-slide-up-leave.od-dropdown-slide-up-leave-active {
|
|
3980
|
+
animation-name: rcDropdownSlideUpOut;
|
|
3981
|
+
animation-play-state: running;
|
|
3982
|
+
}
|
|
3983
|
+
|
|
3984
|
+
@keyframes rcDropdownSlideUpIn {
|
|
3985
|
+
0% {
|
|
3986
|
+
opacity: 0;
|
|
3987
|
+
transform: scaleY(0.8);
|
|
3988
|
+
}
|
|
3989
|
+
100% {
|
|
3990
|
+
opacity: 1;
|
|
3991
|
+
transform: scaleY(1);
|
|
3992
|
+
}
|
|
3993
|
+
}
|
|
3994
|
+
|
|
3995
|
+
@keyframes rcDropdownSlideUpOut {
|
|
3996
|
+
0% {
|
|
3997
|
+
opacity: 1;
|
|
3998
|
+
transform: scaleY(1);
|
|
3999
|
+
}
|
|
4000
|
+
100% {
|
|
4001
|
+
opacity: 0;
|
|
4002
|
+
transform: scaleY(0.8);
|
|
4003
|
+
}
|
|
4004
|
+
}
|
|
4005
|
+
`;
|
|
4006
|
+
var MenuGlobalStyles = baseStyled.createGlobalStyle`
|
|
4007
|
+
/* Base menu container */
|
|
4008
|
+
.od-menu {
|
|
4009
|
+
margin: 0;
|
|
4010
|
+
padding: ${() => theme2.components?.dropdown?.padding || "4px 0"};
|
|
4011
|
+
list-style: none;
|
|
4012
|
+
outline: none;
|
|
4013
|
+
box-shadow: none;
|
|
4014
|
+
background: transparent;
|
|
4015
|
+
border: none;
|
|
4016
|
+
}
|
|
4017
|
+
|
|
4018
|
+
.od-menu-hidden {
|
|
4019
|
+
display: none;
|
|
4020
|
+
}
|
|
4021
|
+
|
|
4022
|
+
/* Menu item */
|
|
4023
|
+
.od-menu-item {
|
|
4024
|
+
position: relative;
|
|
4025
|
+
display: flex;
|
|
4026
|
+
align-items: center;
|
|
4027
|
+
margin: 0;
|
|
4028
|
+
cursor: pointer;
|
|
4029
|
+
transition: background-color 0.15s ease;
|
|
4030
|
+
user-select: none;
|
|
4031
|
+
list-style: none;
|
|
4032
|
+
|
|
4033
|
+
${() => {
|
|
4034
|
+
const config = theme2.components?.menu?.menuItem;
|
|
4035
|
+
return `
|
|
4036
|
+
padding: ${config?.layout?.padding || "6px 12px"};
|
|
4037
|
+
background: ${config?.background?.normal || "transparent"};
|
|
4038
|
+
`;
|
|
4039
|
+
}}
|
|
4040
|
+
}
|
|
4041
|
+
|
|
4042
|
+
.od-menu-item:hover {
|
|
4043
|
+
${() => {
|
|
4044
|
+
const config = theme2.components?.menu?.menuItem;
|
|
4045
|
+
return `
|
|
4046
|
+
background: ${config?.background?.hover || "rgba(65, 70, 75, 0.05)"};
|
|
4047
|
+
`;
|
|
4048
|
+
}}
|
|
4049
|
+
}
|
|
4050
|
+
|
|
4051
|
+
.od-menu-item-active,
|
|
4052
|
+
.od-menu-item-selected {
|
|
4053
|
+
${() => {
|
|
4054
|
+
const config = theme2.components?.menu?.menuItem;
|
|
4055
|
+
return `
|
|
4056
|
+
background: ${config?.background?.active || "rgba(65, 70, 75, 0.1)"};
|
|
4057
|
+
`;
|
|
4058
|
+
}}
|
|
4059
|
+
}
|
|
4060
|
+
|
|
4061
|
+
.od-menu-item-disabled {
|
|
4062
|
+
cursor: not-allowed;
|
|
4063
|
+
${() => {
|
|
4064
|
+
const config = theme2.components?.menu?.menuItem;
|
|
4065
|
+
return `
|
|
4066
|
+
background: ${config?.background?.disabled || "transparent"};
|
|
4067
|
+
`;
|
|
4068
|
+
}}
|
|
4069
|
+
}
|
|
4070
|
+
|
|
4071
|
+
.od-menu-item-disabled:hover {
|
|
4072
|
+
${() => {
|
|
4073
|
+
const config = theme2.components?.menu?.menuItem;
|
|
4074
|
+
return `
|
|
4075
|
+
background: ${config?.background?.disabled || "transparent"};
|
|
4076
|
+
`;
|
|
4077
|
+
}}
|
|
4078
|
+
}
|
|
4079
|
+
|
|
4080
|
+
/* SubMenu */
|
|
4081
|
+
.od-menu-submenu {
|
|
4082
|
+
position: relative;
|
|
4083
|
+
list-style: none;
|
|
4084
|
+
}
|
|
4085
|
+
|
|
4086
|
+
.od-menu-submenu-title {
|
|
4087
|
+
position: relative;
|
|
4088
|
+
display: flex;
|
|
4089
|
+
align-items: center;
|
|
4090
|
+
margin: 0;
|
|
4091
|
+
cursor: pointer;
|
|
4092
|
+
transition: background-color 0.15s ease;
|
|
4093
|
+
user-select: none;
|
|
4094
|
+
|
|
4095
|
+
${() => {
|
|
4096
|
+
const config = theme2.components?.menu?.menuItem;
|
|
4097
|
+
return `
|
|
4098
|
+
padding: ${config?.layout?.padding || "6px 12px"};
|
|
4099
|
+
background: ${config?.background?.normal || "transparent"};
|
|
4100
|
+
`;
|
|
4101
|
+
}}
|
|
4102
|
+
}
|
|
4103
|
+
|
|
4104
|
+
.od-menu-submenu-title:hover {
|
|
4105
|
+
${() => {
|
|
4106
|
+
const config = theme2.components?.menu?.menuItem;
|
|
4107
|
+
return `
|
|
4108
|
+
background: ${config?.background?.hover || "rgba(65, 70, 75, 0.05)"};
|
|
4109
|
+
`;
|
|
4110
|
+
}}
|
|
4111
|
+
}
|
|
4112
|
+
|
|
4113
|
+
.od-menu-submenu-open > .od-menu-submenu-title {
|
|
4114
|
+
${() => {
|
|
4115
|
+
const config = theme2.components?.menu?.menuItem;
|
|
4116
|
+
return `
|
|
4117
|
+
background: ${config?.background?.active || "rgba(65, 70, 75, 0.1)"};
|
|
4118
|
+
`;
|
|
4119
|
+
}}
|
|
4120
|
+
}
|
|
4121
|
+
|
|
4122
|
+
.od-menu-submenu-disabled .od-menu-submenu-title {
|
|
4123
|
+
cursor: not-allowed;
|
|
4124
|
+
${() => {
|
|
4125
|
+
const config = theme2.components?.menu?.menuItem;
|
|
4126
|
+
return `
|
|
4127
|
+
background: ${config?.background?.disabled || "transparent"};
|
|
4128
|
+
`;
|
|
4129
|
+
}}
|
|
4130
|
+
}
|
|
4131
|
+
|
|
4132
|
+
/* Submenu popup */
|
|
4133
|
+
.od-menu-submenu-popup {
|
|
4134
|
+
position: absolute;
|
|
4135
|
+
z-index: 1050;
|
|
4136
|
+
}
|
|
4137
|
+
|
|
4138
|
+
/* Submenu popup positioning - add 5px gap */
|
|
4139
|
+
.od-menu-submenu-placement-rightTop,
|
|
4140
|
+
.od-menu-submenu-placement-rightBottom {
|
|
4141
|
+
padding-left: 5px;
|
|
4142
|
+
}
|
|
4143
|
+
|
|
4144
|
+
.od-menu-submenu-placement-leftTop,
|
|
4145
|
+
.od-menu-submenu-placement-leftBottom {
|
|
4146
|
+
padding-right: 5px;
|
|
4147
|
+
}
|
|
4148
|
+
|
|
4149
|
+
.od-menu-submenu > .od-menu {
|
|
4150
|
+
${() => {
|
|
4151
|
+
const dropdownConfig = theme2.components?.dropdown;
|
|
4152
|
+
const menuConfig = theme2.components?.menu;
|
|
4153
|
+
return `
|
|
4154
|
+
background: ${dropdownConfig?.background || "#fff"};
|
|
4155
|
+
border: ${menuConfig?.border?.width || "1px"} solid ${menuConfig?.border?.color || "rgba(65, 70, 75, 0.1)"};
|
|
4156
|
+
border-radius: ${menuConfig?.border?.radius || "4px"};
|
|
4157
|
+
box-shadow: ${dropdownConfig?.boxShadow || "0 2px 8px rgba(0, 0, 0, 0.15)"};
|
|
4158
|
+
`;
|
|
4159
|
+
}}
|
|
4160
|
+
}
|
|
4161
|
+
|
|
4162
|
+
/* Item Group */
|
|
4163
|
+
.od-menu-item-group-title {
|
|
4164
|
+
padding: 8px 12px 4px;
|
|
4165
|
+
user-select: none;
|
|
4166
|
+
list-style: none;
|
|
4167
|
+
|
|
4168
|
+
${() => {
|
|
4169
|
+
const config = theme2.components?.menu?.groupTitle;
|
|
4170
|
+
return `
|
|
4171
|
+
font-size: ${config?.fontSize || "12px"};
|
|
4172
|
+
font-weight: ${config?.fontWeight || "500"};
|
|
4173
|
+
color: ${config?.color || "rgba(65, 70, 75, 0.6)"};
|
|
4174
|
+
line-height: 20px;
|
|
4175
|
+
`;
|
|
4176
|
+
}}
|
|
4177
|
+
}
|
|
4178
|
+
|
|
4179
|
+
.od-menu-item-group-list {
|
|
4180
|
+
margin: 0;
|
|
4181
|
+
padding: 0;
|
|
4182
|
+
list-style: none;
|
|
4183
|
+
}
|
|
4184
|
+
|
|
4185
|
+
/* Divider */
|
|
4186
|
+
.od-menu-item-divider {
|
|
4187
|
+
overflow: hidden;
|
|
4188
|
+
line-height: 0;
|
|
4189
|
+
list-style: none;
|
|
4190
|
+
|
|
4191
|
+
${() => {
|
|
4192
|
+
const config = theme2.components?.menu?.divider;
|
|
4193
|
+
return `
|
|
4194
|
+
height: ${config?.height || "1px"};
|
|
4195
|
+
background: ${config?.background || "rgba(65, 70, 75, 0.1)"};
|
|
4196
|
+
margin: ${config?.margin || "4px 0"};
|
|
4197
|
+
`;
|
|
4198
|
+
}}
|
|
4199
|
+
}
|
|
4200
|
+
|
|
4201
|
+
/* Animation */
|
|
4202
|
+
.od-menu-submenu-inline {
|
|
4203
|
+
border: 0;
|
|
4204
|
+
box-shadow: none;
|
|
4205
|
+
}
|
|
4206
|
+
|
|
4207
|
+
.od-menu-submenu-inline > .od-menu {
|
|
4208
|
+
padding: 0;
|
|
4209
|
+
border: 0;
|
|
4210
|
+
box-shadow: none;
|
|
4211
|
+
}
|
|
4212
|
+
|
|
4213
|
+
/* Collapse animation */
|
|
4214
|
+
.od-menu-submenu-inline-collapsed {
|
|
4215
|
+
max-height: 0;
|
|
4216
|
+
overflow: hidden;
|
|
4217
|
+
transition: max-height 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
4218
|
+
}
|
|
4219
|
+
|
|
4220
|
+
.od-menu-submenu-inline-collapsed-active {
|
|
4221
|
+
max-height: 1000px;
|
|
4222
|
+
}
|
|
4223
|
+
`;
|
|
4224
|
+
|
|
3255
4225
|
// src/UIConfigProvider/UIConfigProvider.tsx
|
|
3256
4226
|
init_IconProvider();
|
|
3257
4227
|
init_context();
|
|
@@ -3276,7 +4246,9 @@ var UIConfigProvider = ({ config, children }) => {
|
|
|
3276
4246
|
defaultDuration: toast2.defaultDuration ?? 3e3
|
|
3277
4247
|
};
|
|
3278
4248
|
const TooltipStyles = TooltipGlobalStyles;
|
|
3279
|
-
|
|
4249
|
+
const MenuStyles = MenuGlobalStyles;
|
|
4250
|
+
const DropdownStyles = DropdownGlobalStyles;
|
|
4251
|
+
return /* @__PURE__ */ React3__default.default.createElement(UIConfigContext.Provider, { value: config }, /* @__PURE__ */ React3__default.default.createElement(TooltipStyles, null), /* @__PURE__ */ React3__default.default.createElement(MenuStyles, null), /* @__PURE__ */ React3__default.default.createElement(DropdownStyles, null), /* @__PURE__ */ React3__default.default.createElement(exports.IconProvider, { icons }, /* @__PURE__ */ React3__default.default.createElement(
|
|
3280
4252
|
ToastContainer2,
|
|
3281
4253
|
{
|
|
3282
4254
|
maxCount: toastConfig.maxCount,
|
|
@@ -3366,7 +4338,12 @@ init_styled();
|
|
|
3366
4338
|
init_context();
|
|
3367
4339
|
|
|
3368
4340
|
exports.Checkbox = Checkbox;
|
|
4341
|
+
exports.Dropdown = Dropdown;
|
|
4342
|
+
exports.DropdownButton = DropdownButton2;
|
|
4343
|
+
exports.DropdownGlobalStyles = DropdownGlobalStyles;
|
|
3369
4344
|
exports.Input = Input;
|
|
4345
|
+
exports.Menu = Menu;
|
|
4346
|
+
exports.MenuGlobalStyles = MenuGlobalStyles;
|
|
3370
4347
|
exports.Radio = Radio;
|
|
3371
4348
|
exports.SearchInput = SearchInput;
|
|
3372
4349
|
exports.Switch = Switch;
|
|
@@ -3375,6 +4352,7 @@ exports.ToastContainer = ToastContainer2;
|
|
|
3375
4352
|
exports.ToolbarButton = ToolbarButton;
|
|
3376
4353
|
exports.Tooltip = Tooltip;
|
|
3377
4354
|
exports.UIConfigProvider = UIConfigProvider;
|
|
4355
|
+
exports.UnderlinedInput = UnderlinedInput;
|
|
3378
4356
|
exports.createUIConfig = createUIConfig;
|
|
3379
4357
|
exports.mergeUIConfig = mergeUIConfig;
|
|
3380
4358
|
exports.useToast = useToast;
|