@nmorph/nmorph-ui-kit 2.2.49 → 2.2.51

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 (24) hide show
  1. package/dist/assets/icons/full-screen.svg.js +6 -6
  2. package/dist/components/data/nmorph-audio-preview/NmorphAudioPreview.css +1 -1
  3. package/dist/components/data/nmorph-audio-preview/NmorphAudioPreview.vue.js +84 -78
  4. package/dist/components/data/nmorph-file-card/NmorphFileCard.css +1 -1
  5. package/dist/components/data/nmorph-file-card/NmorphFileCard.vue.js +108 -81
  6. package/dist/components/data/nmorph-tag-list/components/nmorph-tag-item/NmorphTagItem.vue.js +57 -54
  7. package/dist/components/data/nmorph-video-preview/NmorphVideoPreview.css +1 -1
  8. package/dist/components/data/nmorph-video-preview/NmorphVideoPreview.vue.js +230 -133
  9. package/dist/components/providers/nmorph-notification-provider/NmorphNotificationProvider.vue.js +92 -67
  10. package/dist/index.umd.js +24 -24
  11. package/dist/package.json.js +1 -1
  12. package/dist/src/components/data/nmorph-file-card/types.d.ts +1 -1
  13. package/dist/src/components/data/nmorph-media-tile/NmorphMediaTile.vue.d.ts +3 -3
  14. package/dist/src/components/data/nmorph-video-preview/NmorphVideoPreview.vue.d.ts +11 -3
  15. package/dist/src/components/data/nmorph-video-preview/types.d.ts +6 -0
  16. package/dist/src/components/feedback/nmorph-alert/NmorphAlert.vue.d.ts +1 -1
  17. package/dist/src/components/feedback/nmorph-tooltip/NmorphTooltip.vue.d.ts +3 -3
  18. package/dist/src/components/form/nmorph-file-upload/NmorphFileUpload.vue.d.ts +2 -2
  19. package/dist/src/components/form/nmorph-select/NmorphSelect.vue.d.ts +1 -1
  20. package/dist/src/components/form/nmorph-slider/NmorphSlider.vue.d.ts +9 -9
  21. package/dist/src/components/providers/nmorph-notification-provider/types.d.ts +1 -0
  22. package/dist/src/outside-hooks/use-nmorph-notification.d.ts +2 -0
  23. package/dist/style.css +1 -1
  24. package/package.json +1 -1
@@ -1,34 +1,36 @@
1
1
  import './NmorphFileCard.css';
2
- import { defineComponent as z, useSlots as F, computed as a, openBlock as r, createElementBlock as t, normalizeClass as P, createElementVNode as g, createBlock as f, unref as n, withCtx as m, createVNode as i, resolveDynamicComponent as R, createCommentVNode as l, toDisplayString as h, renderSlot as V } from "vue";
3
- import { useModifiers as O } from "../../../utils/create-modifiers.js";
4
- import { getFileExtension as W, getPlainFileType as K, getTypeCandidates as j, isKnownFileType as d } from "../../../utils/file-types.js";
5
- import { NmorphImageResolution as G, NmorphAudioResolution as q, NmorphVideoResolution as J, NmorphArchiveResolution as Q, NmorphDocResolution as U } from "../../form/nmorph-file-upload/types.js";
6
- import X from "../nmorph-audio-preview/NmorphAudioPreview.vue.js";
2
+ import { defineComponent as V, useSlots as W, computed as a, openBlock as r, createElementBlock as n, normalizeClass as K, createElementVNode as f, createVNode as t, unref as i, withCtx as c, createBlock as b, resolveDynamicComponent as j, createCommentVNode as l, toDisplayString as h, renderSlot as G } from "vue";
3
+ import { useModifiers as U } from "../../../utils/create-modifiers.js";
4
+ import { getFileExtension as q, getPlainFileType as J, getTypeCandidates as Q, isKnownFileType as m } from "../../../utils/file-types.js";
5
+ import { NmorphImageResolution as X, NmorphAudioResolution as Y, NmorphVideoResolution as Z, NmorphArchiveResolution as ee, NmorphDocResolution as oe } from "../../form/nmorph-file-upload/types.js";
6
+ import ae from "../nmorph-audio-preview/NmorphAudioPreview.vue.js";
7
7
  /* empty css */
8
- import Y from "../../../assets/icons/image.svg.js";
9
- import Z from "../../../assets/icons/video.svg.js";
10
- import ee from "../../../assets/icons/archive.svg.js";
11
- import C from "../../../assets/icons/doc.svg.js";
12
- import p from "../../basic/nmorph-icon/NmorphIcon.vue.js";
8
+ import re from "../nmorph-video-preview/NmorphVideoPreview.vue.js";
9
+ /* empty css */
10
+ import ne from "../../../assets/icons/image.svg.js";
11
+ import te from "../../../assets/icons/archive.svg.js";
12
+ import A from "../../../assets/icons/doc.svg.js";
13
+ import d from "../../basic/nmorph-icon/NmorphIcon.vue.js";
13
14
  /* empty css */
14
- import oe from "../../../assets/icons/eye.svg.js";
15
- import re from "../../../assets/icons/audio.svg.js";
16
- import ae from "../../../assets/icons/loading.svg.js";
17
- import ne from "../../../assets/icons/open.svg.js";
18
- import te from "../../../assets/icons/download.svg.js";
19
- const ie = { class: "nmorph-file-card__icon" }, le = ["href", "aria-label"], se = { class: "nmorph-file-card__body" }, ce = { class: "nmorph-file-card__name" }, me = {
15
+ import ie from "../../../assets/icons/audio.svg.js";
16
+ import le from "../../../assets/icons/video.svg.js";
17
+ import se from "../../../assets/icons/eye.svg.js";
18
+ import ce from "../../../assets/icons/loading.svg.js";
19
+ import me from "../../../assets/icons/open.svg.js";
20
+ import de from "../../../assets/icons/download.svg.js";
21
+ const pe = { class: "nmorph-file-card__icon" }, ue = ["href", "aria-label"], fe = { class: "nmorph-file-card__body" }, he = { class: "nmorph-file-card__info" }, ve = { class: "nmorph-file-card__name" }, _e = {
20
22
  key: 0,
21
23
  class: "nmorph-file-card__error"
22
- }, de = {
24
+ }, we = {
23
25
  key: 1,
24
26
  class: "nmorph-file-card__meta"
25
- }, pe = {
27
+ }, ye = {
26
28
  key: 0,
27
29
  class: "nmorph-file-card__badge"
28
- }, ue = {
30
+ }, ge = {
29
31
  key: 1,
30
32
  class: "nmorph-file-card__actions"
31
- }, fe = ["href", "aria-label"], he = ["href", "download", "aria-label"], Ee = /* @__PURE__ */ z({
33
+ }, Ne = ["aria-label"], Be = ["href", "aria-label"], be = ["href", "download", "aria-label"], ke = "var(--nmorph-contrast-text-color)", Ke = /* @__PURE__ */ V({
32
34
  __name: "NmorphFileCard",
33
35
  props: {
34
36
  name: {},
@@ -48,69 +50,68 @@ const ie = { class: "nmorph-file-card__icon" }, le = ["href", "aria-label"], se
48
50
  showDefaultActions: { type: Boolean, default: !0 }
49
51
  },
50
52
  emits: ["open", "download", "error"],
51
- setup(S, { emit: T }) {
52
- const e = S, _ = T, b = F(), u = a(() => (e.extension || W(e.name) || K(e.mimeType)).toLowerCase()), s = a(() => j(e.mimeType, e.name)), x = a(() => e.mimeType.toLowerCase().startsWith("image/") || s.value.some((o) => d(o, G)) ? Y : e.mimeType.toLowerCase().startsWith("audio/") || s.value.some((o) => d(o, q)) ? re : e.mimeType.toLowerCase().startsWith("video/") || s.value.some((o) => d(o, J)) ? Z : s.value.some((o) => d(o, Q)) ? ee : s.value.some((o) => d(o, U)) ? C : C), I = (o) => {
53
+ setup(P, { emit: H }) {
54
+ const e = P, v = H, $ = W(), p = a(() => (e.extension || q(e.name) || J(e.mimeType)).toLowerCase()), s = a(() => Q(e.mimeType, e.name)), D = a(() => e.mimeType.toLowerCase().startsWith("image/") || s.value.some((o) => m(o, X)) ? ne : e.mimeType.toLowerCase().startsWith("audio/") || s.value.some((o) => m(o, Y)) ? ie : e.mimeType.toLowerCase().startsWith("video/") || s.value.some((o) => m(o, Z)) ? le : s.value.some((o) => m(o, ee)) ? te : s.value.some((o) => m(o, oe)) ? A : A), E = (o) => {
53
55
  if (o === void 0 || Number.isNaN(o) || o < 0) return "";
54
56
  if (o === 0) return "0 B";
55
- const w = ["B", "KB", "MB", "GB", "TB"], y = Math.min(Math.floor(Math.log(o) / Math.log(1024)), w.length - 1), k = o / 1024 ** y, M = k >= 10 || y === 0 ? 0 : 1;
56
- return `${k.toFixed(M)} ${w[y]}`;
57
- }, A = a(() => I(e.size)), D = a(() => u.value || e.mimeType), B = a(() => [D.value, A.value].filter(Boolean).join(" · ")), c = a(() => e.mediaPreview === "audio" && !!e.previewSrc && !e.loading && !e.error), v = a(() => e.showDefaultActions && !!e.previewSrc && !c.value && (e.mimeType.toLowerCase() === "application/pdf" || u.value === "pdf")), $ = a(
58
- () => !!b.actions || e.showDefaultActions && (e.previewSrc && !c.value && !v.value || e.downloadHref)
59
- ), E = a(
60
- () => O({
57
+ const g = ["B", "KB", "MB", "GB", "TB"], N = Math.min(Math.floor(Math.log(o) / Math.log(1024)), g.length - 1), B = o / 1024 ** N, F = B >= 10 || N === 0 || Number.isInteger(B) ? 0 : 1;
58
+ return `${B.toFixed(F)} ${g[N]}`;
59
+ }, L = a(() => E(e.size)), O = a(() => p.value || e.mimeType), k = a(() => [O.value, L.value].filter(Boolean).join(" · ")), _ = a(() => e.mediaPreview === "audio" && !!e.previewSrc && !e.loading && !e.error), w = a(() => e.mediaPreview === "video" && !!e.previewSrc && !e.loading && !e.error), u = a(() => _.value || w.value), R = a(() => e.compact ? "96px" : "120px"), C = a(() => e.mimeType.toLowerCase() === "application/pdf" || p.value === "pdf"), S = a(() => C.value ? e.previewSrc || e.downloadHref : ""), y = a(
60
+ () => e.showDefaultActions && !!S.value && !u.value && C.value
61
+ ), T = a(
62
+ () => !!$.actions || e.showDefaultActions && (e.loading || e.previewSrc && !u.value && !y.value || e.downloadHref)
63
+ ), M = a(
64
+ () => U({
61
65
  "nmorph-file-card": [
62
66
  e.surface,
63
67
  e.compact && "compact",
64
68
  e.loading && "loading",
65
69
  e.error && "error",
66
- c.value && "media-audio",
67
- !e.iconSurface && "icon-plain"
70
+ u.value && "media",
71
+ _.value && "media-audio",
72
+ w.value && "media-video",
73
+ !e.iconSurface && "icon-plain",
74
+ !T.value && "no-actions"
68
75
  ]
69
76
  })
70
- ), N = () => _("open"), H = () => _("download"), L = () => _("error");
71
- return (o, w) => (r(), t("div", {
72
- class: P(E.value)
77
+ ), x = () => v("open"), z = () => v("download"), I = () => v("error");
78
+ return (o, g) => (r(), n("div", {
79
+ class: K(M.value)
73
80
  }, [
74
- g("div", ie, [
75
- e.loading ? (r(), f(n(p), {
76
- key: 0,
77
- size: "medium"
78
- }, {
79
- default: m(() => [
80
- i(n(ae))
81
- ]),
82
- _: 1
83
- })) : (r(), f(n(p), {
84
- key: 1,
85
- size: "medium"
86
- }, {
87
- default: m(() => [
88
- (r(), f(R(x.value)))
81
+ f("div", pe, [
82
+ t(i(d), { size: "medium" }, {
83
+ default: c(() => [
84
+ (r(), b(j(D.value)))
89
85
  ]),
90
86
  _: 1
91
- })),
92
- v.value && !e.loading && !e.error ? (r(), t("a", {
93
- key: 2,
94
- href: e.previewSrc,
87
+ }),
88
+ y.value && !e.loading && !e.error ? (r(), n("a", {
89
+ key: 0,
90
+ href: S.value,
95
91
  target: "_blank",
96
92
  rel: "noopener noreferrer",
97
93
  class: "nmorph-file-card__icon-action",
98
94
  "aria-label": `Preview ${e.name}`,
99
- onClick: N
95
+ onClick: x
100
96
  }, [
101
- i(n(p), { size: "small" }, {
102
- default: m(() => [
103
- i(n(oe))
97
+ t(i(d), {
98
+ size: "small",
99
+ color: ke
100
+ }, {
101
+ default: c(() => [
102
+ t(i(se))
104
103
  ]),
105
104
  _: 1
106
105
  })
107
- ], 8, le)) : l("", !0)
106
+ ], 8, ue)) : l("", !0)
108
107
  ]),
109
- g("div", se, [
110
- g("span", ce, h(e.name), 1),
111
- e.error && e.errorText ? (r(), t("span", me, h(e.errorText), 1)) : B.value ? (r(), t("span", de, h(B.value), 1)) : l("", !0),
112
- c.value ? (r(), f(X, {
113
- key: 2,
108
+ f("div", fe, [
109
+ f("div", he, [
110
+ f("span", ve, h(e.name), 1),
111
+ e.error && e.errorText ? (r(), n("span", _e, h(e.errorText), 1)) : k.value ? (r(), n("span", we, h(k.value), 1)) : l("", !0)
112
+ ]),
113
+ _.value ? (r(), b(ae, {
114
+ key: 0,
114
115
  class: "nmorph-file-card__audio-preview",
115
116
  src: e.previewSrc,
116
117
  name: e.name,
@@ -120,48 +121,74 @@ const ie = { class: "nmorph-file-card__icon" }, le = ["href", "aria-label"], se
120
121
  "show-icon": !1,
121
122
  "show-header": !1,
122
123
  "show-default-actions": !1,
123
- onError: L
124
- }, null, 8, ["src", "name"])) : l("", !0)
124
+ onError: I
125
+ }, null, 8, ["src", "name"])) : l("", !0),
126
+ w.value ? (r(), b(re, {
127
+ key: 1,
128
+ class: "nmorph-file-card__video-preview",
129
+ src: e.previewSrc,
130
+ name: e.name,
131
+ height: R.value,
132
+ surface: "plain",
133
+ embedded: "",
134
+ compact: "",
135
+ controls: !1,
136
+ "show-meta": !1,
137
+ "show-default-actions": !1,
138
+ onError: I
139
+ }, null, 8, ["src", "name", "height"])) : l("", !0)
125
140
  ]),
126
- e.showExtensionBadge && u.value ? (r(), t("span", pe, h(u.value), 1)) : l("", !0),
127
- $.value ? (r(), t("div", ue, [
128
- V(o.$slots, "actions", {}, () => [
129
- e.previewSrc && !c.value && !v.value ? (r(), t("a", {
141
+ e.showExtensionBadge && p.value ? (r(), n("span", ye, h(p.value), 1)) : l("", !0),
142
+ T.value ? (r(), n("div", ge, [
143
+ G(o.$slots, "actions", {}, () => [
144
+ e.loading ? (r(), n("span", {
130
145
  key: 0,
146
+ class: "nmorph-file-card__action-loader",
147
+ role: "status",
148
+ "aria-label": `Uploading ${e.name}`
149
+ }, [
150
+ t(i(d), { size: "small" }, {
151
+ default: c(() => [
152
+ t(i(ce))
153
+ ]),
154
+ _: 1
155
+ })
156
+ ], 8, Ne)) : e.previewSrc && !u.value && !y.value ? (r(), n("a", {
157
+ key: 1,
131
158
  href: e.previewSrc,
132
159
  target: "_blank",
133
160
  rel: "noopener noreferrer",
134
161
  class: "nmorph-file-card__action-link",
135
162
  "aria-label": `Open ${e.name}`,
136
- onClick: N
163
+ onClick: x
137
164
  }, [
138
- i(n(p), { size: "small" }, {
139
- default: m(() => [
140
- i(n(ne))
165
+ t(i(d), { size: "small" }, {
166
+ default: c(() => [
167
+ t(i(me))
141
168
  ]),
142
169
  _: 1
143
170
  })
144
- ], 8, fe)) : l("", !0),
145
- e.downloadHref ? (r(), t("a", {
146
- key: 1,
171
+ ], 8, Be)) : l("", !0),
172
+ !e.loading && e.downloadHref ? (r(), n("a", {
173
+ key: 2,
147
174
  href: e.downloadHref,
148
175
  download: e.name,
149
176
  class: "nmorph-file-card__action-link",
150
177
  "aria-label": `Download ${e.name}`,
151
- onClick: H
178
+ onClick: z
152
179
  }, [
153
- i(n(p), { size: "small" }, {
154
- default: m(() => [
155
- i(n(te))
180
+ t(i(d), { size: "small" }, {
181
+ default: c(() => [
182
+ t(i(de))
156
183
  ]),
157
184
  _: 1
158
185
  })
159
- ], 8, he)) : l("", !0)
186
+ ], 8, be)) : l("", !0)
160
187
  ])
161
188
  ])) : l("", !0)
162
189
  ], 2));
163
190
  }
164
191
  });
165
192
  export {
166
- Ee as default
193
+ Ke as default
167
194
  };
@@ -1,12 +1,12 @@
1
1
  import './NmorphTagItem.css';
2
- import { defineComponent as S, ref as v, computed as p, onMounted as $, onBeforeUnmount as x, watch as I, openBlock as d, createElementBlock as _, normalizeStyle as z, normalizeClass as H, createElementVNode as F, renderSlot as U, toDisplayString as G, createBlock as P, unref as k, withModifiers as K, withCtx as j, createVNode as Z, createCommentVNode as q, nextTick as J } from "vue";
3
- import { useModifiers as Q } from "../../../../../utils/create-modifiers.js";
4
- import { createCssVariables as W } from "../../../../../utils/common.js";
5
- import { NmorphComponentHeight as X } from "../../../../../types/common.types.js";
6
- import Y from "../../../../basic/nmorph-icon/NmorphIcon.vue.js";
2
+ import { defineComponent as I, ref as b, computed as m, onMounted as S, onBeforeUnmount as $, watch as z, openBlock as h, createElementBlock as _, normalizeStyle as H, normalizeClass as F, createElementVNode as U, renderSlot as G, toDisplayString as P, createBlock as K, unref as k, withModifiers as j, withCtx as Z, createVNode as q, createCommentVNode as J, nextTick as Q } from "vue";
3
+ import { useModifiers as W } from "../../../../../utils/create-modifiers.js";
4
+ import { createCssVariables as X } from "../../../../../utils/common.js";
5
+ import { NmorphComponentHeight as Y } from "../../../../../types/common.types.js";
6
+ import ee from "../../../../basic/nmorph-icon/NmorphIcon.vue.js";
7
7
  /* empty css */
8
- import ee from "../../../../../assets/icons/error.svg.js";
9
- const te = { class: "nmorph-tag-item__content" }, oe = { key: 1 }, re = "var(--nmorph-gray-color)", y = "var(--nmorph-black-color)", ne = "var(--nmorph-white-color)", pe = /* @__PURE__ */ S({
8
+ import te from "../../../../../assets/icons/error.svg.js";
9
+ const oe = { class: "nmorph-tag-item__content" }, re = { key: 1 }, ne = "var(--nmorph-gray-color)", y = "var(--nmorph-black-color)", le = "var(--nmorph-white-color)", de = /* @__PURE__ */ I({
10
10
  __name: "NmorphTagItem",
11
11
  props: {
12
12
  value: {},
@@ -14,25 +14,27 @@ const te = { class: "nmorph-tag-item__content" }, oe = { key: 1 }, re = "var(--n
14
14
  removable: { type: Boolean, default: !0 },
15
15
  height: { default: "basic" },
16
16
  design: { default: "nmorph" },
17
- color: { default: re }
17
+ color: { default: ne }
18
18
  },
19
19
  emits: ["click", "close"],
20
- setup(f, { emit: O }) {
21
- const N = { r: 201, g: 210, b: 222 }, s = f, i = v(null), h = v(y);
22
- let m = null;
23
- const R = p(
24
- () => Q({
25
- nmorph: [X[s.height]],
26
- "nmorph-tag-item": [s.design]
20
+ setup(g, { emit: O }) {
21
+ const N = { r: 201, g: 210, b: 222 }, l = g, i = b(null), u = b(y);
22
+ let p = null;
23
+ const R = m(
24
+ () => W({
25
+ nmorph: [Y[l.height]],
26
+ "nmorph-tag-item": [l.design]
27
27
  })
28
- ), g = p(() => s.design === "common"), w = p(() => g.value ? W({
29
- "--tag-item-background-color": s.color,
30
- "--tag-item-content-color": h.value
31
- }) : {}), C = O, V = () => {
32
- C("close", s.value);
33
- }, D = () => {
34
- C("click", s.value);
35
- }, L = (o) => {
28
+ ), d = m(() => l.design === "common"), w = m(
29
+ () => d.value ? u.value : "var(--nmorph-contrast-text-color)"
30
+ ), V = m(() => d.value ? X({
31
+ "--tag-item-background-color": l.color,
32
+ "--tag-item-content-color": u.value
33
+ }) : {}), C = O, D = () => {
34
+ C("close", l.value);
35
+ }, L = () => {
36
+ C("click", l.value);
37
+ }, T = (o) => {
36
38
  const t = o.trim().replace("#", "");
37
39
  if (![3, 4, 6, 8].includes(t.length)) return null;
38
40
  const e = t.length <= 4 ? t.split("").map((r) => `${r}${r}`).join("") : t;
@@ -41,69 +43,70 @@ const te = { class: "nmorph-tag-item__content" }, oe = { key: 1 }, re = "var(--n
41
43
  g: parseInt(e.slice(2, 4), 16),
42
44
  b: parseInt(e.slice(4, 6), 16)
43
45
  };
44
- }, T = (o) => {
46
+ }, M = (o) => {
45
47
  const t = o.match(/^rgba?\((.+)\)$/);
46
48
  if (!t) return null;
47
- const e = t[1].split("/")[0], r = e.includes(",") ? e.split(",") : e.trim().split(/\s+/), [n, a, c] = r.map((l) => Number.parseFloat(l));
48
- return [n, a, c].some((l) => Number.isNaN(l)) ? null : { r: n, g: a, b: c };
49
- }, M = (o, t) => {
49
+ const e = t[1].split("/")[0], r = e.includes(",") ? e.split(",") : e.trim().split(/\s+/), [n, a, c] = r.map((s) => Number.parseFloat(s));
50
+ return [n, a, c].some((s) => Number.isNaN(s)) ? null : { r: n, g: a, b: c };
51
+ }, x = (o, t) => {
50
52
  const e = o.trim().match(/^var\(\s*(--[A-Za-z0-9-_]+)(?:\s*,\s*(.+))?\)$/);
51
53
  if (!e) return o;
52
- const [, r, n] = e, a = t.ownerDocument, c = getComputedStyle(t).getPropertyValue(r).trim(), l = getComputedStyle(a.documentElement).getPropertyValue(r).trim();
53
- return c || l || n || o;
54
+ const [, r, n] = e, a = t.ownerDocument, c = getComputedStyle(t).getPropertyValue(r).trim(), s = getComputedStyle(a.documentElement).getPropertyValue(r).trim();
55
+ return c || s || n || o;
54
56
  }, A = (o, t) => {
55
57
  let e = o;
56
58
  for (let r = 0; r < 4; r += 1) {
57
- const n = M(e, t);
59
+ const n = x(e, t);
58
60
  if (n === e) break;
59
61
  e = n;
60
62
  }
61
- return L(e) || T(e) || N;
63
+ return T(e) || M(e) || N;
62
64
  }, B = ({ r: o, g: t, b: e }) => {
63
65
  const [r, n, a] = [o, t, e].map((c) => {
64
- const l = c / 255;
65
- return l <= 0.03928 ? l / 12.92 : ((l + 0.055) / 1.055) ** 2.4;
66
+ const s = c / 255;
67
+ return s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4;
66
68
  });
67
69
  return 0.2126 * r + 0.7152 * n + 0.0722 * a;
68
- }, b = (o, t) => {
70
+ }, v = (o, t) => {
69
71
  const [e, r] = [o, t].sort((n, a) => a - n);
70
72
  return (e + 0.05) / (r + 0.05);
71
73
  }, E = (o) => {
72
- const t = B(o), e = b(t, 1), r = b(t, 0);
73
- return e > r ? ne : y;
74
- }, u = async () => {
75
- await J(), !(!g.value || !i.value) && (h.value = E(A(s.color, i.value)));
74
+ const t = B(o), e = v(t, 1), r = v(t, 0);
75
+ return e > r ? le : y;
76
+ }, f = async () => {
77
+ await Q(), !(!d.value || !i.value) && (u.value = E(A(l.color, i.value)));
76
78
  };
77
- return $(() => {
78
- u(), !(typeof MutationObserver > "u" || !i.value) && (m = new MutationObserver(() => u()), m.observe(i.value.ownerDocument.documentElement, {
79
+ return S(() => {
80
+ f(), !(typeof MutationObserver > "u" || !i.value) && (p = new MutationObserver(() => f()), p.observe(i.value.ownerDocument.documentElement, {
79
81
  attributes: !0,
80
82
  attributeFilter: ["nmorph-data-theme", "class", "style"]
81
83
  }));
82
- }), x(() => {
83
- m?.disconnect();
84
- }), I(() => [s.color, s.design], u, { flush: "post" }), (o, t) => (d(), _("div", {
84
+ }), $(() => {
85
+ p?.disconnect();
86
+ }), z(() => [l.color, l.design], f, { flush: "post" }), (o, t) => (h(), _("div", {
85
87
  ref_key: "tagRef",
86
88
  ref: i,
87
- class: H(R.value),
88
- style: z(w.value),
89
- onClick: D
89
+ class: F(R.value),
90
+ style: H(V.value),
91
+ onClick: L
90
92
  }, [
91
- F("div", te, [
92
- o.$slots.default ? U(o.$slots, "default", { key: 0 }) : (d(), _("span", oe, G(f.text), 1)),
93
- s.removable ? (d(), P(k(Y), {
93
+ U("div", oe, [
94
+ o.$slots.default ? G(o.$slots, "default", { key: 0 }) : (h(), _("span", re, P(g.text), 1)),
95
+ l.removable ? (h(), K(k(ee), {
94
96
  key: 2,
95
97
  class: "nmorph-tag-item__close-icon",
96
- onClick: K(V, ["stop"])
98
+ color: w.value,
99
+ onClick: j(D, ["stop"])
97
100
  }, {
98
- default: j(() => [
99
- Z(k(ee))
101
+ default: Z(() => [
102
+ q(k(te))
100
103
  ]),
101
104
  _: 1
102
- })) : q("", !0)
105
+ }, 8, ["color"])) : J("", !0)
103
106
  ])
104
107
  ], 6));
105
108
  }
106
109
  });
107
110
  export {
108
- pe as default
111
+ de as default
109
112
  };
@@ -1 +1 @@
1
- .nmorph-video-preview{position:relative;display:flex;width:var(--nmorph-video-preview-width, 280px);min-width:0;max-width:100%;height:var(--nmorph-video-preview-height, 158px);overflow:hidden;color:var(--nmorph-white-color);background:color-mix(in srgb,var(--nmorph-black-color) 72%,var(--nmorph-main-color));border-radius:var(--default-border-radius);box-shadow:var(--nmorph-shadow-inset)}.nmorph-video-preview .nmorph-video-preview__media,.nmorph-video-preview .nmorph-video-preview__state{width:100%;height:100%}.nmorph-video-preview.nmorph-video-preview--soft .nmorph-video-preview__state,.nmorph-video-preview.nmorph-video-preview--plain .nmorph-video-preview__state{color:var(--nmorph-text-color)}.nmorph-video-preview .nmorph-video-preview__media{display:block;object-fit:cover}.nmorph-video-preview.nmorph-video-preview--contain .nmorph-video-preview__media{object-fit:contain}.nmorph-video-preview .nmorph-video-preview__state{display:flex;flex-direction:column;gap:var(--indentation-02);justify-content:center;align-items:center;padding:var(--indentation-03);text-align:center}.nmorph-video-preview .nmorph-video-preview__error{max-width:100%;overflow:hidden;color:var(--nmorph-error-text-color);font-size:var(--font-size-extra-small);white-space:nowrap;text-overflow:ellipsis}.nmorph-video-preview .nmorph-video-preview__meta{position:absolute;right:0;bottom:0;left:0;display:flex;gap:var(--indentation-02);justify-content:space-between;align-items:center;padding:18px var(--indentation-03) var(--indentation-02);background:linear-gradient(transparent,color-mix(in srgb,var(--nmorph-black-color) 66%,transparent));pointer-events:none}.nmorph-video-preview .nmorph-video-preview__play{position:absolute;top:50%;left:50%;z-index:1;display:inline-flex;justify-content:center;align-items:center;width:42px;height:42px;padding:0;color:var(--nmorph-text-color);background:color-mix(in srgb,var(--nmorph-main-color) 86%,transparent);border:0;border-radius:var(--border-radius-circular);box-shadow:var(--nmorph-shadow-outset);transform:translate(-50%,-50%);cursor:pointer}.nmorph-video-preview .nmorph-video-preview__play .nmorph-icon{--color: currentColor}.nmorph-video-preview .nmorph-video-preview__play:hover{color:var(--nmorph-accent-color)}.nmorph-video-preview.nmorph-video-preview--playing .nmorph-video-preview__play{opacity:.72}.nmorph-video-preview .nmorph-video-preview__name,.nmorph-video-preview .nmorph-video-preview__duration{min-width:0;overflow:hidden;font-size:var(--font-size-extra-small);line-height:var(--line-height-regular);white-space:nowrap;text-overflow:ellipsis}.nmorph-video-preview .nmorph-video-preview__name{flex:1 1 auto}.nmorph-video-preview .nmorph-video-preview__duration{flex:0 0 auto;font-variant-numeric:tabular-nums}.nmorph-video-preview .nmorph-video-preview__actions{position:absolute;top:var(--indentation-02);right:var(--indentation-02);display:flex;gap:var(--indentation-01);padding:2px;background:color-mix(in srgb,var(--nmorph-main-color) 86%,transparent);border-radius:var(--default-border-radius)}.nmorph-video-preview .nmorph-video-preview__action-link{display:inline-flex;justify-content:center;align-items:center;width:22px;height:22px;color:var(--nmorph-text-color);text-decoration:none;border-radius:var(--default-border-radius)}.nmorph-video-preview .nmorph-video-preview__action-link:hover{color:var(--nmorph-accent-color);background:color-mix(in srgb,var(--nmorph-accent-color) 10%,transparent)}.nmorph-video-preview .nmorph-video-preview__action-link .nmorph-icon{--color: currentColor}.nmorph-video-preview.nmorph-video-preview--compact{width:var(--nmorph-video-preview-width, 180px);height:var(--nmorph-video-preview-height, 102px)}.nmorph-video-preview.nmorph-video-preview--soft{background:color-mix(in srgb,var(--nmorph-accent-color) 6%,transparent);box-shadow:none}.nmorph-video-preview.nmorph-video-preview--plain{background:transparent;box-shadow:none}.nmorph-video-preview.nmorph-video-preview--error{outline:1px solid var(--nmorph-error-color)}
1
+ .nmorph-video-preview{position:relative;display:flex;width:var(--nmorph-video-preview-width, 280px);min-width:0;max-width:100%;height:var(--nmorph-video-preview-height, 158px);overflow:hidden;color:var(--nmorph-white-color);background:color-mix(in srgb,var(--nmorph-black-color) 72%,var(--nmorph-main-color));border-radius:var(--default-border-radius);box-shadow:var(--nmorph-shadow-inset)}.nmorph-video-preview .nmorph-video-preview__media,.nmorph-video-preview .nmorph-video-preview__state{width:100%;height:100%}.nmorph-video-preview.nmorph-video-preview--soft .nmorph-video-preview__state,.nmorph-video-preview.nmorph-video-preview--plain .nmorph-video-preview__state{color:var(--nmorph-text-color)}.nmorph-video-preview .nmorph-video-preview__media{display:block;object-fit:cover}.nmorph-video-preview.nmorph-video-preview--contain .nmorph-video-preview__media{object-fit:contain}.nmorph-video-preview .nmorph-video-preview__state{display:flex;flex-direction:column;gap:var(--indentation-02);justify-content:center;align-items:center;padding:var(--indentation-03);text-align:center}.nmorph-video-preview .nmorph-video-preview__error{max-width:100%;overflow:hidden;color:var(--nmorph-error-text-color);font-size:var(--font-size-extra-small);white-space:nowrap;text-overflow:ellipsis}.nmorph-video-preview .nmorph-video-preview__meta{position:absolute;right:0;bottom:0;left:0;display:flex;gap:var(--indentation-02);justify-content:space-between;align-items:center;padding:18px var(--indentation-03) var(--indentation-02);background:linear-gradient(transparent,color-mix(in srgb,var(--nmorph-black-color) 66%,transparent));pointer-events:none}.nmorph-video-preview .nmorph-video-preview__play{position:absolute;top:50%;left:50%;z-index:1;display:inline-flex;justify-content:center;align-items:center;width:42px;height:42px;padding:0;color:var(--nmorph-contrast-text-color);background:color-mix(in srgb,var(--nmorph-black-color) 58%,transparent);border:0;border-radius:var(--border-radius-circular);box-shadow:var(--nmorph-shadow-outset);transform:translate(-50%,-50%);cursor:pointer}.nmorph-video-preview .nmorph-video-preview__play .nmorph-icon{--nmorph-icon-color: var(--nmorph-contrast-text-color);--color: var(--nmorph-contrast-text-color)}.nmorph-video-preview .nmorph-video-preview__play:hover{background:color-mix(in srgb,var(--nmorph-black-color) 72%,transparent)}.nmorph-video-preview.nmorph-video-preview--playing .nmorph-video-preview__play{opacity:.72}.nmorph-video-preview.nmorph-video-preview--embedded{width:var(--nmorph-video-preview-width, 100%);height:var(--nmorph-video-preview-height, 120px);box-shadow:none}.nmorph-video-preview.nmorph-video-preview--embedded .nmorph-video-preview__play,.nmorph-video-preview.nmorph-video-preview--soft .nmorph-video-preview__play,.nmorph-video-preview.nmorph-video-preview--plain .nmorph-video-preview__play{box-shadow:none}.nmorph-video-preview .nmorph-video-preview__name,.nmorph-video-preview .nmorph-video-preview__duration{min-width:0;overflow:hidden;font-size:var(--font-size-extra-small);line-height:var(--line-height-regular);white-space:nowrap;text-overflow:ellipsis}.nmorph-video-preview .nmorph-video-preview__name{flex:1 1 auto}.nmorph-video-preview .nmorph-video-preview__duration{flex:0 0 auto;font-variant-numeric:tabular-nums}.nmorph-video-preview .nmorph-video-preview__actions{position:absolute;top:var(--indentation-02);right:var(--indentation-02);display:flex;gap:var(--indentation-01);padding:0;background:transparent}.nmorph-video-preview .nmorph-video-preview__action-button,.nmorph-video-preview .nmorph-video-preview__action-link{display:inline-flex;justify-content:center;align-items:center;width:22px;height:22px;padding:0;color:var(--nmorph-contrast-text-color);font:inherit;text-decoration:none;background:color-mix(in srgb,var(--nmorph-black-color) 58%,transparent);border:0;border-radius:var(--default-border-radius);cursor:pointer}.nmorph-video-preview .nmorph-video-preview__action-button:hover,.nmorph-video-preview .nmorph-video-preview__action-link:hover{background:color-mix(in srgb,var(--nmorph-black-color) 72%,transparent)}.nmorph-video-preview .nmorph-video-preview__action-button .nmorph-icon,.nmorph-video-preview .nmorph-video-preview__action-link .nmorph-icon{--nmorph-icon-color: var(--nmorph-contrast-text-color);--color: var(--nmorph-contrast-text-color)}.nmorph-video-preview.nmorph-video-preview--compact{width:var(--nmorph-video-preview-width, 180px);height:var(--nmorph-video-preview-height, 102px)}.nmorph-video-preview.nmorph-video-preview--soft{background:color-mix(in srgb,var(--nmorph-accent-color) 6%,transparent);box-shadow:none}.nmorph-video-preview.nmorph-video-preview--plain{background:transparent;box-shadow:none}.nmorph-video-preview.nmorph-video-preview--error{outline:1px solid var(--nmorph-error-color)}.nmorph-video-preview__portal{display:contents}.nmorph-video-preview__portal .nmorph-video-preview__portal-content{--nmorph-video-preview-portal-width: min( calc(100vw - 96px) , 1080px);--nmorph-video-preview-portal-height: min( calc(100vh - 180px) , 720px);position:absolute;top:50%;left:50%;display:flex;justify-content:center;align-items:center;width:var(--nmorph-video-preview-portal-width);height:var(--nmorph-video-preview-portal-height);transform:translate(-50%,-50%)}.nmorph-video-preview__portal .nmorph-video-preview__portal-media{display:block;width:100%;max-width:100%;height:100%;max-height:100%;object-fit:contain;background:var(--nmorph-black-color);border-radius:var(--default-border-radius)}