@floegence/floe-webapp-core 0.101.5 → 0.101.9
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/ui/SettingsDisclosure.d.ts +14 -0
- package/dist/components/ui/SettingsDisclosure.js +77 -0
- package/dist/components/ui/dialogHeightMotion.js +24 -25
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/full.js +282 -280
- package/dist/styles.css +1 -1
- package/dist/ui.css +28 -0
- package/dist/ui.js +82 -80
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type JSX } from 'solid-js';
|
|
2
|
+
export interface SettingsDisclosureProps {
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
open?: boolean;
|
|
6
|
+
defaultOpen?: boolean;
|
|
7
|
+
onOpenChange?: (open: boolean) => void;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
hidden?: boolean;
|
|
10
|
+
class?: string;
|
|
11
|
+
children: JSX.Element;
|
|
12
|
+
}
|
|
13
|
+
/** A retained settings group. Hosts still own draft and portalled-control authority. */
|
|
14
|
+
export declare function SettingsDisclosure(props: SettingsDisclosureProps): JSX.Element;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { createComponent as f, setAttribute as n, insert as a, effect as m, use as $, template as g, delegateEvents as y } from "solid-js/web";
|
|
2
|
+
import { createUniqueId as S, createMemo as w, createRenderEffect as E, Show as b } from "solid-js";
|
|
3
|
+
import { ChevronRight as O } from "../icons/index.js";
|
|
4
|
+
import { cn as R } from "../../utils/cn.js";
|
|
5
|
+
import { createControllableValue as k } from "./controllable.js";
|
|
6
|
+
import { SettingsList as x } from "./Settings.js";
|
|
7
|
+
var V = /* @__PURE__ */ g("<span class=floe-settings-disclosure__description>"), q = /* @__PURE__ */ g("<button type=button class=floe-settings-disclosure__trigger><span class=floe-settings-disclosure__heading><span>"), A = /* @__PURE__ */ g("<div class=floe-settings-disclosure__content>"), D = /* @__PURE__ */ g("<div class=floe-settings-disclosure__panel><div class=floe-settings-disclosure__clip>");
|
|
8
|
+
function B(i) {
|
|
9
|
+
const l = S(), [s, C] = k({
|
|
10
|
+
value: () => i.open,
|
|
11
|
+
defaultValue: i.defaultOpen ?? !1,
|
|
12
|
+
onChange: (e) => i.onOpenChange?.(e)
|
|
13
|
+
}), p = w((e) => e || s(), !1);
|
|
14
|
+
let c, v;
|
|
15
|
+
return E(() => {
|
|
16
|
+
!s() && v?.contains(document.activeElement) && c?.getClientRects().length && c.focus({
|
|
17
|
+
preventScroll: !0
|
|
18
|
+
});
|
|
19
|
+
}), f(x, {
|
|
20
|
+
get class() {
|
|
21
|
+
return R("floe-settings-disclosure", i.class);
|
|
22
|
+
},
|
|
23
|
+
get hidden() {
|
|
24
|
+
return i.hidden;
|
|
25
|
+
},
|
|
26
|
+
get "data-open"() {
|
|
27
|
+
return s();
|
|
28
|
+
},
|
|
29
|
+
get children() {
|
|
30
|
+
return [(() => {
|
|
31
|
+
var e = q(), u = e.firstChild, d = u.firstChild;
|
|
32
|
+
e.$$click = () => C(!s());
|
|
33
|
+
var r = c;
|
|
34
|
+
return typeof r == "function" ? $(r, e) : c = e, n(e, "id", `${l}-trigger`), n(e, "aria-labelledby", `${l}-title`), n(e, "aria-controls", `${l}-panel`), n(d, "id", `${l}-title`), a(d, () => i.title), a(u, f(b, {
|
|
35
|
+
get when() {
|
|
36
|
+
return i.description;
|
|
37
|
+
},
|
|
38
|
+
get children() {
|
|
39
|
+
var t = V();
|
|
40
|
+
return n(t, "id", `${l}-description`), a(t, () => i.description), t;
|
|
41
|
+
}
|
|
42
|
+
}), null), a(e, f(O, {
|
|
43
|
+
class: "floe-settings-disclosure__chevron",
|
|
44
|
+
"aria-hidden": "true"
|
|
45
|
+
}), null), m((t) => {
|
|
46
|
+
var o = s(), _ = i.description ? `${l}-description` : void 0, h = i.disabled;
|
|
47
|
+
return o !== t.e && n(e, "aria-expanded", t.e = o), _ !== t.t && n(e, "aria-describedby", t.t = _), h !== t.a && (e.disabled = t.a = h), t;
|
|
48
|
+
}, {
|
|
49
|
+
e: void 0,
|
|
50
|
+
t: void 0,
|
|
51
|
+
a: void 0
|
|
52
|
+
}), e;
|
|
53
|
+
})(), (() => {
|
|
54
|
+
var e = D(), u = e.firstChild, d = v;
|
|
55
|
+
return typeof d == "function" ? $(d, e) : v = e, n(e, "id", `${l}-panel`), n(e, "aria-labelledby", `${l}-trigger`), a(u, f(b, {
|
|
56
|
+
get when() {
|
|
57
|
+
return p();
|
|
58
|
+
},
|
|
59
|
+
get children() {
|
|
60
|
+
var r = A();
|
|
61
|
+
return a(r, () => i.children), r;
|
|
62
|
+
}
|
|
63
|
+
})), m((r) => {
|
|
64
|
+
var t = !s(), o = !s();
|
|
65
|
+
return t !== r.e && n(e, "aria-hidden", r.e = t), o !== r.t && (e.inert = r.t = o), r;
|
|
66
|
+
}, {
|
|
67
|
+
e: void 0,
|
|
68
|
+
t: void 0
|
|
69
|
+
}), e;
|
|
70
|
+
})()];
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
y(["click"]);
|
|
75
|
+
export {
|
|
76
|
+
B as SettingsDisclosure
|
|
77
|
+
};
|
|
@@ -2,46 +2,45 @@ function g() {
|
|
|
2
2
|
const e = globalThis.matchMedia;
|
|
3
3
|
return typeof e != "function" ? !1 : e.call(globalThis, "(prefers-reduced-motion: reduce)").matches;
|
|
4
4
|
}
|
|
5
|
-
function p(e,
|
|
5
|
+
function p(e, c = {}) {
|
|
6
6
|
const u = globalThis.ResizeObserver;
|
|
7
7
|
if (typeof u != "function") return () => {
|
|
8
8
|
};
|
|
9
|
-
const
|
|
10
|
-
let
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
const
|
|
15
|
-
if (
|
|
9
|
+
const l = () => e.offsetHeight, d = () => typeof e.getAnimations == "function" && e.getAnimations().some((n) => n !== t && n.playState === "running");
|
|
10
|
+
let o = l(), t = null, s = !1, i = null;
|
|
11
|
+
const f = () => {
|
|
12
|
+
t = null, e.style.willChange = "", !s && i && i.observe(e, { box: "border-box" });
|
|
13
|
+
}, b = (n) => {
|
|
14
|
+
const a = o;
|
|
15
|
+
if (o = n, !Number.isFinite(a) || Math.abs(a - n) < 0.5 || g()) return;
|
|
16
16
|
i?.unobserve(e);
|
|
17
|
-
const
|
|
18
|
-
[{ height: `${
|
|
17
|
+
const r = e.animate(
|
|
18
|
+
[{ height: `${a}px` }, { height: `${n}px` }],
|
|
19
19
|
{
|
|
20
20
|
duration: 220,
|
|
21
21
|
easing: "cubic-bezier(0.22, 1, 0.36, 1)",
|
|
22
22
|
fill: "none"
|
|
23
23
|
}
|
|
24
24
|
);
|
|
25
|
-
|
|
26
|
-
if (
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
Math.abs(
|
|
30
|
-
}),
|
|
31
|
-
|
|
25
|
+
t = r, e.style.willChange = "height", r.addEventListener("finish", () => {
|
|
26
|
+
if (s) return;
|
|
27
|
+
f();
|
|
28
|
+
const h = l();
|
|
29
|
+
Math.abs(h - o) >= 0.5 && b(h);
|
|
30
|
+
}), r.oncancel = () => {
|
|
31
|
+
s || f();
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
|
-
return i = new u((
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
a = s;
|
|
34
|
+
return i = new u((n) => {
|
|
35
|
+
if (!n[n.length - 1] || t) return;
|
|
36
|
+
const r = l();
|
|
37
|
+
if (c.isSettled && !c.isSettled() || d()) {
|
|
38
|
+
o = r;
|
|
40
39
|
return;
|
|
41
40
|
}
|
|
42
|
-
|
|
41
|
+
b(r);
|
|
43
42
|
}), i.observe(e, { box: "border-box" }), () => {
|
|
44
|
-
|
|
43
|
+
s = !0, i.disconnect(), t?.cancel(), t = null, e.style.willChange = "";
|
|
45
44
|
};
|
|
46
45
|
}
|
|
47
46
|
export {
|
|
@@ -69,3 +69,4 @@ export { DatePicker, DateRangePicker, type DatePickerProps, type DateRangePicker
|
|
|
69
69
|
export { parseCalendarDate, formatCalendarDate, addCalendarDays, addCalendarMonths, calendarDays, } from './calendarModel';
|
|
70
70
|
export { RetainedPanel, type RetainedPanelProps } from './RetainedPanel';
|
|
71
71
|
export { ThemePicker, type ThemePickerProps } from "./ThemePicker";
|
|
72
|
+
export { SettingsDisclosure, type SettingsDisclosureProps } from './SettingsDisclosure';
|