vanilla-jui 1.3.11 → 1.4.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.
Files changed (106) hide show
  1. package/dist/index.d.ts +2921 -0
  2. package/dist/index.js +1 -1
  3. package/dist/index.umd.js +1 -1
  4. package/dist/style.css +1 -1
  5. package/package.json +4 -3
  6. package/src/components/accordion.ts +522 -0
  7. package/src/components/drop.ts +497 -0
  8. package/src/components/flow.ts +1579 -0
  9. package/src/components/form.ts +953 -0
  10. package/src/components/{icons.js → icons.ts} +24 -11
  11. package/src/components/menu.ts +615 -0
  12. package/src/components/{modal.js → modal.ts} +560 -237
  13. package/src/components/offcanvas.ts +457 -0
  14. package/src/components/{pagination.js → pagination.ts} +251 -76
  15. package/src/components/parabola.ts +335 -0
  16. package/src/components/{sticky.js → sticky.ts} +123 -98
  17. package/src/components/{swiper.js → swiper.ts} +510 -232
  18. package/src/components/tabs.ts +984 -0
  19. package/src/components/theme.ts +437 -0
  20. package/src/components/toast.ts +371 -0
  21. package/src/components/toc.ts +385 -0
  22. package/src/components/tooltip.ts +179 -0
  23. package/src/components/validator.ts +596 -0
  24. package/src/core/{Component.js → Component.ts} +134 -27
  25. package/src/css/accordion.css +0 -45
  26. package/src/css/animation.css +31 -1
  27. package/src/css/avatar.css +7 -33
  28. package/src/css/badge.css +11 -59
  29. package/src/css/breadcrumb.css +9 -32
  30. package/src/css/button.css +23 -224
  31. package/src/css/card.css +1 -1
  32. package/src/css/color.css +863 -1013
  33. package/src/css/color_p3.css +822 -975
  34. package/src/css/components.css +1 -0
  35. package/src/css/drop.css +7 -7
  36. package/src/css/flow.css +1 -1
  37. package/src/css/form.css +1 -1
  38. package/src/css/icon.css +7 -12
  39. package/src/css/index.css +5 -2
  40. package/src/css/loading.css +36 -20
  41. package/src/css/menu.css +1 -1
  42. package/src/css/modal.css +15 -44
  43. package/src/css/offcanvas.css +14 -40
  44. package/src/css/popup.css +4 -4
  45. package/src/css/status.css +0 -2
  46. package/src/css/swiper.css +35 -50
  47. package/src/css/tabs.css +9 -31
  48. package/src/css/tag.css +16 -77
  49. package/src/css/themes/default/accordion.css +62 -0
  50. package/src/css/themes/default/avatar.css +39 -0
  51. package/src/css/themes/default/badge.css +63 -0
  52. package/src/css/themes/default/breadcrumb.css +28 -0
  53. package/src/css/themes/default/button.css +204 -0
  54. package/src/css/themes/default/drop.css +11 -0
  55. package/src/css/themes/default/index.css +16 -0
  56. package/src/css/themes/default/loading.css +23 -0
  57. package/src/css/themes/default/modal.css +40 -0
  58. package/src/css/themes/default/offcanvas.css +13 -0
  59. package/src/css/themes/default/popup.css +7 -0
  60. package/src/css/themes/default/swiper.css +35 -0
  61. package/src/css/themes/default/tabs.css +37 -0
  62. package/src/css/themes/default/tag.css +85 -0
  63. package/src/css/themes/default/tip.css +49 -0
  64. package/src/css/themes/default/toast.css +70 -0
  65. package/src/css/themes/default/tooltip.css +14 -0
  66. package/src/css/themes/index.css +1 -0
  67. package/src/css/tip.css +20 -39
  68. package/src/css/toast.css +18 -80
  69. package/src/css/tokens.css +8 -3
  70. package/src/css/tooltip.css +10 -10
  71. package/src/index.ts +37 -0
  72. package/src/locales/{index.js → index.ts} +1 -2
  73. package/src/types.d.ts +1 -0
  74. package/src/utilities/browser.ts +131 -0
  75. package/src/utilities/cache.ts +57 -0
  76. package/src/utilities/core.ts +614 -0
  77. package/src/utilities/dom.ts +468 -0
  78. package/src/utilities/events.ts +106 -0
  79. package/src/utilities/http.ts +35 -0
  80. package/src/utilities/storage.ts +46 -0
  81. package/src/components/accordion.js +0 -373
  82. package/src/components/components.js +0 -0
  83. package/src/components/drop.js +0 -437
  84. package/src/components/flow.js +0 -1133
  85. package/src/components/form.js +0 -585
  86. package/src/components/menu.js +0 -422
  87. package/src/components/offcanvas.js +0 -332
  88. package/src/components/parabola.js +0 -295
  89. package/src/components/tabs.js +0 -746
  90. package/src/components/theme.js +0 -353
  91. package/src/components/toast.js +0 -329
  92. package/src/components/toc.js +0 -226
  93. package/src/components/tooltip.js +0 -86
  94. package/src/components/validator.js +0 -586
  95. package/src/index.js +0 -45
  96. package/src/locales/index.min.js +0 -1
  97. package/src/utilities/browser.js +0 -111
  98. package/src/utilities/cache.js +0 -159
  99. package/src/utilities/core.js +0 -502
  100. package/src/utilities/debug.js +0 -103
  101. package/src/utilities/dom.js +0 -313
  102. package/src/utilities/events.js +0 -69
  103. package/src/utilities/http.js +0 -30
  104. package/src/utilities/legacy-dom.js +0 -179
  105. package/src/utilities/storage.js +0 -46
  106. /package/src/icons/{index.js → index.ts} +0 -0
@@ -4,20 +4,21 @@
4
4
  justify-content: center;
5
5
  align-items: center;
6
6
  flex-wrap: nowrap;
7
- gap: var(--button-gap, var(--space) calc(var(--space) * 1.5));
7
+ gap: var(--btn-gap);
8
8
  position: relative;
9
9
  white-space: nowrap;
10
- font-weight: var(--button-font-weight, var(--font-medium));
11
- font-size: var(--button-font-size, var(--font-size-md));
12
- height: var(--button-height, var(--el-height-md));
13
- line-height: var(--button-line-height, var(--line-height-self));
14
- background-color: var(--button-background, transparent);
15
- padding: var(--button-padding, 0 var(--s3));
16
- border-width: var(--button-border-width, 1px);
17
- border-style: var(--button-border-style, solid);
18
- border-color: var(--button-border-color, transparent);
19
- border-radius: var(--button-border-radius, var(--radius-md));
20
- box-shadow: var(--button-box-shadow, var(--shadow-sm));
10
+ font-weight: var(--btn-font-weight);
11
+ font-size: var(--btn-font-size);
12
+ height: var(--btn-height);
13
+ line-height: var(--btn-line-height);
14
+ color: var(--btn-fg);
15
+ background-color: var(--btn-bg);
16
+ padding: var(--btn-padding);
17
+ border-width: var(--btn-border-width);
18
+ border-style: var(--btn-border-style);
19
+ border-color: var(--btn-border-color);
20
+ border-radius: var(--btn-border-radius);
21
+ box-shadow: var(--btn-box-shadow);
21
22
  appearance: button;
22
23
  user-select: none;
23
24
  touch-action: manipulation;
@@ -29,7 +30,7 @@
29
30
  }
30
31
 
31
32
  .j-button svg {
32
- width: var(--font-size-md);
33
+ width: var(--btn-svg-size);
33
34
  fill: currentColor;
34
35
  }
35
36
 
@@ -38,113 +39,16 @@
38
39
  color: inherit;
39
40
  }
40
41
 
41
- /* size */
42
- .j-button.is-sm {
43
- font-size: var(--font-size-sm);
44
- height: var(--button-height-sm, var(--el-height-sm));
45
- padding: var(--button-padding-sm, var(--space) var(--s2));
46
- }
47
-
48
- .j-button.is-lg {
49
- font-size: var(--font-size-lg);
50
- height: var(--button-height-lg, var(--el-height-lg));
51
- padding: var(--button-padding-lg, var(--s3) var(--s4));
52
- }
53
-
54
- /* variant */
55
- .j-button.is-default {
56
- --button-background: var(--ui-bg);
57
- --button-border-color: var(--ui-border);
58
- color: var(--ui-fg);
59
- }
60
-
61
- .j-button.is-contrast {
62
- --button-background: var(--ui-fg);
63
- color: var(--ui-bg);
64
- }
65
-
66
- .j-button.is-primary {
67
- --button-background: var(--tone-solid);
68
- color: var(--tone-fg);
69
- }
70
-
71
- .j-button.is-secondary {
72
- --button-border-color: transparent;
73
- --button-background: var(--tone-soft);
74
- color: var(--tone-text);
75
- }
76
-
77
- .j-button.is-outline {
78
- --button-background: transparent;
79
- --button-border-color: var(--tone-solid);
80
- color: var(--tone-solid);
81
- }
82
-
83
- .j-button.is-ghost {
84
- --button-box-shadow: none;
85
- transition-property: none;
86
- }
87
-
88
- .j-button.is-text {
89
- --button-border-color: transparent;
90
- height: var(--button-text-height, auto);
91
- padding: var(--button-text-padding, 0);
92
- box-shadow: var(--button-text-box-shadow, none);
93
- }
94
-
95
- .j-button.is-icon {
96
- aspect-ratio: var(--aspect-icon, 1);
97
- padding: var(--icon-padding, 0);
98
- }
99
-
100
- .j-button.is-danger {
101
- --button-background: var(--state-danger);
102
- color: var(--state-danger-fg);
103
- }
104
-
105
- .j-button.is-warning {
106
- --button-background: var(--state-warning);
107
- color: var(--state-warning-fg);
108
- }
109
-
110
- .j-button.is-success {
111
- --button-background: var(--state-success);
112
- color: var(--state-success-fg);
113
- }
114
-
115
- .j-button.is-error {
116
- --button-background: var(--state-danger-subtle);
117
- color: var(--state-danger-text);
118
- }
119
-
120
- .j-button[class*='is-surface-'] {
121
- --button-border-color: var(--ui-border);
122
- color: var(--ui-fg);
123
- }
124
-
125
- .j-button.is-surface-sm {
126
- --button-background: var(--ui-surface-subtle);
127
- }
128
-
129
- .j-button.is-surface-md {
130
- --button-background: var(--ui-surface-muted);
131
- }
132
-
133
- .j-button.is-surface-lg {
134
- --button-background: var(--ui-surface-active);
135
- }
136
-
137
42
  /* group */
138
43
  .j-button-group {
139
- --button-padding: 0 var(--s2);
140
44
  display: flex;
141
45
  margin: 0;
46
+ box-shadow: var(--btn-group-box-shadow);
142
47
  }
143
48
 
144
49
  .j-button-group .j-button:not(:first-child) {
145
50
  border-top-left-radius: 0;
146
51
  border-bottom-left-radius: 0;
147
- /* margin-left: -1px; */
148
52
  }
149
53
 
150
54
  .j-button-group .j-button:not(:last-child) {
@@ -153,8 +57,10 @@
153
57
  }
154
58
 
155
59
  .j-button-group .j-button:not(:first-child):not(:last-child) {
156
- border-block-width: var(--button-border-width, 1px);
157
- border-inline-width: 0;
60
+ border-top-width: var(--btn-border-width);
61
+ border-bottom-width: var(--btn-border-width);
62
+ border-left-width: 0;
63
+ border-right-width: 0;
158
64
  }
159
65
 
160
66
  .j-button-group.is-vertical {
@@ -173,8 +79,10 @@
173
79
  }
174
80
 
175
81
  .j-button-group.is-vertical .j-button:not(:last-child):not(:first-child) {
176
- border-block-width: 0;
177
- border-inline-width: var(--button-border-width, 1px);
82
+ border-left-width: var(--btn-border-width);
83
+ border-right-width: var(--btn-border-width);
84
+ border-top-width: 0;
85
+ border-bottom-width: 0;
178
86
  }
179
87
 
180
88
  .j-button-group.is-vertical .j-button:first-child {
@@ -184,113 +92,4 @@
184
92
  .j-button-group.is-vertical .j-button:last-child {
185
93
  border-bottom-left-radius: var(--radius-md);
186
94
  }
187
-
188
- /* disabled */
189
- .j-button:disabled {
190
- opacity: var(--opacity-disabled, 0.5);
191
- }
192
-
193
- /* status */
194
- .j-button:not(:disabled) {
195
- cursor: pointer;
196
- }
197
-
198
- .j-button:not(:disabled):hover {
199
- opacity: var(--opacity-hover);
200
- }
201
-
202
- .j-button:not(:disabled):active {
203
- opacity: var(--opacity-active);
204
- }
205
-
206
- .j-button:not(:disabled).is-active,
207
- .j-button:not(:disabled):focus-visible {
208
- outline: 2px solid var(--button-ring, var(--tone-solid));
209
- outline-offset: 1px;
210
- border-color: transparent;
211
- }
212
-
213
- .j-button.is-default:hover:not(:disabled) {
214
- background-color: var(--ui-surface-hover);
215
- }
216
-
217
- .j-button.is-outline:hover:not(:disabled),
218
- .j-button.is-ghost:hover:not(:disabled) {
219
- background-color: var(--tone-subtle);
220
- }
221
-
222
- .j-button.is-text:not(:disabled):active,
223
- .j-button.is-text:not(:disabled):focus-visible,
224
- .j-button.is-text:not(:disabled).is-active {
225
- outline: none;
226
- color: var(--tone-solid);
227
- text-decoration: underline;
228
- text-underline-offset: var(--space);
229
- }
230
-
231
- .j-button.is-contrast:not(:disabled):active,
232
- .j-button.is-contrast:not(:disabled):focus-visible {
233
- --button-ring: var(--ui-fg);
234
- }
235
-
236
- .j-button.is-success:not(:disabled):active,
237
- .j-button.is-success:not(:disabled):focus-visible {
238
- --button-ring: var(--state-success);
239
- }
240
-
241
- .j-button.is-warning:not(:disabled):active,
242
- .j-button.is-warning:not(:disabled):focus-visible {
243
- --button-ring: var(--state-warning);
244
- }
245
-
246
- .j-button.is-danger:not(:disabled):active,
247
- .j-button.is-danger:not(:disabled):focus-visible {
248
- --button-ring: var(--state-danger);
249
- }
250
-
251
- .j-button.is-error:not(:disabled):active,
252
- .j-button.is-error:not(:disabled):focus-visible {
253
- --button-ring: var(--state-danger-subtle);
254
- }
255
-
256
- .j-button.is-surface-sm:not(:disabled):active,
257
- .j-button.is-surface-sm:not(:disabled):focus-visible {
258
- --button-ring: var(--ui-surface-hover);
259
- }
260
-
261
- .j-button.is-surface-md:not(:disabled):active,
262
- .j-button.is-surface-md:not(:disabled):focus-visible {
263
- --button-ring: var(--ui-border);
264
- }
265
-
266
- .j-button.is-surface-lg:not(:disabled):active,
267
- .j-button.is-surface-lg:not(:disabled):focus-visible {
268
- --button-ring: var(--ui-border-strong);
269
- }
270
-
271
- .j-button-group .j-button:active,
272
- .j-button-group .j-button:focus-visible {
273
- outline: none;
274
- --button-border-color: transparent;
275
- --button-box-shadow: 0 0 0 2px var(--tone-solid);
276
- z-index: 1;
277
- }
278
-
279
- .j-button-group .j-button.is-primary:not(:disabled):active,
280
- .j-button-group .j-button.is-primary:not(:disabled):focus-visible,
281
- .j-button-group .j-button:focus-within {
282
- outline: 2px solid var(--button-ring, var(--tone-solid));
283
- outline-offset: 1px;
284
- --button-border-color: transparent;
285
- --button-box-shadow: var(--shadow-sm);
286
- }
287
-
288
- .j-button-group .j-button:focus-within {
289
- z-index: 1;
290
- --button-border-color: transparent;
291
- }
292
-
293
- .j-button-group.is-vertical .j-button:focus-within {
294
- z-index: auto
295
- }
296
95
  }
package/src/css/card.css CHANGED
@@ -146,6 +146,6 @@
146
146
  }
147
147
 
148
148
  .j-card .card-footer:has(.j-button-group) {
149
- padding-top: 2px;
149
+ padding-top: 4px;
150
150
  }
151
151
  }