@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/cjs/index.js
CHANGED
|
@@ -32846,9 +32846,9 @@ DropdownMenu.Item = function (_a) {
|
|
|
32846
32846
|
children)) : (React.createElement(Item.Dropdown, { className: "s-w-full s-px-4", href: href, onClick: onClick, label: label, visual: visual, icon: icon, description: description }))));
|
|
32847
32847
|
};
|
|
32848
32848
|
DropdownMenu.Items = function (_a) {
|
|
32849
|
-
var _b = _a.origin, origin = _b === void 0 ? "auto" : _b, _c = _a.width, width = _c === void 0 ? 160 : _c,
|
|
32849
|
+
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;
|
|
32850
32850
|
var buttonRef = React.useContext(ButtonRefContext);
|
|
32851
|
-
var
|
|
32851
|
+
var _d = __read(React.useState(0), 2), buttonHeight = _d[0], setButtonHeight = _d[1];
|
|
32852
32852
|
if (origin === "auto") {
|
|
32853
32853
|
origin = findOriginFromButton(buttonRef);
|
|
32854
32854
|
}
|
|
@@ -32886,22 +32886,16 @@ DropdownMenu.Items = function (_a) {
|
|
|
32886
32886
|
}
|
|
32887
32887
|
};
|
|
32888
32888
|
var styleInsert = function (origin, marginLeft) {
|
|
32889
|
-
|
|
32890
|
-
|
|
32891
|
-
|
|
32892
|
-
|
|
32893
|
-
|
|
32894
|
-
|
|
32895
|
-
|
|
32896
|
-
|
|
32897
|
-
return {
|
|
32898
|
-
width: "".concat(width, "px"),
|
|
32899
|
-
top: "".concat(buttonHeight + 8, "px"),
|
|
32900
|
-
left: "".concat(marginLeft, "px"),
|
|
32901
|
-
};
|
|
32902
|
-
default:
|
|
32903
|
-
return { width: "".concat(width, "px"), left: "".concat(marginLeft, "px") };
|
|
32889
|
+
var style = {
|
|
32890
|
+
width: "".concat(width, "px"),
|
|
32891
|
+
};
|
|
32892
|
+
if (marginLeft) {
|
|
32893
|
+
style["left"] = "".concat(marginLeft, "px");
|
|
32894
|
+
}
|
|
32895
|
+
if (origin === "topLeft" || origin === "topRight") {
|
|
32896
|
+
style["top"] = "".concat(buttonHeight + 8, "px");
|
|
32904
32897
|
}
|
|
32898
|
+
return style;
|
|
32905
32899
|
};
|
|
32906
32900
|
return (React.createElement(tt, { as: React.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) },
|
|
32907
32901
|
React.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) },
|