@x-plat/design-system 0.5.55 → 0.5.59
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/Accordion/index.css +2 -2
- package/dist/components/Alert/index.css +3 -3
- package/dist/components/Avatar/index.css +2 -2
- package/dist/components/Box/index.css +1 -1
- package/dist/components/Breadcrumb/index.css +1 -1
- package/dist/components/Button/index.css +6 -6
- package/dist/components/Calendar/index.css +1 -1
- package/dist/components/CardTab/index.css +2 -2
- package/dist/components/Chart/index.css +1 -1
- package/dist/components/ChatInput/index.css +4 -4
- package/dist/components/CheckBox/index.css +5 -5
- package/dist/components/Chip/index.css +2 -2
- package/dist/components/DatePicker/index.css +20 -18
- package/dist/components/Drawer/index.css +1 -1
- package/dist/components/Dropdown/index.css +1 -1
- package/dist/components/Editor/index.css +1 -1
- package/dist/components/EmptyState/index.css +1 -1
- package/dist/components/FileUpload/index.css +1 -1
- package/dist/components/HtmlTypeWriter/index.css +1 -1
- package/dist/components/IconButton/index.css +2 -2
- package/dist/components/ImageSelector/index.css +1 -1
- package/dist/components/Input/index.css +9 -7
- package/dist/components/Pagination/index.css +6 -6
- package/dist/components/Radio/index.css +6 -6
- package/dist/components/Select/index.cjs +7 -2
- package/dist/components/Select/index.css +23 -18
- package/dist/components/Select/index.js +7 -2
- package/dist/components/Steps/index.css +1 -1
- package/dist/components/Swiper/index.cjs +7 -1
- package/dist/components/Swiper/index.css +4 -0
- package/dist/components/Swiper/index.js +7 -1
- package/dist/components/Tab/index.css +4 -4
- package/dist/components/Table/index.css +2 -2
- package/dist/components/Tag/index.css +2 -2
- package/dist/components/TextArea/index.css +2 -2
- package/dist/components/Toast/index.css +3 -3
- package/dist/components/index.cjs +14 -3
- package/dist/components/index.css +100 -89
- package/dist/components/index.js +14 -3
- package/dist/index.cjs +14 -3
- package/dist/index.css +100 -89
- package/dist/index.js +14 -3
- package/package.json +1 -1
|
@@ -1036,10 +1036,11 @@ var SelectItem = (props) => {
|
|
|
1036
1036
|
ctx?.close();
|
|
1037
1037
|
onClick?.();
|
|
1038
1038
|
};
|
|
1039
|
+
const isSelected = value !== void 0 ? ctx?.selectedValue === value : ctx?.selectedLabel === children;
|
|
1039
1040
|
return /* @__PURE__ */ jsx296(
|
|
1040
1041
|
"div",
|
|
1041
1042
|
{
|
|
1042
|
-
className: clsx_default("select-item", disabled && "disabled"),
|
|
1043
|
+
className: clsx_default("select-item", disabled && "disabled", isSelected && "is-selected"),
|
|
1043
1044
|
onClick: handleClick,
|
|
1044
1045
|
role: "menuitem",
|
|
1045
1046
|
tabIndex: disabled ? void 0 : 0,
|
|
@@ -1075,12 +1076,14 @@ var SelectRoot = (props) => {
|
|
|
1075
1076
|
const isControlled = valueProp !== void 0;
|
|
1076
1077
|
const [isOpen, setOpen] = React6.useState(false);
|
|
1077
1078
|
const [uncontrolledLabel, setUncontrolledLabel] = React6.useState(null);
|
|
1079
|
+
const [uncontrolledValue, setUncontrolledValue] = React6.useState(void 0);
|
|
1078
1080
|
const controlledLabel = React6.useMemo(() => {
|
|
1079
1081
|
if (!isControlled) return null;
|
|
1080
1082
|
const match = itemChildren.find((child) => child.props.value === valueProp);
|
|
1081
1083
|
return match ? match.props.children : null;
|
|
1082
1084
|
}, [isControlled, valueProp, itemChildren]);
|
|
1083
1085
|
const selectedLabel = isControlled ? controlledLabel : uncontrolledLabel;
|
|
1086
|
+
const selectedValue = isControlled ? valueProp : uncontrolledValue;
|
|
1084
1087
|
const triggerRef = React6.useRef(null);
|
|
1085
1088
|
const contentRef = React6.useRef(null);
|
|
1086
1089
|
const [mounted, setMounted] = React6.useState(false);
|
|
@@ -1107,6 +1110,7 @@ var SelectRoot = (props) => {
|
|
|
1107
1110
|
(label, itemValue) => {
|
|
1108
1111
|
if (!isControlled) {
|
|
1109
1112
|
setUncontrolledLabel(label);
|
|
1113
|
+
setUncontrolledValue(itemValue);
|
|
1110
1114
|
}
|
|
1111
1115
|
onChange?.(itemValue, label);
|
|
1112
1116
|
},
|
|
@@ -1119,12 +1123,13 @@ var SelectRoot = (props) => {
|
|
|
1119
1123
|
visible,
|
|
1120
1124
|
triggerRef,
|
|
1121
1125
|
selectedLabel,
|
|
1126
|
+
selectedValue,
|
|
1122
1127
|
setSelected,
|
|
1123
1128
|
open,
|
|
1124
1129
|
close,
|
|
1125
1130
|
toggle
|
|
1126
1131
|
}),
|
|
1127
|
-
[isOpen, mounted, visible, selectedLabel, setSelected, open, close, toggle]
|
|
1132
|
+
[isOpen, mounted, visible, selectedLabel, selectedValue, setSelected, open, close, toggle]
|
|
1128
1133
|
);
|
|
1129
1134
|
const stateClass = visible ? "visible" : "exit";
|
|
1130
1135
|
const handleTriggerClick = (e) => {
|
|
@@ -88,7 +88,7 @@ var Swiper = (props) => {
|
|
|
88
88
|
);
|
|
89
89
|
const [isDragging, setIsDragging] = import_react.default.useState(false);
|
|
90
90
|
const [dragOffset, setDragOffset] = import_react.default.useState(0);
|
|
91
|
-
const [animated, setAnimated] = import_react.default.useState(
|
|
91
|
+
const [animated, setAnimated] = import_react.default.useState(false);
|
|
92
92
|
const [containerWidth, setContainerWidth] = import_react.default.useState(0);
|
|
93
93
|
const containerRef = import_react.default.useRef(null);
|
|
94
94
|
const startXRef = import_react.default.useRef(0);
|
|
@@ -96,12 +96,17 @@ var Swiper = (props) => {
|
|
|
96
96
|
const autoplayTimerRef = import_react.default.useRef(null);
|
|
97
97
|
const resumeTimeoutRef = import_react.default.useRef(null);
|
|
98
98
|
const [paused, setPaused] = import_react.default.useState(false);
|
|
99
|
+
const initializedRef = import_react.default.useRef(false);
|
|
99
100
|
import_react.default.useEffect(() => {
|
|
100
101
|
const el = containerRef.current;
|
|
101
102
|
if (!el) return;
|
|
102
103
|
const ro = new ResizeObserver((entries) => {
|
|
103
104
|
for (const entry of entries) {
|
|
104
105
|
setContainerWidth(entry.contentRect.width);
|
|
106
|
+
if (!initializedRef.current) {
|
|
107
|
+
initializedRef.current = true;
|
|
108
|
+
requestAnimationFrame(() => setAnimated(true));
|
|
109
|
+
}
|
|
105
110
|
}
|
|
106
111
|
});
|
|
107
112
|
ro.observe(el);
|
|
@@ -304,6 +309,7 @@ var Swiper = (props) => {
|
|
|
304
309
|
className: "lib-xplat-swiper__viewport",
|
|
305
310
|
onMouseDown: handleDragStart,
|
|
306
311
|
onTouchStart: handleDragStart,
|
|
312
|
+
onDragStart: (e) => e.preventDefault(),
|
|
307
313
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
308
314
|
"div",
|
|
309
315
|
{
|
|
@@ -52,7 +52,7 @@ var Swiper = (props) => {
|
|
|
52
52
|
);
|
|
53
53
|
const [isDragging, setIsDragging] = React.useState(false);
|
|
54
54
|
const [dragOffset, setDragOffset] = React.useState(0);
|
|
55
|
-
const [animated, setAnimated] = React.useState(
|
|
55
|
+
const [animated, setAnimated] = React.useState(false);
|
|
56
56
|
const [containerWidth, setContainerWidth] = React.useState(0);
|
|
57
57
|
const containerRef = React.useRef(null);
|
|
58
58
|
const startXRef = React.useRef(0);
|
|
@@ -60,12 +60,17 @@ var Swiper = (props) => {
|
|
|
60
60
|
const autoplayTimerRef = React.useRef(null);
|
|
61
61
|
const resumeTimeoutRef = React.useRef(null);
|
|
62
62
|
const [paused, setPaused] = React.useState(false);
|
|
63
|
+
const initializedRef = React.useRef(false);
|
|
63
64
|
React.useEffect(() => {
|
|
64
65
|
const el = containerRef.current;
|
|
65
66
|
if (!el) return;
|
|
66
67
|
const ro = new ResizeObserver((entries) => {
|
|
67
68
|
for (const entry of entries) {
|
|
68
69
|
setContainerWidth(entry.contentRect.width);
|
|
70
|
+
if (!initializedRef.current) {
|
|
71
|
+
initializedRef.current = true;
|
|
72
|
+
requestAnimationFrame(() => setAnimated(true));
|
|
73
|
+
}
|
|
69
74
|
}
|
|
70
75
|
});
|
|
71
76
|
ro.observe(el);
|
|
@@ -268,6 +273,7 @@ var Swiper = (props) => {
|
|
|
268
273
|
className: "lib-xplat-swiper__viewport",
|
|
269
274
|
onMouseDown: handleDragStart,
|
|
270
275
|
onTouchStart: handleDragStart,
|
|
276
|
+
onDragStart: (e) => e.preventDefault(),
|
|
271
277
|
children: /* @__PURE__ */ jsx(
|
|
272
278
|
"div",
|
|
273
279
|
{
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
}
|
|
15
15
|
.lib-xplat-tab.sm {
|
|
16
16
|
height: var(--spacing-control-height-sm);
|
|
17
|
-
font-size: var(--semantic-typo-
|
|
17
|
+
font-size: var(--semantic-typo-caption-1-r-size);
|
|
18
18
|
}
|
|
19
19
|
.lib-xplat-tab.md {
|
|
20
20
|
height: var(--spacing-control-height-md);
|
|
21
|
-
font-size: var(--semantic-typo-label-
|
|
21
|
+
font-size: var(--semantic-typo-label-2-m-size);
|
|
22
22
|
}
|
|
23
23
|
.lib-xplat-tab.lg {
|
|
24
24
|
height: var(--spacing-control-height-lg);
|
|
25
|
-
font-size: var(--semantic-typo-
|
|
25
|
+
font-size: var(--semantic-typo-label-1-m-size);
|
|
26
26
|
}
|
|
27
27
|
.lib-xplat-tab.type-default {
|
|
28
28
|
width: 100%;
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
justify-content: center;
|
|
61
61
|
white-space: nowrap;
|
|
62
62
|
padding: 0 var(--spacing-space-3);
|
|
63
|
-
font-size: var(--semantic-typo-label-
|
|
63
|
+
font-size: var(--semantic-typo-label-2-m-size);
|
|
64
64
|
font-weight: 500;
|
|
65
65
|
height: 100%;
|
|
66
66
|
background: none;
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
.lib-xplat-table-wrapper.md > .lib-xplat-table > tbody > tr > th,
|
|
23
23
|
.lib-xplat-table-wrapper.md > .lib-xplat-table > tbody > tr > td {
|
|
24
24
|
padding: var(--spacing-space-2) var(--spacing-space-3);
|
|
25
|
-
font-size: var(--semantic-typo-
|
|
25
|
+
font-size: var(--semantic-typo-caption-1-r-size);
|
|
26
26
|
}
|
|
27
27
|
.lib-xplat-table-wrapper.lg > .lib-xplat-table > thead > tr > th,
|
|
28
28
|
.lib-xplat-table-wrapper.lg > .lib-xplat-table > thead > tr > td,
|
|
29
29
|
.lib-xplat-table-wrapper.lg > .lib-xplat-table > tbody > tr > th,
|
|
30
30
|
.lib-xplat-table-wrapper.lg > .lib-xplat-table > tbody > tr > td {
|
|
31
31
|
padding: var(--spacing-space-3) var(--spacing-space-4);
|
|
32
|
-
font-size: var(--semantic-typo-label-
|
|
32
|
+
font-size: var(--semantic-typo-label-2-m-size);
|
|
33
33
|
}
|
|
34
34
|
.lib-xplat-table-wrapper > .lib-xplat-table {
|
|
35
35
|
width: 100%;
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
.lib-xplat-tag.lg {
|
|
20
20
|
gap: var(--spacing-space-1);
|
|
21
21
|
padding: var(--spacing-space-1) var(--spacing-space-2);
|
|
22
|
-
font-size: var(--semantic-typo-
|
|
22
|
+
font-size: var(--semantic-typo-caption-1-r-size);
|
|
23
23
|
}
|
|
24
24
|
.lib-xplat-tag.neutral {
|
|
25
25
|
color: var(--semantic-text-muted);
|
|
@@ -95,5 +95,5 @@
|
|
|
95
95
|
font-size: var(--semantic-typo-caption-2-r-size);
|
|
96
96
|
}
|
|
97
97
|
.lib-xplat-tag.lg .tag-close svg {
|
|
98
|
-
font-size: var(--semantic-typo-
|
|
98
|
+
font-size: var(--semantic-typo-caption-1-r-size);
|
|
99
99
|
}
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
color: var(--semantic-text-subtle);
|
|
40
40
|
resize: none;
|
|
41
41
|
height: 1.5em;
|
|
42
|
-
font-size: var(--semantic-typo-label-
|
|
43
|
-
line-height: var(--semantic-typo-label-
|
|
42
|
+
font-size: var(--semantic-typo-label-2-m-size);
|
|
43
|
+
line-height: var(--semantic-typo-label-2-m-lh);
|
|
44
44
|
font-family: inherit;
|
|
45
45
|
}
|
|
46
46
|
.lib-xplat-textarea-wrapper .lib-xplat-textarea > textarea:disabled {
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
gap: var(--spacing-space-2);
|
|
54
54
|
padding: var(--spacing-space-3) var(--spacing-space-4);
|
|
55
55
|
border-radius: var(--spacing-radius-md);
|
|
56
|
-
font-size: var(--semantic-typo-
|
|
57
|
-
line-height: var(--semantic-typo-
|
|
56
|
+
font-size: var(--semantic-typo-caption-1-r-size);
|
|
57
|
+
line-height: var(--semantic-typo-caption-1-r-lh);
|
|
58
58
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
|
|
59
59
|
pointer-events: auto;
|
|
60
60
|
animation: lib-xplat-toast-enter 0.2s ease;
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
background: none;
|
|
74
74
|
border: none;
|
|
75
75
|
cursor: pointer;
|
|
76
|
-
font-size: var(--semantic-typo-
|
|
76
|
+
font-size: var(--semantic-typo-label-1-m-size);
|
|
77
77
|
line-height: 1;
|
|
78
78
|
padding: 0;
|
|
79
79
|
opacity: 0.6;
|
|
@@ -5140,10 +5140,11 @@ var SelectItem = (props) => {
|
|
|
5140
5140
|
ctx?.close();
|
|
5141
5141
|
onClick?.();
|
|
5142
5142
|
};
|
|
5143
|
+
const isSelected = value !== void 0 ? ctx?.selectedValue === value : ctx?.selectedLabel === children;
|
|
5143
5144
|
return /* @__PURE__ */ (0, import_jsx_runtime334.jsx)(
|
|
5144
5145
|
"div",
|
|
5145
5146
|
{
|
|
5146
|
-
className: clsx_default("select-item", disabled && "disabled"),
|
|
5147
|
+
className: clsx_default("select-item", disabled && "disabled", isSelected && "is-selected"),
|
|
5147
5148
|
onClick: handleClick,
|
|
5148
5149
|
role: "menuitem",
|
|
5149
5150
|
tabIndex: disabled ? void 0 : 0,
|
|
@@ -5179,12 +5180,14 @@ var SelectRoot = (props) => {
|
|
|
5179
5180
|
const isControlled = valueProp !== void 0;
|
|
5180
5181
|
const [isOpen, setOpen] = import_react31.default.useState(false);
|
|
5181
5182
|
const [uncontrolledLabel, setUncontrolledLabel] = import_react31.default.useState(null);
|
|
5183
|
+
const [uncontrolledValue, setUncontrolledValue] = import_react31.default.useState(void 0);
|
|
5182
5184
|
const controlledLabel = import_react31.default.useMemo(() => {
|
|
5183
5185
|
if (!isControlled) return null;
|
|
5184
5186
|
const match = itemChildren.find((child) => child.props.value === valueProp);
|
|
5185
5187
|
return match ? match.props.children : null;
|
|
5186
5188
|
}, [isControlled, valueProp, itemChildren]);
|
|
5187
5189
|
const selectedLabel = isControlled ? controlledLabel : uncontrolledLabel;
|
|
5190
|
+
const selectedValue = isControlled ? valueProp : uncontrolledValue;
|
|
5188
5191
|
const triggerRef = import_react31.default.useRef(null);
|
|
5189
5192
|
const contentRef = import_react31.default.useRef(null);
|
|
5190
5193
|
const [mounted, setMounted] = import_react31.default.useState(false);
|
|
@@ -5211,6 +5214,7 @@ var SelectRoot = (props) => {
|
|
|
5211
5214
|
(label, itemValue) => {
|
|
5212
5215
|
if (!isControlled) {
|
|
5213
5216
|
setUncontrolledLabel(label);
|
|
5217
|
+
setUncontrolledValue(itemValue);
|
|
5214
5218
|
}
|
|
5215
5219
|
onChange?.(itemValue, label);
|
|
5216
5220
|
},
|
|
@@ -5223,12 +5227,13 @@ var SelectRoot = (props) => {
|
|
|
5223
5227
|
visible,
|
|
5224
5228
|
triggerRef,
|
|
5225
5229
|
selectedLabel,
|
|
5230
|
+
selectedValue,
|
|
5226
5231
|
setSelected,
|
|
5227
5232
|
open,
|
|
5228
5233
|
close,
|
|
5229
5234
|
toggle
|
|
5230
5235
|
}),
|
|
5231
|
-
[isOpen, mounted, visible, selectedLabel, setSelected, open, close, toggle]
|
|
5236
|
+
[isOpen, mounted, visible, selectedLabel, selectedValue, setSelected, open, close, toggle]
|
|
5232
5237
|
);
|
|
5233
5238
|
const stateClass = visible ? "visible" : "exit";
|
|
5234
5239
|
const handleTriggerClick = (e) => {
|
|
@@ -5442,7 +5447,7 @@ var Swiper = (props) => {
|
|
|
5442
5447
|
);
|
|
5443
5448
|
const [isDragging, setIsDragging] = import_react32.default.useState(false);
|
|
5444
5449
|
const [dragOffset, setDragOffset] = import_react32.default.useState(0);
|
|
5445
|
-
const [animated, setAnimated] = import_react32.default.useState(
|
|
5450
|
+
const [animated, setAnimated] = import_react32.default.useState(false);
|
|
5446
5451
|
const [containerWidth, setContainerWidth] = import_react32.default.useState(0);
|
|
5447
5452
|
const containerRef = import_react32.default.useRef(null);
|
|
5448
5453
|
const startXRef = import_react32.default.useRef(0);
|
|
@@ -5450,12 +5455,17 @@ var Swiper = (props) => {
|
|
|
5450
5455
|
const autoplayTimerRef = import_react32.default.useRef(null);
|
|
5451
5456
|
const resumeTimeoutRef = import_react32.default.useRef(null);
|
|
5452
5457
|
const [paused, setPaused] = import_react32.default.useState(false);
|
|
5458
|
+
const initializedRef = import_react32.default.useRef(false);
|
|
5453
5459
|
import_react32.default.useEffect(() => {
|
|
5454
5460
|
const el = containerRef.current;
|
|
5455
5461
|
if (!el) return;
|
|
5456
5462
|
const ro = new ResizeObserver((entries) => {
|
|
5457
5463
|
for (const entry of entries) {
|
|
5458
5464
|
setContainerWidth(entry.contentRect.width);
|
|
5465
|
+
if (!initializedRef.current) {
|
|
5466
|
+
initializedRef.current = true;
|
|
5467
|
+
requestAnimationFrame(() => setAnimated(true));
|
|
5468
|
+
}
|
|
5459
5469
|
}
|
|
5460
5470
|
});
|
|
5461
5471
|
ro.observe(el);
|
|
@@ -5658,6 +5668,7 @@ var Swiper = (props) => {
|
|
|
5658
5668
|
className: "lib-xplat-swiper__viewport",
|
|
5659
5669
|
onMouseDown: handleDragStart,
|
|
5660
5670
|
onTouchStart: handleDragStart,
|
|
5671
|
+
onDragStart: (e) => e.preventDefault(),
|
|
5661
5672
|
children: /* @__PURE__ */ (0, import_jsx_runtime339.jsx)(
|
|
5662
5673
|
"div",
|
|
5663
5674
|
{
|