@dust-tt/sparkle 0.2.173 → 0.2.174
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.
|
@@ -14,8 +14,9 @@ type ItemProps = {
|
|
|
14
14
|
hasAction?: boolean | "hover";
|
|
15
15
|
className?: string;
|
|
16
16
|
href?: string;
|
|
17
|
+
target?: string;
|
|
17
18
|
};
|
|
18
|
-
export declare function Item({ label, description, visual, icon, style, spacing, action, hasAction, onClick, selected, disabled, className, href, }: ItemProps): React.JSX.Element;
|
|
19
|
+
export declare function Item({ label, description, visual, icon, style, spacing, action, hasAction, onClick, selected, disabled, className, href, target }: ItemProps): React.JSX.Element;
|
|
19
20
|
export declare namespace Item {
|
|
20
21
|
var Entry: (props: EntryItemProps) => React.JSX.Element;
|
|
21
22
|
var Avatar: ({ description, hasAction, ...otherProps }: AvatarItemProps) => React.JSX.Element;
|
package/dist/esm/index.js
CHANGED
|
@@ -77551,7 +77551,7 @@ var iconClasses$4 = {
|
|
|
77551
77551
|
warning: "s-text-warning-400 group-hover:s-text-warning-300 group-active:s-text-warning-700 dark:group-hover:s-text-warning-600-dark dark:group-active:s-text-warning-400-dark",
|
|
77552
77552
|
};
|
|
77553
77553
|
function Item(_a) {
|
|
77554
|
-
var label = _a.label, description = _a.description, visual = _a.visual, icon = _a.icon, _b = _a.style, style = _b === void 0 ? "action" : _b, _c = _a.spacing, spacing = _c === void 0 ? "sm" : _c, _d = _a.action, action = _d === void 0 ? SvgChevronRight$1 : _d, _e = _a.hasAction, hasAction = _e === void 0 ? true : _e, onClick = _a.onClick, _f = _a.selected, selected = _f === void 0 ? false : _f, _g = _a.disabled, disabled = _g === void 0 ? false : _g, _h = _a.className, className = _h === void 0 ? "" : _h, href = _a.href;
|
|
77554
|
+
var label = _a.label, description = _a.description, visual = _a.visual, icon = _a.icon, _b = _a.style, style = _b === void 0 ? "action" : _b, _c = _a.spacing, spacing = _c === void 0 ? "sm" : _c, _d = _a.action, action = _d === void 0 ? SvgChevronRight$1 : _d, _e = _a.hasAction, hasAction = _e === void 0 ? true : _e, onClick = _a.onClick, _f = _a.selected, selected = _f === void 0 ? false : _f, _g = _a.disabled, disabled = _g === void 0 ? false : _g, _h = _a.className, className = _h === void 0 ? "" : _h, href = _a.href, target = _a.target;
|
|
77555
77555
|
var components = React__default.useContext(SparkleContext).components;
|
|
77556
77556
|
var Link = href ? components.link : noHrefLink;
|
|
77557
77557
|
var visualElement;
|
|
@@ -77565,7 +77565,8 @@ function Item(_a) {
|
|
|
77565
77565
|
? "s-text-action-400 dark:s-text-action-600-dark"
|
|
77566
77566
|
: iconClasses$4[style]) }));
|
|
77567
77567
|
}
|
|
77568
|
-
|
|
77568
|
+
var targetProps = target ? { target: target } : {};
|
|
77569
|
+
return (React__default.createElement(Link, __assign({ className: classNames("s-duration-400 s-group s-box-border s-flex s-select-none s-text-sm s-transition-colors s-ease-out", spacingClasses[spacing], disabled ? "" : "s-cursor-pointer", className), onClick: selected || disabled ? undefined : onClick, "aria-label": label, href: href || "#" }, targetProps),
|
|
77569
77570
|
visualElement,
|
|
77570
77571
|
React__default.createElement("div", { className: classNames("s-flex s-grow s-flex-col s-gap-0 s-overflow-hidden") },
|
|
77571
77572
|
React__default.createElement("div", { className: classNames("s-transition-colors s-duration-200 s-ease-out", "s-grow s-truncate s-text-sm", labelStyleClasses[style], disabled
|
|
@@ -106262,13 +106263,14 @@ function RadioButton(_a) {
|
|
|
106262
106263
|
function Popup(_a) {
|
|
106263
106264
|
var show = _a.show, chipLabel = _a.chipLabel, description = _a.description, buttonLabel = _a.buttonLabel, buttonClick = _a.buttonClick, className = _a.className, onClose = _a.onClose;
|
|
106264
106265
|
return (React__default.createElement(Xe$1, { show: show, enter: "s-transition-opacity s-duration-300", appear: true, enterFrom: "s-opacity-0", enterTo: "s-opacity-100", leave: "s-transition-opacity s-duration-300", leaveFrom: "s-opacity-100", leaveTo: "s-opacity-0", className: classNames("s-z-30 s-flex s-w-64 s-flex-col s-gap-3 s-rounded-xl s-border s-border-pink-100 s-bg-pink-50 s-p-4 s-shadow-xl", className || "") },
|
|
106265
|
-
React__default.createElement("div",
|
|
106266
|
-
React__default.createElement(
|
|
106267
|
-
|
|
106268
|
-
React__default.createElement(
|
|
106269
|
-
|
|
106270
|
-
|
|
106271
|
-
React__default.createElement(
|
|
106266
|
+
React__default.createElement("div", null,
|
|
106267
|
+
React__default.createElement("div", { className: "s-flex" },
|
|
106268
|
+
React__default.createElement(Chip, { color: "pink" }, chipLabel),
|
|
106269
|
+
onClose && (React__default.createElement("div", { className: "-s-mr-1 -s-mt-1 s-flex s-grow s-items-start s-justify-end" },
|
|
106270
|
+
React__default.createElement(IconButton, { icon: SvgXMark$1, onClick: onClose, variant: "secondary", size: "sm" })))),
|
|
106271
|
+
React__default.createElement("div", { className: "s-text-sm s-font-normal s-text-element-900" }, description),
|
|
106272
|
+
React__default.createElement("div", { className: "s-self-center" },
|
|
106273
|
+
React__default.createElement(Button, { variant: "primary", size: "sm", label: buttonLabel, onClick: buttonClick })))));
|
|
106272
106274
|
}
|
|
106273
106275
|
|
|
106274
106276
|
function TemplateItem(_a) {
|