vanilla-jui 1.4.5 → 1.4.6

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.
Files changed (103) hide show
  1. package/README.md +6 -0
  2. package/dist/index.d.ts +1273 -1896
  3. package/dist/index.js +1 -1
  4. package/dist/index.umd.js +1 -1
  5. package/dist/style.css +1 -1
  6. package/package.json +21 -2
  7. package/src/components/accordion.ts +297 -216
  8. package/src/components/flow.ts +222 -258
  9. package/src/components/form.ts +44 -102
  10. package/src/components/menu.ts +268 -356
  11. package/src/components/modal.ts +181 -641
  12. package/src/components/offcanvas.ts +225 -106
  13. package/src/components/pagination.ts +296 -326
  14. package/src/components/sticky.ts +55 -54
  15. package/src/components/swiper.ts +237 -247
  16. package/src/components/tabs.ts +278 -271
  17. package/src/components/toc.ts +42 -46
  18. package/src/core/Component.ts +69 -47
  19. package/src/css/accordion.css +2 -2
  20. package/src/css/animation.css +1 -5
  21. package/src/css/avatar.css +1 -1
  22. package/src/css/badge.css +1 -1
  23. package/src/css/breadcrumb.css +9 -10
  24. package/src/css/button.css +1 -1
  25. package/src/css/card.css +2 -2
  26. package/src/css/color.css +974 -1002
  27. package/src/css/color_p3.css +974 -1004
  28. package/src/css/components.css +1 -1
  29. package/src/css/content.css +72 -63
  30. package/src/css/drop.css +1 -1
  31. package/src/css/editor.css +14 -14
  32. package/src/css/flow.css +4 -14
  33. package/src/css/font.css +5 -4
  34. package/src/css/form.css +76 -52
  35. package/src/css/gradient.css +299 -222
  36. package/src/css/icon.css +57 -57
  37. package/src/css/index.css +1 -1
  38. package/src/css/layout.css +13 -10
  39. package/src/css/loading.css +60 -12
  40. package/src/css/menu.css +262 -188
  41. package/src/css/modal.css +1 -1
  42. package/src/css/offcanvas.css +9 -13
  43. package/src/css/pagination.css +5 -1
  44. package/src/css/popup.css +1 -1
  45. package/src/css/skeleton.css +3 -2
  46. package/src/css/status.css +2 -3
  47. package/src/css/swiper.css +1 -1
  48. package/src/css/table.css +1 -1
  49. package/src/css/tabs.css +12 -11
  50. package/src/css/tag.css +1 -1
  51. package/src/css/theme-palette.css +19 -5
  52. package/src/css/themes/default/accordion.css +61 -61
  53. package/src/css/themes/default/avatar.css +54 -54
  54. package/src/css/themes/default/badge.css +62 -62
  55. package/src/css/themes/default/breadcrumb.css +23 -23
  56. package/src/css/themes/default/button.css +203 -203
  57. package/src/css/themes/default/content.css +53 -53
  58. package/src/css/themes/default/drop.css +10 -10
  59. package/src/css/themes/default/editor.css +9 -9
  60. package/src/css/themes/default/index.css +1 -1
  61. package/src/css/themes/default/loading.css +26 -20
  62. package/src/css/themes/default/menu.css +75 -11
  63. package/src/css/themes/default/modal.css +32 -36
  64. package/src/css/themes/default/pagination.css +7 -7
  65. package/src/css/themes/default/popup.css +6 -6
  66. package/src/css/themes/default/swiper.css +32 -32
  67. package/src/css/themes/default/table.css +16 -16
  68. package/src/css/themes/default/tabs.css +30 -30
  69. package/src/css/themes/default/tag.css +71 -71
  70. package/src/css/themes/default/theme-palette.css +11 -11
  71. package/src/css/themes/default/tip.css +42 -42
  72. package/src/css/themes/default/toast.css +60 -60
  73. package/src/css/themes/default/toolbar.css +23 -29
  74. package/src/css/themes/default/tooltip.css +43 -13
  75. package/src/css/themes/index.css +1 -1
  76. package/src/css/tip.css +2 -2
  77. package/src/css/toast.css +3 -3
  78. package/src/css/tokens.css +12 -17
  79. package/src/css/toolbar.css +9 -10
  80. package/src/css/tooltip.css +3 -2
  81. package/src/index.ts +22 -19
  82. package/src/{components → primitives}/drop.ts +58 -49
  83. package/src/{components → primitives}/icons.ts +1 -1
  84. package/src/primitives/loading.ts +23 -0
  85. package/src/primitives/parabola.ts +388 -0
  86. package/src/primitives/popup.ts +61 -0
  87. package/src/{components → primitives}/theme.ts +88 -57
  88. package/src/{components → primitives}/toast.ts +18 -25
  89. package/src/{components → primitives}/tooltip.ts +100 -25
  90. package/src/utilities/browser.ts +23 -49
  91. package/src/utilities/class-name.ts +5 -0
  92. package/src/utilities/dom.ts +14 -32
  93. package/src/utilities/function.ts +4 -0
  94. package/src/utilities/http.ts +7 -7
  95. package/src/utilities/id.ts +57 -0
  96. package/src/utilities/object.ts +5 -0
  97. package/src/utilities/timer.ts +38 -0
  98. package/src/utilities/types.ts +420 -0
  99. package/src/{components → validation}/validator.ts +64 -53
  100. package/src/components/parabola.ts +0 -335
  101. package/src/utilities/cache.ts +0 -57
  102. package/src/utilities/core.ts +0 -614
  103. package/src/utilities/storage.ts +0 -46
@@ -25,4 +25,4 @@
25
25
  @import url('./editor.css');
26
26
  @import url('./menu.css');
27
27
  @import url('./toc.css');
28
- @import url('./form.css');
28
+ @import url('./form.css');
@@ -1,5 +1,4 @@
1
1
  @layer content {
2
-
3
2
  /* ============================================
4
3
  Content - 文章阅读/编辑器预览样式
5
4
  ============================================ */
@@ -35,7 +34,8 @@
35
34
  .j-content h4,
36
35
  .j-content h5,
37
36
  .j-content h6 {
38
- margin: var(--content-heading-space) 0 calc(var(--content-heading-space) * 0.75);
37
+ margin: var(--content-heading-space) 0
38
+ calc(var(--content-heading-space) * 0.75);
39
39
  font-weight: 600;
40
40
  line-height: 1.3;
41
41
  color: var(--content-heading-fg);
@@ -70,12 +70,12 @@
70
70
  }
71
71
 
72
72
  /* 标题后的段落减少间距 */
73
- .j-content h1+p,
74
- .j-content h2+p,
75
- .j-content h3+p,
76
- .j-content h4+p,
77
- .j-content h5+p,
78
- .j-content h6+p {
73
+ .j-content h1 + p,
74
+ .j-content h2 + p,
75
+ .j-content h3 + p,
76
+ .j-content h4 + p,
77
+ .j-content h5 + p,
78
+ .j-content h6 + p {
79
79
  margin-top: calc(var(--content-paragraph-space) * -0.5);
80
80
  }
81
81
 
@@ -157,7 +157,9 @@
157
157
  text-decoration: none;
158
158
  text-decoration-color: transparent;
159
159
  text-underline-offset: 0.15em;
160
- transition: color 0.15s, text-decoration-color 0.15s;
160
+ transition:
161
+ color 0.15s,
162
+ text-decoration-color 0.15s;
161
163
  }
162
164
 
163
165
  .j-content a:hover {
@@ -202,22 +204,26 @@
202
204
  list-style-type: decimal;
203
205
  }
204
206
 
205
- .j-content ul ul {
206
- list-style-type: circle;
207
+ .j-content ul ul,
208
+ .j-content ol ol,
209
+ .j-content ol ul,
210
+ .j-content ul ol {
207
211
  margin-top: var(--content-list-space);
208
212
  margin-bottom: 0;
209
213
  }
210
214
 
211
- .j-content ol ol {
212
- list-style-type: lower-alpha;
213
- margin-top: var(--content-list-space);
214
- margin-bottom: 0;
215
+ .j-content ul ul {
216
+ list-style-type: circle;
215
217
  }
216
218
 
217
219
  .j-content ul ul ul {
218
220
  list-style-type: square;
219
221
  }
220
222
 
223
+ .j-content ol ol {
224
+ list-style-type: lower-alpha;
225
+ }
226
+
221
227
  .j-content ol ol ol {
222
228
  list-style-type: lower-roman;
223
229
  }
@@ -249,7 +255,7 @@
249
255
  color: var(--tone-body);
250
256
  }
251
257
 
252
- .j-content dd+dt {
258
+ .j-content dd + dt {
253
259
  margin-top: 1em;
254
260
  }
255
261
 
@@ -277,7 +283,7 @@
277
283
  margin: 0;
278
284
  }
279
285
 
280
- .j-content blockquote p+p {
286
+ .j-content blockquote p + p {
281
287
  margin-top: 0.75em;
282
288
  }
283
289
 
@@ -296,8 +302,9 @@
296
302
  /* ============================================
297
303
  Code - 代码
298
304
  ============================================ */
299
- .j-content code:not([class*="language-"]) {
300
- font-family: 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
305
+ .j-content code:not([class*='language-']) {
306
+ font-family:
307
+ 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
301
308
  font-size: 0.875em;
302
309
  border: 1px solid var(--content-border-subtle);
303
310
  border-radius: var(--radius-sm);
@@ -356,8 +363,8 @@
356
363
  align-items: center;
357
364
  justify-content: space-between;
358
365
  gap: 12px;
359
- padding: .5rem 1rem 0;
360
- font-size: .78rem;
366
+ padding: 0.5rem 1rem 0;
367
+ font-size: 0.78rem;
361
368
  }
362
369
 
363
370
  .j-code-editor .code-header .code-dots {
@@ -365,12 +372,14 @@
365
372
  height: 8px;
366
373
  border-radius: 50%;
367
374
  background: var(--state-success);
368
- box-shadow: 14px 0 0 var(--state-warning), 28px 0 0 var(--state-danger);
375
+ box-shadow:
376
+ 14px 0 0 var(--state-warning),
377
+ 28px 0 0 var(--state-danger);
369
378
  }
370
379
 
371
380
  .j-code-editor .code-header .code-language,
372
381
  .j-code-editor .code-header select {
373
- font-size: .75rem;
382
+ font-size: 0.75rem;
374
383
  color: var(--ui-fg-soft);
375
384
  }
376
385
 
@@ -384,25 +393,24 @@
384
393
  display: none;
385
394
  }
386
395
 
387
- .j-content pre code[class*="language-"] {
396
+ .j-content pre code[class*='language-'] {
388
397
  display: block;
389
398
  overflow-x: auto;
390
399
  padding: 1.25em 1.5em;
391
400
  }
392
401
 
393
- .j-content pre.j-code-editor .code-header+code[class*="language-"] {
394
- padding: .5rem 1rem 1rem;
402
+ .j-content pre.j-code-editor .code-header + code[class*='language-'] {
403
+ padding: 0.5rem 1rem 1rem;
395
404
  }
396
405
 
397
- /* prettylights-syntax-keyword */
398
- .hljs-doctag,
399
- .hljs-keyword,
400
- .hljs-meta .hljs-keyword,
401
- .hljs-template-tag,
402
- .hljs-template-variable,
403
- .hljs-type,
404
- .hljs-variable.language_ {
405
- color: var(--ui-tomato)
406
+ /* purposely ignored */
407
+ .hljs-char.escape_,
408
+ .hljs-link,
409
+ .hljs-params,
410
+ .hljs-property,
411
+ .hljs-punctuation,
412
+ .hljs-tag {
413
+ color: var(--ui-gray);
406
414
  }
407
415
 
408
416
  /* prettylights-syntax-entity */
@@ -410,7 +418,7 @@
410
418
  .hljs-title.class_,
411
419
  .hljs-title.class_.inherited__,
412
420
  .hljs-title.function_ {
413
- color: var(--ui-violet)
421
+ color: var(--ui-violet);
414
422
  }
415
423
 
416
424
  /* prettylights-syntax-constant */
@@ -424,27 +432,38 @@
424
432
  .hljs-selector-attr,
425
433
  .hljs-selector-class,
426
434
  .hljs-selector-id {
427
- color: var(--ui-teal)
435
+ color: var(--ui-teal);
436
+ }
437
+
438
+ /* prettylights-syntax-keyword */
439
+ .hljs-doctag,
440
+ .hljs-keyword,
441
+ .hljs-meta .hljs-keyword,
442
+ .hljs-template-tag,
443
+ .hljs-template-variable,
444
+ .hljs-type,
445
+ .hljs-variable.language_ {
446
+ color: var(--ui-tomato);
428
447
  }
429
448
 
430
449
  /* prettylights-syntax-string */
431
450
  .hljs-regexp,
432
451
  .hljs-string,
433
452
  .hljs-meta .hljs-string {
434
- color: var(--ui-pink)
453
+ color: var(--ui-pink);
435
454
  }
436
455
 
437
456
  /* prettylights-syntax-variable */
438
457
  .hljs-built_in,
439
458
  .hljs-symbol {
440
- color: var(--ui-orange)
459
+ color: var(--ui-orange);
441
460
  }
442
461
 
443
462
  /* prettylights-syntax-comment */
444
463
  .hljs-comment,
445
464
  .hljs-code,
446
465
  .hljs-formula {
447
- color: var(--ui-gray-shade)
466
+ color: var(--ui-gray-shade);
448
467
  }
449
468
 
450
469
  /* prettylights-syntax-entity-tag */
@@ -457,36 +476,36 @@
457
476
 
458
477
  /* prettylights-syntax-storage-modifier-import */
459
478
  .hljs-subst {
460
- color: var(--ui-fg)
479
+ color: var(--ui-fg);
461
480
  }
462
481
 
463
482
  /* prettylights-syntax-markup-heading */
464
483
  .hljs-section {
465
484
  color: var(--ui-teal);
466
- font-weight: bold
485
+ font-weight: bold;
467
486
  }
468
487
 
469
488
  /* prettylights-syntax-markup-list */
470
489
  .hljs-bullet {
471
- color: var(--ui-gold)
490
+ color: var(--ui-gold);
472
491
  }
473
492
 
474
493
  /* prettylights-syntax-markup-italic */
475
494
  .hljs-emphasis {
476
495
  color: var(--ui-fg);
477
- font-style: italic
496
+ font-style: italic;
478
497
  }
479
498
 
480
499
  /* prettylights-syntax-markup-bold */
481
500
  .hljs-strong {
482
501
  color: var(--ui-fg);
483
- font-weight: bold
502
+ font-weight: bold;
484
503
  }
485
504
 
486
505
  /* prettylights-syntax-markup-inserted */
487
506
  .hljs-addition {
488
507
  color: var(--ui-indigo);
489
- background-color: #f0fff4
508
+ background-color: #f0fff4;
490
509
  }
491
510
 
492
511
  /* prettylights-syntax-markup-deleted */
@@ -495,16 +514,6 @@
495
514
  background-color: #ffeef0;
496
515
  }
497
516
 
498
- /* purposely ignored */
499
- .hljs-char.escape_,
500
- .hljs-link,
501
- .hljs-params,
502
- .hljs-property,
503
- .hljs-punctuation,
504
- .hljs-tag {
505
- color: var(--ui-lime);
506
- }
507
-
508
517
  /* ============================================
509
518
  Media - 媒体
510
519
  ============================================ */
@@ -638,14 +647,14 @@
638
647
  transition: transform 0.2s ease;
639
648
  }
640
649
 
641
- .j-content details[open]>summary::before {
650
+ .j-content details[open] > summary::before {
642
651
  transform: rotate(90deg);
643
652
  }
644
653
 
645
654
  .j-content details[open] p,
646
655
  .j-content details[open] ul,
647
656
  .j-content details[open] ol,
648
- .j-content details[open]>* {
657
+ .j-content details[open] > * {
649
658
  margin-bottom: 1em;
650
659
  }
651
660
 
@@ -653,11 +662,11 @@
653
662
  margin-bottom: 0.75em;
654
663
  } */
655
664
 
656
- .j-content details[open]>summary+* {
665
+ .j-content details[open] > summary + * {
657
666
  margin-top: 0;
658
667
  }
659
668
 
660
- .j-content details[open]>*:last-child {
669
+ .j-content details[open] > *:last-child {
661
670
  margin-bottom: 0;
662
671
  }
663
672
 
@@ -702,11 +711,11 @@
702
711
  }
703
712
 
704
713
  /* First/Last child margin reset */
705
- .j-content>*:first-child {
714
+ .j-content > *:first-child {
706
715
  margin-top: 0;
707
716
  }
708
717
 
709
- .j-content>*:last-child {
718
+ .j-content > *:last-child {
710
719
  margin-bottom: 0;
711
720
  }
712
- }
721
+ }
package/src/css/drop.css CHANGED
@@ -25,4 +25,4 @@
25
25
  color: var(--drop-fg);
26
26
  box-shadow: var(--drop-box-shadow);
27
27
  }
28
- }
28
+ }
@@ -1,16 +1,16 @@
1
1
  @layer components {
2
- #j-editor {
3
- max-width: var(--editor-max-width);
4
- border-width: var(--editor-border-width);
5
- border-style: var(--editor-border-style);
6
- border-color: var(--editor-border-color);
7
- border-top: none;
8
- border-bottom: none;
9
- min-height: var(--editor-min-height);
10
- padding: var(--editor-padding);
11
- }
2
+ #j-editor {
3
+ max-width: var(--editor-max-width);
4
+ border-width: var(--editor-border-width);
5
+ border-style: var(--editor-border-style);
6
+ border-color: var(--editor-border-color);
7
+ border-top: none;
8
+ border-bottom: none;
9
+ min-height: var(--editor-min-height);
10
+ padding: var(--editor-padding);
11
+ }
12
12
 
13
- .ProseMirror {
14
- outline: 0;
15
- }
16
- }
13
+ .ProseMirror {
14
+ outline: 0;
15
+ }
16
+ }
package/src/css/flow.css CHANGED
@@ -10,18 +10,7 @@
10
10
 
11
11
  .j-flow .flow-header {
12
12
  display: grid;
13
- gap: calc(var(--space) / 2);
14
- }
15
-
16
- .j-flow .flow-title {
17
- font-size: var(--font-size-lg);
18
- font-weight: 600;
19
- }
20
-
21
- .j-flow .flow-description {
22
- color: var(--ui-fg-muted);
23
- font-size: var(--font-size-sm);
24
- line-height: var(--line-height-paragraph);
13
+ gap: var(--flow-gap);
25
14
  }
26
15
 
27
16
  .j-flow .flow-steps {
@@ -72,7 +61,7 @@
72
61
  color: var(--tone-fg);
73
62
  }
74
63
 
75
- s .j-flow .flow-body {
64
+ .j-flow .flow-body {
76
65
  min-width: 0;
77
66
  }
78
67
 
@@ -82,5 +71,6 @@
82
71
  gap: var(--space);
83
72
  justify-content: flex-end;
84
73
  padding-top: var(--flow-gap);
74
+ position: relative;
85
75
  }
86
- }
76
+ }
package/src/css/font.css CHANGED
@@ -2,8 +2,8 @@
2
2
  @font-face {
3
3
  font-family: Emoji;
4
4
  src:
5
- local('Apple Color Emoji'), local('Segoe UI Emoji'), local('Segoe UI Symbol'),
6
- local('Noto Color Emoji');
5
+ local('Apple Color Emoji'), local('Segoe UI Emoji'),
6
+ local('Segoe UI Symbol'), local('Noto Color Emoji');
7
7
  unicode-range: U+1F000-1F644, U+203C-3299;
8
8
  }
9
9
 
@@ -12,7 +12,8 @@
12
12
  }
13
13
 
14
14
  .font-mono {
15
- font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
15
+ font-family:
16
+ Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
16
17
  }
17
18
 
18
19
  .font-math {
@@ -20,4 +21,4 @@
20
21
  Cambria Math,
21
22
  Latin Modern Math;
22
23
  }
23
- }
24
+ }