@officesdk/design 0.1.1 → 0.1.2
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/index.d.mts +74 -2
- package/dist/components/index.d.ts +74 -2
- package/dist/components/index.js +257 -177
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +196 -117
- package/dist/components/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React12, { forwardRef, useState, createContext, useRef, useCallback, useEffect, useContext } from 'react';
|
|
2
2
|
import styled3, { createGlobalStyle, ThemeProvider } from 'styled-components';
|
|
3
3
|
import RcTooltip from 'rc-tooltip';
|
|
4
4
|
import 'rc-tooltip/assets/bootstrap.css';
|
|
@@ -142,7 +142,7 @@ var Button = ({
|
|
|
142
142
|
}) => {
|
|
143
143
|
const isIconOnly = variant === "icon" || !children && !!(iconBefore || iconAfter);
|
|
144
144
|
const iconOnlyContent = iconBefore || iconAfter;
|
|
145
|
-
return /* @__PURE__ */
|
|
145
|
+
return /* @__PURE__ */ React12.createElement(
|
|
146
146
|
StyledButton,
|
|
147
147
|
{
|
|
148
148
|
$variant: variant,
|
|
@@ -154,7 +154,7 @@ var Button = ({
|
|
|
154
154
|
disabled: disabled || loading,
|
|
155
155
|
...rest
|
|
156
156
|
},
|
|
157
|
-
loading ? /* @__PURE__ */
|
|
157
|
+
loading ? /* @__PURE__ */ React12.createElement(React12.Fragment, null, "Loading...") : isIconOnly ? iconOnlyContent : /* @__PURE__ */ React12.createElement(React12.Fragment, null, iconBefore && /* @__PURE__ */ React12.createElement(IconWrapper, { $size: size, $position: "before" }, iconBefore), children, iconAfter && /* @__PURE__ */ React12.createElement(IconWrapper, { $size: size, $position: "after" }, iconAfter))
|
|
158
158
|
);
|
|
159
159
|
};
|
|
160
160
|
Button.displayName = "Button";
|
|
@@ -306,7 +306,7 @@ var Slider = ({
|
|
|
306
306
|
},
|
|
307
307
|
[disabled, value, min, max, step, controlledValue, onChange]
|
|
308
308
|
);
|
|
309
|
-
return /* @__PURE__ */
|
|
309
|
+
return /* @__PURE__ */ React12.createElement(
|
|
310
310
|
SliderContainer,
|
|
311
311
|
{
|
|
312
312
|
ref: containerRef,
|
|
@@ -322,9 +322,9 @@ var Slider = ({
|
|
|
322
322
|
"aria-valuenow": value,
|
|
323
323
|
"aria-disabled": disabled
|
|
324
324
|
},
|
|
325
|
-
/* @__PURE__ */
|
|
326
|
-
/* @__PURE__ */
|
|
327
|
-
/* @__PURE__ */
|
|
325
|
+
/* @__PURE__ */ React12.createElement(SliderTrack, { $disabled: disabled }),
|
|
326
|
+
/* @__PURE__ */ React12.createElement(SliderFill, { $percentage: percentage, $disabled: disabled }),
|
|
327
|
+
/* @__PURE__ */ React12.createElement(
|
|
328
328
|
SliderThumb,
|
|
329
329
|
{
|
|
330
330
|
$percentage: percentage,
|
|
@@ -335,23 +335,7 @@ var Slider = ({
|
|
|
335
335
|
);
|
|
336
336
|
};
|
|
337
337
|
Slider.displayName = "Slider";
|
|
338
|
-
|
|
339
|
-
// src/Button/SpinButton.tsx
|
|
340
|
-
var SpinButtonWrapper = styled3.div`
|
|
341
|
-
display: inline-flex;
|
|
342
|
-
align-items: center;
|
|
343
|
-
gap: ${({ $showSlider }) => $showSlider ? "0" : "0"};
|
|
344
|
-
width: ${({ $showSlider }) => $showSlider ? "100%" : "auto"};
|
|
345
|
-
`;
|
|
346
|
-
var SliderWrapper = styled3.div`
|
|
347
|
-
flex: 1;
|
|
348
|
-
display: flex;
|
|
349
|
-
align-items: center;
|
|
350
|
-
padding: ${({ $size }) => $size === "small" ? "7px 0" : "7px 0"};
|
|
351
|
-
padding-right: ${({ $size }) => $size === "small" ? "83px" : "72px"};
|
|
352
|
-
min-width: 0;
|
|
353
|
-
`;
|
|
354
|
-
var SpinButtonContainer = styled3.div`
|
|
338
|
+
var NumberInputContainer = styled3.div`
|
|
355
339
|
display: inline-flex;
|
|
356
340
|
align-items: center;
|
|
357
341
|
background: white;
|
|
@@ -401,6 +385,25 @@ var InputWrapper = styled3.div`
|
|
|
401
385
|
align-items: center;
|
|
402
386
|
padding: 0 8px;
|
|
403
387
|
min-width: 0;
|
|
388
|
+
gap: 4px;
|
|
389
|
+
`;
|
|
390
|
+
var UnitText = styled3.span`
|
|
391
|
+
flex-shrink: 0;
|
|
392
|
+
font-family: 'PingFang SC', sans-serif;
|
|
393
|
+
font-weight: 400;
|
|
394
|
+
line-height: 20px;
|
|
395
|
+
|
|
396
|
+
${({ $size }) => $size === "small" ? `
|
|
397
|
+
font-size: 12px;
|
|
398
|
+
` : `
|
|
399
|
+
font-size: 13px;
|
|
400
|
+
`}
|
|
401
|
+
|
|
402
|
+
${({ $disabled, theme }) => $disabled ? `
|
|
403
|
+
color: ${theme.colors.palettes.transparency["30"]};
|
|
404
|
+
` : `
|
|
405
|
+
color: ${theme.colors.palettes.gray["120"]};
|
|
406
|
+
`}
|
|
404
407
|
`;
|
|
405
408
|
var StyledInput = styled3.input`
|
|
406
409
|
width: 100%;
|
|
@@ -438,6 +441,7 @@ var StyledInput = styled3.input`
|
|
|
438
441
|
}
|
|
439
442
|
|
|
440
443
|
&[type='number'] {
|
|
444
|
+
appearance: textfield;
|
|
441
445
|
-moz-appearance: textfield;
|
|
442
446
|
}
|
|
443
447
|
`;
|
|
@@ -504,9 +508,9 @@ var StepButton = styled3.button`
|
|
|
504
508
|
fill: ${({ $disabled, theme }) => $disabled ? theme.colors.palettes.transparency["30"] : theme.colors.palettes.gray["120"]};
|
|
505
509
|
}
|
|
506
510
|
`;
|
|
507
|
-
var UpArrow = () => /* @__PURE__ */
|
|
508
|
-
var DownArrow = () => /* @__PURE__ */
|
|
509
|
-
var
|
|
511
|
+
var UpArrow = () => /* @__PURE__ */ React12.createElement("svg", { viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React12.createElement("path", { d: "M7 4.5L10.5 8.5H3.5L7 4.5Z", fill: "currentColor" }));
|
|
512
|
+
var DownArrow = () => /* @__PURE__ */ React12.createElement("svg", { viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React12.createElement("path", { d: "M7 9.5L3.5 5.5H10.5L7 9.5Z", fill: "currentColor" }));
|
|
513
|
+
var NumberInput = ({
|
|
510
514
|
value: controlledValue,
|
|
511
515
|
defaultValue = 0,
|
|
512
516
|
min = -Infinity,
|
|
@@ -515,10 +519,10 @@ var SpinButton = ({
|
|
|
515
519
|
size = "large",
|
|
516
520
|
disabled = false,
|
|
517
521
|
alert = false,
|
|
518
|
-
showSlider = false,
|
|
519
522
|
precision,
|
|
520
523
|
formatter,
|
|
521
524
|
parser,
|
|
525
|
+
unit,
|
|
522
526
|
onChange,
|
|
523
527
|
className,
|
|
524
528
|
style
|
|
@@ -609,7 +613,105 @@ var SpinButton = ({
|
|
|
609
613
|
},
|
|
610
614
|
[increment, decrement]
|
|
611
615
|
);
|
|
612
|
-
return /* @__PURE__ */
|
|
616
|
+
return /* @__PURE__ */ React12.createElement(
|
|
617
|
+
NumberInputContainer,
|
|
618
|
+
{
|
|
619
|
+
$size: size,
|
|
620
|
+
$disabled: disabled,
|
|
621
|
+
$alert: alert,
|
|
622
|
+
$isFocused: isFocused,
|
|
623
|
+
className,
|
|
624
|
+
style
|
|
625
|
+
},
|
|
626
|
+
/* @__PURE__ */ React12.createElement(InputWrapper, null, /* @__PURE__ */ React12.createElement(
|
|
627
|
+
StyledInput,
|
|
628
|
+
{
|
|
629
|
+
ref: inputRef,
|
|
630
|
+
type: "text",
|
|
631
|
+
value: displayValue,
|
|
632
|
+
onChange: handleInputChange,
|
|
633
|
+
onFocus: handleFocus,
|
|
634
|
+
onBlur: handleBlur,
|
|
635
|
+
onKeyDown: handleKeyDown,
|
|
636
|
+
disabled,
|
|
637
|
+
$size: size,
|
|
638
|
+
$disabled: disabled
|
|
639
|
+
}
|
|
640
|
+
), unit && /* @__PURE__ */ React12.createElement(UnitText, { $size: size, $disabled: disabled }, unit)),
|
|
641
|
+
/* @__PURE__ */ React12.createElement(ButtonGroup, { $alert: alert, $disabled: disabled }, /* @__PURE__ */ React12.createElement(
|
|
642
|
+
StepButton,
|
|
643
|
+
{
|
|
644
|
+
type: "button",
|
|
645
|
+
$position: "up",
|
|
646
|
+
$alert: alert,
|
|
647
|
+
$disabled: disabled,
|
|
648
|
+
onClick: increment,
|
|
649
|
+
disabled,
|
|
650
|
+
tabIndex: -1
|
|
651
|
+
},
|
|
652
|
+
/* @__PURE__ */ React12.createElement(UpArrow, null)
|
|
653
|
+
), /* @__PURE__ */ React12.createElement(
|
|
654
|
+
StepButton,
|
|
655
|
+
{
|
|
656
|
+
type: "button",
|
|
657
|
+
$position: "down",
|
|
658
|
+
$alert: alert,
|
|
659
|
+
$disabled: disabled,
|
|
660
|
+
onClick: decrement,
|
|
661
|
+
disabled,
|
|
662
|
+
tabIndex: -1
|
|
663
|
+
},
|
|
664
|
+
/* @__PURE__ */ React12.createElement(DownArrow, null)
|
|
665
|
+
))
|
|
666
|
+
);
|
|
667
|
+
};
|
|
668
|
+
NumberInput.displayName = "NumberInput";
|
|
669
|
+
|
|
670
|
+
// src/Button/SpinButton.tsx
|
|
671
|
+
var SpinButtonWrapper = styled3.div`
|
|
672
|
+
display: inline-flex;
|
|
673
|
+
align-items: center;
|
|
674
|
+
gap: ${({ $showSlider }) => $showSlider ? "0" : "0"};
|
|
675
|
+
width: ${({ $showSlider }) => $showSlider ? "100%" : "auto"};
|
|
676
|
+
`;
|
|
677
|
+
var SliderWrapper = styled3.div`
|
|
678
|
+
flex: 1;
|
|
679
|
+
display: flex;
|
|
680
|
+
align-items: center;
|
|
681
|
+
padding: ${({ $size }) => $size === "small" ? "7px 0" : "7px 0"};
|
|
682
|
+
padding-right: ${({ $size }) => $size === "small" ? "83px" : "72px"};
|
|
683
|
+
min-width: 0;
|
|
684
|
+
`;
|
|
685
|
+
var SpinButton = ({
|
|
686
|
+
value: controlledValue,
|
|
687
|
+
defaultValue = 0,
|
|
688
|
+
min = -Infinity,
|
|
689
|
+
max = Infinity,
|
|
690
|
+
step = 1,
|
|
691
|
+
size = "large",
|
|
692
|
+
disabled = false,
|
|
693
|
+
alert = false,
|
|
694
|
+
showSlider = false,
|
|
695
|
+
precision,
|
|
696
|
+
formatter,
|
|
697
|
+
parser,
|
|
698
|
+
onChange,
|
|
699
|
+
className,
|
|
700
|
+
style
|
|
701
|
+
}) => {
|
|
702
|
+
const [internalValue, setInternalValue] = useState(controlledValue ?? defaultValue);
|
|
703
|
+
const value = controlledValue !== void 0 ? controlledValue : internalValue;
|
|
704
|
+
const handleValueChange = useCallback(
|
|
705
|
+
(newValue) => {
|
|
706
|
+
if (newValue === null) return;
|
|
707
|
+
if (controlledValue === void 0) {
|
|
708
|
+
setInternalValue(newValue);
|
|
709
|
+
}
|
|
710
|
+
onChange?.(newValue);
|
|
711
|
+
},
|
|
712
|
+
[controlledValue, onChange]
|
|
713
|
+
);
|
|
714
|
+
return /* @__PURE__ */ React12.createElement(SpinButtonWrapper, { $showSlider: showSlider, className, style }, showSlider && /* @__PURE__ */ React12.createElement(SliderWrapper, { $size: size }, /* @__PURE__ */ React12.createElement(
|
|
613
715
|
Slider,
|
|
614
716
|
{
|
|
615
717
|
value,
|
|
@@ -617,47 +719,24 @@ var SpinButton = ({
|
|
|
617
719
|
max,
|
|
618
720
|
step,
|
|
619
721
|
disabled,
|
|
620
|
-
onChange:
|
|
722
|
+
onChange: handleValueChange
|
|
621
723
|
}
|
|
622
|
-
)), /* @__PURE__ */
|
|
623
|
-
|
|
724
|
+
)), /* @__PURE__ */ React12.createElement(
|
|
725
|
+
NumberInput,
|
|
624
726
|
{
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
onBlur: handleBlur,
|
|
631
|
-
onKeyDown: handleKeyDown,
|
|
727
|
+
value,
|
|
728
|
+
min,
|
|
729
|
+
max,
|
|
730
|
+
step,
|
|
731
|
+
size,
|
|
632
732
|
disabled,
|
|
633
|
-
|
|
634
|
-
|
|
733
|
+
alert,
|
|
734
|
+
precision,
|
|
735
|
+
formatter,
|
|
736
|
+
parser,
|
|
737
|
+
onChange: handleValueChange
|
|
635
738
|
}
|
|
636
|
-
))
|
|
637
|
-
StepButton,
|
|
638
|
-
{
|
|
639
|
-
type: "button",
|
|
640
|
-
$position: "up",
|
|
641
|
-
$alert: alert,
|
|
642
|
-
$disabled: disabled,
|
|
643
|
-
onClick: increment,
|
|
644
|
-
disabled,
|
|
645
|
-
tabIndex: -1
|
|
646
|
-
},
|
|
647
|
-
/* @__PURE__ */ React11.createElement(UpArrow, null)
|
|
648
|
-
), /* @__PURE__ */ React11.createElement(
|
|
649
|
-
StepButton,
|
|
650
|
-
{
|
|
651
|
-
type: "button",
|
|
652
|
-
$position: "down",
|
|
653
|
-
$alert: alert,
|
|
654
|
-
$disabled: disabled,
|
|
655
|
-
onClick: decrement,
|
|
656
|
-
disabled,
|
|
657
|
-
tabIndex: -1
|
|
658
|
-
},
|
|
659
|
-
/* @__PURE__ */ React11.createElement(DownArrow, null)
|
|
660
|
-
))));
|
|
739
|
+
));
|
|
661
740
|
};
|
|
662
741
|
SpinButton.displayName = "SpinButton";
|
|
663
742
|
var SwitchContainer = styled3.label`
|
|
@@ -804,7 +883,7 @@ var Switch = ({
|
|
|
804
883
|
const handleBlur = useCallback(() => {
|
|
805
884
|
setIsFocused(false);
|
|
806
885
|
}, []);
|
|
807
|
-
return /* @__PURE__ */
|
|
886
|
+
return /* @__PURE__ */ React12.createElement(
|
|
808
887
|
SwitchContainer,
|
|
809
888
|
{
|
|
810
889
|
$size: size,
|
|
@@ -813,7 +892,7 @@ var Switch = ({
|
|
|
813
892
|
className,
|
|
814
893
|
style
|
|
815
894
|
},
|
|
816
|
-
/* @__PURE__ */
|
|
895
|
+
/* @__PURE__ */ React12.createElement(
|
|
817
896
|
HiddenInput,
|
|
818
897
|
{
|
|
819
898
|
type: "checkbox",
|
|
@@ -824,7 +903,7 @@ var Switch = ({
|
|
|
824
903
|
disabled
|
|
825
904
|
}
|
|
826
905
|
),
|
|
827
|
-
/* @__PURE__ */
|
|
906
|
+
/* @__PURE__ */ React12.createElement(
|
|
828
907
|
Track,
|
|
829
908
|
{
|
|
830
909
|
$size: size,
|
|
@@ -833,7 +912,7 @@ var Switch = ({
|
|
|
833
912
|
$isFocused: isFocused
|
|
834
913
|
}
|
|
835
914
|
),
|
|
836
|
-
/* @__PURE__ */
|
|
915
|
+
/* @__PURE__ */ React12.createElement(
|
|
837
916
|
Thumb,
|
|
838
917
|
{
|
|
839
918
|
$size: size,
|
|
@@ -960,14 +1039,14 @@ var Radio = ({
|
|
|
960
1039
|
const handleBlur = useCallback(() => {
|
|
961
1040
|
setIsFocused(false);
|
|
962
1041
|
}, []);
|
|
963
|
-
return /* @__PURE__ */
|
|
1042
|
+
return /* @__PURE__ */ React12.createElement(
|
|
964
1043
|
RadioContainer,
|
|
965
1044
|
{
|
|
966
1045
|
$disabled: disabled,
|
|
967
1046
|
className,
|
|
968
1047
|
style
|
|
969
1048
|
},
|
|
970
|
-
/* @__PURE__ */
|
|
1049
|
+
/* @__PURE__ */ React12.createElement(
|
|
971
1050
|
HiddenInput2,
|
|
972
1051
|
{
|
|
973
1052
|
type: "radio",
|
|
@@ -981,7 +1060,7 @@ var Radio = ({
|
|
|
981
1060
|
disabled
|
|
982
1061
|
}
|
|
983
1062
|
),
|
|
984
|
-
/* @__PURE__ */
|
|
1063
|
+
/* @__PURE__ */ React12.createElement(
|
|
985
1064
|
RadioOuter,
|
|
986
1065
|
{
|
|
987
1066
|
$checked: checked,
|
|
@@ -989,7 +1068,7 @@ var Radio = ({
|
|
|
989
1068
|
$isFocused: isFocused
|
|
990
1069
|
}
|
|
991
1070
|
),
|
|
992
|
-
/* @__PURE__ */
|
|
1071
|
+
/* @__PURE__ */ React12.createElement(
|
|
993
1072
|
RadioInner,
|
|
994
1073
|
{
|
|
995
1074
|
$checked: checked,
|
|
@@ -1145,14 +1224,14 @@ var Checkbox = ({
|
|
|
1145
1224
|
const handleBlur = useCallback(() => {
|
|
1146
1225
|
setIsFocused(false);
|
|
1147
1226
|
}, []);
|
|
1148
|
-
return /* @__PURE__ */
|
|
1227
|
+
return /* @__PURE__ */ React12.createElement(
|
|
1149
1228
|
CheckboxContainer,
|
|
1150
1229
|
{
|
|
1151
1230
|
$disabled: disabled,
|
|
1152
1231
|
className,
|
|
1153
1232
|
style
|
|
1154
1233
|
},
|
|
1155
|
-
/* @__PURE__ */
|
|
1234
|
+
/* @__PURE__ */ React12.createElement(
|
|
1156
1235
|
HiddenInput3,
|
|
1157
1236
|
{
|
|
1158
1237
|
ref: inputRef,
|
|
@@ -1167,7 +1246,7 @@ var Checkbox = ({
|
|
|
1167
1246
|
disabled
|
|
1168
1247
|
}
|
|
1169
1248
|
),
|
|
1170
|
-
/* @__PURE__ */
|
|
1249
|
+
/* @__PURE__ */ React12.createElement(
|
|
1171
1250
|
CheckboxBox,
|
|
1172
1251
|
{
|
|
1173
1252
|
$checked: checked,
|
|
@@ -1176,8 +1255,8 @@ var Checkbox = ({
|
|
|
1176
1255
|
$isFocused: isFocused
|
|
1177
1256
|
}
|
|
1178
1257
|
),
|
|
1179
|
-
!indeterminate && /* @__PURE__ */
|
|
1180
|
-
indeterminate && /* @__PURE__ */
|
|
1258
|
+
!indeterminate && /* @__PURE__ */ React12.createElement(IconWrapper2, { $visible: checked }, /* @__PURE__ */ React12.createElement("svg", { width: 10, height: 8, viewBox: "0 0 10 8", fill: "#fff" }, /* @__PURE__ */ React12.createElement("path", { d: "M1.05426 3.16164L0 4.27945L3.50904 8L10 1.11781L8.94573 0L3.50904 5.76438L1.05426 3.16164Z" }))),
|
|
1259
|
+
indeterminate && /* @__PURE__ */ React12.createElement(IconWrapper2, { $visible: indeterminate }, /* @__PURE__ */ React12.createElement(DefaultIndeterminateIcon, null))
|
|
1181
1260
|
);
|
|
1182
1261
|
};
|
|
1183
1262
|
Checkbox.displayName = "Checkbox";
|
|
@@ -1330,7 +1409,7 @@ var Input = forwardRef(
|
|
|
1330
1409
|
setIsFocused(false);
|
|
1331
1410
|
onBlur?.(e);
|
|
1332
1411
|
};
|
|
1333
|
-
return /* @__PURE__ */
|
|
1412
|
+
return /* @__PURE__ */ React12.createElement(
|
|
1334
1413
|
InputWrapper2,
|
|
1335
1414
|
{
|
|
1336
1415
|
$size: size,
|
|
@@ -1341,8 +1420,8 @@ var Input = forwardRef(
|
|
|
1341
1420
|
className,
|
|
1342
1421
|
style
|
|
1343
1422
|
},
|
|
1344
|
-
prefixNode && /* @__PURE__ */
|
|
1345
|
-
/* @__PURE__ */
|
|
1423
|
+
prefixNode && /* @__PURE__ */ React12.createElement(PrefixNode, { $size: size }, prefixNode),
|
|
1424
|
+
/* @__PURE__ */ React12.createElement(
|
|
1346
1425
|
StyledInput2,
|
|
1347
1426
|
{
|
|
1348
1427
|
ref,
|
|
@@ -1356,7 +1435,7 @@ var Input = forwardRef(
|
|
|
1356
1435
|
...rest
|
|
1357
1436
|
}
|
|
1358
1437
|
),
|
|
1359
|
-
suffixNode && /* @__PURE__ */
|
|
1438
|
+
suffixNode && /* @__PURE__ */ React12.createElement(SuffixNode, { $size: size }, suffixNode)
|
|
1360
1439
|
);
|
|
1361
1440
|
}
|
|
1362
1441
|
);
|
|
@@ -1416,7 +1495,7 @@ var ClearButton = styled3.button`
|
|
|
1416
1495
|
opacity: 0.5;
|
|
1417
1496
|
}
|
|
1418
1497
|
`;
|
|
1419
|
-
var DefaultSearchIcon = () => /* @__PURE__ */
|
|
1498
|
+
var DefaultSearchIcon = () => /* @__PURE__ */ React12.createElement("svg", { viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React12.createElement(
|
|
1420
1499
|
"path",
|
|
1421
1500
|
{
|
|
1422
1501
|
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",
|
|
@@ -1425,7 +1504,7 @@ var DefaultSearchIcon = () => /* @__PURE__ */ React11.createElement("svg", { vie
|
|
|
1425
1504
|
strokeLinecap: "round",
|
|
1426
1505
|
strokeLinejoin: "round"
|
|
1427
1506
|
}
|
|
1428
|
-
), /* @__PURE__ */
|
|
1507
|
+
), /* @__PURE__ */ React12.createElement(
|
|
1429
1508
|
"path",
|
|
1430
1509
|
{
|
|
1431
1510
|
d: "M14 14L11.1 11.1",
|
|
@@ -1435,7 +1514,7 @@ var DefaultSearchIcon = () => /* @__PURE__ */ React11.createElement("svg", { vie
|
|
|
1435
1514
|
strokeLinejoin: "round"
|
|
1436
1515
|
}
|
|
1437
1516
|
));
|
|
1438
|
-
var DefaultCloseIcon = () => /* @__PURE__ */
|
|
1517
|
+
var DefaultCloseIcon = () => /* @__PURE__ */ React12.createElement("svg", { viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React12.createElement(
|
|
1439
1518
|
"path",
|
|
1440
1519
|
{
|
|
1441
1520
|
d: "M12 4L4 12",
|
|
@@ -1444,7 +1523,7 @@ var DefaultCloseIcon = () => /* @__PURE__ */ React11.createElement("svg", { view
|
|
|
1444
1523
|
strokeLinecap: "round",
|
|
1445
1524
|
strokeLinejoin: "round"
|
|
1446
1525
|
}
|
|
1447
|
-
), /* @__PURE__ */
|
|
1526
|
+
), /* @__PURE__ */ React12.createElement(
|
|
1448
1527
|
"path",
|
|
1449
1528
|
{
|
|
1450
1529
|
d: "M4 4L12 12",
|
|
@@ -1482,8 +1561,8 @@ var SearchInput = forwardRef(
|
|
|
1482
1561
|
}
|
|
1483
1562
|
onClear?.();
|
|
1484
1563
|
};
|
|
1485
|
-
const prefixNode = /* @__PURE__ */
|
|
1486
|
-
const suffixNode = clearable && currentValue && !disabled && !readOnly ? /* @__PURE__ */
|
|
1564
|
+
const prefixNode = /* @__PURE__ */ React12.createElement(SearchIconWrapper, { $size: size }, searchIcon || /* @__PURE__ */ React12.createElement(DefaultSearchIcon, null));
|
|
1565
|
+
const suffixNode = clearable && currentValue && !disabled && !readOnly ? /* @__PURE__ */ React12.createElement(
|
|
1487
1566
|
ClearButton,
|
|
1488
1567
|
{
|
|
1489
1568
|
$size: size,
|
|
@@ -1491,9 +1570,9 @@ var SearchInput = forwardRef(
|
|
|
1491
1570
|
type: "button",
|
|
1492
1571
|
tabIndex: -1
|
|
1493
1572
|
},
|
|
1494
|
-
/* @__PURE__ */
|
|
1573
|
+
/* @__PURE__ */ React12.createElement(DefaultCloseIcon, null)
|
|
1495
1574
|
) : null;
|
|
1496
|
-
return /* @__PURE__ */
|
|
1575
|
+
return /* @__PURE__ */ React12.createElement(
|
|
1497
1576
|
Input,
|
|
1498
1577
|
{
|
|
1499
1578
|
ref,
|
|
@@ -1515,7 +1594,7 @@ var IconProvider = ({
|
|
|
1515
1594
|
icons,
|
|
1516
1595
|
children
|
|
1517
1596
|
}) => {
|
|
1518
|
-
return /* @__PURE__ */
|
|
1597
|
+
return /* @__PURE__ */ React12.createElement(IconContext.Provider, { value: icons }, children);
|
|
1519
1598
|
};
|
|
1520
1599
|
var useIconRegistry = () => {
|
|
1521
1600
|
return useContext(IconContext);
|
|
@@ -1553,7 +1632,7 @@ var Icon = ({
|
|
|
1553
1632
|
const registry = useIconRegistry();
|
|
1554
1633
|
let iconElement = children;
|
|
1555
1634
|
if (!iconElement && src) {
|
|
1556
|
-
iconElement = /* @__PURE__ */
|
|
1635
|
+
iconElement = /* @__PURE__ */ React12.createElement(
|
|
1557
1636
|
"img",
|
|
1558
1637
|
{
|
|
1559
1638
|
src,
|
|
@@ -1565,7 +1644,7 @@ var Icon = ({
|
|
|
1565
1644
|
if (!iconElement && name && registry) {
|
|
1566
1645
|
const IconComponent = registry[name];
|
|
1567
1646
|
if (IconComponent) {
|
|
1568
|
-
iconElement = /* @__PURE__ */
|
|
1647
|
+
iconElement = /* @__PURE__ */ React12.createElement(IconComponent, null);
|
|
1569
1648
|
} else if (process.env.NODE_ENV !== "production") {
|
|
1570
1649
|
console.warn(`Icon "${name}" not found in registry. Make sure IconProvider is set up.`);
|
|
1571
1650
|
}
|
|
@@ -1576,7 +1655,7 @@ var Icon = ({
|
|
|
1576
1655
|
}
|
|
1577
1656
|
return null;
|
|
1578
1657
|
}
|
|
1579
|
-
return /* @__PURE__ */
|
|
1658
|
+
return /* @__PURE__ */ React12.createElement(
|
|
1580
1659
|
IconContainer,
|
|
1581
1660
|
{
|
|
1582
1661
|
$size: size,
|
|
@@ -1680,11 +1759,11 @@ var CloseButton = styled3.button`
|
|
|
1680
1759
|
color: ${({ theme }) => theme.colors.palettes.gray["120"]};
|
|
1681
1760
|
}
|
|
1682
1761
|
`;
|
|
1683
|
-
var SuccessIcon = () => /* @__PURE__ */
|
|
1684
|
-
var InfoIcon = () => /* @__PURE__ */
|
|
1685
|
-
var ErrorIcon = () => /* @__PURE__ */
|
|
1686
|
-
var WarnIcon = () => /* @__PURE__ */
|
|
1687
|
-
var CloseIconSvg = () => /* @__PURE__ */
|
|
1762
|
+
var SuccessIcon = () => /* @__PURE__ */ React12.createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React12.createElement("circle", { cx: "10", cy: "10", r: "8", fill: "#4ea44b" }), /* @__PURE__ */ React12.createElement("path", { d: "M6 10L9 13L14 7", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }));
|
|
1763
|
+
var InfoIcon = () => /* @__PURE__ */ React12.createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React12.createElement("circle", { cx: "10", cy: "10", r: "8", fill: "#5ba0e7" }), /* @__PURE__ */ React12.createElement("path", { d: "M10 9V14M10 6H10.01", stroke: "white", strokeWidth: "2", strokeLinecap: "round" }));
|
|
1764
|
+
var ErrorIcon = () => /* @__PURE__ */ React12.createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React12.createElement("circle", { cx: "10", cy: "10", r: "8", fill: "#e95555" }), /* @__PURE__ */ React12.createElement("path", { d: "M7 7L13 13M13 7L7 13", stroke: "white", strokeWidth: "2", strokeLinecap: "round" }));
|
|
1765
|
+
var WarnIcon = () => /* @__PURE__ */ React12.createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React12.createElement("circle", { cx: "10", cy: "10", r: "8", fill: "#ebe361" }), /* @__PURE__ */ React12.createElement("path", { d: "M10 6V11M10 14H10.01", stroke: "white", strokeWidth: "2", strokeLinecap: "round" }));
|
|
1766
|
+
var CloseIconSvg = () => /* @__PURE__ */ React12.createElement("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React12.createElement("path", { d: "M9 3L3 9M3 3L9 9", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }));
|
|
1688
1767
|
var Toast = ({
|
|
1689
1768
|
variant = "info",
|
|
1690
1769
|
message,
|
|
@@ -1716,13 +1795,13 @@ var Toast = ({
|
|
|
1716
1795
|
return null;
|
|
1717
1796
|
}
|
|
1718
1797
|
const defaultIcons = {
|
|
1719
|
-
success: /* @__PURE__ */
|
|
1720
|
-
info: /* @__PURE__ */
|
|
1721
|
-
error: /* @__PURE__ */
|
|
1722
|
-
warn: /* @__PURE__ */
|
|
1798
|
+
success: /* @__PURE__ */ React12.createElement(SuccessIcon, null),
|
|
1799
|
+
info: /* @__PURE__ */ React12.createElement(InfoIcon, null),
|
|
1800
|
+
error: /* @__PURE__ */ React12.createElement(ErrorIcon, null),
|
|
1801
|
+
warn: /* @__PURE__ */ React12.createElement(WarnIcon, null)
|
|
1723
1802
|
};
|
|
1724
1803
|
const iconElement = icon || defaultIcons[variant];
|
|
1725
|
-
return /* @__PURE__ */
|
|
1804
|
+
return /* @__PURE__ */ React12.createElement(
|
|
1726
1805
|
ToastContainer,
|
|
1727
1806
|
{
|
|
1728
1807
|
$variant: variant,
|
|
@@ -1731,9 +1810,9 @@ var Toast = ({
|
|
|
1731
1810
|
role: "alert",
|
|
1732
1811
|
"aria-live": "polite"
|
|
1733
1812
|
},
|
|
1734
|
-
showIcon && /* @__PURE__ */
|
|
1735
|
-
/* @__PURE__ */
|
|
1736
|
-
actionText && onAction && /* @__PURE__ */
|
|
1813
|
+
showIcon && /* @__PURE__ */ React12.createElement(IconWrapper3, { $variant: variant }, iconElement),
|
|
1814
|
+
/* @__PURE__ */ React12.createElement(Message, null, message),
|
|
1815
|
+
actionText && onAction && /* @__PURE__ */ React12.createElement(
|
|
1737
1816
|
ActionButton,
|
|
1738
1817
|
{
|
|
1739
1818
|
$variant: variant,
|
|
@@ -1742,14 +1821,14 @@ var Toast = ({
|
|
|
1742
1821
|
},
|
|
1743
1822
|
actionText
|
|
1744
1823
|
),
|
|
1745
|
-
closable && /* @__PURE__ */
|
|
1824
|
+
closable && /* @__PURE__ */ React12.createElement(
|
|
1746
1825
|
CloseButton,
|
|
1747
1826
|
{
|
|
1748
1827
|
onClick: handleClose,
|
|
1749
1828
|
type: "button",
|
|
1750
1829
|
"aria-label": "Close"
|
|
1751
1830
|
},
|
|
1752
|
-
/* @__PURE__ */
|
|
1831
|
+
/* @__PURE__ */ React12.createElement(CloseIconSvg, null)
|
|
1753
1832
|
)
|
|
1754
1833
|
);
|
|
1755
1834
|
};
|
|
@@ -1811,7 +1890,7 @@ var ToastContainer2 = ({
|
|
|
1811
1890
|
error,
|
|
1812
1891
|
warn
|
|
1813
1892
|
};
|
|
1814
|
-
return /* @__PURE__ */
|
|
1893
|
+
return /* @__PURE__ */ React12.createElement(ToastContext.Provider, { value: contextValue }, children, /* @__PURE__ */ React12.createElement(ToastWrapper, null, toasts.map((toast) => /* @__PURE__ */ React12.createElement(
|
|
1815
1894
|
Toast,
|
|
1816
1895
|
{
|
|
1817
1896
|
key: toast.id,
|
|
@@ -1965,7 +2044,7 @@ var Tabs = ({
|
|
|
1965
2044
|
},
|
|
1966
2045
|
[controlledActiveKey, onChange]
|
|
1967
2046
|
);
|
|
1968
|
-
return /* @__PURE__ */
|
|
2047
|
+
return /* @__PURE__ */ React12.createElement(TabContainer, { className, style }, /* @__PURE__ */ React12.createElement(TabList, { $variant: variant, role: "tablist" }, items.map((item) => /* @__PURE__ */ React12.createElement(
|
|
1969
2048
|
TabItem,
|
|
1970
2049
|
{
|
|
1971
2050
|
key: item.key,
|
|
@@ -1979,7 +2058,7 @@ var Tabs = ({
|
|
|
1979
2058
|
disabled: item.disabled,
|
|
1980
2059
|
type: "button"
|
|
1981
2060
|
},
|
|
1982
|
-
item.icon && /* @__PURE__ */
|
|
2061
|
+
item.icon && /* @__PURE__ */ React12.createElement("span", null, item.icon),
|
|
1983
2062
|
item.label
|
|
1984
2063
|
))));
|
|
1985
2064
|
};
|
|
@@ -1996,7 +2075,7 @@ var Tooltip = ({
|
|
|
1996
2075
|
getPopupContainer,
|
|
1997
2076
|
...rest
|
|
1998
2077
|
}) => {
|
|
1999
|
-
const overlayContent =
|
|
2078
|
+
const overlayContent = React12.useMemo(() => /* @__PURE__ */ React12.createElement("div", null, content), [content]);
|
|
2000
2079
|
const variantClass = `tooltip-variant-${variant}`;
|
|
2001
2080
|
const sizeClass = variant === "white" ? `tooltip-size-${size}` : "";
|
|
2002
2081
|
const combinedClassName = [variantClass, sizeClass, overlayClassName].filter(Boolean).join(" ");
|
|
@@ -2009,7 +2088,7 @@ var Tooltip = ({
|
|
|
2009
2088
|
...getPopupContainer && { getPopupContainer },
|
|
2010
2089
|
...rest
|
|
2011
2090
|
};
|
|
2012
|
-
return /* @__PURE__ */
|
|
2091
|
+
return /* @__PURE__ */ React12.createElement(RcTooltip, { ...tooltipProps }, children);
|
|
2013
2092
|
};
|
|
2014
2093
|
Tooltip.displayName = "Tooltip";
|
|
2015
2094
|
var paddingDistance = "5px";
|
|
@@ -2288,7 +2367,7 @@ var UIConfigProvider = ({
|
|
|
2288
2367
|
};
|
|
2289
2368
|
const Provider = ThemeProvider;
|
|
2290
2369
|
const TooltipStyles = TooltipGlobalStyles;
|
|
2291
|
-
return /* @__PURE__ */
|
|
2370
|
+
return /* @__PURE__ */ React12.createElement(UIConfigContext.Provider, { value: config }, /* @__PURE__ */ React12.createElement(Provider, { theme }, /* @__PURE__ */ React12.createElement(TooltipStyles, null), /* @__PURE__ */ React12.createElement(IconProvider, { icons }, /* @__PURE__ */ React12.createElement(
|
|
2292
2371
|
ToastContainer2,
|
|
2293
2372
|
{
|
|
2294
2373
|
maxCount: toastConfig.maxCount,
|
|
@@ -2373,6 +2452,6 @@ var mergeUIConfig = (baseConfig, ...configs) => {
|
|
|
2373
2452
|
return merged;
|
|
2374
2453
|
};
|
|
2375
2454
|
|
|
2376
|
-
export { Button, Checkbox, Icon, IconProvider, Input, Radio, SearchInput, Slider, SpinButton, Switch, Tabs, Toast, ToastContainer2 as ToastContainer, Tooltip, UIConfigProvider, createUIConfig, mergeUIConfig, useIconRegistry, useToast, useUIConfig };
|
|
2455
|
+
export { Button, Checkbox, Icon, IconProvider, Input, NumberInput, Radio, SearchInput, Slider, SpinButton, Switch, Tabs, Toast, ToastContainer2 as ToastContainer, Tooltip, UIConfigProvider, createUIConfig, mergeUIConfig, useIconRegistry, useToast, useUIConfig };
|
|
2377
2456
|
//# sourceMappingURL=index.mjs.map
|
|
2378
2457
|
//# sourceMappingURL=index.mjs.map
|