@officesdk/design 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2320 @@
1
+ 'use strict';
2
+
3
+ var React11 = require('react');
4
+ var styled3 = require('styled-components');
5
+ var RcTooltip = require('rc-tooltip');
6
+ require('rc-tooltip/assets/bootstrap.css');
7
+
8
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
9
+
10
+ var React11__default = /*#__PURE__*/_interopDefault(React11);
11
+ var styled3__default = /*#__PURE__*/_interopDefault(styled3);
12
+ var RcTooltip__default = /*#__PURE__*/_interopDefault(RcTooltip);
13
+
14
+ // src/Button/Button.tsx
15
+ var IconWrapper = styled3__default.default.span`
16
+ display: inline-flex;
17
+ align-items: center;
18
+ justify-content: center;
19
+ flex-shrink: 0;
20
+
21
+ ${({ $size, $position, theme }) => {
22
+ const sizeConfig = theme.components.button[$size || "medium"];
23
+ const marginSide = $position === "before" ? "margin-right" : "margin-left";
24
+ return `
25
+ width: ${sizeConfig.iconSize.width};
26
+ height: ${sizeConfig.iconSize.height};
27
+ ${marginSide}: ${sizeConfig.iconGap};
28
+
29
+ svg, img {
30
+ width: 100%;
31
+ height: 100%;
32
+ display: block;
33
+ }
34
+ `;
35
+ }}
36
+ `;
37
+ var StyledButton = styled3__default.default.button`
38
+ display: inline-flex;
39
+ align-items: center;
40
+ justify-content: center;
41
+ cursor: pointer;
42
+ outline: none;
43
+ border: none;
44
+ width: ${({ $fullWidth }) => $fullWidth ? "100%" : "auto"};
45
+
46
+ /* Size variants */
47
+ ${({ $size, $isIconOnly, theme }) => {
48
+ const sizeConfig = theme.components.button[$size || "medium"];
49
+ if ($isIconOnly) {
50
+ return `
51
+ padding: 0;
52
+ width: ${sizeConfig.height};
53
+ height: ${sizeConfig.height};
54
+ border-radius: ${sizeConfig.borderRadius};
55
+ `;
56
+ }
57
+ return `
58
+ padding: ${sizeConfig.padding};
59
+ font-size: ${sizeConfig.fontSize};
60
+ line-height: ${sizeConfig.lineHeight};
61
+ border-radius: ${sizeConfig.borderRadius};
62
+ min-height: ${sizeConfig.height};
63
+ `;
64
+ }}
65
+
66
+ /* Variant and color type styles */
67
+ ${({ $variant, $colorType, $isIconOnly, $iconBordered, theme }) => {
68
+ if ($variant === "icon" || $isIconOnly) {
69
+ const baseVariant = $iconBordered ? "outlined" : "text";
70
+ const styles2 = theme.components.button[baseVariant]["default"];
71
+ return `
72
+ background: ${styles2.background};
73
+ color: ${styles2.color};
74
+ border: 1px solid ${styles2.borderColor};
75
+ box-shadow: ${styles2.boxShadow};
76
+
77
+ &:hover:not(:disabled) {
78
+ background: ${styles2.backgroundHover};
79
+ color: ${styles2.colorHover};
80
+ border-color: ${styles2.borderColorHover};
81
+ box-shadow: ${styles2.boxShadowHover};
82
+ }
83
+
84
+ &:active:not(:disabled) {
85
+ background: ${styles2.backgroundActive};
86
+ color: ${styles2.colorActive};
87
+ border-color: ${styles2.borderColorActive};
88
+ box-shadow: ${styles2.boxShadowActive};
89
+ }
90
+
91
+ &:disabled {
92
+ background: ${styles2.backgroundDisabled};
93
+ color: ${styles2.colorDisabled};
94
+ border-color: ${styles2.borderColorDisabled};
95
+ box-shadow: ${styles2.boxShadowDisabled};
96
+ cursor: not-allowed;
97
+ }
98
+ `;
99
+ }
100
+ const variant = $variant || "solid";
101
+ const colorType = $colorType || "default";
102
+ if (colorType === "status" && variant !== "text") {
103
+ console.warn(`colorType 'status' is only available for 'text' variant. Falling back to 'default'.`);
104
+ }
105
+ const effectiveColorType = colorType === "status" && variant !== "text" ? "default" : colorType;
106
+ const styles = theme.components.button[variant][effectiveColorType];
107
+ return `
108
+ background: ${styles.background};
109
+ color: ${styles.color};
110
+ border: 1px solid ${styles.borderColor};
111
+ box-shadow: ${styles.boxShadow};
112
+ font-weight: ${styles.fontWeight};
113
+
114
+ &:hover:not(:disabled) {
115
+ background: ${styles.backgroundHover};
116
+ color: ${styles.colorHover};
117
+ border-color: ${styles.borderColorHover};
118
+ box-shadow: ${styles.boxShadowHover};
119
+ }
120
+
121
+ &:active:not(:disabled) {
122
+ background: ${styles.backgroundActive};
123
+ color: ${styles.colorActive};
124
+ border-color: ${styles.borderColorActive};
125
+ box-shadow: ${styles.boxShadowActive};
126
+ }
127
+
128
+ &:disabled {
129
+ background: ${styles.backgroundDisabled};
130
+ color: ${styles.colorDisabled};
131
+ border-color: ${styles.borderColorDisabled};
132
+ box-shadow: ${styles.boxShadowDisabled};
133
+ cursor: not-allowed;
134
+ }
135
+ `;
136
+ }}
137
+ `;
138
+ var Button = ({
139
+ variant = "solid",
140
+ colorType = "default",
141
+ size = "medium",
142
+ disabled = false,
143
+ loading = false,
144
+ fullWidth = false,
145
+ iconBefore,
146
+ iconAfter,
147
+ iconBordered = false,
148
+ onClick,
149
+ children,
150
+ className,
151
+ style
152
+ }) => {
153
+ const isIconOnly = variant === "icon" || !children && !!(iconBefore || iconAfter);
154
+ const iconOnlyContent = iconBefore || iconAfter;
155
+ return /* @__PURE__ */ React11__default.default.createElement(
156
+ StyledButton,
157
+ {
158
+ $variant: variant,
159
+ $colorType: colorType,
160
+ $size: size,
161
+ $fullWidth: fullWidth,
162
+ $isIconOnly: isIconOnly,
163
+ $iconBordered: iconBordered,
164
+ disabled: disabled || loading,
165
+ onClick,
166
+ className,
167
+ style
168
+ },
169
+ loading ? /* @__PURE__ */ React11__default.default.createElement(React11__default.default.Fragment, null, "Loading...") : isIconOnly ? iconOnlyContent : /* @__PURE__ */ React11__default.default.createElement(React11__default.default.Fragment, null, iconBefore && /* @__PURE__ */ React11__default.default.createElement(IconWrapper, { $size: size, $position: "before" }, iconBefore), children, iconAfter && /* @__PURE__ */ React11__default.default.createElement(IconWrapper, { $size: size, $position: "after" }, iconAfter))
170
+ );
171
+ };
172
+ Button.displayName = "Button";
173
+ var SliderContainer = styled3__default.default.div`
174
+ position: relative;
175
+ display: flex;
176
+ align-items: center;
177
+ width: 100%;
178
+ height: 18px;
179
+ cursor: ${({ $disabled }) => $disabled ? "not-allowed" : "pointer"};
180
+ user-select: none;
181
+ `;
182
+ var SliderTrack = styled3__default.default.div`
183
+ position: absolute;
184
+ left: 0;
185
+ right: 0;
186
+ height: 2px;
187
+ background: ${({ theme }) => theme.colors.palettes.transparency["20"]};
188
+ border-radius: 1000px;
189
+ top: 50%;
190
+ transform: translateY(-50%);
191
+ `;
192
+ var SliderFill = styled3__default.default.div`
193
+ position: absolute;
194
+ left: 0;
195
+ height: 2px;
196
+ border-radius: 1px;
197
+ top: 50%;
198
+ transform: translateY(-50%);
199
+ width: ${({ $percentage }) => $percentage}%;
200
+ background: ${({ $disabled, theme }) => $disabled ? theme.colors.palettes.transparency["10"] : theme.colors.palettes.gray["100"]};
201
+ `;
202
+ var SliderThumb = styled3__default.default.div`
203
+ position: absolute;
204
+ width: 10px;
205
+ height: 10px;
206
+ border-radius: 50%;
207
+ background: ${({ $disabled, theme }) => $disabled ? theme.colors.palettes.transparency["30"] : theme.colors.palettes.blue["5"]};
208
+ left: ${({ $percentage }) => $percentage}%;
209
+ top: 50%;
210
+ transform: translate(-50%, -50%);
211
+ cursor: ${({ $disabled }) => $disabled ? "not-allowed" : "grab"};
212
+ transition: ${({ $isDragging }) => $isDragging ? "none" : "left 0.1s ease"};
213
+ box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.1);
214
+
215
+ ${({ $disabled }) => !$disabled && `
216
+ &:hover {
217
+ box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.15);
218
+ }
219
+
220
+ &:active {
221
+ cursor: grabbing;
222
+ box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.2);
223
+ }
224
+ `}
225
+ `;
226
+ var Slider = ({
227
+ value: controlledValue,
228
+ defaultValue = 0,
229
+ min = 0,
230
+ max = 100,
231
+ step = 1,
232
+ disabled = false,
233
+ onChange,
234
+ onDragStart,
235
+ onDragEnd,
236
+ className,
237
+ style
238
+ }) => {
239
+ const [internalValue, setInternalValue] = React11.useState(
240
+ controlledValue ?? defaultValue
241
+ );
242
+ const [isDragging, setIsDragging] = React11.useState(false);
243
+ const containerRef = React11.useRef(null);
244
+ const value = controlledValue !== void 0 ? controlledValue : internalValue;
245
+ const percentage = (value - min) / (max - min) * 100;
246
+ const updateValue = React11.useCallback(
247
+ (clientX) => {
248
+ if (!containerRef.current || disabled) return;
249
+ const rect = containerRef.current.getBoundingClientRect();
250
+ const offsetX = clientX - rect.left;
251
+ const newPercentage = Math.max(0, Math.min(100, offsetX / rect.width * 100));
252
+ const rawValue = newPercentage / 100 * (max - min) + min;
253
+ const steppedValue = Math.round(rawValue / step) * step;
254
+ const clampedValue = Math.max(min, Math.min(max, steppedValue));
255
+ if (controlledValue === void 0) {
256
+ setInternalValue(clampedValue);
257
+ }
258
+ onChange?.(clampedValue);
259
+ },
260
+ [min, max, step, disabled, controlledValue, onChange]
261
+ );
262
+ const handleMouseDown = React11.useCallback(
263
+ (e) => {
264
+ if (disabled) return;
265
+ e.preventDefault();
266
+ setIsDragging(true);
267
+ onDragStart?.();
268
+ updateValue(e.clientX);
269
+ },
270
+ [disabled, onDragStart, updateValue]
271
+ );
272
+ React11.useEffect(() => {
273
+ if (!isDragging) return;
274
+ const handleMouseMove = (e) => {
275
+ updateValue(e.clientX);
276
+ };
277
+ const handleMouseUp = () => {
278
+ setIsDragging(false);
279
+ onDragEnd?.();
280
+ };
281
+ document.addEventListener("mousemove", handleMouseMove);
282
+ document.addEventListener("mouseup", handleMouseUp);
283
+ return () => {
284
+ document.removeEventListener("mousemove", handleMouseMove);
285
+ document.removeEventListener("mouseup", handleMouseUp);
286
+ };
287
+ }, [isDragging, updateValue, onDragEnd]);
288
+ const handleKeyDown = React11.useCallback(
289
+ (e) => {
290
+ if (disabled) return;
291
+ let newValue = value;
292
+ switch (e.key) {
293
+ case "ArrowLeft":
294
+ case "ArrowDown":
295
+ e.preventDefault();
296
+ newValue = Math.max(min, value - step);
297
+ break;
298
+ case "ArrowRight":
299
+ case "ArrowUp":
300
+ e.preventDefault();
301
+ newValue = Math.min(max, value + step);
302
+ break;
303
+ case "Home":
304
+ e.preventDefault();
305
+ newValue = min;
306
+ break;
307
+ case "End":
308
+ e.preventDefault();
309
+ newValue = max;
310
+ break;
311
+ default:
312
+ return;
313
+ }
314
+ if (controlledValue === void 0) {
315
+ setInternalValue(newValue);
316
+ }
317
+ onChange?.(newValue);
318
+ },
319
+ [disabled, value, min, max, step, controlledValue, onChange]
320
+ );
321
+ return /* @__PURE__ */ React11__default.default.createElement(
322
+ SliderContainer,
323
+ {
324
+ ref: containerRef,
325
+ $disabled: disabled,
326
+ className,
327
+ style,
328
+ onMouseDown: handleMouseDown,
329
+ onKeyDown: handleKeyDown,
330
+ tabIndex: disabled ? -1 : 0,
331
+ role: "slider",
332
+ "aria-valuemin": min,
333
+ "aria-valuemax": max,
334
+ "aria-valuenow": value,
335
+ "aria-disabled": disabled
336
+ },
337
+ /* @__PURE__ */ React11__default.default.createElement(SliderTrack, { $disabled: disabled }),
338
+ /* @__PURE__ */ React11__default.default.createElement(SliderFill, { $percentage: percentage, $disabled: disabled }),
339
+ /* @__PURE__ */ React11__default.default.createElement(
340
+ SliderThumb,
341
+ {
342
+ $percentage: percentage,
343
+ $disabled: disabled,
344
+ $isDragging: isDragging
345
+ }
346
+ )
347
+ );
348
+ };
349
+ Slider.displayName = "Slider";
350
+
351
+ // src/Button/SpinButton.tsx
352
+ var SpinButtonWrapper = styled3__default.default.div`
353
+ display: inline-flex;
354
+ align-items: center;
355
+ gap: ${({ $showSlider }) => $showSlider ? "0" : "0"};
356
+ width: ${({ $showSlider }) => $showSlider ? "100%" : "auto"};
357
+ `;
358
+ var SliderWrapper = styled3__default.default.div`
359
+ flex: 1;
360
+ display: flex;
361
+ align-items: center;
362
+ padding: ${({ $size }) => $size === "small" ? "7px 0" : "7px 0"};
363
+ padding-right: ${({ $size }) => $size === "small" ? "83px" : "72px"};
364
+ min-width: 0;
365
+ `;
366
+ var SpinButtonContainer = styled3__default.default.div`
367
+ display: inline-flex;
368
+ align-items: center;
369
+ background: white;
370
+ border: 1px solid;
371
+ border-radius: 2px;
372
+ flex-shrink: 0;
373
+
374
+ ${({ $size }) => $size === "small" ? `
375
+ height: 24px;
376
+ width: 72px;
377
+ ` : `
378
+ height: 32px;
379
+ width: 80px;
380
+ `}
381
+
382
+ ${({ $disabled, $alert, $isFocused, theme }) => {
383
+ if ($disabled) {
384
+ return `
385
+ border-color: ${theme.colors.palettes.transparency["10"]};
386
+ cursor: not-allowed;
387
+ `;
388
+ }
389
+ if ($alert) {
390
+ return `
391
+ border-color: ${theme.colors.palettes.red["6"]};
392
+ `;
393
+ }
394
+ if ($isFocused) {
395
+ return `
396
+ border-color: ${theme.colors.palettes.transparency["30"]};
397
+ box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.04);
398
+ `;
399
+ }
400
+ return `
401
+ border-color: ${theme.colors.palettes.transparency["10"]};
402
+
403
+ &:hover {
404
+ border-color: ${theme.colors.palettes.transparency["20"]};
405
+ box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.04);
406
+ }
407
+ `;
408
+ }}
409
+ `;
410
+ var InputWrapper = styled3__default.default.div`
411
+ flex: 1;
412
+ display: flex;
413
+ align-items: center;
414
+ padding: 0 8px;
415
+ min-width: 0;
416
+ `;
417
+ var StyledInput = styled3__default.default.input`
418
+ width: 100%;
419
+ border: none;
420
+ outline: none;
421
+ background: transparent;
422
+ font-family: 'PingFang SC', sans-serif;
423
+ font-weight: 400;
424
+ line-height: 20px;
425
+ padding: 0;
426
+ margin: 0;
427
+
428
+ ${({ $size }) => $size === "small" ? `
429
+ font-size: 12px;
430
+ ` : `
431
+ font-size: 13px;
432
+ `}
433
+
434
+ ${({ $disabled, theme }) => $disabled ? `
435
+ color: ${theme.colors.palettes.transparency["30"]};
436
+ cursor: not-allowed;
437
+ ` : `
438
+ color: ${theme.colors.palettes.gray["120"]};
439
+ `}
440
+
441
+ &::placeholder {
442
+ color: ${({ theme }) => theme.colors.palettes.transparency["30"]};
443
+ }
444
+
445
+ /* Remove number input arrows */
446
+ &::-webkit-inner-spin-button,
447
+ &::-webkit-outer-spin-button {
448
+ -webkit-appearance: none;
449
+ margin: 0;
450
+ }
451
+
452
+ &[type='number'] {
453
+ -moz-appearance: textfield;
454
+ }
455
+ `;
456
+ var ButtonGroup = styled3__default.default.div`
457
+ display: flex;
458
+ flex-direction: column;
459
+ height: 100%;
460
+ border-left: 1px solid;
461
+ flex-shrink: 0;
462
+
463
+ ${({ $disabled, $alert, theme }) => {
464
+ if ($disabled) {
465
+ return `border-color: ${theme.colors.palettes.transparency["10"]};`;
466
+ }
467
+ if ($alert) {
468
+ return `border-color: ${theme.colors.palettes.red["6"]};`;
469
+ }
470
+ return `border-color: ${theme.colors.palettes.transparency["10"]};`;
471
+ }}
472
+ `;
473
+ var StepButton = styled3__default.default.button`
474
+ flex: 1 1 50%;
475
+ display: flex;
476
+ align-items: center;
477
+ justify-content: center;
478
+ border: none;
479
+ background: transparent;
480
+ cursor: pointer;
481
+ padding: 1px 8px;
482
+ outline: none;
483
+ min-height: 0;
484
+ overflow: hidden;
485
+
486
+ ${({ $position, $alert, $disabled, theme }) => {
487
+ if ($position === "up") {
488
+ return `
489
+ border-bottom: 1px solid ${$disabled ? theme.colors.palettes.transparency["10"] : $alert ? theme.colors.palettes.red["6"] : theme.colors.palettes.transparency["10"]};
490
+ `;
491
+ }
492
+ return "";
493
+ }}
494
+
495
+ ${({ $disabled, theme }) => {
496
+ if ($disabled) {
497
+ return `
498
+ cursor: not-allowed;
499
+ opacity: 0.4;
500
+ `;
501
+ }
502
+ return `
503
+ &:hover {
504
+ background-color: ${theme.colors.palettes.transparency["5"]};
505
+ }
506
+
507
+ &:active {
508
+ background-color: ${theme.colors.palettes.transparency["10"]};
509
+ }
510
+ `;
511
+ }}
512
+
513
+ svg {
514
+ width: 14px;
515
+ height: 14px;
516
+ fill: ${({ $disabled, theme }) => $disabled ? theme.colors.palettes.transparency["30"] : theme.colors.palettes.gray["120"]};
517
+ }
518
+ `;
519
+ var UpArrow = () => /* @__PURE__ */ React11__default.default.createElement("svg", { viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11__default.default.createElement("path", { d: "M7 4.5L10.5 8.5H3.5L7 4.5Z", fill: "currentColor" }));
520
+ var DownArrow = () => /* @__PURE__ */ React11__default.default.createElement("svg", { viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11__default.default.createElement("path", { d: "M7 9.5L3.5 5.5H10.5L7 9.5Z", fill: "currentColor" }));
521
+ var SpinButton = ({
522
+ value: controlledValue,
523
+ defaultValue = 0,
524
+ min = -Infinity,
525
+ max = Infinity,
526
+ step = 1,
527
+ size = "large",
528
+ disabled = false,
529
+ alert = false,
530
+ showSlider = false,
531
+ precision,
532
+ formatter,
533
+ parser,
534
+ onChange,
535
+ className,
536
+ style
537
+ }) => {
538
+ const [internalValue, setInternalValue] = React11.useState(controlledValue ?? defaultValue);
539
+ const [displayValue, setDisplayValue] = React11.useState("");
540
+ const [isFocused, setIsFocused] = React11.useState(false);
541
+ const inputRef = React11.useRef(null);
542
+ const value = controlledValue !== void 0 ? controlledValue : internalValue;
543
+ const formatValue = React11.useCallback(
544
+ (val) => {
545
+ if (formatter) {
546
+ return formatter(val);
547
+ }
548
+ if (precision !== void 0) {
549
+ return val.toFixed(precision);
550
+ }
551
+ return String(val);
552
+ },
553
+ [formatter, precision]
554
+ );
555
+ const parseValue = React11.useCallback(
556
+ (displayVal) => {
557
+ if (parser) {
558
+ return parser(displayVal);
559
+ }
560
+ const parsed = parseFloat(displayVal);
561
+ return isNaN(parsed) ? null : parsed;
562
+ },
563
+ [parser]
564
+ );
565
+ React11.useEffect(() => {
566
+ if (!isFocused) {
567
+ setDisplayValue(formatValue(value));
568
+ }
569
+ }, [value, isFocused, formatValue]);
570
+ const clampValue = React11.useCallback(
571
+ (val) => {
572
+ return Math.max(min, Math.min(max, val));
573
+ },
574
+ [min, max]
575
+ );
576
+ const handleValueChange = React11.useCallback(
577
+ (newValue) => {
578
+ const clampedValue = clampValue(newValue);
579
+ if (controlledValue === void 0) {
580
+ setInternalValue(clampedValue);
581
+ }
582
+ onChange?.(clampedValue);
583
+ },
584
+ [clampValue, controlledValue, onChange]
585
+ );
586
+ const increment = React11.useCallback(() => {
587
+ if (disabled) return;
588
+ handleValueChange(value + step);
589
+ }, [disabled, value, step, handleValueChange]);
590
+ const decrement = React11.useCallback(() => {
591
+ if (disabled) return;
592
+ handleValueChange(value - step);
593
+ }, [disabled, value, step, handleValueChange]);
594
+ const handleInputChange = React11.useCallback((e) => {
595
+ setDisplayValue(e.target.value);
596
+ }, []);
597
+ const handleBlur = React11.useCallback(() => {
598
+ setIsFocused(false);
599
+ const parsed = parseValue(displayValue);
600
+ if (parsed !== null) {
601
+ handleValueChange(parsed);
602
+ } else {
603
+ setDisplayValue(formatValue(value));
604
+ }
605
+ }, [displayValue, parseValue, handleValueChange, value, formatValue]);
606
+ const handleFocus = React11.useCallback(() => {
607
+ setIsFocused(true);
608
+ setDisplayValue(String(value));
609
+ }, [value]);
610
+ const handleKeyDown = React11.useCallback(
611
+ (e) => {
612
+ if (e.key === "ArrowUp") {
613
+ e.preventDefault();
614
+ increment();
615
+ } else if (e.key === "ArrowDown") {
616
+ e.preventDefault();
617
+ decrement();
618
+ } else if (e.key === "Enter") {
619
+ inputRef.current?.blur();
620
+ }
621
+ },
622
+ [increment, decrement]
623
+ );
624
+ return /* @__PURE__ */ React11__default.default.createElement(SpinButtonWrapper, { $showSlider: showSlider, className, style }, showSlider && /* @__PURE__ */ React11__default.default.createElement(SliderWrapper, { $size: size }, /* @__PURE__ */ React11__default.default.createElement(
625
+ Slider,
626
+ {
627
+ value,
628
+ min,
629
+ max,
630
+ step,
631
+ disabled,
632
+ onChange: (val) => handleValueChange(val)
633
+ }
634
+ )), /* @__PURE__ */ React11__default.default.createElement(SpinButtonContainer, { $size: size, $disabled: disabled, $alert: alert, $isFocused: isFocused }, /* @__PURE__ */ React11__default.default.createElement(InputWrapper, null, /* @__PURE__ */ React11__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
+ )), /* @__PURE__ */ React11__default.default.createElement(ButtonGroup, { $alert: alert, $disabled: disabled }, /* @__PURE__ */ React11__default.default.createElement(
649
+ StepButton,
650
+ {
651
+ type: "button",
652
+ $position: "up",
653
+ $alert: alert,
654
+ $disabled: disabled,
655
+ onClick: increment,
656
+ disabled,
657
+ tabIndex: -1
658
+ },
659
+ /* @__PURE__ */ React11__default.default.createElement(UpArrow, null)
660
+ ), /* @__PURE__ */ React11__default.default.createElement(
661
+ StepButton,
662
+ {
663
+ type: "button",
664
+ $position: "down",
665
+ $alert: alert,
666
+ $disabled: disabled,
667
+ onClick: decrement,
668
+ disabled,
669
+ tabIndex: -1
670
+ },
671
+ /* @__PURE__ */ React11__default.default.createElement(DownArrow, null)
672
+ ))));
673
+ };
674
+ SpinButton.displayName = "SpinButton";
675
+ var SwitchContainer = styled3__default.default.label`
676
+ position: relative;
677
+ display: inline-block;
678
+ cursor: ${({ $disabled }) => $disabled ? "not-allowed" : "pointer"};
679
+
680
+ ${({ $size, theme }) => {
681
+ const sizeConfig = theme.components.switch[$size];
682
+ return `
683
+ width: ${sizeConfig.container.width};
684
+ height: ${sizeConfig.container.height};
685
+ `;
686
+ }}
687
+ `;
688
+ var HiddenInput = styled3__default.default.input`
689
+ position: absolute;
690
+ opacity: 0;
691
+ width: 0;
692
+ height: 0;
693
+ pointer-events: none;
694
+ `;
695
+ var Track = styled3__default.default.div`
696
+ position: absolute;
697
+ inset: 0;
698
+ top: 50%;
699
+ left: 50%;
700
+ transform: translate(-50%, -50%);
701
+ transition: ${({ theme }) => theme.components.switch.transition || "all 0.2s ease"};
702
+
703
+ ${({ $size, theme }) => {
704
+ const sizeConfig = theme.components.switch[$size];
705
+ return `
706
+ border-radius: ${sizeConfig.track.borderRadius};
707
+ width: ${sizeConfig.track.width};
708
+ height: ${sizeConfig.track.height};
709
+ `;
710
+ }}
711
+
712
+ ${({ $checked, $disabled, theme }) => {
713
+ const stateConfig = $checked ? theme.components.switch.on : theme.components.switch.off;
714
+ if ($disabled) {
715
+ return `
716
+ background: ${stateConfig.track.backgroundDisabled};
717
+ box-shadow: ${stateConfig.track.boxShadowDisabled};
718
+ `;
719
+ }
720
+ return `
721
+ background: ${stateConfig.track.background};
722
+ box-shadow: ${stateConfig.track.boxShadow};
723
+ `;
724
+ }}
725
+
726
+ ${({ $disabled, $checked, theme }) => {
727
+ if ($disabled) return "";
728
+ const stateConfig = $checked ? theme.components.switch.on : theme.components.switch.off;
729
+ return `
730
+ :hover {
731
+ background: ${stateConfig.track.backgroundHover};
732
+ box-shadow: ${stateConfig.track.boxShadowHover};
733
+ }
734
+ `;
735
+ }}
736
+ `;
737
+ var Thumb = styled3__default.default.div`
738
+ position: absolute;
739
+ top: 50%;
740
+ transform: translateY(-50%);
741
+ border-style: solid;
742
+ box-sizing: border-box;
743
+ transition: ${({ theme }) => theme.components.switch.transition || "all 0.2s ease"};
744
+
745
+ ${({ $size, $checked, theme }) => {
746
+ const sizeConfig = theme.components.switch[$size];
747
+ const thumbSize = sizeConfig.thumb.size;
748
+ const thumbOffset = sizeConfig.thumb.offset;
749
+ const thumbBorderRadius = sizeConfig.thumb.borderRadius;
750
+ const thumbBorderWidth = sizeConfig.thumb.borderWidth;
751
+ return `
752
+ width: ${thumbSize};
753
+ height: ${thumbSize};
754
+ border-radius: ${thumbBorderRadius};
755
+ border-width: ${thumbBorderWidth};
756
+ ${$checked ? "right" : "left"}: ${thumbOffset};
757
+ `;
758
+ }}
759
+
760
+ ${({ $checked, $disabled, theme }) => {
761
+ const stateConfig = $checked ? theme.components.switch.on : theme.components.switch.off;
762
+ if ($disabled) {
763
+ return `
764
+ background: ${stateConfig.thumb.backgroundDisabled};
765
+ border-color: ${stateConfig.thumb.borderColorDisabled};
766
+ box-shadow: ${stateConfig.thumb.boxShadowDisabled};
767
+ `;
768
+ }
769
+ return `
770
+ background: ${stateConfig.thumb.background};
771
+ border-color: ${stateConfig.thumb.borderColor};
772
+ box-shadow: ${stateConfig.thumb.boxShadow};
773
+ `;
774
+ }}
775
+
776
+ ${({ $disabled, $checked, theme }) => {
777
+ if ($disabled) return "";
778
+ const stateConfig = $checked ? theme.components.switch.on : theme.components.switch.off;
779
+ return `
780
+ :hover & {
781
+ background: ${stateConfig.thumb.backgroundHover};
782
+ border-color: ${stateConfig.thumb.borderColorHover};
783
+ box-shadow: ${stateConfig.thumb.boxShadowHover};
784
+ }
785
+ `;
786
+ }}
787
+ `;
788
+ var Switch = ({
789
+ checked: controlledChecked,
790
+ defaultChecked = false,
791
+ size = "large",
792
+ disabled = false,
793
+ onChange,
794
+ className,
795
+ style
796
+ }) => {
797
+ const [internalChecked, setInternalChecked] = React11.useState(
798
+ controlledChecked ?? defaultChecked
799
+ );
800
+ const [isFocused, setIsFocused] = React11.useState(false);
801
+ const checked = controlledChecked !== void 0 ? controlledChecked : internalChecked;
802
+ const handleChange = React11.useCallback(
803
+ (e) => {
804
+ if (disabled) return;
805
+ const newChecked = e.target.checked;
806
+ if (controlledChecked === void 0) {
807
+ setInternalChecked(newChecked);
808
+ }
809
+ onChange?.(newChecked);
810
+ },
811
+ [disabled, controlledChecked, onChange]
812
+ );
813
+ const handleFocus = React11.useCallback(() => {
814
+ setIsFocused(true);
815
+ }, []);
816
+ const handleBlur = React11.useCallback(() => {
817
+ setIsFocused(false);
818
+ }, []);
819
+ return /* @__PURE__ */ React11__default.default.createElement(
820
+ SwitchContainer,
821
+ {
822
+ $size: size,
823
+ $checked: checked,
824
+ $disabled: disabled,
825
+ className,
826
+ style
827
+ },
828
+ /* @__PURE__ */ React11__default.default.createElement(
829
+ HiddenInput,
830
+ {
831
+ type: "checkbox",
832
+ checked,
833
+ onChange: handleChange,
834
+ onFocus: handleFocus,
835
+ onBlur: handleBlur,
836
+ disabled
837
+ }
838
+ ),
839
+ /* @__PURE__ */ React11__default.default.createElement(
840
+ Track,
841
+ {
842
+ $size: size,
843
+ $checked: checked,
844
+ $disabled: disabled,
845
+ $isFocused: isFocused
846
+ }
847
+ ),
848
+ /* @__PURE__ */ React11__default.default.createElement(
849
+ Thumb,
850
+ {
851
+ $size: size,
852
+ $checked: checked,
853
+ $disabled: disabled,
854
+ $isFocused: isFocused
855
+ }
856
+ )
857
+ );
858
+ };
859
+ Switch.displayName = "Switch";
860
+ var RadioContainer = styled3__default.default.label`
861
+ position: relative;
862
+ display: inline-block;
863
+ cursor: ${({ $disabled }) => $disabled ? "not-allowed" : "pointer"};
864
+
865
+ ${({ theme }) => {
866
+ const sizeConfig = theme.components.radio.small;
867
+ return `
868
+ width: ${sizeConfig.size};
869
+ height: ${sizeConfig.size};
870
+ `;
871
+ }}
872
+ `;
873
+ var HiddenInput2 = styled3__default.default.input`
874
+ position: absolute;
875
+ opacity: 0;
876
+ width: 0;
877
+ height: 0;
878
+ pointer-events: none;
879
+ `;
880
+ var RadioOuter = styled3__default.default.div`
881
+ position: absolute;
882
+ inset: 0;
883
+ border-radius: 50%;
884
+ border: 1px solid;
885
+ transition: all 0.2s ease;
886
+
887
+ ${({ $checked, $disabled, theme }) => {
888
+ if ($disabled) {
889
+ const stateConfig = $checked ? theme.components.radio.checked : theme.components.radio.unchecked;
890
+ return `
891
+ background: ${stateConfig.backgroundDisabled};
892
+ border-color: ${stateConfig.borderColorDisabled};
893
+ `;
894
+ }
895
+ if ($checked) {
896
+ const checkedConfig = theme.components.radio.checked;
897
+ return `
898
+ background: ${checkedConfig.background};
899
+ border-color: ${checkedConfig.borderColor};
900
+ `;
901
+ }
902
+ const uncheckedConfig = theme.components.radio.unchecked;
903
+ return `
904
+ background: ${uncheckedConfig.background};
905
+ border-color: ${uncheckedConfig.borderColor};
906
+ `;
907
+ }}
908
+
909
+ ${({ $disabled, $checked, theme }) => {
910
+ if ($disabled) return "";
911
+ const stateConfig = $checked ? theme.components.radio.checked : theme.components.radio.unchecked;
912
+ return `
913
+ ${RadioContainer}:hover & {
914
+ background: ${stateConfig.backgroundHover};
915
+ border-color: ${stateConfig.borderColorHover};
916
+ }
917
+
918
+ ${RadioContainer}:active & {
919
+ border-color: ${stateConfig.borderColorActive};
920
+ }
921
+ `;
922
+ }}
923
+ `;
924
+ var RadioInner = styled3__default.default.div`
925
+ position: absolute;
926
+ left: 50%;
927
+ top: 50%;
928
+ transform: translate(-50%, -50%);
929
+ border-radius: 50%;
930
+ background: white;
931
+ opacity: ${({ $checked }) => $checked ? 1 : 0};
932
+ transition: opacity 0.2s ease;
933
+
934
+ ${({ theme }) => {
935
+ const dotSize = theme.components.radio.small.dotSize;
936
+ return `
937
+ width: ${dotSize};
938
+ height: ${dotSize};
939
+ `;
940
+ }}
941
+ `;
942
+ var Radio = ({
943
+ checked: controlledChecked,
944
+ defaultChecked = false,
945
+ disabled = false,
946
+ value,
947
+ name,
948
+ id,
949
+ onChange,
950
+ className,
951
+ style
952
+ }) => {
953
+ const [internalChecked, setInternalChecked] = React11.useState(
954
+ controlledChecked ?? defaultChecked
955
+ );
956
+ const [isFocused, setIsFocused] = React11.useState(false);
957
+ const checked = controlledChecked !== void 0 ? controlledChecked : internalChecked;
958
+ const handleChange = React11.useCallback(
959
+ (e) => {
960
+ if (disabled) return;
961
+ const newChecked = e.target.checked;
962
+ if (controlledChecked === void 0) {
963
+ setInternalChecked(newChecked);
964
+ }
965
+ onChange?.(e);
966
+ },
967
+ [disabled, controlledChecked, onChange]
968
+ );
969
+ const handleFocus = React11.useCallback(() => {
970
+ setIsFocused(true);
971
+ }, []);
972
+ const handleBlur = React11.useCallback(() => {
973
+ setIsFocused(false);
974
+ }, []);
975
+ return /* @__PURE__ */ React11__default.default.createElement(
976
+ RadioContainer,
977
+ {
978
+ $disabled: disabled,
979
+ className,
980
+ style
981
+ },
982
+ /* @__PURE__ */ React11__default.default.createElement(
983
+ HiddenInput2,
984
+ {
985
+ type: "radio",
986
+ id,
987
+ checked,
988
+ value,
989
+ name,
990
+ onChange: handleChange,
991
+ onFocus: handleFocus,
992
+ onBlur: handleBlur,
993
+ disabled
994
+ }
995
+ ),
996
+ /* @__PURE__ */ React11__default.default.createElement(
997
+ RadioOuter,
998
+ {
999
+ $checked: checked,
1000
+ $disabled: disabled,
1001
+ $isFocused: isFocused
1002
+ }
1003
+ ),
1004
+ /* @__PURE__ */ React11__default.default.createElement(
1005
+ RadioInner,
1006
+ {
1007
+ $checked: checked,
1008
+ $disabled: disabled
1009
+ }
1010
+ )
1011
+ );
1012
+ };
1013
+ Radio.displayName = "Radio";
1014
+ var CheckboxContainer = styled3__default.default.label`
1015
+ position: relative;
1016
+ display: inline-block;
1017
+ cursor: ${({ $disabled }) => $disabled ? "not-allowed" : "pointer"};
1018
+
1019
+ ${({ theme }) => {
1020
+ const sizeConfig = theme.components.checkbox.small;
1021
+ return `
1022
+ width: ${sizeConfig.size};
1023
+ height: ${sizeConfig.size};
1024
+ `;
1025
+ }}
1026
+ `;
1027
+ var HiddenInput3 = styled3__default.default.input`
1028
+ position: absolute;
1029
+ opacity: 0;
1030
+ width: 0;
1031
+ height: 0;
1032
+ pointer-events: none;
1033
+ `;
1034
+ var CheckboxBox = styled3__default.default.div`
1035
+ position: absolute;
1036
+ inset: 1px;
1037
+ border: 1px solid;
1038
+ transition: all 0.2s ease;
1039
+
1040
+ ${({ theme }) => {
1041
+ const sizeConfig = theme.components.checkbox.small;
1042
+ return `
1043
+ border-radius: ${sizeConfig.borderRadius};
1044
+ `;
1045
+ }}
1046
+
1047
+ ${({ $checked, $indeterminate, $disabled, theme }) => {
1048
+ if ($disabled) {
1049
+ const stateConfig = $checked || $indeterminate ? theme.components.checkbox.checked : theme.components.checkbox.unchecked;
1050
+ return `
1051
+ background: ${stateConfig.backgroundDisabled};
1052
+ border-color: ${stateConfig.borderColorDisabled};
1053
+ `;
1054
+ }
1055
+ if ($checked) {
1056
+ const checkedConfig = theme.components.checkbox.checked;
1057
+ return `
1058
+ background: ${checkedConfig.background};
1059
+ border-color: ${checkedConfig.borderColor};
1060
+ `;
1061
+ }
1062
+ if ($indeterminate) {
1063
+ const indeterminateConfig = theme.components.checkbox.indeterminate;
1064
+ return `
1065
+ background: ${indeterminateConfig.background};
1066
+ border-color: ${indeterminateConfig.borderColor};
1067
+ `;
1068
+ }
1069
+ const uncheckedConfig = theme.components.checkbox.unchecked;
1070
+ return `
1071
+ background: ${uncheckedConfig.background};
1072
+ border-color: ${uncheckedConfig.borderColor};
1073
+ `;
1074
+ }}
1075
+
1076
+ ${({ $disabled, $checked, $indeterminate, theme }) => {
1077
+ if ($disabled) return "";
1078
+ const stateConfig = $checked || $indeterminate ? theme.components.checkbox.checked : theme.components.checkbox.unchecked;
1079
+ return `
1080
+ ${CheckboxContainer}:hover & {
1081
+ background: ${stateConfig.backgroundHover};
1082
+ border-color: ${stateConfig.borderColorHover};
1083
+ }
1084
+
1085
+ ${CheckboxContainer}:active & {
1086
+ border-color: ${stateConfig.borderColorActive};
1087
+ }
1088
+ `;
1089
+ }}
1090
+ `;
1091
+ var IconWrapper2 = styled3__default.default.div`
1092
+ position: absolute;
1093
+ left: 50%;
1094
+ top: 50%;
1095
+ transform: translate(-50%, -50%);
1096
+ opacity: ${({ $visible }) => $visible ? 1 : 0};
1097
+ transition: opacity 0.2s ease;
1098
+ pointer-events: none;
1099
+ display: flex;
1100
+ align-items: center;
1101
+ justify-content: center;
1102
+
1103
+ ${({ theme }) => {
1104
+ const iconSize = theme.components.checkbox.small.iconSize;
1105
+ return `
1106
+ width: ${iconSize.width};
1107
+ height: ${iconSize.height};
1108
+ `;
1109
+ }}
1110
+
1111
+ svg, img {
1112
+ display: block;
1113
+ }
1114
+ `;
1115
+ var DefaultIndeterminateIcon = styled3__default.default.div`
1116
+ width: 8px;
1117
+ height: 2px;
1118
+ background: white;
1119
+ `;
1120
+ var Checkbox = ({
1121
+ checked: controlledChecked,
1122
+ defaultChecked = false,
1123
+ indeterminate = false,
1124
+ disabled = false,
1125
+ value,
1126
+ name,
1127
+ id,
1128
+ onChange,
1129
+ className,
1130
+ style
1131
+ }) => {
1132
+ const [internalChecked, setInternalChecked] = React11.useState(
1133
+ controlledChecked ?? defaultChecked
1134
+ );
1135
+ const [isFocused, setIsFocused] = React11.useState(false);
1136
+ const inputRef = React11.useRef(null);
1137
+ const checked = controlledChecked !== void 0 ? controlledChecked : internalChecked;
1138
+ React11.useEffect(() => {
1139
+ if (inputRef.current) {
1140
+ inputRef.current.indeterminate = indeterminate;
1141
+ }
1142
+ }, [indeterminate]);
1143
+ const handleChange = React11.useCallback(
1144
+ (e) => {
1145
+ if (disabled) return;
1146
+ const newChecked = e.target.checked;
1147
+ if (controlledChecked === void 0) {
1148
+ setInternalChecked(newChecked);
1149
+ }
1150
+ onChange?.(e);
1151
+ },
1152
+ [disabled, controlledChecked, onChange]
1153
+ );
1154
+ const handleFocus = React11.useCallback(() => {
1155
+ setIsFocused(true);
1156
+ }, []);
1157
+ const handleBlur = React11.useCallback(() => {
1158
+ setIsFocused(false);
1159
+ }, []);
1160
+ return /* @__PURE__ */ React11__default.default.createElement(
1161
+ CheckboxContainer,
1162
+ {
1163
+ $disabled: disabled,
1164
+ className,
1165
+ style
1166
+ },
1167
+ /* @__PURE__ */ React11__default.default.createElement(
1168
+ HiddenInput3,
1169
+ {
1170
+ ref: inputRef,
1171
+ type: "checkbox",
1172
+ id,
1173
+ checked,
1174
+ value,
1175
+ name,
1176
+ onChange: handleChange,
1177
+ onFocus: handleFocus,
1178
+ onBlur: handleBlur,
1179
+ disabled
1180
+ }
1181
+ ),
1182
+ /* @__PURE__ */ React11__default.default.createElement(
1183
+ CheckboxBox,
1184
+ {
1185
+ $checked: checked,
1186
+ $indeterminate: indeterminate,
1187
+ $disabled: disabled,
1188
+ $isFocused: isFocused
1189
+ }
1190
+ ),
1191
+ !indeterminate && /* @__PURE__ */ React11__default.default.createElement(IconWrapper2, { $visible: checked }, /* @__PURE__ */ React11__default.default.createElement("svg", { width: 10, height: 8, viewBox: "0 0 10 8", fill: "#fff" }, /* @__PURE__ */ React11__default.default.createElement("path", { d: "M1.05426 3.16164L0 4.27945L3.50904 8L10 1.11781L8.94573 0L3.50904 5.76438L1.05426 3.16164Z" }))),
1192
+ indeterminate && /* @__PURE__ */ React11__default.default.createElement(IconWrapper2, { $visible: indeterminate }, /* @__PURE__ */ React11__default.default.createElement(DefaultIndeterminateIcon, null))
1193
+ );
1194
+ };
1195
+ Checkbox.displayName = "Checkbox";
1196
+ var InputWrapper2 = styled3__default.default.div`
1197
+ display: inline-flex;
1198
+ align-items: center;
1199
+ width: 100%;
1200
+ box-sizing: border-box;
1201
+ position: relative;
1202
+ transition: all 0.2s ease;
1203
+
1204
+ ${({ $size, theme }) => {
1205
+ const size = $size || "medium";
1206
+ const sizeConfig = theme.components.input.outlined[size];
1207
+ return `
1208
+ height: ${sizeConfig.height};
1209
+ border-radius: ${sizeConfig.borderRadius};
1210
+ padding: ${sizeConfig.padding};
1211
+ font-size: ${sizeConfig.fontSize};
1212
+ line-height: ${sizeConfig.lineHeight};
1213
+ `;
1214
+ }}
1215
+
1216
+ ${({ $error, $disabled, $readOnly, $isFocused, theme, $size }) => {
1217
+ const stateConfig = theme.components.input.outlined.state;
1218
+ let borderColor = stateConfig.borderColor;
1219
+ let background = stateConfig.background;
1220
+ let boxShadow = "none";
1221
+ if ($disabled) {
1222
+ borderColor = stateConfig.borderColorDisabled;
1223
+ background = stateConfig.backgroundDisabled;
1224
+ } else if ($readOnly) {
1225
+ borderColor = stateConfig.borderColorReadonly;
1226
+ background = stateConfig.backgroundReadonly;
1227
+ } else if ($error) {
1228
+ borderColor = stateConfig.borderColorError;
1229
+ background = stateConfig.backgroundActive;
1230
+ } else if ($isFocused) {
1231
+ borderColor = stateConfig.borderColorActive;
1232
+ background = stateConfig.backgroundActive;
1233
+ const size = $size || "medium";
1234
+ boxShadow = theme.components.input.outlined[size].boxShadowActive;
1235
+ }
1236
+ return `
1237
+ border: 1px solid ${borderColor};
1238
+ background: ${background};
1239
+ box-shadow: ${boxShadow};
1240
+
1241
+ &:hover:not(:disabled) {
1242
+ ${!$disabled && !$readOnly && !$isFocused ? `
1243
+ border-color: ${stateConfig.borderColorHover};
1244
+ background: ${stateConfig.backgroundHover};
1245
+ ` : ""}
1246
+ }
1247
+ `;
1248
+ }}
1249
+
1250
+ ${({ $disabled }) => $disabled && `
1251
+ cursor: not-allowed;
1252
+ opacity: 1;
1253
+ `}
1254
+ `;
1255
+ var StyledInput2 = styled3__default.default.input`
1256
+ flex: 1;
1257
+ border: none;
1258
+ outline: none;
1259
+ background: transparent;
1260
+ min-width: 0;
1261
+ padding: 0;
1262
+ margin: 0;
1263
+ font-family: inherit;
1264
+ color: ${({ theme }) => theme.components.input.outlined.state.borderColorActive};
1265
+
1266
+ ${({ $size, theme }) => {
1267
+ const size = $size || "medium";
1268
+ const sizeConfig = theme.components.input.outlined[size];
1269
+ return `
1270
+ font-size: ${sizeConfig.fontSize};
1271
+ line-height: ${sizeConfig.lineHeight};
1272
+ `;
1273
+ }}
1274
+
1275
+ &::placeholder {
1276
+ color: ${({ theme }) => theme.colors.palettes.transparency["30"]};
1277
+ }
1278
+
1279
+ ${({ $disabled, theme }) => $disabled && `
1280
+ cursor: not-allowed;
1281
+ color: ${theme.colors.palettes.transparency["30"]};
1282
+ `}
1283
+
1284
+ ${({ $readOnly }) => $readOnly && `
1285
+ cursor: default;
1286
+ `}
1287
+ `;
1288
+ var PrefixNode = styled3__default.default.div`
1289
+ display: inline-flex;
1290
+ align-items: center;
1291
+ flex-shrink: 0;
1292
+ margin-right: 4px;
1293
+
1294
+ ${({ $size, theme }) => {
1295
+ const size = $size || "medium";
1296
+ const sizeConfig = theme.components.input.outlined[size];
1297
+ return `
1298
+ svg, img {
1299
+ width: ${sizeConfig.iconSize.width};
1300
+ height: ${sizeConfig.iconSize.height};
1301
+ }
1302
+ `;
1303
+ }}
1304
+ `;
1305
+ var SuffixNode = styled3__default.default.div`
1306
+ display: inline-flex;
1307
+ align-items: center;
1308
+ flex-shrink: 0;
1309
+ margin-left: 4px;
1310
+
1311
+ ${({ $size, theme }) => {
1312
+ const size = $size || "medium";
1313
+ const sizeConfig = theme.components.input.outlined[size];
1314
+ return `
1315
+ svg, img {
1316
+ width: ${sizeConfig.iconSize.width};
1317
+ height: ${sizeConfig.iconSize.height};
1318
+ }
1319
+ `;
1320
+ }}
1321
+ `;
1322
+ var Input = React11.forwardRef(
1323
+ ({
1324
+ size = "medium",
1325
+ error = false,
1326
+ disabled = false,
1327
+ readOnly = false,
1328
+ prefixNode,
1329
+ suffixNode,
1330
+ className,
1331
+ style,
1332
+ onFocus,
1333
+ onBlur,
1334
+ ...rest
1335
+ }, ref) => {
1336
+ const [isFocused, setIsFocused] = React11.useState(false);
1337
+ const handleFocus = (e) => {
1338
+ setIsFocused(true);
1339
+ onFocus?.(e);
1340
+ };
1341
+ const handleBlur = (e) => {
1342
+ setIsFocused(false);
1343
+ onBlur?.(e);
1344
+ };
1345
+ return /* @__PURE__ */ React11__default.default.createElement(
1346
+ InputWrapper2,
1347
+ {
1348
+ $size: size,
1349
+ $error: error,
1350
+ $disabled: !!disabled,
1351
+ $readOnly: !!readOnly,
1352
+ $isFocused: isFocused,
1353
+ className,
1354
+ style
1355
+ },
1356
+ prefixNode && /* @__PURE__ */ React11__default.default.createElement(PrefixNode, { $size: size }, prefixNode),
1357
+ /* @__PURE__ */ React11__default.default.createElement(
1358
+ StyledInput2,
1359
+ {
1360
+ ref,
1361
+ $size: size,
1362
+ $disabled: !!disabled,
1363
+ $readOnly: !!readOnly,
1364
+ disabled,
1365
+ readOnly,
1366
+ onFocus: handleFocus,
1367
+ onBlur: handleBlur,
1368
+ ...rest
1369
+ }
1370
+ ),
1371
+ suffixNode && /* @__PURE__ */ React11__default.default.createElement(SuffixNode, { $size: size }, suffixNode)
1372
+ );
1373
+ }
1374
+ );
1375
+ Input.displayName = "Input";
1376
+ var SearchIconWrapper = styled3__default.default.div`
1377
+ display: inline-flex;
1378
+ align-items: center;
1379
+ justify-content: center;
1380
+ flex-shrink: 0;
1381
+
1382
+ ${({ $size, theme }) => {
1383
+ const sizeConfig = theme.components.input.outlined[$size === "extraLarge" ? "extraLarge" : "large"];
1384
+ return `
1385
+ width: ${sizeConfig.iconSize.width};
1386
+ height: ${sizeConfig.iconSize.height};
1387
+ `;
1388
+ }}
1389
+
1390
+ svg {
1391
+ width: 100%;
1392
+ height: 100%;
1393
+ color: ${({ theme }) => theme.colors.palettes.transparency["100"]};
1394
+ }
1395
+ `;
1396
+ var ClearButton = styled3__default.default.button`
1397
+ display: inline-flex;
1398
+ align-items: center;
1399
+ justify-content: center;
1400
+ flex-shrink: 0;
1401
+ border: none;
1402
+ background: transparent;
1403
+ cursor: pointer;
1404
+ padding: 0;
1405
+ margin: 0;
1406
+ outline: none;
1407
+ transition: opacity 0.2s ease;
1408
+
1409
+ ${({ $size, theme }) => {
1410
+ const sizeConfig = theme.components.input.outlined[$size === "extraLarge" ? "extraLarge" : "large"];
1411
+ return `
1412
+ width: ${sizeConfig.iconSize.width};
1413
+ height: ${sizeConfig.iconSize.height};
1414
+ `;
1415
+ }}
1416
+
1417
+ svg {
1418
+ width: 100%;
1419
+ height: 100%;
1420
+ color: ${({ theme }) => theme.colors.palettes.transparency["100"]};
1421
+ }
1422
+
1423
+ &:hover {
1424
+ opacity: 0.7;
1425
+ }
1426
+
1427
+ &:active {
1428
+ opacity: 0.5;
1429
+ }
1430
+ `;
1431
+ var DefaultSearchIcon = () => /* @__PURE__ */ React11__default.default.createElement("svg", { viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11__default.default.createElement(
1432
+ "path",
1433
+ {
1434
+ 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",
1435
+ stroke: "currentColor",
1436
+ strokeWidth: "1.5",
1437
+ strokeLinecap: "round",
1438
+ strokeLinejoin: "round"
1439
+ }
1440
+ ), /* @__PURE__ */ React11__default.default.createElement(
1441
+ "path",
1442
+ {
1443
+ d: "M14 14L11.1 11.1",
1444
+ stroke: "currentColor",
1445
+ strokeWidth: "1.5",
1446
+ strokeLinecap: "round",
1447
+ strokeLinejoin: "round"
1448
+ }
1449
+ ));
1450
+ var DefaultCloseIcon = () => /* @__PURE__ */ React11__default.default.createElement("svg", { viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11__default.default.createElement(
1451
+ "path",
1452
+ {
1453
+ d: "M12 4L4 12",
1454
+ stroke: "currentColor",
1455
+ strokeWidth: "1.5",
1456
+ strokeLinecap: "round",
1457
+ strokeLinejoin: "round"
1458
+ }
1459
+ ), /* @__PURE__ */ React11__default.default.createElement(
1460
+ "path",
1461
+ {
1462
+ d: "M4 4L12 12",
1463
+ stroke: "currentColor",
1464
+ strokeWidth: "1.5",
1465
+ strokeLinecap: "round",
1466
+ strokeLinejoin: "round"
1467
+ }
1468
+ ));
1469
+ var SearchInput = React11.forwardRef(
1470
+ ({
1471
+ size = "extraLarge",
1472
+ clearable = true,
1473
+ onClear,
1474
+ searchIcon,
1475
+ value,
1476
+ defaultValue,
1477
+ onChange,
1478
+ disabled,
1479
+ readOnly,
1480
+ ...rest
1481
+ }, ref) => {
1482
+ const [internalValue, setInternalValue] = React11.useState(defaultValue || "");
1483
+ const isControlled = value !== void 0;
1484
+ const currentValue = isControlled ? value : internalValue;
1485
+ const handleChange = (e) => {
1486
+ if (!isControlled) {
1487
+ setInternalValue(e.target.value);
1488
+ }
1489
+ onChange?.(e);
1490
+ };
1491
+ const handleClear = () => {
1492
+ if (!isControlled) {
1493
+ setInternalValue("");
1494
+ }
1495
+ onClear?.();
1496
+ };
1497
+ const prefixNode = /* @__PURE__ */ React11__default.default.createElement(SearchIconWrapper, { $size: size }, searchIcon || /* @__PURE__ */ React11__default.default.createElement(DefaultSearchIcon, null));
1498
+ const suffixNode = clearable && currentValue && !disabled && !readOnly ? /* @__PURE__ */ React11__default.default.createElement(
1499
+ ClearButton,
1500
+ {
1501
+ $size: size,
1502
+ onClick: handleClear,
1503
+ type: "button",
1504
+ tabIndex: -1
1505
+ },
1506
+ /* @__PURE__ */ React11__default.default.createElement(DefaultCloseIcon, null)
1507
+ ) : null;
1508
+ return /* @__PURE__ */ React11__default.default.createElement(
1509
+ Input,
1510
+ {
1511
+ ref,
1512
+ size,
1513
+ prefixNode,
1514
+ suffixNode,
1515
+ value: isControlled ? value : internalValue,
1516
+ onChange: handleChange,
1517
+ disabled,
1518
+ readOnly,
1519
+ ...rest
1520
+ }
1521
+ );
1522
+ }
1523
+ );
1524
+ SearchInput.displayName = "SearchInput";
1525
+ var IconContext = React11.createContext(null);
1526
+ var IconProvider = ({
1527
+ icons,
1528
+ children
1529
+ }) => {
1530
+ return /* @__PURE__ */ React11__default.default.createElement(IconContext.Provider, { value: icons }, children);
1531
+ };
1532
+ var useIconRegistry = () => {
1533
+ return React11.useContext(IconContext);
1534
+ };
1535
+ IconProvider.displayName = "IconProvider";
1536
+
1537
+ // src/Icon/Icon.tsx
1538
+ var IconContainer = styled3__default.default.span`
1539
+ display: inline-flex;
1540
+ align-items: center;
1541
+ justify-content: center;
1542
+ width: ${({ $size }) => typeof $size === "number" ? `${$size}px` : $size};
1543
+ height: ${({ $size }) => typeof $size === "number" ? `${$size}px` : $size};
1544
+ color: ${({ $color }) => $color};
1545
+ flex-shrink: 0;
1546
+ line-height: 1;
1547
+
1548
+ svg {
1549
+ width: 100%;
1550
+ height: 100%;
1551
+ display: block;
1552
+ }
1553
+ `;
1554
+ var Icon = ({
1555
+ name,
1556
+ src,
1557
+ children,
1558
+ size = 16,
1559
+ color = "currentColor",
1560
+ alt = "icon",
1561
+ className,
1562
+ style,
1563
+ onClick
1564
+ }) => {
1565
+ const registry = useIconRegistry();
1566
+ let iconElement = children;
1567
+ if (!iconElement && src) {
1568
+ iconElement = /* @__PURE__ */ React11__default.default.createElement(
1569
+ "img",
1570
+ {
1571
+ src,
1572
+ alt,
1573
+ style: { width: "100%", height: "100%", display: "block" }
1574
+ }
1575
+ );
1576
+ }
1577
+ if (!iconElement && name && registry) {
1578
+ const IconComponent = registry[name];
1579
+ if (IconComponent) {
1580
+ iconElement = /* @__PURE__ */ React11__default.default.createElement(IconComponent, null);
1581
+ } else if (process.env.NODE_ENV !== "production") {
1582
+ console.warn(`Icon "${name}" not found in registry. Make sure IconProvider is set up.`);
1583
+ }
1584
+ }
1585
+ if (!iconElement) {
1586
+ if (process.env.NODE_ENV !== "production" && !children && !name && !src) {
1587
+ console.warn('Icon: one of "name", "src", or "children" must be provided');
1588
+ }
1589
+ return null;
1590
+ }
1591
+ return /* @__PURE__ */ React11__default.default.createElement(
1592
+ IconContainer,
1593
+ {
1594
+ $size: size,
1595
+ $color: color,
1596
+ className,
1597
+ style,
1598
+ onClick
1599
+ },
1600
+ iconElement
1601
+ );
1602
+ };
1603
+ Icon.displayName = "Icon";
1604
+ var ToastContainer = styled3__default.default.div`
1605
+ display: inline-flex;
1606
+ align-items: center;
1607
+ gap: 8px;
1608
+ border: 1px solid;
1609
+ box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.08);
1610
+
1611
+ ${({ theme }) => {
1612
+ const baseConfig = theme.components.toast;
1613
+ return `
1614
+ padding: ${baseConfig.padding};
1615
+ border-radius: ${baseConfig.borderRadius};
1616
+ font-size: ${baseConfig.fontSize};
1617
+ font-weight: ${baseConfig.fontWeight};
1618
+ `;
1619
+ }}
1620
+
1621
+ ${({ $variant, theme }) => {
1622
+ const variantConfig = theme.components.toast[$variant];
1623
+ return `
1624
+ background: ${variantConfig.background};
1625
+ border-color: ${variantConfig.borderColor};
1626
+ `;
1627
+ }}
1628
+ `;
1629
+ var IconWrapper3 = styled3__default.default.div`
1630
+ display: flex;
1631
+ align-items: center;
1632
+ justify-content: center;
1633
+ flex-shrink: 0;
1634
+
1635
+ ${({ $variant, theme }) => {
1636
+ const iconConfig = theme.components.toast[$variant].icon;
1637
+ return `
1638
+ width: ${iconConfig.size.width};
1639
+ height: ${iconConfig.size.height};
1640
+ `;
1641
+ }}
1642
+ `;
1643
+ var Message = styled3__default.default.span`
1644
+ flex: 1;
1645
+ line-height: 20px;
1646
+ color: ${({ theme }) => theme.colors.palettes.gray["120"]};
1647
+ `;
1648
+ var ActionButton = styled3__default.default.button`
1649
+ background: transparent;
1650
+ border: none;
1651
+ cursor: pointer;
1652
+ padding: 0;
1653
+ outline: none;
1654
+
1655
+ ${({ $variant, theme }) => {
1656
+ const buttonConfig = theme.components.toast[$variant].button;
1657
+ return `
1658
+ font-size: ${buttonConfig.fontSize};
1659
+ font-weight: ${buttonConfig.fontWeight};
1660
+ color: ${buttonConfig.color};
1661
+ margin-left: ${buttonConfig.gap};
1662
+ `;
1663
+ }}
1664
+
1665
+ &:hover {
1666
+ opacity: 0.8;
1667
+ }
1668
+
1669
+ &:active {
1670
+ opacity: 0.6;
1671
+ }
1672
+ `;
1673
+ var CloseButton = styled3__default.default.button`
1674
+ background: transparent;
1675
+ border: none;
1676
+ cursor: pointer;
1677
+ padding: 0;
1678
+ width: 16px;
1679
+ height: 16px;
1680
+ display: flex;
1681
+ align-items: center;
1682
+ justify-content: center;
1683
+ color: ${({ theme }) => theme.colors.palettes.gray["60"]};
1684
+ flex-shrink: 0;
1685
+ outline: none;
1686
+
1687
+ &:hover {
1688
+ color: ${({ theme }) => theme.colors.palettes.gray["100"]};
1689
+ }
1690
+
1691
+ &:active {
1692
+ color: ${({ theme }) => theme.colors.palettes.gray["120"]};
1693
+ }
1694
+ `;
1695
+ var SuccessIcon = () => /* @__PURE__ */ React11__default.default.createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11__default.default.createElement("circle", { cx: "10", cy: "10", r: "8", fill: "#4ea44b" }), /* @__PURE__ */ React11__default.default.createElement("path", { d: "M6 10L9 13L14 7", stroke: "white", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }));
1696
+ var InfoIcon = () => /* @__PURE__ */ React11__default.default.createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11__default.default.createElement("circle", { cx: "10", cy: "10", r: "8", fill: "#5ba0e7" }), /* @__PURE__ */ React11__default.default.createElement("path", { d: "M10 9V14M10 6H10.01", stroke: "white", strokeWidth: "2", strokeLinecap: "round" }));
1697
+ var ErrorIcon = () => /* @__PURE__ */ React11__default.default.createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11__default.default.createElement("circle", { cx: "10", cy: "10", r: "8", fill: "#e95555" }), /* @__PURE__ */ React11__default.default.createElement("path", { d: "M7 7L13 13M13 7L7 13", stroke: "white", strokeWidth: "2", strokeLinecap: "round" }));
1698
+ var WarnIcon = () => /* @__PURE__ */ React11__default.default.createElement("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11__default.default.createElement("circle", { cx: "10", cy: "10", r: "8", fill: "#ebe361" }), /* @__PURE__ */ React11__default.default.createElement("path", { d: "M10 6V11M10 14H10.01", stroke: "white", strokeWidth: "2", strokeLinecap: "round" }));
1699
+ var CloseIconSvg = () => /* @__PURE__ */ React11__default.default.createElement("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ React11__default.default.createElement("path", { d: "M9 3L3 9M3 3L9 9", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }));
1700
+ var Toast = ({
1701
+ variant = "info",
1702
+ message,
1703
+ actionText,
1704
+ onAction,
1705
+ closable = false,
1706
+ onClose,
1707
+ duration = 0,
1708
+ icon,
1709
+ showIcon = true,
1710
+ className,
1711
+ style
1712
+ }) => {
1713
+ const [visible, setVisible] = React11.useState(true);
1714
+ React11.useEffect(() => {
1715
+ if (duration > 0) {
1716
+ const timer = setTimeout(() => {
1717
+ setVisible(false);
1718
+ onClose?.();
1719
+ }, duration);
1720
+ return () => clearTimeout(timer);
1721
+ }
1722
+ }, [duration, onClose]);
1723
+ const handleClose = () => {
1724
+ setVisible(false);
1725
+ onClose?.();
1726
+ };
1727
+ if (!visible) {
1728
+ return null;
1729
+ }
1730
+ const defaultIcons = {
1731
+ success: /* @__PURE__ */ React11__default.default.createElement(SuccessIcon, null),
1732
+ info: /* @__PURE__ */ React11__default.default.createElement(InfoIcon, null),
1733
+ error: /* @__PURE__ */ React11__default.default.createElement(ErrorIcon, null),
1734
+ warn: /* @__PURE__ */ React11__default.default.createElement(WarnIcon, null)
1735
+ };
1736
+ const iconElement = icon || defaultIcons[variant];
1737
+ return /* @__PURE__ */ React11__default.default.createElement(
1738
+ ToastContainer,
1739
+ {
1740
+ $variant: variant,
1741
+ className,
1742
+ style,
1743
+ role: "alert",
1744
+ "aria-live": "polite"
1745
+ },
1746
+ showIcon && /* @__PURE__ */ React11__default.default.createElement(IconWrapper3, { $variant: variant }, iconElement),
1747
+ /* @__PURE__ */ React11__default.default.createElement(Message, null, message),
1748
+ actionText && onAction && /* @__PURE__ */ React11__default.default.createElement(
1749
+ ActionButton,
1750
+ {
1751
+ $variant: variant,
1752
+ onClick: onAction,
1753
+ type: "button"
1754
+ },
1755
+ actionText
1756
+ ),
1757
+ closable && /* @__PURE__ */ React11__default.default.createElement(
1758
+ CloseButton,
1759
+ {
1760
+ onClick: handleClose,
1761
+ type: "button",
1762
+ "aria-label": "Close"
1763
+ },
1764
+ /* @__PURE__ */ React11__default.default.createElement(CloseIconSvg, null)
1765
+ )
1766
+ );
1767
+ };
1768
+ Toast.displayName = "Toast";
1769
+ var ToastContext = React11.createContext(null);
1770
+ var ToastWrapper = styled3__default.default.div`
1771
+ position: fixed;
1772
+ top: 24px;
1773
+ right: 24px;
1774
+ z-index: 9999;
1775
+ display: flex;
1776
+ flex-direction: column;
1777
+ gap: 12px;
1778
+ pointer-events: none;
1779
+
1780
+ > * {
1781
+ pointer-events: auto;
1782
+ }
1783
+ `;
1784
+ var ToastContainer2 = ({
1785
+ maxCount = 5,
1786
+ defaultDuration = 3e3,
1787
+ children
1788
+ }) => {
1789
+ const [toasts, setToasts] = React11.useState([]);
1790
+ const showToast = React11.useCallback((props) => {
1791
+ const id = `toast-${Date.now()}-${Math.random()}`;
1792
+ const newToast = {
1793
+ ...props,
1794
+ id,
1795
+ duration: props.duration ?? defaultDuration
1796
+ };
1797
+ setToasts((prev) => {
1798
+ const updated = [...prev, newToast];
1799
+ return updated.slice(-maxCount);
1800
+ });
1801
+ return id;
1802
+ }, [maxCount, defaultDuration]);
1803
+ const hideToast = React11.useCallback((id) => {
1804
+ setToasts((prev) => prev.filter((toast) => toast.id !== id));
1805
+ }, []);
1806
+ const success = React11.useCallback((message, options) => {
1807
+ return showToast({ ...options, variant: "success", message });
1808
+ }, [showToast]);
1809
+ const info = React11.useCallback((message, options) => {
1810
+ return showToast({ ...options, variant: "info", message });
1811
+ }, [showToast]);
1812
+ const error = React11.useCallback((message, options) => {
1813
+ return showToast({ ...options, variant: "error", message });
1814
+ }, [showToast]);
1815
+ const warn = React11.useCallback((message, options) => {
1816
+ return showToast({ ...options, variant: "warn", message });
1817
+ }, [showToast]);
1818
+ const contextValue = {
1819
+ showToast,
1820
+ hideToast,
1821
+ success,
1822
+ info,
1823
+ error,
1824
+ warn
1825
+ };
1826
+ return /* @__PURE__ */ React11__default.default.createElement(ToastContext.Provider, { value: contextValue }, children, /* @__PURE__ */ React11__default.default.createElement(ToastWrapper, null, toasts.map((toast) => /* @__PURE__ */ React11__default.default.createElement(
1827
+ Toast,
1828
+ {
1829
+ key: toast.id,
1830
+ ...toast,
1831
+ onClose: () => hideToast(toast.id)
1832
+ }
1833
+ ))));
1834
+ };
1835
+ var useToast = () => {
1836
+ const context = React11.useContext(ToastContext);
1837
+ if (!context) {
1838
+ throw new Error("useToast must be used within ToastContainer");
1839
+ }
1840
+ return context;
1841
+ };
1842
+ ToastContainer2.displayName = "ToastContainer";
1843
+ var TabContainer = styled3__default.default.div`
1844
+ display: flex;
1845
+ flex-direction: column;
1846
+ `;
1847
+ var TabList = styled3__default.default.div`
1848
+ display: flex;
1849
+ align-items: center;
1850
+ position: relative;
1851
+
1852
+ ${({ $variant, theme }) => {
1853
+ const variantConfig = theme.components.tab[$variant];
1854
+ return `
1855
+ gap: ${variantConfig.layout.gap};
1856
+ `;
1857
+ }}
1858
+
1859
+ ${({ $variant }) => {
1860
+ if ($variant === "line") {
1861
+ return `
1862
+ border-bottom: 2px solid rgba(65, 70, 75, 0.1);
1863
+ `;
1864
+ }
1865
+ return "";
1866
+ }}
1867
+ `;
1868
+ var TabItem = styled3__default.default.button`
1869
+ display: inline-flex;
1870
+ align-items: center;
1871
+ justify-content: center;
1872
+ gap: 6px;
1873
+ border: none;
1874
+ outline: none;
1875
+ cursor: ${({ $disabled }) => $disabled ? "not-allowed" : "pointer"};
1876
+ transition: all 0.2s ease;
1877
+ position: relative;
1878
+ white-space: nowrap;
1879
+
1880
+ ${({ theme }) => {
1881
+ const sizeConfig = theme.components.tab.large;
1882
+ return `
1883
+ height: ${sizeConfig.height};
1884
+ padding: ${sizeConfig.padding};
1885
+ font-size: ${sizeConfig.fontSize};
1886
+ line-height: ${sizeConfig.lineHeight};
1887
+ border-radius: ${sizeConfig.borderRadius};
1888
+ font-weight: ${sizeConfig.fontWeight};
1889
+ `;
1890
+ }}
1891
+
1892
+ ${({ $variant, $active, $disabled, theme }) => {
1893
+ const variantConfig = theme.components.tab[$variant];
1894
+ const itemConfig = variantConfig.item;
1895
+ if ($disabled) {
1896
+ return `
1897
+ background: ${itemConfig.backgroundDisabled};
1898
+ border-color: ${itemConfig.borderColorDisabled};
1899
+ color: ${itemConfig.colorDisabled};
1900
+ `;
1901
+ }
1902
+ if ($active) {
1903
+ return `
1904
+ background: ${itemConfig.backgroundActive};
1905
+ border-color: ${itemConfig.borderColorActive};
1906
+ color: ${itemConfig.colorActive};
1907
+ `;
1908
+ }
1909
+ return `
1910
+ background: ${itemConfig.background};
1911
+ border-color: ${itemConfig.borderColor};
1912
+ color: ${itemConfig.color};
1913
+ `;
1914
+ }}
1915
+
1916
+ ${({ $variant, $disabled, theme }) => {
1917
+ if ($disabled) return "";
1918
+ const variantConfig = theme.components.tab[$variant];
1919
+ const itemConfig = variantConfig.item;
1920
+ return `
1921
+ &:hover {
1922
+ background: ${itemConfig.backgroundHover};
1923
+ border-color: ${itemConfig.borderColorHover};
1924
+ color: ${itemConfig.colorHover};
1925
+ }
1926
+ `;
1927
+ }}
1928
+
1929
+ ${({ $variant, $active }) => {
1930
+ if ($variant === "line" && $active) {
1931
+ return `
1932
+ &::after {
1933
+ content: '';
1934
+ position: absolute;
1935
+ bottom: -2px;
1936
+ left: 0;
1937
+ right: 0;
1938
+ height: 2px;
1939
+ background: currentColor;
1940
+ }
1941
+ `;
1942
+ }
1943
+ if ($variant === "card") {
1944
+ return `
1945
+ border: 1px solid;
1946
+ ${$active ? `
1947
+ border-bottom-color: transparent;
1948
+ margin-bottom: -1px;
1949
+ ` : ""}
1950
+ `;
1951
+ }
1952
+ return "";
1953
+ }}
1954
+ `;
1955
+ var Tabs = ({
1956
+ items,
1957
+ activeKey: controlledActiveKey,
1958
+ defaultActiveKey,
1959
+ variant = "line",
1960
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1961
+ size: _size = "large",
1962
+ onChange,
1963
+ className,
1964
+ style
1965
+ }) => {
1966
+ const [internalActiveKey, setInternalActiveKey] = React11.useState(
1967
+ controlledActiveKey ?? defaultActiveKey ?? items[0]?.key ?? ""
1968
+ );
1969
+ const activeKey = controlledActiveKey !== void 0 ? controlledActiveKey : internalActiveKey;
1970
+ const handleTabClick = React11.useCallback(
1971
+ (key, disabled) => {
1972
+ if (disabled) return;
1973
+ if (controlledActiveKey === void 0) {
1974
+ setInternalActiveKey(key);
1975
+ }
1976
+ onChange?.(key);
1977
+ },
1978
+ [controlledActiveKey, onChange]
1979
+ );
1980
+ return /* @__PURE__ */ React11__default.default.createElement(TabContainer, { className, style }, /* @__PURE__ */ React11__default.default.createElement(TabList, { $variant: variant, role: "tablist" }, items.map((item) => /* @__PURE__ */ React11__default.default.createElement(
1981
+ TabItem,
1982
+ {
1983
+ key: item.key,
1984
+ $variant: variant,
1985
+ $active: activeKey === item.key,
1986
+ $disabled: item.disabled || false,
1987
+ onClick: () => handleTabClick(item.key, item.disabled),
1988
+ role: "tab",
1989
+ "aria-selected": activeKey === item.key,
1990
+ "aria-disabled": item.disabled,
1991
+ disabled: item.disabled,
1992
+ type: "button"
1993
+ },
1994
+ item.icon && /* @__PURE__ */ React11__default.default.createElement("span", null, item.icon),
1995
+ item.label
1996
+ ))));
1997
+ };
1998
+ Tabs.displayName = "Tab";
1999
+ var TooltipGlobalStyles = styled3.createGlobalStyle`
2000
+ .rc-tooltip {
2001
+ position: absolute;
2002
+ z-index: 1070;
2003
+ display: block;
2004
+ visibility: visible;
2005
+ font-size: 12px;
2006
+ line-height: 1.5;
2007
+ opacity: 0;
2008
+ }
2009
+
2010
+ .rc-tooltip-hidden {
2011
+ display: none;
2012
+ }
2013
+
2014
+ .rc-tooltip-placement-top,
2015
+ .rc-tooltip-placement-topLeft,
2016
+ .rc-tooltip-placement-topRight {
2017
+ padding-bottom: 8px;
2018
+ }
2019
+
2020
+ .rc-tooltip-placement-right,
2021
+ .rc-tooltip-placement-rightTop,
2022
+ .rc-tooltip-placement-rightBottom {
2023
+ padding-left: 8px;
2024
+ }
2025
+
2026
+ .rc-tooltip-placement-bottom,
2027
+ .rc-tooltip-placement-bottomLeft,
2028
+ .rc-tooltip-placement-bottomRight {
2029
+ padding-top: 8px;
2030
+ }
2031
+
2032
+ .rc-tooltip-placement-left,
2033
+ .rc-tooltip-placement-leftTop,
2034
+ .rc-tooltip-placement-leftBottom {
2035
+ padding-right: 8px;
2036
+ }
2037
+
2038
+ .rc-tooltip-inner {
2039
+ /* istanbul ignore next - styled-components CSS generation */
2040
+ ${({ $variant, $size, theme }) => {
2041
+ if ($variant === "black") {
2042
+ const config = theme.components.tooltip.black;
2043
+ return `
2044
+ background: ${config.background};
2045
+ border: 1px solid ${config.borderColor};
2046
+ color: ${config.color};
2047
+ border-radius: ${config.borderRadius};
2048
+ padding: ${config.padding};
2049
+ box-shadow: ${config.boxShadow};
2050
+ font-size: ${config.fontSize};
2051
+ line-height: ${config.lineHeight};
2052
+ font-weight: ${config.fontWeight};
2053
+ max-width: ${config.maxWidth};
2054
+ text-align: left;
2055
+ text-decoration: none;
2056
+ word-wrap: break-word;
2057
+ `;
2058
+ } else {
2059
+ const sizeConfig = theme.components.tooltip.white[$size || "small"];
2060
+ return `
2061
+ background: ${sizeConfig.background};
2062
+ border: 1px solid ${sizeConfig.borderColor};
2063
+ color: ${sizeConfig.color};
2064
+ border-radius: ${sizeConfig.borderRadius};
2065
+ padding: ${sizeConfig.padding};
2066
+ box-shadow: ${sizeConfig.boxShadow};
2067
+ font-size: ${sizeConfig.fontSize};
2068
+ line-height: ${sizeConfig.lineHeight};
2069
+ font-weight: ${sizeConfig.fontWeight};
2070
+ text-align: left;
2071
+ text-decoration: none;
2072
+ word-wrap: break-word;
2073
+ `;
2074
+ }
2075
+ }}
2076
+ }
2077
+
2078
+ .rc-tooltip-arrow {
2079
+ position: absolute;
2080
+ width: 0;
2081
+ height: 0;
2082
+ border-color: transparent;
2083
+ border-style: solid;
2084
+ }
2085
+
2086
+ /* istanbul ignore next - styled-components CSS generation */
2087
+ ${({ $variant, theme }) => {
2088
+ const bgColor = $variant === "black" ? theme.components?.tooltip?.black?.background : theme.components?.tooltip?.white?.small?.background;
2089
+ return `
2090
+ .rc-tooltip-placement-top .rc-tooltip-arrow,
2091
+ .rc-tooltip-placement-topLeft .rc-tooltip-arrow,
2092
+ .rc-tooltip-placement-topRight .rc-tooltip-arrow {
2093
+ bottom: 3px;
2094
+ margin-left: -5px;
2095
+ border-width: 5px 5px 0;
2096
+ border-top-color: ${bgColor};
2097
+ }
2098
+
2099
+ .rc-tooltip-placement-right .rc-tooltip-arrow,
2100
+ .rc-tooltip-placement-rightTop .rc-tooltip-arrow,
2101
+ .rc-tooltip-placement-rightBottom .rc-tooltip-arrow {
2102
+ left: 3px;
2103
+ margin-top: -5px;
2104
+ border-width: 5px 5px 5px 0;
2105
+ border-right-color: ${bgColor};
2106
+ }
2107
+
2108
+ .rc-tooltip-placement-left .rc-tooltip-arrow,
2109
+ .rc-tooltip-placement-leftTop .rc-tooltip-arrow,
2110
+ .rc-tooltip-placement-leftBottom .rc-tooltip-arrow {
2111
+ right: 3px;
2112
+ margin-top: -5px;
2113
+ border-width: 5px 0 5px 5px;
2114
+ border-left-color: ${bgColor};
2115
+ }
2116
+
2117
+ .rc-tooltip-placement-bottom .rc-tooltip-arrow,
2118
+ .rc-tooltip-placement-bottomLeft .rc-tooltip-arrow,
2119
+ .rc-tooltip-placement-bottomRight .rc-tooltip-arrow {
2120
+ top: 3px;
2121
+ margin-left: -5px;
2122
+ border-width: 0 5px 5px;
2123
+ border-bottom-color: ${bgColor};
2124
+ }
2125
+ `;
2126
+ }}
2127
+
2128
+ .rc-tooltip.rc-tooltip-zoom-enter,
2129
+ .rc-tooltip.rc-tooltip-zoom-leave {
2130
+ display: block;
2131
+ }
2132
+
2133
+ .rc-tooltip-zoom-enter,
2134
+ .rc-tooltip-zoom-appear {
2135
+ opacity: 0;
2136
+ animation-duration: 0.3s;
2137
+ animation-fill-mode: both;
2138
+ animation-timing-function: cubic-bezier(0.18, 0.89, 0.32, 1.28);
2139
+ animation-play-state: paused;
2140
+ }
2141
+
2142
+ .rc-tooltip-zoom-leave {
2143
+ animation-duration: 0.3s;
2144
+ animation-fill-mode: both;
2145
+ animation-timing-function: cubic-bezier(0.6, -0.3, 0.74, 0.05);
2146
+ animation-play-state: paused;
2147
+ }
2148
+
2149
+ .rc-tooltip-zoom-enter.rc-tooltip-zoom-enter-active,
2150
+ .rc-tooltip-zoom-appear.rc-tooltip-zoom-appear-active {
2151
+ animation-name: rcToolTipZoomIn;
2152
+ animation-play-state: running;
2153
+ }
2154
+
2155
+ .rc-tooltip-zoom-leave.rc-tooltip-zoom-leave-active {
2156
+ animation-name: rcToolTipZoomOut;
2157
+ animation-play-state: running;
2158
+ }
2159
+
2160
+ @keyframes rcToolTipZoomIn {
2161
+ 0% {
2162
+ opacity: 0;
2163
+ transform-origin: 50% 50%;
2164
+ transform: scale(0, 0);
2165
+ }
2166
+ 100% {
2167
+ opacity: 1;
2168
+ transform-origin: 50% 50%;
2169
+ transform: scale(1, 1);
2170
+ }
2171
+ }
2172
+
2173
+ @keyframes rcToolTipZoomOut {
2174
+ 0% {
2175
+ opacity: 1;
2176
+ transform-origin: 50% 50%;
2177
+ transform: scale(1, 1);
2178
+ }
2179
+ 100% {
2180
+ opacity: 0;
2181
+ transform-origin: 50% 50%;
2182
+ transform: scale(0, 0);
2183
+ }
2184
+ }
2185
+ `;
2186
+ var Tooltip = ({
2187
+ content,
2188
+ variant = "black",
2189
+ size = "small",
2190
+ children,
2191
+ placement = "top",
2192
+ trigger = ["hover"],
2193
+ ...rest
2194
+ }) => {
2195
+ const GlobalStyles = TooltipGlobalStyles;
2196
+ return /* @__PURE__ */ React11__default.default.createElement(React11__default.default.Fragment, null, /* @__PURE__ */ React11__default.default.createElement(GlobalStyles, { $variant: variant, $size: size }), /* @__PURE__ */ React11__default.default.createElement(RcTooltip__default.default, { overlay: /* @__PURE__ */ React11__default.default.createElement("div", null, content), placement, trigger, ...rest }, children));
2197
+ };
2198
+ Tooltip.displayName = "Tooltip";
2199
+ var UIConfigContext = React11.createContext(null);
2200
+ var UIConfigProvider = ({
2201
+ config,
2202
+ children
2203
+ }) => {
2204
+ const {
2205
+ theme,
2206
+ icons = {},
2207
+ toast = {}
2208
+ } = config;
2209
+ const toastConfig = {
2210
+ maxCount: toast.maxCount ?? 5,
2211
+ defaultDuration: toast.defaultDuration ?? 3e3
2212
+ };
2213
+ const Provider = styled3.ThemeProvider;
2214
+ return /* @__PURE__ */ React11__default.default.createElement(UIConfigContext.Provider, { value: config }, /* @__PURE__ */ React11__default.default.createElement(Provider, { theme }, /* @__PURE__ */ React11__default.default.createElement(IconProvider, { icons }, /* @__PURE__ */ React11__default.default.createElement(
2215
+ ToastContainer2,
2216
+ {
2217
+ maxCount: toastConfig.maxCount,
2218
+ defaultDuration: toastConfig.defaultDuration
2219
+ },
2220
+ children
2221
+ ))));
2222
+ };
2223
+ var useUIConfig = () => {
2224
+ const context = React11.useContext(UIConfigContext);
2225
+ if (!context) {
2226
+ throw new Error("useUIConfig must be used within UIConfigProvider");
2227
+ }
2228
+ return context;
2229
+ };
2230
+ UIConfigProvider.displayName = "UIConfigProvider";
2231
+
2232
+ // src/UIConfigProvider/createUIConfig.ts
2233
+ var createUIConfig = (config) => {
2234
+ return {
2235
+ // Theme is required
2236
+ theme: config.theme,
2237
+ // Icons with default
2238
+ icons: config.icons ?? {},
2239
+ // Toast with defaults
2240
+ toast: {
2241
+ maxCount: config.toast?.maxCount ?? 5,
2242
+ defaultDuration: config.toast?.defaultDuration ?? 3e3,
2243
+ position: config.toast?.position ?? "top-right",
2244
+ offset: {
2245
+ x: config.toast?.offset?.x ?? 24,
2246
+ y: config.toast?.offset?.y ?? 24
2247
+ }
2248
+ },
2249
+ // Locale with default
2250
+ locale: config.locale ?? "en-US",
2251
+ // I18n with defaults
2252
+ i18n: {
2253
+ toast: {
2254
+ closeLabel: config.i18n?.toast?.closeLabel ?? "Close"
2255
+ },
2256
+ button: {
2257
+ loadingText: config.i18n?.button?.loadingText ?? "Loading..."
2258
+ },
2259
+ common: {
2260
+ confirm: config.i18n?.common?.confirm ?? "Confirm",
2261
+ cancel: config.i18n?.common?.cancel ?? "Cancel",
2262
+ ok: config.i18n?.common?.ok ?? "OK"
2263
+ }
2264
+ },
2265
+ // Z-index with defaults
2266
+ zIndex: {
2267
+ toast: config.zIndex?.toast ?? 9999,
2268
+ modal: config.zIndex?.modal ?? 1e4,
2269
+ dropdown: config.zIndex?.dropdown ?? 1e3,
2270
+ tooltip: config.zIndex?.tooltip ?? 1001
2271
+ },
2272
+ // Animation with defaults
2273
+ animation: {
2274
+ duration: config.animation?.duration ?? 200,
2275
+ easing: config.animation?.easing ?? "cubic-bezier(0.4, 0, 0.2, 1)",
2276
+ disabled: config.animation?.disabled ?? false
2277
+ },
2278
+ // A11y with defaults
2279
+ a11y: {
2280
+ announceMessages: config.a11y?.announceMessages ?? true,
2281
+ focusVisible: config.a11y?.focusVisible ?? true,
2282
+ reduceMotion: config.a11y?.reduceMotion ?? false
2283
+ }
2284
+ };
2285
+ };
2286
+ var mergeUIConfig = (baseConfig, ...configs) => {
2287
+ const merged = configs.reduce((acc, config) => ({
2288
+ ...acc,
2289
+ ...config,
2290
+ toast: { ...acc.toast, ...config.toast },
2291
+ i18n: { ...acc.i18n, ...config.i18n },
2292
+ zIndex: { ...acc.zIndex, ...config.zIndex },
2293
+ animation: { ...acc.animation, ...config.animation },
2294
+ a11y: { ...acc.a11y, ...config.a11y }
2295
+ }), baseConfig);
2296
+ return merged;
2297
+ };
2298
+
2299
+ exports.Button = Button;
2300
+ exports.Checkbox = Checkbox;
2301
+ exports.Icon = Icon;
2302
+ exports.IconProvider = IconProvider;
2303
+ exports.Input = Input;
2304
+ exports.Radio = Radio;
2305
+ exports.SearchInput = SearchInput;
2306
+ exports.Slider = Slider;
2307
+ exports.SpinButton = SpinButton;
2308
+ exports.Switch = Switch;
2309
+ exports.Tabs = Tabs;
2310
+ exports.Toast = Toast;
2311
+ exports.ToastContainer = ToastContainer2;
2312
+ exports.Tooltip = Tooltip;
2313
+ exports.UIConfigProvider = UIConfigProvider;
2314
+ exports.createUIConfig = createUIConfig;
2315
+ exports.mergeUIConfig = mergeUIConfig;
2316
+ exports.useIconRegistry = useIconRegistry;
2317
+ exports.useToast = useToast;
2318
+ exports.useUIConfig = useUIConfig;
2319
+ //# sourceMappingURL=index.js.map
2320
+ //# sourceMappingURL=index.js.map