@gemologic/sheen 0.2.1 → 0.3.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.
- package/README.md +1 -1
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/ai.d.ts +8 -0
- package/dist/ai.js +5 -0
- package/dist/core.d.ts +11 -4
- package/dist/core.js +32 -28
- package/dist/formisch.js +1 -2
- package/dist/forms.d.ts +2 -0
- package/dist/forms.js +16 -15
- package/dist/index.d.ts +25 -5
- package/dist/index.js +86 -76
- package/dist/layout/Layout.js +1 -2
- package/dist/metadata.js +1 -2
- package/dist/navigation.d.ts +2 -1
- package/dist/navigation.js +16 -16
- package/dist/primitives/Accordion.js +9 -9
- package/dist/primitives/ActivityTimeline.js +57 -49
- package/dist/primitives/AlertDialog.js +1 -2
- package/dist/primitives/Avatar.js +16 -17
- package/dist/primitives/Board.d.ts +39 -0
- package/dist/primitives/Board.js +471 -0
- package/dist/primitives/Breadcrumb.js +1 -2
- package/dist/primitives/Button.js +38 -27
- package/dist/primitives/ButtonGroup.js +1 -2
- package/dist/primitives/Checkbox.js +1 -2
- package/dist/primitives/CheckboxGroup.js +11 -12
- package/dist/primitives/Collapsible.js +6 -6
- package/dist/primitives/Combobox.js +203 -201
- package/dist/primitives/CommandPalette.js +2 -4
- package/dist/primitives/ConfirmDialog.js +5 -6
- package/dist/primitives/ContextMenu.js +7 -8
- package/dist/primitives/Conversation.d.ts +17 -0
- package/dist/primitives/Conversation.js +107 -0
- package/dist/primitives/DescriptionList.js +1 -2
- package/dist/primitives/Dialog.js +101 -68
- package/dist/primitives/Drawer.js +12 -13
- package/dist/primitives/DropdownMenu.js +163 -157
- package/dist/primitives/EditableTextField.js +3 -8
- package/dist/primitives/EmptyState.js +1 -2
- package/dist/primitives/Field.js +1 -2
- package/dist/primitives/FileDropzone.js +19 -18
- package/dist/primitives/Form.d.ts +23 -0
- package/dist/primitives/Form.js +76 -0
- package/dist/primitives/Glyph.d.ts +40 -0
- package/dist/primitives/Glyph.js +65 -0
- package/dist/primitives/IconButton.js +5 -6
- package/dist/primitives/Input.js +1 -2
- package/dist/primitives/InputGroup.js +8 -9
- package/dist/primitives/Link.d.ts +9 -1
- package/dist/primitives/Link.js +23 -17
- package/dist/primitives/LinkTooltip.js +6 -7
- package/dist/primitives/List.d.ts +34 -0
- package/dist/primitives/List.js +135 -0
- package/dist/primitives/Message.d.ts +13 -0
- package/dist/primitives/Message.js +75 -0
- package/dist/primitives/NavList.js +15 -16
- package/dist/primitives/Notice.d.ts +15 -1
- package/dist/primitives/Notice.js +91 -43
- package/dist/primitives/NumberField.js +81 -81
- package/dist/primitives/NumberText.d.ts +4 -0
- package/dist/primitives/NumberText.js +50 -25
- package/dist/primitives/Pagination.js +81 -60
- package/dist/primitives/Popover.js +57 -57
- package/dist/primitives/Progress.js +1 -2
- package/dist/primitives/PromptInput.d.ts +23 -0
- package/dist/primitives/PromptInput.js +135 -0
- package/dist/primitives/RadioGroup.js +12 -17
- package/dist/primitives/Resizable.js +1 -2
- package/dist/primitives/ScrollArea.js +1 -2
- package/dist/primitives/SearchInput.js +45 -38
- package/dist/primitives/SegmentedControl.d.ts +2 -0
- package/dist/primitives/SegmentedControl.js +92 -78
- package/dist/primitives/Select.js +105 -100
- package/dist/primitives/Separator.js +1 -2
- package/dist/primitives/ShortcutPending.js +11 -12
- package/dist/primitives/ShortcutProvider.d.ts +5 -0
- package/dist/primitives/ShortcutProvider.js +71 -65
- package/dist/primitives/ShortcutScope.js +8 -9
- package/dist/primitives/ShortcutSheet.js +30 -24
- package/dist/primitives/Skeleton.js +1 -2
- package/dist/primitives/Slider.js +1 -2
- package/dist/primitives/SortableList.d.ts +19 -0
- package/dist/primitives/SortableList.js +235 -0
- package/dist/primitives/Spinner.js +1 -2
- package/dist/primitives/Status.js +14 -14
- package/dist/primitives/Stepper.js +54 -52
- package/dist/primitives/StreamingText.d.ts +12 -0
- package/dist/primitives/StreamingText.js +42 -0
- package/dist/primitives/Surface.js +1 -2
- package/dist/primitives/Switch.js +1 -2
- package/dist/primitives/Table.js +1 -2
- package/dist/primitives/Tabs.js +20 -17
- package/dist/primitives/TagInput.js +6 -9
- package/dist/primitives/Textarea.js +37 -63
- package/dist/primitives/Toast.js +42 -41
- package/dist/primitives/Toaster.js +27 -28
- package/dist/primitives/Tooltip.js +32 -32
- package/dist/primitives/Tree.js +1 -2
- package/dist/primitives/Typography.d.ts +6 -2
- package/dist/primitives/Typography.js +20 -12
- package/dist/primitives/boolean-input-state.js +3 -8
- package/dist/primitives/button-variants.js +2 -3
- package/dist/primitives/choice-options.js +1 -2
- package/dist/primitives/create-confirm.js +1 -2
- package/dist/primitives/create-toaster.js +1 -2
- package/dist/primitives/link-focus.js +1 -2
- package/dist/primitives/menu-focus.js +1 -2
- package/dist/primitives/sortable-core.d.ts +70 -0
- package/dist/primitives/sortable-core.js +109 -0
- package/dist/primitives/sortable-drag.d.ts +29 -0
- package/dist/primitives/sortable-drag.js +50 -0
- package/dist/primitives/tooltip-layer.js +26 -27
- package/dist/sortable.d.ts +6 -0
- package/dist/sortable.js +4 -0
- package/dist/theme/ThemeProvider.d.ts +6 -1
- package/dist/theme/ThemeProvider.js +65 -58
- package/dist/theme/intl.js +1 -2
- package/dist/theme/keyboard-script.js +1 -2
- package/dist/theme/layers.js +1 -2
- package/dist/theme/messages.d.ts +26 -0
- package/dist/theme/messages.js +9 -2
- package/dist/theme/number-format-cache.js +1 -2
- package/dist/theme/script.d.ts +1 -0
- package/dist/theme/script.js +3 -3
- package/dist/theme/state.d.ts +4 -4
- package/dist/theme/state.js +12 -13
- package/dist/utils/auto-resize.d.ts +6 -0
- package/dist/utils/auto-resize.js +31 -0
- package/dist/utils/browser-status.js +1 -2
- package/dist/utils/change-motion.d.ts +8 -0
- package/dist/utils/change-motion.js +19 -0
- package/dist/utils/cn.js +1 -2
- package/dist/utils/media-query.d.ts +10 -0
- package/dist/utils/media-query.js +16 -0
- package/dist/utils/optimistic.js +1 -2
- package/dist/utils/shortcut-platform.js +1 -2
- package/dist/utils/shortcut-registry.d.ts +5 -0
- package/dist/utils/shortcut-registry.js +61 -51
- package/dist/vite.js +3 -4
- package/package.json +23 -5
- package/src/ai.ts +8 -0
- package/src/core.ts +11 -4
- package/src/forms.ts +2 -0
- package/src/index.ts +25 -5
- package/src/navigation.ts +2 -1
- package/src/primitives/Accordion.tsx +1 -1
- package/src/primitives/ActivityTimeline.tsx +12 -7
- package/src/primitives/Board.tsx +406 -0
- package/src/primitives/Button.tsx +15 -4
- package/src/primitives/Collapsible.tsx +1 -1
- package/src/primitives/Combobox.tsx +2 -1
- package/src/primitives/CommandPalette.tsx +2 -2
- package/src/primitives/Conversation.tsx +108 -0
- package/src/primitives/Dialog.tsx +5 -1
- package/src/primitives/DropdownMenu.tsx +12 -6
- package/src/primitives/FileDropzone.tsx +2 -2
- package/src/primitives/Form.tsx +58 -0
- package/src/primitives/Glyph.tsx +55 -0
- package/src/primitives/Link.tsx +15 -6
- package/src/primitives/List.tsx +68 -0
- package/src/primitives/Message.tsx +40 -0
- package/src/primitives/Notice.tsx +45 -12
- package/src/primitives/NumberField.tsx +3 -2
- package/src/primitives/NumberText.tsx +31 -4
- package/src/primitives/Pagination.tsx +6 -5
- package/src/primitives/Popover.tsx +2 -1
- package/src/primitives/PromptInput.tsx +116 -0
- package/src/primitives/SearchInput.tsx +4 -3
- package/src/primitives/SegmentedControl.tsx +29 -4
- package/src/primitives/Select.tsx +3 -2
- package/src/primitives/ShortcutProvider.tsx +14 -1
- package/src/primitives/ShortcutSheet.tsx +1 -1
- package/src/primitives/SortableList.tsx +208 -0
- package/src/primitives/Status.tsx +1 -1
- package/src/primitives/Stepper.tsx +7 -7
- package/src/primitives/StreamingText.tsx +32 -0
- package/src/primitives/Tabs.tsx +2 -1
- package/src/primitives/TagInput.tsx +1 -1
- package/src/primitives/Textarea.tsx +3 -47
- package/src/primitives/Toast.tsx +2 -1
- package/src/primitives/Tooltip.tsx +4 -2
- package/src/primitives/Typography.tsx +11 -2
- package/src/primitives/button-variants.ts +1 -1
- package/src/primitives/sortable-core.ts +139 -0
- package/src/primitives/sortable-drag.ts +75 -0
- package/src/sortable.ts +6 -0
- package/src/styles/ai.css +57 -0
- package/src/styles/core.css +321 -0
- package/src/styles/forms.css +261 -0
- package/src/styles/navigation.css +137 -0
- package/src/styles/overlays.css +104 -0
- package/src/styles/sortable.css +87 -0
- package/src/styles.css +5 -658
- package/src/theme/ThemeProvider.tsx +20 -8
- package/src/theme/messages.ts +20 -1
- package/src/theme/script.ts +2 -2
- package/src/theme/state.ts +5 -5
- package/src/utils/auto-resize.ts +58 -0
- package/src/utils/change-motion.ts +28 -0
- package/src/utils/media-query.ts +26 -0
- package/src/utils/shortcut-registry.ts +19 -2
- package/src/vite.ts +3 -3
- package/vendor/integrity.json +13 -13
- package/vendor/kobalte-core/chunk/3D6FM2PJ.js +7 -1
- package/vendor/kobalte-core/chunk/G3KI2B4X.js +2 -1
- package/vendor/kobalte-core/chunk/KEL2LLJM.jsx +2 -1
- package/vendor/kobalte-core/chunk/RFN6X5VH.jsx +7 -1
- package/vendor/origins.json +4 -4
- package/vendor/solid-web/dev.cjs +21 -17
- package/vendor/solid-web/dev.js +21 -17
- package/vendor/solid-web/server.cjs +1 -1
- package/vendor/solid-web/server.js +1 -1
- package/vendor/solid-web/web.cjs +21 -17
- package/vendor/solid-web/web.js +21 -17
|
@@ -6,7 +6,7 @@ import { createComponent as s, insert as c, mergeProps as l, template as u } fro
|
|
|
6
6
|
import { For as d, Show as f, createEffect as p, createMemo as m, createSignal as h, createUniqueId as g, onCleanup as _, splitProps as v } from "solid-js";
|
|
7
7
|
import * as y from "#sheen-kobalte/dialog";
|
|
8
8
|
import { Command as b } from "#sheen-cmdk";
|
|
9
|
-
|
|
9
|
+
// src/primitives/CommandPalette.tsx
|
|
10
10
|
var x = /*#__PURE__*/ u("<span>"), S = /*#__PURE__*/ u("<div role=alert>");
|
|
11
11
|
function C(e, t) {
|
|
12
12
|
let n = e.trim();
|
|
@@ -96,7 +96,7 @@ function O(u) {
|
|
|
96
96
|
}
|
|
97
97
|
}), _(() => r.abort());
|
|
98
98
|
});
|
|
99
|
-
let q = m(() => T.bindings().filter((e) => !e.shadowed).map((e) => Object.freeze({
|
|
99
|
+
let q = m(() => T.bindings().filter((e) => !e.shadowed && (e.keys !== "mod+k" || e.label !== C.messages().openCommandPalette)).map((e) => Object.freeze({
|
|
100
100
|
id: `shortcut:${e.id}`,
|
|
101
101
|
label: e.label,
|
|
102
102
|
group: e.group,
|
|
@@ -105,7 +105,6 @@ function O(u) {
|
|
|
105
105
|
e.displayKeys,
|
|
106
106
|
e.scope
|
|
107
107
|
],
|
|
108
|
-
disabled: e.keys === "mod+k" && e.label === C.messages().openCommandPalette,
|
|
109
108
|
run: () => {
|
|
110
109
|
T.run(e.id);
|
|
111
110
|
}
|
|
@@ -315,5 +314,4 @@ function O(u) {
|
|
|
315
314
|
}
|
|
316
315
|
});
|
|
317
316
|
}
|
|
318
|
-
//#endregion
|
|
319
317
|
export { O as CommandPalette, E as commandPaletteFilter };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AlertDialog as e } from "./AlertDialog.js";
|
|
2
2
|
import { Button as t } from "./Button.js";
|
|
3
|
-
import {
|
|
3
|
+
import { useTheme as n } from "../theme/ThemeProvider.js";
|
|
4
4
|
import { createComponent as r, mergeProps as i } from "solid-js/web";
|
|
5
|
-
|
|
5
|
+
// src/primitives/ConfirmDialog.tsx
|
|
6
6
|
function a(a) {
|
|
7
|
-
let o =
|
|
8
|
-
return r(
|
|
7
|
+
let o = n();
|
|
8
|
+
return r(e, i({
|
|
9
9
|
get title() {
|
|
10
10
|
return a.title;
|
|
11
11
|
},
|
|
@@ -38,5 +38,4 @@ function a(a) {
|
|
|
38
38
|
}
|
|
39
39
|
}));
|
|
40
40
|
}
|
|
41
|
-
//#endregion
|
|
42
41
|
export { a as ConfirmDialog };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { useTheme as e } from "../theme/ThemeProvider.js";
|
|
2
2
|
import { cn as t } from "../utils/cn.js";
|
|
3
|
-
import {
|
|
4
|
-
import { createMenuFocusRecovery as
|
|
5
|
-
import {
|
|
3
|
+
import { MenuItems as n, validateMenuTree as r } from "./DropdownMenu.js";
|
|
4
|
+
import { createMenuFocusRecovery as i } from "./menu-focus.js";
|
|
5
|
+
import { useShortcutKeyboardOwner as a } from "./ShortcutProvider.js";
|
|
6
6
|
import { createComponent as o, memo as s, mergeProps as c } from "solid-js/web";
|
|
7
7
|
import { Show as l, createEffect as u, createMemo as d, createSignal as f, createUniqueId as p, onCleanup as m, splitProps as h } from "solid-js";
|
|
8
8
|
import { MenuContent as g, MenuPortal as _, MenuRoot as v } from "#sheen-kobalte/menu";
|
|
9
9
|
import { Polymorphic as y } from "#sheen-kobalte/polymorphic";
|
|
10
|
-
|
|
10
|
+
// src/primitives/ContextMenu.tsx
|
|
11
11
|
function b(e, t) {
|
|
12
12
|
typeof e == "function" ? e(t) : Array.isArray(e) && typeof e[0] == "function" && e[0](e[1], t);
|
|
13
13
|
}
|
|
@@ -19,13 +19,13 @@ function x(x) {
|
|
|
19
19
|
"onOpenChange",
|
|
20
20
|
"menuClass",
|
|
21
21
|
"children"
|
|
22
|
-
]), E = d(() => (
|
|
22
|
+
]), E = d(() => (r(w.items), w.items)), D = () => w.disabled === !0 || E().length === 0, [O, k] = f(!1), [A, j] = f({
|
|
23
23
|
x: 0,
|
|
24
24
|
y: 0
|
|
25
25
|
}), M = (e) => {
|
|
26
26
|
e === O() || e && D() || (k(e), w.onOpenChange?.(e));
|
|
27
27
|
}, [N, P] = f();
|
|
28
|
-
|
|
28
|
+
a(N, O), i(N, O), u(() => {
|
|
29
29
|
O() && m(S.layers.register(C));
|
|
30
30
|
});
|
|
31
31
|
let F = d((e) => O() ? S.layers.zIndex(C) : e ?? 100), I = () => T.id ?? `${C}-trigger`;
|
|
@@ -117,7 +117,7 @@ function x(x) {
|
|
|
117
117
|
S.layers.isTop(C) ? L() : e.preventDefault();
|
|
118
118
|
},
|
|
119
119
|
get children() {
|
|
120
|
-
return o(
|
|
120
|
+
return o(n, { get items() {
|
|
121
121
|
return E();
|
|
122
122
|
} });
|
|
123
123
|
}
|
|
@@ -128,5 +128,4 @@ function x(x) {
|
|
|
128
128
|
}
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
|
-
//#endregion
|
|
132
131
|
export { x as ContextMenu };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Accessor, JSX } from "solid-js";
|
|
2
|
+
export interface ConversationItem {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
}
|
|
5
|
+
export type ConversationProps<Item extends ConversationItem> = Omit<JSX.HTMLAttributes<HTMLDivElement>, "children" | "ref" | "role"> & {
|
|
6
|
+
ref?: HTMLDivElement | ((element: HTMLDivElement) => void);
|
|
7
|
+
items: readonly Item[];
|
|
8
|
+
children: (item: Accessor<Item>) => JSX.Element;
|
|
9
|
+
label?: string;
|
|
10
|
+
stickToBottom?: boolean;
|
|
11
|
+
jumpLabel?: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* A scrolling message log keyed by stable item IDs. Existing message nodes survive appends and content updates.
|
|
15
|
+
* While the reader is at the end, growth keeps the newest content in view; scrolling away stops that until they return.
|
|
16
|
+
*/
|
|
17
|
+
export declare function Conversation<Item extends ConversationItem>(props: ConversationProps<Item>): JSX.Element;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { Button as e } from "./Button.js";
|
|
2
|
+
import { useTheme as t } from "../theme/ThemeProvider.js";
|
|
3
|
+
import { cn as n } from "../utils/cn.js";
|
|
4
|
+
import { createComponent as r, effect as i, insert as a, memo as o, mergeProps as s, setAttribute as c, spread as l, style as u, template as d, use as f } from "solid-js/web";
|
|
5
|
+
import { For as p, Show as m, createMemo as h, createSignal as g, onCleanup as _, onMount as v, splitProps as y } from "solid-js";
|
|
6
|
+
// src/primitives/Conversation.tsx
|
|
7
|
+
var b = /*#__PURE__*/ d("<div><div class=sheen-conversation-scroller role=log tabindex=0><div class=sheen-conversation-content>"), x = /*#__PURE__*/ d("<div class=sheen-conversation-item>"), S = 4, C = 6;
|
|
8
|
+
function w(d) {
|
|
9
|
+
let w = t(), [T, E] = y(d, [
|
|
10
|
+
"ref",
|
|
11
|
+
"items",
|
|
12
|
+
"children",
|
|
13
|
+
"label",
|
|
14
|
+
"stickToBottom",
|
|
15
|
+
"jumpLabel",
|
|
16
|
+
"class"
|
|
17
|
+
]), D = h(() => {
|
|
18
|
+
let e = /* @__PURE__ */ new Map();
|
|
19
|
+
for (let t of T.items) {
|
|
20
|
+
if (!t.id) throw Error("Conversation: item ids must be nonempty");
|
|
21
|
+
if (e.has(t.id)) throw Error(`Conversation: duplicate item id "${t.id}"`);
|
|
22
|
+
e.set(t.id, t);
|
|
23
|
+
}
|
|
24
|
+
return e;
|
|
25
|
+
}), O = h(() => [...D().keys()]), [k, A] = g(!0), j = () => T.stickToBottom !== !1, M, N, P = !1, F = 0, I = !1, L = 0, R = (e) => e.scrollHeight - e.scrollTop - e.clientHeight <= S, z = () => {
|
|
26
|
+
M && (M.scrollTop = M.scrollHeight, L = M.scrollTop);
|
|
27
|
+
}, B = (e) => {
|
|
28
|
+
let t = e.scrollTop;
|
|
29
|
+
t < L - S ? A(!1) : R(e) && A(!0), L = t;
|
|
30
|
+
};
|
|
31
|
+
v(() => {
|
|
32
|
+
if (P = !0, !M || !N) return;
|
|
33
|
+
let e = M;
|
|
34
|
+
j() && z(), A(R(e)), L = e.scrollTop;
|
|
35
|
+
let t = new ResizeObserver(() => {
|
|
36
|
+
j() && k() ? z() : (L = e.scrollTop, A(R(e)));
|
|
37
|
+
});
|
|
38
|
+
t.observe(N), t.observe(e), _(() => t.disconnect());
|
|
39
|
+
});
|
|
40
|
+
let V = () => {
|
|
41
|
+
if (P) return I || (I = !0, queueMicrotask(() => {
|
|
42
|
+
F = 0, I = !1;
|
|
43
|
+
})), Math.min(F++, C);
|
|
44
|
+
};
|
|
45
|
+
return (() => {
|
|
46
|
+
var t = b(), d = t.firstChild, h = d.firstChild;
|
|
47
|
+
f((e) => {
|
|
48
|
+
typeof T.ref == "function" && T.ref(e);
|
|
49
|
+
}, t), l(t, s(E, {
|
|
50
|
+
get class() {
|
|
51
|
+
return n("sheen-conversation", T.class);
|
|
52
|
+
},
|
|
53
|
+
get "data-stuck"() {
|
|
54
|
+
return k() || void 0;
|
|
55
|
+
}
|
|
56
|
+
}), !1, !0), d.addEventListener("wheel", (e) => {
|
|
57
|
+
let t = e.currentTarget;
|
|
58
|
+
e.deltaY < 0 && t.scrollTop > 0 && A(!1);
|
|
59
|
+
}), d.addEventListener("scroll", (e) => B(e.currentTarget));
|
|
60
|
+
var _ = M;
|
|
61
|
+
typeof _ == "function" ? f(_, d) : M = d;
|
|
62
|
+
var v = N;
|
|
63
|
+
return typeof v == "function" ? f(v, h) : N = h, a(h, r(p, {
|
|
64
|
+
get each() {
|
|
65
|
+
return O();
|
|
66
|
+
},
|
|
67
|
+
children: (e) => {
|
|
68
|
+
let t = V(), [n, o] = g(t !== void 0);
|
|
69
|
+
return r(m, {
|
|
70
|
+
get when() {
|
|
71
|
+
return D().get(e);
|
|
72
|
+
},
|
|
73
|
+
children: (r) => (() => {
|
|
74
|
+
var s = x();
|
|
75
|
+
return s.addEventListener("animationend", (e) => {
|
|
76
|
+
e.target === e.currentTarget && o(!1);
|
|
77
|
+
}), c(s, "data-id", e), a(s, () => T.children(r)), i((e) => {
|
|
78
|
+
var r = n() || void 0, i = t === void 0 ? void 0 : { "--sheen-conversation-stagger": String(t) };
|
|
79
|
+
return r !== e.e && c(s, "data-entering", e.e = r), e.t = u(s, i, e.t), e;
|
|
80
|
+
}, {
|
|
81
|
+
e: void 0,
|
|
82
|
+
t: void 0
|
|
83
|
+
}), s;
|
|
84
|
+
})()
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
})), a(t, r(m, {
|
|
88
|
+
get when() {
|
|
89
|
+
return o(() => !!j())() && !k();
|
|
90
|
+
},
|
|
91
|
+
get children() {
|
|
92
|
+
return r(e, {
|
|
93
|
+
class: "sheen-conversation-jump",
|
|
94
|
+
variant: "outline",
|
|
95
|
+
size: "sm",
|
|
96
|
+
onClick: () => {
|
|
97
|
+
z(), A(!0), M?.focus({ preventScroll: !0 });
|
|
98
|
+
},
|
|
99
|
+
get children() {
|
|
100
|
+
return T.jumpLabel ?? w.messages().jumpToLatest;
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}), null), i(() => c(d, "aria-label", T.label ?? w.messages().conversation)), t;
|
|
105
|
+
})();
|
|
106
|
+
}
|
|
107
|
+
export { w as Conversation };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn as e } from "../utils/cn.js";
|
|
2
2
|
import { mergeProps as t, spread as n, template as r } from "solid-js/web";
|
|
3
3
|
import { splitProps as i } from "solid-js";
|
|
4
|
-
|
|
4
|
+
// src/primitives/DescriptionList.tsx
|
|
5
5
|
var a = /*#__PURE__*/ r("<dl>"), o = /*#__PURE__*/ r("<dt>"), s = /*#__PURE__*/ r("<dd>");
|
|
6
6
|
function c(r) {
|
|
7
7
|
let [o, s] = i(r, ["class", "layout"]);
|
|
@@ -40,5 +40,4 @@ function u(r) {
|
|
|
40
40
|
}), !1, !1), r;
|
|
41
41
|
})();
|
|
42
42
|
}
|
|
43
|
-
//#endregion
|
|
44
43
|
export { u as DescriptionDetails, c as DescriptionList, l as DescriptionTerm };
|
|
@@ -1,130 +1,164 @@
|
|
|
1
1
|
import { useTheme as e } from "../theme/ThemeProvider.js";
|
|
2
|
-
import {
|
|
2
|
+
import { Button as t } from "./Button.js";
|
|
3
3
|
import { buttonVariants as n } from "./button-variants.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
4
|
+
import { cn as r } from "../utils/cn.js";
|
|
5
|
+
import { Glyph as i } from "./Glyph.js";
|
|
6
|
+
import { useModalShortcutScope as a } from "./ShortcutProvider.js";
|
|
7
|
+
import { createComponent as o, insert as s, mergeProps as c, template as l } from "solid-js/web";
|
|
8
|
+
import { Show as u, createEffect as d, createMemo as f, createSignal as p, createUniqueId as m, onCleanup as h } from "solid-js";
|
|
9
|
+
import * as g from "#sheen-kobalte/dialog";
|
|
10
|
+
// src/primitives/Dialog.tsx
|
|
11
|
+
var _ = /*#__PURE__*/ l("<div class=sheen-dialog-header>"), v = /*#__PURE__*/ l("<div class=sheen-dialog-body>"), y = /*#__PURE__*/ l("<div class=sheen-dialog-footer>");
|
|
12
|
+
function b(l) {
|
|
13
|
+
let b = e(), [x, S] = p(l.defaultOpen ?? !1), C = () => l.open === void 0 ? x() : l.open, w = () => l.dismissible ?? !0, T = (e) => {
|
|
14
|
+
(e || w()) && e !== C() && (l.open === void 0 && S(e), l.onOpenChange?.(e));
|
|
15
|
+
}, E = m();
|
|
16
|
+
a(() => l.shortcutScope ?? `dialog:${E}`, C);
|
|
17
|
+
let D, O, k = () => !!l.alert || l.closeLabel !== void 0;
|
|
18
|
+
d(() => {
|
|
19
|
+
C() && h(b.layers.register(E));
|
|
19
20
|
});
|
|
20
|
-
let
|
|
21
|
-
return
|
|
21
|
+
let A = f((e) => C() ? b.layers.zIndex(E) : e ?? 100);
|
|
22
|
+
return o(g.Root, {
|
|
22
23
|
get open() {
|
|
23
|
-
return
|
|
24
|
+
return C();
|
|
24
25
|
},
|
|
25
|
-
onOpenChange:
|
|
26
|
+
onOpenChange: T,
|
|
26
27
|
get children() {
|
|
27
|
-
return [
|
|
28
|
+
return [o(u, {
|
|
28
29
|
get when() {
|
|
29
|
-
return
|
|
30
|
+
return l.trigger;
|
|
30
31
|
},
|
|
31
32
|
get children() {
|
|
32
|
-
return
|
|
33
|
+
return o(g.Trigger, {
|
|
33
34
|
get class() {
|
|
34
35
|
return n({ variant: "outline" });
|
|
35
36
|
},
|
|
36
37
|
"data-variant": "outline",
|
|
37
38
|
get children() {
|
|
38
|
-
return
|
|
39
|
+
return l.trigger;
|
|
39
40
|
}
|
|
40
41
|
});
|
|
41
42
|
}
|
|
42
|
-
}),
|
|
43
|
+
}), o(u, {
|
|
43
44
|
get when() {
|
|
44
|
-
return
|
|
45
|
+
return b.portal();
|
|
45
46
|
},
|
|
46
|
-
children: (e) =>
|
|
47
|
+
children: (e) => o(g.Portal, {
|
|
47
48
|
get mount() {
|
|
48
49
|
return e();
|
|
49
50
|
},
|
|
50
51
|
get children() {
|
|
51
|
-
return [
|
|
52
|
+
return [o(g.Overlay, {
|
|
52
53
|
class: "sheen-dialog-overlay",
|
|
53
54
|
get style() {
|
|
54
|
-
return { "z-index":
|
|
55
|
+
return { "z-index": A() };
|
|
55
56
|
}
|
|
56
|
-
}),
|
|
57
|
+
}), o(g.Content, c(() => l.contentId === void 0 ? {} : { id: l.contentId }, {
|
|
57
58
|
ref: (e) => {
|
|
58
|
-
|
|
59
|
+
D = e;
|
|
59
60
|
},
|
|
60
61
|
get role() {
|
|
61
|
-
return
|
|
62
|
+
return l.alert ? "alertdialog" : "dialog";
|
|
62
63
|
},
|
|
63
64
|
get "aria-hidden"() {
|
|
64
|
-
return !
|
|
65
|
+
return !C() || void 0;
|
|
65
66
|
},
|
|
66
67
|
get inert() {
|
|
67
|
-
return !
|
|
68
|
+
return !C();
|
|
68
69
|
},
|
|
69
70
|
get class() {
|
|
70
|
-
return
|
|
71
|
+
return r("sheen-dialog", l.class);
|
|
71
72
|
},
|
|
72
73
|
get style() {
|
|
73
|
-
return { "z-index":
|
|
74
|
+
return { "z-index": A() + 1 };
|
|
74
75
|
},
|
|
75
76
|
onEscapeKeyDown: (e) => {
|
|
76
|
-
|
|
77
|
+
b.layers.isTop(E) && w() || e.preventDefault();
|
|
77
78
|
},
|
|
78
79
|
onPointerDownOutside: (e) => {
|
|
79
|
-
|
|
80
|
+
!l.alert && w() && b.layers.isTop(E) || e.preventDefault();
|
|
80
81
|
},
|
|
81
82
|
onOpenAutoFocus: (e) => {
|
|
82
|
-
let t =
|
|
83
|
-
t?.isConnected &&
|
|
83
|
+
let t = l.initialFocus?.() ?? (l.alert ? O : void 0);
|
|
84
|
+
t?.isConnected && D?.contains(t) && !t.matches(":disabled,[inert]") && (t.focus({ preventScroll: !0 }), t.ownerDocument.activeElement === t && e.preventDefault());
|
|
84
85
|
},
|
|
85
86
|
onCloseAutoFocus: (e) => {
|
|
86
|
-
let t =
|
|
87
|
+
let t = l.returnFocus?.();
|
|
87
88
|
t?.isConnected && !t.matches(":disabled,[inert]") && (t.focus({ preventScroll: !0 }), t.ownerDocument.activeElement === t && e.preventDefault());
|
|
88
89
|
},
|
|
89
90
|
get children() {
|
|
90
91
|
return [
|
|
91
92
|
(() => {
|
|
92
|
-
var e =
|
|
93
|
-
return
|
|
94
|
-
return
|
|
95
|
-
} }), null),
|
|
93
|
+
var e = _();
|
|
94
|
+
return s(e, o(g.Title, { get children() {
|
|
95
|
+
return l.title;
|
|
96
|
+
} }), null), s(e, o(u, {
|
|
96
97
|
get when() {
|
|
97
|
-
return
|
|
98
|
+
return l.description;
|
|
98
99
|
},
|
|
99
100
|
get children() {
|
|
100
|
-
return
|
|
101
|
-
return
|
|
101
|
+
return o(g.Description, { get children() {
|
|
102
|
+
return l.description;
|
|
102
103
|
} });
|
|
103
104
|
}
|
|
104
105
|
}), null), e;
|
|
105
106
|
})(),
|
|
106
107
|
(() => {
|
|
107
|
-
var e =
|
|
108
|
-
return
|
|
108
|
+
var e = v();
|
|
109
|
+
return s(e, () => l.children), e;
|
|
109
110
|
})(),
|
|
110
111
|
(() => {
|
|
111
|
-
var e =
|
|
112
|
-
return
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
D = e;
|
|
116
|
-
},
|
|
117
|
-
get disabled() {
|
|
118
|
-
return !C();
|
|
119
|
-
},
|
|
120
|
-
get "aria-label"() {
|
|
121
|
-
return c.closeLabel ?? y.messages().close;
|
|
112
|
+
var e = y();
|
|
113
|
+
return s(e, o(u, {
|
|
114
|
+
get when() {
|
|
115
|
+
return k();
|
|
122
116
|
},
|
|
123
117
|
get children() {
|
|
124
|
-
return
|
|
118
|
+
return o(g.CloseButton, {
|
|
119
|
+
as: t,
|
|
120
|
+
variant: "ghost",
|
|
121
|
+
ref: (e) => {
|
|
122
|
+
O = e;
|
|
123
|
+
},
|
|
124
|
+
get disabled() {
|
|
125
|
+
return !w();
|
|
126
|
+
},
|
|
127
|
+
get "aria-label"() {
|
|
128
|
+
return l.closeLabel ?? b.messages().close;
|
|
129
|
+
},
|
|
130
|
+
get children() {
|
|
131
|
+
return l.closeLabel ?? b.messages().close;
|
|
132
|
+
}
|
|
133
|
+
});
|
|
125
134
|
}
|
|
126
|
-
}), null),
|
|
127
|
-
})()
|
|
135
|
+
}), null), s(e, () => l.footer, null), e;
|
|
136
|
+
})(),
|
|
137
|
+
o(u, {
|
|
138
|
+
get when() {
|
|
139
|
+
return !k();
|
|
140
|
+
},
|
|
141
|
+
get children() {
|
|
142
|
+
return o(g.CloseButton, {
|
|
143
|
+
as: t,
|
|
144
|
+
variant: "ghost",
|
|
145
|
+
class: "sheen-dialog-close",
|
|
146
|
+
size: "sm",
|
|
147
|
+
ref: (e) => {
|
|
148
|
+
O = e;
|
|
149
|
+
},
|
|
150
|
+
get disabled() {
|
|
151
|
+
return !w();
|
|
152
|
+
},
|
|
153
|
+
get "aria-label"() {
|
|
154
|
+
return b.messages().close;
|
|
155
|
+
},
|
|
156
|
+
get children() {
|
|
157
|
+
return o(i, { name: "close" });
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
})
|
|
128
162
|
];
|
|
129
163
|
}
|
|
130
164
|
}))];
|
|
@@ -134,8 +168,7 @@ function y(c) {
|
|
|
134
168
|
}
|
|
135
169
|
});
|
|
136
170
|
}
|
|
137
|
-
function
|
|
138
|
-
return
|
|
171
|
+
function x(e) {
|
|
172
|
+
return o(b, e);
|
|
139
173
|
}
|
|
140
|
-
|
|
141
|
-
export { b as Dialog, y as ModalFrame };
|
|
174
|
+
export { x as Dialog, b as ModalFrame };
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ModalFrame as e } from "./Dialog.js";
|
|
2
|
+
import { cn as t } from "../utils/cn.js";
|
|
3
3
|
import { createComponent as n, mergeProps as r } from "solid-js/web";
|
|
4
|
-
|
|
5
|
-
function i(
|
|
4
|
+
// src/primitives/Drawer.tsx
|
|
5
|
+
function i(e, n) {
|
|
6
6
|
let r = n.side ?? "end";
|
|
7
|
-
if (r !== "start" && r !== "end") throw Error(`${
|
|
8
|
-
return
|
|
7
|
+
if (r !== "start" && r !== "end") throw Error(`${e} side must be start or end`);
|
|
8
|
+
return t("sheen-drawer", `sheen-drawer-${r}`, `sheen-${e}`, n.class);
|
|
9
9
|
}
|
|
10
|
-
function a(
|
|
11
|
-
return n(
|
|
12
|
-
return i("drawer",
|
|
10
|
+
function a(t) {
|
|
11
|
+
return n(e, r(t, { get class() {
|
|
12
|
+
return i("drawer", t);
|
|
13
13
|
} }));
|
|
14
14
|
}
|
|
15
|
-
function o(
|
|
16
|
-
return n(
|
|
17
|
-
return i("sheet",
|
|
15
|
+
function o(t) {
|
|
16
|
+
return n(e, r(t, { get class() {
|
|
17
|
+
return i("sheet", t);
|
|
18
18
|
} }));
|
|
19
19
|
}
|
|
20
|
-
//#endregion
|
|
21
20
|
export { a as Drawer, o as Sheet };
|