@floegence/floe-webapp-core 0.86.76 → 0.87.1

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 (54) hide show
  1. package/dist/components/index.d.ts +2 -0
  2. package/dist/components/ui/Accordion.d.ts +16 -0
  3. package/dist/components/ui/Accordion.js +59 -0
  4. package/dist/components/ui/Breadcrumb.d.ts +14 -0
  5. package/dist/components/ui/Breadcrumb.js +72 -0
  6. package/dist/components/ui/Calendar.d.ts +17 -0
  7. package/dist/components/ui/Calendar.js +151 -0
  8. package/dist/components/ui/Checkbox.js +137 -130
  9. package/dist/components/ui/DataTable.d.ts +33 -0
  10. package/dist/components/ui/DataTable.js +269 -0
  11. package/dist/components/ui/DatePicker.d.ts +35 -0
  12. package/dist/components/ui/DatePicker.js +198 -0
  13. package/dist/components/ui/Dropdown.d.ts +4 -20
  14. package/dist/components/ui/Dropdown.js +195 -231
  15. package/dist/components/ui/Form.d.ts +24 -5
  16. package/dist/components/ui/Form.js +179 -128
  17. package/dist/components/ui/Input.d.ts +6 -0
  18. package/dist/components/ui/Input.js +237 -189
  19. package/dist/components/ui/Pagination.js +211 -162
  20. package/dist/components/ui/Popover.d.ts +6 -1
  21. package/dist/components/ui/Popover.js +75 -56
  22. package/dist/components/ui/Select.d.ts +46 -0
  23. package/dist/components/ui/Select.js +414 -0
  24. package/dist/components/ui/Slider.d.ts +7 -0
  25. package/dist/components/ui/Slider.js +28 -0
  26. package/dist/components/ui/Switch.js +41 -32
  27. package/dist/components/ui/Table.d.ts +9 -0
  28. package/dist/components/ui/Table.js +97 -0
  29. package/dist/components/ui/calendarModel.d.ts +6 -0
  30. package/dist/components/ui/calendarModel.js +37 -0
  31. package/dist/components/ui/controllable.d.ts +7 -0
  32. package/dist/components/ui/controllable.js +10 -0
  33. package/dist/components/ui/dataTableModel.d.ts +18 -0
  34. package/dist/components/ui/dataTableModel.js +18 -0
  35. package/dist/components/ui/formFieldContext.d.ts +26 -0
  36. package/dist/components/ui/formFieldContext.js +40 -0
  37. package/dist/components/ui/index.d.ts +13 -1
  38. package/dist/components/ui/picker/PickerBase.js +106 -112
  39. package/dist/context/LocaleContext.d.ts +55 -0
  40. package/dist/context/LocaleContext.js +80 -0
  41. package/dist/context/index.d.ts +1 -0
  42. package/dist/floe.css +1 -0
  43. package/dist/full.d.ts +2 -0
  44. package/dist/full.js +776 -737
  45. package/dist/index.js +111 -107
  46. package/dist/standalone.css +1 -0
  47. package/dist/styles/themes/presets.d.ts +7 -3
  48. package/dist/styles/themes/presets.js +91 -39
  49. package/dist/styles.css +1 -1
  50. package/dist/themes/porcelain-light.css +19 -0
  51. package/dist/themes/shell-presets.generated.css +62 -49
  52. package/dist/ui.js +223 -184
  53. package/dist/workbench-themes.css +3 -0
  54. package/package.json +1 -1
@@ -6,3 +6,5 @@ export * from './launchpad';
6
6
  export * from './file-browser';
7
7
  export * from './chat';
8
8
  export { Tag, type TagProps, type TagVariant, type TagSize } from './ui';
9
+ export { Calendar } from './icons';
10
+ export { Breadcrumb, type BreadcrumbProps } from './file-browser';
@@ -0,0 +1,16 @@
1
+ import { type JSX } from 'solid-js';
2
+ export interface AccordionItem {
3
+ id: string;
4
+ title: JSX.Element;
5
+ content: JSX.Element;
6
+ disabled?: boolean;
7
+ }
8
+ export interface AccordionProps {
9
+ items: readonly AccordionItem[];
10
+ value?: string[];
11
+ defaultValue?: string[];
12
+ onValueChange?: (value: string[]) => void;
13
+ multiple?: boolean;
14
+ class?: string;
15
+ }
16
+ export declare function Accordion(props: AccordionProps): JSX.Element;
@@ -0,0 +1,59 @@
1
+ import { insert as u, createComponent as S, effect as V, setAttribute as d, className as U, template as $, use as j, delegateEvents as I } from "solid-js/web";
2
+ import { createUniqueId as L, For as N } from "solid-js";
3
+ import { createControllableValue as O } from "./controllable.js";
4
+ import { useFloeLocale as _ } from "../../context/LocaleContext.js";
5
+ var z = /* @__PURE__ */ $("<div>"), B = /* @__PURE__ */ $('<section class="border-b border-border"><h3><button type=button data-accordion-trigger class="flex w-full items-center justify-between gap-3 py-3 text-start font-medium focus-visible:outline focus-visible:outline-2 disabled:opacity-50"><span aria-hidden=true></span></button></h3><div><div class=pb-3>');
6
+ function P(l) {
7
+ const D = _(), E = L(), [v, q] = O({
8
+ value: () => l.value,
9
+ defaultValue: l.defaultValue ?? [],
10
+ onChange: (t) => l.onValueChange?.(t)
11
+ });
12
+ let f;
13
+ const F = (t) => {
14
+ if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(t.key)) return;
15
+ const i = Array.from(f?.querySelectorAll("[data-accordion-trigger]:not(:disabled)") ?? []), r = i.indexOf(t.target);
16
+ if (r < 0) return;
17
+ t.preventDefault();
18
+ const a = t.key === "Home" ? 0 : t.key === "End" ? i.length - 1 : (r + (t.key === "ArrowDown" ? 1 : -1) + i.length) % i.length;
19
+ i[a]?.focus();
20
+ };
21
+ return (() => {
22
+ var t = z();
23
+ t.$$keydown = F;
24
+ var i = f;
25
+ return typeof i == "function" ? j(i, t) : f = t, u(t, S(N, {
26
+ get each() {
27
+ return l.items;
28
+ },
29
+ children: (r, a) => {
30
+ const o = () => E + "-" + a(), s = () => v().includes(r.id);
31
+ return (() => {
32
+ var b = B(), g = b.firstChild, n = g.firstChild, h = n.firstChild, c = g.nextSibling, H = c.firstChild;
33
+ return n.$$click = () => q(s() ? v().filter((e) => e !== r.id) : l.multiple ? [...v(), r.id] : [r.id]), u(n, () => r.title, h), u(h, () => s() ? "−" : "+"), u(H, () => r.content), V((e) => {
34
+ var m = o() + "-trigger", y = r.disabled, w = s(), x = o() + "-panel", k = o() + "-panel", C = o() + "-trigger", A = !s();
35
+ return m !== e.e && d(n, "id", e.e = m), y !== e.t && (n.disabled = e.t = y), w !== e.a && d(n, "aria-expanded", e.a = w), x !== e.o && d(n, "aria-controls", e.o = x), k !== e.i && d(c, "id", e.i = k), C !== e.n && d(c, "aria-labelledby", e.n = C), A !== e.s && (c.hidden = e.s = A), e;
36
+ }, {
37
+ e: void 0,
38
+ t: void 0,
39
+ a: void 0,
40
+ o: void 0,
41
+ i: void 0,
42
+ n: void 0,
43
+ s: void 0
44
+ }), b;
45
+ })();
46
+ }
47
+ })), V((r) => {
48
+ var a = D.direction, o = l.class;
49
+ return a !== r.e && d(t, "dir", r.e = a), o !== r.t && U(t, r.t = o), r;
50
+ }, {
51
+ e: void 0,
52
+ t: void 0
53
+ }), t;
54
+ })();
55
+ }
56
+ I(["keydown", "click"]);
57
+ export {
58
+ P as Accordion
59
+ };
@@ -0,0 +1,14 @@
1
+ import { type JSX } from 'solid-js';
2
+ export interface BreadcrumbItem {
3
+ id: string;
4
+ label: string;
5
+ href?: string;
6
+ onSelect?: () => void;
7
+ }
8
+ export interface BreadcrumbProps {
9
+ items: readonly BreadcrumbItem[];
10
+ ariaLabel?: string;
11
+ class?: string;
12
+ separator?: JSX.Element;
13
+ }
14
+ export declare function Breadcrumb(props: BreadcrumbProps): JSX.Element;
@@ -0,0 +1,72 @@
1
+ import { insert as t, createComponent as c, effect as g, setAttribute as s, className as b, template as n, delegateEvents as x } from "solid-js/web";
2
+ import { For as $, Show as d } from "solid-js";
3
+ import { useFloeLocale as _ } from "../../context/LocaleContext.js";
4
+ import { cn as w } from "../../utils/cn.js";
5
+ var p = /* @__PURE__ */ n('<nav><ol class="flex flex-wrap items-center gap-1 text-[length:var(--floe-type-control)]">'), k = /* @__PURE__ */ n("<span aria-hidden=true class=text-muted-foreground>"), y = /* @__PURE__ */ n("<a>"), C = /* @__PURE__ */ n('<li class="flex min-w-0 items-center gap-1">'), F = /* @__PURE__ */ n("<span aria-current=page class=break-words>"), L = /* @__PURE__ */ n('<button type=button class="rounded-sm px-1 text-muted-foreground hover:text-foreground focus-visible:outline focus-visible:outline-2">');
6
+ function N(a) {
7
+ const v = _();
8
+ return (() => {
9
+ var o = p(), h = o.firstChild;
10
+ return t(h, c($, {
11
+ get each() {
12
+ return a.items;
13
+ },
14
+ children: (r, u) => (() => {
15
+ var l = C();
16
+ return t(l, c(d, {
17
+ get when() {
18
+ return u() > 0;
19
+ },
20
+ get children() {
21
+ var e = k();
22
+ return t(e, () => a.separator ?? "/"), e;
23
+ }
24
+ }), null), t(l, c(d, {
25
+ get when() {
26
+ return u() < a.items.length - 1;
27
+ },
28
+ get fallback() {
29
+ return (() => {
30
+ var e = F();
31
+ return t(e, () => r.label), e;
32
+ })();
33
+ },
34
+ get children() {
35
+ return c(d, {
36
+ get when() {
37
+ return r.href;
38
+ },
39
+ get fallback() {
40
+ return (() => {
41
+ var e = L();
42
+ return e.$$click = () => r.onSelect?.(), t(e, () => r.label), e;
43
+ })();
44
+ },
45
+ get children() {
46
+ var e = y();
47
+ return t(e, () => r.label), g((i) => {
48
+ var f = r.href, m = w("rounded-sm px-1 text-muted-foreground hover:text-foreground focus-visible:outline focus-visible:outline-2");
49
+ return f !== i.e && s(e, "href", i.e = f), m !== i.t && b(e, i.t = m), i;
50
+ }, {
51
+ e: void 0,
52
+ t: void 0
53
+ }), e;
54
+ }
55
+ });
56
+ }
57
+ }), null), l;
58
+ })()
59
+ })), g((r) => {
60
+ var u = a.ariaLabel ?? v.t("breadcrumb"), l = v.direction, e = a.class;
61
+ return u !== r.e && s(o, "aria-label", r.e = u), l !== r.t && s(o, "dir", r.t = l), e !== r.a && b(o, r.a = e), r;
62
+ }, {
63
+ e: void 0,
64
+ t: void 0,
65
+ a: void 0
66
+ }), o;
67
+ })();
68
+ }
69
+ x(["click"]);
70
+ export {
71
+ N as Breadcrumb
72
+ };
@@ -0,0 +1,17 @@
1
+ export interface CalendarProps {
2
+ autoFocus?: boolean;
3
+ value?: string;
4
+ defaultValue?: string;
5
+ onChange?: (date: string) => void;
6
+ month?: string;
7
+ defaultMonth?: string;
8
+ onMonthChange?: (month: string) => void;
9
+ min?: string;
10
+ max?: string;
11
+ disabled?: boolean;
12
+ isDateDisabled?: (date: string) => boolean;
13
+ weekStartsOn?: number;
14
+ ariaLabel?: string;
15
+ class?: string;
16
+ }
17
+ export declare function Calendar(props: CalendarProps): import("solid-js").JSX.Element;
@@ -0,0 +1,151 @@
1
+ import { insert as u, createComponent as g, setAttribute as d, effect as $, className as B, template as y, use as J, delegateEvents as Q } from "solid-js/web";
2
+ import { createUniqueId as X, untrack as K, createSignal as p, createMemo as ee, onMount as te, For as D } from "solid-js";
3
+ import { useFloeLocale as ae } from "../../context/LocaleContext.js";
4
+ import { cn as P } from "../../utils/cn.js";
5
+ import { createControllableValue as W } from "./controllable.js";
6
+ import { Button as j } from "./Button.js";
7
+ import { calendarDays as ie, parseCalendarDate as f, addCalendarMonths as M, addCalendarDays as b } from "./calendarModel.js";
8
+ var H = /* @__PURE__ */ y("<span aria-hidden=true>"), le = /* @__PURE__ */ y('<div><div class="mb-2 flex items-center justify-between gap-2"><span aria-live=polite class="text-sm font-medium"></span></div><table role=grid class="w-full table-fixed border-collapse"><thead><tr></tr></thead><tbody>'), ne = /* @__PURE__ */ y('<th scope=col class="pb-1 text-caption font-normal text-muted-foreground"><abbr class=no-underline>'), re = /* @__PURE__ */ y("<tr>"), oe = /* @__PURE__ */ y('<td class="p-0.5 text-center"><button type=button>');
9
+ function ce() {
10
+ const e = /* @__PURE__ */ new Date();
11
+ return String(e.getFullYear()).padStart(4, "0") + "-" + String(e.getMonth() + 1).padStart(2, "0") + "-" + String(e.getDate()).padStart(2, "0");
12
+ }
13
+ function he(e) {
14
+ const o = ae(), _ = X(), U = K(() => e.defaultMonth || e.value || e.defaultValue || ce()), [m, k] = W({
15
+ value: () => e.month,
16
+ defaultValue: U,
17
+ onChange: (t) => e.onMonthChange?.(t)
18
+ }), [T, I] = W({
19
+ value: () => e.value,
20
+ defaultValue: e.defaultValue ?? "",
21
+ onChange: (t) => e.onChange?.(t)
22
+ }), [w, V] = p(K(() => e.value || e.defaultValue || U)), x = ee(() => ie(m(), e.weekStartsOn ?? 0)), h = (t) => !!(e.disabled || e.min && t < e.min || e.max && t > e.max || e.isDateDisabled?.(t)), N = () => x().includes(w()) && !h(w()) ? w() : x().find((t) => t.startsWith(m().slice(0, 7)) && !h(t));
23
+ let C;
24
+ te(() => {
25
+ e.autoFocus && C?.querySelector('[tabindex="0"]')?.focus();
26
+ });
27
+ const A = (t) => k(M(m().slice(0, 7) + "-01", t)), R = (t, n) => {
28
+ let l;
29
+ switch (t.key) {
30
+ case "ArrowLeft":
31
+ l = b(n, o.direction === "rtl" ? 1 : -1);
32
+ break;
33
+ case "ArrowRight":
34
+ l = b(n, o.direction === "rtl" ? -1 : 1);
35
+ break;
36
+ case "ArrowUp":
37
+ l = b(n, -7);
38
+ break;
39
+ case "ArrowDown":
40
+ l = b(n, 7);
41
+ break;
42
+ case "PageUp":
43
+ l = M(n, t.shiftKey ? -12 : -1);
44
+ break;
45
+ case "PageDown":
46
+ l = M(n, t.shiftKey ? 12 : 1);
47
+ break;
48
+ case "Home":
49
+ l = b(n, -((f(n).getUTCDay() - (e.weekStartsOn ?? 0) + 7) % 7));
50
+ break;
51
+ case "End":
52
+ l = b(n, 6 - (f(n).getUTCDay() - (e.weekStartsOn ?? 0) + 7) % 7);
53
+ break;
54
+ default:
55
+ return;
56
+ }
57
+ t.preventDefault(), e.min && l < e.min && (l = e.min), e.max && l > e.max && (l = e.max), V(l), k(l.slice(0, 7) + "-01"), queueMicrotask(() => C?.querySelector('[data-date="' + l + '"]')?.focus());
58
+ };
59
+ return (() => {
60
+ var t = le(), n = t.firstChild, l = n.firstChild, S = n.nextSibling, F = S.firstChild, Y = F.firstChild, G = F.nextSibling, L = C;
61
+ return typeof L == "function" ? J(L, t) : C = t, u(n, g(j, {
62
+ size: "icon",
63
+ variant: "ghost",
64
+ get "aria-label"() {
65
+ return o.t("previousMonth");
66
+ },
67
+ get disabled() {
68
+ return e.disabled || !!e.min && m().slice(0, 7) <= e.min.slice(0, 7);
69
+ },
70
+ onClick: () => A(-1),
71
+ get children() {
72
+ var a = H();
73
+ return u(a, () => o.direction === "rtl" ? "›" : "‹"), a;
74
+ }
75
+ }), l), d(l, "id", _ + "-month"), u(l, () => o.date(f(m().slice(0, 7) + "-01"), {
76
+ month: "long",
77
+ year: "numeric",
78
+ timeZone: "UTC",
79
+ calendar: "gregory"
80
+ })), u(n, g(j, {
81
+ size: "icon",
82
+ variant: "ghost",
83
+ get "aria-label"() {
84
+ return o.t("nextMonth");
85
+ },
86
+ get disabled() {
87
+ return e.disabled || !!e.max && m().slice(0, 7) >= e.max.slice(0, 7);
88
+ },
89
+ onClick: () => A(1),
90
+ get children() {
91
+ var a = H();
92
+ return u(a, () => o.direction === "rtl" ? "‹" : "›"), a;
93
+ }
94
+ }), null), u(Y, g(D, {
95
+ get each() {
96
+ return x().slice(0, 7);
97
+ },
98
+ children: (a) => (() => {
99
+ var s = ne(), i = s.firstChild;
100
+ return u(i, () => o.date(f(a), {
101
+ weekday: "short",
102
+ timeZone: "UTC"
103
+ })), $(() => d(i, "title", o.date(f(a), {
104
+ weekday: "long",
105
+ timeZone: "UTC"
106
+ }))), s;
107
+ })()
108
+ })), u(G, g(D, {
109
+ each: [0, 1, 2, 3, 4, 5],
110
+ children: (a) => (() => {
111
+ var s = re();
112
+ return u(s, g(D, {
113
+ get each() {
114
+ return x().slice(a * 7, a * 7 + 7);
115
+ },
116
+ children: (i) => (() => {
117
+ var v = oe(), c = v.firstChild;
118
+ return c.$$click = () => {
119
+ h(i) || (I(i), k(i.slice(0, 7) + "-01"));
120
+ }, c.$$keydown = (r) => R(r, i), c.addEventListener("focus", () => V(i)), d(c, "data-date", i), u(c, () => o.number(f(i).getUTCDate())), $((r) => {
121
+ var q = T() === i, Z = N() === i ? 0 : -1, E = h(i) || void 0, O = o.date(f(i), {
122
+ dateStyle: "full",
123
+ timeZone: "UTC",
124
+ calendar: "gregory"
125
+ }), z = P("h-8 w-full rounded-control text-xs focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1", T() === i ? "bg-primary text-primary-foreground" : "hover:bg-accent", !i.startsWith(m().slice(0, 7)) && "text-muted-foreground", h(i) && "opacity-40");
126
+ return q !== r.e && d(v, "aria-selected", r.e = q), Z !== r.t && d(c, "tabindex", r.t = Z), E !== r.a && d(c, "aria-disabled", r.a = E), O !== r.o && d(c, "aria-label", r.o = O), z !== r.i && B(c, r.i = z), r;
127
+ }, {
128
+ e: void 0,
129
+ t: void 0,
130
+ a: void 0,
131
+ o: void 0,
132
+ i: void 0
133
+ }), v;
134
+ })()
135
+ })), s;
136
+ })()
137
+ })), $((a) => {
138
+ var s = o.direction, i = P("w-64 max-w-full p-2", e.class), v = e.ariaLabel, c = e.ariaLabel ? void 0 : _ + "-month";
139
+ return s !== a.e && d(t, "dir", a.e = s), i !== a.t && B(t, a.t = i), v !== a.a && d(S, "aria-label", a.a = v), c !== a.o && d(S, "aria-labelledby", a.o = c), a;
140
+ }, {
141
+ e: void 0,
142
+ t: void 0,
143
+ a: void 0,
144
+ o: void 0
145
+ }), t;
146
+ })();
147
+ }
148
+ Q(["keydown", "click"]);
149
+ export {
150
+ he as Calendar
151
+ };