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
package/src/css/form.css CHANGED
@@ -1,5 +1,4 @@
1
1
  @layer components {
2
-
3
2
  .j-form,
4
3
  .j-form .form-item,
5
4
  .j-form .form-item .item-label {
@@ -119,7 +118,6 @@
119
118
  letter-spacing: 0.5px;
120
119
  }
121
120
 
122
-
123
121
  /* type file */
124
122
  .j-input[type='file'] {
125
123
  appearance: none;
@@ -181,7 +179,8 @@
181
179
  padding-right: calc(1.4285714286em + 0.875rem);
182
180
  background-repeat: no-repeat;
183
181
  background-position: right calc(0.3571428572em + 0.21875rem) center;
184
- background-size: calc(0.7142857143em + 0.4375rem) calc(0.7142857143em + 0.4375rem);
182
+ background-size: calc(0.7142857143em + 0.4375rem)
183
+ calc(0.7142857143em + 0.4375rem);
185
184
  }
186
185
 
187
186
  .j-input.is-valid,
@@ -321,7 +320,7 @@
321
320
  margin-left: 1px;
322
321
  }
323
322
 
324
- .j-radio.is-group input[type='radio']:checked+span.radio-text {
323
+ .j-radio.is-group input[type='radio']:checked + span.radio-text {
325
324
  box-shadow: 0 0 0 0.0625em var(--tone-solid);
326
325
  background-color: var(--tone-solid);
327
326
  z-index: 1;
@@ -491,27 +490,39 @@
491
490
  height: 1.5rem;
492
491
  }
493
492
 
494
- .j-switch.is-default input[type='checkbox']:checked+.switch-slider {
493
+ .j-switch.is-default input[type='checkbox']:checked + .switch-slider {
495
494
  background-color: var(--tone-solid);
496
495
  }
497
496
 
498
- .j-switch.is-default.is-sm input[type='checkbox']:checked+.switch-slider:after {
497
+ .j-switch.is-default.is-sm
498
+ input[type='checkbox']:checked
499
+ + .switch-slider:after {
499
500
  transform: translateX(0.75rem);
500
501
  }
501
502
 
502
- .j-switch.is-default.is-md input[type='checkbox']:checked+.switch-slider:after {
503
+ .j-switch.is-default.is-md
504
+ input[type='checkbox']:checked
505
+ + .switch-slider:after {
503
506
  transform: translateX(1.125rem);
504
507
  }
505
508
 
506
- .j-switch.is-default.is-lg input[type='checkbox']:checked+.switch-slider:after {
509
+ .j-switch.is-default.is-lg
510
+ input[type='checkbox']:checked
511
+ + .switch-slider:after {
507
512
  transform: translateX(1.5rem);
508
513
  }
509
514
 
510
- .j-theme-gray .j-switch.is-default input[type='checkbox']:checked+.switch-slider:after {
515
+ .j-theme-gray
516
+ .j-switch.is-default
517
+ input[type='checkbox']:checked
518
+ + .switch-slider:after {
511
519
  background-color: var(--ui-bg);
512
520
  }
513
521
 
514
- .j-theme-olive .j-switch.is-default input[type='checkbox']:checked+.switch-slider:after {
522
+ .j-theme-olive
523
+ .j-switch.is-default
524
+ input[type='checkbox']:checked
525
+ + .switch-slider:after {
515
526
  background-color: var(--ui-bg);
516
527
  }
517
528
 
@@ -588,30 +599,33 @@
588
599
  height: 1.375rem;
589
600
  }
590
601
 
591
- .j-switch.is-line input:checked+.switch-slider {
602
+ .j-switch.is-line input:checked + .switch-slider {
592
603
  box-shadow: 0 0 8px var(--tone-solid);
593
604
  border-color: var(--tone-solid);
594
605
  }
595
606
 
596
- .j-switch.is-line input:checked+.switch-slider:before {
607
+ .j-switch.is-line input:checked + .switch-slider:before {
597
608
  background-color: var(--tone-solid);
598
609
  }
599
610
 
600
- .j-switch.is-line.is-sm input:checked+.switch-slider:before {
611
+ .j-switch.is-line.is-sm input:checked + .switch-slider:before {
601
612
  transform: translateX(0.75rem);
602
613
  }
603
614
 
604
- .j-switch.is-line.is-md input:checked+.switch-slider:before {
615
+ .j-switch.is-line.is-md input:checked + .switch-slider:before {
605
616
  transform: translateX(1.125rem);
606
617
  }
607
618
 
608
- .j-switch.is-line.is-lg input:checked+.switch-slider:before {
619
+ .j-switch.is-line.is-lg input:checked + .switch-slider:before {
609
620
  transform: translateX(1.5rem);
610
621
  }
611
622
 
612
623
  /* select */
613
624
  select.j-select {
614
- padding: var(--input-padding, calc(var(--space) * 1.5) calc(var(--space) * 1.5));
625
+ padding: var(
626
+ --input-padding,
627
+ calc(var(--space) * 1.5) calc(var(--space) * 1.5)
628
+ );
615
629
  border-width: var(--input-border-width, 1px);
616
630
  border-style: var(--input-border-style, solid);
617
631
  border-color: var(--input-border-color, var(--ui-input-border));
@@ -635,8 +649,6 @@
635
649
  --input-font-size: var(--font-size-lg);
636
650
  }
637
651
 
638
-
639
-
640
652
  /* textarea */
641
653
  textarea.j-textarea {
642
654
  min-height: var(--textarea-min-height, calc(var(--space) * 18));
@@ -679,8 +691,8 @@
679
691
  width: 100%;
680
692
  }
681
693
 
682
- .input-group>input.j-input,
683
- .input-group>select.j-select {
694
+ .input-group > input.j-input,
695
+ .input-group > select.j-select {
684
696
  position: relative;
685
697
  flex: 1 1 auto;
686
698
  width: 1%;
@@ -688,21 +700,24 @@
688
700
  letter-spacing: 0.4px;
689
701
  }
690
702
 
691
- .input-group>.el-addon>.j-button {
703
+ .input-group > .el-addon > .j-button {
692
704
  position: relative;
693
705
  border-color: var(--input-border-color, var(--ui-input-border));
694
706
  color: var(--ui-fg-muted);
695
707
  background: var(--ui-surface-muted);
696
708
  }
697
709
 
698
- .input-group>.el-addon>.is-text {
710
+ .input-group > .el-addon > .is-text {
699
711
  display: flex;
700
712
  align-items: center;
701
713
  white-space: nowrap;
702
714
  font-size: var(--font-size, 0.875rem);
703
715
  line-height: var(--line-height, 1.25rem);
704
716
  color: var(--ui-fg-muted);
705
- background-color: var(--input-group-text-addon-background, var(--ui-bg-muted));
717
+ background-color: var(
718
+ --input-group-text-addon-background,
719
+ var(--ui-bg-muted)
720
+ );
706
721
  padding: var(--input-group-text-addon-padding, var(--s2));
707
722
  height: var(--button-height, var(--el-height-md));
708
723
  border-width: var(--border-width, 1px);
@@ -713,32 +728,35 @@
713
728
  user-select: none;
714
729
  }
715
730
 
716
- .input-group>.el-addon>.is-text.icon-close {
731
+ .input-group > .el-addon > .is-text.icon-close {
717
732
  width: var(--button-height, var(--el-height-md));
718
733
  }
719
734
 
720
- .input-group>*:not(:first-child) {
735
+ .input-group > *:not(:first-child) {
721
736
  margin-left: -1px;
722
737
  }
723
738
 
724
- .input-group>input.j-input:not(:first-child),
725
- .input-group>select.j-select:not(:first-child),
726
- .input-group> :not(select.j-select)+.el-addon:not(:first-child)>.is-text {
739
+ .input-group > input.j-input:not(:first-child),
740
+ .input-group > select.j-select:not(:first-child),
741
+ .input-group
742
+ > :not(select.j-select)
743
+ + .el-addon:not(:first-child)
744
+ > .is-text {
727
745
  border-left-color: transparent;
728
746
  }
729
747
 
730
- .input-group>input.j-input:not(:first-child),
731
- .input-group>select.j-select:not(:first-child),
732
- .input-group>*:not(:first-child)>*,
733
- .input-group>*:not(:first-child)>.is-text {
748
+ .input-group > input.j-input:not(:first-child),
749
+ .input-group > select.j-select:not(:first-child),
750
+ .input-group > *:not(:first-child) > *,
751
+ .input-group > *:not(:first-child) > .is-text {
734
752
  border-top-left-radius: 0;
735
753
  border-bottom-left-radius: 0;
736
754
  }
737
755
 
738
- .input-group>input.j-input:not(:last-child),
739
- .input-group>select.j-select:not(:last-child),
740
- .input-group>*:not(:last-child)>*,
741
- .input-group>*:not(:last-child)>.is-text {
756
+ .input-group > input.j-input:not(:last-child),
757
+ .input-group > select.j-select:not(:last-child),
758
+ .input-group > *:not(:last-child) > *,
759
+ .input-group > *:not(:last-child) > .is-text {
742
760
  border-top-right-radius: 0;
743
761
  border-bottom-right-radius: 0;
744
762
  }
@@ -753,20 +771,20 @@
753
771
  position: relative;
754
772
  }
755
773
 
756
- .input-inner-group>input.j-input {
774
+ .input-inner-group > input.j-input {
757
775
  width: 100%;
758
776
  letter-spacing: 0.4px;
759
777
  }
760
778
 
761
- .input-inner-group>input.j-input:not(:last-child) {
779
+ .input-inner-group > input.j-input:not(:last-child) {
762
780
  padding-right: var(--el-height-md);
763
781
  }
764
782
 
765
- .input-inner-group>input.j-input:not(:first-child) {
783
+ .input-inner-group > input.j-input:not(:first-child) {
766
784
  padding-left: var(--el-height-md);
767
785
  }
768
786
 
769
- .input-inner-group>.el-addon {
787
+ .input-inner-group > .el-addon {
770
788
  position: absolute;
771
789
  top: 0;
772
790
  bottom: 0;
@@ -779,36 +797,38 @@
779
797
  font-size: 0.875em;
780
798
  }
781
799
 
782
- .input-inner-group>.el-addon:last-child {
800
+ .input-inner-group > .el-addon:last-child {
783
801
  right: 0;
784
802
  left: auto;
785
803
  }
786
804
 
787
- .input-inner-group>.el-addon:first-child.is-text:has(.j-button:not(.is-icon)) {
805
+ .input-inner-group
806
+ > .el-addon:first-child.is-text:has(.j-button:not(.is-icon)) {
788
807
  left: var(--space);
789
808
  }
790
809
 
791
- .input-inner-group>.el-addon:last-child.is-text:has(.j-button:not(.is-icon)) {
810
+ .input-inner-group
811
+ > .el-addon:last-child.is-text:has(.j-button:not(.is-icon)) {
792
812
  right: var(--space);
793
813
  }
794
814
 
795
- .input-inner-group>.el-addon>svg {
815
+ .input-inner-group > .el-addon > svg {
796
816
  width: var(--font-size-xl);
797
817
  height: var(--font-size-xl);
798
818
  }
799
819
 
800
- .input-inner-group>.el-addon>.el-text {
820
+ .input-inner-group > .el-addon > .el-text {
801
821
  color: currentColor;
802
822
  }
803
823
 
804
- .input-inner-group>.el-addon.is-text {
824
+ .input-inner-group > .el-addon.is-text {
805
825
  color: var(--ui-fg);
806
826
  display: flex;
807
827
  gap: var(--space);
808
828
  }
809
829
 
810
830
  /* status active */
811
- .input-group>.el-addon>.j-button:not(:disabled):active {
831
+ .input-group > .el-addon > .j-button:not(:disabled):active {
812
832
  transform: none;
813
833
  outline: var(--input-focus-outline, 2px solid var(--tone-solid));
814
834
  border-color: transparent;
@@ -835,7 +855,7 @@
835
855
  outline-color: var(--form-invalid-border-color, var(--state-danger));
836
856
  }
837
857
 
838
- .input-group>.j-input:focus-within {
858
+ .input-group > .j-input:focus-within {
839
859
  z-index: 2;
840
860
  }
841
861
 
@@ -856,7 +876,10 @@
856
876
 
857
877
  /* status readonly */
858
878
  .j-input:not([type='file']):not(.is-line):not(.is-blank)[readonly] {
859
- background-color: var(--input-readonly-background, var(--ui-surface-active));
879
+ background-color: var(
880
+ --input-readonly-background,
881
+ var(--ui-surface-active)
882
+ );
860
883
  }
861
884
 
862
885
  .j-textarea[readonly] {
@@ -889,7 +912,7 @@
889
912
  border-color: var(--ui-border);
890
913
  }
891
914
 
892
- .j-radio.is-group label input[type='radio']:disabled+.radio-text {
915
+ .j-radio.is-group label input[type='radio']:disabled + .radio-text {
893
916
  cursor: not-allowed;
894
917
  background-color: var(--ui-disabled-bg);
895
918
  /* opacity: var(--opacity-disabled); */
@@ -920,7 +943,8 @@
920
943
  cursor: not-allowed;
921
944
  }
922
945
 
923
- .j-switch.is-default:has(input[type='checkbox']:disabled) .switch-slider:before,
946
+ .j-switch.is-default:has(input[type='checkbox']:disabled)
947
+ .switch-slider:before,
924
948
  .j-switch.is-line:has(input[type='checkbox']:disabled) .switch-slider:before {
925
949
  background-color: var(--ui-border);
926
950
  }
@@ -929,4 +953,4 @@
929
953
  /* input.j-input:not([type='file']):not(:placeholder-shown) {
930
954
  background-color: var(--tone-subtle);
931
955
  } */
932
- }
956
+ }