@alea-design/ui 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/command/CommandPalette.js +53 -42
- package/dist/components/notification/NotificationCenter.d.ts +86 -0
- package/dist/components/notification/NotificationCenter.js +185 -0
- package/dist/components/theme/Theme.js +141 -98
- package/dist/css/command.css +1 -1
- package/dist/css/groups.json +11 -1
- package/dist/css/notification.css +1 -0
- package/dist/i18n/strings.d.ts +14 -0
- package/dist/i18n/strings.js +20 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +150 -148
- package/dist/styles.css +1 -1
- package/package.json +3 -3
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { warnDeprecated as
|
|
5
|
-
import { RouterProvider as
|
|
6
|
-
import { motionVariables as
|
|
7
|
-
import { cx as
|
|
8
|
-
import { StringsContext as
|
|
9
|
-
import { refractionLevel as
|
|
10
|
-
const
|
|
2
|
+
import { jsxs as R, Fragment as ee, jsx as v } from "react/jsx-runtime";
|
|
3
|
+
import { useState as te, useSyncExternalStore as V, useEffect as w, useMemo as M, useId as ne, useCallback as ae, useContext as re, createContext as oe } from "react";
|
|
4
|
+
import { warnDeprecated as ce } from "../../utils/vocabulary.js";
|
|
5
|
+
import { RouterProvider as ie, I18nProvider as se } from "react-aria-components";
|
|
6
|
+
import { motionVariables as le, motionAttributes as me, motionComponentCss as de } from "@alea-design/motion";
|
|
7
|
+
import { cx as ue } from "../../utils/cx.js";
|
|
8
|
+
import { StringsContext as fe } from "../../i18n/strings.js";
|
|
9
|
+
import { refractionLevel as pe, startGlassLens as he } from "./lens.js";
|
|
10
|
+
const ye = {
|
|
11
11
|
"--alea-spacing-base": "0.125rem",
|
|
12
12
|
"--alea-space-0": "0rem",
|
|
13
13
|
"--alea-space-0-25": "0.0625rem",
|
|
@@ -29,61 +29,104 @@ const fe = {
|
|
|
29
29
|
"--alea-space-20": "2.5rem",
|
|
30
30
|
"--alea-space-22": "2.75rem",
|
|
31
31
|
"--alea-space-24": "3rem"
|
|
32
|
-
},
|
|
33
|
-
function
|
|
34
|
-
|
|
32
|
+
}, H = [["3xs", 1], ["2xs", 2], ["xs", 4], ["sm", 6], ["field", 8], ["md", 10], ["lg", 12], ["xl", 16], ["2xl", 20], ["3xl", 24], ["4xl", 32]], xe = H.map(([e, n]) => [e, e === "3xs" || e === "2xs" ? n : n * 2]);
|
|
33
|
+
function D(e) {
|
|
34
|
+
const n = e.trim().toLowerCase(), t = /^#([0-9a-f]{3,8})$/.exec(n);
|
|
35
|
+
if (t) {
|
|
36
|
+
let s = t[1];
|
|
37
|
+
return (s.length === 3 || s.length === 4) && (s = s.split("").map((l) => l + l).join("")), s.length !== 6 && s.length !== 8 ? null : [0, 2, 4].map((l) => parseInt(s.slice(l, l + 2), 16));
|
|
38
|
+
}
|
|
39
|
+
const a = /^(rgba?|hsla?)\(([^)]+)\)$/.exec(n);
|
|
40
|
+
if (!a) return null;
|
|
41
|
+
const r = a[2].split(/[\s,/]+/).filter(Boolean).slice(0, 3).map((s) => s.endsWith("%") ? parseFloat(s) / 100 : parseFloat(s));
|
|
42
|
+
if (r.length < 3 || r.some(Number.isNaN)) return null;
|
|
43
|
+
if (a[1].startsWith("rgb")) {
|
|
44
|
+
const s = a[2].split(/[\s,/]+/).filter(Boolean).slice(0, 3).map((l) => l.endsWith("%"));
|
|
45
|
+
return r.map((l, u) => Math.max(0, Math.min(255, Math.round(s[u] ? l * 255 : l))));
|
|
46
|
+
}
|
|
47
|
+
const [c, i, y] = [(r[0] % 360 + 360) % 360, r[1] > 1 ? r[1] / 100 : r[1], r[2] > 1 ? r[2] / 100 : r[2]], f = i * Math.min(y, 1 - y), x = (s) => {
|
|
48
|
+
const l = (s + c / 30) % 12;
|
|
49
|
+
return Math.round(255 * (y - f * Math.max(-1, Math.min(l - 3, 9 - l, 1))));
|
|
50
|
+
};
|
|
51
|
+
return [x(0), x(8), x(4)];
|
|
52
|
+
}
|
|
53
|
+
const F = ([e, n, t]) => {
|
|
54
|
+
const a = [e, n, t].map((r) => {
|
|
55
|
+
const c = r / 255;
|
|
56
|
+
return c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
|
|
57
|
+
});
|
|
58
|
+
return 0.2126 * a[0] + 0.7152 * a[1] + 0.0722 * a[2];
|
|
59
|
+
}, ge = (e, n) => {
|
|
60
|
+
const t = F(e), a = F(n);
|
|
61
|
+
return (Math.max(t, a) + 0.05) / (Math.min(t, a) + 0.05);
|
|
62
|
+
}, J = (e) => `#${e.map((n) => n.toString(16).padStart(2, "0")).join("")}`, we = (e, n) => e.map((t) => Math.round(t * n));
|
|
63
|
+
function ve(e, n) {
|
|
64
|
+
const t = {}, a = D(e);
|
|
65
|
+
let r = e, c = `color-mix(in srgb, ${e} 88%, black)`, i = "var(--alea-accent-on)";
|
|
66
|
+
if (a) {
|
|
67
|
+
const y = [a, we(a, 0.88)], f = [n, "#0a0a0a", "#000000", "#ffffff"].filter((m) => !!m).map((m) => ({ css: m, rgb: D(m) })).filter((m) => !!m.rgb), x = (m, h) => Math.min(...h.map((p) => ge(m, p))), s = (m) => {
|
|
68
|
+
const h = f.map((p) => ({ css: p.css, ratio: x(p.rgb, m) }));
|
|
69
|
+
return h.find((p) => p.ratio >= 7) ?? h.find((p) => p.ratio >= 4.5) ?? h.slice().sort((p, k) => k.ratio - p.ratio)[0];
|
|
70
|
+
};
|
|
71
|
+
let l = s(y), u = y;
|
|
72
|
+
l.ratio < 4.5 && (u = [a, a], l = s(u)), r = J(u[0]), c = J(u[1]), i = l.css;
|
|
73
|
+
}
|
|
74
|
+
return t["--alea-button-top"] = r, t["--alea-button-bottom"] = c, t["--alea-button-text"] = i, t["--alea-button-ring"] = `color-mix(in srgb, ${e} 25%, transparent)`, t["--alea-gradient-button"] = `linear-gradient(180deg, ${r} 0%, ${c} 100%)`, t["--alea-accent-second"] = `color-mix(in oklch, ${e} 55%, white)`, t["--alea-accent-third"] = `color-mix(in oklch, ${e} 45%, var(--alea-text))`, t;
|
|
75
|
+
}
|
|
76
|
+
function ke(e = {}, n = "default") {
|
|
77
|
+
var a, r, c;
|
|
35
78
|
const t = {};
|
|
36
79
|
if (e.accent) {
|
|
37
80
|
t["--alea-accent"] = e.accent, t["--alea-accent-strong"] = `color-mix(in oklch, ${e.accent} 62%, var(--alea-text))`, t["--alea-accent-subtle"] = `color-mix(in oklch, ${e.accent} 16%, transparent)`, t["--alea-focus"] = e.accent, t["--alea-focus-halo"] = `color-mix(in oklch, ${e.accent} 30%, transparent)`, t["--alea-accent-solid"] = e.accent;
|
|
38
|
-
const
|
|
39
|
-
t["--alea-gradient-accent"] = `radial-gradient(100% 100% at 25% 100%, ${e.accent} 0%, ${
|
|
81
|
+
const i = `color-mix(in oklch, ${e.accent} 55%, white)`;
|
|
82
|
+
t["--alea-gradient-accent"] = `radial-gradient(100% 100% at 25% 100%, ${e.accent} 0%, ${i} 100%)`, t["--alea-gradient-accent-linear"] = `linear-gradient(120deg, ${e.accent} 0%, ${i} 100%)`, t["--alea-gradient-text"] = t["--alea-gradient-accent"], t["--alea-gradient-text-linear"] = t["--alea-gradient-accent-linear"], t["--alea-shadow-glow"] = `0 10px 30px -10px color-mix(in srgb, ${e.accent} 55%, transparent)`, Object.assign(t, ve(e.accent, e.accentOn));
|
|
40
83
|
}
|
|
41
84
|
if (e.accentOn && (t["--alea-accent-on"] = e.accentOn), e.radius != null) {
|
|
42
|
-
for (const [
|
|
85
|
+
for (const [i, y] of n === "glass" ? xe : H) t[`--alea-radius-${i}`] = `${Math.round(y * e.radius)}px`;
|
|
43
86
|
t["--alea-radius-full"] = e.radius >= 1 ? "9999px" : `${Math.round(18 * e.radius)}px`;
|
|
44
87
|
}
|
|
45
|
-
return e.density === "compact" && Object.assign(t,
|
|
88
|
+
return e.density === "compact" && Object.assign(t, ye, {
|
|
46
89
|
"--alea-size-control-sm": "24px",
|
|
47
90
|
"--alea-size-control-md": "32px",
|
|
48
91
|
"--alea-size-control-lg": "40px",
|
|
49
92
|
"--alea-size-field": "36px"
|
|
50
|
-
}), (
|
|
93
|
+
}), (a = e.fonts) != null && a.body && (t["--alea-font-family-body"] = e.fonts.body), (r = e.fonts) != null && r.display && (t["--alea-font-family-display"] = e.fonts.display), (c = e.fonts) != null && c.mono && (t["--alea-font-family-mono"] = e.fonts.mono), t;
|
|
51
94
|
}
|
|
52
|
-
const
|
|
95
|
+
const Q = oe(null), $e = /* @__PURE__ */ new Set(["ar", "arc", "ckb", "dv", "fa", "he", "ks", "ku", "ps", "sd", "ug", "ur", "yi"]);
|
|
53
96
|
function P(e) {
|
|
54
|
-
var t,
|
|
97
|
+
var t, a;
|
|
55
98
|
if (!e) return "ltr";
|
|
56
99
|
try {
|
|
57
|
-
const
|
|
58
|
-
if (
|
|
100
|
+
const r = new Intl.Locale(e), c = ((t = r.getTextInfo) == null ? void 0 : t.call(r).direction) ?? ((a = r.textInfo) == null ? void 0 : a.direction);
|
|
101
|
+
if (c === "rtl" || c === "ltr") return c;
|
|
59
102
|
} catch {
|
|
60
103
|
}
|
|
61
104
|
const n = e.toLowerCase().split(/[-_]/)[0];
|
|
62
|
-
return
|
|
105
|
+
return $e.has(n) ? "rtl" : "ltr";
|
|
63
106
|
}
|
|
64
107
|
function T() {
|
|
65
108
|
return typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: light)").matches ? "light" : "dark";
|
|
66
109
|
}
|
|
67
|
-
function
|
|
110
|
+
function Ae(e) {
|
|
68
111
|
var t;
|
|
69
112
|
if (typeof window > "u" || !window.matchMedia) return () => {
|
|
70
113
|
};
|
|
71
114
|
const n = window.matchMedia("(prefers-color-scheme: light)");
|
|
72
115
|
return (t = n.addEventListener) == null || t.call(n, "change", e), () => {
|
|
73
|
-
var
|
|
74
|
-
return (
|
|
116
|
+
var a;
|
|
117
|
+
return (a = n.removeEventListener) == null ? void 0 : a.call(n, "change", e);
|
|
75
118
|
};
|
|
76
119
|
}
|
|
77
|
-
const
|
|
120
|
+
const Ee = () => () => {
|
|
78
121
|
};
|
|
79
|
-
function
|
|
80
|
-
const t = (
|
|
122
|
+
function Se(e = "alea-theme", n = "dark") {
|
|
123
|
+
const t = (a) => JSON.stringify(a).replace(/</g, "\\u003c").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
81
124
|
return `(function(){try{var k=${t(e)},t=k&&localStorage.getItem(k);if(t!=='dark'&&t!=='light'&&t!=='system')t=${t(n)};if(t==='system')t=matchMedia('(prefers-color-scheme: light)').matches?'light':'dark';document.documentElement.setAttribute('data-theme',t)}catch(e){}})()`;
|
|
82
125
|
}
|
|
83
|
-
function
|
|
84
|
-
return /* @__PURE__ */
|
|
126
|
+
function _e({ storageKey: e = "alea-theme", defaultTheme: n = "dark" }) {
|
|
127
|
+
return /* @__PURE__ */ v("script", { dangerouslySetInnerHTML: { __html: Se(e, n) } });
|
|
85
128
|
}
|
|
86
|
-
function
|
|
129
|
+
function U(e) {
|
|
87
130
|
if (!e || typeof window > "u") return null;
|
|
88
131
|
try {
|
|
89
132
|
const n = window.localStorage.getItem(e);
|
|
@@ -92,81 +135,81 @@ function J(e) {
|
|
|
92
135
|
return null;
|
|
93
136
|
}
|
|
94
137
|
}
|
|
95
|
-
const
|
|
96
|
-
function
|
|
97
|
-
let n =
|
|
138
|
+
const be = /^([a-z][a-z0-9+.-]*:|\/\/|#)/i, Z = /* @__PURE__ */ new WeakMap();
|
|
139
|
+
function Me(e) {
|
|
140
|
+
let n = Z.get(e);
|
|
98
141
|
return n || (n = (t) => {
|
|
99
|
-
const
|
|
100
|
-
return
|
|
101
|
-
},
|
|
142
|
+
const a = e(t);
|
|
143
|
+
return be.test(t) ? t : a;
|
|
144
|
+
}, Z.set(e, n)), n;
|
|
102
145
|
}
|
|
103
|
-
function
|
|
104
|
-
|
|
105
|
-
typeof document > "u" || (document.documentElement.setAttribute("data-alea-refraction", String(e)), t ? document.documentElement.removeAttribute("data-alea-lens-pause") : document.documentElement.setAttribute("data-alea-lens-pause", "off"),
|
|
146
|
+
function Le(e, n, t = !0) {
|
|
147
|
+
w(() => {
|
|
148
|
+
typeof document > "u" || (document.documentElement.setAttribute("data-alea-refraction", String(e)), t ? document.documentElement.removeAttribute("data-alea-lens-pause") : document.documentElement.setAttribute("data-alea-lens-pause", "off"), he(n).refresh());
|
|
106
149
|
}, [e, n, t]);
|
|
107
150
|
}
|
|
108
|
-
function
|
|
109
|
-
|
|
110
|
-
const [L,
|
|
111
|
-
|
|
112
|
-
if (
|
|
113
|
-
const
|
|
114
|
-
document.documentElement.setAttribute("data-theme",
|
|
115
|
-
}, [
|
|
116
|
-
if (
|
|
117
|
-
const
|
|
118
|
-
return
|
|
119
|
-
window.removeEventListener("resize",
|
|
151
|
+
function We({ children: e, dir: n, defaultTheme: t = "dark", theme: a, onThemeChange: r, storageKey: c = "alea-theme", scope: i = "document", className: y, brand: f, density: x, navigate: s, useHref: l, locale: u, motion: m, preset: h = "default", surface: p = "solid", contrast: k = "system", background: C = "decorated", strings: N, glass: g }) {
|
|
152
|
+
Le(pe(g == null ? void 0 : g.refraction), g == null ? void 0 : g.lensSelector, (g == null ? void 0 : g.pauseOnScroll) !== !1);
|
|
153
|
+
const [L, X] = te(null), Y = V(Ee, () => U(c), () => null), $ = a ?? L ?? Y ?? t, q = V(Ae, T, () => "dark"), A = $ === "system" ? q : $;
|
|
154
|
+
w(() => {
|
|
155
|
+
if (i !== "document" || typeof document > "u") return;
|
|
156
|
+
const o = a ?? L ?? U(c) ?? t;
|
|
157
|
+
document.documentElement.setAttribute("data-theme", o === "system" ? T() : o), document.documentElement.classList.add("alea-root");
|
|
158
|
+
}, [A, i, a, L, c, t]), w(() => {
|
|
159
|
+
if (i !== "document" || typeof window > "u") return;
|
|
160
|
+
const o = document.documentElement, d = () => o.style.setProperty("--alea-scrollbar", `${Math.max(0, window.innerWidth - o.clientWidth)}px`);
|
|
161
|
+
return d(), window.addEventListener("resize", d), () => {
|
|
162
|
+
window.removeEventListener("resize", d), o.style.removeProperty("--alea-scrollbar");
|
|
120
163
|
};
|
|
121
|
-
}, [
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
if (
|
|
125
|
-
const
|
|
126
|
-
return
|
|
127
|
-
|
|
164
|
+
}, [i]);
|
|
165
|
+
const E = n ?? (u ? P(u) : void 0);
|
|
166
|
+
w(() => {
|
|
167
|
+
if (i !== "document" || typeof document > "u" || !E) return;
|
|
168
|
+
const o = document.documentElement, d = o.getAttribute("dir");
|
|
169
|
+
return o.setAttribute("dir", E), () => {
|
|
170
|
+
d == null ? o.removeAttribute("dir") : o.setAttribute("dir", d);
|
|
128
171
|
};
|
|
129
|
-
}, [
|
|
130
|
-
!n || !
|
|
131
|
-
}, [n,
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
(
|
|
135
|
-
}, [
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
if (
|
|
139
|
-
const
|
|
140
|
-
return Object.entries(
|
|
141
|
-
Object.keys(
|
|
172
|
+
}, [E, i]), w(() => {
|
|
173
|
+
!n || !u || P(u) === n || console.warn(`[alea] dir="${n}" does not match locale "${u}" (${P(u)}): the styles mirror, but the arrow keys, sliders and calendars follow the locale. Pass a ${n === "rtl" ? "right to left" : "left to right"} locale as well.`);
|
|
174
|
+
}, [n, u]);
|
|
175
|
+
const O = JSON.stringify(m || {}), S = M(() => ({ ...ke(f, h), ...le(m) }), [f, O, h]);
|
|
176
|
+
w(() => {
|
|
177
|
+
(x === "comfortable" || (f == null ? void 0 : f.density) === "comfortable") && ce("ThemeProvider", 'density="comfortable"', 'density="comfy"');
|
|
178
|
+
}, [x, f == null ? void 0 : f.density]);
|
|
179
|
+
const _ = (x ?? ((f == null ? void 0 : f.density) === "compact" ? "compact" : "comfy")) === "compact", b = M(() => ({ ...me(m), ..._ ? { "data-density": "compact" } : {}, ...h !== "default" ? { "data-preset": h } : {}, ...p !== "solid" ? { "data-surface": p } : {}, ...k !== "system" ? { "data-contrast": k } : {}, ...C === "plain" ? { "data-background": "plain" } : {} }), [O, h, p, k, C, _]), I = ne().replace(/[^a-zA-Z0-9_-]/g, ""), j = M(() => de(m == null ? void 0 : m.components, i === "document" ? ":root" : `[data-alea-scope="${I}"]`), [O, i, I]);
|
|
180
|
+
w(() => {
|
|
181
|
+
if (i !== "document" || typeof document > "u") return;
|
|
182
|
+
const o = document.documentElement;
|
|
183
|
+
return Object.entries(b).forEach(([d, z]) => o.setAttribute(d, z)), () => {
|
|
184
|
+
Object.keys(b).forEach((d) => o.removeAttribute(d));
|
|
142
185
|
};
|
|
143
|
-
}, [
|
|
144
|
-
if (
|
|
145
|
-
const
|
|
146
|
-
return Object.entries(
|
|
147
|
-
Object.keys(
|
|
186
|
+
}, [b, i]), w(() => {
|
|
187
|
+
if (i !== "document" || typeof document > "u") return;
|
|
188
|
+
const o = document.documentElement;
|
|
189
|
+
return Object.entries(S).forEach(([d, z]) => o.style.setProperty(d, z)), () => {
|
|
190
|
+
Object.keys(S).forEach((d) => o.style.removeProperty(d));
|
|
148
191
|
};
|
|
149
|
-
}, [
|
|
150
|
-
const
|
|
151
|
-
if (
|
|
192
|
+
}, [S, i]);
|
|
193
|
+
const W = ae((o) => {
|
|
194
|
+
if (a === void 0 && X(o), r == null || r(o), c)
|
|
152
195
|
try {
|
|
153
|
-
window.localStorage.setItem(
|
|
196
|
+
window.localStorage.setItem(c, o);
|
|
154
197
|
} catch {
|
|
155
198
|
}
|
|
156
|
-
}, [
|
|
157
|
-
|
|
199
|
+
}, [a, r, c]), K = M(() => ({ theme: $, resolvedTheme: A, setTheme: W }), [$, A, W]), G = j ? /* @__PURE__ */ v("style", { children: j }) : null, B = i === "element" ? /* @__PURE__ */ R("div", { className: ue("alea-root", y), dir: E, "data-theme": A, "data-alea-scope": j ? I : void 0, ...b, style: S, children: [
|
|
200
|
+
G,
|
|
158
201
|
e
|
|
159
|
-
] }) : /* @__PURE__ */
|
|
160
|
-
|
|
202
|
+
] }) : /* @__PURE__ */ R(ee, { children: [
|
|
203
|
+
G,
|
|
161
204
|
e
|
|
162
205
|
] });
|
|
163
|
-
return /* @__PURE__ */
|
|
164
|
-
const
|
|
165
|
-
return
|
|
206
|
+
return /* @__PURE__ */ v(Q.Provider, { value: K, children: (() => {
|
|
207
|
+
const o = N ? /* @__PURE__ */ v(fe.Provider, { value: N, children: B }) : B, d = s ? /* @__PURE__ */ v(ie, { navigate: s, useHref: l ? Me(l) : void 0, children: o }) : o;
|
|
208
|
+
return u ? /* @__PURE__ */ v(se, { locale: u, children: d }) : d;
|
|
166
209
|
})() });
|
|
167
210
|
}
|
|
168
|
-
function
|
|
169
|
-
const e =
|
|
211
|
+
function Ge() {
|
|
212
|
+
const e = re(Q);
|
|
170
213
|
if (e) return e;
|
|
171
214
|
const n = typeof document < "u" && document.documentElement.getAttribute("data-theme") === "light" ? "light" : "dark";
|
|
172
215
|
return { theme: n, resolvedTheme: n, setTheme: (t) => {
|
|
@@ -174,13 +217,13 @@ function je() {
|
|
|
174
217
|
} };
|
|
175
218
|
}
|
|
176
219
|
export {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
220
|
+
ye as COMPACT_SPACE,
|
|
221
|
+
xe as GLASS_RADII,
|
|
222
|
+
We as ThemeProvider,
|
|
223
|
+
_e as ThemeScript,
|
|
224
|
+
ke as brandVariables,
|
|
182
225
|
P as directionOf,
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
226
|
+
Me as keepAbsolute,
|
|
227
|
+
Se as themeScript,
|
|
228
|
+
Ge as useTheme
|
|
186
229
|
};
|
package/dist/css/command.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.alea-command-overlay{align-items:start;padding-top:min(12vh,calc(var(--alea-space-24) + var(--alea-space-6)))}.alea-command{padding:0;gap:0}.alea-command-search{display:flex;align-items:center;gap:var(--alea-space-3);height:56px;padding:0 var(--alea-space-4);border-bottom:1px solid var(--alea-border);color:var(--alea-text-muted)}.alea-command-input{flex:1;min-width:0;height:100%;border:0;background:transparent;color:var(--alea-text);font:var(--alea-font-weight-regular) var(--alea-font-size-base)/1 var(--alea-font-family-body);outline:none}.alea-command-input::placeholder{color:var(--alea-text-faint)}.alea-command-input::-webkit-search-cancel-button{display:none}.alea-command-
|
|
1
|
+
.alea-command-overlay{align-items:start;padding-top:min(12vh,calc(var(--alea-space-24) + var(--alea-space-6)))}.alea-command{padding:0;gap:0}.alea-command-search{display:flex;align-items:center;gap:var(--alea-space-3);height:56px;padding:0 var(--alea-space-4);border-bottom:1px solid var(--alea-border);color:var(--alea-text-muted)}.alea-command-input{flex:1;min-width:0;height:100%;border:0;background:transparent;color:var(--alea-text);font:var(--alea-font-weight-regular) var(--alea-font-size-base)/1 var(--alea-font-family-body);outline:none}.alea-command-input::placeholder{color:var(--alea-text-faint)}.alea-command-input::-webkit-search-cancel-button{display:none}.alea-command-scroll{max-height:min(56vh,480px);overflow-y:auto}.alea-command-scroll:focus-visible{outline-offset:calc(var(--alea-space-1) * -1)}.alea-command-list{padding:var(--alea-space-2);outline:none;display:flex;flex-direction:column;gap:var(--alea-space-0-25)}.alea-command-item[data-focused]{background:var(--alea-accent-subtle)}.alea-command-empty{margin:0;padding:var(--alea-space-7) var(--alea-space-4);text-align:center;color:var(--alea-text-muted)}@media(forced-colors:active){.alea-button:not([data-variant=link],[data-variant=text],[data-variant=ghost],[data-variant=dashed]),.alea-icon-button:not([data-variant=link],[data-variant=text],[data-variant=ghost],[data-variant=dashed]){outline:1px solid ButtonBorder;outline-offset:calc(var(--alea-space-0-25) * -1)}}
|
package/dist/css/groups.json
CHANGED
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
]
|
|
79
79
|
},
|
|
80
80
|
"command": {
|
|
81
|
-
"bytes":
|
|
81
|
+
"bytes": 1450,
|
|
82
82
|
"requires": [
|
|
83
83
|
"base",
|
|
84
84
|
"overlay",
|
|
@@ -224,6 +224,16 @@
|
|
|
224
224
|
"overlay"
|
|
225
225
|
]
|
|
226
226
|
},
|
|
227
|
+
"notification": {
|
|
228
|
+
"bytes": 4201,
|
|
229
|
+
"requires": [
|
|
230
|
+
"base",
|
|
231
|
+
"button",
|
|
232
|
+
"data",
|
|
233
|
+
"display",
|
|
234
|
+
"overlay"
|
|
235
|
+
]
|
|
236
|
+
},
|
|
227
237
|
"overlay": {
|
|
228
238
|
"bytes": 12628,
|
|
229
239
|
"requires": [
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.alea-notifs-root{display:inline-flex}.alea-notifs-bell{position:relative;display:inline-flex}.alea-notifs-count{position:absolute;inset-block-start:calc(var(--alea-space-1) * -1);inset-inline-end:calc(var(--alea-space-1) * -1);pointer-events:none;font-variant-numeric:tabular-nums}.alea-notifs-popover{padding:0;overflow:hidden}.alea-notifs{display:flex;flex-direction:column;max-height:min(560px,80dvh);outline:none}.alea-notifs-head{display:flex;align-items:center;gap:var(--alea-space-2);padding:var(--alea-space-3) var(--alea-space-4);border-bottom:1px solid var(--alea-border)}.alea-notifs-title{display:flex;align-items:center;gap:var(--alea-space-2);flex:1;min-width:0;margin:0;font:var(--alea-font-weight-semibold) var(--alea-font-size-md) / 1.4 var(--alea-font-family-body);color:var(--alea-text)}.alea-notifs-list{display:flex;flex-direction:column;flex:1;min-height:0;margin:0;padding:0;list-style:none;overflow-y:auto;overscroll-behavior:contain}.alea-notifs-empty{padding:var(--alea-space-6) var(--alea-space-4);outline:none}.alea-notifs-empty:focus-visible{box-shadow:inset 0 0 0 2px var(--alea-focus-ring, var(--alea-accent))}.alea-notif{--tone: var(--alea-status-info);--tone-bg: var(--alea-status-info-bg);border-bottom:1px solid var(--alea-border);outline:none}.alea-notif:last-child{border-bottom:0}.alea-notif[data-tone=success]{--tone: var(--alea-status-success);--tone-bg: var(--alea-status-success-bg)}.alea-notif[data-tone=warning]{--tone: var(--alea-status-warning);--tone-bg: var(--alea-status-warning-bg)}.alea-notif[data-tone=danger]{--tone: var(--alea-status-danger);--tone-bg: var(--alea-status-danger-bg)}.alea-notif-inner{display:flex;align-items:flex-start;gap:var(--alea-space-3);padding:var(--alea-space-3) var(--alea-space-4);transition:background-color var(--alea-motion-duration-base) var(--alea-motion-ease-out)}.alea-notif[data-unread] .alea-notif-inner{background:var(--alea-accent-subtle)}.alea-notif:hover .alea-notif-inner{background:var(--alea-surface-hover)}.alea-notif:focus-visible .alea-notif-inner{box-shadow:inset 0 0 0 2px var(--alea-focus-ring, var(--alea-accent))}.alea-notif-icon{display:inline-flex;align-items:center;justify-content:center;flex:none;width:var(--alea-space-8);height:var(--alea-space-8);border-radius:var(--alea-radius-full);background:var(--tone-bg);color:var(--tone)}.alea-notif-icon svg{width:var(--alea-space-4);height:var(--alea-space-4)}.alea-notif-body{display:flex;flex-direction:column;gap:var(--alea-space-1);flex:1;min-width:0}.alea-notif-body>p{margin:0}.alea-notif-title{color:var(--alea-text-soft);font:var(--alea-font-weight-medium) var(--alea-font-size-sm) / 1.4 var(--alea-font-family-body);overflow-wrap:anywhere}.alea-notif[data-unread] .alea-notif-title{color:var(--alea-text);font-weight:var(--alea-font-weight-semibold)}.alea-notif-text{color:var(--alea-text-muted);font-size:var(--alea-font-size-sm);line-height:1.4;overflow-wrap:anywhere}.alea-notif[data-unread] .alea-notif-text{color:var(--alea-text-soft)}.alea-notif-meta{display:flex;align-items:center;flex-wrap:wrap;gap:var(--alea-space-1) var(--alea-space-3);color:var(--alea-text-muted);font-size:var(--alea-font-size-xs)}.alea-notif[data-unread] .alea-notif-meta{color:var(--alea-text-soft)}.alea-notif-tools{display:flex;align-items:center;gap:var(--alea-space-1);flex:none}.alea-notif-out{animation:alea-notif-out var(--alea-motion-duration-base) var(--alea-motion-ease-in) forwards;pointer-events:none}@keyframes alea-notif-out{to{opacity:.01;transform:translate(var(--alea-space-4))}}@media(pointer:coarse){.alea-notif-tools{gap:var(--alea-space-2)}}@media(prefers-reduced-motion:reduce){.alea-notif-inner{transition:none}.alea-notif-out{animation-duration:.01ms}}@media(forced-colors:active){.alea-button:not([data-variant=link],[data-variant=text],[data-variant=ghost],[data-variant=dashed]),.alea-icon-button:not([data-variant=link],[data-variant=text],[data-variant=ghost],[data-variant=dashed]){outline:1px solid ButtonBorder;outline-offset:calc(var(--alea-space-0-25) * -1)}.alea-notif:focus-visible .alea-notif-inner,.alea-notifs-empty:focus-visible{box-shadow:none;outline:2px solid Highlight;outline-offset:var(--alea-space-0-5)}}
|
package/dist/i18n/strings.d.ts
CHANGED
|
@@ -421,6 +421,20 @@ export interface AleaStrings {
|
|
|
421
421
|
preview: string;
|
|
422
422
|
formatting: string;
|
|
423
423
|
nothingToPreview: string;
|
|
424
|
+
notificationBell: (unread: number) => string;
|
|
425
|
+
markRead: string;
|
|
426
|
+
markAllRead: string;
|
|
427
|
+
dismissNotification: string;
|
|
428
|
+
notificationsEmpty: string;
|
|
429
|
+
notificationsEmptyHint: string;
|
|
430
|
+
newNotification: (title: string) => string;
|
|
431
|
+
unreadNotification: string;
|
|
432
|
+
notificationTones: {
|
|
433
|
+
info: string;
|
|
434
|
+
success: string;
|
|
435
|
+
warning: string;
|
|
436
|
+
danger: string;
|
|
437
|
+
};
|
|
424
438
|
}
|
|
425
439
|
export declare const en: AleaStrings;
|
|
426
440
|
export declare const es: AleaStrings;
|
package/dist/i18n/strings.js
CHANGED
|
@@ -414,7 +414,16 @@ const s = {
|
|
|
414
414
|
write: "Write",
|
|
415
415
|
preview: "Preview",
|
|
416
416
|
formatting: "Formatting",
|
|
417
|
-
nothingToPreview: "Nothing to preview yet."
|
|
417
|
+
nothingToPreview: "Nothing to preview yet.",
|
|
418
|
+
notificationBell: (e) => e > 0 ? `Notifications, ${e} unread` : "Notifications",
|
|
419
|
+
markRead: "Mark as read",
|
|
420
|
+
markAllRead: "Mark all as read",
|
|
421
|
+
dismissNotification: "Dismiss notification",
|
|
422
|
+
notificationsEmpty: "You are all caught up",
|
|
423
|
+
notificationsEmptyHint: "New notifications will show up here.",
|
|
424
|
+
newNotification: (e) => `New notification: ${e}`,
|
|
425
|
+
unreadNotification: "Unread",
|
|
426
|
+
notificationTones: { info: "Information", success: "Success", warning: "Warning", danger: "Problem" }
|
|
418
427
|
}, p = {
|
|
419
428
|
loading: "Cargando",
|
|
420
429
|
close: "Cerrar",
|
|
@@ -828,7 +837,16 @@ const s = {
|
|
|
828
837
|
write: "Escribir",
|
|
829
838
|
preview: "Vista previa",
|
|
830
839
|
formatting: "Formato",
|
|
831
|
-
nothingToPreview: "Aún no hay nada que mostrar."
|
|
840
|
+
nothingToPreview: "Aún no hay nada que mostrar.",
|
|
841
|
+
notificationBell: (e) => e > 0 ? `Notificaciones, ${e} sin leer` : "Notificaciones",
|
|
842
|
+
markRead: "Marcar como leída",
|
|
843
|
+
markAllRead: "Marcar todas como leídas",
|
|
844
|
+
dismissNotification: "Descartar notificación",
|
|
845
|
+
notificationsEmpty: "Estás al día",
|
|
846
|
+
notificationsEmptyHint: "Las notificaciones nuevas aparecerán aquí.",
|
|
847
|
+
newNotification: (e) => `Notificación nueva: ${e}`,
|
|
848
|
+
unreadNotification: "Sin leer",
|
|
849
|
+
notificationTones: { info: "Información", success: "Éxito", warning: "Advertencia", danger: "Problema" }
|
|
832
850
|
}, n = { en: s, es: p }, u = d(null);
|
|
833
851
|
function h() {
|
|
834
852
|
const { locale: e } = c(), a = l(u), o = n[(e || "en").split("-")[0]] || s;
|
package/dist/index.d.ts
CHANGED
|
@@ -70,4 +70,5 @@ export { EMOJI, EMOJI_CATEGORIES, type EmojiEntry, type EmojiCategory } from './
|
|
|
70
70
|
export * from './components/chat/Chat.js';
|
|
71
71
|
export * from './components/ai/AI.js';
|
|
72
72
|
export * from './components/work/Work.js';
|
|
73
|
+
export * from './components/notification/NotificationCenter.js';
|
|
73
74
|
export * from './components/app/AppParts.js';
|