@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.
Files changed (32) hide show
  1. package/README.md +44 -1
  2. package/dist/chunks/{plugins-keys-CmrMlx3F.js → plugins-keys-DdadrIAg.js} +84 -77
  3. package/dist/chunks/ui3n-notification-o0tuhTpO.js +272 -0
  4. package/dist/mixins.scss +0 -23
  5. package/dist/src/components/ui3n-input/ui3n-input.d.ts +2 -2
  6. package/dist/src/components/ui3n-notification/types.d.ts +5 -0
  7. package/dist/src/components/ui3n-notification/ui3n-notification.d.ts +1 -0
  8. package/dist/src/components/ui3n-text/ui3n-text.d.ts +2 -2
  9. package/dist/src/components/ui3n-tooltip/ui3n-tooltip.d.ts +1 -1
  10. package/dist/src/constants/plugins-keys.d.ts +2 -0
  11. package/dist/src/directives/ui3n-ripple.d.ts +2 -1
  12. package/dist/src/directives/ui3n-title.d.ts +1 -1
  13. package/dist/src/plugins/index.d.ts +4 -1
  14. package/dist/src/plugins/theme/store-theme.d.ts +4 -0
  15. package/dist/src/plugins/theme/theme.d.ts +10 -0
  16. package/dist/src/plugins/theme/types.d.ts +12 -0
  17. package/dist/src/ui3n-plugins.d.ts +5 -3
  18. package/dist/src/utils/index.d.ts +1 -0
  19. package/dist/src/utils/ui/to-css-length.d.ts +1 -0
  20. package/dist/style.css +1 -1
  21. package/dist/ui3n-components.js +1213 -1193
  22. package/dist/ui3n-plugins.js +83 -34
  23. package/dist/ui3n-utils.js +4 -4
  24. package/dist/variables.css +5 -91
  25. package/package.json +1 -1
  26. package/src/components/ui3n-checkbox/ui3n-checkbox.vue +6 -9
  27. package/src/components/ui3n-notification/types.ts +5 -0
  28. package/src/components/ui3n-notification/ui3n-notification.vue +38 -16
  29. package/src/components/ui3n-radio-group/ui3n-radio.vue +9 -6
  30. package/src/components/ui3n-switch/ui3n-switch.vue +2 -1
  31. package/src/components/ui3n-tabs/ui3n-tabs.vue +0 -3
  32. package/dist/chunks/ui3n-notification-DPC5Ke4b.js +0 -278
@@ -1,278 +0,0 @@
1
- import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createVNode as a, defineComponent as o, mergeProps as s, normalizeClass as c, onBeforeUnmount as l, onMounted as u, openBlock as d, ref as f, renderSlot as p, toDisplayString as m, unref as h, useCssModule as g, watch as _, withDirectives as v, withKeys as y } from "vue";
2
- //#region src/directives/ui3n-ripple.ts
3
- var b = {}, x = "";
4
- function S({ el: e, duration: t }) {
5
- let n = document.createElement("div"), r = Math.max(e.clientWidth, e.clientHeight), i = r / 2;
6
- n.style.width = n.style.height = `${r}px`, n.style.left = `${Math.round(e.clientWidth / 2 - i)}px`, n.style.top = `${Math.round(e.clientHeight / 2 - i)}px`, n.classList.add("ui3n-ripple"), x && n.style.setProperty("--ui3n-ripple-bg-color", x), t && n.style.setProperty("--ui3n-ripple-duration", `${t}ms`);
7
- let a = e.getElementsByClassName("ui3n-ripple")[0];
8
- a && a.remove(), e.appendChild(n);
9
- }
10
- function C({ eventName: e, el: t, duration: n }) {
11
- ["click", "keydown"].includes(e) && (b[e] = new AbortController(), t.addEventListener(e, function() {
12
- S({
13
- el: t,
14
- duration: n
15
- });
16
- }, { signal: b[e].signal }));
17
- }
18
- var w = {
19
- mounted(e, t) {
20
- let { color: n, duration: r, eventsTriggers: i = [], disabled: a = !1 } = t.value || {};
21
- x = n || "", !a && ((!i.length || i.length && i.includes("click")) && C({
22
- eventName: "click",
23
- el: e,
24
- duration: r
25
- }), i.length && i.includes("enter") && C({
26
- eventName: "keydown",
27
- el: e,
28
- duration: r
29
- }));
30
- },
31
- beforeUnmount() {
32
- Object.keys(b).forEach((e) => {
33
- b[e].abort();
34
- });
35
- }
36
- }, T = ["id", "title"], E = /* @__PURE__ */ o({
37
- __name: "ui3n-icon",
38
- props: {
39
- id: {},
40
- icon: {},
41
- title: { default: "" },
42
- size: {},
43
- width: {},
44
- height: {},
45
- color: { default: "var(--color-icon-control-primary-default)" },
46
- horizontalFlip: { type: Boolean },
47
- verticalFlip: { type: Boolean },
48
- rotate: { default: 0 }
49
- },
50
- emits: ["click"],
51
- setup(t, { emit: n }) {
52
- let i = t, a = n, o = e(() => i.size || i.width || 16), c = e(() => i.size || i.height || 16), l = e(() => {
53
- let e = {
54
- "--ui3n-icon-width": u(o.value),
55
- "--ui3n-icon-height": u(c.value),
56
- "--ui3n-icon-color": i.color
57
- }, t = [];
58
- return i.horizontalFlip && t.push("rotateY(180deg)"), i.verticalFlip && t.push("rotateX(180deg)"), i.rotate && t.push(`rotate(${i.rotate}deg)`), t.length && (e.transform = t.join(" ")), e;
59
- });
60
- function u(e) {
61
- return isNaN(Number(e)) ? String(e) : `${e}px`;
62
- }
63
- return (e, n) => (d(), r("div", s({
64
- id: t.id,
65
- class: e.$style.ui3nIcon,
66
- title: t.title,
67
- style: l.value
68
- }, { "data-icon": t.icon }, { onClick: n[0] ||= (e) => a("click", e) }), null, 16, T));
69
- }
70
- }), D = { ui3nIcon: "_ui3nIcon_10yhz_1" }, O = (e, t) => {
71
- let n = e.__vccOpts || e;
72
- for (let [e, r] of t) n[e] = r;
73
- return n;
74
- }, k = /* @__PURE__ */ O(E, [["__cssModules", { $style: D }]]), A = {
75
- small: 12,
76
- regular: 16,
77
- large: 24
78
- }, j = ["id", "disabled"], M = /* @__PURE__ */ O(/* @__PURE__ */ o({
79
- __name: "ui3n-button",
80
- props: {
81
- id: {},
82
- type: { default: "primary" },
83
- size: { default: "regular" },
84
- square: { type: Boolean },
85
- block: { type: Boolean },
86
- textColor: {},
87
- color: {},
88
- elevation: { type: Boolean },
89
- icon: {},
90
- iconSize: {},
91
- iconColor: {},
92
- iconPosition: { default: "right" },
93
- disabled: {
94
- type: Boolean,
95
- default: !1
96
- }
97
- },
98
- emits: [
99
- "init",
100
- "click",
101
- "enter",
102
- "focus",
103
- "blur"
104
- ],
105
- setup(i, { emit: a }) {
106
- let o = w, s = i, l = a, m = g(), b = f(null), x = e(() => {
107
- let e = [
108
- m.ui3nButton,
109
- m[s.size],
110
- m[s.type]
111
- ];
112
- return s.block && s.type !== "icon" && e.push(m.block), s.square && e.push(m.square), s.icon && e.push(m[`withIcon-${s.iconPosition}`]), s.elevation && e.push(m.elevation), e;
113
- }), S = e(() => s.iconSize ? s.iconSize : A[s.size]), C = e(() => s.iconColor ? s.iconColor : "inherit");
114
- async function T(e, t) {
115
- ["init", "enter"].includes(e) ? l(e, b.value) : l(e, t);
116
- }
117
- return _([() => s.color, () => s.textColor], (e, t) => {
118
- if (!b.value) return;
119
- let [n, r] = t, [i, a] = e;
120
- (s.type === "custom" || s.type === "icon") && i !== n && b.value.style.setProperty("--ui3n-button-bg-color", i ?? "var(--color-bg-button-primary-default)"), (s.type === "custom" || s.type === "icon") && a !== r && b.value.style.setProperty("--ui3n-button-text-color", a ?? "var(--color-text-button-primary-default)");
121
- }), u(() => {
122
- b.value && ((s.type === "custom" || s.type === "icon") && s.color && b.value.style.setProperty("--ui3n-button-bg-color", s.color), s.type === "custom" && s.textColor && b.value.style.setProperty("--ui3n-button-text-color", s.textColor), T("init"));
123
- }), (e, a) => v((d(), r("button", {
124
- ref_key: "buttonEl",
125
- ref: b,
126
- id: i.id,
127
- class: c(x.value),
128
- type: "button",
129
- disabled: i.disabled,
130
- onClick: a[0] ||= (e) => T("click", e),
131
- onFocusin: a[1] ||= (e) => T("focus", e),
132
- onFocusout: a[2] ||= (e) => T("blur", e),
133
- onKeydown: a[3] ||= y((e) => T("enter"), ["enter"])
134
- }, [i.icon ? (d(), t(k, {
135
- key: 0,
136
- class: c(e.$style.buttonIcon),
137
- icon: i.icon,
138
- size: S.value,
139
- color: C.value
140
- }, null, 8, [
141
- "class",
142
- "icon",
143
- "size",
144
- "color"
145
- ])) : n("", !0), i.type === "icon" ? n("", !0) : (d(), r("span", {
146
- key: 1,
147
- class: c(e.$style.text)
148
- }, [p(e.$slots, "default")], 2))], 42, j)), [[h(o)]]);
149
- }
150
- }), [["__cssModules", { $style: {
151
- ui3nButton: "_ui3nButton_5lm0q_3",
152
- "withIcon-left": "_withIcon-left_5lm0q_35",
153
- "withIcon-right": "_withIcon-right_5lm0q_38",
154
- square: "_square_5lm0q_41",
155
- regular: "_regular_5lm0q_48",
156
- small: "_small_5lm0q_55",
157
- large: "_large_5lm0q_62",
158
- block: "_block_5lm0q_69",
159
- primary: "_primary_5lm0q_73",
160
- elevation: "_elevation_5lm0q_96",
161
- text: "_text_5lm0q_101",
162
- secondary: "_secondary_5lm0q_133",
163
- tertiary: "_tertiary_5lm0q_187",
164
- outline: "_outline_5lm0q_242",
165
- icon: "_icon_5lm0q_270",
166
- custom: "_custom_5lm0q_290",
167
- buttonIcon: "_buttonIcon_5lm0q_319"
168
- } }]]), N = ["id"], P = /* @__PURE__ */ O(/* @__PURE__ */ o({
169
- __name: "ui3n-notification",
170
- props: {
171
- id: {},
172
- type: { default: "info" },
173
- content: {},
174
- position: { default: "center" },
175
- duration: { default: 0 },
176
- withIcon: {
177
- type: Boolean,
178
- default: !0
179
- },
180
- onOpen: {
181
- type: Function,
182
- default: () => {}
183
- },
184
- onClose: {
185
- type: Function,
186
- default: () => {}
187
- }
188
- },
189
- setup(o) {
190
- let s = o, f = null, p = g(), _ = e(() => ({
191
- success: {
192
- color: "var(--success-content-default)",
193
- icon: "round-check-circle",
194
- iconColor: "var(--success-fill-default)",
195
- iconRotate: 0
196
- },
197
- warning: {
198
- color: "var(--warning-content-default)",
199
- icon: "round-warning",
200
- iconColor: "var(--warning-fill-default)",
201
- iconRotate: 0
202
- },
203
- info: {
204
- color: "var(--info-content-default)",
205
- icon: "round-info",
206
- iconColor: "var(--info-fill-default)",
207
- iconRotate: 180
208
- },
209
- error: {
210
- color: "var(--error-content-default)",
211
- icon: "round-info",
212
- iconColor: "var(--error-fill-default)",
213
- iconRotate: 180
214
- }
215
- })[s.type || "info"]), v = e(() => {
216
- let e = [
217
- p.ui3nNotification,
218
- p[`${s.type}Type`],
219
- p[`${s.position}Position`]
220
- ];
221
- return s.withIcon && e.push(p.withIcon), e;
222
- });
223
- function y() {
224
- s.onClose && s.onClose();
225
- }
226
- return u(() => {
227
- s.onOpen && s.onOpen(), s.duration > 0 && (f = setTimeout(() => {
228
- y();
229
- }, s.duration));
230
- }), l(() => {
231
- f && clearTimeout(f);
232
- }), (e, s) => (d(), r("div", {
233
- id: o.id,
234
- class: c(v.value)
235
- }, [
236
- o.withIcon ? (d(), r("div", {
237
- key: 0,
238
- class: c(h(p).ui3nNotificationIcon)
239
- }, [a(k, {
240
- icon: _.value.icon,
241
- size: "16",
242
- rotate: _.value.iconRotate,
243
- color: _.value.iconColor
244
- }, null, 8, [
245
- "icon",
246
- "rotate",
247
- "color"
248
- ])], 2)) : n("", !0),
249
- i("div", { class: c(h(p).ui3nNotificationContent) }, m(o.content), 3),
250
- o.duration ? n("", !0) : (d(), t(M, {
251
- key: 1,
252
- type: "icon",
253
- size: "small",
254
- color: "transparent",
255
- icon: "round-close",
256
- "icon-color": _.value.color,
257
- "icon-size": "16",
258
- class: c(h(p).closeBtn),
259
- onClick: y
260
- }, null, 8, ["icon-color", "class"]))
261
- ], 10, N));
262
- }
263
- }), [["__cssModules", { $style: {
264
- ui3nNotification: "_ui3nNotification_1iczq_1",
265
- withIcon: "_withIcon_1iczq_21",
266
- ui3nNotificationIcon: "_ui3nNotificationIcon_1iczq_25",
267
- ui3nNotificationContent: "_ui3nNotificationContent_1iczq_38",
268
- closeBtn: "_closeBtn_1iczq_47",
269
- infoType: "_infoType_1iczq_54",
270
- successType: "_successType_1iczq_64",
271
- warningType: "_warningType_1iczq_74",
272
- errorType: "_errorType_1iczq_84",
273
- leftPosition: "_leftPosition_1iczq_94",
274
- centerPosition: "_centerPosition_1iczq_99",
275
- rightPosition: "_rightPosition_1iczq_104"
276
- } }]]);
277
- //#endregion
278
- export { w as a, O as i, M as n, k as r, P as t };