@dust-tt/sparkle 0.2.153-alphatv → 0.2.155-alphatv

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.
@@ -22,9 +22,11 @@ type GalleryVariantAssistantPreviewProps = BaseAssistantPreviewProps & {
22
22
  };
23
23
  type MinimalGalleryVariantAssistantPreviewProps = BaseAssistantPreviewProps & {
24
24
  variant: "minimalGallery";
25
- actions?: React.ReactNode;
25
+ hasAction?: boolean;
26
+ href?: string;
26
27
  onClick?: () => void;
27
28
  onActionClick?: () => void;
29
+ renderActionButton?: (button: React.ReactNode) => React.ReactNode;
28
30
  };
29
31
  type AssistantPreviewProps = ItemVariantAssistantPreviewProps | ListVariantAssistantPreviewProps | GalleryVariantAssistantPreviewProps | MinimalGalleryVariantAssistantPreviewProps;
30
32
  export declare function AssistantPreview(props: AssistantPreviewProps): React.JSX.Element;
package/dist/cjs/index.js CHANGED
@@ -74717,19 +74717,26 @@ ContextItem.SectionHeader = function (_a) {
74717
74717
  description && (React.createElement("div", { className: "s-text-sm s-font-normal s-text-element-700 dark:s-text-element-700-dark" }, description))));
74718
74718
  };
74719
74719
 
74720
+ var breakpoints = {
74721
+ sm: 640,
74722
+ md: 768,
74723
+ lg: 1024,
74724
+ xl: 1280,
74725
+ xxl: 1536, // Tailwind's default for `2xl`
74726
+ };
74720
74727
  var titleClassNames = {
74721
74728
  base: "s-truncate s-font-medium s-text-element-900 s-w-full",
74722
74729
  item: "s-text-sm",
74723
74730
  list: "s-text-base",
74724
74731
  gallery: "s-text-lg",
74725
- minimalGallery: "s-truncate s-text-base",
74732
+ minimalGallery: "s-overflow-hidden s-whitespace-nowrap ".concat(window.innerWidth <= breakpoints.sm ? "s-text-sm" : window.innerWidth <= breakpoints.md ? "s-text-base" : ""),
74726
74733
  };
74727
74734
  var subtitleClassNames = {
74728
74735
  base: "s-font-normal s-text-element-700 s-truncate s-w-full",
74729
74736
  item: "s-text-xs",
74730
74737
  list: "s-text-sm",
74731
74738
  gallery: "s-text-sm",
74732
- minimalGallery: "s-text-sm",
74739
+ minimalGallery: "s-overflow-hidden s-whitespace-nowrap ".concat(window.innerWidth <= breakpoints.sm ? "s-text-xs" : window.innerWidth <= breakpoints.md ? "s-text-sm" : ""),
74733
74740
  };
74734
74741
  var descriptionClassNames = {
74735
74742
  base: "s-font-normal s-mb-1",
@@ -74801,23 +74808,25 @@ var GalleryVariantContent = function (_a) {
74801
74808
  React.createElement("div", { className: classNames(descriptionClassNames["base"], descriptionClassNames.gallery) }, description))));
74802
74809
  };
74803
74810
  var MinimalGalleryVariantContent = function (_a) {
74804
- var actions = _a.actions, title = _a.title, pictureUrl = _a.pictureUrl, subtitle = _a.subtitle, onClick = _a.onClick, onActionClick = _a.onActionClick;
74811
+ var title = _a.title, pictureUrl = _a.pictureUrl, subtitle = _a.subtitle, _b = _a.hasAction, hasAction = _b === void 0 ? true : _b, onClick = _a.onClick, onActionClick = _a.onActionClick, renderActionButton = _a.renderActionButton;
74812
+ var isSmallScreen = window.innerWidth <= breakpoints.sm;
74813
+ var actionButton = (React.createElement(Button, { label: "", icon: SvgMore$1, variant: "tertiary", size: isSmallScreen ? "xs" : "sm", labelVisible: false, hasMagnifying: false, disabledTooltip: true, onClick: function (e) {
74814
+ e.stopPropagation();
74815
+ onActionClick === null || onActionClick === void 0 ? void 0 : onActionClick();
74816
+ } }));
74805
74817
  return (React.createElement(React.Fragment, null,
74806
- React.createElement("div", { id: "assistant-container", className: "s-flex s-grow s-flex-row s-justify-between s-gap-2 s-py-1", onClick: onClick },
74807
- React.createElement("div", { id: "preview", className: "s-flex s-w-fit s-flex-row s-items-center s-gap-2" },
74818
+ React.createElement("div", { id: "assistant-container", className: "s-flex s-grow s-flex-row s-justify-between s-gap-2 s-overflow-hidden s-py-1", onClick: onClick },
74819
+ React.createElement("div", { id: "preview", className: "s-flex s-w-full s-min-w-0 s-flex-row s-items-center s-gap-2" },
74808
74820
  React.createElement("div", { id: "avatar-column", className: "s-w-fit" },
74809
- React.createElement(Avatar, { name: "Avatar of ".concat(title), visual: pictureUrl, size: "md" })),
74810
- React.createElement("div", { id: "details-column", className: "s-flex s-w-full s-min-w-0 s-flex-col s-items-start s-gap-0" },
74821
+ React.createElement(Avatar, { name: "Avatar of ".concat(title), visual: pictureUrl, size: isSmallScreen ? "sm" : "md" })),
74822
+ React.createElement("div", { id: "details-column", className: "s-flex s-w-full s-min-w-0 s-flex-col s-items-start s-gap-0 s-overflow-hidden" },
74811
74823
  React.createElement("div", { className: classNames(titleClassNames["base"], titleClassNames.minimalGallery) },
74812
74824
  "@",
74813
74825
  title),
74814
74826
  React.createElement("div", { className: classNames(subtitleClassNames["base"], subtitleClassNames.minimalGallery) },
74815
74827
  "By: ",
74816
74828
  subtitle))),
74817
- React.createElement("div", { id: "actions-column", onClick: function (e) {
74818
- e.stopPropagation();
74819
- onActionClick === null || onActionClick === void 0 ? void 0 : onActionClick();
74820
- } }, actions))));
74829
+ React.createElement("div", { id: "actions-column", className: "s-flex s-shrink-0 s-w-fit" }, hasAction && (renderActionButton ? renderActionButton(actionButton) : actionButton)))));
74821
74830
  };
74822
74831
  function AssistantPreview(props) {
74823
74832
  var onClick = props.onClick, variant = props.variant;