@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
|
@@ -1,68 +1,69 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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 { Glyph as r } from "./Glyph.js";
|
|
5
|
+
import { createComponent as i, insert as a, memo as o, mergeProps as s, template as c } from "solid-js/web";
|
|
6
|
+
import { Show as l, createEffect as u, createMemo as d, createSignal as f, createUniqueId as p, onCleanup as m } from "solid-js";
|
|
7
|
+
import * as h from "#sheen-kobalte/popover";
|
|
8
|
+
// src/primitives/Popover.tsx
|
|
9
|
+
var g = /*#__PURE__*/ c("<div class=sheen-dialog-header>"), _ = /*#__PURE__*/ c("<div class=sheen-dialog-body>");
|
|
10
|
+
function v(t) {
|
|
11
|
+
let n = h.usePopoverContext();
|
|
12
|
+
return i(e, s({
|
|
12
13
|
ref(e) {
|
|
13
|
-
var
|
|
14
|
-
typeof
|
|
14
|
+
var t = n.setTriggerRef;
|
|
15
|
+
typeof t == "function" ? t(e) : n.setTriggerRef = e;
|
|
15
16
|
},
|
|
16
17
|
variant: "outline",
|
|
17
18
|
"data-sheen-popover-trigger": "",
|
|
18
19
|
"aria-haspopup": "dialog",
|
|
19
20
|
get "aria-expanded"() {
|
|
20
|
-
return
|
|
21
|
+
return n.isOpen();
|
|
21
22
|
},
|
|
22
23
|
get "aria-controls"() {
|
|
23
|
-
return
|
|
24
|
+
return o(() => !!n.isOpen())() ? n.contentId() : void 0;
|
|
24
25
|
},
|
|
25
26
|
onPointerDown: (e) => {
|
|
26
27
|
e.pointerType === "mouse" && e.preventDefault();
|
|
27
28
|
},
|
|
28
|
-
onClick: () =>
|
|
29
|
-
}, () =>
|
|
30
|
-
return
|
|
29
|
+
onClick: () => n.toggle()
|
|
30
|
+
}, () => n.dataset(), { get children() {
|
|
31
|
+
return t.children;
|
|
31
32
|
} }));
|
|
32
33
|
}
|
|
33
|
-
function y(
|
|
34
|
-
let
|
|
35
|
-
e !== x() && (
|
|
34
|
+
function y(o) {
|
|
35
|
+
let s = t(), c = p(), [y, b] = f(o.defaultOpen ?? !1), x = () => o.open === void 0 ? y() : o.open, S = (e) => {
|
|
36
|
+
e !== x() && (o.open === void 0 && b(e), o.onOpenChange?.(e));
|
|
36
37
|
};
|
|
37
|
-
|
|
38
|
-
x() &&
|
|
38
|
+
u(() => {
|
|
39
|
+
x() && m(s.layers.register(c));
|
|
39
40
|
});
|
|
40
|
-
let C =
|
|
41
|
-
return
|
|
41
|
+
let C = d((e) => x() ? s.layers.zIndex(c) : e ?? 100);
|
|
42
|
+
return i(h.Root, {
|
|
42
43
|
get open() {
|
|
43
44
|
return x();
|
|
44
45
|
},
|
|
45
46
|
onOpenChange: S,
|
|
46
47
|
get placement() {
|
|
47
|
-
return
|
|
48
|
+
return o.placement ?? "bottom";
|
|
48
49
|
},
|
|
49
50
|
gutter: 6,
|
|
50
51
|
get children() {
|
|
51
|
-
return [
|
|
52
|
-
return
|
|
53
|
-
} }),
|
|
52
|
+
return [i(v, { get children() {
|
|
53
|
+
return o.trigger;
|
|
54
|
+
} }), i(l, {
|
|
54
55
|
get when() {
|
|
55
|
-
return
|
|
56
|
+
return s.portal();
|
|
56
57
|
},
|
|
57
|
-
children: (
|
|
58
|
+
children: (t) => i(h.Portal, {
|
|
58
59
|
get mount() {
|
|
59
|
-
return
|
|
60
|
+
return t();
|
|
60
61
|
},
|
|
61
62
|
get children() {
|
|
62
|
-
return
|
|
63
|
+
return i(h.Content, {
|
|
63
64
|
"data-kb-top-layer": "true",
|
|
64
65
|
get class() {
|
|
65
|
-
return
|
|
66
|
+
return n("sheen-popover", o.class);
|
|
66
67
|
},
|
|
67
68
|
get "aria-hidden"() {
|
|
68
69
|
return !x() || void 0;
|
|
@@ -74,41 +75,41 @@ function y(a) {
|
|
|
74
75
|
return { "z-index": C() };
|
|
75
76
|
},
|
|
76
77
|
onEscapeKeyDown: (e) => {
|
|
77
|
-
|
|
78
|
+
s.layers.isTop(c) || e.preventDefault();
|
|
78
79
|
},
|
|
79
80
|
get children() {
|
|
80
81
|
return [
|
|
81
82
|
(() => {
|
|
82
|
-
var e =
|
|
83
|
-
return
|
|
84
|
-
return
|
|
85
|
-
} }), null),
|
|
83
|
+
var e = g();
|
|
84
|
+
return a(e, i(h.Title, { get children() {
|
|
85
|
+
return o.title;
|
|
86
|
+
} }), null), a(e, i(l, {
|
|
86
87
|
get when() {
|
|
87
|
-
return
|
|
88
|
+
return o.description;
|
|
88
89
|
},
|
|
89
90
|
get children() {
|
|
90
|
-
return
|
|
91
|
-
return
|
|
91
|
+
return i(h.Description, { get children() {
|
|
92
|
+
return o.description;
|
|
92
93
|
} });
|
|
93
94
|
}
|
|
94
95
|
}), null), e;
|
|
95
96
|
})(),
|
|
96
|
-
(() => {
|
|
97
|
-
var e = g();
|
|
98
|
-
return i(e, () => a.children), e;
|
|
99
|
-
})(),
|
|
100
97
|
(() => {
|
|
101
98
|
var e = _();
|
|
102
|
-
return
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
99
|
+
return a(e, () => o.children), e;
|
|
100
|
+
})(),
|
|
101
|
+
i(h.CloseButton, {
|
|
102
|
+
as: e,
|
|
103
|
+
variant: "ghost",
|
|
104
|
+
class: "sheen-dialog-close",
|
|
105
|
+
size: "sm",
|
|
106
|
+
get "aria-label"() {
|
|
107
|
+
return s.messages().close;
|
|
108
|
+
},
|
|
109
|
+
get children() {
|
|
110
|
+
return i(r, { name: "close" });
|
|
111
|
+
}
|
|
112
|
+
})
|
|
112
113
|
];
|
|
113
114
|
}
|
|
114
115
|
});
|
|
@@ -118,5 +119,4 @@ function y(a) {
|
|
|
118
119
|
}
|
|
119
120
|
});
|
|
120
121
|
}
|
|
121
|
-
//#endregion
|
|
122
122
|
export { y as Popover };
|
|
@@ -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 { createMemo as i, splitProps as a } from "solid-js";
|
|
4
|
-
|
|
4
|
+
// src/primitives/Progress.tsx
|
|
5
5
|
var o = /*#__PURE__*/ r("<progress>"), s = /*#__PURE__*/ r("<meter>");
|
|
6
6
|
function c(r) {
|
|
7
7
|
let [i, s] = a(r, [
|
|
@@ -94,5 +94,4 @@ function u(r) {
|
|
|
94
94
|
}), !1, !1), r;
|
|
95
95
|
})();
|
|
96
96
|
}
|
|
97
|
-
//#endregion
|
|
98
97
|
export { u as Meter, c as Progress };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
export type PromptInputStatus = "idle" | "streaming";
|
|
3
|
+
export interface PromptInputProps extends Omit<JSX.FormHTMLAttributes<HTMLFormElement>, "onSubmit" | "children" | "name" | "ref"> {
|
|
4
|
+
ref?: HTMLFormElement | ((element: HTMLFormElement) => void);
|
|
5
|
+
value?: string;
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
onValueChange?: (value: string) => void;
|
|
8
|
+
onSubmit: (value: string) => void;
|
|
9
|
+
onStop?: () => void;
|
|
10
|
+
status?: PromptInputStatus;
|
|
11
|
+
label?: string;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
name?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
maxRows?: number;
|
|
16
|
+
leading?: JSX.Element;
|
|
17
|
+
trailing?: JSX.Element;
|
|
18
|
+
submitLabel?: string;
|
|
19
|
+
stopLabel?: string;
|
|
20
|
+
textareaRef?: (element: HTMLTextAreaElement) => void;
|
|
21
|
+
}
|
|
22
|
+
/** A chat composer: an auto-growing textarea whose single action sends the draft or stops the streaming response. */
|
|
23
|
+
export declare function PromptInput(props: PromptInputProps): JSX.Element;
|
|
@@ -0,0 +1,135 @@
|
|
|
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 { createAutoResize as r } from "../utils/auto-resize.js";
|
|
5
|
+
import { createComponent as i, delegateEvents as a, effect as o, insert as s, isServer as c, mergeProps as l, setAttribute as u, setStyleProperty as d, spread as f, template as p, use as m } from "solid-js/web";
|
|
6
|
+
import { Show as h, children as g, createEffect as _, createMemo as v, createSignal as y, onMount as b, splitProps as x } from "solid-js";
|
|
7
|
+
// src/primitives/PromptInput.tsx
|
|
8
|
+
var S = /*#__PURE__*/ p("<div class=sheen-prompt-input-leading>"), C = /*#__PURE__*/ p("<svg><rect x=4 y=4 width=8 height=8 rx=1.5></svg>", !1, !0, !1), w = /*#__PURE__*/ p("<svg class=sheen-prompt-input-glyph viewBox=\"0 0 16 16\"aria-hidden=true fill=currentColor>"), T = /*#__PURE__*/ p("<form><textarea class=sheen-prompt-input-textarea rows=1></textarea><div class=sheen-prompt-input-toolbar><div class=sheen-prompt-input-trailing>"), E = /*#__PURE__*/ p("<svg><path d=\"M8 2.5 13 7.5l-1.06 1.06-3.19-3.19V13.5h-1.5V5.37L4.06 8.56 3 7.5z\"></svg>", !1, !0, !1);
|
|
9
|
+
function D(a) {
|
|
10
|
+
let p = t(), [D, O] = x(a, [
|
|
11
|
+
"ref",
|
|
12
|
+
"value",
|
|
13
|
+
"defaultValue",
|
|
14
|
+
"onValueChange",
|
|
15
|
+
"onSubmit",
|
|
16
|
+
"onStop",
|
|
17
|
+
"status",
|
|
18
|
+
"label",
|
|
19
|
+
"placeholder",
|
|
20
|
+
"name",
|
|
21
|
+
"disabled",
|
|
22
|
+
"maxRows",
|
|
23
|
+
"leading",
|
|
24
|
+
"trailing",
|
|
25
|
+
"submitLabel",
|
|
26
|
+
"stopLabel",
|
|
27
|
+
"textareaRef",
|
|
28
|
+
"class"
|
|
29
|
+
]), k = g(() => D.leading), A = g(() => D.trailing), [j, M] = y(D.defaultValue ?? ""), N = () => D.value ?? j(), [P, F] = y(!1), I = () => D.status === "streaming", L = v(() => {
|
|
30
|
+
let e = D.maxRows ?? 8;
|
|
31
|
+
if (!Number.isSafeInteger(e) || e < 1) throw Error("PromptInput: maxRows must be a positive integer");
|
|
32
|
+
return e;
|
|
33
|
+
}), R, z = r(() => R, () => !0);
|
|
34
|
+
_(() => {
|
|
35
|
+
N(), L(), p.state(), z();
|
|
36
|
+
});
|
|
37
|
+
let B = (e) => {
|
|
38
|
+
D.value === void 0 && M(e), D.onValueChange?.(e);
|
|
39
|
+
}, V = () => {
|
|
40
|
+
R && !P() && R.value !== N() && (R.value = N());
|
|
41
|
+
}, H = () => !D.disabled && !I() && !P() && N().trim().length > 0, U = () => !D.disabled && I() && D.onStop !== void 0, W = () => {
|
|
42
|
+
if (!H()) return;
|
|
43
|
+
let e = N();
|
|
44
|
+
D.value === void 0 && M(""), D.onSubmit(e), V();
|
|
45
|
+
};
|
|
46
|
+
b(() => {
|
|
47
|
+
R && R.value !== N() && (B(R.value), V());
|
|
48
|
+
});
|
|
49
|
+
let G = (e) => {
|
|
50
|
+
e.key !== "Enter" || e.shiftKey || e.isComposing || e.keyCode === 229 || P() || (e.preventDefault(), W());
|
|
51
|
+
}, K = (e) => {
|
|
52
|
+
e.preventDefault(), I() ? U() && D.onStop?.() : W();
|
|
53
|
+
}, q = () => I() ? D.stopLabel ?? p.messages().stopResponse : D.submitLabel ?? p.messages().sendMessage, J = () => `\n${N()}`;
|
|
54
|
+
return (() => {
|
|
55
|
+
var t = T(), r = t.firstChild, a = r.nextSibling, g = a.firstChild;
|
|
56
|
+
return m((e) => {
|
|
57
|
+
typeof D.ref == "function" && D.ref(e);
|
|
58
|
+
}, t), f(t, l(O, {
|
|
59
|
+
get class() {
|
|
60
|
+
return n("sheen-prompt-input", D.class);
|
|
61
|
+
},
|
|
62
|
+
get "data-status"() {
|
|
63
|
+
return I() ? "streaming" : "idle";
|
|
64
|
+
},
|
|
65
|
+
get "data-disabled"() {
|
|
66
|
+
return D.disabled || void 0;
|
|
67
|
+
},
|
|
68
|
+
onSubmit: (e) => {
|
|
69
|
+
e.preventDefault(), W();
|
|
70
|
+
}
|
|
71
|
+
}), !1, !0), r.$$keydown = G, r.addEventListener("compositionend", () => {
|
|
72
|
+
F(!1), V();
|
|
73
|
+
}), r.addEventListener("compositionstart", () => F(!0)), r.$$input = (e) => {
|
|
74
|
+
B(e.currentTarget.value), V(), z();
|
|
75
|
+
}, m((e) => {
|
|
76
|
+
R = e, D.textareaRef?.(e);
|
|
77
|
+
}, r), s(r, () => c ? J() : void 0), s(a, i(h, {
|
|
78
|
+
get when() {
|
|
79
|
+
return k.toArray().length > 0;
|
|
80
|
+
},
|
|
81
|
+
get children() {
|
|
82
|
+
var e = S();
|
|
83
|
+
return s(e, k), e;
|
|
84
|
+
}
|
|
85
|
+
}), g), s(g, A, null), s(g, i(e, {
|
|
86
|
+
class: "sheen-prompt-input-action",
|
|
87
|
+
get type() {
|
|
88
|
+
return I() ? "button" : "submit";
|
|
89
|
+
},
|
|
90
|
+
variant: "solid",
|
|
91
|
+
get tone() {
|
|
92
|
+
return I() ? "neutral" : "accent";
|
|
93
|
+
},
|
|
94
|
+
size: "sm",
|
|
95
|
+
get disabled() {
|
|
96
|
+
return D.disabled;
|
|
97
|
+
},
|
|
98
|
+
get "aria-disabled"() {
|
|
99
|
+
return !D.disabled && !(I() ? U() : H()) ? "true" : void 0;
|
|
100
|
+
},
|
|
101
|
+
get "aria-label"() {
|
|
102
|
+
return q();
|
|
103
|
+
},
|
|
104
|
+
get "data-action"() {
|
|
105
|
+
return I() ? "stop" : "send";
|
|
106
|
+
},
|
|
107
|
+
onClick: K,
|
|
108
|
+
get children() {
|
|
109
|
+
var e = w();
|
|
110
|
+
return s(e, i(h, {
|
|
111
|
+
get when() {
|
|
112
|
+
return I();
|
|
113
|
+
},
|
|
114
|
+
get fallback() {
|
|
115
|
+
return E();
|
|
116
|
+
},
|
|
117
|
+
get children() {
|
|
118
|
+
return C();
|
|
119
|
+
}
|
|
120
|
+
})), e;
|
|
121
|
+
}
|
|
122
|
+
}), null), o((e) => {
|
|
123
|
+
var t = D.name, n = D.placeholder, i = D.disabled, a = D.label ?? p.messages().promptInput, o = String(L());
|
|
124
|
+
return t !== e.e && u(r, "name", e.e = t), n !== e.t && u(r, "placeholder", e.t = n), i !== e.a && (r.disabled = e.a = i), a !== e.o && u(r, "aria-label", e.o = a), o !== e.i && d(r, "--sheen-prompt-input-max-rows", e.i = o), e;
|
|
125
|
+
}, {
|
|
126
|
+
e: void 0,
|
|
127
|
+
t: void 0,
|
|
128
|
+
a: void 0,
|
|
129
|
+
o: void 0,
|
|
130
|
+
i: void 0
|
|
131
|
+
}), o(() => r.value = c ? void 0 : N()), t;
|
|
132
|
+
})();
|
|
133
|
+
}
|
|
134
|
+
a(["input", "keydown"]);
|
|
135
|
+
export { D as PromptInput };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { createChoiceOptions as e } from "./choice-options.js";
|
|
2
|
+
import { cn as t } from "../utils/cn.js";
|
|
3
3
|
import { createComponent as n, delegateEvents as r, effect as i, insert as a, mergeProps as o, setAttribute as s, spread as c, template as l, use as u } from "solid-js/web";
|
|
4
4
|
import { For as d, Show as f, createMemo as p, createSignal as m, createUniqueId as h, onCleanup as g, onMount as _, splitProps as v, untrack as y } from "solid-js";
|
|
5
|
-
|
|
5
|
+
// src/primitives/RadioGroup.tsx
|
|
6
6
|
var b = /*#__PURE__*/ l("<span aria-hidden=true> *"), x = /*#__PURE__*/ l("<p class=sheen-radio-group-description>"), S = /*#__PURE__*/ l("<p class=sheen-radio-group-error>"), C = /*#__PURE__*/ l("<fieldset role=radiogroup><legend class=sheen-radio-group-label></legend><div class=sheen-radio-group-options>"), w = /*#__PURE__*/ l("<p class=sheen-radio-description>"), T = /*#__PURE__*/ l("<div class=sheen-radio-item><div class=sheen-radio-row><input type=radio class=sheen-radio-input><span class=sheen-radio-control aria-hidden=true><span class=sheen-radio-indicator></span></span><label class=sheen-radio-label>");
|
|
7
7
|
function E(r) {
|
|
8
8
|
let l = h(), [E, D] = v(r, [
|
|
@@ -28,7 +28,7 @@ function E(r) {
|
|
|
28
28
|
g(() => {
|
|
29
29
|
N = !0;
|
|
30
30
|
});
|
|
31
|
-
let { byValue: P, keys: F } =
|
|
31
|
+
let { byValue: P, keys: F } = e(() => {
|
|
32
32
|
if (!E.name.trim()) throw Error("RadioGroup: name must be nonempty for native grouping");
|
|
33
33
|
if (E.options.some((e) => !e.value)) throw Error("RadioGroup: option values must be nonempty; use null for no selection");
|
|
34
34
|
return E.options;
|
|
@@ -40,11 +40,7 @@ function E(r) {
|
|
|
40
40
|
}, R = () => {
|
|
41
41
|
if (!N) for (let e of M?.querySelectorAll("input[type=radio]") ?? []) e.checked = e.value === j();
|
|
42
42
|
}, z = (e) => {
|
|
43
|
-
|
|
44
|
-
R();
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
L(e || null), R();
|
|
43
|
+
E.disabled || E.readOnly || P().get(e)?.disabled || L(e || null), R();
|
|
48
44
|
};
|
|
49
45
|
_(() => {
|
|
50
46
|
let e = M, t = e?.ownerDocument.defaultView;
|
|
@@ -54,7 +50,7 @@ function E(r) {
|
|
|
54
50
|
let r = /* @__PURE__ */ new Set(), i = (n) => {
|
|
55
51
|
if (n.target !== e.form) return;
|
|
56
52
|
let i = t.setTimeout(() => {
|
|
57
|
-
r.delete(i),
|
|
53
|
+
r.delete(i), n.defaultPrevented || (E.value === void 0 && L(O), R());
|
|
58
54
|
}, 0);
|
|
59
55
|
r.add(i);
|
|
60
56
|
};
|
|
@@ -69,10 +65,10 @@ function E(r) {
|
|
|
69
65
|
E["aria-describedby"]
|
|
70
66
|
].filter(Boolean).join(" ") || void 0;
|
|
71
67
|
return (() => {
|
|
72
|
-
var
|
|
68
|
+
var e = C(), r = e.firstChild, p = r.nextSibling;
|
|
73
69
|
return u((e) => {
|
|
74
70
|
M = e, typeof E.ref == "function" && E.ref(e);
|
|
75
|
-
},
|
|
71
|
+
}, e), c(e, o(D, () => E["aria-label"] === void 0 ? {} : { "aria-label": E["aria-label"] }, {
|
|
76
72
|
get "aria-labelledby"() {
|
|
77
73
|
return E["aria-labelledby"] ?? `${l}-label`;
|
|
78
74
|
},
|
|
@@ -98,7 +94,7 @@ function E(r) {
|
|
|
98
94
|
return E.id ?? l;
|
|
99
95
|
},
|
|
100
96
|
get class() {
|
|
101
|
-
return
|
|
97
|
+
return t("sheen-radio-group", E.class);
|
|
102
98
|
},
|
|
103
99
|
get disabled() {
|
|
104
100
|
return E.disabled ?? !1;
|
|
@@ -113,7 +109,7 @@ function E(r) {
|
|
|
113
109
|
get children() {
|
|
114
110
|
return b();
|
|
115
111
|
}
|
|
116
|
-
}), null), a(
|
|
112
|
+
}), null), a(e, n(f, {
|
|
117
113
|
get when() {
|
|
118
114
|
return E.description;
|
|
119
115
|
},
|
|
@@ -157,7 +153,7 @@ function E(r) {
|
|
|
157
153
|
}), i(() => l.checked = j() === e), t;
|
|
158
154
|
})();
|
|
159
155
|
}
|
|
160
|
-
})), a(
|
|
156
|
+
})), a(e, n(f, {
|
|
161
157
|
get when() {
|
|
162
158
|
return E.error;
|
|
163
159
|
},
|
|
@@ -165,9 +161,8 @@ function E(r) {
|
|
|
165
161
|
var e = S();
|
|
166
162
|
return s(e, "id", `${l}-error`), a(e, () => E.error), e;
|
|
167
163
|
}
|
|
168
|
-
}), null),
|
|
164
|
+
}), null), e;
|
|
169
165
|
})();
|
|
170
166
|
}
|
|
171
167
|
r(["click"]);
|
|
172
|
-
//#endregion
|
|
173
168
|
export { E as RadioGroup };
|
|
@@ -2,7 +2,7 @@ import { cn as e } from "../utils/cn.js";
|
|
|
2
2
|
import { createComponent as t, mergeProps as n, template as r } from "solid-js/web";
|
|
3
3
|
import { createContext as i, createMemo as a, createSignal as o, splitProps as s, useContext as c } from "solid-js";
|
|
4
4
|
import l from "@corvu/resizable";
|
|
5
|
-
|
|
5
|
+
// src/primitives/Resizable.tsx
|
|
6
6
|
var u = /*#__PURE__*/ r("<span aria-hidden=true>"), d = i();
|
|
7
7
|
function f(e, t) {
|
|
8
8
|
if (e.length < 2) throw Error(`${t} requires at least two panel sizes`);
|
|
@@ -192,5 +192,4 @@ function _(r) {
|
|
|
192
192
|
}
|
|
193
193
|
}));
|
|
194
194
|
}
|
|
195
|
-
//#endregion
|
|
196
195
|
export { h as Resizable, _ as ResizableHandle, g as ResizablePanel };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn as e } from "../utils/cn.js";
|
|
2
2
|
import { createComponent as t, delegateEvents as n, effect as r, insert as i, mergeProps as a, setAttribute as o, setStyleProperty as s, spread as c, template as l, use as u } from "solid-js/web";
|
|
3
3
|
import { Show as d, createEffect as f, createMemo as p, createSignal as m, onCleanup as h, onMount as g, splitProps as _ } from "solid-js";
|
|
4
|
-
|
|
4
|
+
// src/primitives/ScrollArea.tsx
|
|
5
5
|
var v = /*#__PURE__*/ l("<div aria-hidden=true class=sheen-scroll-track data-axis=y><div class=sheen-scroll-thumb>"), y = /*#__PURE__*/ l("<div aria-hidden=true class=sheen-scroll-track data-axis=x><div class=sheen-scroll-thumb>"), b = /*#__PURE__*/ l("<div class=sheen-scroll-frame><div role=region><div class=sheen-scroll-content>");
|
|
6
6
|
function x(n) {
|
|
7
7
|
let [l, x] = _(n, [
|
|
@@ -174,5 +174,4 @@ n([
|
|
|
174
174
|
"pointermove",
|
|
175
175
|
"pointerup"
|
|
176
176
|
]);
|
|
177
|
-
//#endregion
|
|
178
177
|
export { x as ScrollArea };
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { Glyph as e } from "./Glyph.js";
|
|
2
|
+
import { Button as t } from "./Button.js";
|
|
3
|
+
import { InputGroup as n } from "./InputGroup.js";
|
|
4
|
+
import { useTheme as r } from "../theme/ThemeProvider.js";
|
|
5
|
+
import { cn as i } from "../utils/cn.js";
|
|
6
|
+
import { useShortcutAction 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 { createSignal as u, onCleanup as d, onMount as f, splitProps as p } from "solid-js";
|
|
9
|
+
// src/primitives/SearchInput.tsx
|
|
10
|
+
var m = /*#__PURE__*/ l("<span class=sheen-sr-only>");
|
|
11
|
+
function h(l) {
|
|
12
|
+
let h = r(), [g, _] = p(l, [
|
|
12
13
|
"value",
|
|
13
14
|
"defaultValue",
|
|
14
15
|
"onValueChange",
|
|
@@ -19,71 +20,77 @@ function p(s) {
|
|
|
19
20
|
"onCompositionEnd",
|
|
20
21
|
"ref",
|
|
21
22
|
"class"
|
|
22
|
-
]),
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
return
|
|
26
|
-
let e =
|
|
23
|
+
]), v = g.defaultValue ?? "", [y, b] = u(v), x = () => g.value ?? y(), [S, C] = u(), w = () => S() ?? x(), T, E = (e) => {
|
|
24
|
+
g.value === void 0 && b(e), g.onValueChange?.(e);
|
|
25
|
+
}, D = a(() => g.shortcut, () => T?.focus({ preventScroll: !0 }));
|
|
26
|
+
return f(() => {
|
|
27
|
+
let e = T;
|
|
27
28
|
if (!e) return;
|
|
28
|
-
e.value !==
|
|
29
|
+
e.value !== x() && (E(e.value), e.value !== x() && (e.value = x()));
|
|
29
30
|
let t = e.ownerDocument.defaultView;
|
|
30
31
|
if (!t) return;
|
|
31
32
|
let n = !1, r = /* @__PURE__ */ new Set(), i = (i) => {
|
|
32
33
|
if (i.target !== e.form) return;
|
|
33
34
|
let a = t.setTimeout(() => {
|
|
34
|
-
r.delete(a),
|
|
35
|
+
r.delete(a), n || i.defaultPrevented || (C(void 0), g.value === void 0 && y() !== v && E(v), e.value !== x() && (e.value = x()));
|
|
35
36
|
}, 0);
|
|
36
37
|
r.add(a);
|
|
37
38
|
};
|
|
38
|
-
e.ownerDocument.addEventListener("reset", i, !0),
|
|
39
|
+
e.ownerDocument.addEventListener("reset", i, !0), d(() => {
|
|
39
40
|
n = !0;
|
|
40
41
|
for (let e of r) t.clearTimeout(e);
|
|
41
42
|
r.clear(), e.ownerDocument.removeEventListener("reset", i, !0);
|
|
42
43
|
});
|
|
43
|
-
}),
|
|
44
|
+
}), o(n, c(_, {
|
|
44
45
|
type: "search",
|
|
45
46
|
get class() {
|
|
46
|
-
return
|
|
47
|
+
return i("sheen-search-input", g.class);
|
|
47
48
|
},
|
|
48
49
|
get "data-sheen-shortcut"() {
|
|
49
|
-
return
|
|
50
|
+
return D()?.displayKeys;
|
|
50
51
|
},
|
|
51
52
|
get value() {
|
|
52
|
-
return
|
|
53
|
+
return w();
|
|
53
54
|
},
|
|
54
55
|
onInput: (e) => {
|
|
55
|
-
(e.isComposing ||
|
|
56
|
-
let t =
|
|
57
|
-
typeof t == "function" ? t(e) : t && t[0](t[1], e),
|
|
56
|
+
(e.isComposing || S() !== void 0) && C(e.currentTarget.value), E(e.currentTarget.value);
|
|
57
|
+
let t = g.onInput;
|
|
58
|
+
typeof t == "function" ? t(e) : t && t[0](t[1], e), S() === void 0 && !e.isComposing && e.currentTarget.value !== x() && (e.currentTarget.value = x());
|
|
58
59
|
},
|
|
59
60
|
onCompositionStart: (e) => {
|
|
60
|
-
|
|
61
|
-
let t =
|
|
61
|
+
C(e.currentTarget.value);
|
|
62
|
+
let t = g.onCompositionStart;
|
|
62
63
|
typeof t == "function" ? t(e) : t && t[0](t[1], e);
|
|
63
64
|
},
|
|
64
65
|
onCompositionEnd: (e) => {
|
|
65
|
-
let t =
|
|
66
|
-
typeof t == "function" ? t(e) : t && t[0](t[1], e),
|
|
66
|
+
let t = g.onCompositionEnd;
|
|
67
|
+
typeof t == "function" ? t(e) : t && t[0](t[1], e), C(void 0), e.currentTarget.value !== x() && (e.currentTarget.value = x());
|
|
67
68
|
},
|
|
68
69
|
ref: (e) => {
|
|
69
|
-
|
|
70
|
+
T = e, typeof g.ref == "function" && g.ref(e);
|
|
70
71
|
},
|
|
71
72
|
get endContent() {
|
|
72
|
-
return [
|
|
73
|
+
return [o(t, {
|
|
74
|
+
variant: "ghost",
|
|
73
75
|
class: "sheen-search-input-clear",
|
|
74
76
|
type: "button",
|
|
75
77
|
get disabled() {
|
|
76
|
-
return
|
|
78
|
+
return _.disabled || _.readOnly || _.readonly || S() !== void 0 || !x();
|
|
77
79
|
},
|
|
78
80
|
onClick: () => {
|
|
79
|
-
|
|
81
|
+
_.disabled || _.readOnly || _.readonly || S() !== void 0 || !x() || (E(""), T && T.value !== x() && (T.value = x()), T?.focus());
|
|
80
82
|
},
|
|
81
83
|
get children() {
|
|
82
|
-
return
|
|
84
|
+
return [o(e, { name: "close" }), (() => {
|
|
85
|
+
var e = m();
|
|
86
|
+
return s(e, () => g.clearLabel ?? h.messages().clearSearch), e;
|
|
87
|
+
})()];
|
|
83
88
|
}
|
|
84
|
-
}),
|
|
89
|
+
}), o(e, {
|
|
90
|
+
class: "sheen-search-input-indicator",
|
|
91
|
+
name: "search"
|
|
92
|
+
})];
|
|
85
93
|
}
|
|
86
94
|
}));
|
|
87
95
|
}
|
|
88
|
-
|
|
89
|
-
export { p as SearchInput };
|
|
96
|
+
export { h as SearchInput };
|
|
@@ -20,6 +20,8 @@ export interface SegmentedControlProps extends Omit<JSX.FieldsetHTMLAttributes<H
|
|
|
20
20
|
orientation?: "horizontal" | "vertical";
|
|
21
21
|
size?: "sm" | "md";
|
|
22
22
|
overflowBehavior?: "scroll" | "wrap";
|
|
23
|
+
/** Stretch segments to share the container width equally, for short exclusive choices such as Buy/Sell. */
|
|
24
|
+
fullWidth?: boolean;
|
|
23
25
|
}
|
|
24
26
|
/** A compact, native-radio single-selection control with roving focus. */
|
|
25
27
|
export declare function SegmentedControl(props: SegmentedControlProps): JSX.Element;
|