@bysages/react 0.3.0 → 0.4.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/dist/{ai-response-jZy-0Tvv.mjs → ai-response-B4DX7nmJ.mjs} +10 -4
- package/dist/chevron-a2nIZKN4.mjs +6 -0
- package/dist/components/accordion/index.d.mts +22 -4
- package/dist/components/accordion/index.mjs +31 -1
- package/dist/components/affix/index.d.mts +4 -1
- package/dist/components/affix/index.mjs +5 -3
- package/dist/components/ai/index.d.mts +2 -2
- package/dist/components/ai/index.mjs +29 -12
- package/dist/components/ai-action/index.d.mts +4 -1
- package/dist/components/ai-action/index.mjs +3 -1
- package/dist/components/ai-attachments/index.d.mts +10 -4
- package/dist/components/ai-attachments/index.mjs +19 -45
- package/dist/components/ai-message/index.d.mts +4 -1
- package/dist/components/ai-message/index.mjs +3 -1
- package/dist/components/ai-prompt-input/index.d.mts +5 -2
- package/dist/components/ai-prompt-input/index.mjs +17 -17
- package/dist/components/ai-reasoning/index.d.mts +4 -1
- package/dist/components/ai-reasoning/index.mjs +4 -2
- package/dist/components/ai-response/index.d.mts +8 -3
- package/dist/components/ai-response/index.mjs +1 -1
- package/dist/components/ai-source/index.d.mts +8 -2
- package/dist/components/ai-source/index.mjs +5 -2
- package/dist/components/ai-suggestion/index.d.mts +4 -1
- package/dist/components/ai-suggestion/index.mjs +3 -1
- package/dist/components/ai-tool/index.d.mts +4 -1
- package/dist/components/ai-tool/index.mjs +4 -2
- package/dist/components/alert/index.d.mts +2 -0
- package/dist/components/alert/index.mjs +11 -18
- package/dist/components/angle-slider/index.d.mts +19 -2
- package/dist/components/angle-slider/index.mjs +31 -8
- package/dist/components/aspect-ratio/index.d.mts +4 -1
- package/dist/components/aspect-ratio/index.mjs +3 -1
- package/dist/components/autocomplete/index.d.mts +3 -1
- package/dist/components/autocomplete/index.mjs +9 -2
- package/dist/components/avatar/index.d.mts +2 -2
- package/dist/components/avatar/index.mjs +9 -2
- package/dist/components/avatar-group/index.d.mts +4 -1
- package/dist/components/avatar-group/index.mjs +3 -1
- package/dist/components/back-top/index.d.mts +7 -1
- package/dist/components/back-top/index.mjs +12 -17
- package/dist/components/badge/index.d.mts +4 -1
- package/dist/components/badge/index.mjs +3 -1
- package/dist/components/banner/index.mjs +13 -18
- package/dist/components/block-ui/index.d.mts +4 -1
- package/dist/components/block-ui/index.mjs +3 -1
- package/dist/components/breadcrumb/index.d.mts +3 -8
- package/dist/components/breadcrumb/index.mjs +11 -1
- package/dist/components/button/index.d.mts +4 -1
- package/dist/components/button/index.mjs +3 -1
- package/dist/components/calendar/index.d.mts +3 -1
- package/dist/components/calendar/index.mjs +9 -10
- package/dist/components/carousel/index.d.mts +21 -1
- package/dist/components/carousel/index.mjs +43 -2
- package/dist/components/cascade-select/index.d.mts +6 -1
- package/dist/components/cascade-select/index.mjs +18 -37
- package/dist/components/checkbox/index.d.mts +20 -2
- package/dist/components/checkbox/index.mjs +28 -8
- package/dist/components/checkbox-group/index.d.mts +8 -6
- package/dist/components/checkbox-group/index.mjs +44 -48
- package/dist/components/chip/index.d.mts +4 -1
- package/dist/components/chip/index.mjs +3 -1
- package/dist/components/client-only/index.d.mts +7 -2
- package/dist/components/client-only/index.mjs +5 -1
- package/dist/components/clipboard/index.d.mts +17 -4
- package/dist/components/clipboard/index.mjs +33 -5
- package/dist/components/collapsible/index.d.mts +16 -4
- package/dist/components/collapsible/index.mjs +25 -1
- package/dist/components/color-picker/index.d.mts +20 -4
- package/dist/components/color-picker/index.mjs +56 -14
- package/dist/components/combobox/index.d.mts +27 -1
- package/dist/components/combobox/index.mjs +62 -5
- package/dist/components/command/index.d.mts +4 -1
- package/dist/components/command/index.mjs +15 -3
- package/dist/components/comment/index.d.mts +4 -1
- package/dist/components/comment/index.mjs +3 -1
- package/dist/components/config-provider/index.d.mts +8 -2
- package/dist/components/config-provider/index.mjs +5 -2
- package/dist/components/container/index.d.mts +4 -1
- package/dist/components/container/index.mjs +3 -1
- package/dist/components/data-view/index.d.mts +4 -1
- package/dist/components/data-view/index.mjs +7 -3
- package/dist/components/date-input/index.d.mts +19 -4
- package/dist/components/date-input/index.mjs +33 -9
- package/dist/components/date-picker/index.d.mts +21 -4
- package/dist/components/date-picker/index.mjs +58 -11
- package/dist/components/deferred-content/index.d.mts +4 -1
- package/dist/components/deferred-content/index.mjs +3 -1
- package/dist/components/descriptions/index.d.mts +10 -2
- package/dist/components/descriptions/index.mjs +13 -8
- package/dist/components/dialog/index.d.mts +18 -5
- package/dist/components/dialog/index.mjs +43 -1
- package/dist/components/download-trigger/index.d.mts +7 -2
- package/dist/components/download-trigger/index.mjs +5 -1
- package/dist/components/drawer/index.d.mts +18 -6
- package/dist/components/drawer/index.mjs +40 -1
- package/dist/components/dynamic-input/index.d.mts +4 -1
- package/dist/components/dynamic-input/index.mjs +13 -19
- package/dist/components/editable/index.d.mts +28 -7
- package/dist/components/editable/index.mjs +43 -4
- package/dist/components/ellipsis/index.d.mts +4 -1
- package/dist/components/ellipsis/index.mjs +3 -1
- package/dist/components/field/index.d.mts +30 -5
- package/dist/components/field/index.mjs +36 -3
- package/dist/components/fieldset/index.d.mts +19 -4
- package/dist/components/fieldset/index.mjs +28 -3
- package/dist/components/file-upload/index.d.mts +36 -9
- package/dist/components/file-upload/index.mjs +66 -11
- package/dist/components/float-button/index.mjs +3 -1
- package/dist/components/floating-panel/index.d.mts +18 -6
- package/dist/components/floating-panel/index.mjs +55 -1
- package/dist/components/focus-trap/index.d.mts +7 -2
- package/dist/components/focus-trap/index.mjs +5 -1
- package/dist/components/form/index.d.mts +1 -1
- package/dist/components/form/index.mjs +5 -2
- package/dist/components/frame/index.d.mts +4 -8
- package/dist/components/frame/index.mjs +13 -1
- package/dist/components/grid/index.d.mts +4 -1
- package/dist/components/grid/index.mjs +3 -1
- package/dist/components/highlight/index.d.mts +3 -5
- package/dist/components/highlight/index.mjs +6 -1
- package/dist/components/hover-card/index.d.mts +20 -4
- package/dist/components/hover-card/index.mjs +32 -1
- package/dist/components/icon/index.d.mts +10 -8
- package/dist/components/icon/index.mjs +5 -3
- package/dist/components/image/index.d.mts +11 -2
- package/dist/components/image/index.mjs +16 -29
- package/dist/components/image-cropper/index.d.mts +13 -2
- package/dist/components/image-cropper/index.mjs +34 -2
- package/dist/components/image-viewer/index.d.mts +2 -18
- package/dist/components/image-viewer/index.mjs +3 -109
- package/dist/components/input/index.d.mts +3 -1
- package/dist/components/input/index.mjs +1 -1
- package/dist/components/json-tree-view/index.d.mts +20 -4
- package/dist/components/json-tree-view/index.mjs +38 -4
- package/dist/components/kbd/index.d.mts +4 -1
- package/dist/components/kbd/index.mjs +3 -1
- package/dist/components/layout/index.d.mts +25 -7
- package/dist/components/layout/index.mjs +159 -63
- package/dist/components/link/index.d.mts +4 -1
- package/dist/components/link/index.mjs +3 -1
- package/dist/components/list/index.d.mts +5 -4
- package/dist/components/list/index.mjs +10 -1
- package/dist/components/listbox/index.d.mts +22 -1
- package/dist/components/listbox/index.mjs +36 -4
- package/dist/components/marquee/index.d.mts +18 -1
- package/dist/components/marquee/index.mjs +34 -2
- package/dist/components/masonry/index.d.mts +4 -1
- package/dist/components/masonry/index.mjs +3 -1
- package/dist/components/media-player/index.d.mts +2 -0
- package/dist/components/media-player/index.mjs +2 -0
- package/dist/components/mentions/index.d.mts +1 -1
- package/dist/components/mentions/index.mjs +1 -1
- package/dist/components/menu/index.d.mts +29 -11
- package/dist/components/menu/index.mjs +34 -12
- package/dist/components/menubar/index.d.mts +3 -1
- package/dist/components/menubar/index.mjs +7 -1
- package/dist/components/navigation-menu/index.d.mts +25 -1
- package/dist/components/navigation-menu/index.mjs +36 -1
- package/dist/components/number-input/index.d.mts +28 -6
- package/dist/components/number-input/index.mjs +33 -8
- package/dist/components/order-list/index.d.mts +4 -1
- package/dist/components/order-list/index.mjs +34 -33
- package/dist/components/pagination/index.d.mts +23 -3
- package/dist/components/pagination/index.mjs +57 -12
- package/dist/components/password-input/index.d.mts +24 -6
- package/dist/components/password-input/index.mjs +31 -8
- package/dist/components/pin-input/index.d.mts +23 -5
- package/dist/components/pin-input/index.mjs +29 -7
- package/dist/components/popconfirm/index.d.mts +9 -5
- package/dist/components/popconfirm/index.mjs +23 -18
- package/dist/components/popover/index.d.mts +2 -8
- package/dist/components/popover/index.mjs +44 -4
- package/dist/components/presence/index.d.mts +10 -2
- package/dist/components/presence/index.mjs +6 -1
- package/dist/components/progress/index.d.mts +18 -3
- package/dist/components/progress/index.mjs +34 -9
- package/dist/components/progress-group/index.d.mts +4 -1
- package/dist/components/progress-group/index.mjs +4 -2
- package/dist/components/qr-code/index.d.mts +14 -1
- package/dist/components/qr-code/index.mjs +26 -2
- package/dist/components/radio-group/index.d.mts +27 -2
- package/dist/components/radio-group/index.mjs +32 -8
- package/dist/components/rating-group/index.d.mts +20 -3
- package/dist/components/rating-group/index.mjs +26 -8
- package/dist/components/result/index.d.mts +1 -1
- package/dist/components/result/index.mjs +2 -2
- package/dist/components/scroll-area/index.d.mts +14 -1
- package/dist/components/scroll-area/index.mjs +32 -2
- package/dist/components/segment-group/index.d.mts +28 -2
- package/dist/components/segment-group/index.mjs +34 -7
- package/dist/components/select/index.d.mts +2 -2
- package/dist/components/select/index.mjs +1 -1
- package/dist/components/separator/index.d.mts +4 -1
- package/dist/components/separator/index.mjs +3 -1
- package/dist/components/signature-pad/index.d.mts +25 -5
- package/dist/components/signature-pad/index.mjs +37 -3
- package/dist/components/skeleton/index.d.mts +4 -1
- package/dist/components/skeleton/index.mjs +3 -1
- package/dist/components/slider/index.d.mts +21 -2
- package/dist/components/slider/index.mjs +31 -8
- package/dist/components/spinner/index.d.mts +4 -1
- package/dist/components/spinner/index.mjs +6 -2
- package/dist/components/split-button/index.d.mts +3 -1
- package/dist/components/split-button/index.mjs +15 -18
- package/dist/components/splitter/index.d.mts +17 -4
- package/dist/components/splitter/index.mjs +35 -1
- package/dist/components/spotlight/index.d.mts +4 -1
- package/dist/components/spotlight/index.mjs +3 -1
- package/dist/components/stack/index.d.mts +4 -1
- package/dist/components/stack/index.mjs +6 -4
- package/dist/components/steps/index.d.mts +27 -3
- package/dist/components/steps/index.mjs +36 -12
- package/dist/components/swap/index.d.mts +11 -5
- package/dist/components/swap/index.mjs +30 -3
- package/dist/components/switch/index.d.mts +20 -2
- package/dist/components/switch/index.mjs +27 -8
- package/dist/components/table/index.d.mts +4 -1
- package/dist/components/table/index.mjs +44 -70
- package/dist/components/tabs/index.d.mts +24 -2
- package/dist/components/tabs/index.mjs +25 -9
- package/dist/components/tags-input/index.d.mts +33 -8
- package/dist/components/tags-input/index.mjs +41 -9
- package/dist/components/terminal/index.d.mts +4 -1
- package/dist/components/terminal/index.mjs +8 -3
- package/dist/components/textarea/index.d.mts +4 -1
- package/dist/components/textarea/index.mjs +3 -1
- package/dist/components/timer/index.d.mts +18 -1
- package/dist/components/timer/index.mjs +51 -2
- package/dist/components/toast/index.d.mts +3 -6
- package/dist/components/toast/index.mjs +22 -2
- package/dist/components/toc/index.d.mts +24 -4
- package/dist/components/toc/index.mjs +41 -3
- package/dist/components/toggle/index.d.mts +11 -4
- package/dist/components/toggle/index.mjs +21 -1
- package/dist/components/toggle-group/index.d.mts +26 -2
- package/dist/components/toggle-group/index.mjs +31 -6
- package/dist/components/toolbar/index.d.mts +4 -1
- package/dist/components/toolbar/index.mjs +3 -1
- package/dist/components/tooltip/index.d.mts +17 -4
- package/dist/components/tooltip/index.mjs +28 -1
- package/dist/components/tour/index.d.mts +18 -9
- package/dist/components/tour/index.mjs +44 -2
- package/dist/components/transfer/index.d.mts +3 -1
- package/dist/components/transfer/index.mjs +20 -30
- package/dist/components/tree-select/index.d.mts +3 -1
- package/dist/components/tree-select/index.mjs +15 -24
- package/dist/components/tree-view/index.d.mts +30 -1
- package/dist/components/tree-view/index.mjs +69 -6
- package/dist/components/typography/index.d.mts +4 -0
- package/dist/components/typography/index.mjs +1 -0
- package/dist/components/user/index.d.mts +4 -1
- package/dist/components/user/index.mjs +3 -1
- package/dist/components/virtual-list/index.d.mts +4 -1
- package/dist/components/virtual-list/index.mjs +11 -12
- package/dist/components/watermark/index.d.mts +4 -1
- package/dist/components/watermark/index.mjs +4 -2
- package/dist/family-DE_GQeeM.mjs +9 -0
- package/dist/icon-BALgGtNK.mjs +18 -0
- package/dist/id-C37UYLwJ.mjs +13 -0
- package/dist/image-viewer-Cf6thHax.mjs +141 -0
- package/dist/{index-Uefyw7Im.d.mts → index-Bbg4heDO.d.mts} +12 -7
- package/dist/index-BcRdWGY-.d.mts +115 -0
- package/dist/{index-DFN9F5Zt.d.mts → index-D_iKc2Uw.d.mts} +32 -3
- package/dist/{index-CsfxYv6J.d.mts → index-DdNKngUQ.d.mts} +63 -39
- package/dist/index-Dj8S4eyJ.d.mts +41 -0
- package/dist/index-Eu-Bttta.d.mts +24 -0
- package/dist/{index-uPyYiWaL.d.mts → index-PsgGWW3m.d.mts} +8 -2
- package/dist/index.d.mts +36 -35
- package/dist/index.mjs +13 -12
- package/dist/{input-2oezH-dY.mjs → input-C21Zzuy6.mjs} +3 -1
- package/dist/media-player-gQrnxU52.mjs +554 -0
- package/dist/{mentions-DMIBCBOd.mjs → mentions-BuWibdci.mjs} +74 -42
- package/dist/messages-1jJWtaYU.mjs +16 -0
- package/dist/select-ozUFq0zd.mjs +121 -0
- package/package.json +3 -3
- package/dist/chevron-BeHvt46K.mjs +0 -17
- package/dist/select-D1xiT1oJ.mjs +0 -68
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { t as withSelfRoot } from "./family-DE_GQeeM.mjs";
|
|
2
|
+
import { n as useComponentMessages } from "./messages-1jJWtaYU.mjs";
|
|
1
3
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
4
|
import { jsx } from "react/jsx-runtime";
|
|
3
5
|
import { useEffect, useRef } from "react";
|
|
@@ -99,20 +101,23 @@ function wrapResponseTables(root) {
|
|
|
99
101
|
}
|
|
100
102
|
//#endregion
|
|
101
103
|
//#region src/components/ai-response/index.tsx
|
|
102
|
-
function
|
|
104
|
+
function ResponseImpl({ content, highlighter, copyLabel, copiedLabel, ...rest }) {
|
|
103
105
|
injectComponentStyle("ai");
|
|
106
|
+
const messages = useComponentMessages();
|
|
107
|
+
const resolvedCopyLabel = copyLabel ?? messages.ai.copyCode;
|
|
108
|
+
const resolvedCopiedLabel = copiedLabel ?? messages.ai.copied;
|
|
104
109
|
const root = useRef(null);
|
|
105
110
|
useEffect(() => {
|
|
106
111
|
const host = root.current;
|
|
107
|
-
if (host) decorateCodeCopy(host,
|
|
112
|
+
if (host) decorateCodeCopy(host, resolvedCopyLabel);
|
|
108
113
|
if (host) wrapResponseTables(host);
|
|
109
114
|
}, [
|
|
110
115
|
content,
|
|
111
116
|
highlighter,
|
|
112
|
-
|
|
117
|
+
resolvedCopyLabel
|
|
113
118
|
]);
|
|
114
119
|
const onClick = (event) => {
|
|
115
|
-
clickCodeCopy(event.nativeEvent,
|
|
120
|
+
clickCodeCopy(event.nativeEvent, resolvedCopyLabel, resolvedCopiedLabel);
|
|
116
121
|
};
|
|
117
122
|
return /* @__PURE__ */ jsx("div", {
|
|
118
123
|
...rest,
|
|
@@ -123,5 +128,6 @@ function Response({ content, highlighter, copyLabel = "Copy code", copiedLabel =
|
|
|
123
128
|
dangerouslySetInnerHTML: { __html: renderHtml(content, highlighter ? { highlighter } : void 0) }
|
|
124
129
|
});
|
|
125
130
|
}
|
|
131
|
+
const Response = withSelfRoot(ResponseImpl);
|
|
126
132
|
//#endregion
|
|
127
133
|
export { Response as t };
|
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
import { Accordion as Accordion$1 } from "@ark-ui/react/accordion";
|
|
2
2
|
//#region src/components/accordion/index.d.ts
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
export type AccordionItem = {
|
|
4
|
+
value: string;
|
|
5
|
+
title: string;
|
|
6
|
+
content: string;
|
|
7
|
+
};
|
|
8
|
+
export interface AccordionFacadeProps {
|
|
9
|
+
value?: string[];
|
|
10
|
+
defaultValue?: string[];
|
|
11
|
+
items: AccordionItem[];
|
|
12
|
+
multiple?: boolean;
|
|
13
|
+
collapsible?: boolean;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
orientation?: "horizontal" | "vertical";
|
|
16
|
+
className?: string;
|
|
17
|
+
onValueChange?: (value: string[]) => void;
|
|
18
|
+
}
|
|
19
|
+
declare function AccordionFacade({ value, defaultValue, items, multiple, collapsible, disabled, orientation, className, onValueChange }: AccordionFacadeProps): import("react").JSX.Element;
|
|
20
|
+
declare namespace AccordionFacade {
|
|
21
|
+
var displayName: string;
|
|
22
|
+
}
|
|
23
|
+
type AccordionParts = typeof Accordion$1;
|
|
24
|
+
export declare const Accordion: typeof AccordionFacade & AccordionParts;
|
|
7
25
|
//#endregion
|
|
@@ -1,10 +1,40 @@
|
|
|
1
|
+
import { t as iconNode } from "../../icon-BALgGtNK.mjs";
|
|
2
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
1
3
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
4
|
import { Accordion as Accordion$1 } from "@ark-ui/react/accordion";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
6
|
//#region src/components/accordion/index.tsx
|
|
4
7
|
/** Ark's Accordion, dressed in the paper-and-ink system: a ruled sheet
|
|
5
8
|
* folded by quiet rows, unfolding with a spring-chevoned dissolve. The
|
|
6
9
|
* API is Ark's own — Root, Item, ItemTrigger, ItemContent, ItemIndicator. */
|
|
7
|
-
|
|
10
|
+
function AccordionRoot(props) {
|
|
11
|
+
const id = useElementId("accordion", props);
|
|
12
|
+
return /* @__PURE__ */ jsx(Accordion$1.Root, {
|
|
13
|
+
...props,
|
|
14
|
+
id
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function AccordionFacade({ value, defaultValue, items, multiple = false, collapsible = true, disabled = false, orientation = "vertical", className, onValueChange }) {
|
|
18
|
+
return /* @__PURE__ */ jsx(AccordionRoot, {
|
|
19
|
+
className,
|
|
20
|
+
disabled,
|
|
21
|
+
multiple,
|
|
22
|
+
collapsible,
|
|
23
|
+
orientation,
|
|
24
|
+
defaultValue,
|
|
25
|
+
...value === void 0 ? {} : { value },
|
|
26
|
+
onValueChange: (details) => onValueChange?.(details.value),
|
|
27
|
+
children: items.map((item) => /* @__PURE__ */ jsxs(Accordion$1.Item, {
|
|
28
|
+
value: item.value,
|
|
29
|
+
children: [/* @__PURE__ */ jsxs(Accordion$1.ItemTrigger, { children: [item.title, /* @__PURE__ */ jsx(Accordion$1.ItemIndicator, { children: iconNode("chevron-down") })] }), /* @__PURE__ */ jsx(Accordion$1.ItemContent, { children: /* @__PURE__ */ jsx("p", { children: item.content }) })]
|
|
30
|
+
}, item.value))
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
AccordionFacade.displayName = "SAccordion";
|
|
34
|
+
const Accordion = Object.assign(AccordionFacade, {
|
|
35
|
+
...Accordion$1,
|
|
36
|
+
Root: AccordionRoot
|
|
37
|
+
});
|
|
8
38
|
injectComponentStyle("accordion");
|
|
9
39
|
//#endregion
|
|
10
40
|
export { Accordion };
|
|
@@ -16,5 +16,8 @@ export interface AffixProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
16
16
|
/** Where it pins from the bottom instead, for footers and action bars. */
|
|
17
17
|
offsetBottom?: string;
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
declare function AffixImpl({ offsetTop, offsetBottom, ...rest }: AffixProps): import("react").JSX.Element;
|
|
20
|
+
export declare const Affix: typeof AffixImpl & {
|
|
21
|
+
Root: typeof AffixImpl;
|
|
22
|
+
};
|
|
20
23
|
//#endregion
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
1
2
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
//#region src/components/affix/index.tsx
|
|
4
|
-
function
|
|
5
|
+
function AffixImpl({ offsetTop = "0px", offsetBottom = "0px", ...rest }) {
|
|
5
6
|
injectComponentStyle("affix");
|
|
6
7
|
return /* @__PURE__ */ jsx("div", {
|
|
7
8
|
...rest,
|
|
8
9
|
style: {
|
|
9
10
|
...rest.style,
|
|
10
|
-
top: offsetTop,
|
|
11
|
-
bottom: offsetBottom
|
|
11
|
+
"--bs-affix-top": offsetTop,
|
|
12
|
+
"--bs-affix-bottom": offsetBottom
|
|
12
13
|
},
|
|
13
14
|
"data-scope": "affix",
|
|
14
15
|
"data-part": "root"
|
|
15
16
|
});
|
|
16
17
|
}
|
|
18
|
+
const Affix = withSelfRoot(AffixImpl);
|
|
17
19
|
//#endregion
|
|
18
20
|
export { Affix };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { Ai, AiActions, AiContent,
|
|
1
|
+
import { a as FileUIPart, c as SourceUrlUIPart, d as ToolUIPart, f as UIMessage, i as DataUIPart, l as StepStartUIPart, n as AiActions, o as ReasoningUIPart, p as UIMessagePart, r as AiContent, s as SourceDocumentUIPart, t as Ai, u as TextUIPart } from "../../index-DdNKngUQ.mjs";
|
|
2
|
+
export { Ai, AiActions, AiContent, type DataUIPart, type FileUIPart, type ReasoningUIPart, type SourceDocumentUIPart, type SourceUrlUIPart, type StepStartUIPart, type TextUIPart, type ToolUIPart, type UIMessage, type UIMessagePart };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
2
|
+
import { n as useComponentMessages } from "../../messages-1jJWtaYU.mjs";
|
|
1
3
|
import { Action } from "../ai-action/index.mjs";
|
|
2
4
|
import { AiMessage as Message } from "../ai-message/index.mjs";
|
|
3
5
|
import { AiPromptInput as PromptInput } from "../ai-prompt-input/index.mjs";
|
|
4
6
|
import { AiReasoning as Reasoning } from "../ai-reasoning/index.mjs";
|
|
5
|
-
import { t as Response } from "../../ai-response-
|
|
7
|
+
import { t as Response } from "../../ai-response-B4DX7nmJ.mjs";
|
|
6
8
|
import { AiSource as Source, AiSources as Sources } from "../ai-source/index.mjs";
|
|
7
9
|
import { AiSuggestion as Suggestion } from "../ai-suggestion/index.mjs";
|
|
8
10
|
import { AiTool as Tool } from "../ai-tool/index.mjs";
|
|
@@ -29,23 +31,38 @@ function part(name, tag, extra = {}) {
|
|
|
29
31
|
}
|
|
30
32
|
/** The log itself: the column every stroke lands in, a landmark to
|
|
31
33
|
* screen readers. */
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
|
|
34
|
+
function AiConversation({ children, ...rest }) {
|
|
35
|
+
const messages = useComponentMessages();
|
|
36
|
+
return /* @__PURE__ */ jsx("div", {
|
|
37
|
+
...rest,
|
|
38
|
+
role: "log",
|
|
39
|
+
"aria-label": rest["aria-label"] ?? messages.ai.conversation,
|
|
40
|
+
"data-scope": "ai",
|
|
41
|
+
"data-part": "conversation",
|
|
42
|
+
children
|
|
43
|
+
});
|
|
44
|
+
}
|
|
36
45
|
/** The bubble's inner measure — content that belongs to neither side
|
|
37
46
|
* specifically. */
|
|
38
|
-
const AiContent = part("Content", "div");
|
|
47
|
+
const AiContent = withSelfRoot(part("Content", "div"));
|
|
39
48
|
/** The quiet row under a message — copy, retry, feedback. */
|
|
40
|
-
const AiActions = part("Actions", "div");
|
|
49
|
+
const AiActions = withSelfRoot(part("Actions", "div"));
|
|
41
50
|
/** The while-it-works whisper for the in-flight turns. */
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
|
|
51
|
+
function AiLoader({ children, ...rest }) {
|
|
52
|
+
const messages = useComponentMessages();
|
|
53
|
+
return /* @__PURE__ */ jsx("span", {
|
|
54
|
+
...rest,
|
|
55
|
+
role: "status",
|
|
56
|
+
"aria-label": rest["aria-label"] ?? messages.ai.loading,
|
|
57
|
+
"data-scope": "ai",
|
|
58
|
+
"data-part": "loader",
|
|
59
|
+
children
|
|
60
|
+
});
|
|
61
|
+
}
|
|
46
62
|
/** The whole family under one handle — `Ai.Conversation`,
|
|
47
63
|
* `Ai.Message`, and the rest, exactly as before the split. */
|
|
48
64
|
const Ai = Object.assign(AiConversation, {
|
|
65
|
+
Root: AiConversation,
|
|
49
66
|
Conversation: AiConversation,
|
|
50
67
|
MessageContent: AiContent,
|
|
51
68
|
Actions: AiActions,
|
|
@@ -62,4 +79,4 @@ const Ai = Object.assign(AiConversation, {
|
|
|
62
79
|
});
|
|
63
80
|
injectComponentStyle("ai");
|
|
64
81
|
//#endregion
|
|
65
|
-
export { Ai, AiActions, AiContent
|
|
82
|
+
export { Ai, AiActions, AiContent };
|
|
@@ -9,6 +9,9 @@ export interface ActionProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
9
9
|
label: string;
|
|
10
10
|
children?: ReactNode;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
declare function ActionImpl({ label, children, ...rest }: ActionProps): import("react").JSX.Element;
|
|
13
|
+
export declare const Action: typeof ActionImpl & {
|
|
14
|
+
Root: typeof ActionImpl;
|
|
15
|
+
};
|
|
13
16
|
//#endregion
|
|
14
17
|
export { Action as AiAction };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
1
2
|
import { Button } from "../button/index.mjs";
|
|
2
3
|
import { injectComponentStyle } from "@bysages/core";
|
|
3
4
|
import { jsx } from "react/jsx-runtime";
|
|
4
5
|
//#region src/components/ai-action/index.tsx
|
|
5
|
-
function
|
|
6
|
+
function ActionImpl({ label, children, ...rest }) {
|
|
6
7
|
injectComponentStyle("ai");
|
|
7
8
|
return /* @__PURE__ */ jsx(Button, {
|
|
8
9
|
variant: "ghost",
|
|
@@ -14,5 +15,6 @@ function Action({ label, children, ...rest }) {
|
|
|
14
15
|
children
|
|
15
16
|
});
|
|
16
17
|
}
|
|
18
|
+
const Action = withSelfRoot(ActionImpl);
|
|
17
19
|
//#endregion
|
|
18
20
|
export { Action, Action as AiAction };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { HTMLAttributes } from "react";
|
|
2
2
|
//#region src/components/ai-attachments/index.d.ts
|
|
3
|
-
/** One file riding the prompt: its
|
|
3
|
+
/** One file riding the prompt: its icon by extension, its name and
|
|
4
4
|
* human size, and a quiet way to take it back off. Uploading reads as
|
|
5
5
|
* a dashed ghost, error as danger ink. */
|
|
6
6
|
export interface AttachmentProps extends HTMLAttributes<HTMLSpanElement> {
|
|
7
|
-
/** The file's name — it picks the
|
|
7
|
+
/** The file's name — it picks the icon by extension. */
|
|
8
8
|
name: string;
|
|
9
9
|
/** The file's size in bytes, when known — rendered human. */
|
|
10
10
|
size?: number;
|
|
@@ -12,8 +12,14 @@ export interface AttachmentProps extends HTMLAttributes<HTMLSpanElement> {
|
|
|
12
12
|
status?: "uploading" | "ready" | "error";
|
|
13
13
|
onRemove?: () => void;
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
declare function AttachmentImpl({ name, size, status, onRemove, ...rest }: AttachmentProps): import("react").JSX.Element;
|
|
16
|
+
export declare const Attachment: typeof AttachmentImpl & {
|
|
17
|
+
Root: typeof AttachmentImpl;
|
|
18
|
+
};
|
|
16
19
|
/** The row the files ride in — a wrapping line of chips. */
|
|
17
|
-
|
|
20
|
+
declare function AttachmentsImpl({ children, ...rest }: HTMLAttributes<HTMLSpanElement>): import("react").JSX.Element;
|
|
21
|
+
export declare const Attachments: typeof AttachmentsImpl & {
|
|
22
|
+
Root: typeof AttachmentsImpl;
|
|
23
|
+
};
|
|
18
24
|
//#endregion
|
|
19
25
|
export { Attachment as AiAttachment, Attachments as AiAttachments };
|
|
@@ -1,49 +1,20 @@
|
|
|
1
|
+
import { t as iconNode } from "../../icon-BALgGtNK.mjs";
|
|
2
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
3
|
+
import { n as useComponentMessages, t as formatMessage } from "../../messages-1jJWtaYU.mjs";
|
|
1
4
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
6
|
//#region src/components/ai-attachments/index.tsx
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
fill: "none",
|
|
8
|
-
stroke: "currentColor",
|
|
9
|
-
strokeWidth: 1.5,
|
|
10
|
-
strokeLinecap: "square",
|
|
11
|
-
children: [
|
|
12
|
-
/* @__PURE__ */ jsx("rect", {
|
|
13
|
-
x: 2.5,
|
|
14
|
-
y: 3.5,
|
|
15
|
-
width: 11,
|
|
16
|
-
height: 9
|
|
17
|
-
}),
|
|
18
|
-
/* @__PURE__ */ jsx("path", { d: "M2.5 10.5 6 7l3 3 2-1.5 2.5 2" }),
|
|
19
|
-
/* @__PURE__ */ jsx("circle", {
|
|
20
|
-
cx: 6,
|
|
21
|
-
cy: 6,
|
|
22
|
-
r: .75,
|
|
23
|
-
fill: "currentColor",
|
|
24
|
-
stroke: "none"
|
|
25
|
-
})
|
|
26
|
-
]
|
|
7
|
+
const imageIcon = iconNode("image", {
|
|
8
|
+
width: 16,
|
|
9
|
+
height: 16
|
|
27
10
|
});
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
fill: "none",
|
|
32
|
-
stroke: "currentColor",
|
|
33
|
-
strokeWidth: 1.5,
|
|
34
|
-
strokeLinecap: "square",
|
|
35
|
-
children: [/* @__PURE__ */ jsx("path", { d: "M4 2.5h5l3 3V13.5H4z" }), /* @__PURE__ */ jsx("path", { d: "M9 2.5v3h3" })]
|
|
11
|
+
const fileIcon = iconNode("file", {
|
|
12
|
+
width: 16,
|
|
13
|
+
height: 16
|
|
36
14
|
});
|
|
37
|
-
const
|
|
38
|
-
viewBox: "0 0 16 16",
|
|
15
|
+
const removeIcon = iconNode("x", {
|
|
39
16
|
width: 12,
|
|
40
|
-
height: 12
|
|
41
|
-
"aria-hidden": "true",
|
|
42
|
-
fill: "none",
|
|
43
|
-
stroke: "currentColor",
|
|
44
|
-
strokeWidth: 1.5,
|
|
45
|
-
strokeLinecap: "square",
|
|
46
|
-
children: /* @__PURE__ */ jsx("path", { d: "M4 4l8 8M12 4l-8 8" })
|
|
17
|
+
height: 12
|
|
47
18
|
});
|
|
48
19
|
const IMAGE_EXTS = [
|
|
49
20
|
"png",
|
|
@@ -72,29 +43,31 @@ const humanSize = (bytes) => {
|
|
|
72
43
|
} while (value >= 1024 && unit < units.length - 1);
|
|
73
44
|
return `${value.toFixed(1)} ${units[unit]}`;
|
|
74
45
|
};
|
|
75
|
-
function
|
|
46
|
+
function AttachmentImpl({ name, size, status = "ready", onRemove, ...rest }) {
|
|
76
47
|
injectComponentStyle("ai");
|
|
48
|
+
const messages = useComponentMessages();
|
|
77
49
|
return /* @__PURE__ */ jsxs("span", {
|
|
78
50
|
...rest,
|
|
79
51
|
"data-scope": "ai",
|
|
80
52
|
"data-part": "attachment",
|
|
81
53
|
"data-status": status,
|
|
82
54
|
children: [
|
|
83
|
-
isImage(name) ?
|
|
55
|
+
isImage(name) ? imageIcon : fileIcon,
|
|
84
56
|
/* @__PURE__ */ jsx("span", { children: name }),
|
|
85
57
|
size !== void 0 ? /* @__PURE__ */ jsx("span", { children: humanSize(size) }) : null,
|
|
86
58
|
/* @__PURE__ */ jsx("button", {
|
|
87
59
|
type: "button",
|
|
88
60
|
"data-remove": "",
|
|
89
|
-
"aria-label":
|
|
61
|
+
"aria-label": formatMessage(messages.ai.removeAttachment, { name }),
|
|
90
62
|
onClick: () => onRemove?.(),
|
|
91
|
-
children:
|
|
63
|
+
children: removeIcon
|
|
92
64
|
})
|
|
93
65
|
]
|
|
94
66
|
});
|
|
95
67
|
}
|
|
68
|
+
const Attachment = withSelfRoot(AttachmentImpl);
|
|
96
69
|
/** The row the files ride in — a wrapping line of chips. */
|
|
97
|
-
function
|
|
70
|
+
function AttachmentsImpl({ children, ...rest }) {
|
|
98
71
|
return /* @__PURE__ */ jsx("span", {
|
|
99
72
|
...rest,
|
|
100
73
|
"data-scope": "ai",
|
|
@@ -102,5 +75,6 @@ function Attachments({ children, ...rest }) {
|
|
|
102
75
|
children
|
|
103
76
|
});
|
|
104
77
|
}
|
|
78
|
+
const Attachments = withSelfRoot(AttachmentsImpl);
|
|
105
79
|
//#endregion
|
|
106
80
|
export { Attachment as AiAttachment, Attachment, Attachments as AiAttachments, Attachments };
|
|
@@ -6,6 +6,9 @@ export interface MessageProps extends HTMLAttributes<HTMLElement> {
|
|
|
6
6
|
role?: "user" | "assistant" | "system";
|
|
7
7
|
children?: ReactNode;
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
declare function MessageImpl({ role, children, ...rest }: MessageProps): import("react").JSX.Element;
|
|
10
|
+
export declare const Message: typeof MessageImpl & {
|
|
11
|
+
Root: typeof MessageImpl;
|
|
12
|
+
};
|
|
10
13
|
//#endregion
|
|
11
14
|
export { Message as AiMessage };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
1
2
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
//#region src/components/ai-message/index.tsx
|
|
4
|
-
function
|
|
5
|
+
function MessageImpl({ role = "assistant", children, ...rest }) {
|
|
5
6
|
injectComponentStyle("ai");
|
|
6
7
|
return /* @__PURE__ */ jsx("article", {
|
|
7
8
|
...rest,
|
|
@@ -11,5 +12,6 @@ function Message({ role = "assistant", children, ...rest }) {
|
|
|
11
12
|
children
|
|
12
13
|
});
|
|
13
14
|
}
|
|
15
|
+
const Message = withSelfRoot(MessageImpl);
|
|
14
16
|
//#endregion
|
|
15
17
|
export { Message as AiMessage, Message };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as MentionEntry } from "../../index-
|
|
1
|
+
import { t as MentionEntry } from "../../index-Bbg4heDO.mjs";
|
|
2
2
|
import { HTMLAttributes, ReactNode } from "react";
|
|
3
3
|
//#region src/components/ai-prompt-input/index.d.ts
|
|
4
4
|
/**
|
|
@@ -42,6 +42,9 @@ export interface PromptInputProps extends Omit<HTMLAttributes<HTMLFormElement>,
|
|
|
42
42
|
footer?: ReactNode;
|
|
43
43
|
footerEnd?: ReactNode;
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
declare function PromptInputImpl({ value, onValueChange, onSubmit, onStop, placeholder, "aria-label": ariaLabel, disabled, busy, mentions, header, leading, trailing, footer, footerEnd, ...rest }: PromptInputProps): import("react").JSX.Element;
|
|
46
|
+
export declare const PromptInput: typeof PromptInputImpl & {
|
|
47
|
+
Root: typeof PromptInputImpl;
|
|
48
|
+
};
|
|
46
49
|
//#endregion
|
|
47
50
|
export { PromptInput as AiPromptInput };
|
|
@@ -1,22 +1,18 @@
|
|
|
1
|
+
import { t as iconNode } from "../../icon-BALgGtNK.mjs";
|
|
2
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
3
|
+
import { n as useComponentMessages } from "../../messages-1jJWtaYU.mjs";
|
|
1
4
|
import { Button } from "../button/index.mjs";
|
|
2
5
|
import { Field } from "../field/index.mjs";
|
|
3
|
-
import { n as MentionsVessel, r as useMentions } from "../../mentions-
|
|
6
|
+
import { n as MentionsVessel, r as useMentions } from "../../mentions-BuWibdci.mjs";
|
|
4
7
|
import { injectComponentStyle } from "@bysages/core";
|
|
5
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
9
|
import { useRef } from "react";
|
|
7
10
|
//#region src/components/ai-prompt-input/index.tsx
|
|
8
|
-
const
|
|
9
|
-
viewBox: "0 0 16 16",
|
|
11
|
+
const arrowUpIcon = iconNode("arrow-up", {
|
|
10
12
|
width: 14,
|
|
11
|
-
height: 14
|
|
12
|
-
"aria-hidden": "true",
|
|
13
|
-
fill: "none",
|
|
14
|
-
stroke: "currentColor",
|
|
15
|
-
strokeWidth: 1.5,
|
|
16
|
-
strokeLinecap: "square",
|
|
17
|
-
children: /* @__PURE__ */ jsx("path", { d: "M8 13V3M3.5 7.5 8 3l4.5 4.5" })
|
|
13
|
+
height: 14
|
|
18
14
|
});
|
|
19
|
-
const
|
|
15
|
+
const stopIcon = /* @__PURE__ */ jsx("svg", {
|
|
20
16
|
viewBox: "0 0 16 16",
|
|
21
17
|
width: 14,
|
|
22
18
|
height: 14,
|
|
@@ -39,9 +35,11 @@ function row(part, content) {
|
|
|
39
35
|
children: content
|
|
40
36
|
});
|
|
41
37
|
}
|
|
42
|
-
function
|
|
38
|
+
function PromptInputImpl({ value, onValueChange, onSubmit, onStop, placeholder, "aria-label": ariaLabel, disabled = false, busy = false, mentions, header, leading, trailing, footer, footerEnd, ...rest }) {
|
|
43
39
|
injectComponentStyle("ai");
|
|
44
40
|
const fieldRef = useRef(null);
|
|
41
|
+
const messages = useComponentMessages();
|
|
42
|
+
const placeholderText = placeholder ?? messages.ai.conversation;
|
|
45
43
|
const mentionState = useMentions(() => ({
|
|
46
44
|
items: mentions?.items ?? [],
|
|
47
45
|
trigger: mentions?.trigger
|
|
@@ -61,18 +59,18 @@ function PromptInput({ value, onValueChange, onSubmit, onStop, placeholder = "Se
|
|
|
61
59
|
size: "sm",
|
|
62
60
|
square: true,
|
|
63
61
|
type: "button",
|
|
64
|
-
"aria-label":
|
|
62
|
+
"aria-label": messages.ai.stop,
|
|
65
63
|
disabled,
|
|
66
64
|
onClick: () => onStop?.(),
|
|
67
|
-
children:
|
|
65
|
+
children: stopIcon
|
|
68
66
|
}) : /* @__PURE__ */ jsx(Button, {
|
|
69
67
|
variant: "solid",
|
|
70
68
|
size: "sm",
|
|
71
69
|
square: true,
|
|
72
70
|
type: "submit",
|
|
73
|
-
"aria-label":
|
|
71
|
+
"aria-label": messages.ai.send,
|
|
74
72
|
disabled: disabled || !value.trim(),
|
|
75
|
-
children:
|
|
73
|
+
children: arrowUpIcon
|
|
76
74
|
});
|
|
77
75
|
const hasFooter = footer != null && (!Array.isArray(footer) || footer.length > 0);
|
|
78
76
|
return /* @__PURE__ */ jsxs("form", {
|
|
@@ -95,7 +93,8 @@ function PromptInput({ value, onValueChange, onSubmit, onStop, placeholder = "Se
|
|
|
95
93
|
autoresize: true,
|
|
96
94
|
rows: 1,
|
|
97
95
|
value,
|
|
98
|
-
placeholder,
|
|
96
|
+
placeholder: placeholderText,
|
|
97
|
+
"aria-label": ariaLabel ?? messages.ai.conversation,
|
|
99
98
|
disabled,
|
|
100
99
|
onChange: (event) => {
|
|
101
100
|
onValueChange?.(event.target.value);
|
|
@@ -131,5 +130,6 @@ function PromptInput({ value, onValueChange, onSubmit, onStop, placeholder = "Se
|
|
|
131
130
|
]
|
|
132
131
|
});
|
|
133
132
|
}
|
|
133
|
+
const PromptInput = withSelfRoot(PromptInputImpl);
|
|
134
134
|
//#endregion
|
|
135
135
|
export { PromptInput as AiPromptInput, PromptInput };
|
|
@@ -8,6 +8,9 @@ export interface ReasoningProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
8
8
|
defaultOpen?: boolean;
|
|
9
9
|
children?: ReactNode;
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
declare function ReasoningImpl({ label, children, ...rest }: ReasoningProps): import("react").JSX.Element;
|
|
12
|
+
export declare const Reasoning: typeof ReasoningImpl & {
|
|
13
|
+
Root: typeof ReasoningImpl;
|
|
14
|
+
};
|
|
12
15
|
//#endregion
|
|
13
16
|
export { Reasoning as AiReasoning };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { t as
|
|
1
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
2
|
+
import { t as chevron } from "../../chevron-a2nIZKN4.mjs";
|
|
2
3
|
import { Collapsible } from "../collapsible/index.mjs";
|
|
3
4
|
import { injectComponentStyle } from "@bysages/core";
|
|
4
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
//#region src/components/ai-reasoning/index.tsx
|
|
6
|
-
function
|
|
7
|
+
function ReasoningImpl({ label = "Thinking", children, ...rest }) {
|
|
7
8
|
injectComponentStyle("ai");
|
|
8
9
|
return /* @__PURE__ */ jsxs(Collapsible.Root, {
|
|
9
10
|
...rest,
|
|
@@ -15,5 +16,6 @@ function Reasoning({ label = "Thinking", children, ...rest }) {
|
|
|
15
16
|
}) })]
|
|
16
17
|
});
|
|
17
18
|
}
|
|
19
|
+
const Reasoning = withSelfRoot(ReasoningImpl);
|
|
18
20
|
//#endregion
|
|
19
21
|
export { Reasoning as AiReasoning, Reasoning };
|
|
@@ -12,11 +12,16 @@ export interface ResponseProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
12
12
|
/** Optional code-highlighting function re-inking fenced blocks; the
|
|
13
13
|
* component stays agnostic about which engine provides it. */
|
|
14
14
|
highlighter?: (code: string, lang?: string) => string;
|
|
15
|
-
/** The copy stamp's accessible name before the copy lands
|
|
15
|
+
/** The copy stamp's accessible name before the copy lands; leave
|
|
16
|
+
* unset for the resolved default. */
|
|
16
17
|
copyLabel?: string;
|
|
17
|
-
/** The copy stamp's accessible name once the text has landed
|
|
18
|
+
/** The copy stamp's accessible name once the text has landed; leave
|
|
19
|
+
* unset for the resolved default. */
|
|
18
20
|
copiedLabel?: string;
|
|
19
21
|
}
|
|
20
|
-
|
|
22
|
+
declare function ResponseImpl({ content, highlighter, copyLabel, copiedLabel, ...rest }: ResponseProps): import("react").JSX.Element;
|
|
23
|
+
export declare const Response: typeof ResponseImpl & {
|
|
24
|
+
Root: typeof ResponseImpl;
|
|
25
|
+
};
|
|
21
26
|
//#endregion
|
|
22
27
|
export { Response as AiResponse };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as Response } from "../../ai-response-
|
|
1
|
+
import { t as Response } from "../../ai-response-B4DX7nmJ.mjs";
|
|
2
2
|
export { Response as AiResponse, Response };
|
|
@@ -7,11 +7,17 @@ export interface SourceProps extends HTMLAttributes<HTMLAnchorElement> {
|
|
|
7
7
|
href: string;
|
|
8
8
|
children?: ReactNode;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
declare function SourceImpl({ href, children, ...rest }: SourceProps): import("react").JSX.Element;
|
|
11
|
+
export declare const Source: typeof SourceImpl & {
|
|
12
|
+
Root: typeof SourceImpl;
|
|
13
|
+
};
|
|
11
14
|
/** The reading list under a response: where this ink came from. */
|
|
12
15
|
export interface SourcesProps extends HTMLAttributes<HTMLOListElement> {
|
|
13
16
|
children?: ReactNode;
|
|
14
17
|
}
|
|
15
|
-
|
|
18
|
+
declare function SourcesImpl({ children, ...rest }: SourcesProps): import("react").JSX.Element;
|
|
19
|
+
export declare const Sources: typeof SourcesImpl & {
|
|
20
|
+
Root: typeof SourcesImpl;
|
|
21
|
+
};
|
|
16
22
|
//#endregion
|
|
17
23
|
export { Source as AiSource, Sources as AiSources };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
1
2
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
//#region src/components/ai-source/index.tsx
|
|
4
|
-
function
|
|
5
|
+
function SourceImpl({ href, children, ...rest }) {
|
|
5
6
|
injectComponentStyle("ai");
|
|
6
7
|
return /* @__PURE__ */ jsx("li", {
|
|
7
8
|
"data-scope": "ai",
|
|
@@ -15,7 +16,8 @@ function Source({ href, children, ...rest }) {
|
|
|
15
16
|
})
|
|
16
17
|
});
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
+
const Source = withSelfRoot(SourceImpl);
|
|
20
|
+
function SourcesImpl({ children, ...rest }) {
|
|
19
21
|
return /* @__PURE__ */ jsx("ol", {
|
|
20
22
|
...rest,
|
|
21
23
|
"data-scope": "ai",
|
|
@@ -23,5 +25,6 @@ function Sources({ children, ...rest }) {
|
|
|
23
25
|
children
|
|
24
26
|
});
|
|
25
27
|
}
|
|
28
|
+
const Sources = withSelfRoot(SourcesImpl);
|
|
26
29
|
//#endregion
|
|
27
30
|
export { Source as AiSource, Source, Sources as AiSources, Sources };
|
|
@@ -8,6 +8,9 @@ export interface SuggestionProps extends Omit<HTMLAttributes<HTMLButtonElement>,
|
|
|
8
8
|
prompt: string;
|
|
9
9
|
onSelect?: (prompt: string) => void;
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
declare function SuggestionImpl({ prompt, onSelect, ...rest }: SuggestionProps): import("react").JSX.Element;
|
|
12
|
+
export declare const Suggestion: typeof SuggestionImpl & {
|
|
13
|
+
Root: typeof SuggestionImpl;
|
|
14
|
+
};
|
|
12
15
|
//#endregion
|
|
13
16
|
export { Suggestion as AiSuggestion };
|