@dust-tt/sparkle 0.2.155 → 0.2.156

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.
@@ -11,7 +11,7 @@ export declare namespace DropdownMenu {
11
11
  var Button: ({ label, type, size, tooltip, icon, children, tooltipPosition, className, disabled, onClick, }: DropdownButtonProps) => React.JSX.Element;
12
12
  var Item: ({ variant, label, description, href, disabled, visual, icon, onClick, hasChildren, children, selected, }: DropdownItemProps) => React.JSX.Element;
13
13
  var SectionHeader: ({ label }: DropdownSectionHeaderProps) => React.JSX.Element;
14
- var Items: ({ origin, width, marginLeft, children, topBar, bottomBar, overflow, variant, }: DropdownItemsProps) => React.JSX.Element;
14
+ var Items: ({ origin, width, marginLeft, children, topBar, bottomBar, onKeyDown, overflow, variant, }: DropdownItemsProps) => React.JSX.Element;
15
15
  }
16
16
  export interface DropdownButtonProps {
17
17
  label?: string;
@@ -49,6 +49,7 @@ interface DropdownItemsProps {
49
49
  children: React.ReactNode;
50
50
  topBar?: React.ReactNode;
51
51
  bottomBar?: React.ReactNode;
52
+ onKeyDown?: (e: React.KeyboardEvent) => void;
52
53
  overflow?: "visible" | "auto";
53
54
  variant?: ItemsVariantType;
54
55
  }
package/dist/esm/index.js CHANGED
@@ -75534,7 +75534,7 @@ var classNamesForVariant = function (variant, hasDropdownItem) {
75534
75534
  }
75535
75535
  };
75536
75536
  DropdownMenu.Items = function (_a) {
75537
- 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, topBar = _a.topBar, bottomBar = _a.bottomBar, _d = _a.overflow, overflow = _d === void 0 ? "auto" : _d, _e = _a.variant, variant = _e === void 0 ? "default" : _e;
75537
+ 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, topBar = _a.topBar, bottomBar = _a.bottomBar, onKeyDown = _a.onKeyDown, _d = _a.overflow, overflow = _d === void 0 ? "auto" : _d, _e = _a.variant, variant = _e === void 0 ? "default" : _e;
75538
75538
  var buttonRef = useContext(ButtonRefContext);
75539
75539
  var _f = __read(useState(0), 2), buttonHeight = _f[0], setButtonHeight = _f[1];
75540
75540
  if (origin === "auto") {
@@ -75602,7 +75602,7 @@ DropdownMenu.Items = function (_a) {
75602
75602
  return style;
75603
75603
  };
75604
75604
  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) },
75605
- React__default.createElement(it.Items, { className: classNames("s-absolute s-z-10", getOriginClass(origin), "s-rounded-xl s-border s-border-structure-100 s-bg-structure-0 s-shadow-lg focus:s-outline-none dark:s-border-structure-100-dark dark:s-bg-structure-0-dark"), style: styleInsert(origin, marginLeft) },
75605
+ React__default.createElement(it.Items, { onKeyDown: onKeyDown, className: classNames("s-absolute s-z-10", getOriginClass(origin), "s-rounded-xl s-border s-border-structure-100 s-bg-structure-0 s-shadow-lg focus:s-outline-none dark:s-border-structure-100-dark dark:s-bg-structure-0-dark"), style: styleInsert(origin, marginLeft) },
75606
75606
  topBar,
75607
75607
  React__default.createElement("div", { className: classNames(classNamesForVariant(variant, hasDropdownItem), getOverflowClass(overflow)) },
75608
75608
  React__default.createElement(Item.List, null, children)),