@floegence/floe-webapp-core 0.50.6 → 0.52.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.
Files changed (46) hide show
  1. package/dist/components/chat/input/ChatInput.js +8 -8
  2. package/dist/components/ui/Button.js +16 -13
  3. package/dist/components/ui/Card.js +125 -119
  4. package/dist/components/ui/Checkbox.js +178 -132
  5. package/dist/components/ui/CommandPalette.js +10 -10
  6. package/dist/components/ui/Dialog.d.ts +7 -0
  7. package/dist/components/ui/Dialog.js +160 -114
  8. package/dist/components/ui/DirectoryInput.js +5 -5
  9. package/dist/components/ui/Dropdown.d.ts +2 -0
  10. package/dist/components/ui/Dropdown.js +183 -160
  11. package/dist/components/ui/FloatingWindow.js +211 -199
  12. package/dist/components/ui/HighlightBlock.js +8 -8
  13. package/dist/components/ui/Input.js +40 -40
  14. package/dist/components/ui/Pagination.js +90 -88
  15. package/dist/components/ui/ProcessingIndicator.js +1 -1
  16. package/dist/components/ui/Progress.js +99 -88
  17. package/dist/components/ui/QuoteBlock.js +9 -9
  18. package/dist/components/ui/Radio.js +151 -127
  19. package/dist/components/ui/SegmentedControl.js +26 -25
  20. package/dist/components/ui/Stepper.js +114 -112
  21. package/dist/components/ui/Switch.js +34 -33
  22. package/dist/components/ui/Tabs.js +153 -150
  23. package/dist/components/ui/Tag.js +24 -21
  24. package/dist/components/ui/Tooltip.js +10 -10
  25. package/dist/components/ui/floatingPresence.js +40 -30
  26. package/dist/components/workbench/WorkbenchHud.js +9 -9
  27. package/dist/components/workbench/WorkbenchLockButton.js +4 -4
  28. package/dist/components/workbench/WorkbenchWidget.js +46 -43
  29. package/dist/context/FloeConfigContext.d.ts +5 -1
  30. package/dist/context/FloeConfigContext.js +10 -9
  31. package/dist/context/ThemeContext.d.ts +3 -1
  32. package/dist/context/ThemeContext.js +78 -71
  33. package/dist/floe.css +32 -0
  34. package/dist/full.js +839 -836
  35. package/dist/hooks/useOverlayMask.js +95 -83
  36. package/dist/index.js +150 -147
  37. package/dist/input-focus.css +0 -1
  38. package/dist/styles/themes/index.d.ts +3 -0
  39. package/dist/styles/themes/index.js +40 -31
  40. package/dist/styles/tokens.d.ts +36 -0
  41. package/dist/styles/tokens.js +12 -5
  42. package/dist/styles.css +1 -1
  43. package/dist/surface.css +467 -0
  44. package/dist/themes.d.ts +1 -1
  45. package/dist/ui.css +9 -0
  46. package/package.json +1 -1
@@ -1,100 +1,107 @@
1
- import { createSignal as u, createMemo as L, createEffect as P, onCleanup as $ } from "solid-js";
2
- import { createSimpleContext as I } from "./createSimpleContext.js";
3
- import { useResolvedFloeConfig as J } from "./FloeConfigContext.js";
4
- import { isThemeType as U, getSystemTheme as W, applyTheme as X, applyShellThemeAttribute as z, syncThemeTokenOverrides as A, resolveThemeTokens as Y } from "../styles/themes/index.js";
5
- import { normalizeShellThemeSelection as O, presetSupportsMode as Q } from "../styles/themes/presets.js";
6
- function a(s, r, c) {
7
- if (r.length !== 0)
8
- return s && r.some((i) => i.name === s) ? s : c && r.some((i) => i.name === c) ? c : r[0]?.name;
1
+ import { createSignal as h, createEffect as S, createMemo as Q, onCleanup as R } from "solid-js";
2
+ import { createSimpleContext as te } from "./createSimpleContext.js";
3
+ import { useResolvedFloeConfig as se } from "./FloeConfigContext.js";
4
+ import { isFloeSurfaceStyle as k, applySurfaceStyleAttribute as V, isThemeType as re, getSystemTheme as ne, applyTheme as oe, applyShellThemeAttribute as j, syncThemeTokenOverrides as q, resolveThemeTokens as ce } from "../styles/themes/index.js";
5
+ import { normalizeShellThemeSelection as B, presetSupportsMode as D } from "../styles/themes/presets.js";
6
+ function d(s, n, c) {
7
+ if (n.length !== 0)
8
+ return s && n.some((l) => l.name === s) ? s : c && n.some((l) => l.name === c) ? c : n[0]?.name;
9
9
  }
10
- function Z() {
11
- const s = J(), r = () => s.config.theme.storageKey, c = () => s.config.theme.defaultTheme, i = () => s.config.theme.tokens, o = () => s.config.theme.presets ?? [], g = () => s.config.theme.presetStorageKey ?? `${r()}-preset`, m = () => a(s.config.theme.defaultPreset, o()), l = () => s.config.theme.shellPresets ?? [], y = () => s.config.theme.shellPresetStorageKey ?? `${r()}-shell-preset`, k = () => s.config.theme.defaultShellPreset ?? {}, x = s.persist.load(r(), c()), R = U(x) ? x : c(), [T, V] = u(R), j = s.persist.load(g(), m()), [S, K] = u(a(j, o(), m())), q = s.persist.load(y(), void 0), [p, C] = u(O(q, l(), k())), [B, D] = u(W());
12
- let d = [];
13
- const M = L(() => {
14
- const e = a(S(), o(), m());
10
+ function le() {
11
+ const s = se(), n = () => s.config.theme.storageKey, c = () => s.config.theme.defaultTheme, l = () => s.config.theme.surfaceStyleStorageKey ?? `${n()}-surface-style`, K = s.config.theme.defaultSurfaceStyle, g = k(K) ? K : "standard", x = s.persist.load(l(), g), [b, G] = h(k(x) ? x : g), H = (e) => {
12
+ const t = k(e) ? e : g;
13
+ G(t), s.persist.debouncedSave(l(), t);
14
+ };
15
+ S(() => V(b()));
16
+ const I = () => s.config.theme.tokens, o = () => s.config.theme.presets ?? [], p = () => s.config.theme.presetStorageKey ?? `${n()}-preset`, m = () => d(s.config.theme.defaultPreset, o()), i = () => s.config.theme.shellPresets ?? [], C = () => s.config.theme.shellPresetStorageKey ?? `${n()}-shell-preset`, M = () => s.config.theme.defaultShellPreset ?? {}, w = s.persist.load(n(), c()), J = re(w) ? w : c(), [T, U] = h(J), W = s.persist.load(p(), m()), [y, E] = h(d(W, o(), m())), X = s.persist.load(C(), void 0), [v, F] = h(B(X, i(), M())), [Y, Z] = h(ne());
17
+ let f = [];
18
+ const N = Q(() => {
19
+ const e = d(y(), o(), m());
15
20
  if (e)
16
21
  return o().find((t) => t.name === e);
17
- }), h = () => {
22
+ }), a = () => {
18
23
  const e = T();
19
- return e === "system" ? B() : e;
20
- }, w = (e) => {
21
- const t = p()[e];
24
+ return e === "system" ? Y() : e;
25
+ }, $ = (e) => {
26
+ const t = v()[e];
22
27
  if (t)
23
- return l().find((n) => n.name === t && Q(n, e));
24
- }, E = L(() => w(h()));
25
- if (P(() => {
26
- const e = a(S(), o(), m());
27
- S() !== e && K(e);
28
- }), P(() => {
29
- const e = p(), t = O(e, l(), k());
30
- (e.light !== t.light || e.dark !== t.dark) && C(t);
28
+ return i().find((r) => r.name === t && D(r, e));
29
+ }, A = Q(() => $(a()));
30
+ if (S(() => {
31
+ const e = d(y(), o(), m());
32
+ y() !== e && E(e);
33
+ }), S(() => {
34
+ const e = v(), t = B(e, i(), M());
35
+ (e.light !== t.light || e.dark !== t.dark) && F(t);
31
36
  }), typeof window < "u") {
32
- const e = window.matchMedia("(prefers-color-scheme: dark)"), t = (n) => {
33
- D(n.matches ? "dark" : "light");
37
+ const e = window.matchMedia("(prefers-color-scheme: dark)"), t = (r) => {
38
+ Z(r.matches ? "dark" : "light");
34
39
  };
35
- e.addEventListener("change", t), $(() => e.removeEventListener("change", t));
40
+ e.addEventListener("change", t), R(() => e.removeEventListener("change", t));
36
41
  }
37
- P(() => {
38
- const e = T(), t = h(), n = E();
39
- X(e), z(n?.name), d = A(Y(t, i(), n?.tokens, M()?.tokens), d);
40
- }), $(() => {
41
- z(void 0), d = A(void 0, d);
42
+ S(() => {
43
+ const e = T(), t = a(), r = A();
44
+ oe(e), j(r?.name), f = q(ce(t, I(), r?.tokens, N()?.tokens), f);
45
+ }), R(() => {
46
+ V(void 0), j(void 0), f = q(void 0, f);
42
47
  });
43
- const v = (e) => {
44
- V(e), s.persist.debouncedSave(r(), e);
45
- }, G = () => {
46
- const e = h();
47
- v(e === "light" ? "dark" : "light");
48
- }, H = (e) => {
49
- const t = a(e, o(), m());
50
- if (K(t), !t) {
51
- s.persist.remove(g());
48
+ const P = (e) => {
49
+ U(e), s.persist.debouncedSave(n(), e);
50
+ }, _ = () => {
51
+ const e = a();
52
+ P(e === "light" ? "dark" : "light");
53
+ }, ee = (e) => {
54
+ const t = d(e, o(), m());
55
+ if (E(t), !t) {
56
+ s.persist.remove(p());
52
57
  return;
53
58
  }
54
- s.persist.debouncedSave(g(), t);
55
- }, N = (e, t) => {
56
- const n = l().find((F) => F.name === t && Q(F, e));
57
- if (!n) return !1;
58
- const f = p();
59
- if (f[e] === n.name) return !0;
60
- const b = {
61
- ...f,
59
+ s.persist.debouncedSave(p(), t);
60
+ }, L = (e, t) => {
61
+ const r = i().find((O) => O.name === t && D(O, e));
62
+ if (!r) return !1;
63
+ const u = v();
64
+ if (u[e] === r.name) return !0;
65
+ const z = {
66
+ ...u,
62
67
  version: 1,
63
- [e]: n.name
68
+ [e]: r.name
64
69
  };
65
- return C(b), s.persist.debouncedSave(y(), b), !0;
70
+ return F(z), s.persist.debouncedSave(C(), z), !0;
66
71
  };
67
72
  return {
73
+ surfaceStyle: b,
74
+ setSurfaceStyle: H,
68
75
  theme: T,
69
- resolvedTheme: h,
70
- setTheme: v,
71
- toggleTheme: G,
76
+ resolvedTheme: a,
77
+ setTheme: P,
78
+ toggleTheme: _,
72
79
  themePresets: o,
73
- themePreset: M,
74
- setThemePreset: H,
75
- shellPresets: l,
76
- shellPreset: E,
77
- shellPresetForMode: w,
80
+ themePreset: N,
81
+ setThemePreset: ee,
82
+ shellPresets: i,
83
+ shellPreset: A,
84
+ shellPresetForMode: $,
78
85
  setShellPreset: (e) => {
79
- const t = l().find((f) => f.name === e);
86
+ const t = i().find((u) => u.name === e);
80
87
  if (!t) return;
81
- const n = t.mode === "light" || t.mode === "dark" ? t.mode : h();
82
- N(n, e);
88
+ const r = t.mode === "light" || t.mode === "dark" ? t.mode : a();
89
+ L(r, e);
83
90
  },
84
91
  selectShellTheme: (e, t) => {
85
- N(e, t) && v(e);
92
+ L(e, t) && P(e);
86
93
  }
87
94
  };
88
95
  }
89
96
  const {
90
- Provider: ce,
91
- use: le
92
- } = I({
97
+ Provider: Se,
98
+ use: ge
99
+ } = te({
93
100
  name: "Theme",
94
- init: Z
101
+ init: le
95
102
  });
96
103
  export {
97
- ce as ThemeProvider,
98
- Z as createThemeService,
99
- le as useTheme
104
+ Se as ThemeProvider,
105
+ le as createThemeService,
106
+ ge as useTheme
100
107
  };
package/dist/floe.css CHANGED
@@ -1,4 +1,5 @@
1
1
  @import './input-focus.css';
2
+ @import './surface.css';
2
3
  /*
3
4
  * Floe design tokens + base styles + custom utilities.
4
5
  *
@@ -489,6 +490,37 @@
489
490
  --floe-floating-exit-scale: 0.985;
490
491
  }
491
492
 
493
+ .floe-bottom-drawer-overlay {
494
+ padding: max(1.25rem, env(safe-area-inset-top, 0px))
495
+ max(1.5rem, env(safe-area-inset-right, 0px)) max(1.25rem, env(safe-area-inset-bottom, 0px))
496
+ max(1.5rem, env(safe-area-inset-left, 0px));
497
+ }
498
+
499
+ .floe-bottom-drawer-backdrop {
500
+ background: color-mix(in srgb, var(--foreground) 8%, transparent);
501
+ --floe-floating-enter-duration: 240ms;
502
+ --floe-floating-exit-duration: 180ms;
503
+ }
504
+
505
+ .floe-bottom-drawer-panel {
506
+ --floe-floating-enter-duration: 240ms;
507
+ --floe-floating-exit-duration: 180ms;
508
+ --floe-floating-enter-y: calc(100% + 1.25rem);
509
+ --floe-floating-exit-y: calc(100% + 1.25rem);
510
+ --floe-floating-enter-scale: 1;
511
+ --floe-floating-exit-scale: 1;
512
+ border-radius: 1rem;
513
+ overflow: hidden;
514
+ }
515
+
516
+ @media (max-width: 639px) {
517
+ .floe-bottom-drawer-overlay {
518
+ padding: max(0.75rem, env(safe-area-inset-top, 0px))
519
+ max(0.75rem, env(safe-area-inset-right, 0px)) max(0.75rem, env(safe-area-inset-bottom, 0px))
520
+ max(0.75rem, env(safe-area-inset-left, 0px));
521
+ }
522
+ }
523
+
492
524
  .floe-floating-menu {
493
525
  --floe-floating-enter-duration: 120ms;
494
526
  --floe-floating-exit-duration: 100ms;