@officesdk/design 0.1.1 → 0.1.3
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.ts → cjs/index.d.ts} +74 -2
- package/dist/components/{index.js → cjs/index.js} +257 -177
- package/dist/components/cjs/index.js.map +1 -0
- package/dist/components/{index.d.mts → esm/index.d.ts} +74 -2
- package/dist/components/{index.mjs → esm/index.js} +198 -119
- package/dist/components/esm/index.js.map +1 -0
- package/dist/icons/cjs/index.js.map +1 -0
- package/dist/icons/{index.mjs → esm/index.js} +2 -2
- package/dist/icons/esm/index.js.map +1 -0
- package/dist/theme/cjs/index.js.map +1 -0
- package/dist/theme/{index.mjs → esm/index.js} +2 -2
- package/dist/theme/esm/index.js.map +1 -0
- package/dist/utils/cjs/index.js.map +1 -0
- package/dist/utils/{index.mjs → esm/index.js} +2 -2
- package/dist/utils/esm/index.js.map +1 -0
- package/package.json +20 -20
- package/dist/components/index.js.map +0 -1
- package/dist/components/index.mjs.map +0 -1
- package/dist/icons/index.js.map +0 -1
- package/dist/icons/index.mjs.map +0 -1
- package/dist/index.d.mts +0 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -2
- package/dist/index.mjs +0 -2
- package/dist/theme/index.js.map +0 -1
- package/dist/theme/index.mjs.map +0 -1
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/index.mjs.map +0 -1
- /package/dist/icons/{index.d.ts → cjs/index.d.ts} +0 -0
- /package/dist/icons/{index.js → cjs/index.js} +0 -0
- /package/dist/icons/{index.d.mts → esm/index.d.ts} +0 -0
- /package/dist/theme/{index.d.ts → cjs/index.d.ts} +0 -0
- /package/dist/theme/{index.js → cjs/index.js} +0 -0
- /package/dist/theme/{index.d.mts → esm/index.d.ts} +0 -0
- /package/dist/utils/{index.d.ts → cjs/index.d.ts} +0 -0
- /package/dist/utils/{index.js → cjs/index.js} +0 -0
- /package/dist/utils/{index.d.mts → esm/index.d.mts} +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React12 = require('react');
|
|
4
4
|
var styled3 = require('styled-components');
|
|
5
5
|
var RcTooltip = require('rc-tooltip');
|
|
6
6
|
require('rc-tooltip/assets/bootstrap.css');
|
|
7
7
|
|
|
8
8
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var React12__default = /*#__PURE__*/_interopDefault(React12);
|
|
11
11
|
var styled3__default = /*#__PURE__*/_interopDefault(styled3);
|
|
12
12
|
var RcTooltip__default = /*#__PURE__*/_interopDefault(RcTooltip);
|
|
13
13
|
|
|
@@ -150,7 +150,7 @@ var Button = ({
|
|
|
150
150
|
}) => {
|
|
151
151
|
const isIconOnly = variant === "icon" || !children && !!(iconBefore || iconAfter);
|
|
152
152
|
const iconOnlyContent = iconBefore || iconAfter;
|
|
153
|
-
return /* @__PURE__ */
|
|
153
|
+
return /* @__PURE__ */ React12__default.default.createElement(
|
|
154
154
|
StyledButton,
|
|
155
155
|
{
|
|
156
156
|
$variant: variant,
|
|
@@ -162,7 +162,7 @@ var Button = ({
|
|
|
162
162
|
disabled: disabled || loading,
|
|
163
163
|
...rest
|
|
164
164
|
},
|
|
165
|
-
loading ? /* @__PURE__ */
|
|
165
|
+
loading ? /* @__PURE__ */ React12__default.default.createElement(React12__default.default.Fragment, null, "Loading...") : isIconOnly ? iconOnlyContent : /* @__PURE__ */ React12__default.default.createElement(React12__default.default.Fragment, null, iconBefore && /* @__PURE__ */ React12__default.default.createElement(IconWrapper, { $size: size, $position: "before" }, iconBefore), children, iconAfter && /* @__PURE__ */ React12__default.default.createElement(IconWrapper, { $size: size, $position: "after" }, iconAfter))
|
|
166
166
|
);
|
|
167
167
|
};
|
|
168
168
|
Button.displayName = "Button";
|
|
@@ -232,14 +232,14 @@ var Slider = ({
|
|
|
232
232
|
className,
|
|
233
233
|
style
|
|
234
234
|
}) => {
|
|
235
|
-
const [internalValue, setInternalValue] =
|
|
235
|
+
const [internalValue, setInternalValue] = React12.useState(
|
|
236
236
|
controlledValue ?? defaultValue
|
|
237
237
|
);
|
|
238
|
-
const [isDragging, setIsDragging] =
|
|
239
|
-
const containerRef =
|
|
238
|
+
const [isDragging, setIsDragging] = React12.useState(false);
|
|
239
|
+
const containerRef = React12.useRef(null);
|
|
240
240
|
const value = controlledValue !== void 0 ? controlledValue : internalValue;
|
|
241
241
|
const percentage = (value - min) / (max - min) * 100;
|
|
242
|
-
const updateValue =
|
|
242
|
+
const updateValue = React12.useCallback(
|
|
243
243
|
(clientX) => {
|
|
244
244
|
if (!containerRef.current || disabled) return;
|
|
245
245
|
const rect = containerRef.current.getBoundingClientRect();
|
|
@@ -255,7 +255,7 @@ var Slider = ({
|
|
|
255
255
|
},
|
|
256
256
|
[min, max, step, disabled, controlledValue, onChange]
|
|
257
257
|
);
|
|
258
|
-
const handleMouseDown =
|
|
258
|
+
const handleMouseDown = React12.useCallback(
|
|
259
259
|
(e) => {
|
|
260
260
|
if (disabled) return;
|
|
261
261
|
e.preventDefault();
|
|
@@ -265,7 +265,7 @@ var Slider = ({
|
|
|
265
265
|
},
|
|
266
266
|
[disabled, onDragStart, updateValue]
|
|
267
267
|
);
|
|
268
|
-
|
|
268
|
+
React12.useEffect(() => {
|
|
269
269
|
if (!isDragging) return;
|
|
270
270
|
const handleMouseMove = (e) => {
|
|
271
271
|
updateValue(e.clientX);
|
|
@@ -281,7 +281,7 @@ var Slider = ({
|
|
|
281
281
|
document.removeEventListener("mouseup", handleMouseUp);
|
|
282
282
|
};
|
|
283
283
|
}, [isDragging, updateValue, onDragEnd]);
|
|
284
|
-
const handleKeyDown =
|
|
284
|
+
const handleKeyDown = React12.useCallback(
|
|
285
285
|
(e) => {
|
|
286
286
|
if (disabled) return;
|
|
287
287
|
let newValue = value;
|
|
@@ -314,7 +314,7 @@ var Slider = ({
|
|
|
314
314
|
},
|
|
315
315
|
[disabled, value, min, max, step, controlledValue, onChange]
|
|
316
316
|
);
|
|
317
|
-
return /* @__PURE__ */
|
|
317
|
+
return /* @__PURE__ */ React12__default.default.createElement(
|
|
318
318
|
SliderContainer,
|
|
319
319
|
{
|
|
320
320
|
ref: containerRef,
|
|
@@ -330,9 +330,9 @@ var Slider = ({
|
|
|
330
330
|
"aria-valuenow": value,
|
|
331
331
|
"aria-disabled": disabled
|
|
332
332
|
},
|
|
333
|
-
/* @__PURE__ */
|
|
334
|
-
/* @__PURE__ */
|
|
335
|
-
/* @__PURE__ */
|
|
333
|
+
/* @__PURE__ */ React12__default.default.createElement(SliderTrack, { $disabled: disabled }),
|
|
334
|
+
/* @__PURE__ */ React12__default.default.createElement(SliderFill, { $percentage: percentage, $disabled: disabled }),
|
|
335
|
+
/* @__PURE__ */ React12__default.default.createElement(
|
|
336
336
|
SliderThumb,
|
|
337
337
|
{
|
|
338
338
|
$percentage: percentage,
|
|
@@ -343,23 +343,7 @@ var Slider = ({
|
|
|
343
343
|
);
|
|
344
344
|
};
|
|
345
345
|
Slider.displayName = "Slider";
|
|
346
|
-
|
|
347
|
-
// src/Button/SpinButton.tsx
|
|
348
|
-
var SpinButtonWrapper = styled3__default.default.div`
|
|
349
|
-
display: inline-flex;
|
|
350
|
-
align-items: center;
|
|
351
|
-
gap: ${({ $showSlider }) => $showSlider ? "0" : "0"};
|
|
352
|
-
width: ${({ $showSlider }) => $showSlider ? "100%" : "auto"};
|
|
353
|
-
`;
|
|
354
|
-
var SliderWrapper = styled3__default.default.div`
|
|
355
|
-
flex: 1;
|
|
356
|
-
display: flex;
|
|
357
|
-
align-items: center;
|
|
358
|
-
padding: ${({ $size }) => $size === "small" ? "7px 0" : "7px 0"};
|
|
359
|
-
padding-right: ${({ $size }) => $size === "small" ? "83px" : "72px"};
|
|
360
|
-
min-width: 0;
|
|
361
|
-
`;
|
|
362
|
-
var SpinButtonContainer = styled3__default.default.div`
|
|
346
|
+
var NumberInputContainer = styled3__default.default.div`
|
|
363
347
|
display: inline-flex;
|
|
364
348
|
align-items: center;
|
|
365
349
|
background: white;
|
|
@@ -409,6 +393,25 @@ var InputWrapper = styled3__default.default.div`
|
|
|
409
393
|
align-items: center;
|
|
410
394
|
padding: 0 8px;
|
|
411
395
|
min-width: 0;
|
|
396
|
+
gap: 4px;
|
|
397
|
+
`;
|
|
398
|
+
var UnitText = styled3__default.default.span`
|
|
399
|
+
flex-shrink: 0;
|
|
400
|
+
font-family: 'PingFang SC', sans-serif;
|
|
401
|
+
font-weight: 400;
|
|
402
|
+
line-height: 20px;
|
|
403
|
+
|
|
404
|
+
${({ $size }) => $size === "small" ? `
|
|
405
|
+
font-size: 12px;
|
|
406
|
+
` : `
|
|
407
|
+
font-size: 13px;
|
|
408
|
+
`}
|
|
409
|
+
|
|
410
|
+
${({ $disabled, theme }) => $disabled ? `
|
|
411
|
+
color: ${theme.colors.palettes.transparency["30"]};
|
|
412
|
+
` : `
|
|
413
|
+
color: ${theme.colors.palettes.gray["120"]};
|
|
414
|
+
`}
|
|
412
415
|
`;
|
|
413
416
|
var StyledInput = styled3__default.default.input`
|
|
414
417
|
width: 100%;
|
|
@@ -446,6 +449,7 @@ var StyledInput = styled3__default.default.input`
|
|
|
446
449
|
}
|
|
447
450
|
|
|
448
451
|
&[type='number'] {
|
|
452
|
+
appearance: textfield;
|
|
449
453
|
-moz-appearance: textfield;
|
|
450
454
|
}
|
|
451
455
|
`;
|
|
@@ -512,9 +516,9 @@ var StepButton = styled3__default.default.button`
|
|
|
512
516
|
fill: ${({ $disabled, theme }) => $disabled ? theme.colors.palettes.transparency["30"] : theme.colors.palettes.gray["120"]};
|
|
513
517
|
}
|
|
514
518
|
`;
|
|
515
|
-
var UpArrow = () => /* @__PURE__ */
|
|
516
|
-
var DownArrow = () => /* @__PURE__ */
|
|
517
|
-
var
|
|
519
|
+
var UpArrow = () => /* @__PURE__ */ React12__default.default.createElement("svg", { viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React12__default.default.createElement("path", { d: "M7 4.5L10.5 8.5H3.5L7 4.5Z", fill: "currentColor" }));
|
|
520
|
+
var DownArrow = () => /* @__PURE__ */ React12__default.default.createElement("svg", { viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React12__default.default.createElement("path", { d: "M7 9.5L3.5 5.5H10.5L7 9.5Z", fill: "currentColor" }));
|
|
521
|
+
var NumberInput = ({
|
|
518
522
|
value: controlledValue,
|
|
519
523
|
defaultValue = 0,
|
|
520
524
|
min = -Infinity,
|
|
@@ -523,20 +527,20 @@ var SpinButton = ({
|
|
|
523
527
|
size = "large",
|
|
524
528
|
disabled = false,
|
|
525
529
|
alert = false,
|
|
526
|
-
showSlider = false,
|
|
527
530
|
precision,
|
|
528
531
|
formatter,
|
|
529
532
|
parser,
|
|
533
|
+
unit,
|
|
530
534
|
onChange,
|
|
531
535
|
className,
|
|
532
536
|
style
|
|
533
537
|
}) => {
|
|
534
|
-
const [internalValue, setInternalValue] =
|
|
535
|
-
const [displayValue, setDisplayValue] =
|
|
536
|
-
const [isFocused, setIsFocused] =
|
|
537
|
-
const inputRef =
|
|
538
|
+
const [internalValue, setInternalValue] = React12.useState(controlledValue ?? defaultValue);
|
|
539
|
+
const [displayValue, setDisplayValue] = React12.useState("");
|
|
540
|
+
const [isFocused, setIsFocused] = React12.useState(false);
|
|
541
|
+
const inputRef = React12.useRef(null);
|
|
538
542
|
const value = controlledValue !== void 0 ? controlledValue : internalValue;
|
|
539
|
-
const formatValue =
|
|
543
|
+
const formatValue = React12.useCallback(
|
|
540
544
|
(val) => {
|
|
541
545
|
if (formatter) {
|
|
542
546
|
return formatter(val);
|
|
@@ -548,7 +552,7 @@ var SpinButton = ({
|
|
|
548
552
|
},
|
|
549
553
|
[formatter, precision]
|
|
550
554
|
);
|
|
551
|
-
const parseValue =
|
|
555
|
+
const parseValue = React12.useCallback(
|
|
552
556
|
(displayVal) => {
|
|
553
557
|
if (parser) {
|
|
554
558
|
return parser(displayVal);
|
|
@@ -558,18 +562,18 @@ var SpinButton = ({
|
|
|
558
562
|
},
|
|
559
563
|
[parser]
|
|
560
564
|
);
|
|
561
|
-
|
|
565
|
+
React12.useEffect(() => {
|
|
562
566
|
if (!isFocused) {
|
|
563
567
|
setDisplayValue(formatValue(value));
|
|
564
568
|
}
|
|
565
569
|
}, [value, isFocused, formatValue]);
|
|
566
|
-
const clampValue =
|
|
570
|
+
const clampValue = React12.useCallback(
|
|
567
571
|
(val) => {
|
|
568
572
|
return Math.max(min, Math.min(max, val));
|
|
569
573
|
},
|
|
570
574
|
[min, max]
|
|
571
575
|
);
|
|
572
|
-
const handleValueChange =
|
|
576
|
+
const handleValueChange = React12.useCallback(
|
|
573
577
|
(newValue) => {
|
|
574
578
|
const clampedValue = clampValue(newValue);
|
|
575
579
|
if (controlledValue === void 0) {
|
|
@@ -579,18 +583,18 @@ var SpinButton = ({
|
|
|
579
583
|
},
|
|
580
584
|
[clampValue, controlledValue, onChange]
|
|
581
585
|
);
|
|
582
|
-
const increment =
|
|
586
|
+
const increment = React12.useCallback(() => {
|
|
583
587
|
if (disabled) return;
|
|
584
588
|
handleValueChange(value + step);
|
|
585
589
|
}, [disabled, value, step, handleValueChange]);
|
|
586
|
-
const decrement =
|
|
590
|
+
const decrement = React12.useCallback(() => {
|
|
587
591
|
if (disabled) return;
|
|
588
592
|
handleValueChange(value - step);
|
|
589
593
|
}, [disabled, value, step, handleValueChange]);
|
|
590
|
-
const handleInputChange =
|
|
594
|
+
const handleInputChange = React12.useCallback((e) => {
|
|
591
595
|
setDisplayValue(e.target.value);
|
|
592
596
|
}, []);
|
|
593
|
-
const handleBlur =
|
|
597
|
+
const handleBlur = React12.useCallback(() => {
|
|
594
598
|
setIsFocused(false);
|
|
595
599
|
const parsed = parseValue(displayValue);
|
|
596
600
|
if (parsed !== null) {
|
|
@@ -599,11 +603,11 @@ var SpinButton = ({
|
|
|
599
603
|
setDisplayValue(formatValue(value));
|
|
600
604
|
}
|
|
601
605
|
}, [displayValue, parseValue, handleValueChange, value, formatValue]);
|
|
602
|
-
const handleFocus =
|
|
606
|
+
const handleFocus = React12.useCallback(() => {
|
|
603
607
|
setIsFocused(true);
|
|
604
608
|
setDisplayValue(String(value));
|
|
605
609
|
}, [value]);
|
|
606
|
-
const handleKeyDown =
|
|
610
|
+
const handleKeyDown = React12.useCallback(
|
|
607
611
|
(e) => {
|
|
608
612
|
if (e.key === "ArrowUp") {
|
|
609
613
|
e.preventDefault();
|
|
@@ -617,7 +621,105 @@ var SpinButton = ({
|
|
|
617
621
|
},
|
|
618
622
|
[increment, decrement]
|
|
619
623
|
);
|
|
620
|
-
return /* @__PURE__ */
|
|
624
|
+
return /* @__PURE__ */ React12__default.default.createElement(
|
|
625
|
+
NumberInputContainer,
|
|
626
|
+
{
|
|
627
|
+
$size: size,
|
|
628
|
+
$disabled: disabled,
|
|
629
|
+
$alert: alert,
|
|
630
|
+
$isFocused: isFocused,
|
|
631
|
+
className,
|
|
632
|
+
style
|
|
633
|
+
},
|
|
634
|
+
/* @__PURE__ */ React12__default.default.createElement(InputWrapper, null, /* @__PURE__ */ React12__default.default.createElement(
|
|
635
|
+
StyledInput,
|
|
636
|
+
{
|
|
637
|
+
ref: inputRef,
|
|
638
|
+
type: "text",
|
|
639
|
+
value: displayValue,
|
|
640
|
+
onChange: handleInputChange,
|
|
641
|
+
onFocus: handleFocus,
|
|
642
|
+
onBlur: handleBlur,
|
|
643
|
+
onKeyDown: handleKeyDown,
|
|
644
|
+
disabled,
|
|
645
|
+
$size: size,
|
|
646
|
+
$disabled: disabled
|
|
647
|
+
}
|
|
648
|
+
), unit && /* @__PURE__ */ React12__default.default.createElement(UnitText, { $size: size, $disabled: disabled }, unit)),
|
|
649
|
+
/* @__PURE__ */ React12__default.default.createElement(ButtonGroup, { $alert: alert, $disabled: disabled }, /* @__PURE__ */ React12__default.default.createElement(
|
|
650
|
+
StepButton,
|
|
651
|
+
{
|
|
652
|
+
type: "button",
|
|
653
|
+
$position: "up",
|
|
654
|
+
$alert: alert,
|
|
655
|
+
$disabled: disabled,
|
|
656
|
+
onClick: increment,
|
|
657
|
+
disabled,
|
|
658
|
+
tabIndex: -1
|
|
659
|
+
},
|
|
660
|
+
/* @__PURE__ */ React12__default.default.createElement(UpArrow, null)
|
|
661
|
+
), /* @__PURE__ */ React12__default.default.createElement(
|
|
662
|
+
StepButton,
|
|
663
|
+
{
|
|
664
|
+
type: "button",
|
|
665
|
+
$position: "down",
|
|
666
|
+
$alert: alert,
|
|
667
|
+
$disabled: disabled,
|
|
668
|
+
onClick: decrement,
|
|
669
|
+
disabled,
|
|
670
|
+
tabIndex: -1
|
|
671
|
+
},
|
|
672
|
+
/* @__PURE__ */ React12__default.default.createElement(DownArrow, null)
|
|
673
|
+
))
|
|
674
|
+
);
|
|
675
|
+
};
|
|
676
|
+
NumberInput.displayName = "NumberInput";
|
|
677
|
+
|
|
678
|
+
// src/Button/SpinButton.tsx
|
|
679
|
+
var SpinButtonWrapper = styled3__default.default.div`
|
|
680
|
+
display: inline-flex;
|
|
681
|
+
align-items: center;
|
|
682
|
+
gap: ${({ $showSlider }) => $showSlider ? "0" : "0"};
|
|
683
|
+
width: ${({ $showSlider }) => $showSlider ? "100%" : "auto"};
|
|
684
|
+
`;
|
|
685
|
+
var SliderWrapper = styled3__default.default.div`
|
|
686
|
+
flex: 1;
|
|
687
|
+
display: flex;
|
|
688
|
+
align-items: center;
|
|
689
|
+
padding: ${({ $size }) => $size === "small" ? "7px 0" : "7px 0"};
|
|
690
|
+
padding-right: ${({ $size }) => $size === "small" ? "83px" : "72px"};
|
|
691
|
+
min-width: 0;
|
|
692
|
+
`;
|
|
693
|
+
var SpinButton = ({
|
|
694
|
+
value: controlledValue,
|
|
695
|
+
defaultValue = 0,
|
|
696
|
+
min = -Infinity,
|
|
697
|
+
max = Infinity,
|
|
698
|
+
step = 1,
|
|
699
|
+
size = "large",
|
|
700
|
+
disabled = false,
|
|
701
|
+
alert = false,
|
|
702
|
+
showSlider = false,
|
|
703
|
+
precision,
|
|
704
|
+
formatter,
|
|
705
|
+
parser,
|
|
706
|
+
onChange,
|
|
707
|
+
className,
|
|
708
|
+
style
|
|
709
|
+
}) => {
|
|
710
|
+
const [internalValue, setInternalValue] = React12.useState(controlledValue ?? defaultValue);
|
|
711
|
+
const value = controlledValue !== void 0 ? controlledValue : internalValue;
|
|
712
|
+
const handleValueChange = React12.useCallback(
|
|
713
|
+
(newValue) => {
|
|
714
|
+
if (newValue === null) return;
|
|
715
|
+
if (controlledValue === void 0) {
|
|
716
|
+
setInternalValue(newValue);
|
|
717
|
+
}
|
|
718
|
+
onChange?.(newValue);
|
|
719
|
+
},
|
|
720
|
+
[controlledValue, onChange]
|
|
721
|
+
);
|
|
722
|
+
return /* @__PURE__ */ React12__default.default.createElement(SpinButtonWrapper, { $showSlider: showSlider, className, style }, showSlider && /* @__PURE__ */ React12__default.default.createElement(SliderWrapper, { $size: size }, /* @__PURE__ */ React12__default.default.createElement(
|
|
621
723
|
Slider,
|
|
622
724
|
{
|
|
623
725
|
value,
|
|
@@ -625,47 +727,24 @@ var SpinButton = ({
|
|
|
625
727
|
max,
|
|
626
728
|
step,
|
|
627
729
|
disabled,
|
|
628
|
-
onChange:
|
|
730
|
+
onChange: handleValueChange
|
|
629
731
|
}
|
|
630
|
-
)), /* @__PURE__ */
|
|
631
|
-
|
|
732
|
+
)), /* @__PURE__ */ React12__default.default.createElement(
|
|
733
|
+
NumberInput,
|
|
632
734
|
{
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
onBlur: handleBlur,
|
|
639
|
-
onKeyDown: handleKeyDown,
|
|
735
|
+
value,
|
|
736
|
+
min,
|
|
737
|
+
max,
|
|
738
|
+
step,
|
|
739
|
+
size,
|
|
640
740
|
disabled,
|
|
641
|
-
|
|
642
|
-
|
|
741
|
+
alert,
|
|
742
|
+
precision,
|
|
743
|
+
formatter,
|
|
744
|
+
parser,
|
|
745
|
+
onChange: handleValueChange
|
|
643
746
|
}
|
|
644
|
-
))
|
|
645
|
-
StepButton,
|
|
646
|
-
{
|
|
647
|
-
type: "button",
|
|
648
|
-
$position: "up",
|
|
649
|
-
$alert: alert,
|
|
650
|
-
$disabled: disabled,
|
|
651
|
-
onClick: increment,
|
|
652
|
-
disabled,
|
|
653
|
-
tabIndex: -1
|
|
654
|
-
},
|
|
655
|
-
/* @__PURE__ */ React11__default.default.createElement(UpArrow, null)
|
|
656
|
-
), /* @__PURE__ */ React11__default.default.createElement(
|
|
657
|
-
StepButton,
|
|
658
|
-
{
|
|
659
|
-
type: "button",
|
|
660
|
-
$position: "down",
|
|
661
|
-
$alert: alert,
|
|
662
|
-
$disabled: disabled,
|
|
663
|
-
onClick: decrement,
|
|
664
|
-
disabled,
|
|
665
|
-
tabIndex: -1
|
|
666
|
-
},
|
|
667
|
-
/* @__PURE__ */ React11__default.default.createElement(DownArrow, null)
|
|
668
|
-
))));
|
|
747
|
+
));
|
|
669
748
|
};
|
|
670
749
|
SpinButton.displayName = "SpinButton";
|
|
671
750
|
var SwitchContainer = styled3__default.default.label`
|
|
@@ -790,12 +869,12 @@ var Switch = ({
|
|
|
790
869
|
className,
|
|
791
870
|
style
|
|
792
871
|
}) => {
|
|
793
|
-
const [internalChecked, setInternalChecked] =
|
|
872
|
+
const [internalChecked, setInternalChecked] = React12.useState(
|
|
794
873
|
controlledChecked ?? defaultChecked
|
|
795
874
|
);
|
|
796
|
-
const [isFocused, setIsFocused] =
|
|
875
|
+
const [isFocused, setIsFocused] = React12.useState(false);
|
|
797
876
|
const checked = controlledChecked !== void 0 ? controlledChecked : internalChecked;
|
|
798
|
-
const handleChange =
|
|
877
|
+
const handleChange = React12.useCallback(
|
|
799
878
|
(e) => {
|
|
800
879
|
if (disabled) return;
|
|
801
880
|
const newChecked = e.target.checked;
|
|
@@ -806,13 +885,13 @@ var Switch = ({
|
|
|
806
885
|
},
|
|
807
886
|
[disabled, controlledChecked, onChange]
|
|
808
887
|
);
|
|
809
|
-
const handleFocus =
|
|
888
|
+
const handleFocus = React12.useCallback(() => {
|
|
810
889
|
setIsFocused(true);
|
|
811
890
|
}, []);
|
|
812
|
-
const handleBlur =
|
|
891
|
+
const handleBlur = React12.useCallback(() => {
|
|
813
892
|
setIsFocused(false);
|
|
814
893
|
}, []);
|
|
815
|
-
return /* @__PURE__ */
|
|
894
|
+
return /* @__PURE__ */ React12__default.default.createElement(
|
|
816
895
|
SwitchContainer,
|
|
817
896
|
{
|
|
818
897
|
$size: size,
|
|
@@ -821,7 +900,7 @@ var Switch = ({
|
|
|
821
900
|
className,
|
|
822
901
|
style
|
|
823
902
|
},
|
|
824
|
-
/* @__PURE__ */
|
|
903
|
+
/* @__PURE__ */ React12__default.default.createElement(
|
|
825
904
|
HiddenInput,
|
|
826
905
|
{
|
|
827
906
|
type: "checkbox",
|
|
@@ -832,7 +911,7 @@ var Switch = ({
|
|
|
832
911
|
disabled
|
|
833
912
|
}
|
|
834
913
|
),
|
|
835
|
-
/* @__PURE__ */
|
|
914
|
+
/* @__PURE__ */ React12__default.default.createElement(
|
|
836
915
|
Track,
|
|
837
916
|
{
|
|
838
917
|
$size: size,
|
|
@@ -841,7 +920,7 @@ var Switch = ({
|
|
|
841
920
|
$isFocused: isFocused
|
|
842
921
|
}
|
|
843
922
|
),
|
|
844
|
-
/* @__PURE__ */
|
|
923
|
+
/* @__PURE__ */ React12__default.default.createElement(
|
|
845
924
|
Thumb,
|
|
846
925
|
{
|
|
847
926
|
$size: size,
|
|
@@ -946,12 +1025,12 @@ var Radio = ({
|
|
|
946
1025
|
className,
|
|
947
1026
|
style
|
|
948
1027
|
}) => {
|
|
949
|
-
const [internalChecked, setInternalChecked] =
|
|
1028
|
+
const [internalChecked, setInternalChecked] = React12.useState(
|
|
950
1029
|
controlledChecked ?? defaultChecked
|
|
951
1030
|
);
|
|
952
|
-
const [isFocused, setIsFocused] =
|
|
1031
|
+
const [isFocused, setIsFocused] = React12.useState(false);
|
|
953
1032
|
const checked = controlledChecked !== void 0 ? controlledChecked : internalChecked;
|
|
954
|
-
const handleChange =
|
|
1033
|
+
const handleChange = React12.useCallback(
|
|
955
1034
|
(e) => {
|
|
956
1035
|
if (disabled) return;
|
|
957
1036
|
const newChecked = e.target.checked;
|
|
@@ -962,20 +1041,20 @@ var Radio = ({
|
|
|
962
1041
|
},
|
|
963
1042
|
[disabled, controlledChecked, onChange]
|
|
964
1043
|
);
|
|
965
|
-
const handleFocus =
|
|
1044
|
+
const handleFocus = React12.useCallback(() => {
|
|
966
1045
|
setIsFocused(true);
|
|
967
1046
|
}, []);
|
|
968
|
-
const handleBlur =
|
|
1047
|
+
const handleBlur = React12.useCallback(() => {
|
|
969
1048
|
setIsFocused(false);
|
|
970
1049
|
}, []);
|
|
971
|
-
return /* @__PURE__ */
|
|
1050
|
+
return /* @__PURE__ */ React12__default.default.createElement(
|
|
972
1051
|
RadioContainer,
|
|
973
1052
|
{
|
|
974
1053
|
$disabled: disabled,
|
|
975
1054
|
className,
|
|
976
1055
|
style
|
|
977
1056
|
},
|
|
978
|
-
/* @__PURE__ */
|
|
1057
|
+
/* @__PURE__ */ React12__default.default.createElement(
|
|
979
1058
|
HiddenInput2,
|
|
980
1059
|
{
|
|
981
1060
|
type: "radio",
|
|
@@ -989,7 +1068,7 @@ var Radio = ({
|
|
|
989
1068
|
disabled
|
|
990
1069
|
}
|
|
991
1070
|
),
|
|
992
|
-
/* @__PURE__ */
|
|
1071
|
+
/* @__PURE__ */ React12__default.default.createElement(
|
|
993
1072
|
RadioOuter,
|
|
994
1073
|
{
|
|
995
1074
|
$checked: checked,
|
|
@@ -997,7 +1076,7 @@ var Radio = ({
|
|
|
997
1076
|
$isFocused: isFocused
|
|
998
1077
|
}
|
|
999
1078
|
),
|
|
1000
|
-
/* @__PURE__ */
|
|
1079
|
+
/* @__PURE__ */ React12__default.default.createElement(
|
|
1001
1080
|
RadioInner,
|
|
1002
1081
|
{
|
|
1003
1082
|
$checked: checked,
|
|
@@ -1125,18 +1204,18 @@ var Checkbox = ({
|
|
|
1125
1204
|
className,
|
|
1126
1205
|
style
|
|
1127
1206
|
}) => {
|
|
1128
|
-
const [internalChecked, setInternalChecked] =
|
|
1207
|
+
const [internalChecked, setInternalChecked] = React12.useState(
|
|
1129
1208
|
controlledChecked ?? defaultChecked
|
|
1130
1209
|
);
|
|
1131
|
-
const [isFocused, setIsFocused] =
|
|
1132
|
-
const inputRef =
|
|
1210
|
+
const [isFocused, setIsFocused] = React12.useState(false);
|
|
1211
|
+
const inputRef = React12.useRef(null);
|
|
1133
1212
|
const checked = controlledChecked !== void 0 ? controlledChecked : internalChecked;
|
|
1134
|
-
|
|
1213
|
+
React12.useEffect(() => {
|
|
1135
1214
|
if (inputRef.current) {
|
|
1136
1215
|
inputRef.current.indeterminate = indeterminate;
|
|
1137
1216
|
}
|
|
1138
1217
|
}, [indeterminate]);
|
|
1139
|
-
const handleChange =
|
|
1218
|
+
const handleChange = React12.useCallback(
|
|
1140
1219
|
(e) => {
|
|
1141
1220
|
if (disabled) return;
|
|
1142
1221
|
const newChecked = e.target.checked;
|
|
@@ -1147,20 +1226,20 @@ var Checkbox = ({
|
|
|
1147
1226
|
},
|
|
1148
1227
|
[disabled, controlledChecked, onChange]
|
|
1149
1228
|
);
|
|
1150
|
-
const handleFocus =
|
|
1229
|
+
const handleFocus = React12.useCallback(() => {
|
|
1151
1230
|
setIsFocused(true);
|
|
1152
1231
|
}, []);
|
|
1153
|
-
const handleBlur =
|
|
1232
|
+
const handleBlur = React12.useCallback(() => {
|
|
1154
1233
|
setIsFocused(false);
|
|
1155
1234
|
}, []);
|
|
1156
|
-
return /* @__PURE__ */
|
|
1235
|
+
return /* @__PURE__ */ React12__default.default.createElement(
|
|
1157
1236
|
CheckboxContainer,
|
|
1158
1237
|
{
|
|
1159
1238
|
$disabled: disabled,
|
|
1160
1239
|
className,
|
|
1161
1240
|
style
|
|
1162
1241
|
},
|
|
1163
|
-
/* @__PURE__ */
|
|
1242
|
+
/* @__PURE__ */ React12__default.default.createElement(
|
|
1164
1243
|
HiddenInput3,
|
|
1165
1244
|
{
|
|
1166
1245
|
ref: inputRef,
|
|
@@ -1175,7 +1254,7 @@ var Checkbox = ({
|
|
|
1175
1254
|
disabled
|
|
1176
1255
|
}
|
|
1177
1256
|
),
|
|
1178
|
-
/* @__PURE__ */
|
|
1257
|
+
/* @__PURE__ */ React12__default.default.createElement(
|
|
1179
1258
|
CheckboxBox,
|
|
1180
1259
|
{
|
|
1181
1260
|
$checked: checked,
|
|
@@ -1184,8 +1263,8 @@ var Checkbox = ({
|
|
|
1184
1263
|
$isFocused: isFocused
|
|
1185
1264
|
}
|
|
1186
1265
|
),
|
|
1187
|
-
!indeterminate && /* @__PURE__ */
|
|
1188
|
-
indeterminate && /* @__PURE__ */
|
|
1266
|
+
!indeterminate && /* @__PURE__ */ React12__default.default.createElement(IconWrapper2, { $visible: checked }, /* @__PURE__ */ React12__default.default.createElement("svg", { width: 10, height: 8, viewBox: "0 0 10 8", fill: "#fff" }, /* @__PURE__ */ React12__default.default.createElement("path", { d: "M1.05426 3.16164L0 4.27945L3.50904 8L10 1.11781L8.94573 0L3.50904 5.76438L1.05426 3.16164Z" }))),
|
|
1267
|
+
indeterminate && /* @__PURE__ */ React12__default.default.createElement(IconWrapper2, { $visible: indeterminate }, /* @__PURE__ */ React12__default.default.createElement(DefaultIndeterminateIcon, null))
|
|
1189
1268
|
);
|
|
1190
1269
|
};
|
|
1191
1270
|
Checkbox.displayName = "Checkbox";
|
|
@@ -1315,7 +1394,7 @@ var SuffixNode = styled3__default.default.div`
|
|
|
1315
1394
|
`;
|
|
1316
1395
|
}}
|
|
1317
1396
|
`;
|
|
1318
|
-
var Input =
|
|
1397
|
+
var Input = React12.forwardRef(
|
|
1319
1398
|
({
|
|
1320
1399
|
size = "medium",
|
|
1321
1400
|
error = false,
|
|
@@ -1329,7 +1408,7 @@ var Input = React11.forwardRef(
|
|
|
1329
1408
|
onBlur,
|
|
1330
1409
|
...rest
|
|
1331
1410
|
}, ref) => {
|
|
1332
|
-
const [isFocused, setIsFocused] =
|
|
1411
|
+
const [isFocused, setIsFocused] = React12.useState(false);
|
|
1333
1412
|
const handleFocus = (e) => {
|
|
1334
1413
|
setIsFocused(true);
|
|
1335
1414
|
onFocus?.(e);
|
|
@@ -1338,7 +1417,7 @@ var Input = React11.forwardRef(
|
|
|
1338
1417
|
setIsFocused(false);
|
|
1339
1418
|
onBlur?.(e);
|
|
1340
1419
|
};
|
|
1341
|
-
return /* @__PURE__ */
|
|
1420
|
+
return /* @__PURE__ */ React12__default.default.createElement(
|
|
1342
1421
|
InputWrapper2,
|
|
1343
1422
|
{
|
|
1344
1423
|
$size: size,
|
|
@@ -1349,8 +1428,8 @@ var Input = React11.forwardRef(
|
|
|
1349
1428
|
className,
|
|
1350
1429
|
style
|
|
1351
1430
|
},
|
|
1352
|
-
prefixNode && /* @__PURE__ */
|
|
1353
|
-
/* @__PURE__ */
|
|
1431
|
+
prefixNode && /* @__PURE__ */ React12__default.default.createElement(PrefixNode, { $size: size }, prefixNode),
|
|
1432
|
+
/* @__PURE__ */ React12__default.default.createElement(
|
|
1354
1433
|
StyledInput2,
|
|
1355
1434
|
{
|
|
1356
1435
|
ref,
|
|
@@ -1364,7 +1443,7 @@ var Input = React11.forwardRef(
|
|
|
1364
1443
|
...rest
|
|
1365
1444
|
}
|
|
1366
1445
|
),
|
|
1367
|
-
suffixNode && /* @__PURE__ */
|
|
1446
|
+
suffixNode && /* @__PURE__ */ React12__default.default.createElement(SuffixNode, { $size: size }, suffixNode)
|
|
1368
1447
|
);
|
|
1369
1448
|
}
|
|
1370
1449
|
);
|
|
@@ -1424,7 +1503,7 @@ var ClearButton = styled3__default.default.button`
|
|
|
1424
1503
|
opacity: 0.5;
|
|
1425
1504
|
}
|
|
1426
1505
|
`;
|
|
1427
|
-
var DefaultSearchIcon = () => /* @__PURE__ */
|
|
1506
|
+
var DefaultSearchIcon = () => /* @__PURE__ */ React12__default.default.createElement("svg", { viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React12__default.default.createElement(
|
|
1428
1507
|
"path",
|
|
1429
1508
|
{
|
|
1430
1509
|
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",
|
|
@@ -1433,7 +1512,7 @@ var DefaultSearchIcon = () => /* @__PURE__ */ React11__default.default.createEle
|
|
|
1433
1512
|
strokeLinecap: "round",
|
|
1434
1513
|
strokeLinejoin: "round"
|
|
1435
1514
|
}
|
|
1436
|
-
), /* @__PURE__ */
|
|
1515
|
+
), /* @__PURE__ */ React12__default.default.createElement(
|
|
1437
1516
|
"path",
|
|
1438
1517
|
{
|
|
1439
1518
|
d: "M14 14L11.1 11.1",
|
|
@@ -1443,7 +1522,7 @@ var DefaultSearchIcon = () => /* @__PURE__ */ React11__default.default.createEle
|
|
|
1443
1522
|
strokeLinejoin: "round"
|
|
1444
1523
|
}
|
|
1445
1524
|
));
|
|
1446
|
-
var DefaultCloseIcon = () => /* @__PURE__ */
|
|
1525
|
+
var DefaultCloseIcon = () => /* @__PURE__ */ React12__default.default.createElement("svg", { viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React12__default.default.createElement(
|
|
1447
1526
|
"path",
|
|
1448
1527
|
{
|
|
1449
1528
|
d: "M12 4L4 12",
|
|
@@ -1452,7 +1531,7 @@ var DefaultCloseIcon = () => /* @__PURE__ */ React11__default.default.createElem
|
|
|
1452
1531
|
strokeLinecap: "round",
|
|
1453
1532
|
strokeLinejoin: "round"
|
|
1454
1533
|
}
|
|
1455
|
-
), /* @__PURE__ */
|
|
1534
|
+
), /* @__PURE__ */ React12__default.default.createElement(
|
|
1456
1535
|
"path",
|
|
1457
1536
|
{
|
|
1458
1537
|
d: "M4 4L12 12",
|
|
@@ -1462,7 +1541,7 @@ var DefaultCloseIcon = () => /* @__PURE__ */ React11__default.default.createElem
|
|
|
1462
1541
|
strokeLinejoin: "round"
|
|
1463
1542
|
}
|
|
1464
1543
|
));
|
|
1465
|
-
var SearchInput =
|
|
1544
|
+
var SearchInput = React12.forwardRef(
|
|
1466
1545
|
({
|
|
1467
1546
|
size = "extraLarge",
|
|
1468
1547
|
clearable = true,
|
|
@@ -1475,7 +1554,7 @@ var SearchInput = React11.forwardRef(
|
|
|
1475
1554
|
readOnly,
|
|
1476
1555
|
...rest
|
|
1477
1556
|
}, ref) => {
|
|
1478
|
-
const [internalValue, setInternalValue] =
|
|
1557
|
+
const [internalValue, setInternalValue] = React12.useState(defaultValue || "");
|
|
1479
1558
|
const isControlled = value !== void 0;
|
|
1480
1559
|
const currentValue = isControlled ? value : internalValue;
|
|
1481
1560
|
const handleChange = (e) => {
|
|
@@ -1490,8 +1569,8 @@ var SearchInput = React11.forwardRef(
|
|
|
1490
1569
|
}
|
|
1491
1570
|
onClear?.();
|
|
1492
1571
|
};
|
|
1493
|
-
const prefixNode = /* @__PURE__ */
|
|
1494
|
-
const suffixNode = clearable && currentValue && !disabled && !readOnly ? /* @__PURE__ */
|
|
1572
|
+
const prefixNode = /* @__PURE__ */ React12__default.default.createElement(SearchIconWrapper, { $size: size }, searchIcon || /* @__PURE__ */ React12__default.default.createElement(DefaultSearchIcon, null));
|
|
1573
|
+
const suffixNode = clearable && currentValue && !disabled && !readOnly ? /* @__PURE__ */ React12__default.default.createElement(
|
|
1495
1574
|
ClearButton,
|
|
1496
1575
|
{
|
|
1497
1576
|
$size: size,
|
|
@@ -1499,9 +1578,9 @@ var SearchInput = React11.forwardRef(
|
|
|
1499
1578
|
type: "button",
|
|
1500
1579
|
tabIndex: -1
|
|
1501
1580
|
},
|
|
1502
|
-
/* @__PURE__ */
|
|
1581
|
+
/* @__PURE__ */ React12__default.default.createElement(DefaultCloseIcon, null)
|
|
1503
1582
|
) : null;
|
|
1504
|
-
return /* @__PURE__ */
|
|
1583
|
+
return /* @__PURE__ */ React12__default.default.createElement(
|
|
1505
1584
|
Input,
|
|
1506
1585
|
{
|
|
1507
1586
|
ref,
|
|
@@ -1518,15 +1597,15 @@ var SearchInput = React11.forwardRef(
|
|
|
1518
1597
|
}
|
|
1519
1598
|
);
|
|
1520
1599
|
SearchInput.displayName = "SearchInput";
|
|
1521
|
-
var IconContext =
|
|
1600
|
+
var IconContext = React12.createContext(null);
|
|
1522
1601
|
var IconProvider = ({
|
|
1523
1602
|
icons,
|
|
1524
1603
|
children
|
|
1525
1604
|
}) => {
|
|
1526
|
-
return /* @__PURE__ */
|
|
1605
|
+
return /* @__PURE__ */ React12__default.default.createElement(IconContext.Provider, { value: icons }, children);
|
|
1527
1606
|
};
|
|
1528
1607
|
var useIconRegistry = () => {
|
|
1529
|
-
return
|
|
1608
|
+
return React12.useContext(IconContext);
|
|
1530
1609
|
};
|
|
1531
1610
|
IconProvider.displayName = "IconProvider";
|
|
1532
1611
|
|
|
@@ -1561,7 +1640,7 @@ var Icon = ({
|
|
|
1561
1640
|
const registry = useIconRegistry();
|
|
1562
1641
|
let iconElement = children;
|
|
1563
1642
|
if (!iconElement && src) {
|
|
1564
|
-
iconElement = /* @__PURE__ */
|
|
1643
|
+
iconElement = /* @__PURE__ */ React12__default.default.createElement(
|
|
1565
1644
|
"img",
|
|
1566
1645
|
{
|
|
1567
1646
|
src,
|
|
@@ -1573,7 +1652,7 @@ var Icon = ({
|
|
|
1573
1652
|
if (!iconElement && name && registry) {
|
|
1574
1653
|
const IconComponent = registry[name];
|
|
1575
1654
|
if (IconComponent) {
|
|
1576
|
-
iconElement = /* @__PURE__ */
|
|
1655
|
+
iconElement = /* @__PURE__ */ React12__default.default.createElement(IconComponent, null);
|
|
1577
1656
|
} else if (process.env.NODE_ENV !== "production") {
|
|
1578
1657
|
console.warn(`Icon "${name}" not found in registry. Make sure IconProvider is set up.`);
|
|
1579
1658
|
}
|
|
@@ -1584,7 +1663,7 @@ var Icon = ({
|
|
|
1584
1663
|
}
|
|
1585
1664
|
return null;
|
|
1586
1665
|
}
|
|
1587
|
-
return /* @__PURE__ */
|
|
1666
|
+
return /* @__PURE__ */ React12__default.default.createElement(
|
|
1588
1667
|
IconContainer,
|
|
1589
1668
|
{
|
|
1590
1669
|
$size: size,
|
|
@@ -1688,11 +1767,11 @@ var CloseButton = styled3__default.default.button`
|
|
|
1688
1767
|
color: ${({ theme }) => theme.colors.palettes.gray["120"]};
|
|
1689
1768
|
}
|
|
1690
1769
|
`;
|
|
1691
|
-
var SuccessIcon = () => /* @__PURE__ */
|
|
1692
|
-
var InfoIcon = () => /* @__PURE__ */
|
|
1693
|
-
var ErrorIcon = () => /* @__PURE__ */
|
|
1694
|
-
var WarnIcon = () => /* @__PURE__ */
|
|
1695
|
-
var CloseIconSvg = () => /* @__PURE__ */
|
|
1770
|
+
var SuccessIcon = () => /* @__PURE__ */ React12__default.default.createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React12__default.default.createElement("circle", { cx: "10", cy: "10", r: "8", fill: "#4ea44b" }), /* @__PURE__ */ React12__default.default.createElement("path", { d: "M6 10L9 13L14 7", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }));
|
|
1771
|
+
var InfoIcon = () => /* @__PURE__ */ React12__default.default.createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React12__default.default.createElement("circle", { cx: "10", cy: "10", r: "8", fill: "#5ba0e7" }), /* @__PURE__ */ React12__default.default.createElement("path", { d: "M10 9V14M10 6H10.01", stroke: "white", strokeWidth: "2", strokeLinecap: "round" }));
|
|
1772
|
+
var ErrorIcon = () => /* @__PURE__ */ React12__default.default.createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React12__default.default.createElement("circle", { cx: "10", cy: "10", r: "8", fill: "#e95555" }), /* @__PURE__ */ React12__default.default.createElement("path", { d: "M7 7L13 13M13 7L7 13", stroke: "white", strokeWidth: "2", strokeLinecap: "round" }));
|
|
1773
|
+
var WarnIcon = () => /* @__PURE__ */ React12__default.default.createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React12__default.default.createElement("circle", { cx: "10", cy: "10", r: "8", fill: "#ebe361" }), /* @__PURE__ */ React12__default.default.createElement("path", { d: "M10 6V11M10 14H10.01", stroke: "white", strokeWidth: "2", strokeLinecap: "round" }));
|
|
1774
|
+
var CloseIconSvg = () => /* @__PURE__ */ React12__default.default.createElement("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React12__default.default.createElement("path", { d: "M9 3L3 9M3 3L9 9", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }));
|
|
1696
1775
|
var Toast = ({
|
|
1697
1776
|
variant = "info",
|
|
1698
1777
|
message,
|
|
@@ -1706,8 +1785,8 @@ var Toast = ({
|
|
|
1706
1785
|
className,
|
|
1707
1786
|
style
|
|
1708
1787
|
}) => {
|
|
1709
|
-
const [visible, setVisible] =
|
|
1710
|
-
|
|
1788
|
+
const [visible, setVisible] = React12.useState(true);
|
|
1789
|
+
React12.useEffect(() => {
|
|
1711
1790
|
if (duration > 0) {
|
|
1712
1791
|
const timer = setTimeout(() => {
|
|
1713
1792
|
setVisible(false);
|
|
@@ -1724,13 +1803,13 @@ var Toast = ({
|
|
|
1724
1803
|
return null;
|
|
1725
1804
|
}
|
|
1726
1805
|
const defaultIcons = {
|
|
1727
|
-
success: /* @__PURE__ */
|
|
1728
|
-
info: /* @__PURE__ */
|
|
1729
|
-
error: /* @__PURE__ */
|
|
1730
|
-
warn: /* @__PURE__ */
|
|
1806
|
+
success: /* @__PURE__ */ React12__default.default.createElement(SuccessIcon, null),
|
|
1807
|
+
info: /* @__PURE__ */ React12__default.default.createElement(InfoIcon, null),
|
|
1808
|
+
error: /* @__PURE__ */ React12__default.default.createElement(ErrorIcon, null),
|
|
1809
|
+
warn: /* @__PURE__ */ React12__default.default.createElement(WarnIcon, null)
|
|
1731
1810
|
};
|
|
1732
1811
|
const iconElement = icon || defaultIcons[variant];
|
|
1733
|
-
return /* @__PURE__ */
|
|
1812
|
+
return /* @__PURE__ */ React12__default.default.createElement(
|
|
1734
1813
|
ToastContainer,
|
|
1735
1814
|
{
|
|
1736
1815
|
$variant: variant,
|
|
@@ -1739,9 +1818,9 @@ var Toast = ({
|
|
|
1739
1818
|
role: "alert",
|
|
1740
1819
|
"aria-live": "polite"
|
|
1741
1820
|
},
|
|
1742
|
-
showIcon && /* @__PURE__ */
|
|
1743
|
-
/* @__PURE__ */
|
|
1744
|
-
actionText && onAction && /* @__PURE__ */
|
|
1821
|
+
showIcon && /* @__PURE__ */ React12__default.default.createElement(IconWrapper3, { $variant: variant }, iconElement),
|
|
1822
|
+
/* @__PURE__ */ React12__default.default.createElement(Message, null, message),
|
|
1823
|
+
actionText && onAction && /* @__PURE__ */ React12__default.default.createElement(
|
|
1745
1824
|
ActionButton,
|
|
1746
1825
|
{
|
|
1747
1826
|
$variant: variant,
|
|
@@ -1750,19 +1829,19 @@ var Toast = ({
|
|
|
1750
1829
|
},
|
|
1751
1830
|
actionText
|
|
1752
1831
|
),
|
|
1753
|
-
closable && /* @__PURE__ */
|
|
1832
|
+
closable && /* @__PURE__ */ React12__default.default.createElement(
|
|
1754
1833
|
CloseButton,
|
|
1755
1834
|
{
|
|
1756
1835
|
onClick: handleClose,
|
|
1757
1836
|
type: "button",
|
|
1758
1837
|
"aria-label": "Close"
|
|
1759
1838
|
},
|
|
1760
|
-
/* @__PURE__ */
|
|
1839
|
+
/* @__PURE__ */ React12__default.default.createElement(CloseIconSvg, null)
|
|
1761
1840
|
)
|
|
1762
1841
|
);
|
|
1763
1842
|
};
|
|
1764
1843
|
Toast.displayName = "Toast";
|
|
1765
|
-
var ToastContext =
|
|
1844
|
+
var ToastContext = React12.createContext(null);
|
|
1766
1845
|
var ToastWrapper = styled3__default.default.div`
|
|
1767
1846
|
position: fixed;
|
|
1768
1847
|
top: 24px;
|
|
@@ -1782,8 +1861,8 @@ var ToastContainer2 = ({
|
|
|
1782
1861
|
defaultDuration = 3e3,
|
|
1783
1862
|
children
|
|
1784
1863
|
}) => {
|
|
1785
|
-
const [toasts, setToasts] =
|
|
1786
|
-
const showToast =
|
|
1864
|
+
const [toasts, setToasts] = React12.useState([]);
|
|
1865
|
+
const showToast = React12.useCallback((props) => {
|
|
1787
1866
|
const id = `toast-${Date.now()}-${Math.random()}`;
|
|
1788
1867
|
const newToast = {
|
|
1789
1868
|
...props,
|
|
@@ -1796,19 +1875,19 @@ var ToastContainer2 = ({
|
|
|
1796
1875
|
});
|
|
1797
1876
|
return id;
|
|
1798
1877
|
}, [maxCount, defaultDuration]);
|
|
1799
|
-
const hideToast =
|
|
1878
|
+
const hideToast = React12.useCallback((id) => {
|
|
1800
1879
|
setToasts((prev) => prev.filter((toast) => toast.id !== id));
|
|
1801
1880
|
}, []);
|
|
1802
|
-
const success =
|
|
1881
|
+
const success = React12.useCallback((message, options) => {
|
|
1803
1882
|
return showToast({ ...options, variant: "success", message });
|
|
1804
1883
|
}, [showToast]);
|
|
1805
|
-
const info =
|
|
1884
|
+
const info = React12.useCallback((message, options) => {
|
|
1806
1885
|
return showToast({ ...options, variant: "info", message });
|
|
1807
1886
|
}, [showToast]);
|
|
1808
|
-
const error =
|
|
1887
|
+
const error = React12.useCallback((message, options) => {
|
|
1809
1888
|
return showToast({ ...options, variant: "error", message });
|
|
1810
1889
|
}, [showToast]);
|
|
1811
|
-
const warn =
|
|
1890
|
+
const warn = React12.useCallback((message, options) => {
|
|
1812
1891
|
return showToast({ ...options, variant: "warn", message });
|
|
1813
1892
|
}, [showToast]);
|
|
1814
1893
|
const contextValue = {
|
|
@@ -1819,7 +1898,7 @@ var ToastContainer2 = ({
|
|
|
1819
1898
|
error,
|
|
1820
1899
|
warn
|
|
1821
1900
|
};
|
|
1822
|
-
return /* @__PURE__ */
|
|
1901
|
+
return /* @__PURE__ */ React12__default.default.createElement(ToastContext.Provider, { value: contextValue }, children, /* @__PURE__ */ React12__default.default.createElement(ToastWrapper, null, toasts.map((toast) => /* @__PURE__ */ React12__default.default.createElement(
|
|
1823
1902
|
Toast,
|
|
1824
1903
|
{
|
|
1825
1904
|
key: toast.id,
|
|
@@ -1829,7 +1908,7 @@ var ToastContainer2 = ({
|
|
|
1829
1908
|
))));
|
|
1830
1909
|
};
|
|
1831
1910
|
var useToast = () => {
|
|
1832
|
-
const context =
|
|
1911
|
+
const context = React12.useContext(ToastContext);
|
|
1833
1912
|
if (!context) {
|
|
1834
1913
|
throw new Error("useToast must be used within ToastContainer");
|
|
1835
1914
|
}
|
|
@@ -1959,11 +2038,11 @@ var Tabs = ({
|
|
|
1959
2038
|
className,
|
|
1960
2039
|
style
|
|
1961
2040
|
}) => {
|
|
1962
|
-
const [internalActiveKey, setInternalActiveKey] =
|
|
2041
|
+
const [internalActiveKey, setInternalActiveKey] = React12.useState(
|
|
1963
2042
|
controlledActiveKey ?? defaultActiveKey ?? items[0]?.key ?? ""
|
|
1964
2043
|
);
|
|
1965
2044
|
const activeKey = controlledActiveKey !== void 0 ? controlledActiveKey : internalActiveKey;
|
|
1966
|
-
const handleTabClick =
|
|
2045
|
+
const handleTabClick = React12.useCallback(
|
|
1967
2046
|
(key, disabled) => {
|
|
1968
2047
|
if (disabled) return;
|
|
1969
2048
|
if (controlledActiveKey === void 0) {
|
|
@@ -1973,7 +2052,7 @@ var Tabs = ({
|
|
|
1973
2052
|
},
|
|
1974
2053
|
[controlledActiveKey, onChange]
|
|
1975
2054
|
);
|
|
1976
|
-
return /* @__PURE__ */
|
|
2055
|
+
return /* @__PURE__ */ React12__default.default.createElement(TabContainer, { className, style }, /* @__PURE__ */ React12__default.default.createElement(TabList, { $variant: variant, role: "tablist" }, items.map((item) => /* @__PURE__ */ React12__default.default.createElement(
|
|
1977
2056
|
TabItem,
|
|
1978
2057
|
{
|
|
1979
2058
|
key: item.key,
|
|
@@ -1987,7 +2066,7 @@ var Tabs = ({
|
|
|
1987
2066
|
disabled: item.disabled,
|
|
1988
2067
|
type: "button"
|
|
1989
2068
|
},
|
|
1990
|
-
item.icon && /* @__PURE__ */
|
|
2069
|
+
item.icon && /* @__PURE__ */ React12__default.default.createElement("span", null, item.icon),
|
|
1991
2070
|
item.label
|
|
1992
2071
|
))));
|
|
1993
2072
|
};
|
|
@@ -2004,7 +2083,7 @@ var Tooltip = ({
|
|
|
2004
2083
|
getPopupContainer,
|
|
2005
2084
|
...rest
|
|
2006
2085
|
}) => {
|
|
2007
|
-
const overlayContent =
|
|
2086
|
+
const overlayContent = React12__default.default.useMemo(() => /* @__PURE__ */ React12__default.default.createElement("div", null, content), [content]);
|
|
2008
2087
|
const variantClass = `tooltip-variant-${variant}`;
|
|
2009
2088
|
const sizeClass = variant === "white" ? `tooltip-size-${size}` : "";
|
|
2010
2089
|
const combinedClassName = [variantClass, sizeClass, overlayClassName].filter(Boolean).join(" ");
|
|
@@ -2017,7 +2096,7 @@ var Tooltip = ({
|
|
|
2017
2096
|
...getPopupContainer && { getPopupContainer },
|
|
2018
2097
|
...rest
|
|
2019
2098
|
};
|
|
2020
|
-
return /* @__PURE__ */
|
|
2099
|
+
return /* @__PURE__ */ React12__default.default.createElement(RcTooltip__default.default, { ...tooltipProps }, children);
|
|
2021
2100
|
};
|
|
2022
2101
|
Tooltip.displayName = "Tooltip";
|
|
2023
2102
|
var paddingDistance = "5px";
|
|
@@ -2280,7 +2359,7 @@ var TooltipGlobalStyles = styled3.createGlobalStyle`
|
|
|
2280
2359
|
border-bottom-color: ${({ theme }) => theme.components.tooltip.white.large.background};
|
|
2281
2360
|
}
|
|
2282
2361
|
`;
|
|
2283
|
-
var UIConfigContext =
|
|
2362
|
+
var UIConfigContext = React12.createContext(null);
|
|
2284
2363
|
var UIConfigProvider = ({
|
|
2285
2364
|
config,
|
|
2286
2365
|
children
|
|
@@ -2296,7 +2375,7 @@ var UIConfigProvider = ({
|
|
|
2296
2375
|
};
|
|
2297
2376
|
const Provider = styled3.ThemeProvider;
|
|
2298
2377
|
const TooltipStyles = TooltipGlobalStyles;
|
|
2299
|
-
return /* @__PURE__ */
|
|
2378
|
+
return /* @__PURE__ */ React12__default.default.createElement(UIConfigContext.Provider, { value: config }, /* @__PURE__ */ React12__default.default.createElement(Provider, { theme }, /* @__PURE__ */ React12__default.default.createElement(TooltipStyles, null), /* @__PURE__ */ React12__default.default.createElement(IconProvider, { icons }, /* @__PURE__ */ React12__default.default.createElement(
|
|
2300
2379
|
ToastContainer2,
|
|
2301
2380
|
{
|
|
2302
2381
|
maxCount: toastConfig.maxCount,
|
|
@@ -2306,7 +2385,7 @@ var UIConfigProvider = ({
|
|
|
2306
2385
|
))));
|
|
2307
2386
|
};
|
|
2308
2387
|
var useUIConfig = () => {
|
|
2309
|
-
const context =
|
|
2388
|
+
const context = React12.useContext(UIConfigContext);
|
|
2310
2389
|
if (!context) {
|
|
2311
2390
|
throw new Error("useUIConfig must be used within UIConfigProvider");
|
|
2312
2391
|
}
|
|
@@ -2386,6 +2465,7 @@ exports.Checkbox = Checkbox;
|
|
|
2386
2465
|
exports.Icon = Icon;
|
|
2387
2466
|
exports.IconProvider = IconProvider;
|
|
2388
2467
|
exports.Input = Input;
|
|
2468
|
+
exports.NumberInput = NumberInput;
|
|
2389
2469
|
exports.Radio = Radio;
|
|
2390
2470
|
exports.SearchInput = SearchInput;
|
|
2391
2471
|
exports.Slider = Slider;
|