@dust-tt/sparkle 0.2.285 → 0.2.287-rc-1
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/index.js +28 -16
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/Input.d.ts +6 -2
- package/dist/esm/components/Input.d.ts.map +1 -1
- package/dist/esm/components/Input.js +22 -4
- package/dist/esm/components/Input.js.map +1 -1
- package/dist/esm/components/NavigationList.d.ts +1 -1
- package/dist/esm/components/NavigationList.d.ts.map +1 -1
- package/dist/esm/components/NavigationList.js +6 -10
- package/dist/esm/components/NavigationList.js.map +1 -1
- package/dist/esm/stories/Input.stories.d.ts.map +1 -1
- package/dist/esm/stories/Input.stories.js +11 -11
- package/dist/esm/stories/Input.stories.js.map +1 -1
- package/dist/esm/stories/NavigationList.stories.d.ts.map +1 -1
- package/dist/esm/stories/NavigationList.stories.js +9 -6
- package/dist/esm/stories/NavigationList.stories.js.map +1 -1
- package/dist/sparkle.css +0 -5
- package/package.json +1 -1
- package/src/components/Input.tsx +41 -9
- package/src/components/NavigationList.tsx +6 -21
- package/src/stories/Input.stories.tsx +23 -21
- package/src/stories/NavigationList.stories.tsx +31 -4
package/dist/cjs/index.js
CHANGED
|
@@ -460,9 +460,9 @@ var SvgImage$1 = function (props) { return (React__namespace.createElement("svg"
|
|
|
460
460
|
React__namespace.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M2 21V3h20v18H2Zm18-6V5H4v14L14 9l6 6Z", clipRule: "evenodd" }))); };
|
|
461
461
|
var SvgImage$2 = SvgImage$1;
|
|
462
462
|
|
|
463
|
-
var SvgInformationCircle$
|
|
463
|
+
var SvgInformationCircle$1 = function (props) { return (React__namespace.createElement("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24" }, props),
|
|
464
464
|
React__namespace.createElement("path", { fill: "currentColor", d: "M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10Zm-1-11v6h2v-6h-2Zm0-4v2h2V7h-2Z" }))); };
|
|
465
|
-
var InformationCircleIcon = SvgInformationCircle$
|
|
465
|
+
var InformationCircleIcon = SvgInformationCircle$1;
|
|
466
466
|
|
|
467
467
|
var SvgKey$2 = function (props) { return (React__namespace.createElement("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24" }, props),
|
|
468
468
|
React__namespace.createElement("path", { fill: "currentColor", d: "m10.313 11.566 7.94-7.94 2.121 2.12-1.414 1.415 2.121 2.121-3.535 3.536-2.121-2.121-2.99 2.99a5.002 5.002 0 0 1-7.97 5.848 5 5 0 0 1 5.848-7.97Zm-.899 5.848a2 2 0 1 0-2.828-2.828 2 2 0 0 0 2.828 2.828Z" }))); };
|
|
@@ -43484,7 +43484,7 @@ var ImageStrokeIcon = SvgImage;
|
|
|
43484
43484
|
|
|
43485
43485
|
var SvgInformationCircle = function (props) { return (React__namespace.createElement("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24" }, props),
|
|
43486
43486
|
React__namespace.createElement("path", { fill: "currentColor", d: "M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10Zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM11 7h2v2h-2V7Zm0 4h2v6h-2v-6Z" }))); };
|
|
43487
|
-
var
|
|
43487
|
+
var InformationCircleStrokeIcon = SvgInformationCircle;
|
|
43488
43488
|
|
|
43489
43489
|
var SvgKey = function (props) { return (React__namespace.createElement("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24" }, props),
|
|
43490
43490
|
React__namespace.createElement("path", { fill: "currentColor", d: "m10.758 11.828 7.849-7.849 1.414 1.414-1.414 1.414 2.474 2.475-1.414 1.415-2.475-2.475-1.414 1.414 2.121 2.121-1.414 1.414-2.121-2.12-2.192 2.191a5.002 5.002 0 0 1-7.708 6.293 5 5 0 0 1 6.294-7.707Zm-.637 6.293A3 3 0 1 0 5.88 13.88a3 3 0 0 0 4.242 4.242Z" }))); };
|
|
@@ -85122,11 +85122,24 @@ function IconToggleButton(_a) {
|
|
|
85122
85122
|
return tooltip ? (React.createElement(Tooltip, { trigger: IconButtonToggleContent, label: tooltip, side: tooltipPosition })) : (IconButtonToggleContent);
|
|
85123
85123
|
}
|
|
85124
85124
|
|
|
85125
|
+
var messageVariantStyles = {
|
|
85126
|
+
info: "s-text-muted-foreground",
|
|
85127
|
+
default: "s-text-muted-foreground",
|
|
85128
|
+
error: "s-text-foreground-warning",
|
|
85129
|
+
};
|
|
85125
85130
|
var stateVariantStyles = {
|
|
85126
85131
|
default: "focus-visible:s-ring-ring",
|
|
85127
85132
|
disabled: "disabled:s-cursor-not-allowed disabled:s-opacity-50 disabled:s-text-muted-foreground",
|
|
85128
85133
|
error: "s-border-border-warning focus:s-ring-ring-warning",
|
|
85129
85134
|
};
|
|
85135
|
+
var messageVariant = cva("", {
|
|
85136
|
+
variants: {
|
|
85137
|
+
status: messageVariantStyles,
|
|
85138
|
+
},
|
|
85139
|
+
defaultVariants: {
|
|
85140
|
+
status: "info",
|
|
85141
|
+
},
|
|
85142
|
+
});
|
|
85130
85143
|
var inputStyleClasses = cva(cn("s-text-sm s-bg-background s-rounded-xl s-border s-border-border-dark s-flex s-h-9 s-w-full s-px-3 s-py-1.5 ", "file:s-border-0 file:s-bg-transparent file:s-text-sm file:s-font-medium file:s-text-foreground", "placeholder:s-text-muted-foreground", "focus-visible:s-outline-none focus-visible:s-ring-2 focus-visible:s-ring-offset-2 focus-visible:s-border-border-dark"), {
|
|
85131
85144
|
variants: {
|
|
85132
85145
|
state: stateVariantStyles,
|
|
@@ -85136,12 +85149,14 @@ var inputStyleClasses = cva(cn("s-text-sm s-bg-background s-rounded-xl s-border
|
|
|
85136
85149
|
},
|
|
85137
85150
|
});
|
|
85138
85151
|
var Input = React.forwardRef(function (_a, ref) {
|
|
85139
|
-
var className = _a.className,
|
|
85140
|
-
var state =
|
|
85141
|
-
return (React.createElement("div", { className: "s-flex s-flex-col s-gap-1
|
|
85152
|
+
var className = _a.className, message = _a.message, messageStatus = _a.messageStatus, value = _a.value, label = _a.label, isError = _a.isError, disabled = _a.disabled, props = __rest(_a, ["className", "message", "messageStatus", "value", "label", "isError", "disabled"]);
|
|
85153
|
+
var state = isError ? "error" : disabled ? "disabled" : "default";
|
|
85154
|
+
return (React.createElement("div", { className: "s-flex s-flex-col s-gap-1" },
|
|
85142
85155
|
label && React.createElement(Label$1, { htmlFor: props.name }, label),
|
|
85143
85156
|
React.createElement("input", __assign({ ref: ref, className: cn(inputStyleClasses({ state: state }), className), "data-1p-ignore": props.type !== "password", value: value !== null && value !== void 0 ? value : undefined, disabled: disabled }, props)),
|
|
85144
|
-
|
|
85157
|
+
message && (React.createElement("div", { className: cn("s-ml-3.5 s-flex s-items-center s-gap-1 s-text-xs", messageVariant({ status: messageStatus })) },
|
|
85158
|
+
messageStatus === "info" && (React.createElement(Icon, { visual: InformationCircleStrokeIcon, size: "xs" })),
|
|
85159
|
+
message))));
|
|
85145
85160
|
});
|
|
85146
85161
|
Input.displayName = "Input";
|
|
85147
85162
|
|
|
@@ -106717,11 +106732,10 @@ var NavigationList = React__namespace.forwardRef(function (_a, ref) {
|
|
|
106717
106732
|
});
|
|
106718
106733
|
NavigationList.displayName = "NavigationList";
|
|
106719
106734
|
var NavigationListItem = React__namespace.forwardRef(function (_a, ref) {
|
|
106720
|
-
var className = _a.className, selected = _a.selected, label = _a.label, icon = _a.icon, href = _a.href, target = _a.target, rel = _a.rel, replace = _a.replace, shallow = _a.shallow, props = __rest(_a, ["className", "selected", "label", "icon", "href", "target", "rel", "replace", "shallow"]);
|
|
106721
|
-
var _b = __read(React__namespace.useState(false), 2),
|
|
106722
|
-
var _c = __read(React__namespace.useState(false), 2), isPressed = _c[0], setIsPressed = _c[1];
|
|
106735
|
+
var className = _a.className, selected = _a.selected, label = _a.label, icon = _a.icon, href = _a.href, target = _a.target, rel = _a.rel, replace = _a.replace, shallow = _a.shallow, moreMenu = _a.moreMenu, props = __rest(_a, ["className", "selected", "label", "icon", "href", "target", "rel", "replace", "shallow", "moreMenu"]);
|
|
106736
|
+
var _b = __read(React__namespace.useState(false), 2), isPressed = _b[0], setIsPressed = _b[1];
|
|
106723
106737
|
var handleMouseDown = function (event) {
|
|
106724
|
-
if (!event.target.closest(".
|
|
106738
|
+
if (!event.target.closest(".button-class")) {
|
|
106725
106739
|
setIsPressed(true);
|
|
106726
106740
|
}
|
|
106727
106741
|
};
|
|
@@ -106729,14 +106743,12 @@ var NavigationListItem = React__namespace.forwardRef(function (_a, ref) {
|
|
|
106729
106743
|
React__namespace.createElement("div", { className: listStyles({
|
|
106730
106744
|
layout: "item",
|
|
106731
106745
|
state: selected ? "selected" : isPressed ? "active" : "unselected",
|
|
106732
|
-
}),
|
|
106733
|
-
setIsHovered(false);
|
|
106746
|
+
}), onMouseLeave: function () {
|
|
106734
106747
|
setIsPressed(false);
|
|
106735
106748
|
}, onMouseDown: handleMouseDown, onMouseUp: function () { return setIsPressed(false); } },
|
|
106736
106749
|
icon && React__namespace.createElement(Icon, { visual: icon, size: "sm" }),
|
|
106737
106750
|
label && (React__namespace.createElement("span", { className: "s-grow s-overflow-hidden s-text-ellipsis s-whitespace-nowrap" }, label)),
|
|
106738
|
-
|
|
106739
|
-
React__namespace.createElement(Button, { variant: "ghost", icon: MoreIcon, size: "xs", onClick: function (e) { return e.stopPropagation(); }, onMouseDown: function (e) { return e.stopPropagation(); }, onMouseUp: function (e) { return e.stopPropagation(); } }))))));
|
|
106751
|
+
selected && moreMenu && (React__namespace.createElement("div", { className: "-s-mr-2 s-flex s-h-4 s-items-center" }, moreMenu)))));
|
|
106740
106752
|
return (React__namespace.createElement(LinkWrapper, { href: href, target: target, rel: rel, replace: replace, shallow: shallow, className: className }, content));
|
|
106741
106753
|
});
|
|
106742
106754
|
NavigationListItem.displayName = "NavigationListItem";
|
|
@@ -113320,7 +113332,7 @@ exports.IconToggleButton = IconToggleButton;
|
|
|
113320
113332
|
exports.ImageIcon = SvgImage$2;
|
|
113321
113333
|
exports.ImageStrokeIcon = ImageStrokeIcon;
|
|
113322
113334
|
exports.InformationCircleIcon = InformationCircleIcon;
|
|
113323
|
-
exports.InformationCircleStrokeIcon =
|
|
113335
|
+
exports.InformationCircleStrokeIcon = InformationCircleStrokeIcon;
|
|
113324
113336
|
exports.Input = Input;
|
|
113325
113337
|
exports.IntercomLogo = IntercomLogo;
|
|
113326
113338
|
exports.Item = Item$3;
|