@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.
- package/dist/web.cjs.development.js +3 -26
- package/dist/web.cjs.development.js.map +1 -1
- package/dist/web.cjs.production.min.js +1 -1
- package/dist/web.cjs.production.min.js.map +1 -1
- package/dist/web.esm.js +4 -27
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +3 -26
- package/dist/web.umd.development.js.map +1 -1
- package/dist/web.umd.production.min.js +1 -1
- package/dist/web.umd.production.min.js.map +1 -1
- package/package.json +2 -2
package/dist/web.esm.js
CHANGED
|
@@ -5,7 +5,7 @@ import 'core-js/modules/es.array.iterator.js';
|
|
|
5
5
|
import 'core-js/modules/es.string.includes.js';
|
|
6
6
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
7
7
|
import 'core-js/modules/es.regexp.to-string.js';
|
|
8
|
-
import { View, Horizontal, Vertical, Element, Text as Text$1, Center, useTheme, Image, Typography, Input, Form, useInView } from 'app-studio';
|
|
8
|
+
import { View, Horizontal, Vertical, Element, Text as Text$1, Center, useTheme, Image, useHover, Typography, Input, Form, useInView } from 'app-studio';
|
|
9
9
|
import 'core-js/modules/es.symbol.description.js';
|
|
10
10
|
import 'core-js/modules/es.parse-float.js';
|
|
11
11
|
import 'core-js/modules/es.string.trim-end.js';
|
|
@@ -3394,18 +3394,6 @@ var BadgeView = _ref => {
|
|
|
3394
3394
|
// Badge component that displays a small indicator, typically used for counts or status
|
|
3395
3395
|
var Badge = props => /*#__PURE__*/React.createElement(BadgeView, Object.assign({}, props));
|
|
3396
3396
|
|
|
3397
|
-
var useButtonState = () => {
|
|
3398
|
-
var [isHovered, setIsHovered] = React.useState(false);
|
|
3399
|
-
// This custom react hook 'useButtonState' is defined for managing the state of a button, especially for hover interactions.
|
|
3400
|
-
return {
|
|
3401
|
-
isHovered,
|
|
3402
|
-
setIsHovered
|
|
3403
|
-
};
|
|
3404
|
-
// The 'setIsHovered' function is used to update the value of 'isHovered' state when the hover status of the button changes.
|
|
3405
|
-
// A state variable 'isHovered' is declared with its initial value set to 'false', indicating that the button is not hovered by default.
|
|
3406
|
-
};
|
|
3407
|
-
// The hook returns an object containing 'isHovered' state and the 'setIsHovered' function to enable state management from the consumer component.
|
|
3408
|
-
|
|
3409
3397
|
// This function initializes the Link component's state using the useState hook and exposes its state and setter function.
|
|
3410
3398
|
var useLinkState = () => {
|
|
3411
3399
|
var [isHovered, setIsHovered] = useState(false);
|
|
@@ -3990,25 +3978,14 @@ var ButtonView = _ref => {
|
|
|
3990
3978
|
|
|
3991
3979
|
// Importing a custom hook to manage the state specific to the button component.
|
|
3992
3980
|
var ButtonComponent = props => {
|
|
3993
|
-
|
|
3994
|
-
var {
|
|
3995
|
-
isHovered,
|
|
3996
|
-
setIsHovered
|
|
3997
|
-
} = useButtonState();
|
|
3998
|
-
// Defining the button component with generic React Functional Component type augmented with ButtonProps type.
|
|
3999
|
-
var handleHover = () => setIsHovered(!isHovered);
|
|
3981
|
+
var [ref, hover] = useHover();
|
|
4000
3982
|
// Destructuring the state and state update function from the custom hook for button state management.
|
|
4001
3983
|
return (
|
|
4002
3984
|
/*#__PURE__*/
|
|
4003
3985
|
// Defines a function to toggle the hover state of the button.
|
|
4004
3986
|
React.createElement(ButtonView, Object.assign({
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
setIsHovered: setIsHovered,
|
|
4008
|
-
// Passing the isHovered state and the setIsHovered function to the ButtonView.
|
|
4009
|
-
onMouseEnter: handleHover,
|
|
4010
|
-
// Binding handleHover function to onMouseEnter and onMouseLeave events to toggle hover effect.
|
|
4011
|
-
onMouseLeave: handleHover
|
|
3987
|
+
ref: ref,
|
|
3988
|
+
isHovered: hover
|
|
4012
3989
|
}, props))
|
|
4013
3990
|
);
|
|
4014
3991
|
// Exports the Button component for use in other parts of the application.
|