@floegence/floe-webapp-core 0.35.21 → 0.35.22

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.
@@ -1,5 +1,5 @@
1
1
  import { createComponent as C } from "solid-js/web";
2
- import { createContext as F, createMemo as u, createEffect as I, onCleanup as E, useContext as h } from "solid-js";
2
+ import { createContext as L, createMemo as u, createEffect as F, onCleanup as I, useContext as v } from "solid-js";
3
3
  const m = {
4
4
  storage: {
5
5
  namespace: "floe",
@@ -46,6 +46,15 @@ const m = {
46
46
  storageKey: "theme",
47
47
  defaultTheme: "system"
48
48
  },
49
+ accessibility: {
50
+ mainContentId: "floe-main-content",
51
+ skipLinkLabel: "Skip to main content",
52
+ topBarLabel: "Application toolbar",
53
+ primaryNavigationLabel: "Primary navigation",
54
+ mobileNavigationLabel: "Primary navigation",
55
+ sidebarLabel: "Sidebar",
56
+ mainLabel: "Main content"
57
+ },
49
58
  deck: {
50
59
  storageKey: "deck"
51
60
  },
@@ -70,7 +79,7 @@ const m = {
70
79
  }
71
80
  }
72
81
  };
73
- function S() {
82
+ function k() {
74
83
  if (!(typeof window > "u"))
75
84
  return {
76
85
  getItem: (e) => localStorage.getItem(e),
@@ -79,8 +88,8 @@ function S() {
79
88
  keys: () => Object.keys(localStorage)
80
89
  };
81
90
  }
82
- function v(e) {
83
- const t = e.adapter ?? S(), c = e.namespace ? `${e.namespace}-` : "", r = (o) => `${c}${o}`, n = () => e.enabled && !!t, i = /* @__PURE__ */ new Map(), d = () => {
91
+ function h(e) {
92
+ const t = e.adapter ?? k(), c = e.namespace ? `${e.namespace}-` : "", r = (o) => `${c}${o}`, n = () => e.enabled && !!t, i = /* @__PURE__ */ new Map(), d = () => {
84
93
  if (n()) {
85
94
  for (const [o, a] of i.entries()) {
86
95
  clearTimeout(a.timer);
@@ -122,8 +131,8 @@ function v(e) {
122
131
  i.delete(l);
123
132
  try {
124
133
  t.setItem(l, JSON.stringify(f.value));
125
- } catch (b) {
126
- console.warn(`Failed to save ${l}:`, b);
134
+ } catch (w) {
135
+ console.warn(`Failed to save ${l}:`, w);
127
136
  }
128
137
  }
129
138
  }, s);
@@ -157,7 +166,7 @@ function v(e) {
157
166
  }
158
167
  };
159
168
  }
160
- function k(e) {
169
+ function S(e) {
161
170
  if (typeof window > "u") return () => {
162
171
  };
163
172
  const t = () => {
@@ -184,7 +193,7 @@ function k(e) {
184
193
  }
185
194
  };
186
195
  }
187
- function w(e, t) {
196
+ function b(e, t) {
188
197
  if (!t) return e;
189
198
  if (typeof e != "object" || e === null || Array.isArray(e)) return t ?? e;
190
199
  const c = {
@@ -193,17 +202,17 @@ function w(e, t) {
193
202
  for (const [r, n] of Object.entries(t)) {
194
203
  if (n === void 0) continue;
195
204
  const i = e[r];
196
- typeof i == "object" && i !== null && typeof n == "object" && n !== null && !Array.isArray(n) ? c[r] = w(i, n) : c[r] = n;
205
+ typeof i == "object" && i !== null && typeof n == "object" && n !== null && !Array.isArray(n) ? c[r] = b(i, n) : c[r] = n;
197
206
  }
198
207
  return c;
199
208
  }
200
- const y = F();
201
- function O(e) {
202
- const t = u(() => w(m, e.config)), c = u(() => v(t().storage));
203
- I(() => {
204
- const n = c(), d = t().storage.enabled ? k(n) : () => {
209
+ const y = L();
210
+ function N(e) {
211
+ const t = u(() => b(m, e.config)), c = u(() => h(t().storage));
212
+ F(() => {
213
+ const n = c(), d = t().storage.enabled ? S(n) : () => {
205
214
  };
206
- E(() => {
215
+ I(() => {
207
216
  d(), n.dispose?.();
208
217
  });
209
218
  });
@@ -220,23 +229,23 @@ function O(e) {
220
229
  }
221
230
  });
222
231
  }
223
- function D() {
224
- const e = h(y);
232
+ function O() {
233
+ const e = v(y);
225
234
  if (!e)
226
235
  throw new Error("FloeConfigContext not found. Make sure to wrap your app with FloeConfigProvider (or FloeProvider).");
227
236
  return e;
228
237
  }
229
- const L = v(m.storage), T = {
238
+ const E = h(m.storage), T = {
230
239
  config: m,
231
- persist: L
240
+ persist: E
232
241
  };
233
- function N() {
234
- return h(y) ?? T;
242
+ function D() {
243
+ return v(y) ?? T;
235
244
  }
236
245
  export {
237
246
  m as DEFAULT_FLOE_CONFIG,
238
- O as FloeConfigProvider,
239
- k as installPersistFlushListeners,
240
- D as useFloeConfig,
241
- N as useResolvedFloeConfig
247
+ N as FloeConfigProvider,
248
+ S as installPersistFlushListeners,
249
+ O as useFloeConfig,
250
+ D as useResolvedFloeConfig
242
251
  };
@@ -1,58 +1,58 @@
1
- import { insert as d, createComponent as u, template as r, effect as g, className as p, delegateEvents as x } from "solid-js/web";
2
- import { For as w, onCleanup as v, Show as m } from "solid-js";
3
- import { createStore as k, produce as h } from "solid-js/store";
4
- import { createSimpleContext as $ } from "./createSimpleContext.js";
5
- import { cn as b } from "../utils/cn.js";
6
- var _ = /* @__PURE__ */ r('<div class="fixed bottom-4 right-4 z-[100] flex flex-col gap-2 max-w-sm">'), y = /* @__PURE__ */ r('<svg class="w-4 h-4 text-info"fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=2><circle cx=12 cy=12 r=10></circle><path d="M12 16v-4M12 8h.01">'), C = /* @__PURE__ */ r('<svg class="w-4 h-4 text-success"fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=2><path stroke-linecap=round stroke-linejoin=round d="M5 13l4 4L19 7">'), M = /* @__PURE__ */ r('<svg class="w-4 h-4 text-warning"fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=2><path stroke-linecap=round stroke-linejoin=round d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z">'), S = /* @__PURE__ */ r('<svg class="w-4 h-4 text-error"fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=2><circle cx=12 cy=12 r=10></circle><path stroke-linecap=round d="M15 9l-6 6M9 9l6 6">'), N = /* @__PURE__ */ r('<p class="mt-1 text-sm text-muted-foreground">'), T = /* @__PURE__ */ r('<button type=button class="mt-2 text-sm font-medium text-foreground hover:underline">'), D = /* @__PURE__ */ r('<div role=alert><div class="flex items-start gap-3"><span class="flex-shrink-0 mt-0.5"></span><div class="flex-1 min-w-0"><p class="font-medium text-sm"></p></div><button type=button class="flex-shrink-0 text-muted-foreground hover:text-foreground transition-colors"aria-label=Dismiss><svg class="w-4 h-4"fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=2><path stroke-linecap=round stroke-linejoin=round d="M6 18L18 6M6 6l12 12">');
7
- const B = 5e3;
8
- function L() {
9
- const [o, s] = k({
1
+ import { insert as u, createComponent as d, template as l, effect as k, className as $, setAttribute as h, delegateEvents as y } from "solid-js/web";
2
+ import { For as _, onCleanup as C, Show as x } from "solid-js";
3
+ import { createStore as M, produce as w } from "solid-js/store";
4
+ import { createSimpleContext as S } from "./createSimpleContext.js";
5
+ import { cn as N } from "../utils/cn.js";
6
+ var T = /* @__PURE__ */ l('<div class="fixed bottom-4 right-4 z-[100] flex flex-col gap-2 max-w-sm">'), D = /* @__PURE__ */ l('<svg class="w-4 h-4 text-info"fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=2><circle cx=12 cy=12 r=10></circle><path d="M12 16v-4M12 8h.01">'), B = /* @__PURE__ */ l('<svg class="w-4 h-4 text-success"fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=2><path stroke-linecap=round stroke-linejoin=round d="M5 13l4 4L19 7">'), L = /* @__PURE__ */ l('<svg class="w-4 h-4 text-warning"fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=2><path stroke-linecap=round stroke-linejoin=round d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z">'), A = /* @__PURE__ */ l('<svg class="w-4 h-4 text-error"fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=2><circle cx=12 cy=12 r=10></circle><path stroke-linecap=round d="M15 9l-6 6M9 9l6 6">'), E = /* @__PURE__ */ l('<p class="mt-1 text-sm text-muted-foreground">'), j = /* @__PURE__ */ l('<button type=button class="mt-2 text-sm font-medium text-foreground hover:underline focus:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2">'), z = /* @__PURE__ */ l('<div><div class="flex items-start gap-3"><span class="flex-shrink-0 mt-0.5"></span><div class="flex-1 min-w-0"><p class="font-medium text-sm"></p></div><button type=button class="flex-shrink-0 text-muted-foreground hover:text-foreground transition-colors focus:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2"aria-label=Dismiss><svg class="w-4 h-4"fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=2><path stroke-linecap=round stroke-linejoin=round d="M6 18L18 6M6 6l12 12">');
7
+ const F = 5e3;
8
+ function I() {
9
+ const [i, a] = M({
10
10
  notifications: []
11
- }), i = /* @__PURE__ */ new Map();
12
- v(() => {
13
- i.forEach((t) => clearTimeout(t)), i.clear();
11
+ }), n = /* @__PURE__ */ new Map();
12
+ C(() => {
13
+ n.forEach((t) => clearTimeout(t)), n.clear();
14
14
  });
15
- const n = (t) => {
16
- const e = i.get(t);
17
- e && (clearTimeout(e), i.delete(t)), s(h((l) => {
18
- l.notifications = l.notifications.filter((a) => a.id !== t);
15
+ const s = (t) => {
16
+ const e = n.get(t);
17
+ e && (clearTimeout(e), n.delete(t)), a(w((c) => {
18
+ c.notifications = c.notifications.filter((r) => r.id !== t);
19
19
  }));
20
- }, c = (t) => {
21
- const e = `notification-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`, l = t.duration ?? B;
22
- if (s(h((a) => {
23
- a.notifications.push({
20
+ }, f = (t) => {
21
+ const e = `notification-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`, c = t.duration ?? F;
22
+ if (a(w((r) => {
23
+ r.notifications.push({
24
24
  ...t,
25
25
  id: e
26
26
  });
27
- })), l > 0) {
28
- const a = setTimeout(() => n(e), l);
29
- i.set(e, a);
27
+ })), c > 0) {
28
+ const r = setTimeout(() => s(e), c);
29
+ n.set(e, r);
30
30
  }
31
31
  return e;
32
32
  };
33
33
  return {
34
- notifications: () => o.notifications,
35
- show: c,
36
- dismiss: n,
34
+ notifications: () => i.notifications,
35
+ show: f,
36
+ dismiss: s,
37
37
  dismissAll: () => {
38
- i.forEach((t) => clearTimeout(t)), i.clear(), s("notifications", []);
38
+ n.forEach((t) => clearTimeout(t)), n.clear(), a("notifications", []);
39
39
  },
40
- info: (t, e) => c({
40
+ info: (t, e) => f({
41
41
  type: "info",
42
42
  title: t,
43
43
  message: e
44
44
  }),
45
- success: (t, e) => c({
45
+ success: (t, e) => f({
46
46
  type: "success",
47
47
  title: t,
48
48
  message: e
49
49
  }),
50
- warning: (t, e) => c({
50
+ warning: (t, e) => f({
51
51
  type: "warning",
52
52
  title: t,
53
53
  message: e
54
54
  }),
55
- error: (t, e) => c({
55
+ error: (t, e) => f({
56
56
  type: "error",
57
57
  title: t,
58
58
  message: e
@@ -60,67 +60,74 @@ function L() {
60
60
  };
61
61
  }
62
62
  const {
63
- Provider: U,
64
- use: E
65
- } = $({
63
+ Provider: J,
64
+ use: P
65
+ } = S({
66
66
  name: "Notification",
67
- init: L
67
+ init: I
68
68
  });
69
- function O() {
69
+ function K() {
70
70
  const {
71
- notifications: o,
72
- dismiss: s
73
- } = E();
71
+ notifications: i,
72
+ dismiss: a
73
+ } = P();
74
74
  return (() => {
75
- var i = _();
76
- return d(i, u(w, {
75
+ var n = T();
76
+ return u(n, d(_, {
77
77
  get each() {
78
- return o();
78
+ return i();
79
79
  },
80
- children: (n) => u(j, {
81
- notification: n,
82
- onDismiss: () => s(n.id)
80
+ children: (s) => d(R, {
81
+ notification: s,
82
+ onDismiss: () => a(s.id)
83
83
  })
84
- })), i;
84
+ })), n;
85
85
  })();
86
86
  }
87
- function j(o) {
88
- const s = {
87
+ function R(i) {
88
+ const a = {
89
89
  info: "border-l-info",
90
90
  success: "border-l-success",
91
91
  warning: "border-l-warning",
92
92
  error: "border-l-error"
93
- }, i = {
94
- info: () => y(),
95
- success: () => C(),
96
- warning: () => M(),
97
- error: () => S()
98
- };
93
+ }, n = {
94
+ info: () => D(),
95
+ success: () => B(),
96
+ warning: () => L(),
97
+ error: () => A()
98
+ }, s = () => i.notification.type === "error" || i.notification.type === "warning" ? "alert" : "status", f = () => s() === "alert" ? "assertive" : "polite";
99
99
  return (() => {
100
- var n = D(), c = n.firstChild, t = c.firstChild, e = t.nextSibling, l = e.firstChild, a = e.nextSibling;
101
- return d(t, () => i[o.notification.type]()), d(l, () => o.notification.title), d(e, u(m, {
100
+ var t = z(), e = t.firstChild, c = e.firstChild, r = c.nextSibling, p = r.firstChild, b = r.nextSibling;
101
+ return u(c, () => n[i.notification.type]()), u(p, () => i.notification.title), u(r, d(x, {
102
102
  get when() {
103
- return o.notification.message;
103
+ return i.notification.message;
104
104
  },
105
105
  get children() {
106
- var f = N();
107
- return d(f, () => o.notification.message), f;
106
+ var o = E();
107
+ return u(o, () => i.notification.message), o;
108
108
  }
109
- }), null), d(e, u(m, {
109
+ }), null), u(r, d(x, {
110
110
  get when() {
111
- return o.notification.action;
111
+ return i.notification.action;
112
112
  },
113
113
  get children() {
114
- var f = T();
115
- return f.$$click = () => o.notification.action?.onClick(), d(f, () => o.notification.action.label), f;
114
+ var o = j();
115
+ return o.$$click = () => i.notification.action?.onClick(), u(o, () => i.notification.action.label), o;
116
116
  }
117
- }), null), a.$$click = () => o.onDismiss(), g(() => p(n, b("animate-in slide-in-from-right fade-in duration-200", "rounded-lg border border-border border-l-[3px] p-3.5", "shadow-md", "bg-card text-card-foreground", s[o.notification.type]))), n;
117
+ }), null), b.$$click = () => i.onDismiss(), k((o) => {
118
+ var m = N("animate-in slide-in-from-right fade-in duration-200", "rounded-lg border border-border border-l-[3px] p-3.5", "shadow-md", "bg-card text-card-foreground", a[i.notification.type]), v = s(), g = f();
119
+ return m !== o.e && $(t, o.e = m), v !== o.t && h(t, "role", o.t = v), g !== o.a && h(t, "aria-live", o.a = g), o;
120
+ }, {
121
+ e: void 0,
122
+ t: void 0,
123
+ a: void 0
124
+ }), t;
118
125
  })();
119
126
  }
120
- x(["click"]);
127
+ y(["click"]);
121
128
  export {
122
- O as NotificationContainer,
123
- U as NotificationProvider,
124
- L as createNotificationService,
125
- E as useNotification
129
+ K as NotificationContainer,
130
+ J as NotificationProvider,
131
+ I as createNotificationService,
132
+ P as useNotification
126
133
  };
@@ -96,7 +96,7 @@ export declare const floeColorTokenCategories: readonly [{
96
96
  }, {
97
97
  readonly name: "Muted Foreground";
98
98
  readonly variable: "--muted-foreground";
99
- readonly lightValue: "hsl(215 20% 46%)";
99
+ readonly lightValue: "hsl(215 20% 42%)";
100
100
  readonly darkValue: "hsl(215 20% 60%)";
101
101
  readonly description: "Secondary text color for supporting copy.";
102
102
  }, {
@@ -308,7 +308,7 @@ export declare const floeColorTokenCategories: readonly [{
308
308
  }, {
309
309
  readonly name: "Activity Bar Foreground";
310
310
  readonly variable: "--activity-bar-foreground";
311
- readonly lightValue: "hsl(215 20% 46%)";
311
+ readonly lightValue: "hsl(215 20% 42%)";
312
312
  readonly darkValue: "hsl(215 20% 55%)";
313
313
  readonly description: "Default activity bar icon color.";
314
314
  }, {
@@ -646,7 +646,7 @@ export declare const floeDesignTokens: {
646
646
  }, {
647
647
  readonly name: "Muted Foreground";
648
648
  readonly variable: "--muted-foreground";
649
- readonly lightValue: "hsl(215 20% 46%)";
649
+ readonly lightValue: "hsl(215 20% 42%)";
650
650
  readonly darkValue: "hsl(215 20% 60%)";
651
651
  readonly description: "Secondary text color for supporting copy.";
652
652
  }, {
@@ -858,7 +858,7 @@ export declare const floeDesignTokens: {
858
858
  }, {
859
859
  readonly name: "Activity Bar Foreground";
860
860
  readonly variable: "--activity-bar-foreground";
861
- readonly lightValue: "hsl(215 20% 46%)";
861
+ readonly lightValue: "hsl(215 20% 42%)";
862
862
  readonly darkValue: "hsl(215 20% 55%)";
863
863
  readonly description: "Default activity bar icon color.";
864
864
  }, {
@@ -59,7 +59,7 @@ const r = {
59
59
  {
60
60
  name: "Muted Foreground",
61
61
  variable: "--muted-foreground",
62
- lightValue: "hsl(215 20% 46%)",
62
+ lightValue: "hsl(215 20% 42%)",
63
63
  darkValue: "hsl(215 20% 60%)",
64
64
  description: "Secondary text color for supporting copy."
65
65
  },
@@ -313,7 +313,7 @@ const r = {
313
313
  {
314
314
  name: "Activity Bar Foreground",
315
315
  variable: "--activity-bar-foreground",
316
- lightValue: "hsl(215 20% 46%)",
316
+ lightValue: "hsl(215 20% 42%)",
317
317
  darkValue: "hsl(215 20% 55%)",
318
318
  description: "Default activity bar icon color."
319
319
  },
@@ -450,12 +450,48 @@ const r = {
450
450
  ]
451
451
  }
452
452
  ], l = [
453
- { name: "Text XS", size: "11px", lineHeight: "1.5", className: "text-[11px]", description: "Smallest text, captions and labels." },
454
- { name: "Text SM", size: "12px", lineHeight: "1.5", className: "text-xs", description: "Small text, secondary content." },
455
- { name: "Text Base", size: "14px", lineHeight: "1.5", className: "text-sm", description: "Default body text." },
456
- { name: "Text LG", size: "16px", lineHeight: "1.5", className: "text-base", description: "Larger body text and card titles." },
457
- { name: "Text XL", size: "18px", lineHeight: "1.4", className: "text-lg", description: "Section titles." },
458
- { name: "Text 2XL", size: "20px", lineHeight: "1.3", className: "text-xl", description: "Page titles." }
453
+ {
454
+ name: "Text XS",
455
+ size: "11px",
456
+ lineHeight: "1.5",
457
+ className: "text-[11px]",
458
+ description: "Smallest text, captions and labels."
459
+ },
460
+ {
461
+ name: "Text SM",
462
+ size: "12px",
463
+ lineHeight: "1.5",
464
+ className: "text-xs",
465
+ description: "Small text, secondary content."
466
+ },
467
+ {
468
+ name: "Text Base",
469
+ size: "14px",
470
+ lineHeight: "1.5",
471
+ className: "text-sm",
472
+ description: "Default body text."
473
+ },
474
+ {
475
+ name: "Text LG",
476
+ size: "16px",
477
+ lineHeight: "1.5",
478
+ className: "text-base",
479
+ description: "Larger body text and card titles."
480
+ },
481
+ {
482
+ name: "Text XL",
483
+ size: "18px",
484
+ lineHeight: "1.4",
485
+ className: "text-lg",
486
+ description: "Section titles."
487
+ },
488
+ {
489
+ name: "Text 2XL",
490
+ size: "20px",
491
+ lineHeight: "1.3",
492
+ className: "text-xl",
493
+ description: "Page titles."
494
+ }
459
495
  ], n = [
460
496
  {
461
497
  name: "Sans",
@@ -483,7 +519,12 @@ const r = {
483
519
  ], t = [
484
520
  { name: "None", value: "0", variable: "-", className: "rounded-none" },
485
521
  { name: "SM", value: "0.125rem", variable: "-", className: "rounded-sm" },
486
- { name: "Default", value: r["--radius"], variable: "--radius", className: "rounded" },
522
+ {
523
+ name: "Default",
524
+ value: r["--radius"],
525
+ variable: "--radius",
526
+ className: "rounded"
527
+ },
487
528
  { name: "MD", value: "0.5rem", variable: "-", className: "rounded-md" },
488
529
  { name: "LG", value: "0.75rem", variable: "-", className: "rounded-lg" },
489
530
  { name: "XL", value: "1rem", variable: "-", className: "rounded-xl" },
@@ -526,13 +567,13 @@ const r = {
526
567
  usage: "Neon and emphasis effects",
527
568
  description: "Pulsing glow animation for elevated emphasis."
528
569
  }
529
- ], c = i.reduce(
530
- (a, e) => (a.push(...e.tokens), a),
531
- []
532
- );
570
+ ], c = i.reduce((a, e) => (a.push(...e.tokens), a), []);
533
571
  function o(a) {
534
572
  return Object.fromEntries(
535
- c.map((e) => [e.variable, a === "light" ? e.lightValue : e.darkValue])
573
+ c.map((e) => [
574
+ e.variable,
575
+ a === "light" ? e.lightValue : e.darkValue
576
+ ])
536
577
  );
537
578
  }
538
579
  const u = {