@app-studio/web 0.8.92 → 0.8.93

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.
@@ -3370,18 +3370,6 @@
3370
3370
  // Badge component that displays a small indicator, typically used for counts or status
3371
3371
  var Badge = props => /*#__PURE__*/React__default.createElement(BadgeView, Object.assign({}, props));
3372
3372
 
3373
- var useButtonState = () => {
3374
- var [isHovered, setIsHovered] = React__default.useState(false);
3375
- // This custom react hook 'useButtonState' is defined for managing the state of a button, especially for hover interactions.
3376
- return {
3377
- isHovered,
3378
- setIsHovered
3379
- };
3380
- // The 'setIsHovered' function is used to update the value of 'isHovered' state when the hover status of the button changes.
3381
- // A state variable 'isHovered' is declared with its initial value set to 'false', indicating that the button is not hovered by default.
3382
- };
3383
- // The hook returns an object containing 'isHovered' state and the 'setIsHovered' function to enable state management from the consumer component.
3384
-
3385
3373
  // This function initializes the Link component's state using the useState hook and exposes its state and setter function.
3386
3374
  var useLinkState = () => {
3387
3375
  var [isHovered, setIsHovered] = React.useState(false);
@@ -3966,25 +3954,14 @@
3966
3954
 
3967
3955
  // Importing a custom hook to manage the state specific to the button component.
3968
3956
  var ButtonComponent = props => {
3969
- // Importing the view part of the button, which is presumably a presentational component.
3970
- var {
3971
- isHovered,
3972
- setIsHovered
3973
- } = useButtonState();
3974
- // Defining the button component with generic React Functional Component type augmented with ButtonProps type.
3975
- var handleHover = () => setIsHovered(!isHovered);
3957
+ var [ref, hover] = appStudio.useHover();
3976
3958
  // Destructuring the state and state update function from the custom hook for button state management.
3977
3959
  return (
3978
3960
  /*#__PURE__*/
3979
3961
  // Defines a function to toggle the hover state of the button.
3980
3962
  React__default.createElement(ButtonView, Object.assign({
3981
- isHovered: isHovered,
3982
- // Rendering the ButtonView component and spreading the received props on it.
3983
- setIsHovered: setIsHovered,
3984
- // Passing the isHovered state and the setIsHovered function to the ButtonView.
3985
- onMouseEnter: handleHover,
3986
- // Binding handleHover function to onMouseEnter and onMouseLeave events to toggle hover effect.
3987
- onMouseLeave: handleHover
3963
+ ref: ref,
3964
+ isHovered: hover
3988
3965
  }, props))
3989
3966
  );
3990
3967
  // Exports the Button component for use in other parts of the application.