heroes-of-chess-components 0.5.73 → 0.5.75
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/lib/HocComponents/HBox/HBox.styled.ts +9 -6
- package/dist/lib/HocComponents/HBox/HBox.tsx +4 -4
- package/dist/lib/HocComponents/HBox/type.d.ts +4 -4
- package/dist/lib/HocComponents/HButton/HButton.styled.ts +23 -16
- package/dist/lib/HocComponents/HButton/HButton.tsx +6 -6
- package/dist/lib/HocComponents/HButton/types.d.ts +6 -6
- package/dist/lib/hooks/sounds/soundLibrary.js +9 -6
- package/dist/lib/hooks/sounds/soundTypes.ts +0 -9
- package/package.json +1 -1
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
2
|
import { HBoxStyledProps } from "./type";
|
|
3
3
|
|
|
4
|
-
export const HBoxContainer = styled.div
|
|
4
|
+
export const HBoxContainer = styled.div.withConfig({
|
|
5
|
+
shouldForwardProp: (prop) =>
|
|
6
|
+
!["borderRadius", "overflowX", "overflowY", "boxShadow"].includes(prop),
|
|
7
|
+
})<HBoxStyledProps>`
|
|
5
8
|
display: flex;
|
|
6
9
|
flex-direction: ${(props) => props.direction}; /* Dirección (row o column) */
|
|
7
10
|
gap: ${(props) => props.gap}; /* Espaciado entre elementos */
|
|
@@ -14,7 +17,7 @@ export const HBoxContainer = styled.div<HBoxStyledProps>`
|
|
|
14
17
|
padding: ${(props) => props.padding}; /* Padding */
|
|
15
18
|
margin: ${(props) => props.margin}; /* Margin */
|
|
16
19
|
border: ${(props) => props.border}; /* Border */
|
|
17
|
-
border-radius: ${(props) => props
|
|
20
|
+
border-radius: ${(props) => props.borderRadius}; /* Bordes redondeados */
|
|
18
21
|
position: ${(props) => props.position}; /* Posición del contenedor */
|
|
19
22
|
top: ${(props) => props.top}; /* Posición superior */
|
|
20
23
|
bottom: ${(props) => props.bottom}; /* Posición inferior */
|
|
@@ -23,10 +26,10 @@ export const HBoxContainer = styled.div<HBoxStyledProps>`
|
|
|
23
26
|
background: ${({ theme, background }) =>
|
|
24
27
|
(background && theme?.[background]) || background || "transparent"};
|
|
25
28
|
transition: all 0.3s ease;
|
|
26
|
-
overflow-x: ${(props) => props
|
|
27
|
-
overflow-y: ${(props) => props
|
|
28
|
-
box-shadow: ${({
|
|
29
|
-
(
|
|
29
|
+
overflow-x: ${(props) => props.overflowX ?? "auto"};
|
|
30
|
+
overflow-y: ${(props) => props.overflowY ?? "auto"};
|
|
31
|
+
box-shadow: ${({ boxShadow, theme }) =>
|
|
32
|
+
(boxShadow && theme?.[boxShadow]) || boxShadow || "none"}; /* Sombra */
|
|
30
33
|
|
|
31
34
|
/* Estilos de la barra de scroll */
|
|
32
35
|
&::-webkit-scrollbar {
|
|
@@ -39,10 +39,10 @@ const HBox: React.FC<HBoxProps> = ({
|
|
|
39
39
|
padding={padding}
|
|
40
40
|
margin={margin}
|
|
41
41
|
border={border}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
borderRadius={borderRadius}
|
|
43
|
+
overflowX={overflowX}
|
|
44
|
+
overflowY={overflowY}
|
|
45
|
+
boxShadow={boxShadow}
|
|
46
46
|
position={position}
|
|
47
47
|
top={top}
|
|
48
48
|
bottom={bottom}
|
|
@@ -58,10 +58,10 @@ export interface HBoxStyledProps
|
|
|
58
58
|
bottom?: DimensionType;
|
|
59
59
|
left?: DimensionType;
|
|
60
60
|
right?: DimensionType;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
borderRadius?: BorderRadiusType;
|
|
62
|
+
overflowX?: OverflowType;
|
|
63
|
+
overflowY?: OverflowType;
|
|
64
|
+
boxShadow?: BoxShadowType;
|
|
65
65
|
theme?: any;
|
|
66
66
|
}
|
|
67
67
|
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
2
|
import type { ButtonStyledProps } from "./types";
|
|
3
3
|
|
|
4
|
-
export const Button = styled.button
|
|
4
|
+
export const Button = styled.button.withConfig({
|
|
5
|
+
shouldForwardProp: (prop) =>
|
|
6
|
+
![
|
|
7
|
+
"activeBackground",
|
|
8
|
+
"hoverBackground",
|
|
9
|
+
"borderRadius",
|
|
10
|
+
"boxShadow",
|
|
11
|
+
].includes(prop),
|
|
12
|
+
})<ButtonStyledProps>`
|
|
5
13
|
display: flex;
|
|
6
14
|
align-items: center;
|
|
7
15
|
justify-content: center;
|
|
@@ -12,37 +20,36 @@ export const Button = styled.button<ButtonStyledProps>`
|
|
|
12
20
|
color: ${({ color, theme }) =>
|
|
13
21
|
(color && theme?.[color]) || color || theme?.goldColor} !important;
|
|
14
22
|
|
|
15
|
-
font-size: ${({
|
|
16
|
-
if (
|
|
23
|
+
font-size: ${({ fontSize }) => {
|
|
24
|
+
if (!fontSize) return "var(--h4)";
|
|
17
25
|
|
|
18
|
-
if (
|
|
19
|
-
return `var(--${
|
|
26
|
+
if (fontSize?.startsWith("h") || fontSize?.startsWith("p")) {
|
|
27
|
+
return `var(--${fontSize}, var(--h4))`;
|
|
20
28
|
}
|
|
21
29
|
|
|
22
|
-
return
|
|
30
|
+
return fontSize;
|
|
23
31
|
}} !important;
|
|
24
32
|
|
|
25
|
-
font-weight: ${({
|
|
26
|
-
if (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return `var(--${$fontWeight}, var(--weight-bold))`;
|
|
33
|
+
font-weight: ${({ fontWeight }) => {
|
|
34
|
+
if (!fontWeight) return "var(--weight-bold)";
|
|
35
|
+
if (fontWeight?.startsWith("weight-")) {
|
|
36
|
+
return `var(--${fontWeight}, var(--weight-bold))`;
|
|
30
37
|
}
|
|
31
|
-
return
|
|
38
|
+
return fontWeight; // 400, 700, 'inherit', etc.
|
|
32
39
|
}} !important;
|
|
33
40
|
|
|
34
41
|
width: ${({ width }) => width || "auto"};
|
|
35
42
|
height: ${({ height }) => height || "auto"};
|
|
36
|
-
border-radius: ${({
|
|
43
|
+
border-radius: ${({ borderRadius }) => borderRadius || "8px"} !important;
|
|
37
44
|
border: none;
|
|
38
45
|
outline: none;
|
|
39
46
|
transition: all 0.3s ease;
|
|
40
47
|
padding: ${({ padding }) => padding ?? "10px"};
|
|
41
48
|
text-transform: uppercase;
|
|
42
49
|
margin: ${({ margin }) => margin || "0"};
|
|
43
|
-
box-shadow: ${({
|
|
44
|
-
(
|
|
45
|
-
|
|
50
|
+
box-shadow: ${({ boxShadow, theme }) =>
|
|
51
|
+
(boxShadow && theme?.[boxShadow]) ||
|
|
52
|
+
boxShadow ||
|
|
46
53
|
"none"} !important; /* Sombra */
|
|
47
54
|
opacity: ${({ opacity }) => opacity || 1};
|
|
48
55
|
pointer-events: ${({ pointerEvents }) => pointerEvents || "auto"};
|
|
@@ -28,15 +28,15 @@ const HButton: React.FC<HButtonProps> = ({
|
|
|
28
28
|
type={type}
|
|
29
29
|
onClick={onClick}
|
|
30
30
|
background={background}
|
|
31
|
-
|
|
31
|
+
boxShadow={boxShadow}
|
|
32
32
|
color={color}
|
|
33
33
|
width={width}
|
|
34
34
|
height={height}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
fontSize={fontSize}
|
|
36
|
+
fontWeight={fontWeight}
|
|
37
|
+
borderRadius={borderRadius}
|
|
38
|
+
hoverBackground={hoverBackground}
|
|
39
|
+
activeBackground={activeBackground}
|
|
40
40
|
padding={padding}
|
|
41
41
|
disabled={disabled}
|
|
42
42
|
opacity={disabled ? 0.5 : 1}
|
|
@@ -33,15 +33,15 @@ export interface HButtonProps
|
|
|
33
33
|
// Styled components props
|
|
34
34
|
export interface ButtonStyledProps {
|
|
35
35
|
background?: ColorType;
|
|
36
|
-
|
|
36
|
+
boxShadow?: BoxShadowType;
|
|
37
37
|
color?: ColorType;
|
|
38
38
|
width?: DimensionType;
|
|
39
39
|
height?: DimensionType;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
fontSize?: FontSizeType;
|
|
41
|
+
fontWeight?: FontWeightType;
|
|
42
|
+
borderRadius?: BorderRadiusType;
|
|
43
|
+
hoverBackground?: ColorType;
|
|
44
|
+
activeBackground?: ColorType;
|
|
45
45
|
padding?: SpacingType;
|
|
46
46
|
margin?: SpacingType;
|
|
47
47
|
opacity?: number;
|
|
@@ -330,11 +330,12 @@ export var soundLibrary = {
|
|
|
330
330
|
used: true
|
|
331
331
|
},
|
|
332
332
|
codeBreakerFinish: {
|
|
333
|
+
// NO USADO porque sobrepisa con otro sonido
|
|
333
334
|
id: "codeBreakerFinish",
|
|
334
335
|
title: "Code Breaker Finish",
|
|
335
336
|
description: "Sound when finishing code breaker game - Used when: Completing code breaker mini-game",
|
|
336
|
-
file: codeBreakerFinish,
|
|
337
|
-
used:
|
|
337
|
+
// file: codeBreakerFinish,
|
|
338
|
+
used: false
|
|
338
339
|
},
|
|
339
340
|
codeBreakerCheckCode: {
|
|
340
341
|
id: "codeBreakerCheckCode",
|
|
@@ -365,11 +366,12 @@ export var soundLibrary = {
|
|
|
365
366
|
used: true
|
|
366
367
|
},
|
|
367
368
|
minigameStart: {
|
|
369
|
+
// NO USADO, INSOPORTABLE
|
|
368
370
|
id: "minigameStart",
|
|
369
371
|
title: "Mini Game Start",
|
|
370
372
|
description: "Mini game start sound - Used when: Starting mini-games",
|
|
371
|
-
file: minigameStart,
|
|
372
|
-
used:
|
|
373
|
+
// file: minigameStart,
|
|
374
|
+
used: false
|
|
373
375
|
},
|
|
374
376
|
miniGameNewGame: {
|
|
375
377
|
id: "miniGameNewGame",
|
|
@@ -379,11 +381,12 @@ export var soundLibrary = {
|
|
|
379
381
|
used: true
|
|
380
382
|
},
|
|
381
383
|
miniGameEnter: {
|
|
384
|
+
// No USADO, INSOPORTABLE
|
|
382
385
|
id: "miniGameEnter",
|
|
383
386
|
title: "Mini Game Enter",
|
|
384
387
|
description: "Enter mini game sound - Used when: Entering mini-game area",
|
|
385
|
-
file: miniGameEnter,
|
|
386
|
-
used:
|
|
388
|
+
// file: miniGameEnter,
|
|
389
|
+
used: false
|
|
387
390
|
},
|
|
388
391
|
miniGameLoose: {
|
|
389
392
|
id: "miniGameLoose",
|
|
@@ -119,9 +119,6 @@ export const HOC_SOUNDS = {
|
|
|
119
119
|
/** Claim reward sound - Used when: Claiming jackpot rewards, coins, bonuses (roulette) */
|
|
120
120
|
claimJackpot: "claimJackpot" as const,
|
|
121
121
|
|
|
122
|
-
/** Sound when finishing code breaker game - Used when: Completing code breaker mini-game */
|
|
123
|
-
codeBreakerFinish: "codeBreakerFinish" as const,
|
|
124
|
-
|
|
125
122
|
/** Sound when checking code in code breaker - Used when: Validating code in code breaker mini-game */
|
|
126
123
|
codeBreakerCheckCode: "codeBreakerCheckCode" as const,
|
|
127
124
|
|
|
@@ -134,15 +131,9 @@ export const HOC_SOUNDS = {
|
|
|
134
131
|
/** Profile modal opening sound - Used when: Opening profile modals */
|
|
135
132
|
profileModalOpen: "profileModalOpen" as const,
|
|
136
133
|
|
|
137
|
-
/** Mini game start sound - Used when: Starting mini-games */
|
|
138
|
-
minigameStart: "minigameStart" as const,
|
|
139
|
-
|
|
140
134
|
/** New mini game sound - Used when: Starting a new mini-game session */
|
|
141
135
|
miniGameNewGame: "miniGameNewGame" as const,
|
|
142
136
|
|
|
143
|
-
/** Enter mini game sound - Used when: Entering mini-game area */
|
|
144
|
-
miniGameEnter: "miniGameEnter" as const,
|
|
145
|
-
|
|
146
137
|
/** Mini game lose sound - Used when: Losing in mini-games */
|
|
147
138
|
miniGameLoose: "miniGameLoose" as const,
|
|
148
139
|
|