@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/cjs/index.js CHANGED
@@ -75554,7 +75554,7 @@ var classNamesForVariant = function (variant, hasDropdownItem) {
75554
75554
  }
75555
75555
  };
75556
75556
  DropdownMenu.Items = function (_a) {
75557
- 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;
75557
+ 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;
75558
75558
  var buttonRef = React.useContext(ButtonRefContext);
75559
75559
  var _f = __read(React.useState(0), 2), buttonHeight = _f[0], setButtonHeight = _f[1];
75560
75560
  if (origin === "auto") {
@@ -75622,7 +75622,7 @@ DropdownMenu.Items = function (_a) {
75622
75622
  return style;
75623
75623
  };
75624
75624
  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) },
75625
- React.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) },
75625
+ React.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) },
75626
75626
  topBar,
75627
75627
  React.createElement("div", { className: classNames(classNamesForVariant(variant, hasDropdownItem), getOverflowClass(overflow)) },
75628
75628
  React.createElement(Item.List, null, children)),