@dust-tt/sparkle 0.2.61-alpha-4 → 0.2.62
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 +11 -17
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +11 -17
- package/dist/esm/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -32826,9 +32826,9 @@ DropdownMenu.Item = function (_a) {
|
|
|
32826
32826
|
children)) : (React__default.createElement(Item.Dropdown, { className: "s-w-full s-px-4", href: href, onClick: onClick, label: label, visual: visual, icon: icon, description: description }))));
|
|
32827
32827
|
};
|
|
32828
32828
|
DropdownMenu.Items = function (_a) {
|
|
32829
|
-
var _b = _a.origin, origin = _b === void 0 ? "auto" : _b, _c = _a.width, width = _c === void 0 ? 160 : _c,
|
|
32829
|
+
var _b = _a.origin, origin = _b === void 0 ? "auto" : _b, _c = _a.width, width = _c === void 0 ? 160 : _c, marginLeft = _a.marginLeft, children = _a.children;
|
|
32830
32830
|
var buttonRef = useContext(ButtonRefContext);
|
|
32831
|
-
var
|
|
32831
|
+
var _d = __read(useState(0), 2), buttonHeight = _d[0], setButtonHeight = _d[1];
|
|
32832
32832
|
if (origin === "auto") {
|
|
32833
32833
|
origin = findOriginFromButton(buttonRef);
|
|
32834
32834
|
}
|
|
@@ -32866,22 +32866,16 @@ DropdownMenu.Items = function (_a) {
|
|
|
32866
32866
|
}
|
|
32867
32867
|
};
|
|
32868
32868
|
var styleInsert = function (origin, marginLeft) {
|
|
32869
|
-
|
|
32870
|
-
|
|
32871
|
-
|
|
32872
|
-
|
|
32873
|
-
|
|
32874
|
-
|
|
32875
|
-
|
|
32876
|
-
|
|
32877
|
-
return {
|
|
32878
|
-
width: "".concat(width, "px"),
|
|
32879
|
-
top: "".concat(buttonHeight + 8, "px"),
|
|
32880
|
-
left: "".concat(marginLeft, "px"),
|
|
32881
|
-
};
|
|
32882
|
-
default:
|
|
32883
|
-
return { width: "".concat(width, "px"), left: "".concat(marginLeft, "px") };
|
|
32869
|
+
var style = {
|
|
32870
|
+
width: "".concat(width, "px"),
|
|
32871
|
+
};
|
|
32872
|
+
if (marginLeft) {
|
|
32873
|
+
style["left"] = "".concat(marginLeft, "px");
|
|
32874
|
+
}
|
|
32875
|
+
if (origin === "topLeft" || origin === "topRight") {
|
|
32876
|
+
style["top"] = "".concat(buttonHeight + 8, "px");
|
|
32884
32877
|
}
|
|
32878
|
+
return style;
|
|
32885
32879
|
};
|
|
32886
32880
|
return (React__default.createElement(tt, { as: Fragment, enter: "s-transition s-ease-out s-duration-200", enterFrom: getOriginTransClass(origin), enterTo: "s-transform s-opacity-100 s-scale-100 s-translate-y-0", leave: "s-transition s-ease-in s-duration-75", leaveFrom: "s-transform s-opacity-100 s-scale-100 s-translate-y-0", leaveTo: getOriginTransClass(origin) },
|
|
32887
32881
|
React__default.createElement(it.Items, { className: "s-absolute s-z-10 ".concat(getOriginClass(origin), " s-rounded-xl s-border s-border-structure-100 s-bg-structure-0 s-py-1 s-shadow-lg focus:s-outline-none dark:s-border-structure-100-dark dark:s-bg-structure-0-dark"), style: styleInsert(origin, marginLeft) },
|