@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.
- package/dist/components/index.d.ts +2 -0
- package/dist/components/ui/Accordion.d.ts +16 -0
- package/dist/components/ui/Accordion.js +59 -0
- package/dist/components/ui/Breadcrumb.d.ts +14 -0
- package/dist/components/ui/Breadcrumb.js +72 -0
- package/dist/components/ui/Calendar.d.ts +17 -0
- package/dist/components/ui/Calendar.js +151 -0
- package/dist/components/ui/Checkbox.js +137 -130
- package/dist/components/ui/DataTable.d.ts +33 -0
- package/dist/components/ui/DataTable.js +269 -0
- package/dist/components/ui/DatePicker.d.ts +35 -0
- package/dist/components/ui/DatePicker.js +198 -0
- package/dist/components/ui/Dropdown.d.ts +4 -20
- package/dist/components/ui/Dropdown.js +195 -231
- package/dist/components/ui/Form.d.ts +24 -5
- package/dist/components/ui/Form.js +179 -128
- package/dist/components/ui/Input.d.ts +6 -0
- package/dist/components/ui/Input.js +237 -189
- package/dist/components/ui/Pagination.js +211 -162
- package/dist/components/ui/Popover.d.ts +6 -1
- package/dist/components/ui/Popover.js +75 -56
- package/dist/components/ui/Select.d.ts +46 -0
- package/dist/components/ui/Select.js +414 -0
- package/dist/components/ui/Slider.d.ts +7 -0
- package/dist/components/ui/Slider.js +28 -0
- package/dist/components/ui/Switch.js +41 -32
- package/dist/components/ui/Table.d.ts +9 -0
- package/dist/components/ui/Table.js +97 -0
- package/dist/components/ui/calendarModel.d.ts +6 -0
- package/dist/components/ui/calendarModel.js +37 -0
- package/dist/components/ui/controllable.d.ts +7 -0
- package/dist/components/ui/controllable.js +10 -0
- package/dist/components/ui/dataTableModel.d.ts +18 -0
- package/dist/components/ui/dataTableModel.js +18 -0
- package/dist/components/ui/formFieldContext.d.ts +26 -0
- package/dist/components/ui/formFieldContext.js +40 -0
- package/dist/components/ui/index.d.ts +13 -1
- package/dist/components/ui/picker/PickerBase.js +106 -112
- package/dist/context/LocaleContext.d.ts +55 -0
- package/dist/context/LocaleContext.js +80 -0
- package/dist/context/index.d.ts +1 -0
- package/dist/floe.css +1 -0
- package/dist/full.d.ts +2 -0
- package/dist/full.js +776 -737
- package/dist/index.js +111 -107
- package/dist/standalone.css +1 -0
- package/dist/styles/themes/presets.d.ts +7 -3
- package/dist/styles/themes/presets.js +91 -39
- package/dist/styles.css +1 -1
- package/dist/themes/porcelain-light.css +19 -0
- package/dist/themes/shell-presets.generated.css +62 -49
- package/dist/ui.js +223 -184
- package/dist/workbench-themes.css +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { spread as u, mergeProps as i, memo as m, template as s } from "solid-js/web";
|
|
2
|
+
import { splitProps as c } from "solid-js";
|
|
3
|
+
import { useFormControl as p } from "./formFieldContext.js";
|
|
4
|
+
import { useFloeLocale as v } from "../../context/LocaleContext.js";
|
|
5
|
+
import { cn as f } from "../../utils/cn.js";
|
|
6
|
+
var d = /* @__PURE__ */ s("<input>");
|
|
7
|
+
function h(r) {
|
|
8
|
+
const [e, a] = c(r, ["onValueChange", "valueText", "class"]), o = p(), l = v();
|
|
9
|
+
return (() => {
|
|
10
|
+
var t = d();
|
|
11
|
+
return u(t, i(o, a, {
|
|
12
|
+
type: "range",
|
|
13
|
+
get dir() {
|
|
14
|
+
return l.direction;
|
|
15
|
+
},
|
|
16
|
+
get "aria-valuetext"() {
|
|
17
|
+
return m(() => !!(e.valueText && r.value !== void 0))() ? e.valueText(Number(r.value)) : void 0;
|
|
18
|
+
},
|
|
19
|
+
get class() {
|
|
20
|
+
return f("w-full accent-primary cursor-pointer disabled:opacity-50", e.class);
|
|
21
|
+
},
|
|
22
|
+
onChange: (n) => e.onValueChange?.(n.currentTarget.valueAsNumber)
|
|
23
|
+
}), !1, !1), t;
|
|
24
|
+
})();
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
h as Slider
|
|
28
|
+
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { insert as l, createComponent as
|
|
2
|
-
import { splitProps as
|
|
1
|
+
import { insert as l, createComponent as n, effect as u, className as s, template as h, spread as T, mergeProps as H, setAttribute as I } from "solid-js/web";
|
|
2
|
+
import { splitProps as O, createUniqueId as j, Show as o } from "solid-js";
|
|
3
|
+
import { useFormControl as q } from "./formFieldContext.js";
|
|
3
4
|
import { cn as c } from "../../utils/cn.js";
|
|
4
|
-
var
|
|
5
|
-
const
|
|
5
|
+
var A = /* @__PURE__ */ h('<div class="relative inline-flex items-center shrink-0"><input><div data-floe-surface=inset data-floe-surface-part=switch-track><div data-floe-surface=raised data-floe-surface-part=switch-thumb>'), x = /* @__PURE__ */ h("<span>"), D = /* @__PURE__ */ h('<div class="flex flex-col justify-center min-h-0">'), F = /* @__PURE__ */ h("<label>");
|
|
6
|
+
const L = {
|
|
6
7
|
sm: {
|
|
7
8
|
track: "w-7 h-4",
|
|
8
9
|
thumb: "w-3 h-3",
|
|
@@ -28,77 +29,85 @@ const E = {
|
|
|
28
29
|
trackHeight: 24
|
|
29
30
|
}
|
|
30
31
|
};
|
|
31
|
-
function
|
|
32
|
-
const [e,
|
|
32
|
+
function G(g) {
|
|
33
|
+
const d = q(), [e, w] = O(g, ["checked", "onChange", "size", "label", "description", "labelPosition", "class", "disabled", "id"]), C = j(), y = () => e.id ?? d.id ?? C, _ = () => e.size ?? "md", i = () => L[_()], b = () => e.labelPosition ?? "right", $ = (t) => {
|
|
33
34
|
const r = t.target;
|
|
34
35
|
e.onChange?.(r.checked);
|
|
35
|
-
},
|
|
36
|
-
var t =
|
|
37
|
-
return r
|
|
36
|
+
}, P = () => (() => {
|
|
37
|
+
var t = A(), r = t.firstChild, f = r.nextSibling, z = f.firstChild;
|
|
38
|
+
return T(r, H(d, {
|
|
39
|
+
"data-floe-choice-input": "",
|
|
40
|
+
type: "checkbox",
|
|
41
|
+
role: "switch",
|
|
38
42
|
get id() {
|
|
39
|
-
return
|
|
43
|
+
return y();
|
|
40
44
|
},
|
|
41
45
|
get checked() {
|
|
42
46
|
return e.checked;
|
|
43
47
|
},
|
|
44
48
|
get disabled() {
|
|
45
|
-
return e.disabled;
|
|
49
|
+
return e.disabled ?? d.disabled;
|
|
46
50
|
},
|
|
51
|
+
onClick: (a) => {
|
|
52
|
+
(g.readOnly ?? d.readOnly) && a.preventDefault();
|
|
53
|
+
},
|
|
54
|
+
onChange: $,
|
|
55
|
+
class: "sr-only peer",
|
|
47
56
|
get "aria-checked"() {
|
|
48
57
|
return e.checked;
|
|
49
58
|
}
|
|
50
|
-
},
|
|
51
|
-
var
|
|
52
|
-
return
|
|
59
|
+
}, w), !1, !1), u((a) => {
|
|
60
|
+
var m = e.checked ? "true" : void 0, v = c("rounded-full cursor-pointer", "transition-colors duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)]", i().track, e.checked ? "bg-primary" : "bg-input", e.disabled && "cursor-not-allowed", "peer-focus-visible:ring-2 peer-focus-visible:ring-ring peer-focus-visible:ring-offset-2"), k = c("rounded-full bg-background", "shadow-[var(--floe-elevation-raised)]", "transition-transform duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)]", i().thumb, "absolute top-0.5 left-0.5", e.checked ? i().thumbTranslate : "translate-x-0");
|
|
61
|
+
return m !== a.e && I(f, "data-floe-selected", a.e = m), v !== a.t && s(f, a.t = v), k !== a.a && s(z, a.a = k), a;
|
|
53
62
|
}, {
|
|
54
63
|
e: void 0,
|
|
55
64
|
t: void 0,
|
|
56
65
|
a: void 0
|
|
57
66
|
}), t;
|
|
58
|
-
})(),
|
|
67
|
+
})(), p = () => n(o, {
|
|
59
68
|
get when() {
|
|
60
69
|
return e.label || e.description;
|
|
61
70
|
},
|
|
62
71
|
get children() {
|
|
63
|
-
var t =
|
|
64
|
-
return l(t,
|
|
72
|
+
var t = D();
|
|
73
|
+
return l(t, n(o, {
|
|
65
74
|
get when() {
|
|
66
75
|
return e.label;
|
|
67
76
|
},
|
|
68
77
|
get children() {
|
|
69
|
-
var r =
|
|
70
|
-
return l(r, () => e.label),
|
|
78
|
+
var r = x();
|
|
79
|
+
return l(r, () => e.label), u(() => s(r, c("text-foreground", i().label))), r;
|
|
71
80
|
}
|
|
72
|
-
}), null), l(t,
|
|
81
|
+
}), null), l(t, n(o, {
|
|
73
82
|
get when() {
|
|
74
83
|
return e.description;
|
|
75
84
|
},
|
|
76
85
|
get children() {
|
|
77
|
-
var r =
|
|
78
|
-
return l(r, () => e.description),
|
|
86
|
+
var r = x();
|
|
87
|
+
return l(r, () => e.description), u(() => s(r, c("text-[var(--floe-ink-soft)]", i().description))), r;
|
|
79
88
|
}
|
|
80
89
|
}), null), t;
|
|
81
90
|
}
|
|
82
|
-
}),
|
|
91
|
+
}), S = () => e.description ? "items-start" : "items-center";
|
|
83
92
|
return (() => {
|
|
84
|
-
var t =
|
|
85
|
-
return l(t,
|
|
93
|
+
var t = F();
|
|
94
|
+
return l(t, n(o, {
|
|
86
95
|
get when() {
|
|
87
|
-
return
|
|
96
|
+
return b() === "left";
|
|
88
97
|
},
|
|
89
98
|
get children() {
|
|
90
|
-
return
|
|
99
|
+
return n(p, {});
|
|
91
100
|
}
|
|
92
|
-
}), null), l(t,
|
|
101
|
+
}), null), l(t, n(P, {}), null), l(t, n(o, {
|
|
93
102
|
get when() {
|
|
94
|
-
return
|
|
103
|
+
return b() === "right";
|
|
95
104
|
},
|
|
96
105
|
get children() {
|
|
97
|
-
return
|
|
106
|
+
return n(p, {});
|
|
98
107
|
}
|
|
99
|
-
}), null),
|
|
108
|
+
}), null), u(() => s(t, c("inline-flex gap-2 cursor-pointer select-none", S(), e.disabled && "opacity-50 cursor-not-allowed", e.class))), t;
|
|
100
109
|
})();
|
|
101
110
|
}
|
|
102
111
|
export {
|
|
103
|
-
|
|
112
|
+
G as Switch
|
|
104
113
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type JSX } from 'solid-js';
|
|
2
|
+
export declare function Table(props: JSX.HTMLAttributes<HTMLTableElement>): JSX.Element;
|
|
3
|
+
export declare function TableHeader(props: JSX.HTMLAttributes<HTMLTableSectionElement>): JSX.Element;
|
|
4
|
+
export declare function TableBody(props: JSX.HTMLAttributes<HTMLTableSectionElement>): JSX.Element;
|
|
5
|
+
export declare function TableFooter(props: JSX.HTMLAttributes<HTMLTableSectionElement>): JSX.Element;
|
|
6
|
+
export declare function TableRow(props: JSX.HTMLAttributes<HTMLTableRowElement>): JSX.Element;
|
|
7
|
+
export declare function TableHead(props: JSX.ThHTMLAttributes<HTMLTableCellElement>): JSX.Element;
|
|
8
|
+
export declare function TableCell(props: JSX.TdHTMLAttributes<HTMLTableCellElement>): JSX.Element;
|
|
9
|
+
export declare function TableCaption(props: JSX.HTMLAttributes<HTMLTableCaptionElement>): JSX.Element;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { spread as s, mergeProps as o, template as a } from "solid-js/web";
|
|
2
|
+
import { splitProps as n } from "solid-js";
|
|
3
|
+
import { cn as c } from "../../utils/cn.js";
|
|
4
|
+
var u = /* @__PURE__ */ a("<table>"), f = /* @__PURE__ */ a("<thead>"), d = /* @__PURE__ */ a("<tbody>"), p = /* @__PURE__ */ a("<tfoot>"), b = /* @__PURE__ */ a("<tr>"), m = /* @__PURE__ */ a("<th scope=col>"), i = /* @__PURE__ */ a("<td>"), _ = /* @__PURE__ */ a("<caption>");
|
|
5
|
+
function x(r) {
|
|
6
|
+
const [t, l] = n(r, ["class"]);
|
|
7
|
+
return (() => {
|
|
8
|
+
var e = u();
|
|
9
|
+
return s(e, o({
|
|
10
|
+
get class() {
|
|
11
|
+
return c("w-full caption-bottom border-collapse text-[length:var(--floe-type-body)]", t.class);
|
|
12
|
+
}
|
|
13
|
+
}, l), !1, !1), e;
|
|
14
|
+
})();
|
|
15
|
+
}
|
|
16
|
+
function T(r) {
|
|
17
|
+
const [t, l] = n(r, ["class"]);
|
|
18
|
+
return (() => {
|
|
19
|
+
var e = f();
|
|
20
|
+
return s(e, o({
|
|
21
|
+
get class() {
|
|
22
|
+
return c("border-b border-border text-muted-foreground", t.class);
|
|
23
|
+
}
|
|
24
|
+
}, l), !1, !1), e;
|
|
25
|
+
})();
|
|
26
|
+
}
|
|
27
|
+
function y(r) {
|
|
28
|
+
return (() => {
|
|
29
|
+
var t = d();
|
|
30
|
+
return s(t, r, !1, !1), t;
|
|
31
|
+
})();
|
|
32
|
+
}
|
|
33
|
+
function h(r) {
|
|
34
|
+
const [t, l] = n(r, ["class"]);
|
|
35
|
+
return (() => {
|
|
36
|
+
var e = p();
|
|
37
|
+
return s(e, o({
|
|
38
|
+
get class() {
|
|
39
|
+
return c("border-t border-border font-medium", t.class);
|
|
40
|
+
}
|
|
41
|
+
}, l), !1, !1), e;
|
|
42
|
+
})();
|
|
43
|
+
}
|
|
44
|
+
function w(r) {
|
|
45
|
+
const [t, l] = n(r, ["class"]);
|
|
46
|
+
return (() => {
|
|
47
|
+
var e = b();
|
|
48
|
+
return s(e, o({
|
|
49
|
+
get class() {
|
|
50
|
+
return c("border-b border-border last:border-0 hover:bg-muted/50 data-[selected=true]:bg-accent", t.class);
|
|
51
|
+
}
|
|
52
|
+
}, l), !1, !1), e;
|
|
53
|
+
})();
|
|
54
|
+
}
|
|
55
|
+
function C(r) {
|
|
56
|
+
const [t, l] = n(r, ["class"]);
|
|
57
|
+
return (() => {
|
|
58
|
+
var e = m();
|
|
59
|
+
return s(e, o({
|
|
60
|
+
get class() {
|
|
61
|
+
return c("px-3 py-2 text-start font-medium whitespace-nowrap", t.class);
|
|
62
|
+
}
|
|
63
|
+
}, l), !1, !1), e;
|
|
64
|
+
})();
|
|
65
|
+
}
|
|
66
|
+
function H(r) {
|
|
67
|
+
const [t, l] = n(r, ["class"]);
|
|
68
|
+
return (() => {
|
|
69
|
+
var e = i();
|
|
70
|
+
return s(e, o({
|
|
71
|
+
get class() {
|
|
72
|
+
return c("px-3 py-2 align-middle", t.class);
|
|
73
|
+
}
|
|
74
|
+
}, l), !1, !1), e;
|
|
75
|
+
})();
|
|
76
|
+
}
|
|
77
|
+
function P(r) {
|
|
78
|
+
const [t, l] = n(r, ["class"]);
|
|
79
|
+
return (() => {
|
|
80
|
+
var e = _();
|
|
81
|
+
return s(e, o({
|
|
82
|
+
get class() {
|
|
83
|
+
return c("mt-3 text-caption text-muted-foreground", t.class);
|
|
84
|
+
}
|
|
85
|
+
}, l), !1, !1), e;
|
|
86
|
+
})();
|
|
87
|
+
}
|
|
88
|
+
export {
|
|
89
|
+
x as Table,
|
|
90
|
+
y as TableBody,
|
|
91
|
+
P as TableCaption,
|
|
92
|
+
H as TableCell,
|
|
93
|
+
h as TableFooter,
|
|
94
|
+
C as TableHead,
|
|
95
|
+
T as TableHeader,
|
|
96
|
+
w as TableRow
|
|
97
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Calendar dates are Gregorian civil dates, never instants or implicit UTC. */
|
|
2
|
+
export declare function parseCalendarDate(value: string): Date;
|
|
3
|
+
export declare function formatCalendarDate(date: Date): string;
|
|
4
|
+
export declare function addCalendarDays(value: string, days: number): string;
|
|
5
|
+
export declare function addCalendarMonths(value: string, months: number): string;
|
|
6
|
+
export declare function calendarDays(month: string, weekStartsOn?: number): string[];
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
function o(e) {
|
|
2
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(e))
|
|
3
|
+
throw new Error("Expected a calendar date in YYYY-MM-DD format");
|
|
4
|
+
const [n, t, r] = e.split("-").map(Number), a = /* @__PURE__ */ new Date(0);
|
|
5
|
+
if (a.setUTCHours(12, 0, 0, 0), a.setUTCFullYear(n, t - 1, r), a.getUTCFullYear() !== n || a.getUTCMonth() !== t - 1 || a.getUTCDate() !== r)
|
|
6
|
+
throw new Error("Invalid calendar date");
|
|
7
|
+
return a;
|
|
8
|
+
}
|
|
9
|
+
function s(e) {
|
|
10
|
+
return String(e.getUTCFullYear()).padStart(4, "0") + "-" + String(e.getUTCMonth() + 1).padStart(2, "0") + "-" + String(e.getUTCDate()).padStart(2, "0");
|
|
11
|
+
}
|
|
12
|
+
function C(e, n) {
|
|
13
|
+
const t = o(e);
|
|
14
|
+
return t.setUTCDate(t.getUTCDate() + n), s(t);
|
|
15
|
+
}
|
|
16
|
+
function T(e, n) {
|
|
17
|
+
const t = o(e), r = t.getUTCDate();
|
|
18
|
+
t.setUTCDate(1), t.setUTCMonth(t.getUTCMonth() + n);
|
|
19
|
+
const a = new Date(t.getTime());
|
|
20
|
+
return a.setUTCMonth(a.getUTCMonth() + 1), a.setUTCDate(0), t.setUTCDate(Math.min(r, a.getUTCDate())), s(t);
|
|
21
|
+
}
|
|
22
|
+
function U(e, n = 0) {
|
|
23
|
+
if (!Number.isInteger(n) || n < 0 || n > 6)
|
|
24
|
+
throw new Error("weekStartsOn must be between 0 and 6");
|
|
25
|
+
const t = o(e.slice(0, 7) + "-01"), r = (t.getUTCDay() - n + 7) % 7;
|
|
26
|
+
return Array.from(
|
|
27
|
+
{ length: 42 },
|
|
28
|
+
(a, d) => C(s(t), d - r)
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
C as addCalendarDays,
|
|
33
|
+
T as addCalendarMonths,
|
|
34
|
+
U as calendarDays,
|
|
35
|
+
s as formatCalendarDate,
|
|
36
|
+
o as parseCalendarDate
|
|
37
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Accessor } from 'solid-js';
|
|
2
|
+
/** Controlled callers remain authoritative; omitted values use local state. */
|
|
3
|
+
export declare function createControllableValue<T>(options: {
|
|
4
|
+
value: Accessor<T | undefined>;
|
|
5
|
+
defaultValue: T;
|
|
6
|
+
onChange: (value: T) => void;
|
|
7
|
+
}): readonly [() => T, (next: T) => void];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createSignal as n } from "solid-js";
|
|
2
|
+
function f(e) {
|
|
3
|
+
const [l, r] = n(e.defaultValue), t = () => e.value() ?? l();
|
|
4
|
+
return [t, (a) => {
|
|
5
|
+
Object.is(a, t()) || (e.value() === void 0 && r(() => a), e.onChange(a));
|
|
6
|
+
}];
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
f as createControllableValue
|
|
10
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface TableSort {
|
|
2
|
+
column: string;
|
|
3
|
+
direction: 'asc' | 'desc';
|
|
4
|
+
}
|
|
5
|
+
export interface TableModelOptions<T> {
|
|
6
|
+
rows: readonly T[];
|
|
7
|
+
filter?: (row: T) => boolean;
|
|
8
|
+
compare?: (left: T, right: T) => number;
|
|
9
|
+
page?: number;
|
|
10
|
+
pageSize?: number;
|
|
11
|
+
}
|
|
12
|
+
/** Pure local projection. Remote pagination and authorization remain host owned. */
|
|
13
|
+
export declare function createTableModel<T>(options: TableModelOptions<T>): {
|
|
14
|
+
rows: T[];
|
|
15
|
+
totalRows: number;
|
|
16
|
+
totalPages: number;
|
|
17
|
+
page: number;
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
function s(e) {
|
|
2
|
+
const l = e.filter ? e.rows.filter(e.filter) : [...e.rows], r = e.compare ? l.sort(e.compare) : l, t = e.pageSize ?? Math.max(1, r.length);
|
|
3
|
+
if (!Number.isInteger(t) || t < 1)
|
|
4
|
+
throw new Error("Table pageSize must be a positive integer");
|
|
5
|
+
const i = Math.max(1, Math.ceil(r.length / t)), a = e.page ?? 1;
|
|
6
|
+
if (!Number.isInteger(a) || a < 1)
|
|
7
|
+
throw new Error("Table page must be a positive integer");
|
|
8
|
+
const g = Math.min(a, i);
|
|
9
|
+
return {
|
|
10
|
+
rows: r.slice((g - 1) * t, g * t),
|
|
11
|
+
totalRows: r.length,
|
|
12
|
+
totalPages: i,
|
|
13
|
+
page: g
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
s as createTableModel
|
|
18
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type Accessor } from 'solid-js';
|
|
2
|
+
export interface FormFieldBinding {
|
|
3
|
+
id: Accessor<string>;
|
|
4
|
+
name: Accessor<string | undefined>;
|
|
5
|
+
error: Accessor<string | undefined>;
|
|
6
|
+
required: Accessor<boolean | undefined>;
|
|
7
|
+
disabled: Accessor<boolean | undefined>;
|
|
8
|
+
readOnly: Accessor<boolean | undefined>;
|
|
9
|
+
descriptionIds: Accessor<string[]>;
|
|
10
|
+
messageIds: Accessor<string[]>;
|
|
11
|
+
registerDescription: (id: string) => () => void;
|
|
12
|
+
registerMessage: (id: string, error: Accessor<string | undefined>) => () => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const FormFieldContext: import("solid-js").Context<FormFieldBinding | undefined>;
|
|
15
|
+
export declare function useFormField(): FormFieldBinding | undefined;
|
|
16
|
+
export declare function joinAriaIds(...values: (string | undefined)[]): string | undefined;
|
|
17
|
+
/** Spread these reactive properties on a native or third-party field control. */
|
|
18
|
+
export declare function useFormControl(): {
|
|
19
|
+
readonly id: string | undefined;
|
|
20
|
+
readonly name: string | undefined;
|
|
21
|
+
readonly required: boolean | undefined;
|
|
22
|
+
readonly disabled: boolean | undefined;
|
|
23
|
+
readonly readOnly: boolean | undefined;
|
|
24
|
+
readonly 'aria-invalid': true | undefined;
|
|
25
|
+
readonly 'aria-describedby': string | undefined;
|
|
26
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { useContext as t, createContext as n } from "solid-js";
|
|
2
|
+
const i = n();
|
|
3
|
+
function o() {
|
|
4
|
+
return t(i);
|
|
5
|
+
}
|
|
6
|
+
function d(...e) {
|
|
7
|
+
return [...new Set(e.flatMap((r) => r?.split(/\s+/).filter(Boolean) ?? []))].join(" ") || void 0;
|
|
8
|
+
}
|
|
9
|
+
function a() {
|
|
10
|
+
const e = o();
|
|
11
|
+
return {
|
|
12
|
+
get id() {
|
|
13
|
+
return e?.id();
|
|
14
|
+
},
|
|
15
|
+
get name() {
|
|
16
|
+
return e?.name();
|
|
17
|
+
},
|
|
18
|
+
get required() {
|
|
19
|
+
return e?.required();
|
|
20
|
+
},
|
|
21
|
+
get disabled() {
|
|
22
|
+
return e?.disabled();
|
|
23
|
+
},
|
|
24
|
+
get readOnly() {
|
|
25
|
+
return e?.readOnly();
|
|
26
|
+
},
|
|
27
|
+
get "aria-invalid"() {
|
|
28
|
+
return e?.error() ? !0 : void 0;
|
|
29
|
+
},
|
|
30
|
+
get "aria-describedby"() {
|
|
31
|
+
return d(...e?.descriptionIds() ?? [], ...e?.messageIds() ?? []);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
i as FormFieldContext,
|
|
37
|
+
d as joinAriaIds,
|
|
38
|
+
a as useFormControl,
|
|
39
|
+
o as useFormField
|
|
40
|
+
};
|
|
@@ -17,7 +17,7 @@ export { resolveFloatingWindowViewport, type FloatingWindowRect, type FloatingWi
|
|
|
17
17
|
export { Dropdown, Select, type DropdownProps, type DropdownItem, type SelectProps, } from './Dropdown';
|
|
18
18
|
export { SurfaceFloatingLayer, type SurfaceFloatingLayerPosition, type SurfaceFloatingLayerProps, type SurfaceFloatingLayerSize, } from './SurfaceFloatingLayer';
|
|
19
19
|
export { Tooltip, type TooltipProps } from './Tooltip';
|
|
20
|
-
export { Popover, type PopoverProps, type PopoverPlacement, } from './Popover';
|
|
20
|
+
export { Popover, type PopoverProps, type PopoverTriggerProps, type PopoverPlacement, } from './Popover';
|
|
21
21
|
export { CommandPalette } from './CommandPalette';
|
|
22
22
|
export { InfiniteCanvas, type InfiniteCanvasProps, type InfiniteCanvasPoint, type InfiniteCanvasContextMenuEvent, } from './InfiniteCanvas';
|
|
23
23
|
export { startPointerSession, type PointerSessionController, type PointerSessionEndEvent, type PointerSessionEndReason, type PointerSessionSnapshot, type StartPointerSessionOptions, } from './pointerSession';
|
|
@@ -51,3 +51,15 @@ export { SettingsLayout, SettingsNavigation, SettingsSection, SettingsList, Sett
|
|
|
51
51
|
export { KeyedFor, type KeyedForProps } from './KeyedFor';
|
|
52
52
|
export { DirectoryFavoriteButton } from './picker/DirectoryFavorites';
|
|
53
53
|
export type { DirectoryFavorites } from './picker/DirectoryFavorites';
|
|
54
|
+
export { useFormControl, useFormField, joinAriaIds, type FormFieldBinding } from './formFieldContext';
|
|
55
|
+
export { createControllableValue } from './controllable';
|
|
56
|
+
export { Combobox, MultiSelect, type SelectOption, type SelectBaseProps, type MultiSelectProps } from './Select';
|
|
57
|
+
export { Table, TableHeader, TableBody, TableFooter, TableRow, TableHead, TableCell, TableCaption } from './Table';
|
|
58
|
+
export { DataTable, type DataTableProps, type DataTableColumn } from './DataTable';
|
|
59
|
+
export { createTableModel, type TableSort, type TableModelOptions } from './dataTableModel';
|
|
60
|
+
export { Breadcrumb, type BreadcrumbProps, type BreadcrumbItem } from './Breadcrumb';
|
|
61
|
+
export { Accordion, type AccordionProps, type AccordionItem } from './Accordion';
|
|
62
|
+
export { Slider, type SliderProps } from './Slider';
|
|
63
|
+
export { Calendar, type CalendarProps } from './Calendar';
|
|
64
|
+
export { DatePicker, DateRangePicker, type DatePickerProps, type DateRangePickerProps, type DateRange } from './DatePicker';
|
|
65
|
+
export { parseCalendarDate, formatCalendarDate, addCalendarDays, addCalendarMonths, calendarDays } from './calendarModel';
|