@dust-tt/sparkle 0.2.64 → 0.2.65
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/cjs/components/AssistantPreview.d.ts +15 -7
- package/dist/cjs/index.js +18 -23
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/AssistantPreview.d.ts +15 -7
- package/dist/esm/index.js +18 -23
- package/dist/esm/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
type AssistantPreviewVariant = "sm" | "md" | "lg" | "list";
|
|
3
|
-
interface
|
|
4
|
-
allowAddAction?: boolean;
|
|
5
|
-
allowRemoveAction?: boolean;
|
|
3
|
+
interface BaseAssistantPreviewProps {
|
|
6
4
|
description: string;
|
|
7
|
-
isAdded: boolean;
|
|
8
|
-
isUpdatingList: boolean;
|
|
9
|
-
isWorkspace: boolean;
|
|
10
5
|
name: string;
|
|
11
6
|
pictureUrl: string;
|
|
12
7
|
subtitle: string;
|
|
13
8
|
variant: AssistantPreviewVariant;
|
|
9
|
+
}
|
|
10
|
+
type LargeVariantAssistantPreviewProps = BaseAssistantPreviewProps & {
|
|
11
|
+
variant: "lg";
|
|
12
|
+
allowAddAction?: boolean;
|
|
13
|
+
allowRemoveAction?: boolean;
|
|
14
|
+
isAdded: boolean;
|
|
15
|
+
isUpdatingList: boolean;
|
|
16
|
+
isWorkspace: boolean;
|
|
14
17
|
onShowDetailsClick?: () => void;
|
|
15
18
|
onTestClick?: () => void;
|
|
16
19
|
onUpdate: (action: "added" | "removed") => Promise<void> | void;
|
|
17
|
-
}
|
|
20
|
+
};
|
|
21
|
+
type SmallVariantAssistantPreviewProps = BaseAssistantPreviewProps & {
|
|
22
|
+
variant: "sm";
|
|
23
|
+
onClick: () => void;
|
|
24
|
+
};
|
|
25
|
+
type AssistantPreviewProps = SmallVariantAssistantPreviewProps | LargeVariantAssistantPreviewProps;
|
|
18
26
|
export declare function AssistantPreview(props: AssistantPreviewProps): React.JSX.Element;
|
|
19
27
|
export declare namespace AssistantPreview {
|
|
20
28
|
var defaultProps: {
|
package/dist/esm/index.js
CHANGED
|
@@ -32220,27 +32220,27 @@ AssistantPreview.defaultProps = {
|
|
|
32220
32220
|
allowAddAction: false,
|
|
32221
32221
|
allowRemoveAction: false,
|
|
32222
32222
|
};
|
|
32223
|
-
function renderVariantContent(
|
|
32224
|
-
switch (variant) {
|
|
32223
|
+
function renderVariantContent(props) {
|
|
32224
|
+
switch (props.variant) {
|
|
32225
32225
|
case "sm":
|
|
32226
|
-
return React__default.createElement(SmallVariantContent,
|
|
32227
|
-
case "md":
|
|
32228
|
-
return React__default.createElement(MediumVariantContent, null);
|
|
32226
|
+
return React__default.createElement(SmallVariantContent, __assign({}, props));
|
|
32229
32227
|
case "lg":
|
|
32230
|
-
return React__default.createElement(LargeVariantContent, { props
|
|
32231
|
-
case "list":
|
|
32232
|
-
return React__default.createElement(ListVariantContent, null);
|
|
32228
|
+
return React__default.createElement(LargeVariantContent, __assign({}, props));
|
|
32233
32229
|
default:
|
|
32234
32230
|
return React__default.createElement(React__default.Fragment, null);
|
|
32235
32231
|
}
|
|
32236
32232
|
}
|
|
32237
|
-
|
|
32238
|
-
var
|
|
32239
|
-
|
|
32240
|
-
}
|
|
32241
|
-
|
|
32242
|
-
|
|
32243
|
-
|
|
32233
|
+
var SmallVariantContent = function (props) {
|
|
32234
|
+
var description = props.description, name = props.name, onClick = props.onClick, pictureUrl = props.pictureUrl;
|
|
32235
|
+
return (React__default.createElement("div", { className: "s-flex s-flex-col s-py-2" },
|
|
32236
|
+
React__default.createElement("div", { className: "s-flex s-flex-row s-gap-2" },
|
|
32237
|
+
React__default.createElement(Avatar, { visual: React__default.createElement("img", { src: pictureUrl, alt: "Avatar of ".concat(name) }), size: "md" }),
|
|
32238
|
+
React__default.createElement("div", { className: "s-flex s-flex-col s-gap-2" },
|
|
32239
|
+
React__default.createElement("div", { className: "s-text-sm s-font-medium s-text-element-900" },
|
|
32240
|
+
"@",
|
|
32241
|
+
name),
|
|
32242
|
+
React__default.createElement(Button, { key: "start", variant: "tertiary", icon: SvgChatBubbleBottomCenterText$1, size: "xs", label: "Start", onClick: onClick }))),
|
|
32243
|
+
React__default.createElement("div", { className: "s-py-1.5 s-text-sm s-font-normal s-text-element-700" }, description)));
|
|
32244
32244
|
};
|
|
32245
32245
|
var GalleryChip = function (_a) {
|
|
32246
32246
|
var allowAddAction = _a.allowAddAction, allowRemoveAction = _a.allowRemoveAction, isAdded = _a.isAdded, isUpdatingList = _a.isUpdatingList, onUpdate = _a.onUpdate;
|
|
@@ -32259,8 +32259,7 @@ var ButtonsGroup = function (_a) {
|
|
|
32259
32259
|
onTestClick && (React__default.createElement(Button, { key: "test", variant: "tertiary", icon: SvgPlay$1, size: "xs", label: "Test", onClick: onTestClick })),
|
|
32260
32260
|
onShowDetailsClick && (React__default.createElement(Button, { key: "show_details", icon: SvgMore$1, label: "View Assistant", labelVisible: false, size: "xs", variant: "tertiary", onClick: onShowDetailsClick }))));
|
|
32261
32261
|
};
|
|
32262
|
-
var LargeVariantContent = function (
|
|
32263
|
-
var props = _a.props;
|
|
32262
|
+
var LargeVariantContent = function (props) {
|
|
32264
32263
|
var allowAddAction = props.allowAddAction, allowRemoveAction = props.allowRemoveAction, description = props.description, isAdded = props.isAdded, isUpdatingList = props.isUpdatingList, isWorkspace = props.isWorkspace, name = props.name, onShowDetailsClick = props.onShowDetailsClick, onTestClick = props.onTestClick, onUpdate = props.onUpdate, pictureUrl = props.pictureUrl, subtitle = props.subtitle;
|
|
32265
32264
|
return (React__default.createElement("div", { className: "s-flex s-flex-row s-gap-2 s-py-2" },
|
|
32266
32265
|
React__default.createElement(Avatar, { visual: React__default.createElement("img", { src: pictureUrl, alt: "Avatar of ".concat(name) }), size: "md" }),
|
|
@@ -32275,12 +32274,8 @@ var LargeVariantContent = function (_a) {
|
|
|
32275
32274
|
React__default.createElement(ButtonsGroup, { allowAddAction: allowAddAction, isAdded: isAdded, isUpdatingList: isUpdatingList, isWorkspace: isWorkspace, onShowDetailsClick: onShowDetailsClick, onTestClick: onTestClick, onUpdate: onUpdate })),
|
|
32276
32275
|
React__default.createElement("div", { className: "s-text-sm s-font-normal s-text-element-800" }, description))));
|
|
32277
32276
|
};
|
|
32278
|
-
// TODO:
|
|
32279
|
-
var ListVariantContent = function () {
|
|
32280
|
-
throw new Error("Not yet implemented!");
|
|
32281
|
-
};
|
|
32282
32277
|
function AssistantPreview(props) {
|
|
32283
|
-
var VariantContent = renderVariantContent(props
|
|
32278
|
+
var VariantContent = renderVariantContent(props);
|
|
32284
32279
|
return React__default.createElement("div", null, VariantContent);
|
|
32285
32280
|
}
|
|
32286
32281
|
|
|
@@ -33433,7 +33428,7 @@ var sizeInputClasses = {
|
|
|
33433
33428
|
};
|
|
33434
33429
|
function Input(_a) {
|
|
33435
33430
|
var placeholder = _a.placeholder, value = _a.value, _b = _a.size, size = _b === void 0 ? "sm" : _b, onChange = _a.onChange, error = _a.error, _c = _a.showErrorLabel, showErrorLabel = _c === void 0 ? false : _c, name = _a.name, _d = _a.isPassword, isPassword = _d === void 0 ? false : _d, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.className, className = _f === void 0 ? "" : _f;
|
|
33436
|
-
return (React__default.createElement("div", { className: "s-
|
|
33431
|
+
return (React__default.createElement("div", { className: "s-flex s-flex-col s-gap-1 s-p-px" },
|
|
33437
33432
|
React__default.createElement("input", { type: isPassword ? "password" : "text", name: name, id: name, className: classNames("s-w-full s-border-0 s-outline-none s-ring-1 focus:s-outline-none focus:s-ring-2", "s-bg-structure-50 s-text-element-900 s-placeholder-element-600", "dark:s-bg-structure-50-dark dark:s-text-element-800-dark dark:s-placeholder-element-600-dark", sizeInputClasses[size], "s-transition-all s-duration-300 s-ease-out", className !== null && className !== void 0 ? className : "", !error
|
|
33438
33433
|
? classNames("s-ring-structure-200 focus:s-ring-action-300", "dark:s-ring-structure-300-dark dark:focus:s-ring-action-300-dark")
|
|
33439
33434
|
: classNames("s-ring-warning-200 focus:s-ring-warning-300", "dark:s-ring-warning-200-dark dark:focus:s-ring-warning-300-dark")), placeholder: placeholder, value: value !== null && value !== void 0 ? value : "", onChange: function (e) {
|