@dust-tt/sparkle 0.1.46 → 0.1.47

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.
@@ -1,7 +1,7 @@
1
1
  import React, { ComponentType, MouseEventHandler } from "react";
2
2
  import { TooltipProps } from "./Tooltip";
3
3
  type IconButtonProps = {
4
- type?: "primary" | "warning" | "secondary" | "tertiary";
4
+ variant?: "primary" | "warning" | "secondary" | "tertiary";
5
5
  onClick?: MouseEventHandler<HTMLButtonElement>;
6
6
  size?: "xs" | "sm" | "md";
7
7
  tooltip?: string;
@@ -10,5 +10,5 @@ type IconButtonProps = {
10
10
  className?: string;
11
11
  disabled?: boolean;
12
12
  };
13
- export declare function IconButton({ type, onClick, disabled, tooltip, tooltipPosition, icon, className, size, }: IconButtonProps): React.JSX.Element;
13
+ export declare function IconButton({ variant, onClick, disabled, tooltip, tooltipPosition, icon, className, size, }: IconButtonProps): React.JSX.Element;
14
14
  export {};
@@ -1,7 +1,7 @@
1
1
  import React, { ComponentType, MouseEventHandler } from "react";
2
2
  import { TooltipProps } from "./Tooltip";
3
3
  type IconToggleButtonProps = {
4
- type?: "secondary" | "tertiary";
4
+ variant?: "secondary" | "tertiary";
5
5
  onClick?: MouseEventHandler<HTMLButtonElement>;
6
6
  size?: "xs" | "sm" | "md";
7
7
  tooltip?: string;
@@ -12,5 +12,5 @@ type IconToggleButtonProps = {
12
12
  disabled?: boolean;
13
13
  selected?: boolean;
14
14
  };
15
- export declare function IconToggleButton({ type, onClick, disabled, tooltip, tooltipPosition, icon, iconSelected, className, selected, size, }: IconToggleButtonProps): React.JSX.Element;
15
+ export declare function IconToggleButton({ variant, onClick, disabled, tooltip, tooltipPosition, icon, iconSelected, className, selected, size, }: IconToggleButtonProps): React.JSX.Element;
16
16
  export {};
@@ -1,6 +1,6 @@
1
1
  import React, { MouseEventHandler } from "react";
2
2
  type SliderToggleProps = {
3
- onClick?: MouseEventHandler<HTMLButtonElement>;
3
+ onClick?: MouseEventHandler<HTMLElement>;
4
4
  className?: string;
5
5
  disabled?: boolean;
6
6
  selected?: boolean;
package/dist/esm/index.js CHANGED
@@ -940,9 +940,9 @@ var iconClasses$1 = {
940
940
  },
941
941
  };
942
942
  function IconButton(_a) {
943
- var _b = _a.type, type = _b === void 0 ? "tertiary" : _b, onClick = _a.onClick, _c = _a.disabled, disabled = _c === void 0 ? false : _c, tooltip = _a.tooltip, _d = _a.tooltipPosition, tooltipPosition = _d === void 0 ? "above" : _d, icon = _a.icon, _e = _a.className, className = _e === void 0 ? "" : _e, _f = _a.size, size = _f === void 0 ? "sm" : _f;
943
+ var _b = _a.variant, variant = _b === void 0 ? "tertiary" : _b, onClick = _a.onClick, _c = _a.disabled, disabled = _c === void 0 ? false : _c, tooltip = _a.tooltip, _d = _a.tooltipPosition, tooltipPosition = _d === void 0 ? "above" : _d, icon = _a.icon, _e = _a.className, className = _e === void 0 ? "" : _e, _f = _a.size, size = _f === void 0 ? "sm" : _f;
944
944
  // Choose the correct group of classes based on 'type'
945
- var iconGroup = iconClasses$1[type];
945
+ var iconGroup = iconClasses$1[variant];
946
946
  var finalIconClasses = classNames(className, baseClasses$1, iconGroup.base, disabled ? iconGroup.disabled : iconGroup.hover, disabled ? "" : iconGroup.active, iconGroup.dark.base, disabled ? iconGroup.dark.disabled : iconGroup.dark.hover, disabled ? "" : iconGroup.dark.active);
947
947
  var IconButtonContent = (React__default.createElement("button", { className: finalIconClasses, onClick: disabled ? undefined : onClick, disabled: disabled }, icon && React__default.createElement(Icon, { visual: icon, size: size })));
948
948
  return tooltip ? (React__default.createElement(Tooltip, { label: tooltip, position: tooltipPosition }, IconButtonContent)) : (IconButtonContent);
@@ -980,8 +980,8 @@ var iconClasses = {
980
980
  },
981
981
  };
982
982
  function IconToggleButton(_a) {
983
- var _b = _a.type, type = _b === void 0 ? "tertiary" : _b, onClick = _a.onClick, _c = _a.disabled, disabled = _c === void 0 ? false : _c, tooltip = _a.tooltip, _d = _a.tooltipPosition, tooltipPosition = _d === void 0 ? "above" : _d, icon = _a.icon, iconSelected = _a.iconSelected, _e = _a.className, className = _e === void 0 ? "" : _e, _f = _a.selected, selected = _f === void 0 ? false : _f, _g = _a.size, size = _g === void 0 ? "sm" : _g;
984
- var iconGroup = iconClasses[type];
983
+ var _b = _a.variant, variant = _b === void 0 ? "tertiary" : _b, onClick = _a.onClick, _c = _a.disabled, disabled = _c === void 0 ? false : _c, tooltip = _a.tooltip, _d = _a.tooltipPosition, tooltipPosition = _d === void 0 ? "above" : _d, icon = _a.icon, iconSelected = _a.iconSelected, _e = _a.className, className = _e === void 0 ? "" : _e, _f = _a.selected, selected = _f === void 0 ? false : _f, _g = _a.size, size = _g === void 0 ? "sm" : _g;
984
+ var iconGroup = iconClasses[variant];
985
985
  var finalIconClasses = classNames(className, baseClasses, disabled
986
986
  ? iconGroup.disabled
987
987
  : selected