@v1nt1248/3nclient-lib 0.3.49 → 0.3.50
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/README.md +44 -1
- package/dist/chunks/{plugins-keys-CmrMlx3F.js → plugins-keys-DdadrIAg.js} +84 -77
- package/dist/chunks/ui3n-notification-o0tuhTpO.js +272 -0
- package/dist/mixins.scss +0 -23
- package/dist/src/components/ui3n-input/ui3n-input.d.ts +2 -2
- package/dist/src/components/ui3n-notification/types.d.ts +5 -0
- package/dist/src/components/ui3n-notification/ui3n-notification.d.ts +1 -0
- package/dist/src/components/ui3n-text/ui3n-text.d.ts +2 -2
- package/dist/src/components/ui3n-tooltip/ui3n-tooltip.d.ts +1 -1
- package/dist/src/constants/plugins-keys.d.ts +2 -0
- package/dist/src/directives/ui3n-ripple.d.ts +2 -1
- package/dist/src/directives/ui3n-title.d.ts +1 -1
- package/dist/src/plugins/index.d.ts +4 -1
- package/dist/src/plugins/theme/store-theme.d.ts +4 -0
- package/dist/src/plugins/theme/theme.d.ts +10 -0
- package/dist/src/plugins/theme/types.d.ts +12 -0
- package/dist/src/ui3n-plugins.d.ts +5 -3
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/ui/to-css-length.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/ui3n-components.js +1213 -1193
- package/dist/ui3n-plugins.js +83 -34
- package/dist/ui3n-utils.js +4 -4
- package/dist/variables.css +5 -91
- package/package.json +1 -1
- package/src/components/ui3n-checkbox/ui3n-checkbox.vue +6 -9
- package/src/components/ui3n-notification/types.ts +5 -0
- package/src/components/ui3n-notification/ui3n-notification.vue +38 -16
- package/src/components/ui3n-radio-group/ui3n-radio.vue +9 -6
- package/src/components/ui3n-switch/ui3n-switch.vue +2 -1
- package/src/components/ui3n-tabs/ui3n-tabs.vue +0 -3
- package/dist/chunks/ui3n-notification-DPC5Ke4b.js +0 -278
package/dist/ui3n-plugins.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i, t as
|
|
3
|
-
import { Fragment as
|
|
1
|
+
import { H as e, i as t, n, r, t as i } from "./chunks/plugins-keys-DdadrIAg.js";
|
|
2
|
+
import { i as a, t as o } from "./chunks/ui3n-notification-o0tuhTpO.js";
|
|
3
|
+
import { Fragment as s, createApp as c, createBlock as l, createElementBlock as u, defineComponent as d, markRaw as f, mergeProps as p, normalizeClass as m, openBlock as h, ref as g, renderList as _ } from "vue";
|
|
4
4
|
import "pinia";
|
|
5
|
-
import
|
|
6
|
-
var
|
|
5
|
+
import v from "mitt";
|
|
6
|
+
var y = /* @__PURE__ */ a(/* @__PURE__ */ d({
|
|
7
7
|
__name: "ui3n-notification-container",
|
|
8
8
|
setup(e, { expose: t }) {
|
|
9
|
-
let n =
|
|
9
|
+
let n = g([]);
|
|
10
10
|
function r(e) {
|
|
11
11
|
n.value.push(e);
|
|
12
12
|
}
|
|
13
13
|
function i(e) {
|
|
14
14
|
n.value = n.value.filter((t) => t.id !== e);
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function a(e) {
|
|
17
17
|
e.onClose && e.onClose(), i(e.id);
|
|
18
18
|
}
|
|
19
19
|
return t({
|
|
20
20
|
add: r,
|
|
21
21
|
remove: i
|
|
22
|
-
}), (e, t) => (
|
|
22
|
+
}), (e, t) => (h(), u("div", {
|
|
23
23
|
id: "ui3n-notifications-container",
|
|
24
|
-
class:
|
|
25
|
-
}, [(
|
|
24
|
+
class: m(e.$style.ui3nNotificationsWrapper)
|
|
25
|
+
}, [(h(!0), u(s, null, _(n.value, (e) => (h(), l(o, p({ key: e.id }, { ref_for: !0 }, e, { "on-close": () => a(e) }), null, 16, ["on-close"]))), 128))], 2));
|
|
26
26
|
}
|
|
27
|
-
}), [["__cssModules", { $style: { ui3nNotificationsWrapper: "_ui3nNotificationsWrapper_1vwg2_1" } }]]),
|
|
27
|
+
}), [["__cssModules", { $style: { ui3nNotificationsWrapper: "_ui3nNotificationsWrapper_1vwg2_1" } }]]), b = { install: (t) => {
|
|
28
28
|
if (typeof window > "u") return;
|
|
29
29
|
let r = document.createElement("div");
|
|
30
30
|
document.body.appendChild(r);
|
|
31
|
-
let i =
|
|
32
|
-
i._context.provides =
|
|
31
|
+
let i = c(y);
|
|
32
|
+
i._context.provides = t._context.provides;
|
|
33
33
|
let a = i.mount(r), o = (t) => {
|
|
34
34
|
let n = t.id || e(6), r = t.duration === void 0 ? 1500 : t.duration;
|
|
35
35
|
a.add({
|
|
@@ -38,27 +38,27 @@ var v = /* @__PURE__ */ i(/* @__PURE__ */ u({
|
|
|
38
38
|
duration: r
|
|
39
39
|
});
|
|
40
40
|
};
|
|
41
|
-
|
|
42
|
-
} },
|
|
43
|
-
on:
|
|
41
|
+
t.config.globalProperties.$createNotice = o, t.provide(n, { $createNotice: o });
|
|
42
|
+
} }, x = v(), S = {
|
|
43
|
+
on: x.on.bind(x),
|
|
44
44
|
once: (e, t) => {
|
|
45
45
|
function n() {
|
|
46
|
-
|
|
46
|
+
x.off(e, n), t.apply(null, arguments);
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
x.on(e, n);
|
|
49
49
|
},
|
|
50
|
-
off:
|
|
51
|
-
emit:
|
|
52
|
-
clear:
|
|
53
|
-
},
|
|
54
|
-
e.config.globalProperties.$emitter =
|
|
55
|
-
} },
|
|
56
|
-
let n =
|
|
57
|
-
function
|
|
50
|
+
off: x.off.bind(x),
|
|
51
|
+
emit: x.emit.bind(x),
|
|
52
|
+
clear: x.all.clear.bind(x)
|
|
53
|
+
}, C = { install: (e) => {
|
|
54
|
+
e.config.globalProperties.$emitter = S, e.provide(t, { $emitter: S });
|
|
55
|
+
} }, w = { install(t) {
|
|
56
|
+
let n = g([]);
|
|
57
|
+
function r(t, r) {
|
|
58
58
|
return new Promise((i) => {
|
|
59
59
|
n.value.push({
|
|
60
60
|
id: e(5),
|
|
61
|
-
component:
|
|
61
|
+
component: f(t),
|
|
62
62
|
props: r,
|
|
63
63
|
resolve: i
|
|
64
64
|
});
|
|
@@ -73,31 +73,31 @@ var v = /* @__PURE__ */ i(/* @__PURE__ */ u({
|
|
|
73
73
|
}
|
|
74
74
|
t.config.globalProperties.$dialog = {
|
|
75
75
|
dialogStack: n,
|
|
76
|
-
$openDialog:
|
|
76
|
+
$openDialog: r,
|
|
77
77
|
$closeDialog: a,
|
|
78
78
|
$closeDialogs: o
|
|
79
|
-
}, t.provide(
|
|
79
|
+
}, t.provide(i, {
|
|
80
80
|
dialogStack: n,
|
|
81
|
-
$openDialog:
|
|
81
|
+
$openDialog: r,
|
|
82
82
|
$closeDialog: a,
|
|
83
83
|
$closeDialogs: o
|
|
84
84
|
});
|
|
85
85
|
} };
|
|
86
86
|
//#endregion
|
|
87
87
|
//#region src/plugins/notifications/store-notifications.ts
|
|
88
|
-
function
|
|
88
|
+
function T(e) {
|
|
89
89
|
let { app: t = {} } = e, { config: n = {} } = t, { globalProperties: r = {} } = n, { $createNotice: i } = r;
|
|
90
90
|
return { $createNotice: i };
|
|
91
91
|
}
|
|
92
92
|
//#endregion
|
|
93
93
|
//#region src/plugins/vue-bus/store-vue-bus.ts
|
|
94
|
-
function
|
|
94
|
+
function E(e) {
|
|
95
95
|
let { app: t = {} } = e, { config: n = {} } = t, { globalProperties: r = {} } = n, { $emitter: i } = r;
|
|
96
96
|
return { $emitter: i };
|
|
97
97
|
}
|
|
98
98
|
//#endregion
|
|
99
99
|
//#region src/plugins/dialogs/store-dialog.ts
|
|
100
|
-
function
|
|
100
|
+
function D(e) {
|
|
101
101
|
let { app: t = {} } = e, { config: n = {} } = t, { globalProperties: r = {} } = n, { $dialog: i } = r;
|
|
102
102
|
return { $dialogs: {
|
|
103
103
|
open: i.$openDialog,
|
|
@@ -107,4 +107,53 @@ function E(e) {
|
|
|
107
107
|
} };
|
|
108
108
|
}
|
|
109
109
|
//#endregion
|
|
110
|
-
|
|
110
|
+
//#region src/plugins/theme/theme.ts
|
|
111
|
+
var O = [
|
|
112
|
+
"light",
|
|
113
|
+
"dark",
|
|
114
|
+
"midnight"
|
|
115
|
+
], k = [
|
|
116
|
+
"light-theme",
|
|
117
|
+
"dark-theme",
|
|
118
|
+
"midnight-theme"
|
|
119
|
+
];
|
|
120
|
+
function A(e) {
|
|
121
|
+
return typeof e == "string" && O.includes(e);
|
|
122
|
+
}
|
|
123
|
+
function j(e, t) {
|
|
124
|
+
e.classList.add("colors");
|
|
125
|
+
for (let t of k) e.classList.remove(t);
|
|
126
|
+
e.classList.add(`${t}-theme`);
|
|
127
|
+
}
|
|
128
|
+
function M(e) {
|
|
129
|
+
if (e.persist) {
|
|
130
|
+
let t = e.storageKey ?? "ui3n-theme";
|
|
131
|
+
try {
|
|
132
|
+
let e = localStorage.getItem(t);
|
|
133
|
+
if (A(e)) return e;
|
|
134
|
+
} catch {}
|
|
135
|
+
}
|
|
136
|
+
return A(e.theme) ? e.theme : "light";
|
|
137
|
+
}
|
|
138
|
+
var N = { install(e, t = {}) {
|
|
139
|
+
let n = t.persist ?? !1, i = t.storageKey ?? "ui3n-theme", a = g(typeof document > "u" ? t.theme ?? "light" : M(t));
|
|
140
|
+
function o(e) {
|
|
141
|
+
if (A(e) && (a.value = e, !(typeof document > "u") && (j(t.target ?? document.documentElement, e), n))) try {
|
|
142
|
+
localStorage.setItem(i, e);
|
|
143
|
+
} catch {}
|
|
144
|
+
}
|
|
145
|
+
typeof document < "u" && o(a.value);
|
|
146
|
+
let s = {
|
|
147
|
+
theme: a,
|
|
148
|
+
setTheme: o
|
|
149
|
+
};
|
|
150
|
+
e.provide(r, s), e.config.globalProperties.$theme = s;
|
|
151
|
+
} };
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region src/plugins/theme/store-theme.ts
|
|
154
|
+
function P(e) {
|
|
155
|
+
let { app: t = {} } = e, { config: n = {} } = t, { globalProperties: r = {} } = n, { $theme: i } = r;
|
|
156
|
+
return { $theme: i };
|
|
157
|
+
}
|
|
158
|
+
//#endregion
|
|
159
|
+
export { i as DIALOGS_KEY, n as NOTIFICATIONS_KEY, r as THEME_KEY, t as VUEBUS_KEY, w as dialogs, b as notifications, D as storeDialogs, T as storeNotifications, P as storeTheme, E as storeVueBus, N as theme, C as vueBus };
|
package/dist/ui3n-utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as e,
|
|
2
|
-
import { t as
|
|
1
|
+
import { A as e, C as t, D as n, E as r, F as i, G as a, H as o, I as s, J as c, K as l, L as u, M as d, N as f, O as p, P as m, R as h, S as g, T as _, U as v, V as y, W as b, X as x, Y as S, Z as C, _ as w, a as T, b as E, c as D, d as O, f as k, g as A, h as j, i as M, j as N, k as P, l as F, m as I, n as L, o as R, p as z, q as B, r as V, s as H, t as U, u as W, v as G, w as K, x as q, y as J, z as Y } from "./chunks/plugins-keys-DdadrIAg.js";
|
|
2
|
+
import { t as X } from "./chunks/emoticons-DMgiBINj.js";
|
|
3
3
|
//#region src/constants/general.ts
|
|
4
|
-
var
|
|
4
|
+
var Z = /[^@]+@[^@]+\.[^@]+/iu;
|
|
5
5
|
//#endregion
|
|
6
|
-
export {
|
|
6
|
+
export { U as DIALOGS_KEY, L as NOTIFICATIONS_KEY, l as NamedProcs, T as SQLiteOn3NStorage, B as SingleCyclicProc, c as SingleProc, V as THEME_KEY, b as TaskRunner, M as VUEBUS_KEY, z as b64ToBlob, k as blobFromDataURL, I as blobToB64, q as capitalize, m as copyToClipboard, D as createVideoThumbnail, N as debounce, C as defer, X as emoticons, f as executeFunc, F as fileToUint8Array, J as formatFileSize, _ as generateColor, i as getDeliveryErrors, Y as getFileExtension, o as getRandomId, r as hasSlotContent, t as html2text, K as invertColor, j as isFileArchive, A as isFileAudio, G as isFileImage, w as isFileVideo, Z as mailReg, S as makeSyncedFunc, n as markSearch, h as mimeTypes, y as patchTextareaMaxRowsSupport, g as prepareDateAsSting, d as removeWhitespaceInString, W as resizeImage, v as round, a as schedulerYield, p as selectAll, P as selectEnd, e as selectStart, x as sleep, E as toCssLength, s as transformFileToWeb3NFile, u as transformWeb3nFileToFile, R as tryOnScopeDispose, O as uint8ToDataURL, H as unrefElement };
|
package/dist/variables.css
CHANGED
|
@@ -123,6 +123,8 @@
|
|
|
123
123
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
+
:root,
|
|
127
|
+
.light-theme,
|
|
126
128
|
.default-theme {
|
|
127
129
|
--ripple: var(--white-48);
|
|
128
130
|
--shadow-key-1: var(--black-12);
|
|
@@ -290,7 +292,7 @@
|
|
|
290
292
|
--info-outline-disabled: var(--blue-5);
|
|
291
293
|
}
|
|
292
294
|
|
|
293
|
-
.
|
|
295
|
+
.midnight-theme {
|
|
294
296
|
--ripple: var(--black-48);
|
|
295
297
|
--shadow-key-1: var(--white-12);
|
|
296
298
|
--shadow-key-2: var(--white-8);
|
|
@@ -457,7 +459,7 @@
|
|
|
457
459
|
--info-outline-disabled: var(--blue-85);
|
|
458
460
|
}
|
|
459
461
|
|
|
460
|
-
.
|
|
462
|
+
.dark-theme {
|
|
461
463
|
--ripple: var(--black-48);
|
|
462
464
|
--shadow-key-1: var(--white-12);
|
|
463
465
|
--shadow-key-2: var(--white-8);
|
|
@@ -624,6 +626,7 @@
|
|
|
624
626
|
--info-outline-disabled: var(--blue-85);
|
|
625
627
|
}
|
|
626
628
|
|
|
629
|
+
:root,
|
|
627
630
|
.colors {
|
|
628
631
|
--color-bg-button-primary-default: var(--accent-fill-default);
|
|
629
632
|
--color-bg-button-primary-hover: var(--accent-fill-hover);
|
|
@@ -930,92 +933,3 @@
|
|
|
930
933
|
--color-icon-chat-bubble-other-selected: var(--accent-content-selected);
|
|
931
934
|
--effect-dropdown-shadow: 0 0 4px 0 var(--shadow-close), 0 4px 12px 0 var(--shadow-far);
|
|
932
935
|
}
|
|
933
|
-
|
|
934
|
-
html {
|
|
935
|
-
overflow: hidden;
|
|
936
|
-
font-family: Inter, system-ui, sans-serif;
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
section,
|
|
940
|
-
div {
|
|
941
|
-
box-sizing: border-box;
|
|
942
|
-
}
|
|
943
|
-
|
|
944
|
-
::-webkit-scrollbar-button {
|
|
945
|
-
background-image: url("");
|
|
946
|
-
background-repeat: no-repeat;
|
|
947
|
-
width: var(--spacing-xs);
|
|
948
|
-
height: 0;
|
|
949
|
-
}
|
|
950
|
-
|
|
951
|
-
::-webkit-scrollbar-track {
|
|
952
|
-
background-color: transparent;
|
|
953
|
-
}
|
|
954
|
-
|
|
955
|
-
::-webkit-scrollbar-thumb {
|
|
956
|
-
border-radius: 4px;
|
|
957
|
-
height: 50px;
|
|
958
|
-
background-color: var(--default-fill-pressed);
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
::-webkit-scrollbar-thumb:hover {
|
|
962
|
-
background-color: var(--t-default-fill-default);
|
|
963
|
-
}
|
|
964
|
-
|
|
965
|
-
::-webkit-resizer {
|
|
966
|
-
background-image: url("");
|
|
967
|
-
background-repeat: no-repeat;
|
|
968
|
-
width: var(--spacing-xs);
|
|
969
|
-
height: 0;
|
|
970
|
-
}
|
|
971
|
-
|
|
972
|
-
::-webkit-scrollbar {
|
|
973
|
-
width: 5px;
|
|
974
|
-
}
|
|
975
|
-
|
|
976
|
-
/* other CSS style classes */
|
|
977
|
-
.fade-enter-active,
|
|
978
|
-
.fade-leave-active {
|
|
979
|
-
transition: opacity 0.15s ease;
|
|
980
|
-
}
|
|
981
|
-
|
|
982
|
-
.fade-enter,
|
|
983
|
-
.fade-leave-active {
|
|
984
|
-
opacity: 0;
|
|
985
|
-
}
|
|
986
|
-
|
|
987
|
-
@keyframes ripple {
|
|
988
|
-
to {
|
|
989
|
-
transform: scale(4);
|
|
990
|
-
opacity: 0;
|
|
991
|
-
}
|
|
992
|
-
}
|
|
993
|
-
|
|
994
|
-
.ui3n-ripple {
|
|
995
|
-
--ui3n-ripple-duration: 400ms;
|
|
996
|
-
--ui3n-ripple-bg-color: var(--ripple);
|
|
997
|
-
|
|
998
|
-
position: absolute;
|
|
999
|
-
border-radius: 50%;
|
|
1000
|
-
transform: scale(0);
|
|
1001
|
-
animation: ripple var(--ui3n-ripple-duration) linear;
|
|
1002
|
-
background-color: var(--ui3n-ripple-bg-color);
|
|
1003
|
-
}
|
|
1004
|
-
|
|
1005
|
-
.ui3n-title {
|
|
1006
|
-
position: fixed;
|
|
1007
|
-
width: max-content;
|
|
1008
|
-
top: 0;
|
|
1009
|
-
left: 0;
|
|
1010
|
-
padding: var(--spacing-xs) var(--spacing-s);
|
|
1011
|
-
border-radius: var(--spacing-xs);
|
|
1012
|
-
font-size: var(--font-11);
|
|
1013
|
-
line-height: var(--font-12);
|
|
1014
|
-
font-weight: 400;
|
|
1015
|
-
overflow-wrap: break-word;
|
|
1016
|
-
white-space: break-spaces;
|
|
1017
|
-
box-shadow: 0 2px 1px -1px var(--shadow-key-1),
|
|
1018
|
-
0 1px 1px 0 var(--shadow-key-2),
|
|
1019
|
-
0 1px 3px 0 var(--shadow-key-3);
|
|
1020
|
-
z-index: 1000;
|
|
1021
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { computed, onBeforeMount, ref, useCssModule, useSlots, watch } from 'vue';
|
|
3
3
|
import Ui3nRipple from '../../directives/ui3n-ripple';
|
|
4
|
+
import { toCssLength } from '../../utils/ui/to-css-length';
|
|
4
5
|
import type {
|
|
5
6
|
Ui3nCheckboxEmits,
|
|
6
7
|
Ui3nCheckboxExpose,
|
|
@@ -52,7 +53,7 @@
|
|
|
52
53
|
});
|
|
53
54
|
|
|
54
55
|
const inlineStyles = computed(() => ({
|
|
55
|
-
'--ui3n-checkbox-size':
|
|
56
|
+
'--ui3n-checkbox-size': toCssLength(props.size),
|
|
56
57
|
'--ui3n-checkbox-color': props.color,
|
|
57
58
|
}));
|
|
58
59
|
|
|
@@ -205,8 +206,6 @@
|
|
|
205
206
|
</template>
|
|
206
207
|
|
|
207
208
|
<style lang="scss" module>
|
|
208
|
-
@use '../../assets/styles/mixins' as mixins;
|
|
209
|
-
|
|
210
209
|
.ui3nCheckbox {
|
|
211
210
|
--ui3n-checkbox-size: 16px;
|
|
212
211
|
--ui3n-checkbox-gap: 4px;
|
|
@@ -248,17 +247,15 @@
|
|
|
248
247
|
background-color: var(--ui3n-checkbox-color);
|
|
249
248
|
|
|
250
249
|
&:hover {
|
|
251
|
-
border-color:
|
|
252
|
-
background-color:
|
|
253
|
-
@include mixins.ripple(oklch(from var(--ui3n-checkbox-color) calc(l - 0.1) c h));
|
|
250
|
+
border-color: color-mix(in oklch, var(--ui3n-checkbox-color), black 12%);
|
|
251
|
+
background-color: color-mix(in oklch, var(--ui3n-checkbox-color), black 12%);
|
|
254
252
|
}
|
|
255
253
|
}
|
|
256
254
|
|
|
257
255
|
.unfilled {
|
|
258
256
|
&:hover {
|
|
259
|
-
border-color:
|
|
260
|
-
background-color:
|
|
261
|
-
@include mixins.ripple(oklch(from transparent calc(l - 0.1) c h));
|
|
257
|
+
border-color: color-mix(in oklch, var(--ui3n-checkbox-color) 84%, black);
|
|
258
|
+
background-color: color-mix(in oklch, var(--ui3n-checkbox-color) 16%, transparent);
|
|
262
259
|
}
|
|
263
260
|
}
|
|
264
261
|
|
|
@@ -24,6 +24,11 @@ export interface Ui3nNotificationProps {
|
|
|
24
24
|
* @default false
|
|
25
25
|
*/
|
|
26
26
|
withIcon?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Notification border radius in pixels or css length
|
|
29
|
+
* @default 8
|
|
30
|
+
*/
|
|
31
|
+
borderRadius?: number | string;
|
|
27
32
|
/**
|
|
28
33
|
* Called when notification opens
|
|
29
34
|
*/
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { computed, onMounted, onBeforeUnmount,
|
|
2
|
+
import { computed, onMounted, onBeforeUnmount, useCssModule } from 'vue';
|
|
3
3
|
import Ui3nIcon from '../ui3n-icon/ui3n-icon.vue';
|
|
4
4
|
import Ui3nButton from '../ui3n-button/ui3n-button.vue';
|
|
5
|
+
import { toCssLength } from '../../utils/ui/to-css-length';
|
|
5
6
|
import type { Ui3nNotificationProps } from './types';
|
|
6
7
|
|
|
7
8
|
const props = withDefaults(defineProps<Ui3nNotificationProps>(), {
|
|
@@ -9,6 +10,7 @@
|
|
|
9
10
|
position: 'center',
|
|
10
11
|
duration: 0,
|
|
11
12
|
withIcon: true,
|
|
13
|
+
borderRadius: 8,
|
|
12
14
|
onOpen: () => {},
|
|
13
15
|
onClose: () => {},
|
|
14
16
|
});
|
|
@@ -20,25 +22,21 @@
|
|
|
20
22
|
const currentTypeConfig = computed(() => {
|
|
21
23
|
const stylesByTypes = {
|
|
22
24
|
success: {
|
|
23
|
-
color: 'var(--success-content-default)',
|
|
24
25
|
icon: 'round-check-circle',
|
|
25
26
|
iconColor: 'var(--success-fill-default)',
|
|
26
27
|
iconRotate: 0,
|
|
27
28
|
},
|
|
28
29
|
warning: {
|
|
29
|
-
color: 'var(--warning-content-default)',
|
|
30
30
|
icon: 'round-warning',
|
|
31
31
|
iconColor: 'var(--warning-fill-default)',
|
|
32
32
|
iconRotate: 0,
|
|
33
33
|
},
|
|
34
34
|
info: {
|
|
35
|
-
color: 'var(--info-content-default)',
|
|
36
35
|
icon: 'round-info',
|
|
37
36
|
iconColor: 'var(--info-fill-default)',
|
|
38
37
|
iconRotate: 180,
|
|
39
38
|
},
|
|
40
39
|
error: {
|
|
41
|
-
color: 'var(--error-content-default)',
|
|
42
40
|
icon: 'round-info',
|
|
43
41
|
iconColor: 'var(--error-fill-default)',
|
|
44
42
|
iconRotate: 180,
|
|
@@ -53,6 +51,10 @@
|
|
|
53
51
|
return val;
|
|
54
52
|
});
|
|
55
53
|
|
|
54
|
+
const inlineStyles = computed(() => ({
|
|
55
|
+
'--ui3n-notification-border-radius': toCssLength(props.borderRadius, '8px'),
|
|
56
|
+
}));
|
|
57
|
+
|
|
56
58
|
function closeNotification() {
|
|
57
59
|
if (props.onClose) {
|
|
58
60
|
props.onClose();
|
|
@@ -82,6 +84,7 @@
|
|
|
82
84
|
<div
|
|
83
85
|
:id="id"
|
|
84
86
|
:class="mainCssClasses"
|
|
87
|
+
:style="inlineStyles"
|
|
85
88
|
>
|
|
86
89
|
<div
|
|
87
90
|
v-if="withIcon"
|
|
@@ -105,7 +108,6 @@
|
|
|
105
108
|
size="small"
|
|
106
109
|
color="transparent"
|
|
107
110
|
icon="round-close"
|
|
108
|
-
:icon-color="currentTypeConfig.color"
|
|
109
111
|
icon-size="16"
|
|
110
112
|
:class="$style.closeBtn"
|
|
111
113
|
@click="closeNotification"
|
|
@@ -117,22 +119,24 @@
|
|
|
117
119
|
.ui3nNotification {
|
|
118
120
|
--ui3n-notification-width: 380px;
|
|
119
121
|
--ui3n-notification-font-size: 12px;
|
|
120
|
-
--ui3n-notification-border-radius:
|
|
122
|
+
--ui3n-notification-border-radius: 8px;
|
|
121
123
|
--ui3n-notification-margin-bottom: 4px;
|
|
122
124
|
--ui3n-notification-icon-size: 32px;
|
|
125
|
+
--ui3n-notification-text-color: var(--default-content-default);
|
|
123
126
|
|
|
124
127
|
display: flex;
|
|
125
128
|
position: relative;
|
|
126
129
|
box-sizing: border-box;
|
|
127
130
|
z-index: 5000;
|
|
128
131
|
border-radius: var(--ui3n-notification-border-radius);
|
|
129
|
-
outline: 1px solid var(--color-border-
|
|
132
|
+
outline: 1px solid var(--color-border-block-primary-default);
|
|
130
133
|
padding: var(--spacing-m);
|
|
131
134
|
max-width: var(--ui3n-notification-width);
|
|
132
135
|
margin-bottom: var(--ui3n-notification-margin-bottom);
|
|
133
136
|
justify-content: center;
|
|
134
137
|
align-items: center;
|
|
135
138
|
gap: 8px;
|
|
139
|
+
color: var(--ui3n-notification-text-color);
|
|
136
140
|
}
|
|
137
141
|
|
|
138
142
|
.withIcon {
|
|
@@ -159,6 +163,7 @@
|
|
|
159
163
|
font-weight: 500;
|
|
160
164
|
line-height: 1.33;
|
|
161
165
|
padding-right: 20px;
|
|
166
|
+
color: var(--ui3n-notification-text-color);
|
|
162
167
|
}
|
|
163
168
|
|
|
164
169
|
.closeBtn {
|
|
@@ -166,53 +171,70 @@
|
|
|
166
171
|
z-index: 1;
|
|
167
172
|
top: 6px;
|
|
168
173
|
right: 6px;
|
|
174
|
+
color: var(--ui3n-notification-text-color);
|
|
169
175
|
}
|
|
170
176
|
|
|
171
177
|
.infoType {
|
|
178
|
+
--ui3n-notification-text-color: var(--info-content-default);
|
|
179
|
+
|
|
172
180
|
background-color: var(--info-fill-default);
|
|
173
181
|
|
|
174
182
|
.ui3nNotificationIcon {
|
|
175
183
|
background-color: var(--info-content-default);
|
|
176
184
|
}
|
|
177
185
|
|
|
178
|
-
.
|
|
179
|
-
|
|
186
|
+
:global(.dark-theme) &,
|
|
187
|
+
:global(.midnight-theme) &,
|
|
188
|
+
:global(.dark2-theme) & {
|
|
189
|
+
--ui3n-notification-text-color: oklch(from var(--info-content-default) calc(l + 0.15) c h);
|
|
180
190
|
}
|
|
181
191
|
}
|
|
182
192
|
|
|
183
193
|
.successType {
|
|
194
|
+
--ui3n-notification-text-color: var(--success-content-default);
|
|
195
|
+
|
|
184
196
|
background-color: var(--success-fill-default);
|
|
185
197
|
|
|
186
198
|
.ui3nNotificationIcon {
|
|
187
199
|
background-color: var(--success-content-default);
|
|
188
200
|
}
|
|
189
201
|
|
|
190
|
-
.
|
|
191
|
-
|
|
202
|
+
:global(.dark-theme) &,
|
|
203
|
+
:global(.midnight-theme) &,
|
|
204
|
+
:global(.dark2-theme) & {
|
|
205
|
+
--ui3n-notification-text-color: oklch(from var(--success-content-default) calc(l + 0.15) c h);
|
|
192
206
|
}
|
|
193
207
|
}
|
|
194
208
|
|
|
195
209
|
.warningType {
|
|
210
|
+
--ui3n-notification-text-color: var(--warning-content-default);
|
|
211
|
+
|
|
196
212
|
background-color: var(--warning-fill-default);
|
|
197
213
|
|
|
198
214
|
.ui3nNotificationIcon {
|
|
199
215
|
background-color: var(--warning-content-default);
|
|
200
216
|
}
|
|
201
217
|
|
|
202
|
-
.
|
|
203
|
-
|
|
218
|
+
:global(.dark-theme) &,
|
|
219
|
+
:global(.midnight-theme) &,
|
|
220
|
+
:global(.dark2-theme) & {
|
|
221
|
+
--ui3n-notification-text-color: color-mix(in oklch, var(--warning-content-default) 45%, white);
|
|
204
222
|
}
|
|
205
223
|
}
|
|
206
224
|
|
|
207
225
|
.errorType {
|
|
226
|
+
--ui3n-notification-text-color: var(--error-content-default);
|
|
227
|
+
|
|
208
228
|
background-color: var(--error-fill-default);
|
|
209
229
|
|
|
210
230
|
.ui3nNotificationIcon {
|
|
211
231
|
background-color: var(--error-content-default);
|
|
212
232
|
}
|
|
213
233
|
|
|
214
|
-
.
|
|
215
|
-
|
|
234
|
+
:global(.dark-theme) &,
|
|
235
|
+
:global(.midnight-theme) &,
|
|
236
|
+
:global(.dark2-theme) & {
|
|
237
|
+
--ui3n-notification-text-color: color-mix(in oklch, var(--error-content-default) 45%, white);
|
|
216
238
|
}
|
|
217
239
|
}
|
|
218
240
|
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { computed,
|
|
2
|
+
import { computed, inject, onBeforeMount, ref, useSlots, watch } from 'vue';
|
|
3
3
|
import type { ComputedRef } from 'vue';
|
|
4
|
+
import Ui3nRipple from '../../directives/ui3n-ripple';
|
|
5
|
+
import { toCssLength } from '../../utils/ui/to-css-length';
|
|
4
6
|
import type { Ui3nRadioEmits, Ui3nRadioProps, Ui3nRadioSlots, Ui3nRadioValue, Ui3nRadioExpose } from './types';
|
|
5
7
|
|
|
8
|
+
const vUi3nRipple = Ui3nRipple;
|
|
9
|
+
|
|
6
10
|
const props = withDefaults(defineProps<Ui3nRadioProps>(), {
|
|
7
11
|
name: undefined,
|
|
8
12
|
modelValue: false,
|
|
@@ -38,7 +42,7 @@
|
|
|
38
42
|
});
|
|
39
43
|
|
|
40
44
|
const radioStyle = computed(() => ({
|
|
41
|
-
'--ui3n-radio-size':
|
|
45
|
+
'--ui3n-radio-size': toCssLength(props.size),
|
|
42
46
|
'--ui3n-radio-color': props.color,
|
|
43
47
|
}));
|
|
44
48
|
|
|
@@ -120,6 +124,7 @@
|
|
|
120
124
|
/>
|
|
121
125
|
|
|
122
126
|
<div
|
|
127
|
+
v-ui3n-ripple
|
|
123
128
|
:class="[$style.body, disabled && $style.bodyDisabled]"
|
|
124
129
|
:tabindex="disabled ? -1 : 0"
|
|
125
130
|
@keydown.enter="change"
|
|
@@ -168,8 +173,6 @@
|
|
|
168
173
|
</template>
|
|
169
174
|
|
|
170
175
|
<style lang="scss" module>
|
|
171
|
-
@use '../../assets/styles/mixins' as mixins;
|
|
172
|
-
|
|
173
176
|
.ui3nRadio {
|
|
174
177
|
--ui3n-radio-min-height: 24px;
|
|
175
178
|
|
|
@@ -206,11 +209,11 @@
|
|
|
206
209
|
justify-content: center;
|
|
207
210
|
align-items: center;
|
|
208
211
|
border-radius: 50%;
|
|
212
|
+
overflow: hidden;
|
|
209
213
|
|
|
210
214
|
&:hover {
|
|
211
215
|
cursor: pointer;
|
|
212
|
-
background-color:
|
|
213
|
-
@include mixins.ripple(oklch(from transparent calc(l - 0.1) c h));
|
|
216
|
+
background-color: color-mix(in oklch, var(--ui3n-radio-color) 16%, transparent);
|
|
214
217
|
}
|
|
215
218
|
}
|
|
216
219
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { computed, ref, watch, useSlots } from 'vue';
|
|
3
|
+
import { toCssLength } from '../../utils/ui/to-css-length';
|
|
3
4
|
import type { Ui3nSwitchEmits, Ui3nSwitchProps, Ui3nSwitchSlots, Ui3nSwitchExpose } from './types';
|
|
4
5
|
|
|
5
6
|
const props = withDefaults(defineProps<Ui3nSwitchProps>(), {
|
|
@@ -17,7 +18,7 @@
|
|
|
17
18
|
|
|
18
19
|
const switchStyle = computed(() => ({
|
|
19
20
|
'--ui3n-switch-color': props.color,
|
|
20
|
-
'--ui3n-switch-size':
|
|
21
|
+
'--ui3n-switch-size': toCssLength(props.size),
|
|
21
22
|
}));
|
|
22
23
|
|
|
23
24
|
function change(ev: Event) {
|
|
@@ -98,8 +98,6 @@
|
|
|
98
98
|
</template>
|
|
99
99
|
|
|
100
100
|
<style lang="scss" module>
|
|
101
|
-
@use '../../assets/styles/mixins' as mixins;
|
|
102
|
-
|
|
103
101
|
.ui3nTabs {
|
|
104
102
|
--ui3n-tabs-height: 48px;
|
|
105
103
|
|
|
@@ -116,7 +114,6 @@
|
|
|
116
114
|
position: relative;
|
|
117
115
|
user-select: none;
|
|
118
116
|
color: var(--ui3n-tabs-inactive-color);
|
|
119
|
-
@include mixins.ripple(var(--color-bg-control-secondary-default));
|
|
120
117
|
|
|
121
118
|
&:hover {
|
|
122
119
|
background-color: var(--color-bg-control-secondary-default);
|