hudini 0.17.1 → 0.18.0
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/components/card/card.d.ts +34 -9
- package/dist/components/card/card.d.ts.map +1 -1
- package/dist/components/card/card.js +117 -49
- package/dist/components/card/card.js.map +1 -1
- package/dist/components/card/card.spec.js +28 -1
- package/dist/components/card/card.spec.js.map +1 -1
- package/dist/components/circular-progress/circular-progress.d.ts +4 -4
- package/dist/components/circular-progress/circular-progress.d.ts.map +1 -1
- package/dist/components/circular-progress/circular-progress.js +9 -8
- package/dist/components/circular-progress/circular-progress.js.map +1 -1
- package/dist/components/circular-progress/circular-progress.spec.js +4 -4
- package/dist/components/circular-progress/circular-progress.spec.js.map +1 -1
- package/dist/components/container-interactive/container-interactive.d.ts +65 -0
- package/dist/components/container-interactive/container-interactive.d.ts.map +1 -0
- package/dist/components/container-interactive/container-interactive.js +99 -0
- package/dist/components/container-interactive/container-interactive.js.map +1 -0
- package/dist/components/container-interactive/index.d.ts +2 -0
- package/dist/components/container-interactive/index.d.ts.map +1 -0
- package/dist/components/container-interactive/index.js +2 -0
- package/dist/components/container-interactive/index.js.map +1 -0
- package/dist/components/flat-icon-button/flat-icon-button.d.ts +3 -0
- package/dist/components/flat-icon-button/flat-icon-button.d.ts.map +1 -1
- package/dist/components/flat-icon-button/flat-icon-button.js +110 -19
- package/dist/components/flat-icon-button/flat-icon-button.js.map +1 -1
- package/dist/components/flat-section-header/flat-section-header.d.ts +143 -0
- package/dist/components/flat-section-header/flat-section-header.d.ts.map +1 -0
- package/dist/components/flat-section-header/flat-section-header.js +275 -0
- package/dist/components/flat-section-header/flat-section-header.js.map +1 -0
- package/dist/components/flat-section-header/flat-section-header.spec.d.ts +2 -0
- package/dist/components/flat-section-header/flat-section-header.spec.d.ts.map +1 -0
- package/dist/components/flat-section-header/flat-section-header.spec.js +255 -0
- package/dist/components/flat-section-header/flat-section-header.spec.js.map +1 -0
- package/dist/components/flat-section-header/index.d.ts +2 -0
- package/dist/components/flat-section-header/index.d.ts.map +1 -0
- package/dist/components/flat-section-header/index.js +2 -0
- package/dist/components/flat-section-header/index.js.map +1 -0
- package/dist/components/flat-text-button/flat-text-button.d.ts +165 -0
- package/dist/components/flat-text-button/flat-text-button.d.ts.map +1 -0
- package/dist/components/flat-text-button/flat-text-button.js +325 -0
- package/dist/components/flat-text-button/flat-text-button.js.map +1 -0
- package/dist/components/flat-text-button/flat-text-button.spec.d.ts +2 -0
- package/dist/components/flat-text-button/flat-text-button.spec.d.ts.map +1 -0
- package/dist/components/flat-text-button/flat-text-button.spec.js +243 -0
- package/dist/components/flat-text-button/flat-text-button.spec.js.map +1 -0
- package/dist/components/flat-text-button/index.d.ts +2 -0
- package/dist/components/flat-text-button/index.d.ts.map +1 -0
- package/dist/components/flat-text-button/index.js +2 -0
- package/dist/components/flat-text-button/index.js.map +1 -0
- package/dist/components/icon-button/icon-button.d.ts +11 -3
- package/dist/components/icon-button/icon-button.d.ts.map +1 -1
- package/dist/components/icon-button/icon-button.js +124 -70
- package/dist/components/icon-button/icon-button.js.map +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +4 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/panel/panel.d.ts +0 -1
- package/dist/components/panel/panel.d.ts.map +1 -1
- package/dist/components/panel/panel.js +7 -10
- package/dist/components/panel/panel.js.map +1 -1
- package/dist/components/section-header/section-header.d.ts +33 -39
- package/dist/components/section-header/section-header.d.ts.map +1 -1
- package/dist/components/section-header/section-header.js +124 -155
- package/dist/components/section-header/section-header.js.map +1 -1
- package/dist/components/section-header/section-header.spec.js +57 -17
- package/dist/components/section-header/section-header.spec.js.map +1 -1
- package/dist/components/text/index.d.ts +2 -0
- package/dist/components/text/index.d.ts.map +1 -0
- package/dist/components/text/index.js +2 -0
- package/dist/components/text/index.js.map +1 -0
- package/dist/components/text/text.d.ts +45 -0
- package/dist/components/text/text.d.ts.map +1 -0
- package/dist/components/text/text.js +35 -0
- package/dist/components/text/text.js.map +1 -0
- package/dist/components/text-button/text-button.d.ts +26 -23
- package/dist/components/text-button/text-button.d.ts.map +1 -1
- package/dist/components/text-button/text-button.js +114 -88
- package/dist/components/text-button/text-button.js.map +1 -1
- package/dist/components/text-button/text-button.spec.js +98 -8
- package/dist/components/text-button/text-button.spec.js.map +1 -1
- package/dist/hudini.js +4166 -460
- package/dist/hudini.min.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/loaders/index.d.ts +2 -0
- package/dist/loaders/index.d.ts.map +1 -0
- package/dist/loaders/index.js +2 -0
- package/dist/loaders/index.js.map +1 -0
- package/dist/loaders/load-fonts.d.ts +8 -0
- package/dist/loaders/load-fonts.d.ts.map +1 -0
- package/dist/loaders/load-fonts.js +41 -0
- package/dist/loaders/load-fonts.js.map +1 -0
- package/dist/test-setup.js +8 -2
- package/dist/test-setup.js.map +1 -1
- package/dist/utils/color-variants.d.ts +38 -0
- package/dist/utils/color-variants.d.ts.map +1 -0
- package/dist/utils/color-variants.js +59 -0
- package/dist/utils/color-variants.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { GameObjects, Scene } from 'phaser';
|
|
2
|
+
import { type ColorKey, type FontKey, type FontSizeKey, type RadiusKey, type SpacingKey } from 'phaser-wind';
|
|
3
|
+
import { ContainerInteractive } from '../container-interactive';
|
|
4
|
+
/**
|
|
5
|
+
* Parameters for creating a FlatTextButton.
|
|
6
|
+
*/
|
|
7
|
+
export type FlatTextButtonParams = {
|
|
8
|
+
/** Phaser scene where the button will be added. */
|
|
9
|
+
scene: Scene;
|
|
10
|
+
/** X position of the button. */
|
|
11
|
+
x: number;
|
|
12
|
+
/** Y position of the button. */
|
|
13
|
+
y: number;
|
|
14
|
+
/** Button text. */
|
|
15
|
+
text: string;
|
|
16
|
+
/**
|
|
17
|
+
* Font size in px (number) or a Phaser Wind font size token (string).
|
|
18
|
+
* Defaults to 'lg'.
|
|
19
|
+
*/
|
|
20
|
+
fontSize?: FontSizeKey | number;
|
|
21
|
+
/**
|
|
22
|
+
* Font family. Defaults to 'Bebas Neue'.
|
|
23
|
+
*/
|
|
24
|
+
font?: FontKey | string;
|
|
25
|
+
/**
|
|
26
|
+
* Background color. Defaults to 'blue'.
|
|
27
|
+
*/
|
|
28
|
+
color?: ColorKey | string;
|
|
29
|
+
/**
|
|
30
|
+
* Text color. Defaults to 'white'.
|
|
31
|
+
*/
|
|
32
|
+
textColor?: ColorKey | string;
|
|
33
|
+
/**
|
|
34
|
+
* Border radius in px (number) or a Phaser Wind radius token (string).
|
|
35
|
+
* Defaults to 'md'.
|
|
36
|
+
*/
|
|
37
|
+
borderRadius?: RadiusKey | number;
|
|
38
|
+
/**
|
|
39
|
+
* Padding in px (number) or a Phaser Wind spacing token (string).
|
|
40
|
+
* Defaults to '4'.
|
|
41
|
+
*/
|
|
42
|
+
padding?: SpacingKey | number;
|
|
43
|
+
/**
|
|
44
|
+
* Callback function for click event.
|
|
45
|
+
*/
|
|
46
|
+
onClick?: () => void;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* A customizable flat text button component for Phaser, supporting auto-sizing,
|
|
50
|
+
* design tokens, and interactive effects.
|
|
51
|
+
*/
|
|
52
|
+
export declare class FlatTextButton extends ContainerInteractive<Phaser.GameObjects.Sprite> {
|
|
53
|
+
/** The background sprite of the button. */
|
|
54
|
+
backgroundSprite: GameObjects.Sprite;
|
|
55
|
+
/** The white border sprite of the button. */
|
|
56
|
+
whiteBorderSprite: GameObjects.Sprite;
|
|
57
|
+
/** The text object of the button. */
|
|
58
|
+
buttonText: GameObjects.Text;
|
|
59
|
+
private pw;
|
|
60
|
+
private fontSizePx;
|
|
61
|
+
private paddingPx;
|
|
62
|
+
private borderRadiusPx;
|
|
63
|
+
private colorButton;
|
|
64
|
+
private textColorValue;
|
|
65
|
+
private fontFamily;
|
|
66
|
+
private textValue;
|
|
67
|
+
/**
|
|
68
|
+
* Creates a new FlatTextButton instance.
|
|
69
|
+
* @param params FlatTextButtonParams
|
|
70
|
+
*/
|
|
71
|
+
constructor({ scene, x, y, text, fontSize, font, color, textColor, borderRadius, padding, onClick, }: FlatTextButtonParams);
|
|
72
|
+
/**
|
|
73
|
+
* Sets the button text.
|
|
74
|
+
* @param text The new text.
|
|
75
|
+
* @returns This FlatTextButton instance.
|
|
76
|
+
*/
|
|
77
|
+
setText(text: string): this;
|
|
78
|
+
/**
|
|
79
|
+
* Sets the font size.
|
|
80
|
+
* @param fontSize Font size in px or token.
|
|
81
|
+
* @returns This FlatTextButton instance.
|
|
82
|
+
*/
|
|
83
|
+
setFontSize(fontSize: FontSizeKey | number): this;
|
|
84
|
+
/**
|
|
85
|
+
* Sets the font family.
|
|
86
|
+
* @param font Font family as string or token.
|
|
87
|
+
* @returns This FlatTextButton instance.
|
|
88
|
+
*/
|
|
89
|
+
setFont(font: FontKey | string): this;
|
|
90
|
+
/**
|
|
91
|
+
* Sets the background color.
|
|
92
|
+
* @param color Color as token or CSS string.
|
|
93
|
+
* @returns This FlatTextButton instance.
|
|
94
|
+
*/
|
|
95
|
+
setColor(color: ColorKey | string): this;
|
|
96
|
+
/**
|
|
97
|
+
* Sets the text color.
|
|
98
|
+
* @param color Color as token or CSS string.
|
|
99
|
+
* @returns This FlatTextButton instance.
|
|
100
|
+
*/
|
|
101
|
+
setTextColor(color: ColorKey | string): this;
|
|
102
|
+
/**
|
|
103
|
+
* Sets the border radius.
|
|
104
|
+
* @param borderRadius Border radius in px or token.
|
|
105
|
+
* @returns This FlatTextButton instance.
|
|
106
|
+
*/
|
|
107
|
+
setBorderRadius(borderRadius: RadiusKey | number): this;
|
|
108
|
+
/**
|
|
109
|
+
* Sets the padding.
|
|
110
|
+
* @param padding Padding in px or token.
|
|
111
|
+
* @returns This FlatTextButton instance.
|
|
112
|
+
*/
|
|
113
|
+
setPadding(padding: SpacingKey | number): this;
|
|
114
|
+
/**
|
|
115
|
+
* Creates the button text GameObject.
|
|
116
|
+
* @param scene Phaser scene.
|
|
117
|
+
*/
|
|
118
|
+
private createButtonText;
|
|
119
|
+
/**
|
|
120
|
+
* Creates the white border sprite for the button.
|
|
121
|
+
* @param scene Phaser scene.
|
|
122
|
+
*/
|
|
123
|
+
private createWhiteBorderSprite;
|
|
124
|
+
/**
|
|
125
|
+
* Creates the background sprite for the button.
|
|
126
|
+
* @param scene Phaser scene.
|
|
127
|
+
*/
|
|
128
|
+
private createBackgroundSprite;
|
|
129
|
+
/**
|
|
130
|
+
* Regenerates the background texture based on current state.
|
|
131
|
+
*/
|
|
132
|
+
private regenerateSprites;
|
|
133
|
+
/**
|
|
134
|
+
* Calculates the button's width and height based on text and padding.
|
|
135
|
+
* @returns Object with width and height.
|
|
136
|
+
*/
|
|
137
|
+
private getButtonDimensions;
|
|
138
|
+
/**
|
|
139
|
+
* Creates a texture for the button's white border.
|
|
140
|
+
* @param scene Phaser scene.
|
|
141
|
+
* @returns The texture key.
|
|
142
|
+
*/
|
|
143
|
+
private createWhiteBorderTexture;
|
|
144
|
+
/**
|
|
145
|
+
* Creates a texture for the button's background.
|
|
146
|
+
* @param scene Phaser scene.
|
|
147
|
+
* @returns The texture key.
|
|
148
|
+
*/
|
|
149
|
+
private createBackgroundTexture;
|
|
150
|
+
/**
|
|
151
|
+
* Adds the button's visual elements to the container.
|
|
152
|
+
*/
|
|
153
|
+
private setupContainer;
|
|
154
|
+
/**
|
|
155
|
+
* Sets up interactivity for the button, including hover and click effects.
|
|
156
|
+
* @param onClick Optional click callback.
|
|
157
|
+
*/
|
|
158
|
+
private setupInteractivity;
|
|
159
|
+
/**
|
|
160
|
+
* Gets the interactive sprite of the icon button
|
|
161
|
+
* @returns The interactive sprite
|
|
162
|
+
*/
|
|
163
|
+
get interactive(): Pick<GameObjects.Sprite, 'on' | 'off' | 'setInteractive' | 'setInteractive' | 'once'>;
|
|
164
|
+
}
|
|
165
|
+
//# sourceMappingURL=flat-text-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flat-text-button.d.ts","sourceRoot":"","sources":["../../../src/components/flat-text-button/flat-text-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,UAAU,EAChB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGhE;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,mDAAmD;IACnD,KAAK,EAAE,KAAK,CAAC;IACb,gCAAgC;IAChC,CAAC,EAAE,MAAM,CAAC;IACV,gCAAgC;IAChC,CAAC,EAAE,MAAM,CAAC;IACV,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,QAAQ,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC;IAChC;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC9B;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAClC;;;OAGG;IACH,OAAO,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;IAC9B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAgBF;;;GAGG;AACH,qBAAa,cAAe,SAAQ,oBAAoB,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BAAuB;IAM/B;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAM9B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAYzB;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAO3B;;;;OAIG;IACH,OAAO,CAAC,wBAAwB;IAmChC;;;;OAIG;IACH,OAAO,CAAC,uBAAuB;IA6B/B;;OAEG;IACH,OAAO,CAAC,cAAc;IAItB;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAgD1B;;;OAGG;IACH,IAAW,WAAW,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,GAAG,KAAK,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,MAAM,CAAC,CAQ9G;CACF"}
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
import { Color, } from 'phaser-wind';
|
|
2
|
+
import { getPWFromScene } from '../../utils/get-pw-from-scene';
|
|
3
|
+
import { ContainerInteractive } from '../container-interactive';
|
|
4
|
+
import { Text } from '../text';
|
|
5
|
+
const durations = {
|
|
6
|
+
click: 60,
|
|
7
|
+
hover: 100,
|
|
8
|
+
};
|
|
9
|
+
const HOVER_SCALE = 1.05;
|
|
10
|
+
const POINTER_DOWN_SCALE = 0.95;
|
|
11
|
+
// Border constants
|
|
12
|
+
const BLACK_BORDER_THICKNESS = 2;
|
|
13
|
+
const WHITE_BORDER_EXTRA_PIXELS_PER_SIDE = 2;
|
|
14
|
+
const WHITE_BORDER_TOTAL_EXTRA_PIXELS = WHITE_BORDER_EXTRA_PIXELS_PER_SIDE * 2; // 4 pixels total
|
|
15
|
+
const WHITE_BORDER_RADIUS_EXTRA = 2;
|
|
16
|
+
/**
|
|
17
|
+
* A customizable flat text button component for Phaser, supporting auto-sizing,
|
|
18
|
+
* design tokens, and interactive effects.
|
|
19
|
+
*/
|
|
20
|
+
export class FlatTextButton extends ContainerInteractive {
|
|
21
|
+
/** The background sprite of the button. */
|
|
22
|
+
backgroundSprite;
|
|
23
|
+
/** The white border sprite of the button. */
|
|
24
|
+
whiteBorderSprite;
|
|
25
|
+
/** The text object of the button. */
|
|
26
|
+
buttonText;
|
|
27
|
+
pw;
|
|
28
|
+
fontSizePx;
|
|
29
|
+
paddingPx;
|
|
30
|
+
borderRadiusPx;
|
|
31
|
+
colorButton;
|
|
32
|
+
textColorValue;
|
|
33
|
+
fontFamily;
|
|
34
|
+
textValue;
|
|
35
|
+
/**
|
|
36
|
+
* Creates a new FlatTextButton instance.
|
|
37
|
+
* @param params FlatTextButtonParams
|
|
38
|
+
*/
|
|
39
|
+
constructor({ scene, x, y, text, fontSize = 'lg', font, color = 'blue', textColor = 'white', borderRadius = 'md', padding = '4', onClick, }) {
|
|
40
|
+
super({ scene, x, y });
|
|
41
|
+
this.pw = getPWFromScene(scene);
|
|
42
|
+
// Store values
|
|
43
|
+
this.textValue = text;
|
|
44
|
+
this.fontSizePx =
|
|
45
|
+
typeof fontSize === 'number'
|
|
46
|
+
? fontSize
|
|
47
|
+
: this.pw.fontSize.px(fontSize ?? 'md');
|
|
48
|
+
this.paddingPx =
|
|
49
|
+
typeof padding === 'number'
|
|
50
|
+
? padding
|
|
51
|
+
: this.pw.spacing.px(padding ?? '4');
|
|
52
|
+
this.borderRadiusPx =
|
|
53
|
+
typeof borderRadius === 'number'
|
|
54
|
+
? borderRadius
|
|
55
|
+
: this.pw.radius.px(borderRadius ?? 'md');
|
|
56
|
+
this.colorButton = Color.rgb(color);
|
|
57
|
+
this.textColorValue = Color.rgb(textColor);
|
|
58
|
+
this.fontFamily = font ? (typeof font === 'string' ? font : this.pw.font.family(font)) : 'Bebas Neue';
|
|
59
|
+
this.createButtonText(scene);
|
|
60
|
+
this.createWhiteBorderSprite(scene);
|
|
61
|
+
this.createBackgroundSprite(scene);
|
|
62
|
+
this.setupContainer();
|
|
63
|
+
this.setupInteractivity(onClick);
|
|
64
|
+
this.hitArea = this.backgroundSprite;
|
|
65
|
+
}
|
|
66
|
+
// API Methods
|
|
67
|
+
/**
|
|
68
|
+
* Sets the button text.
|
|
69
|
+
* @param text The new text.
|
|
70
|
+
* @returns This FlatTextButton instance.
|
|
71
|
+
*/
|
|
72
|
+
setText(text) {
|
|
73
|
+
this.textValue = text;
|
|
74
|
+
this.buttonText.setText(text);
|
|
75
|
+
this.regenerateSprites();
|
|
76
|
+
return this;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Sets the font size.
|
|
80
|
+
* @param fontSize Font size in px or token.
|
|
81
|
+
* @returns This FlatTextButton instance.
|
|
82
|
+
*/
|
|
83
|
+
setFontSize(fontSize) {
|
|
84
|
+
this.fontSizePx =
|
|
85
|
+
typeof fontSize === 'number'
|
|
86
|
+
? fontSize
|
|
87
|
+
: this.pw.fontSize.px(fontSize ?? 'md');
|
|
88
|
+
this.buttonText.setFontSize(this.fontSizePx);
|
|
89
|
+
this.regenerateSprites();
|
|
90
|
+
return this;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Sets the font family.
|
|
94
|
+
* @param font Font family as string or token.
|
|
95
|
+
* @returns This FlatTextButton instance.
|
|
96
|
+
*/
|
|
97
|
+
setFont(font) {
|
|
98
|
+
this.fontFamily =
|
|
99
|
+
typeof font === 'string'
|
|
100
|
+
? font
|
|
101
|
+
: this.pw.font.family(font ?? 'primary');
|
|
102
|
+
this.buttonText.setFontFamily(this.fontFamily);
|
|
103
|
+
this.regenerateSprites();
|
|
104
|
+
return this;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Sets the background color.
|
|
108
|
+
* @param color Color as token or CSS string.
|
|
109
|
+
* @returns This FlatTextButton instance.
|
|
110
|
+
*/
|
|
111
|
+
setColor(color) {
|
|
112
|
+
this.colorButton = Color.rgb(color);
|
|
113
|
+
this.regenerateSprites();
|
|
114
|
+
return this;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Sets the text color.
|
|
118
|
+
* @param color Color as token or CSS string.
|
|
119
|
+
* @returns This FlatTextButton instance.
|
|
120
|
+
*/
|
|
121
|
+
setTextColor(color) {
|
|
122
|
+
this.textColorValue = Color.rgb(color);
|
|
123
|
+
this.buttonText.setColor(this.textColorValue);
|
|
124
|
+
return this;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Sets the border radius.
|
|
128
|
+
* @param borderRadius Border radius in px or token.
|
|
129
|
+
* @returns This FlatTextButton instance.
|
|
130
|
+
*/
|
|
131
|
+
setBorderRadius(borderRadius) {
|
|
132
|
+
this.borderRadiusPx =
|
|
133
|
+
typeof borderRadius === 'number'
|
|
134
|
+
? borderRadius
|
|
135
|
+
: this.pw.radius.px(borderRadius ?? 'md');
|
|
136
|
+
this.regenerateSprites();
|
|
137
|
+
return this;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Sets the padding.
|
|
141
|
+
* @param padding Padding in px or token.
|
|
142
|
+
* @returns This FlatTextButton instance.
|
|
143
|
+
*/
|
|
144
|
+
setPadding(padding) {
|
|
145
|
+
this.paddingPx =
|
|
146
|
+
typeof padding === 'number'
|
|
147
|
+
? padding
|
|
148
|
+
: this.pw.spacing.px(padding ?? '4');
|
|
149
|
+
this.regenerateSprites();
|
|
150
|
+
return this;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Creates the button text GameObject.
|
|
154
|
+
* @param scene Phaser scene.
|
|
155
|
+
*/
|
|
156
|
+
createButtonText(scene) {
|
|
157
|
+
this.buttonText = new Text({
|
|
158
|
+
scene,
|
|
159
|
+
x: 0,
|
|
160
|
+
y: 0,
|
|
161
|
+
text: this.textValue,
|
|
162
|
+
size: this.fontSizePx,
|
|
163
|
+
fontFamily: this.fontFamily,
|
|
164
|
+
});
|
|
165
|
+
this.buttonText.setOrigin(0.5, 0.5);
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Creates the white border sprite for the button.
|
|
169
|
+
* @param scene Phaser scene.
|
|
170
|
+
*/
|
|
171
|
+
createWhiteBorderSprite(scene) {
|
|
172
|
+
const whiteBorderTexture = this.createWhiteBorderTexture(scene);
|
|
173
|
+
this.whiteBorderSprite = scene.add.sprite(0, 0, whiteBorderTexture);
|
|
174
|
+
this.whiteBorderSprite.setOrigin(0.5, 0.5);
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Creates the background sprite for the button.
|
|
178
|
+
* @param scene Phaser scene.
|
|
179
|
+
*/
|
|
180
|
+
createBackgroundSprite(scene) {
|
|
181
|
+
const backgroundTexture = this.createBackgroundTexture(scene);
|
|
182
|
+
this.backgroundSprite = scene.add.sprite(0, 0, backgroundTexture);
|
|
183
|
+
this.backgroundSprite.setOrigin(0.5, 0.5);
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Regenerates the background texture based on current state.
|
|
187
|
+
*/
|
|
188
|
+
regenerateSprites() {
|
|
189
|
+
// Update text bounds after text/font changes
|
|
190
|
+
this.buttonText.setText(this.textValue);
|
|
191
|
+
// Regenerate textures
|
|
192
|
+
const whiteBorderTexture = this.createWhiteBorderTexture(this.scene);
|
|
193
|
+
const backgroundTexture = this.createBackgroundTexture(this.scene);
|
|
194
|
+
this.whiteBorderSprite.setTexture(whiteBorderTexture);
|
|
195
|
+
this.backgroundSprite.setTexture(backgroundTexture);
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Calculates the button's width and height based on text and padding.
|
|
199
|
+
* @returns Object with width and height.
|
|
200
|
+
*/
|
|
201
|
+
getButtonDimensions() {
|
|
202
|
+
const textBounds = this.buttonText.getBounds();
|
|
203
|
+
const width = textBounds.width + this.paddingPx * 2;
|
|
204
|
+
const height = textBounds.height + this.paddingPx * 2;
|
|
205
|
+
return { width, height };
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Creates a texture for the button's white border.
|
|
209
|
+
* @param scene Phaser scene.
|
|
210
|
+
* @returns The texture key.
|
|
211
|
+
*/
|
|
212
|
+
createWhiteBorderTexture(scene) {
|
|
213
|
+
const { width, height } = this.getButtonDimensions();
|
|
214
|
+
const textureKey = `flatTextButton_whiteBorder_${this.borderRadiusPx}_${width}_${height}`;
|
|
215
|
+
// White border is larger on each side
|
|
216
|
+
const borderWidth = width + WHITE_BORDER_TOTAL_EXTRA_PIXELS;
|
|
217
|
+
const borderHeight = height + WHITE_BORDER_TOTAL_EXTRA_PIXELS;
|
|
218
|
+
// Add some padding for texture
|
|
219
|
+
const padding = 8;
|
|
220
|
+
const textureWidth = borderWidth + padding * 2;
|
|
221
|
+
const textureHeight = borderHeight + padding * 2;
|
|
222
|
+
const graphics = scene.add.graphics();
|
|
223
|
+
const maxRadius = Math.floor(Math.min(borderWidth / 2, borderHeight / 2));
|
|
224
|
+
const effectiveRadius = Math.min(this.borderRadiusPx + WHITE_BORDER_RADIUS_EXTRA, maxRadius);
|
|
225
|
+
const finalRadius = Math.max(0, effectiveRadius);
|
|
226
|
+
// White border (outer)
|
|
227
|
+
graphics.fillStyle(Color.hex('white'), 1);
|
|
228
|
+
graphics.fillRoundedRect(padding, padding, borderWidth, borderHeight, finalRadius);
|
|
229
|
+
graphics.generateTexture(textureKey, textureWidth, textureHeight);
|
|
230
|
+
graphics.destroy();
|
|
231
|
+
return textureKey;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Creates a texture for the button's background.
|
|
235
|
+
* @param scene Phaser scene.
|
|
236
|
+
* @returns The texture key.
|
|
237
|
+
*/
|
|
238
|
+
createBackgroundTexture(scene) {
|
|
239
|
+
const { width, height } = this.getButtonDimensions();
|
|
240
|
+
const textureKey = `flatTextButton_bg_${this.colorButton}_${this.borderRadiusPx}_${width}_${height}`;
|
|
241
|
+
// Add some padding for texture
|
|
242
|
+
const padding = 8;
|
|
243
|
+
const textureWidth = width + padding * 2;
|
|
244
|
+
const textureHeight = height + padding * 2;
|
|
245
|
+
const graphics = scene.add.graphics();
|
|
246
|
+
const maxRadius = Math.floor(Math.min(width / 2, height / 2));
|
|
247
|
+
const effectiveRadius = Math.min(this.borderRadiusPx, maxRadius);
|
|
248
|
+
const finalRadius = Math.max(0, effectiveRadius);
|
|
249
|
+
// Main background (flat, no gradient overlays)
|
|
250
|
+
graphics.fillStyle(Color.hex(this.colorButton), 1);
|
|
251
|
+
graphics.fillRoundedRect(padding, padding, width, height, finalRadius);
|
|
252
|
+
// Black stroke border
|
|
253
|
+
graphics.lineStyle(BLACK_BORDER_THICKNESS, Color.hex('black'), 1);
|
|
254
|
+
graphics.strokeRoundedRect(padding, padding, width, height, finalRadius);
|
|
255
|
+
graphics.generateTexture(textureKey, textureWidth, textureHeight);
|
|
256
|
+
graphics.destroy();
|
|
257
|
+
return textureKey;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Adds the button's visual elements to the container.
|
|
261
|
+
*/
|
|
262
|
+
setupContainer() {
|
|
263
|
+
this.add([this.whiteBorderSprite, this.backgroundSprite, this.buttonText]);
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Sets up interactivity for the button, including hover and click effects.
|
|
267
|
+
* @param onClick Optional click callback.
|
|
268
|
+
*/
|
|
269
|
+
setupInteractivity(onClick) {
|
|
270
|
+
this.backgroundSprite.setInteractive({ useHandCursor: true });
|
|
271
|
+
// Hover effects
|
|
272
|
+
this.backgroundSprite.on('pointerover', () => {
|
|
273
|
+
this.scene.tweens.add({
|
|
274
|
+
targets: this,
|
|
275
|
+
duration: durations.hover,
|
|
276
|
+
scaleX: HOVER_SCALE,
|
|
277
|
+
scaleY: HOVER_SCALE,
|
|
278
|
+
ease: 'Back.easeOut',
|
|
279
|
+
});
|
|
280
|
+
});
|
|
281
|
+
this.backgroundSprite.on('pointerout', () => {
|
|
282
|
+
this.scene.tweens.add({
|
|
283
|
+
targets: this,
|
|
284
|
+
duration: durations.hover,
|
|
285
|
+
scaleX: 1,
|
|
286
|
+
scaleY: 1,
|
|
287
|
+
ease: 'Back.easeOut',
|
|
288
|
+
});
|
|
289
|
+
});
|
|
290
|
+
// Click effects
|
|
291
|
+
this.backgroundSprite.on('pointerdown', () => {
|
|
292
|
+
this.scene.tweens.add({
|
|
293
|
+
targets: [this.whiteBorderSprite, this.backgroundSprite, this.buttonText],
|
|
294
|
+
scaleX: POINTER_DOWN_SCALE,
|
|
295
|
+
scaleY: POINTER_DOWN_SCALE,
|
|
296
|
+
duration: durations.click,
|
|
297
|
+
ease: 'Linear',
|
|
298
|
+
});
|
|
299
|
+
});
|
|
300
|
+
this.backgroundSprite.on('pointerup', () => {
|
|
301
|
+
this.scene.tweens.add({
|
|
302
|
+
targets: [this.whiteBorderSprite, this.backgroundSprite, this.buttonText],
|
|
303
|
+
scaleX: 1,
|
|
304
|
+
scaleY: 1,
|
|
305
|
+
duration: durations.click,
|
|
306
|
+
ease: 'Linear',
|
|
307
|
+
});
|
|
308
|
+
onClick?.();
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Gets the interactive sprite of the icon button
|
|
313
|
+
* @returns The interactive sprite
|
|
314
|
+
*/
|
|
315
|
+
get interactive() {
|
|
316
|
+
const { on, off, setInteractive, once } = this.backgroundSprite;
|
|
317
|
+
return {
|
|
318
|
+
on: on.bind(this.backgroundSprite),
|
|
319
|
+
off: off.bind(this.backgroundSprite),
|
|
320
|
+
setInteractive: setInteractive.bind(this.backgroundSprite),
|
|
321
|
+
once: once.bind(this.backgroundSprite),
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
//# sourceMappingURL=flat-text-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flat-text-button.js","sourceRoot":"","sources":["../../../src/components/flat-text-button/flat-text-button.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,GAON,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AA+C/B,MAAM,SAAS,GA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C;QACL,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;YACzC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC;gBACpB,OAAO,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,UAAU,CAAC;gBACzE,MAAM,EAAE,CAAC;gBACT,MAAM,EAAE,CAAC;gBACT,QAAQ,EAAE,SAAS,CAAC,KAAK;gBACzB,IAAI,EAAE,QAAQ;aACf,CAAC,CAAC;YACH,OAAO,EAAE,EAAE,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;IAGD;;;OAGG;IACH,IAAW,WAAW;QACpB,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAC;QAChE,OAAO;YACL,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC;YAClC,GAAG,EAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC;YACpC,cAAc,EAAE,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC;YAC1D,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC;SACvC,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flat-text-button.spec.d.ts","sourceRoot":"","sources":["../../../src/components/flat-text-button/flat-text-button.spec.ts"],"names":[],"mappings":""}
|