vanilla-jui 1.3.9 → 1.3.11

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 (76) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/index.umd.js +1 -1
  3. package/dist/style.css +1 -1
  4. package/package.json +3 -2
  5. package/src/components/accordion.js +373 -0
  6. package/src/components/components.js +0 -0
  7. package/src/components/drop.js +437 -0
  8. package/src/components/flow.js +1133 -0
  9. package/src/components/form.js +585 -0
  10. package/src/components/icons.js +83 -0
  11. package/src/components/menu.js +422 -0
  12. package/src/components/modal.js +1174 -0
  13. package/src/components/offcanvas.js +332 -0
  14. package/src/components/pagination.js +536 -0
  15. package/src/components/parabola.js +295 -0
  16. package/src/components/sticky.js +271 -0
  17. package/src/components/swiper.js +1123 -0
  18. package/src/components/tabs.js +746 -0
  19. package/src/components/theme.js +353 -0
  20. package/src/components/toast.js +329 -0
  21. package/src/components/toc.js +226 -0
  22. package/src/components/tooltip.js +86 -0
  23. package/src/components/validator.js +586 -0
  24. package/src/core/Component.js +248 -0
  25. package/src/css/accordion.css +72 -0
  26. package/src/css/animation.css +177 -0
  27. package/src/css/avatar.css +62 -0
  28. package/src/css/badge.css +66 -0
  29. package/src/css/breadcrumb.css +106 -0
  30. package/src/css/button.css +296 -0
  31. package/src/css/card.css +151 -0
  32. package/src/css/color.css +1163 -0
  33. package/src/css/color_p3.css +1172 -0
  34. package/src/css/components.css +26 -0
  35. package/src/css/content.css +716 -0
  36. package/src/css/divider.css +9 -0
  37. package/src/css/drop.css +28 -0
  38. package/src/css/flow.css +86 -0
  39. package/src/css/font.css +23 -0
  40. package/src/css/form.css +919 -0
  41. package/src/css/gradient.css +224 -0
  42. package/src/css/icon.css +63 -0
  43. package/src/css/index.css +12 -0
  44. package/src/css/layout.css +782 -0
  45. package/src/css/loading.css +38 -0
  46. package/src/css/menu.css +564 -0
  47. package/src/css/modal.css +94 -0
  48. package/src/css/offcanvas.css +104 -0
  49. package/src/css/pagination.css +25 -0
  50. package/src/css/popup.css +69 -0
  51. package/src/css/skeleton.css +76 -0
  52. package/src/css/status.css +56 -0
  53. package/src/css/swiper.css +160 -0
  54. package/src/css/table.css +52 -0
  55. package/src/css/tabs.css +95 -0
  56. package/src/css/tag.css +97 -0
  57. package/src/css/theme-palette.css +59 -0
  58. package/src/css/tip.css +84 -0
  59. package/src/css/toast.css +154 -0
  60. package/src/css/toc.css +38 -0
  61. package/src/css/tokens.css +1295 -0
  62. package/src/css/toolbar.css +115 -0
  63. package/src/css/tooltip.css +19 -0
  64. package/src/icons/index.js +30 -0
  65. package/src/index.js +45 -0
  66. package/src/locales/index.js +45 -0
  67. package/src/locales/index.min.js +1 -0
  68. package/src/utilities/browser.js +111 -0
  69. package/src/utilities/cache.js +159 -0
  70. package/src/utilities/core.js +502 -0
  71. package/src/utilities/debug.js +103 -0
  72. package/src/utilities/dom.js +313 -0
  73. package/src/utilities/events.js +69 -0
  74. package/src/utilities/http.js +30 -0
  75. package/src/utilities/legacy-dom.js +179 -0
  76. package/src/utilities/storage.js +46 -0
@@ -0,0 +1,106 @@
1
+ @layer components {
2
+
3
+ .j-breadcrumb,
4
+ .j-breadcrumb.is-md {
5
+ font-size: var(--breadcrumb-font-size, var(--font-size-md));
6
+ color: var(--breadcrumb-color, var(--ui-fg-muted));
7
+ white-space: nowrap;
8
+ user-select: none;
9
+ }
10
+
11
+ .j-breadcrumb.is-sm {
12
+ --breadcrumb-font-size: var(--font-size-sm);
13
+ }
14
+
15
+ .j-breadcrumb.is-lg {
16
+ --breadcrumb-font-size: var(--font-size-lg);
17
+ }
18
+
19
+ .j-breadcrumb svg,
20
+ .j-breadcrumb.is-md svg {
21
+ width: var(--breadcrumb-icon-size, var(--font-size-md));
22
+ height: var(--breadcrumb-icon-size, var(--font-size-md));
23
+ }
24
+
25
+ .j-breadcrumb.is-sm svg {
26
+ --breadcrumb-icon-size: var(--font-size-sm);
27
+ }
28
+
29
+ .j-breadcrumb.is-lg svg {
30
+ --breadcrumb-icon-size: var(--font-size-lg);
31
+ }
32
+
33
+ .j-breadcrumb>ol,
34
+ .j-breadcrumb>ul {
35
+ display: flex;
36
+ flex-wrap: wrap;
37
+ justify-content: flex-start;
38
+ align-items: flex-start;
39
+ margin: 0;
40
+ padding: 0;
41
+ }
42
+
43
+ .j-breadcrumb>ol li,
44
+ .j-breadcrumb>ul li {
45
+ display: flex;
46
+ align-items: center;
47
+ justify-content: center;
48
+ }
49
+
50
+ .j-breadcrumb li:first-child a {
51
+ padding-inline-start: 0;
52
+ }
53
+
54
+ .j-breadcrumb li+li::before {
55
+ color: var(--breadcrumb-item-separator-color, var(--ui-fg-soft));
56
+ content: '/';
57
+ }
58
+
59
+ .j-breadcrumb.is-dot li+li::before {
60
+ content: '•';
61
+ }
62
+
63
+ .j-breadcrumb.is-arrow li+li::before {
64
+ content: '>';
65
+ }
66
+
67
+ .j-breadcrumb.is-dash li+li::before {
68
+ content: '–';
69
+ }
70
+
71
+ .j-breadcrumb a {
72
+ display: flex;
73
+ align-items: center;
74
+ justify-content: center;
75
+ gap: var(--space);
76
+ color: var(--breadcrumb-link-color, var(--tone-text));
77
+ padding: var(--breadcrumb-item-padding-vertical, 0) var(--breadcrumb-item-padding-horizontal, var(--s2));
78
+ text-decoration: none;
79
+ }
80
+
81
+ .j-breadcrumb a:hover {
82
+ color: var(--breadcrumb-link-hover-color, var(--tone-solid));
83
+ }
84
+
85
+ .j-breadcrumb a span {
86
+ display: flex;
87
+ align-items: center;
88
+ justify-content: center;
89
+ }
90
+
91
+ .j-breadcrumb li.is-active a {
92
+ --breadcrumb-link-color: var(--ui-fg-muted);
93
+ cursor: default;
94
+ pointer-events: none;
95
+ }
96
+
97
+ .j-breadcrumb.is-center ul,
98
+ .j-breadcrumb.is-center ol {
99
+ justify-content: center;
100
+ }
101
+
102
+ .j-breadcrumb.is-right ul,
103
+ .j-breadcrumb.is-right ol {
104
+ justify-content: flex-end;
105
+ }
106
+ }
@@ -0,0 +1,296 @@
1
+ @layer components {
2
+ .j-button {
3
+ display: flex;
4
+ justify-content: center;
5
+ align-items: center;
6
+ flex-wrap: nowrap;
7
+ gap: var(--button-gap, var(--space) calc(var(--space) * 1.5));
8
+ position: relative;
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));
21
+ appearance: button;
22
+ user-select: none;
23
+ touch-action: manipulation;
24
+ }
25
+
26
+ .j-button .button-content {
27
+ display: contents;
28
+ position: relative;
29
+ }
30
+
31
+ .j-button svg {
32
+ width: var(--font-size-md);
33
+ fill: currentColor;
34
+ }
35
+
36
+ .j-button a,
37
+ .j-button a:hover {
38
+ color: inherit;
39
+ }
40
+
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
+ /* group */
138
+ .j-button-group {
139
+ --button-padding: 0 var(--s2);
140
+ display: flex;
141
+ margin: 0;
142
+ }
143
+
144
+ .j-button-group .j-button:not(:first-child) {
145
+ border-top-left-radius: 0;
146
+ border-bottom-left-radius: 0;
147
+ /* margin-left: -1px; */
148
+ }
149
+
150
+ .j-button-group .j-button:not(:last-child) {
151
+ border-top-right-radius: 0;
152
+ border-bottom-right-radius: 0;
153
+ }
154
+
155
+ .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;
158
+ }
159
+
160
+ .j-button-group.is-vertical {
161
+ flex-direction: column;
162
+ }
163
+
164
+ .j-button-group.is-vertical .j-button:not(:last-child) {
165
+ border-bottom-left-radius: 0;
166
+ border-bottom-right-radius: 0;
167
+ }
168
+
169
+ .j-button-group.is-vertical .j-button:not(:first-child) {
170
+ margin-left: 0;
171
+ border-top-left-radius: 0;
172
+ border-top-right-radius: 0;
173
+ }
174
+
175
+ .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);
178
+ }
179
+
180
+ .j-button-group.is-vertical .j-button:first-child {
181
+ border-top-right-radius: var(--radius-md);
182
+ }
183
+
184
+ .j-button-group.is-vertical .j-button:last-child {
185
+ border-bottom-left-radius: var(--radius-md);
186
+ }
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
+ }
@@ -0,0 +1,151 @@
1
+ @layer components {
2
+ .j-card {
3
+ display: flex;
4
+ flex-direction: column;
5
+ position: relative;
6
+ max-width: 100%;
7
+ color: var(--card-color, var(--ui-fg));
8
+ background-color: var(--card-background, var(--ui-bg));
9
+ border: 1px solid var(--card-border-color, var(--ui-border));
10
+ border-radius: var(--card-border-radius, var(--radius-md));
11
+ box-shadow: var(--shadow-sm);
12
+ }
13
+
14
+ .border-radius {
15
+ border-radius: var(--radius-md);
16
+ overflow: hidden;
17
+ }
18
+
19
+ .j-card .card-header {
20
+ display: flex;
21
+ align-items: center;
22
+ background-color: var(--card-header-background, transparent);
23
+ }
24
+
25
+ .j-card .card-header .header-title {
26
+ display: flex;
27
+ align-items: center;
28
+ flex-grow: 1;
29
+ color: var(--card-header-color, var(--ui-fg));
30
+ font-size: var(--font-size-md);
31
+ font-weight: var(--card-header-weight, var(--font-medium));
32
+ padding: var(--card-header-padding, var(--s3) var(--s4));
33
+ margin: 0;
34
+ }
35
+
36
+ .j-card .card-header .header-icon {
37
+ display: flex;
38
+ align-items: center;
39
+ font-family: inherit;
40
+ font-size: 1em;
41
+ color: inherit;
42
+ background: none;
43
+ border: none;
44
+ margin: 0;
45
+ padding: 0;
46
+ padding: var(--card-header-padding, var(--space) var(--s2));
47
+ appearance: none;
48
+ cursor: pointer;
49
+ }
50
+
51
+ .j-card .card-header .header-icon,
52
+ .j-card .card-header .header-title.is-centered {
53
+ justify-content: center;
54
+ }
55
+
56
+ .j-card .card-media,
57
+ .image {
58
+ display: block;
59
+ position: relative;
60
+ }
61
+
62
+ .j-card figure {
63
+ margin: 0;
64
+ }
65
+
66
+ .j-card figure img {
67
+ width: 100%;
68
+ height: 100%;
69
+ object-fit: cover;
70
+ }
71
+
72
+ .j-card .card-media figure.image img {
73
+ position: absolute;
74
+ top: 0;
75
+ right: 0;
76
+ bottom: 0;
77
+ left: 0;
78
+ }
79
+
80
+ .j-card .card-media:first-child img {
81
+ border-start-end-radius: var(--card-border-radius, var(--radius-md));
82
+ border-start-start-radius: var(--card-border-radius, var(--radius-md));
83
+ }
84
+
85
+ .j-card .card-content {
86
+ background-color: var(--card-content-background);
87
+ padding: var(--card-content-padding, var(--s4));
88
+ line-height: var(--line-height-paragraph);
89
+ }
90
+
91
+ .j-card .card-content:last-child,
92
+ .j-card .card-footer:last-child,
93
+ .j-card .card-header:last-child {
94
+ border-end-end-radius: var(--card-border-radius, var(--radius-md));
95
+ border-end-start-radius: var(--card-border-radius, var(--radius-md));
96
+ }
97
+
98
+ .j-card .card-content:first-child,
99
+ .j-card .card-footer:first-child,
100
+ .j-card .card-header:first-child {
101
+ border-start-end-radius: var(--card-border-radius, var(--radius-md));
102
+ border-start-start-radius: var(--card-border-radius, var(--radius-md));
103
+ }
104
+
105
+ .j-card .card-footer {
106
+ display: flex;
107
+ align-items: stretch;
108
+ background-color: var(--card-footer-background);
109
+ overflow: hidden;
110
+ gap: calc(var(--space)*2);
111
+ }
112
+
113
+ /* vertical */
114
+ .j-radius-round .j-card {
115
+ border-radius: 24px;
116
+ }
117
+
118
+ .j-card.is-vertical .card-header {
119
+ flex-direction: column;
120
+ align-items: flex-start;
121
+ gap: var(--s2);
122
+ padding: var(--card-header-padding, var(--s4) var(--s4) 0);
123
+ }
124
+
125
+ .j-card.is-vertical .card-header .header-title {
126
+ font-size: var(--vertical-card-title-font-size, var(--font-size-lg));
127
+ }
128
+
129
+ .j-card.is-vertical .card-header .header-description {
130
+ color: var(--ui-fg-muted);
131
+ }
132
+
133
+ .j-card.is-vertical .card-header .header-title,
134
+ .j-card.is-vertical .card-header .header-description {
135
+ padding: 0;
136
+ margin: 0;
137
+ }
138
+
139
+ .j-card .card-footer {
140
+ border-top: none;
141
+ padding: var(--vertical-card-footer-padding, var(--s4));
142
+ }
143
+
144
+ .j-card .card-content+.card-footer {
145
+ padding-top: 0;
146
+ }
147
+
148
+ .j-card .card-footer:has(.j-button-group) {
149
+ padding-top: 2px;
150
+ }
151
+ }