idea-react 3.0.0-beta.0 → 3.0.0-beta.1
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/AGENTS.md +11 -2
- package/ReadMe.md +62 -49
- package/dist/DatePickerPlugin-CpGuQRsi.js +1 -0
- package/dist/DatePickerPlugin-DB3nnslN.mjs +1 -0
- package/dist/index.d.mts +1116 -442
- package/dist/index.d.ts +1116 -442
- package/dist/index.js +16 -16
- package/dist/index.mjs +15 -15
- package/dist/rolldown-runtime-5iZMYShA.js +1 -0
- package/dist/style.css +69 -66
- package/package.json +1 -1
- package/source/Accordion.tsx +137 -0
- package/source/Alert.tsx +138 -0
- package/source/Avatar.tsx +7 -1
- package/source/Badge.tsx +2 -0
- package/source/Breadcrumb.tsx +36 -0
- package/source/Button.tsx +40 -5
- package/source/ButtonGroup.tsx +10 -1
- package/source/Card.tsx +65 -4
- package/source/Carousel/index.tsx +391 -0
- package/source/Carousel/model.ts +113 -0
- package/source/Carousel/scroll.ts +79 -0
- package/source/Collapse.tsx +178 -0
- package/source/Drawer.tsx +127 -30
- package/source/{CodeBlock.tsx → Extension/CodeBlock/index.tsx} +23 -5
- package/source/Extension/CodeBlock/style.module.css +3 -0
- package/source/{Dialog.tsx → Extension/Dialog.tsx} +10 -6
- package/source/{EditorHTML.tsx → Extension/EditorHTML.tsx} +1 -1
- package/source/{HorizontalMarquee → Extension/HorizontalMarquee}/index.module.less +1 -3
- package/source/{Icon.tsx → Extension/Icon.tsx} +1 -7
- package/source/{Loading.tsx → Extension/Loading.tsx} +8 -3
- package/source/{MonthCalendar.tsx → Extension/MonthCalendar.tsx} +3 -3
- package/source/{Nameplate.tsx → Extension/Nameplate.tsx} +1 -1
- package/source/Extension/OverlayBox.tsx +280 -0
- package/source/{PageNav.tsx → Extension/PageNav.tsx} +27 -9
- package/source/{ScrollNav → Extension/ScrollNav}/index.tsx +1 -1
- package/source/Extension/Select.tsx +127 -0
- package/source/{ShareBox.tsx → Extension/ShareBox.tsx} +1 -1
- package/source/{SpinnerButton.tsx → Extension/SpinnerButton.tsx} +2 -2
- package/source/{TableSpinner.tsx → Extension/TableSpinner.tsx} +1 -1
- package/source/{Timeline → Extension/Timeline}/index.tsx +1 -1
- package/source/{UserRank → Extension/UserRank}/index.tsx +4 -4
- package/source/Extension/index.ts +27 -0
- package/source/Form/Adorn.tsx +32 -11
- package/source/Form/Checkbox.tsx +11 -6
- package/source/Form/ChipInput.tsx +125 -0
- package/source/Form/Chips.tsx +42 -24
- package/source/Form/Combobox.tsx +337 -72
- package/source/Form/Control.tsx +50 -15
- package/source/Form/DatePicker.tsx +231 -40
- package/source/Form/DatePickerPlugin.ts +37 -0
- package/source/Form/Feedback.tsx +10 -4
- package/source/Form/FloatingLabel.tsx +24 -7
- package/source/Form/InputGroup.tsx +155 -5
- package/source/Form/OTP.tsx +138 -45
- package/source/Form/PasswordStrength.tsx +43 -17
- package/source/Form/Plugin.tsx +53 -0
- package/source/Form/Primitives.tsx +51 -9
- package/source/Form/Radio.tsx +20 -28
- package/source/Form/Range.tsx +103 -52
- package/source/Form/Switch.tsx +30 -7
- package/source/Form/index.ts +1 -0
- package/source/Grid.tsx +4 -0
- package/source/ListGroup.tsx +28 -15
- package/source/Menu.tsx +226 -17
- package/source/NativeDialog/index.tsx +109 -5
- package/source/Nav.tsx +18 -2
- package/source/NavOverflow/index.tsx +307 -0
- package/source/NavOverflow/model.ts +21 -0
- package/source/Navbar.tsx +18 -3
- package/source/Overlay.ts +163 -1
- package/source/Pagination.tsx +92 -0
- package/source/Placeholder.tsx +66 -0
- package/source/Popover.tsx +7 -2
- package/source/Progress/index.tsx +76 -0
- package/source/Progress/style.module.css +15 -0
- package/source/ScrollSpy/index.tsx +365 -0
- package/source/ScrollSpy/model.ts +17 -0
- package/source/Spinner.tsx +10 -0
- package/source/Stepper.tsx +85 -0
- package/source/Tab.tsx +248 -0
- package/source/Toast.tsx +46 -14
- package/source/ToggleButton.tsx +21 -7
- package/source/Toggler.tsx +108 -0
- package/source/Tooltip.tsx +6 -1
- package/source/index.ts +15 -27
- package/source/OverlayBox.tsx +0 -208
- package/source/Select.tsx +0 -95
- /package/source/{ClickBoundary.tsx → Extension/ClickBoundary.tsx} +0 -0
- /package/source/{Countdown.tsx → Extension/Countdown.tsx} +0 -0
- /package/source/{Editor.tsx → Extension/Editor.tsx} +0 -0
- /package/source/{HorizontalMarquee → Extension/HorizontalMarquee}/index.tsx +0 -0
- /package/source/{LiveTSX.tsx → Extension/LiveTSX.tsx} +0 -0
- /package/source/{ScrollNav → Extension/ScrollNav}/Scroller.tsx +0 -0
- /package/source/{ScrollNav → Extension/ScrollNav}/index.module.less +0 -0
- /package/source/{TextTruncate → Extension/TextTruncate}/Content.tsx +0 -0
- /package/source/{TextTruncate → Extension/TextTruncate}/index.tsx +0 -0
- /package/source/{Time.tsx → Extension/Time.tsx} +0 -0
- /package/source/{TimeDistance.tsx → Extension/TimeDistance.tsx} +0 -0
- /package/source/{Timeline → Extension/Timeline}/index.module.less +0 -0
- /package/source/{TypeEcho → Extension/TypeEcho}/Content.tsx +0 -0
- /package/source/{TypeEcho → Extension/TypeEcho}/index.tsx +0 -0
- /package/source/{UserRank → Extension/UserRank}/Address.tsx +0 -0
- /package/source/{UserRank → Extension/UserRank}/index.module.less +0 -0
- /package/source/{VerticalMarquee → Extension/VerticalMarquee}/index.module.less +0 -0
- /package/source/{VerticalMarquee → Extension/VerticalMarquee}/index.tsx +0 -0
- /package/source/{ZodiacBar.tsx → Extension/ZodiacBar.tsx} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return o}});
|
package/dist/style.css
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
--bs-dialog-backdrop-bg: transparent;
|
|
3
3
|
--bs-dialog-backdrop-blur: 0;
|
|
4
4
|
}
|
|
5
|
-
|
|
5
|
+
.eJn_MW_code span[style] {
|
|
6
|
+
color: light-dark(var(--shiki-light), var(--shiki-dark));
|
|
7
|
+
}
|
|
8
|
+
@keyframes ONAURG_scrollItem {
|
|
6
9
|
0%, 10% {
|
|
7
10
|
transform: translateX(0);
|
|
8
11
|
}
|
|
@@ -12,7 +15,7 @@
|
|
|
12
15
|
}
|
|
13
16
|
}
|
|
14
17
|
|
|
15
|
-
@keyframes
|
|
18
|
+
@keyframes ONAURG_scrollWrap {
|
|
16
19
|
0%, 10% {
|
|
17
20
|
transform: translateX(0);
|
|
18
21
|
}
|
|
@@ -22,66 +25,66 @@
|
|
|
22
25
|
}
|
|
23
26
|
}
|
|
24
27
|
|
|
25
|
-
.
|
|
26
|
-
animation: 4s linear infinite alternate
|
|
28
|
+
.ONAURG_scrollWrap {
|
|
29
|
+
animation: 4s linear infinite alternate ONAURG_scrollWrap;
|
|
27
30
|
}
|
|
28
31
|
|
|
29
|
-
.
|
|
30
|
-
animation: 4s linear infinite alternate
|
|
32
|
+
.ONAURG_scrollWrap .ONAURG_scrollItem {
|
|
33
|
+
animation: 4s linear infinite alternate ONAURG_scrollItem;
|
|
31
34
|
}
|
|
32
35
|
|
|
33
|
-
.
|
|
36
|
+
.ONAURG_scrollWrap:hover, .ONAURG_scrollWrap:hover .ONAURG_scrollItem {
|
|
34
37
|
animation-play-state: paused;
|
|
35
38
|
}
|
|
36
39
|
|
|
37
|
-
.
|
|
40
|
+
.ONAURG_scrollHeightWrap {
|
|
38
41
|
--scroll-height: 20px;
|
|
39
42
|
height: var(--scroll-height);
|
|
40
43
|
}
|
|
41
44
|
|
|
42
|
-
.
|
|
45
|
+
.ONAURG_scrollHeightWrap .ONAURG_scrollContainer {
|
|
43
46
|
transform: translateY(calc(calc(-100% + var(--scroll-height) + var(--scroll-height)) * 2));
|
|
44
47
|
max-height: calc(var(--scroll-height) * 3);
|
|
45
48
|
}
|
|
46
49
|
|
|
47
|
-
.
|
|
50
|
+
.ONAURG_scrollHeightWrap .ONAURG_scrollContainer .ONAURG_unScrollItem {
|
|
48
51
|
max-height: calc(var(--scroll-height) * 2);
|
|
49
52
|
line-height: var(--scroll-height);
|
|
50
53
|
}
|
|
51
54
|
|
|
52
|
-
.
|
|
55
|
+
.ONAURG_scrollHeightWrap .ONAURG_scrollContainer .ONAURG_scrollItem {
|
|
53
56
|
height: var(--scroll-height);
|
|
54
57
|
line-height: var(--scroll-height);
|
|
55
58
|
}
|
|
56
|
-
.
|
|
59
|
+
.nZcgHq_scrollerInner {
|
|
57
60
|
-webkit-overflow-scrolling: touch;
|
|
58
61
|
scrollbar-width: none;
|
|
59
62
|
}
|
|
60
63
|
|
|
61
|
-
.
|
|
64
|
+
.nZcgHq_scrollerInner::-webkit-scrollbar {
|
|
62
65
|
display: none;
|
|
63
66
|
}
|
|
64
67
|
|
|
65
|
-
.
|
|
68
|
+
.nZcgHq_scrollButtonLeft {
|
|
66
69
|
background: linear-gradient(to right, #d3d3d3, #0000);
|
|
67
70
|
}
|
|
68
71
|
|
|
69
|
-
.
|
|
72
|
+
.nZcgHq_scrollButtonRight {
|
|
70
73
|
background: linear-gradient(to left, #d3d3d3, #0000);
|
|
71
74
|
}
|
|
72
|
-
.
|
|
75
|
+
.M_u5hG_timeline {
|
|
73
76
|
max-width: 50%;
|
|
74
77
|
margin: 0 auto;
|
|
75
78
|
position: relative;
|
|
76
79
|
}
|
|
77
80
|
|
|
78
81
|
@media (width <= 991px) {
|
|
79
|
-
.
|
|
82
|
+
.M_u5hG_timeline {
|
|
80
83
|
max-width: 100%;
|
|
81
84
|
}
|
|
82
85
|
}
|
|
83
86
|
|
|
84
|
-
.
|
|
87
|
+
.M_u5hG_timeline:after {
|
|
85
88
|
content: "";
|
|
86
89
|
background-color: #fff;
|
|
87
90
|
width: 3px;
|
|
@@ -92,13 +95,13 @@
|
|
|
92
95
|
left: 10px;
|
|
93
96
|
}
|
|
94
97
|
|
|
95
|
-
.
|
|
98
|
+
.M_u5hG_timelineItem {
|
|
96
99
|
background-color: inherit;
|
|
97
100
|
width: 100%;
|
|
98
101
|
position: relative;
|
|
99
102
|
}
|
|
100
103
|
|
|
101
|
-
.
|
|
104
|
+
.M_u5hG_timelineItem:after {
|
|
102
105
|
z-index: 1;
|
|
103
106
|
content: "";
|
|
104
107
|
background-color: #fff;
|
|
@@ -110,12 +113,12 @@
|
|
|
110
113
|
right: 1px;
|
|
111
114
|
}
|
|
112
115
|
|
|
113
|
-
.
|
|
116
|
+
.M_u5hG_right {
|
|
114
117
|
padding: 0 0 20px 40px;
|
|
115
118
|
left: auto;
|
|
116
119
|
}
|
|
117
120
|
|
|
118
|
-
.
|
|
121
|
+
.M_u5hG_right:before {
|
|
119
122
|
z-index: 1;
|
|
120
123
|
content: " ";
|
|
121
124
|
border: 10px solid #0000;
|
|
@@ -126,10 +129,10 @@
|
|
|
126
129
|
left: 30px;
|
|
127
130
|
}
|
|
128
131
|
|
|
129
|
-
.
|
|
132
|
+
.M_u5hG_right:after {
|
|
130
133
|
left: 0;
|
|
131
134
|
}
|
|
132
|
-
@keyframes
|
|
135
|
+
@keyframes UcKh3G_suspension {
|
|
133
136
|
0% {
|
|
134
137
|
position: relative;
|
|
135
138
|
top: 0;
|
|
@@ -146,26 +149,26 @@
|
|
|
146
149
|
}
|
|
147
150
|
}
|
|
148
151
|
|
|
149
|
-
.
|
|
152
|
+
.UcKh3G_rankBox {
|
|
150
153
|
--logo-image: url("https://github.com/idea2app.png");
|
|
151
154
|
--title-background-image: url("https://hackathon-api.static.kaiyuanshe.cn/6342619375fa1817e0f56ce1/2022/10/09/rrrr.png");
|
|
152
155
|
}
|
|
153
156
|
|
|
154
|
-
.
|
|
157
|
+
.UcKh3G_rankBox a {
|
|
155
158
|
color: inherit;
|
|
156
159
|
text-decoration: none;
|
|
157
160
|
}
|
|
158
161
|
|
|
159
|
-
.
|
|
162
|
+
.UcKh3G_rankBox .UcKh3G_image {
|
|
160
163
|
width: 2.1rem;
|
|
161
164
|
}
|
|
162
165
|
|
|
163
|
-
.
|
|
166
|
+
.UcKh3G_rankBox .UcKh3G_image:hover img {
|
|
164
167
|
transition: all .3s;
|
|
165
168
|
transform: scale(1.1);
|
|
166
169
|
}
|
|
167
170
|
|
|
168
|
-
.
|
|
171
|
+
.UcKh3G_rankBox .UcKh3G_title {
|
|
169
172
|
z-index: 4;
|
|
170
173
|
background-image: var(--title-background-image);
|
|
171
174
|
background-size: 21rem;
|
|
@@ -176,7 +179,7 @@
|
|
|
176
179
|
position: relative;
|
|
177
180
|
}
|
|
178
181
|
|
|
179
|
-
.
|
|
182
|
+
.UcKh3G_rankBox .UcKh3G_title:before {
|
|
180
183
|
content: "";
|
|
181
184
|
background-color: #a1a098b3;
|
|
182
185
|
border-radius: .3rem;
|
|
@@ -188,13 +191,13 @@
|
|
|
188
191
|
left: 0;
|
|
189
192
|
}
|
|
190
193
|
|
|
191
|
-
.
|
|
194
|
+
.UcKh3G_rankBox .UcKh3G_title .UcKh3G_medal {
|
|
192
195
|
position: absolute;
|
|
193
196
|
top: -1.2rem;
|
|
194
197
|
left: 5%;
|
|
195
198
|
}
|
|
196
199
|
|
|
197
|
-
.
|
|
200
|
+
.UcKh3G_rankBox .UcKh3G_title .UcKh3G_medal i {
|
|
198
201
|
background-image: var(--logo-image), linear-gradient(#ffd83a, #fdeba0);
|
|
199
202
|
background-blend-mode: lighten;
|
|
200
203
|
background-position: center;
|
|
@@ -206,19 +209,19 @@
|
|
|
206
209
|
box-shadow: 0 0 .5rem #ffd83a;
|
|
207
210
|
}
|
|
208
211
|
|
|
209
|
-
.
|
|
212
|
+
.UcKh3G_rankBox .UcKh3G_title .UcKh3G_medal i:first-child {
|
|
210
213
|
background-image: var(--logo-image), linear-gradient(#d8d8d8, #eee);
|
|
211
214
|
border-color: #d8d8d8;
|
|
212
215
|
box-shadow: 0 0 .5rem #d8d8d8;
|
|
213
216
|
}
|
|
214
217
|
|
|
215
|
-
.
|
|
218
|
+
.UcKh3G_rankBox .UcKh3G_title .UcKh3G_medal i:last-child {
|
|
216
219
|
background-image: var(--logo-image), linear-gradient(#fab36e, #fbe7d3);
|
|
217
220
|
border-color: #fab36e;
|
|
218
221
|
box-shadow: 0 0 .5rem #fab36e;
|
|
219
222
|
}
|
|
220
223
|
|
|
221
|
-
.
|
|
224
|
+
.UcKh3G_rankBox .UcKh3G_title h3 {
|
|
222
225
|
z-index: 2;
|
|
223
226
|
cursor: default;
|
|
224
227
|
color: #0000;
|
|
@@ -230,7 +233,7 @@
|
|
|
230
233
|
position: relative;
|
|
231
234
|
}
|
|
232
235
|
|
|
233
|
-
.
|
|
236
|
+
.UcKh3G_rankBox .UcKh3G_title h3:after {
|
|
234
237
|
z-index: 1;
|
|
235
238
|
content: attr(data-text);
|
|
236
239
|
width: 10rem;
|
|
@@ -244,39 +247,39 @@
|
|
|
244
247
|
left: 0;
|
|
245
248
|
}
|
|
246
249
|
|
|
247
|
-
.
|
|
250
|
+
.UcKh3G_rankBox .UcKh3G_topUsers {
|
|
248
251
|
z-index: 5;
|
|
249
252
|
}
|
|
250
253
|
|
|
251
|
-
.
|
|
254
|
+
.UcKh3G_rankBox .UcKh3G_topUsers li {
|
|
252
255
|
cursor: default;
|
|
253
256
|
text-align: center;
|
|
254
257
|
}
|
|
255
258
|
|
|
256
|
-
.
|
|
259
|
+
.UcKh3G_rankBox .UcKh3G_topUsers li .UcKh3G_topUser {
|
|
257
260
|
z-index: 3;
|
|
258
261
|
letter-spacing: 1px;
|
|
259
262
|
min-height: 6rem;
|
|
260
263
|
}
|
|
261
264
|
|
|
262
|
-
.
|
|
265
|
+
.UcKh3G_rankBox .UcKh3G_topUsers li .UcKh3G_image {
|
|
263
266
|
z-index: 2;
|
|
264
267
|
transition: all .6s;
|
|
265
|
-
animation: 3.5s ease-in-out infinite
|
|
268
|
+
animation: 3.5s ease-in-out infinite UcKh3G_suspension;
|
|
266
269
|
}
|
|
267
270
|
|
|
268
|
-
.
|
|
271
|
+
.UcKh3G_rankBox .UcKh3G_topUsers li:first-child {
|
|
269
272
|
order: 2;
|
|
270
273
|
padding-top: .3rem;
|
|
271
274
|
}
|
|
272
275
|
|
|
273
|
-
.
|
|
276
|
+
.UcKh3G_rankBox .UcKh3G_topUsers li:first-child .UcKh3G_topUser {
|
|
274
277
|
color: #ffd83a;
|
|
275
278
|
text-shadow: 0 1px #969653, 0 2px 5px #f0db6466;
|
|
276
279
|
border-bottom: 1.5rem solid #ffd83a;
|
|
277
280
|
}
|
|
278
281
|
|
|
279
|
-
.
|
|
282
|
+
.UcKh3G_rankBox .UcKh3G_topUsers li:first-child .UcKh3G_topUser i {
|
|
280
283
|
background-image: var(--logo-image), linear-gradient(#ffd83a, #fdeba0);
|
|
281
284
|
background-blend-mode: lighten;
|
|
282
285
|
background-position: center;
|
|
@@ -286,56 +289,56 @@
|
|
|
286
289
|
height: 2.6rem;
|
|
287
290
|
}
|
|
288
291
|
|
|
289
|
-
.
|
|
292
|
+
.UcKh3G_rankBox .UcKh3G_topUsers li:first-child .UcKh3G_image {
|
|
290
293
|
width: 6.4rem;
|
|
291
294
|
animation-delay: 3.5s;
|
|
292
295
|
}
|
|
293
296
|
|
|
294
|
-
.
|
|
297
|
+
.UcKh3G_rankBox .UcKh3G_topUsers li:nth-child(2) {
|
|
295
298
|
order: 1;
|
|
296
299
|
padding-top: 1rem;
|
|
297
300
|
}
|
|
298
301
|
|
|
299
|
-
.
|
|
302
|
+
.UcKh3G_rankBox .UcKh3G_topUsers li:nth-child(2) .UcKh3G_topUser {
|
|
300
303
|
color: #d8d8d8;
|
|
301
304
|
text-shadow: 0px 1px 0px #d9cdcd 0px 2px 5px #85848266;
|
|
302
305
|
border-bottom: 1.2rem solid #d8d8d8;
|
|
303
306
|
}
|
|
304
307
|
|
|
305
|
-
.
|
|
308
|
+
.UcKh3G_rankBox .UcKh3G_topUsers li:nth-child(2) .UcKh3G_topUser i {
|
|
306
309
|
background-image: var(--logo-image), linear-gradient(#d8d8d8, #eee);
|
|
307
310
|
}
|
|
308
311
|
|
|
309
|
-
.
|
|
312
|
+
.UcKh3G_rankBox .UcKh3G_topUsers li:nth-child(2) .UcKh3G_image {
|
|
310
313
|
width: 6rem;
|
|
311
314
|
animation-delay: 1.4s;
|
|
312
315
|
}
|
|
313
316
|
|
|
314
|
-
.
|
|
317
|
+
.UcKh3G_rankBox .UcKh3G_topUsers li:nth-child(3) {
|
|
315
318
|
order: 3;
|
|
316
319
|
padding-top: 1.5rem;
|
|
317
320
|
}
|
|
318
321
|
|
|
319
|
-
.
|
|
322
|
+
.UcKh3G_rankBox .UcKh3G_topUsers li:nth-child(3) .UcKh3G_topUser {
|
|
320
323
|
color: #fab36e;
|
|
321
324
|
text-shadow: 0 1px #aa8865, 0 2px 5px #a7814366;
|
|
322
325
|
border-bottom: 1rem solid #fab36e;
|
|
323
326
|
}
|
|
324
327
|
|
|
325
|
-
.
|
|
328
|
+
.UcKh3G_rankBox .UcKh3G_topUsers li:nth-child(3) .UcKh3G_topUser i {
|
|
326
329
|
background-image: var(--logo-image), linear-gradient(#fab36e, #fbe7d3);
|
|
327
330
|
}
|
|
328
331
|
|
|
329
|
-
.
|
|
332
|
+
.UcKh3G_rankBox .UcKh3G_topUsers li:nth-child(3) .UcKh3G_image {
|
|
330
333
|
width: 5.6rem;
|
|
331
334
|
animation-delay: 2.4s;
|
|
332
335
|
}
|
|
333
336
|
|
|
334
|
-
.
|
|
337
|
+
.UcKh3G_rankBox .UcKh3G_topUsers li:hover .UcKh3G_image {
|
|
335
338
|
animation-play-state: paused;
|
|
336
339
|
}
|
|
337
340
|
|
|
338
|
-
.
|
|
341
|
+
.UcKh3G_rankBox .UcKh3G_restUsers tr:before {
|
|
339
342
|
content: "";
|
|
340
343
|
background: #9fc2ef;
|
|
341
344
|
width: 0;
|
|
@@ -347,25 +350,25 @@
|
|
|
347
350
|
right: 0;
|
|
348
351
|
}
|
|
349
352
|
|
|
350
|
-
.
|
|
353
|
+
.UcKh3G_rankBox .UcKh3G_restUsers tr:hover:before {
|
|
351
354
|
width: 100%;
|
|
352
355
|
left: 0;
|
|
353
356
|
}
|
|
354
357
|
|
|
355
|
-
.
|
|
358
|
+
.UcKh3G_rankBox .UcKh3G_restUsers td {
|
|
356
359
|
cursor: default;
|
|
357
360
|
background-color: #0000;
|
|
358
361
|
}
|
|
359
362
|
|
|
360
|
-
.
|
|
363
|
+
.UcKh3G_rankBox .UcKh3G_restUsers td .UcKh3G_name {
|
|
361
364
|
max-width: 50%;
|
|
362
365
|
font-size: 0;
|
|
363
366
|
}
|
|
364
367
|
|
|
365
|
-
.
|
|
368
|
+
.UcKh3G_rankBox .UcKh3G_restUsers td .UcKh3G_name:hover .UcKh3G_image > img {
|
|
366
369
|
transform: scale(1.2);
|
|
367
370
|
}
|
|
368
|
-
@keyframes
|
|
371
|
+
@keyframes x8UL2q_scrollItem {
|
|
369
372
|
0%, 10% {
|
|
370
373
|
transform: translateY(0);
|
|
371
374
|
}
|
|
@@ -375,7 +378,7 @@
|
|
|
375
378
|
}
|
|
376
379
|
}
|
|
377
380
|
|
|
378
|
-
@keyframes
|
|
381
|
+
@keyframes x8UL2q_scrollWrap {
|
|
379
382
|
0%, 10% {
|
|
380
383
|
transform: translateY(0);
|
|
381
384
|
}
|
|
@@ -385,21 +388,21 @@
|
|
|
385
388
|
}
|
|
386
389
|
}
|
|
387
390
|
|
|
388
|
-
.
|
|
391
|
+
.x8UL2q_scrollWrap {
|
|
389
392
|
--duration: 10s;
|
|
390
|
-
animation:
|
|
393
|
+
animation: x8UL2q_scrollWrap;
|
|
391
394
|
animation-duration: var(--duration);
|
|
392
395
|
animation-timing-function: linear;
|
|
393
396
|
animation-iteration-count: infinite;
|
|
394
397
|
animation-direction: alternate;
|
|
395
398
|
}
|
|
396
399
|
|
|
397
|
-
.
|
|
400
|
+
.x8UL2q_scrollWrap:hover, .x8UL2q_scrollWrap:hover .x8UL2q_scrollItem {
|
|
398
401
|
animation-play-state: paused;
|
|
399
402
|
}
|
|
400
403
|
|
|
401
|
-
.
|
|
402
|
-
animation:
|
|
404
|
+
.x8UL2q_scrollWrap .x8UL2q_scrollItem {
|
|
405
|
+
animation: x8UL2q_scrollItem;
|
|
403
406
|
animation-duration: var(--duration);
|
|
404
407
|
animation-timing-function: linear;
|
|
405
408
|
animation-iteration-count: infinite;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "idea-react",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.1",
|
|
4
4
|
"license": "LGPL-3.0-or-later",
|
|
5
5
|
"author": "shiy2008@gmail.com",
|
|
6
6
|
"description": "A React advanced components library based on TypeScript & Bootstrap, built by idea2app remote developers team.",
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { action, observable } from 'mobx';
|
|
5
|
+
import { observer } from 'mobx-react';
|
|
6
|
+
import { Component, ComponentPropsWithoutRef, ComponentPropsWithRef, FC, MouseEvent } from 'react';
|
|
7
|
+
|
|
8
|
+
import { Button, ButtonProps, ComponentTheme } from './Button';
|
|
9
|
+
import { Icon } from './Extension/Icon';
|
|
10
|
+
|
|
11
|
+
export interface AccordionProps extends ComponentPropsWithRef<'div'> {
|
|
12
|
+
theme?: ComponentTheme;
|
|
13
|
+
size?: 'sm';
|
|
14
|
+
flush?: boolean;
|
|
15
|
+
gap?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const Accordion: FC<AccordionProps> = ({ theme, size, flush, gap, className, ...props }) => (
|
|
19
|
+
<div
|
|
20
|
+
{...props}
|
|
21
|
+
className={classNames(
|
|
22
|
+
'accordion',
|
|
23
|
+
theme && `theme-${theme}`,
|
|
24
|
+
size && `accordion-${size}`,
|
|
25
|
+
{ 'accordion-flush': flush, 'accordion-gap': gap },
|
|
26
|
+
className
|
|
27
|
+
)}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
export const AccordionItem: FC<ComponentPropsWithRef<'details'>> = ({ className, ...props }) => (
|
|
32
|
+
<details {...props} className={classNames('accordion-item', className)} />
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
export interface AccordionHeaderProps extends ComponentPropsWithRef<'summary'> {
|
|
36
|
+
icon?: string | false;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const AccordionHeader: FC<AccordionHeaderProps> = ({
|
|
40
|
+
icon = 'chevron-down',
|
|
41
|
+
className,
|
|
42
|
+
children,
|
|
43
|
+
...props
|
|
44
|
+
}) => (
|
|
45
|
+
<summary {...props} className={classNames('accordion-header', className)}>
|
|
46
|
+
{children}
|
|
47
|
+
{icon && <Icon name={icon} className="accordion-icon" aria-hidden="true" />}
|
|
48
|
+
</summary>
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
export const AccordionBody: FC<ComponentPropsWithRef<'div'>> = ({ className, ...props }) => (
|
|
52
|
+
<div {...props} className={classNames('accordion-body', className)} />
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
Accordion.displayName = 'Accordion';
|
|
56
|
+
AccordionItem.displayName = 'AccordionItem';
|
|
57
|
+
AccordionHeader.displayName = 'AccordionHeader';
|
|
58
|
+
AccordionBody.displayName = 'AccordionBody';
|
|
59
|
+
|
|
60
|
+
export interface AccordionToggleProps
|
|
61
|
+
extends
|
|
62
|
+
ComponentPropsWithoutRef<'button'>,
|
|
63
|
+
Pick<ButtonProps, 'variant' | 'theme' | 'size' | 'styled' | 'icon'> {
|
|
64
|
+
target: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@observer
|
|
68
|
+
export class AccordionToggle extends Component<AccordionToggleProps> {
|
|
69
|
+
static displayName = 'AccordionToggle';
|
|
70
|
+
|
|
71
|
+
@observable accessor expanded = false;
|
|
72
|
+
|
|
73
|
+
names = new Map<HTMLDetailsElement, string>();
|
|
74
|
+
|
|
75
|
+
get items() {
|
|
76
|
+
return [
|
|
77
|
+
...(document
|
|
78
|
+
.querySelector(this.props.target)
|
|
79
|
+
?.querySelectorAll<HTMLDetailsElement>(':scope > .accordion-item') ?? [])
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
componentDidMount() {
|
|
84
|
+
document.addEventListener('toggle', this.refresh, true);
|
|
85
|
+
this.refresh();
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
componentDidUpdate(previous: AccordionToggleProps) {
|
|
89
|
+
if (previous.target !== this.props.target) {
|
|
90
|
+
this.restoreNames();
|
|
91
|
+
this.refresh();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
componentWillUnmount() {
|
|
96
|
+
document.removeEventListener('toggle', this.refresh, true);
|
|
97
|
+
this.restoreNames();
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
restoreNames = () => {
|
|
101
|
+
for (const [item, name] of this.names) item.setAttribute('name', name);
|
|
102
|
+
this.names.clear();
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
refresh = action(() => {
|
|
106
|
+
const { items } = this;
|
|
107
|
+
|
|
108
|
+
this.expanded = !!items.length && items.every(({ open }) => open);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
handleClick = (event: MouseEvent<HTMLButtonElement>) => {
|
|
112
|
+
this.props.onClick?.(event);
|
|
113
|
+
|
|
114
|
+
if (event.defaultPrevented) return;
|
|
115
|
+
|
|
116
|
+
const { items, expanded } = this;
|
|
117
|
+
|
|
118
|
+
for (const item of items) {
|
|
119
|
+
const name = item.getAttribute('name');
|
|
120
|
+
|
|
121
|
+
if (!expanded && name) {
|
|
122
|
+
this.names.set(item, name);
|
|
123
|
+
item.removeAttribute('name');
|
|
124
|
+
}
|
|
125
|
+
item.open = !expanded;
|
|
126
|
+
}
|
|
127
|
+
if (expanded) this.restoreNames();
|
|
128
|
+
|
|
129
|
+
this.refresh();
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
render() {
|
|
133
|
+
const { target: _target, ...props } = this.props;
|
|
134
|
+
|
|
135
|
+
return <Button {...props} aria-expanded={this.expanded} onClick={this.handleClick} />;
|
|
136
|
+
}
|
|
137
|
+
}
|
package/source/Alert.tsx
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { action, observable } from 'mobx';
|
|
5
|
+
import { observer } from 'mobx-react';
|
|
6
|
+
import {
|
|
7
|
+
Component,
|
|
8
|
+
ComponentPropsWithoutRef,
|
|
9
|
+
ComponentPropsWithRef,
|
|
10
|
+
createRef,
|
|
11
|
+
FC,
|
|
12
|
+
MouseEvent,
|
|
13
|
+
TransitionEvent
|
|
14
|
+
} from 'react';
|
|
15
|
+
|
|
16
|
+
import { ComponentTheme } from './Button';
|
|
17
|
+
import { CloseButton } from './CloseButton';
|
|
18
|
+
|
|
19
|
+
export interface AlertProps extends ComponentPropsWithoutRef<'div'> {
|
|
20
|
+
theme?: ComponentTheme;
|
|
21
|
+
dismissible?: boolean;
|
|
22
|
+
instant?: boolean;
|
|
23
|
+
closeLabel?: string;
|
|
24
|
+
onClose?: () => unknown;
|
|
25
|
+
onClosed?: () => unknown;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@observer
|
|
29
|
+
export class Alert extends Component<AlertProps> {
|
|
30
|
+
static displayName = 'Alert';
|
|
31
|
+
|
|
32
|
+
@observable accessor hiding = false;
|
|
33
|
+
@observable accessor closed = false;
|
|
34
|
+
|
|
35
|
+
root = createRef<HTMLDivElement>();
|
|
36
|
+
timer?: ReturnType<typeof setTimeout>;
|
|
37
|
+
notified = false;
|
|
38
|
+
|
|
39
|
+
componentDidUpdate() {
|
|
40
|
+
if (this.closed && !this.notified) {
|
|
41
|
+
this.notified = true;
|
|
42
|
+
this.props.onClosed?.();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
componentWillUnmount() {
|
|
47
|
+
clearTimeout(this.timer);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
finishClose = action(() => {
|
|
51
|
+
if (this.closed) return;
|
|
52
|
+
|
|
53
|
+
clearTimeout(this.timer);
|
|
54
|
+
this.closed = true;
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
close = action(() => {
|
|
58
|
+
if (this.hiding || this.closed) return;
|
|
59
|
+
|
|
60
|
+
this.props.onClose?.();
|
|
61
|
+
|
|
62
|
+
if (this.props.instant) return this.finishClose();
|
|
63
|
+
|
|
64
|
+
this.hiding = true;
|
|
65
|
+
|
|
66
|
+
const style = getComputedStyle(this.root.current!);
|
|
67
|
+
const durations = style.transitionDuration.split(',').map(Alert.milliseconds);
|
|
68
|
+
const delays = style.transitionDelay.split(',').map(Alert.milliseconds);
|
|
69
|
+
const timeout = Math.max(
|
|
70
|
+
0,
|
|
71
|
+
...durations.map((duration, index) => duration + (delays[index % delays.length] || 0))
|
|
72
|
+
);
|
|
73
|
+
this.timer = setTimeout(this.finishClose, timeout);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
static milliseconds = (value: string) =>
|
|
77
|
+
(parseFloat(value) || 0) * (value.trim().endsWith('ms') ? 1 : 1000);
|
|
78
|
+
|
|
79
|
+
handleClose = (event: MouseEvent<HTMLButtonElement>) => {
|
|
80
|
+
if (!event.defaultPrevented) this.close();
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
handleTransitionEnd = (event: TransitionEvent<HTMLDivElement>) => {
|
|
84
|
+
this.props.onTransitionEnd?.(event);
|
|
85
|
+
|
|
86
|
+
if (event.target === event.currentTarget && this.hiding) this.finishClose();
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
render() {
|
|
90
|
+
const {
|
|
91
|
+
theme,
|
|
92
|
+
dismissible,
|
|
93
|
+
instant,
|
|
94
|
+
closeLabel = 'Close',
|
|
95
|
+
onClose: _onClose,
|
|
96
|
+
onClosed: _onClosed,
|
|
97
|
+
className,
|
|
98
|
+
children,
|
|
99
|
+
...props
|
|
100
|
+
} = this.props;
|
|
101
|
+
|
|
102
|
+
return this.closed ? null : (
|
|
103
|
+
<div
|
|
104
|
+
{...props}
|
|
105
|
+
ref={this.root}
|
|
106
|
+
role={props.role ?? 'alert'}
|
|
107
|
+
className={classNames(
|
|
108
|
+
'alert',
|
|
109
|
+
theme && `theme-${theme}`,
|
|
110
|
+
{ 'alert-instant': instant, hiding: this.hiding },
|
|
111
|
+
className
|
|
112
|
+
)}
|
|
113
|
+
onTransitionEnd={this.handleTransitionEnd}
|
|
114
|
+
>
|
|
115
|
+
{children}
|
|
116
|
+
|
|
117
|
+
{dismissible && (
|
|
118
|
+
<CloseButton
|
|
119
|
+
className="ms-auto"
|
|
120
|
+
aria-label={closeLabel}
|
|
121
|
+
onClick={this.handleClose}
|
|
122
|
+
/>
|
|
123
|
+
)}
|
|
124
|
+
</div>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export const AlertLink: FC<ComponentPropsWithRef<'a'>> = ({ className, ...props }) => (
|
|
130
|
+
<a {...props} className={classNames('alert-link', className)} />
|
|
131
|
+
);
|
|
132
|
+
|
|
133
|
+
export const AlertHeading: FC<ComponentPropsWithRef<'h4'>> = ({ className, ...props }) => (
|
|
134
|
+
<h4 {...props} className={classNames('alert-heading', className)} />
|
|
135
|
+
);
|
|
136
|
+
|
|
137
|
+
AlertLink.displayName = 'AlertLink';
|
|
138
|
+
AlertHeading.displayName = 'AlertHeading';
|