vanilla-jui 1.4.1 → 1.4.3
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/dist/index.d.ts +7 -14
- package/dist/index.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/accordion.ts +7 -10
- package/src/components/drop.ts +5 -15
- package/src/components/parabola.ts +2 -2
- package/src/components/tabs.ts +5 -25
- package/src/components/theme.ts +25 -22
- package/src/components/toast.ts +34 -19
- package/src/components/tooltip.ts +3 -9
- package/src/core/Component.ts +1 -1
- package/src/css/accordion.css +1 -1
- package/src/css/components.css +1 -0
- package/src/css/content.css +147 -151
- package/src/css/drop.css +1 -1
- package/src/css/editor.css +16 -0
- package/src/css/form.css +27 -14
- package/src/css/icon.css +3 -3
- package/src/css/index.css +2 -2
- package/src/css/layout.css +2 -2
- package/src/css/loading.css +77 -29
- package/src/css/menu.css +29 -32
- package/src/css/pagination.css +4 -4
- package/src/css/status.css +2 -1
- package/src/css/table.css +20 -20
- package/src/css/tabs.css +2 -2
- package/src/css/theme-palette.css +10 -17
- package/src/css/themes/default/accordion.css +4 -4
- package/src/css/themes/default/avatar.css +17 -1
- package/src/css/themes/default/content.css +59 -0
- package/src/css/themes/default/editor.css +10 -0
- package/src/css/themes/default/index.css +8 -1
- package/src/css/themes/default/loading.css +16 -16
- package/src/css/themes/default/menu.css +15 -0
- package/src/css/themes/default/pagination.css +8 -0
- package/src/css/themes/default/table.css +18 -0
- package/src/css/themes/default/tabs.css +2 -2
- package/src/css/themes/default/theme-palette.css +12 -0
- package/src/css/themes/default/toolbar.css +34 -0
- package/src/css/toast.css +13 -23
- package/src/css/toolbar.css +29 -48
- package/src/locales/index.ts +3 -3
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
@layer themes {
|
|
2
|
+
.j-content {
|
|
3
|
+
--content-outline: 0;
|
|
4
|
+
--content-font-size: var(--font-size-lg);
|
|
5
|
+
--content-line-height: 1.75;
|
|
6
|
+
--content-letter-space: 0.01em;
|
|
7
|
+
--content-word-space: 0.02em;
|
|
8
|
+
--content-paragraph-space: 1.25em;
|
|
9
|
+
--content-heading-space: 1.5em;
|
|
10
|
+
--content-block-space: 1.5em;
|
|
11
|
+
--content-list-space: 0.5em;
|
|
12
|
+
|
|
13
|
+
--content-heading-fg: var(--tone-heading);
|
|
14
|
+
--content-caption-fg: var(--tone-caption);
|
|
15
|
+
--content-ring: var(--tone-ring);
|
|
16
|
+
--content-border-tone: var(--tone-border);
|
|
17
|
+
--content-border-subtle: var(--ui-border-subtle);
|
|
18
|
+
--content-blockquote-bg: var(--tone-wash);
|
|
19
|
+
--content-blockquote-fg: var(--tone-subtitle);
|
|
20
|
+
--content-link: var(--tone-link);
|
|
21
|
+
--content-link-hover: var(--tone-link-hover);
|
|
22
|
+
--content-link-visited: var(--tone-link-visited);
|
|
23
|
+
--content-link-active: var(--tone-link-active);
|
|
24
|
+
--content-border: var(--ui-border);
|
|
25
|
+
--content-code-bg: var(--tone-code-bg);
|
|
26
|
+
--content-code-fg: var(--tone-code-fg);
|
|
27
|
+
--content-bg-subtle: var(--ui-bg-subtle);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.j-content.is-sm {
|
|
31
|
+
--content-font-size: var(--font-size-md);
|
|
32
|
+
--content-line-height: 1.65;
|
|
33
|
+
--content-paragraph-space: 1em;
|
|
34
|
+
--content-heading-space: 1.25em;
|
|
35
|
+
--content-block-space: 1.25em;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.j-content.is-lg {
|
|
39
|
+
--content-font-size: var(--font-size-xl);
|
|
40
|
+
--content-line-height: 1.8;
|
|
41
|
+
--content-paragraph-space: 1.5em;
|
|
42
|
+
--content-heading-space: 1.75em;
|
|
43
|
+
--content-block-space: 1.75em;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.j-content.is-xl {
|
|
47
|
+
--content-font-size: var(--font-size-2xl);
|
|
48
|
+
--content-line-height: 1.85;
|
|
49
|
+
--content-paragraph-space: 1.75em;
|
|
50
|
+
--content-heading-space: 2em;
|
|
51
|
+
--content-block-space: 2em;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.j-radius-round .j-content {
|
|
55
|
+
--radius-sm: .75rem;
|
|
56
|
+
--radius-md: 1rem;
|
|
57
|
+
--radius-lg: 1.5rem;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
@import url('./content.css');
|
|
2
|
+
@import url('./toolbar.css');
|
|
3
|
+
@import url('./editor.css');
|
|
1
4
|
@import url('./button.css');
|
|
2
5
|
@import url('./avatar.css');
|
|
3
6
|
@import url('./badge.css');
|
|
@@ -13,4 +16,8 @@
|
|
|
13
16
|
@import url('./tooltip.css');
|
|
14
17
|
@import url('./swiper.css');
|
|
15
18
|
@import url('./breadcrumb.css');
|
|
16
|
-
@import url('./loading.css');
|
|
19
|
+
@import url('./loading.css');
|
|
20
|
+
@import url('./theme-palette.css');
|
|
21
|
+
@import url('./table.css');
|
|
22
|
+
@import url('./pagination.css');
|
|
23
|
+
@import url('./menu.css');
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
@layer themes {
|
|
2
2
|
.j-loader {
|
|
3
|
-
--loader-
|
|
4
|
-
--loader-
|
|
5
|
-
--loader-
|
|
6
|
-
--loader-
|
|
7
|
-
--loader-
|
|
8
|
-
--loader-
|
|
3
|
+
--loader-position: absolute;
|
|
4
|
+
--loader-size: var(--font-size-md);
|
|
5
|
+
--loader-width: 1.5px;
|
|
6
|
+
--loader-style: solid;
|
|
7
|
+
--loader-fg: currentcolor;
|
|
8
|
+
--loader-speed: var(--speed-xl);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
.j-
|
|
12
|
-
--
|
|
13
|
-
--
|
|
14
|
-
--
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
--
|
|
19
|
-
--
|
|
11
|
+
.j-loader .tone-loader {
|
|
12
|
+
--loader-width: 2px;
|
|
13
|
+
--loader-fg: var(--tone-soft);
|
|
14
|
+
--loader-top-fg: var(--tone-solid);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.j-loader .flow-loader {
|
|
18
|
+
--loader-width: 2px;
|
|
19
|
+
--loader-bg: radial-gradient(farthest-side, var(--tone-solid) 94%, #0000) top/var(--loader-width) var(--loader-width) no-repeat,
|
|
20
20
|
conic-gradient(#0000 30%, var(--tone-solid));
|
|
21
|
-
--
|
|
21
|
+
--loader-mask: radial-gradient(farthest-side, #0000 calc(100% - var(--loader-width)), #000 0);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
@layer themes {
|
|
2
|
+
.j-menu {
|
|
3
|
+
--menu-font-size: var(--font-size-md);
|
|
4
|
+
--menu-font-weight: var(--font-normal);
|
|
5
|
+
|
|
6
|
+
--menu-item-padding: 0.5rem 1rem;
|
|
7
|
+
--menu-item-height: var(--el-height-md);
|
|
8
|
+
--menu-item-line-height: var(--line-height);
|
|
9
|
+
|
|
10
|
+
--menu-link-font-weight: var(--font-medium);
|
|
11
|
+
--menu-link-gap: var(--space);
|
|
12
|
+
|
|
13
|
+
--menu-item-icon-size: var(--font-size-lg);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
@layer themes {
|
|
2
|
+
.j-table-container {
|
|
3
|
+
--table-container-max-width: 100%;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.j-table {
|
|
7
|
+
--table-selected-bg: var(--tone-soft);
|
|
8
|
+
--table-border-width: 0 0 1px;
|
|
9
|
+
--table-border-style: solid;
|
|
10
|
+
--table-border-color: var(--ui-border);
|
|
11
|
+
--table-cell-padding: 0.5em 0.75em;
|
|
12
|
+
--table-cell-text-align: left;
|
|
13
|
+
--table-link-fg: var(--tone-solid);
|
|
14
|
+
--table-striped-bg: var(--tone-soft);
|
|
15
|
+
--table-hover-bg: var(--tone-soft);
|
|
16
|
+
--table-bordered-width: 1px;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
border-left: var(--tab-wrap-border);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
.j-tabs .tab-list .tab-item
|
|
29
|
+
.j-tabs .tab-list .tab-item[aria-selected="true"] {
|
|
30
30
|
--tab-fg: var(--tone-solid);
|
|
31
31
|
--tab-font-weight: var(--font-medium);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
.j-tabs .tab-list .tab-item
|
|
34
|
+
.j-tabs .tab-list .tab-item[aria-disabled="true"] {
|
|
35
35
|
--tab-fg: var(--ui-border-strong);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@layer themes {
|
|
2
|
+
.j-theme-palette {
|
|
3
|
+
--palette-padding: 1rem 1rem 2rem;
|
|
4
|
+
--palette-container-gap: var(--s4);
|
|
5
|
+
--palette-item-gap: var(--s2);
|
|
6
|
+
--palette-item-title-font-size: var(--font-size-md);
|
|
7
|
+
--palette-item-title-font-weight: var(--font-bold);
|
|
8
|
+
--palette-items-columns: repeat(3, 1fr);
|
|
9
|
+
--palette-items-gap: var(--space);
|
|
10
|
+
--palette-items-icon-size: var(--font-size-sm);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
@layer themes {
|
|
2
|
+
.j-toolbar-container {
|
|
3
|
+
--toolbar-container-position: sticky;
|
|
4
|
+
--toolbar-container-bg: var(--ui-bg);
|
|
5
|
+
--toolbar-container-border: 1px solid var(--ui-border);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.j-toolbar {
|
|
9
|
+
--toolbar-gap: 0;
|
|
10
|
+
--toolbar-padding: var(--s2);
|
|
11
|
+
--toolbar-box-shadow: var(--shadow-sm);
|
|
12
|
+
--toolbar-divider-width: 1px;
|
|
13
|
+
--toolbar-divider-height: 16px;
|
|
14
|
+
--toolbar-divider-bg: var(--ui-fg);
|
|
15
|
+
--toolbar-drop-font-size: var(--font-size-md);
|
|
16
|
+
--toolbar-drop-bg: var(--ui-bg-subtle);
|
|
17
|
+
--toolbar-drop-padding: var(--space);
|
|
18
|
+
--toolbar-drop-border: 1px solid var(--ui-border);
|
|
19
|
+
--toolbar-drop-radius: var(--radius-sm);
|
|
20
|
+
--toolbar-drop-box-shadow: var(--shadow-md);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.j-toolbar button svg {
|
|
24
|
+
--toolbar-icon-size: var(--font-size-xl);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.j-toolbar button.is-sm svg {
|
|
28
|
+
--toolbar-icon-size: var(--font-size-lg);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.j-toolbar button.is-lg svg {
|
|
32
|
+
--toolbar-icon-size: var(--font-size-2xl);
|
|
33
|
+
}
|
|
34
|
+
}
|
package/src/css/toast.css
CHANGED
|
@@ -21,35 +21,28 @@
|
|
|
21
21
|
box-shadow: var(--toast-box-shadow);
|
|
22
22
|
font-size: var(--toast-font-size);
|
|
23
23
|
font-weight: var(--toast-font-weight);
|
|
24
|
-
opacity: 0;
|
|
25
24
|
color: var(--toast-fg);
|
|
26
25
|
background: var(--toast-bg);
|
|
27
26
|
border-width: var(--toast-border-width);
|
|
28
27
|
border-style: var(--toast-border-style);
|
|
29
28
|
border-color: var(--toast-border-color);
|
|
30
29
|
border-radius: var(--toast-border-radius);
|
|
31
|
-
|
|
32
|
-
transform: translateY(-100%);
|
|
33
|
-
|
|
34
|
-
transition: all 0.3s ease-in-out;
|
|
35
|
-
cursor: pointer;
|
|
36
30
|
min-width: var(--toast-min-width);
|
|
37
31
|
max-width: var(--toast-max-width);
|
|
38
32
|
word-break: break-all;
|
|
39
|
-
|
|
33
|
+
cursor: pointer;
|
|
40
34
|
pointer-events: auto;
|
|
35
|
+
|
|
36
|
+
opacity: 0;
|
|
37
|
+
transform: translateY(-100%);
|
|
38
|
+
transition: all 0.3s ease-in-out;
|
|
41
39
|
}
|
|
42
40
|
|
|
43
|
-
.j-toast
|
|
41
|
+
.j-toast[aria-live] {
|
|
44
42
|
opacity: 1;
|
|
45
43
|
transform: translateY(0);
|
|
46
44
|
}
|
|
47
45
|
|
|
48
|
-
.j-toast.is-hidden {
|
|
49
|
-
opacity: 0;
|
|
50
|
-
transform: translateY(-100%);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
46
|
.j-toast .toast-icon {
|
|
54
47
|
margin-right: var(--s2);
|
|
55
48
|
width: var(--toast-icon-size);
|
|
@@ -65,23 +58,20 @@
|
|
|
65
58
|
position: fixed;
|
|
66
59
|
top: 45%;
|
|
67
60
|
left: 50%;
|
|
68
|
-
|
|
69
|
-
transition: opacity var(--speed-sm) ease-in-out;
|
|
70
|
-
opacity: 0;
|
|
61
|
+
transition: opacity 0.15s ease-in-out;
|
|
71
62
|
z-index: var(--z-toast);
|
|
63
|
+
width: fit-content;
|
|
64
|
+
max-width: 240px;
|
|
72
65
|
text-align: center;
|
|
73
66
|
user-select: none;
|
|
74
67
|
pointer-events: none;
|
|
68
|
+
opacity: 0;
|
|
69
|
+
transform: translate(-50%, -50%) scale(0.9);
|
|
75
70
|
}
|
|
76
71
|
|
|
77
|
-
.j-toast-lite
|
|
72
|
+
.j-toast-lite[aria-live] {
|
|
78
73
|
opacity: 1;
|
|
79
|
-
transform: scale(1);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.j-toast-lite.is-hidden {
|
|
83
|
-
opacity: 0;
|
|
84
|
-
transform: scale(0.9);
|
|
74
|
+
transform: translate(-50%, -50%) scale(1);
|
|
85
75
|
}
|
|
86
76
|
|
|
87
77
|
.j-toast.is-action {
|
package/src/css/toolbar.css
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@layer components {
|
|
2
2
|
.j-toolbar-container {
|
|
3
|
-
position: var(--toolbar-container-position
|
|
3
|
+
position: var(--toolbar-container-position);
|
|
4
4
|
top: 0;
|
|
5
5
|
width: 100%;
|
|
6
6
|
z-index: var(--z-toolbar);
|
|
@@ -11,19 +11,18 @@
|
|
|
11
11
|
scrollbar-width: none;
|
|
12
12
|
-ms-overflow-style: none;
|
|
13
13
|
scroll-behavior: smooth;
|
|
14
|
-
background: var(--toolbar-container-
|
|
15
|
-
border-bottom: var(--toolbar-container-border
|
|
14
|
+
background: var(--toolbar-container-bg);
|
|
15
|
+
border-bottom: var(--toolbar-container-border);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
.j-toolbar {
|
|
19
19
|
position: relative;
|
|
20
|
-
/* width: 100%; */
|
|
21
20
|
display: flex;
|
|
22
21
|
justify-content: center;
|
|
23
22
|
align-items: center;
|
|
24
|
-
gap: var(--toolbar-gap
|
|
25
|
-
padding: var(--toolbar-padding
|
|
26
|
-
box-shadow: var(--toolbar-box-shadow
|
|
23
|
+
gap: var(--toolbar-gap);
|
|
24
|
+
padding: var(--toolbar-padding);
|
|
25
|
+
box-shadow: var(--toolbar-box-shadow);
|
|
27
26
|
}
|
|
28
27
|
|
|
29
28
|
@media screen and (max-width: 992px) {
|
|
@@ -33,61 +32,43 @@
|
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
.j-toolbar button svg {
|
|
36
|
-
width: var(--toolbar-icon-size
|
|
37
|
-
height: var(--toolbar-icon-size
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.j-toolbar button.is-sm svg {
|
|
41
|
-
--toolbar-icon-size: var(--font-size-lg);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.j-toolbar button.is-lg svg {
|
|
45
|
-
--toolbar-icon-size: var(--font-size-2xl);
|
|
35
|
+
width: var(--toolbar-icon-size);
|
|
36
|
+
height: var(--toolbar-icon-size);
|
|
46
37
|
}
|
|
47
38
|
|
|
48
39
|
.j-toolbar .divider {
|
|
49
|
-
width:
|
|
50
|
-
height:
|
|
51
|
-
background
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
/* 编辑器区域 */
|
|
55
|
-
#editor {
|
|
56
|
-
max-width: 880px;
|
|
57
|
-
border-left: 1px solid var(--ui-border);
|
|
58
|
-
border-right: 1px solid var(--ui-border);
|
|
59
|
-
min-height: calc(100vh - 51px);
|
|
60
|
-
padding: 1.5rem 1.5rem 4rem;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.ProseMirror {
|
|
64
|
-
outline: 0;
|
|
40
|
+
width: var(--toolbar-divider-width);
|
|
41
|
+
height: var(--toolbar-divider-height);
|
|
42
|
+
background: var(--toolbar-divider-bg);
|
|
43
|
+
align-self: center;
|
|
65
44
|
}
|
|
66
45
|
|
|
67
46
|
.heading-drop-menu,
|
|
68
47
|
.editor-size-menu,
|
|
69
|
-
.color-drop-menu
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
48
|
+
.color-drop-menu,
|
|
49
|
+
|
|
50
|
+
.editor-drop-heading,
|
|
51
|
+
.editor-drop-size,
|
|
52
|
+
.editor-drop-color {
|
|
53
|
+
background: var(--toolbar-drop-bg);
|
|
54
|
+
box-shadow: var(--toolbar-drop-box-shadow);
|
|
55
|
+
border: var(--toolbar-drop-border);
|
|
56
|
+
border-radius: var(--toolbar-drop-radius);
|
|
57
|
+
font-size: var(--toolbar-drop-font-size);
|
|
76
58
|
}
|
|
77
59
|
|
|
78
|
-
.
|
|
79
|
-
|
|
80
|
-
padding-block: var(--space);
|
|
60
|
+
.editor-drop-color {
|
|
61
|
+
padding: var(--toolbar-drop-padding);
|
|
81
62
|
}
|
|
82
63
|
|
|
83
|
-
.
|
|
64
|
+
.editor-drop-color .color-panel {
|
|
84
65
|
padding: .5rem;
|
|
85
66
|
display: grid;
|
|
86
67
|
grid-template-columns: repeat(5, 1fr);
|
|
87
68
|
gap: .5rem;
|
|
88
69
|
}
|
|
89
70
|
|
|
90
|
-
.
|
|
71
|
+
.editor-drop-color .color-panel button.color-btn {
|
|
91
72
|
padding: 0;
|
|
92
73
|
margin: 0;
|
|
93
74
|
outline: none;
|
|
@@ -98,17 +79,17 @@
|
|
|
98
79
|
cursor: pointer;
|
|
99
80
|
}
|
|
100
81
|
|
|
101
|
-
.
|
|
82
|
+
.editor-drop-color .color-panel button.color-btn.color-btn-clear::after {
|
|
102
83
|
content: '🚫';
|
|
103
84
|
display: flex;
|
|
104
85
|
justify-content: center;
|
|
105
86
|
align-items: center;
|
|
106
87
|
height: 30px;
|
|
107
|
-
background
|
|
88
|
+
background: var(--ui-bg-subtle);
|
|
108
89
|
border-radius: var(--radius-sm);
|
|
109
90
|
}
|
|
110
91
|
|
|
111
|
-
.
|
|
92
|
+
.editor-drop-color .color-panel .color-btn:last-of-type {
|
|
112
93
|
grid-column: span 5;
|
|
113
94
|
width: auto;
|
|
114
95
|
}
|
package/src/locales/index.ts
CHANGED
|
@@ -2,7 +2,6 @@ export default {
|
|
|
2
2
|
en: {
|
|
3
3
|
b: 'Back',
|
|
4
4
|
t: 'Customize',
|
|
5
|
-
d: 'Customize your UI experience.',
|
|
6
5
|
sm: 'Small',
|
|
7
6
|
md: 'Medium',
|
|
8
7
|
lg: 'Large',
|
|
@@ -10,8 +9,7 @@ export default {
|
|
|
10
9
|
zh: {
|
|
11
10
|
b: '返回',
|
|
12
11
|
t: '自定义主题',
|
|
13
|
-
|
|
14
|
-
Theme: '主题',
|
|
12
|
+
Primary: '主色',
|
|
15
13
|
Radius: '圆角',
|
|
16
14
|
Shadow: '阴影',
|
|
17
15
|
Font: '字号',
|
|
@@ -40,5 +38,7 @@ export default {
|
|
|
40
38
|
Light: '浅色',
|
|
41
39
|
Dark: '深色',
|
|
42
40
|
Auto: '自动',
|
|
41
|
+
Close: '关闭',
|
|
42
|
+
Confirm: '确认',
|
|
43
43
|
},
|
|
44
44
|
};
|