@v1nt1248/3nclient-lib 0.3.48 → 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 (35) 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-autocomplete/types.d.ts +12 -0
  6. package/dist/src/components/ui3n-input/ui3n-input.d.ts +2 -2
  7. package/dist/src/components/ui3n-notification/types.d.ts +5 -0
  8. package/dist/src/components/ui3n-notification/ui3n-notification.d.ts +1 -0
  9. package/dist/src/components/ui3n-text/ui3n-text.d.ts +2 -2
  10. package/dist/src/components/ui3n-tooltip/ui3n-tooltip.d.ts +1 -1
  11. package/dist/src/constants/plugins-keys.d.ts +2 -0
  12. package/dist/src/directives/ui3n-ripple.d.ts +2 -1
  13. package/dist/src/directives/ui3n-title.d.ts +1 -1
  14. package/dist/src/plugins/index.d.ts +4 -1
  15. package/dist/src/plugins/theme/store-theme.d.ts +4 -0
  16. package/dist/src/plugins/theme/theme.d.ts +10 -0
  17. package/dist/src/plugins/theme/types.d.ts +12 -0
  18. package/dist/src/ui3n-plugins.d.ts +5 -3
  19. package/dist/src/utils/index.d.ts +1 -0
  20. package/dist/src/utils/ui/to-css-length.d.ts +1 -0
  21. package/dist/style.css +1 -1
  22. package/dist/ui3n-components.js +1239 -1199
  23. package/dist/ui3n-plugins.js +83 -34
  24. package/dist/ui3n-utils.js +4 -4
  25. package/dist/variables.css +5 -91
  26. package/package.json +1 -1
  27. package/src/components/ui3n-autocomplete/types.ts +12 -0
  28. package/src/components/ui3n-autocomplete/ui3n-autocomplete.vue +49 -7
  29. package/src/components/ui3n-checkbox/ui3n-checkbox.vue +6 -9
  30. package/src/components/ui3n-notification/types.ts +5 -0
  31. package/src/components/ui3n-notification/ui3n-notification.vue +38 -16
  32. package/src/components/ui3n-radio-group/ui3n-radio.vue +9 -6
  33. package/src/components/ui3n-switch/ui3n-switch.vue +2 -1
  34. package/src/components/ui3n-tabs/ui3n-tabs.vue +0 -3
  35. package/dist/chunks/ui3n-notification-DPC5Ke4b.js +0 -278
@@ -0,0 +1,272 @@
1
+ import { b as e } from "./plugins-keys-DdadrIAg.js";
2
+ import { computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, mergeProps as c, normalizeClass as l, normalizeStyle as u, onBeforeUnmount as d, onMounted as f, openBlock as p, ref as m, renderSlot as h, toDisplayString as g, unref as _, useCssModule as v, watch as y, withDirectives as b, withKeys as x } from "vue";
3
+ //#region src/directives/ui3n-ripple.ts
4
+ var S = /* @__PURE__ */ new WeakMap();
5
+ function C(e, t, n) {
6
+ let r = document.createElement("div"), i = Math.max(e.clientWidth, e.clientHeight), a = i / 2;
7
+ r.style.width = r.style.height = `${i}px`, r.style.left = `${Math.round(e.clientWidth / 2 - a)}px`, r.style.top = `${Math.round(e.clientHeight / 2 - a)}px`, r.classList.add("ui3n-ripple"), t && r.style.setProperty("--ui3n-ripple-bg-color", t), n && r.style.setProperty("--ui3n-ripple-duration", `${n}ms`);
8
+ let o = e.getElementsByClassName("ui3n-ripple")[0];
9
+ o && o.remove(), e.appendChild(r);
10
+ }
11
+ function w(e, t) {
12
+ S.get(e)?.controller.abort();
13
+ let { color: n, duration: r, eventsTriggers: i = [], disabled: a = !1 } = t.value || {};
14
+ if (a) {
15
+ S.delete(e);
16
+ return;
17
+ }
18
+ let o = new AbortController(), s = { signal: o.signal };
19
+ (!i.length || i.includes("click")) && e.addEventListener("click", () => C(e, n, r), s), i.length && i.includes("enter") && e.addEventListener("keydown", (t) => {
20
+ t.key === "Enter" && C(e, n, r);
21
+ }, s), S.set(e, { controller: o });
22
+ }
23
+ var T = {
24
+ mounted(e, t) {
25
+ w(e, t);
26
+ },
27
+ updated(e, t) {
28
+ w(e, t);
29
+ },
30
+ beforeUnmount(e) {
31
+ S.get(e)?.controller.abort(), S.delete(e);
32
+ }
33
+ }, E = ["id", "title"], D = /* @__PURE__ */ s({
34
+ __name: "ui3n-icon",
35
+ props: {
36
+ id: {},
37
+ icon: {},
38
+ title: { default: "" },
39
+ size: {},
40
+ width: {},
41
+ height: {},
42
+ color: { default: "var(--color-icon-control-primary-default)" },
43
+ horizontalFlip: { type: Boolean },
44
+ verticalFlip: { type: Boolean },
45
+ rotate: { default: 0 }
46
+ },
47
+ emits: ["click"],
48
+ setup(e, { emit: n }) {
49
+ let r = e, a = n, o = t(() => r.size || r.width || 16), s = t(() => r.size || r.height || 16), l = t(() => {
50
+ let e = {
51
+ "--ui3n-icon-width": u(o.value),
52
+ "--ui3n-icon-height": u(s.value),
53
+ "--ui3n-icon-color": r.color
54
+ }, t = [];
55
+ return r.horizontalFlip && t.push("rotateY(180deg)"), r.verticalFlip && t.push("rotateX(180deg)"), r.rotate && t.push(`rotate(${r.rotate}deg)`), t.length && (e.transform = t.join(" ")), e;
56
+ });
57
+ function u(e) {
58
+ return isNaN(Number(e)) ? String(e) : `${e}px`;
59
+ }
60
+ return (t, n) => (p(), i("div", c({
61
+ id: e.id,
62
+ class: t.$style.ui3nIcon,
63
+ title: e.title,
64
+ style: l.value
65
+ }, { "data-icon": e.icon }, { onClick: n[0] ||= (e) => a("click", e) }), null, 16, E));
66
+ }
67
+ }), O = { ui3nIcon: "_ui3nIcon_10yhz_1" }, k = (e, t) => {
68
+ let n = e.__vccOpts || e;
69
+ for (let [e, r] of t) n[e] = r;
70
+ return n;
71
+ }, A = /* @__PURE__ */ k(D, [["__cssModules", { $style: O }]]), j = {
72
+ small: 12,
73
+ regular: 16,
74
+ large: 24
75
+ }, M = ["id", "disabled"], N = /* @__PURE__ */ k(/* @__PURE__ */ s({
76
+ __name: "ui3n-button",
77
+ props: {
78
+ id: {},
79
+ type: { default: "primary" },
80
+ size: { default: "regular" },
81
+ square: { type: Boolean },
82
+ block: { type: Boolean },
83
+ textColor: {},
84
+ color: {},
85
+ elevation: { type: Boolean },
86
+ icon: {},
87
+ iconSize: {},
88
+ iconColor: {},
89
+ iconPosition: { default: "right" },
90
+ disabled: {
91
+ type: Boolean,
92
+ default: !1
93
+ }
94
+ },
95
+ emits: [
96
+ "init",
97
+ "click",
98
+ "enter",
99
+ "focus",
100
+ "blur"
101
+ ],
102
+ setup(e, { emit: a }) {
103
+ let o = T, s = e, c = a, u = v(), d = m(null), g = t(() => {
104
+ let e = [
105
+ u.ui3nButton,
106
+ u[s.size],
107
+ u[s.type]
108
+ ];
109
+ return s.block && s.type !== "icon" && e.push(u.block), s.square && e.push(u.square), s.icon && e.push(u[`withIcon-${s.iconPosition}`]), s.elevation && e.push(u.elevation), e;
110
+ }), S = t(() => s.iconSize ? s.iconSize : j[s.size]), C = t(() => s.iconColor ? s.iconColor : "inherit");
111
+ async function w(e, t) {
112
+ ["init", "enter"].includes(e) ? c(e, d.value) : c(e, t);
113
+ }
114
+ return y([() => s.color, () => s.textColor], (e, t) => {
115
+ if (!d.value) return;
116
+ let [n, r] = t, [i, a] = e;
117
+ (s.type === "custom" || s.type === "icon") && i !== n && d.value.style.setProperty("--ui3n-button-bg-color", i ?? "var(--color-bg-button-primary-default)"), (s.type === "custom" || s.type === "icon") && a !== r && d.value.style.setProperty("--ui3n-button-text-color", a ?? "var(--color-text-button-primary-default)");
118
+ }), f(() => {
119
+ d.value && ((s.type === "custom" || s.type === "icon") && s.color && d.value.style.setProperty("--ui3n-button-bg-color", s.color), s.type === "custom" && s.textColor && d.value.style.setProperty("--ui3n-button-text-color", s.textColor), w("init"));
120
+ }), (t, a) => b((p(), i("button", {
121
+ ref_key: "buttonEl",
122
+ ref: d,
123
+ id: e.id,
124
+ class: l(g.value),
125
+ type: "button",
126
+ disabled: e.disabled,
127
+ onClick: a[0] ||= (e) => w("click", e),
128
+ onFocusin: a[1] ||= (e) => w("focus", e),
129
+ onFocusout: a[2] ||= (e) => w("blur", e),
130
+ onKeydown: a[3] ||= x((e) => w("enter"), ["enter"])
131
+ }, [e.icon ? (p(), n(A, {
132
+ key: 0,
133
+ class: l(t.$style.buttonIcon),
134
+ icon: e.icon,
135
+ size: S.value,
136
+ color: C.value
137
+ }, null, 8, [
138
+ "class",
139
+ "icon",
140
+ "size",
141
+ "color"
142
+ ])) : r("", !0), e.type === "icon" ? r("", !0) : (p(), i("span", {
143
+ key: 1,
144
+ class: l(t.$style.text)
145
+ }, [h(t.$slots, "default")], 2))], 42, M)), [[_(o)]]);
146
+ }
147
+ }), [["__cssModules", { $style: {
148
+ ui3nButton: "_ui3nButton_5lm0q_3",
149
+ "withIcon-left": "_withIcon-left_5lm0q_35",
150
+ "withIcon-right": "_withIcon-right_5lm0q_38",
151
+ square: "_square_5lm0q_41",
152
+ regular: "_regular_5lm0q_48",
153
+ small: "_small_5lm0q_55",
154
+ large: "_large_5lm0q_62",
155
+ block: "_block_5lm0q_69",
156
+ primary: "_primary_5lm0q_73",
157
+ elevation: "_elevation_5lm0q_96",
158
+ text: "_text_5lm0q_101",
159
+ secondary: "_secondary_5lm0q_133",
160
+ tertiary: "_tertiary_5lm0q_187",
161
+ outline: "_outline_5lm0q_242",
162
+ icon: "_icon_5lm0q_270",
163
+ custom: "_custom_5lm0q_290",
164
+ buttonIcon: "_buttonIcon_5lm0q_319"
165
+ } }]]), P = ["id"], F = /* @__PURE__ */ k(/* @__PURE__ */ s({
166
+ __name: "ui3n-notification",
167
+ props: {
168
+ id: {},
169
+ type: { default: "info" },
170
+ content: {},
171
+ position: { default: "center" },
172
+ duration: { default: 0 },
173
+ withIcon: {
174
+ type: Boolean,
175
+ default: !0
176
+ },
177
+ borderRadius: { default: 8 },
178
+ onOpen: {
179
+ type: Function,
180
+ default: () => {}
181
+ },
182
+ onClose: {
183
+ type: Function,
184
+ default: () => {}
185
+ }
186
+ },
187
+ setup(s) {
188
+ let c = s, m = null, h = v(), y = t(() => ({
189
+ success: {
190
+ icon: "round-check-circle",
191
+ iconColor: "var(--success-fill-default)",
192
+ iconRotate: 0
193
+ },
194
+ warning: {
195
+ icon: "round-warning",
196
+ iconColor: "var(--warning-fill-default)",
197
+ iconRotate: 0
198
+ },
199
+ info: {
200
+ icon: "round-info",
201
+ iconColor: "var(--info-fill-default)",
202
+ iconRotate: 180
203
+ },
204
+ error: {
205
+ icon: "round-info",
206
+ iconColor: "var(--error-fill-default)",
207
+ iconRotate: 180
208
+ }
209
+ })[c.type || "info"]), b = t(() => {
210
+ let e = [
211
+ h.ui3nNotification,
212
+ h[`${c.type}Type`],
213
+ h[`${c.position}Position`]
214
+ ];
215
+ return c.withIcon && e.push(h.withIcon), e;
216
+ }), x = t(() => ({ "--ui3n-notification-border-radius": e(c.borderRadius, "8px") }));
217
+ function S() {
218
+ c.onClose && c.onClose();
219
+ }
220
+ return f(() => {
221
+ c.onOpen && c.onOpen(), c.duration > 0 && (m = setTimeout(() => {
222
+ S();
223
+ }, c.duration));
224
+ }), d(() => {
225
+ m && clearTimeout(m);
226
+ }), (e, t) => (p(), i("div", {
227
+ id: s.id,
228
+ class: l(b.value),
229
+ style: u(x.value)
230
+ }, [
231
+ s.withIcon ? (p(), i("div", {
232
+ key: 0,
233
+ class: l(_(h).ui3nNotificationIcon)
234
+ }, [o(A, {
235
+ icon: y.value.icon,
236
+ size: "16",
237
+ rotate: y.value.iconRotate,
238
+ color: y.value.iconColor
239
+ }, null, 8, [
240
+ "icon",
241
+ "rotate",
242
+ "color"
243
+ ])], 2)) : r("", !0),
244
+ a("div", { class: l(_(h).ui3nNotificationContent) }, g(s.content), 3),
245
+ s.duration ? r("", !0) : (p(), n(N, {
246
+ key: 1,
247
+ type: "icon",
248
+ size: "small",
249
+ color: "transparent",
250
+ icon: "round-close",
251
+ "icon-size": "16",
252
+ class: l(_(h).closeBtn),
253
+ onClick: S
254
+ }, null, 8, ["class"]))
255
+ ], 14, P));
256
+ }
257
+ }), [["__cssModules", { $style: {
258
+ ui3nNotification: "_ui3nNotification_1pr9s_1",
259
+ withIcon: "_withIcon_1pr9s_23",
260
+ ui3nNotificationIcon: "_ui3nNotificationIcon_1pr9s_27",
261
+ ui3nNotificationContent: "_ui3nNotificationContent_1pr9s_40",
262
+ closeBtn: "_closeBtn_1pr9s_50",
263
+ infoType: "_infoType_1pr9s_58",
264
+ successType: "_successType_1pr9s_69",
265
+ warningType: "_warningType_1pr9s_80",
266
+ errorType: "_errorType_1pr9s_91",
267
+ leftPosition: "_leftPosition_1pr9s_102",
268
+ centerPosition: "_centerPosition_1pr9s_107",
269
+ rightPosition: "_rightPosition_1pr9s_112"
270
+ } }]]);
271
+ //#endregion
272
+ export { T as a, k as i, N as n, A as r, F as t };
package/dist/mixins.scss CHANGED
@@ -31,29 +31,6 @@
31
31
  box-shadow: 0 0 2px 0 var(--shadow-key-1), 0 2px 5px 0 var(--shadow-key-2);
32
32
  }
33
33
 
34
- @mixin ripple($color) {
35
- @if & {
36
- background-position: center;
37
- transition: background 0.35s ease-in-out;
38
-
39
- &:not([disabled]) {
40
- cursor: pointer;
41
-
42
- &:hover {
43
- background: $color radial-gradient(circle, transparent 1%, $color 1%) center/15000%;
44
- }
45
-
46
- &:active {
47
- opacity: 1;
48
- background-color: var(--grey-20);
49
- background-size: 100%;
50
- transition: background 0s;
51
- }
52
- }
53
- }
54
- }
55
-
56
-
57
34
  /* stylelint-disable nesting-selector-no-missing-scoping-root */
58
35
  @mixin scrollbar($size: 100px) {
59
36
  @supports (-moz-appearance: none) {
@@ -45,6 +45,18 @@ export interface Ui3nAutocompleteProps<T extends Ui3nAutocompleteOptionBase> {
45
45
  * @default false
46
46
  */
47
47
  disabled?: boolean;
48
+ /**
49
+ * Whether an individual item cannot be picked.
50
+ *
51
+ * A disabled item is still listed, greyed out and inert to both the pointer
52
+ * and the keyboard. Use it when leaving the item out would be worse than
53
+ * showing it: an absence explains nothing, while a disabled row - with a
54
+ * reason rendered through the `item` slot - does.
55
+ *
56
+ * A predicate rather than a flag on the item itself, so that a caller can
57
+ * answer from state of its own without copying or mutating its data.
58
+ */
59
+ itemDisabled?: (item: T) => boolean;
48
60
  /**
49
61
  * Filter keys
50
62
  */
@@ -22,10 +22,10 @@ declare const __VLS_component: import('vue').DefineComponent<Ui3nInputProps, {
22
22
  shiftKey: boolean;
23
23
  metaKey: boolean;
24
24
  }) => any;
25
- keydown: (value: KeyboardEvent) => any;
26
25
  blur: (value: Event) => any;
27
26
  change: (value: string) => any;
28
27
  focus: (value: Event) => any;
28
+ keydown: (value: KeyboardEvent) => any;
29
29
  init: (value: HTMLInputElement) => any;
30
30
  "update:modelValue": (value: string) => any;
31
31
  clear: () => any;
@@ -40,10 +40,10 @@ declare const __VLS_component: import('vue').DefineComponent<Ui3nInputProps, {
40
40
  shiftKey: boolean;
41
41
  metaKey: boolean;
42
42
  }) => any) | undefined;
43
- onKeydown?: ((value: KeyboardEvent) => any) | undefined;
44
43
  onBlur?: ((value: Event) => any) | undefined;
45
44
  onChange?: ((value: string) => any) | undefined;
46
45
  onFocus?: ((value: Event) => any) | undefined;
46
+ onKeydown?: ((value: KeyboardEvent) => any) | undefined;
47
47
  onInit?: ((value: HTMLInputElement) => any) | undefined;
48
48
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
49
49
  onClear?: (() => any) | undefined;
@@ -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
  */
@@ -6,5 +6,6 @@ declare const _default: import('vue').DefineComponent<Ui3nNotificationProps, {},
6
6
  withIcon: boolean;
7
7
  onOpen: () => void;
8
8
  position: "left" | "center" | "right";
9
+ borderRadius: number | string;
9
10
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
10
11
  export default _default;
@@ -10,10 +10,10 @@ declare const _default: import('vue').DefineComponent<Ui3nTextProps, {
10
10
  shiftKey: boolean;
11
11
  metaKey: boolean;
12
12
  }) => any;
13
- keydown: (value: KeyboardEvent) => any;
14
13
  blur: (value: Event) => any;
15
14
  change: (value: string) => any;
16
15
  focus: (value: Event) => any;
16
+ keydown: (value: KeyboardEvent) => any;
17
17
  init: (value: HTMLTextAreaElement) => any;
18
18
  "update:modelValue": (value: string) => any;
19
19
  escape: (value: Event) => any;
@@ -27,10 +27,10 @@ declare const _default: import('vue').DefineComponent<Ui3nTextProps, {
27
27
  shiftKey: boolean;
28
28
  metaKey: boolean;
29
29
  }) => any) | undefined;
30
- onKeydown?: ((value: KeyboardEvent) => any) | undefined;
31
30
  onBlur?: ((value: Event) => any) | undefined;
32
31
  onChange?: ((value: string) => any) | undefined;
33
32
  onFocus?: ((value: Event) => any) | undefined;
33
+ onKeydown?: ((value: KeyboardEvent) => any) | undefined;
34
34
  onInit?: ((value: HTMLTextAreaElement) => any) | undefined;
35
35
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
36
36
  onEscape?: ((value: Event) => any) | undefined;
@@ -25,9 +25,9 @@ declare const __VLS_component: import('vue').DefineComponent<Ui3nTooltipProps, {
25
25
  }>, {
26
26
  color: string;
27
27
  disabled: boolean;
28
- textColor: string;
29
28
  offsetX: string | number;
30
29
  offsetY: string | number;
30
+ textColor: string;
31
31
  positionStrategy: "absolute" | "fixed";
32
32
  placement: import('./types').Ui3nTooltipPlacement;
33
33
  maxContentWidth: number | string;
@@ -2,6 +2,8 @@ import { InjectionKey } from 'vue';
2
2
  import { DialogsPlugin } from '../plugins/dialogs/types';
3
3
  import { NotificationsPlugin } from '../plugins/notifications/types';
4
4
  import { VueBusPlugin } from '../plugins/vue-bus/types';
5
+ import { ThemePlugin } from '../plugins/theme/types';
5
6
  export declare const DIALOGS_KEY: InjectionKey<DialogsPlugin>;
6
7
  export declare const NOTIFICATIONS_KEY: InjectionKey<NotificationsPlugin>;
7
8
  export declare const VUEBUS_KEY: InjectionKey<VueBusPlugin<any>>;
9
+ export declare const THEME_KEY: InjectionKey<ThemePlugin>;
@@ -8,6 +8,7 @@ export interface Ui3nRippleDirectiveProps {
8
8
  export type Ui3nRippleDirectiveBinding = DirectiveBinding<Ui3nRippleDirectiveProps>;
9
9
  declare const _default: {
10
10
  mounted(el: HTMLElement, binding: Ui3nRippleDirectiveBinding): void;
11
- beforeUnmount(): void;
11
+ updated(el: HTMLElement, binding: Ui3nRippleDirectiveBinding): void;
12
+ beforeUnmount(el: HTMLElement): void;
12
13
  };
13
14
  export default _default;
@@ -17,6 +17,6 @@ export type Ui3nTitleDirectiveBinding = DirectiveBinding<Ui3nTitleDirectiveProps
17
17
  declare const _default: {
18
18
  mounted(el: HTMLElement, binding: Ui3nTitleDirectiveBinding): void;
19
19
  updated(el: HTMLElement, binding: Ui3nTitleDirectiveBinding): void;
20
- beforeUnmount(el: HTMLElement, binding: Ui3nTitleDirectiveBinding): void;
20
+ beforeUnmount(el: HTMLElement): void;
21
21
  };
22
22
  export default _default;
@@ -7,4 +7,7 @@ import { DialogsPlugin, DialogOptions } from './dialogs/types';
7
7
  import { storeNotifications } from './notifications/store-notifications';
8
8
  import { storeVueBus } from './vue-bus/store-vue-bus';
9
9
  import { storeDialogs } from './dialogs/store-dialog';
10
- export { notifications, NotificationsPlugin, vueBus, VueBusPlugin, dialogs, DialogsPlugin, DialogOptions, storeNotifications, storeVueBus, storeDialogs, };
10
+ import { theme } from './theme/theme';
11
+ import { storeTheme } from './theme/store-theme';
12
+ import { ThemePlugin, ThemePluginOptions, ThemeId } from './theme/types';
13
+ export { notifications, NotificationsPlugin, vueBus, VueBusPlugin, dialogs, DialogsPlugin, DialogOptions, theme, ThemePlugin, ThemePluginOptions, ThemeId, storeNotifications, storeVueBus, storeDialogs, storeTheme, };
@@ -0,0 +1,4 @@
1
+ import { ThemePlugin } from './types';
2
+ export declare function storeTheme(context: any): {
3
+ $theme: ThemePlugin;
4
+ };
@@ -0,0 +1,10 @@
1
+ import { App } from 'vue';
2
+ import { ThemePlugin, ThemePluginOptions } from './types';
3
+ export declare const theme: {
4
+ install(app: App, options?: ThemePluginOptions): void;
5
+ };
6
+ declare module '@vue/runtime-core' {
7
+ interface ComponentCustomProperties {
8
+ $theme: ThemePlugin;
9
+ }
10
+ }
@@ -0,0 +1,12 @@
1
+ import { Ref } from 'vue';
2
+ export type ThemeId = 'light' | 'dark' | 'midnight';
3
+ export interface ThemePluginOptions {
4
+ theme?: ThemeId;
5
+ persist?: boolean;
6
+ storageKey?: string;
7
+ target?: HTMLElement;
8
+ }
9
+ export interface ThemePlugin {
10
+ theme: Ref<ThemeId>;
11
+ setTheme: (id: ThemeId) => void;
12
+ }
@@ -2,9 +2,9 @@ import { Component, Ref } from 'vue';
2
2
  import { ExtractComponentProps } from './types';
3
3
  import { Ui3nNotificationProps } from './components/ui3n-notification/types';
4
4
  import { Ui3nDialogEvent } from './components/ui3n-dialog/types';
5
- import { notifications, storeNotifications, NotificationsPlugin, dialogs, storeDialogs, DialogOptions, DialogsPlugin, vueBus, storeVueBus, VueBusPlugin } from './plugins';
5
+ import { notifications, storeNotifications, NotificationsPlugin, dialogs, storeDialogs, DialogOptions, DialogsPlugin, vueBus, storeVueBus, VueBusPlugin, theme, storeTheme, ThemePlugin, ThemePluginOptions, ThemeId } from './plugins';
6
6
  import { CbFunction, VueEventBus } from './plugins/vue-bus/types';
7
- import { NOTIFICATIONS_KEY, DIALOGS_KEY, VUEBUS_KEY } from './constants';
7
+ import { NOTIFICATIONS_KEY, DIALOGS_KEY, VUEBUS_KEY, THEME_KEY } from './constants';
8
8
  declare module 'vue' {
9
9
  interface ComponentCustomProperties {
10
10
  $openDialog: <V>(component: Component, props: ExtractComponentProps<Component>) => Promise<{
@@ -19,12 +19,14 @@ declare module 'vue' {
19
19
  dialogStack: Ref<DialogOptions<any>[]>;
20
20
  $createNotice: (params: Ui3nNotificationProps) => void;
21
21
  $emitter: VueEventBus<any>;
22
+ $theme: ThemePlugin;
22
23
  }
23
24
  }
24
25
  declare module 'pinia' {
25
26
  interface PiniaCustomProperties {
26
27
  $createNotice: (params: Ui3nNotificationProps) => void;
27
28
  $emitter: VueEventBus<any>;
29
+ $theme: ThemePlugin;
28
30
  $dialogs: {
29
31
  open: <V>(component: Component, props: ExtractComponentProps<Component>) => Promise<{
30
32
  event: Ui3nDialogEvent;
@@ -39,4 +41,4 @@ declare module 'pinia' {
39
41
  };
40
42
  }
41
43
  }
42
- export { notifications, storeNotifications, NOTIFICATIONS_KEY, NotificationsPlugin, dialogs, storeDialogs, DIALOGS_KEY, DialogsPlugin, DialogOptions, vueBus, storeVueBus, VUEBUS_KEY, CbFunction, VueBusPlugin, VueEventBus, };
44
+ export { notifications, storeNotifications, NOTIFICATIONS_KEY, NotificationsPlugin, dialogs, storeDialogs, DIALOGS_KEY, DialogsPlugin, DialogOptions, vueBus, storeVueBus, VUEBUS_KEY, CbFunction, VueBusPlugin, VueEventBus, theme, storeTheme, ThemePlugin, ThemePluginOptions, ThemeId, THEME_KEY, };
@@ -20,6 +20,7 @@ export * from './ui/invert-color';
20
20
  export * from './ui/html2text';
21
21
  export * from './ui/prepare-date-as-string';
22
22
  export * from './ui/capitalize';
23
+ export * from './ui/to-css-length';
23
24
  export * from './files/format-file-size';
24
25
  export * from './files/get-file-extension';
25
26
  export * from './files/is-file-image';
@@ -0,0 +1 @@
1
+ export declare function toCssLength(size: number | string, fallback?: string): string;