@dust-tt/sparkle 0.2.20 → 0.2.22
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/BarHeader.d.ts +1 -0
- package/dist/cjs/components/Checkbox.d.ts +1 -2
- package/dist/cjs/components/Modal.d.ts +4 -2
- package/dist/cjs/components/Tree.d.ts +6 -2
- package/dist/cjs/index.js +11 -7
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/BarHeader.d.ts +1 -0
- package/dist/esm/components/Checkbox.d.ts +1 -2
- package/dist/esm/components/Modal.d.ts +4 -2
- package/dist/esm/components/Tree.d.ts +6 -2
- package/dist/esm/index.js +11 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
interface CheckboxProps {
|
|
2
|
+
export interface CheckboxProps {
|
|
3
3
|
variant?: "selectable" | "checkable";
|
|
4
4
|
checked: boolean;
|
|
5
5
|
disabled?: boolean;
|
|
@@ -8,4 +8,3 @@ interface CheckboxProps {
|
|
|
8
8
|
className?: string;
|
|
9
9
|
}
|
|
10
10
|
export declare function Checkbox({ variant, checked, onChange, className, disabled, partialChecked, }: CheckboxProps): React.JSX.Element;
|
|
11
|
-
export {};
|
|
@@ -7,9 +7,11 @@ interface ModalProps {
|
|
|
7
7
|
children: React.ReactNode;
|
|
8
8
|
hasChanged: boolean;
|
|
9
9
|
onSave?: () => void;
|
|
10
|
+
saveLabel?: string;
|
|
11
|
+
isSaving?: boolean;
|
|
12
|
+
savingLabel?: string;
|
|
10
13
|
title?: string;
|
|
11
14
|
type?: "full-screen" | "right-side" | "default";
|
|
12
|
-
saveLabel?: string;
|
|
13
15
|
}
|
|
14
|
-
export declare function Modal({ isOpen, onClose, action, children, hasChanged, onSave, title, type,
|
|
16
|
+
export declare function Modal({ isOpen, onClose, action, children, hasChanged, onSave, saveLabel, isSaving, savingLabel, title, type, }: ModalProps): React.JSX.Element;
|
|
15
17
|
export {};
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { CheckboxProps } from "./Checkbox";
|
|
2
3
|
export interface TreeProps {
|
|
3
4
|
children?: React.ReactNode;
|
|
4
5
|
isLoading?: boolean;
|
|
5
6
|
}
|
|
6
7
|
export declare function Tree({ children, isLoading }: TreeProps): React.JSX.Element;
|
|
7
8
|
export declare namespace Tree {
|
|
8
|
-
var Item: ({ label, type, className, variant, children, }: TreeItemProps) => React.JSX.Element;
|
|
9
|
+
var Item: ({ label, type, className, variant, checkbox, onChevronClick, collapsed, children, }: TreeItemProps) => React.JSX.Element;
|
|
9
10
|
}
|
|
10
11
|
export interface TreeItemProps {
|
|
11
12
|
label?: string;
|
|
12
|
-
type?: "node" | "item";
|
|
13
|
+
type?: "node" | "item" | "leaf";
|
|
13
14
|
variant?: "file" | "folder" | "database" | "channel";
|
|
15
|
+
checkbox?: CheckboxProps;
|
|
16
|
+
onChevronClick?: () => void;
|
|
17
|
+
collapsed?: boolean;
|
|
14
18
|
className?: string;
|
|
15
19
|
children?: React.ReactNode;
|
|
16
20
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -32704,7 +32704,9 @@ BarHeader.ButtonBar = function (props) {
|
|
|
32704
32704
|
case "validate":
|
|
32705
32705
|
return (React.createElement(React.Fragment, null,
|
|
32706
32706
|
React.createElement(Button, { size: "sm", label: "Cancel", variant: "secondaryWarning", onClick: props.onCancel, disabled: !props.onCancel || props.isSaving }),
|
|
32707
|
-
React.createElement(Button, { size: "sm", label: props.isSaving
|
|
32707
|
+
React.createElement(Button, { size: "sm", label: props.isSaving
|
|
32708
|
+
? props.savingLabel || "Processing..."
|
|
32709
|
+
: props.saveLabel || "Save", variant: "primary", onClick: props.onSave, disabled: !props.onSave || props.isSaving })));
|
|
32708
32710
|
case "conversation":
|
|
32709
32711
|
return (React.createElement(React.Fragment, null,
|
|
32710
32712
|
React.createElement(Button, { size: "sm", label: "Delete", icon: SvgTrash$1, variant: "secondaryWarning", labelVisible: false, tooltipPosition: "below", onClick: props.onDelete }),
|
|
@@ -32911,16 +32913,16 @@ var visualTable = {
|
|
|
32911
32913
|
channel: SvgChatBubbleBottomCenterText,
|
|
32912
32914
|
};
|
|
32913
32915
|
Tree.Item = function (_a) {
|
|
32914
|
-
var label = _a.label, _b = _a.type, type = _b === void 0 ? "node" : _b, _c = _a.className, className = _c === void 0 ? "" : _c, _d = _a.variant, variant = _d === void 0 ? "file" : _d, children = _a.children;
|
|
32916
|
+
var label = _a.label, _b = _a.type, type = _b === void 0 ? "node" : _b, _c = _a.className, className = _c === void 0 ? "" : _c, _d = _a.variant, variant = _d === void 0 ? "file" : _d, checkbox = _a.checkbox, onChevronClick = _a.onChevronClick, collapsed = _a.collapsed, children = _a.children;
|
|
32915
32917
|
return (React.createElement(React.Fragment, null,
|
|
32916
32918
|
React.createElement("div", { className: classNames(className ? className : "", "s-flex s-flex-row s-items-center s-gap-4 s-py-1") },
|
|
32917
|
-
type === "node" && (React.createElement(IconButton, { icon: children ? SvgChevronDown : SvgChevronRight, size: "sm", variant: "secondary" })),
|
|
32918
|
-
React.createElement(
|
|
32919
|
+
type === "node" && (React.createElement(IconButton, { icon: children && !collapsed ? SvgChevronDown : SvgChevronRight, size: "sm", variant: "secondary", onClick: onChevronClick })),
|
|
32920
|
+
type === "leaf" && React.createElement("div", { className: "s-w-5" }),
|
|
32921
|
+
checkbox && React.createElement(Checkbox, __assign({}, checkbox)),
|
|
32919
32922
|
React.createElement("div", { className: "s-flex s-items-center s-gap-1.5 s-text-sm s-font-medium s-text-element-900" },
|
|
32920
32923
|
React.createElement(Icon, { visual: visualTable[variant], size: "sm", className: "s-text-element-700" }),
|
|
32921
32924
|
label)),
|
|
32922
|
-
React.Children.count(children) > 0 && (React.createElement("div", { className: "s-flex s-pl-5" },
|
|
32923
|
-
React.createElement(Tree, null, children)))));
|
|
32925
|
+
React.Children.count(children) > 0 && (React.createElement("div", { className: "s-flex s-pl-5" }, !collapsed && children))));
|
|
32924
32926
|
};
|
|
32925
32927
|
|
|
32926
32928
|
var baseClasses = "s-transition-all s-ease-out s-duration-300 s-cursor-pointer hover:s-scale-110";
|
|
@@ -32975,13 +32977,15 @@ function IconToggleButton(_a) {
|
|
|
32975
32977
|
}
|
|
32976
32978
|
|
|
32977
32979
|
function Modal(_a) {
|
|
32978
|
-
var isOpen = _a.isOpen, onClose = _a.onClose, action = _a.action, children = _a.children, hasChanged = _a.hasChanged, onSave = _a.onSave,
|
|
32980
|
+
var isOpen = _a.isOpen, onClose = _a.onClose, action = _a.action, children = _a.children, hasChanged = _a.hasChanged, onSave = _a.onSave, _b = _a.saveLabel, saveLabel = _b === void 0 ? "Save" : _b, isSaving = _a.isSaving, savingLabel = _a.savingLabel, title = _a.title, _c = _a.type, type = _c === void 0 ? "default" : _c;
|
|
32979
32981
|
var buttonBarProps = hasChanged
|
|
32980
32982
|
? {
|
|
32981
32983
|
variant: "validate",
|
|
32982
32984
|
onCancel: onClose,
|
|
32983
32985
|
onSave: onSave,
|
|
32984
32986
|
saveLabel: saveLabel,
|
|
32987
|
+
isSaving: isSaving,
|
|
32988
|
+
savingLabel: savingLabel,
|
|
32985
32989
|
}
|
|
32986
32990
|
: {
|
|
32987
32991
|
variant: "close",
|