@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/cjs/index.js CHANGED
@@ -960,9 +960,9 @@ var iconClasses$1 = {
960
960
  },
961
961
  };
962
962
  function IconButton(_a) {
963
- 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;
963
+ 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;
964
964
  // Choose the correct group of classes based on 'type'
965
- var iconGroup = iconClasses$1[type];
965
+ var iconGroup = iconClasses$1[variant];
966
966
  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);
967
967
  var IconButtonContent = (React.createElement("button", { className: finalIconClasses, onClick: disabled ? undefined : onClick, disabled: disabled }, icon && React.createElement(Icon, { visual: icon, size: size })));
968
968
  return tooltip ? (React.createElement(Tooltip, { label: tooltip, position: tooltipPosition }, IconButtonContent)) : (IconButtonContent);
@@ -1000,8 +1000,8 @@ var iconClasses = {
1000
1000
  },
1001
1001
  };
1002
1002
  function IconToggleButton(_a) {
1003
- 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;
1004
- var iconGroup = iconClasses[type];
1003
+ 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;
1004
+ var iconGroup = iconClasses[variant];
1005
1005
  var finalIconClasses = classNames(className, baseClasses, disabled
1006
1006
  ? iconGroup.disabled
1007
1007
  : selected