hudini 0.18.0 → 0.18.1
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.map +1 -1
- package/dist/components/card/card.js +2 -1
- package/dist/components/card/card.js.map +1 -1
- package/dist/components/flat-icon-button/flat-icon-button.js +3 -3
- package/dist/components/flat-section-header/flat-section-header.js +1 -1
- package/dist/components/flat-text-button/flat-text-button.d.ts.map +1 -1
- package/dist/components/flat-text-button/flat-text-button.js +3 -3
- package/dist/components/flat-text-button/flat-text-button.js.map +1 -1
- package/dist/components/icon-button/icon-button.d.ts.map +1 -1
- package/dist/components/icon-button/icon-button.js +3 -2
- package/dist/components/icon-button/icon-button.js.map +1 -1
- package/dist/components/text-button/text-button.d.ts.map +1 -1
- package/dist/components/text-button/text-button.js +3 -3
- package/dist/components/text-button/text-button.js.map +1 -1
- package/dist/components/text-button/text-button.spec.js +10 -1
- package/dist/components/text-button/text-button.spec.js.map +1 -1
- package/dist/hudini.js +87 -40
- package/dist/hudini.min.js +1 -1
- package/dist/utils/color-variants.d.ts +6 -1
- package/dist/utils/color-variants.d.ts.map +1 -1
- package/dist/utils/color-variants.js +18 -5
- package/dist/utils/color-variants.js.map +1 -1
- package/package.json +2 -2
package/dist/hudini.js
CHANGED
|
@@ -933,6 +933,19 @@
|
|
|
933
933
|
}
|
|
934
934
|
return null;
|
|
935
935
|
};
|
|
936
|
+
/**
|
|
937
|
+
* Normalizes a color by adding -500 if only color name is provided
|
|
938
|
+
* @param color - Color token or color name
|
|
939
|
+
* @returns Normalized color token
|
|
940
|
+
*/
|
|
941
|
+
const normalizeColorToken = (color) => {
|
|
942
|
+
if (typeof color === 'string' && !String(color).includes('-')) {
|
|
943
|
+
if (color in palette && color !== 'black' && color !== 'white') {
|
|
944
|
+
return `${color}-500`;
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
return color;
|
|
948
|
+
};
|
|
936
949
|
/**
|
|
937
950
|
* Get RGB string representation of a color
|
|
938
951
|
* @param color - Color token, theme color key or valid color string
|
|
@@ -949,25 +962,27 @@
|
|
|
949
962
|
if (colorFromTheme) {
|
|
950
963
|
return rgb(colorFromTheme);
|
|
951
964
|
}
|
|
952
|
-
|
|
965
|
+
// Normalize color: add -500 if only color name is provided
|
|
966
|
+
const normalizedColor = normalizeColorToken(color);
|
|
967
|
+
const parts = normalizedColor?.split('-') ?? [];
|
|
953
968
|
if (parts.length === 2) {
|
|
954
969
|
const colorKey = parts[0];
|
|
955
970
|
const shade = parts[1];
|
|
956
971
|
const colorValue = palette[colorKey]?.[shade];
|
|
957
972
|
if (!colorValue) {
|
|
958
|
-
if (isValidColor(
|
|
959
|
-
return
|
|
973
|
+
if (isValidColor(normalizedColor)) {
|
|
974
|
+
return normalizedColor;
|
|
960
975
|
}
|
|
961
976
|
throw new Error(`Color token "${colorKey}-${shade}" not found`);
|
|
962
977
|
}
|
|
963
978
|
return colorValue;
|
|
964
979
|
}
|
|
965
|
-
const colorValue = palette[
|
|
980
|
+
const colorValue = palette[normalizedColor];
|
|
966
981
|
if (!colorValue) {
|
|
967
|
-
if (isValidColor(
|
|
968
|
-
return
|
|
982
|
+
if (isValidColor(normalizedColor)) {
|
|
983
|
+
return normalizedColor;
|
|
969
984
|
}
|
|
970
|
-
throw new Error(`Color token "${
|
|
985
|
+
throw new Error(`Color token "${normalizedColor}" not found`);
|
|
971
986
|
}
|
|
972
987
|
return colorValue;
|
|
973
988
|
};
|
|
@@ -998,24 +1013,26 @@
|
|
|
998
1013
|
if (colorFromTheme) {
|
|
999
1014
|
return hex(colorFromTheme);
|
|
1000
1015
|
}
|
|
1001
|
-
|
|
1016
|
+
// Normalize color: add -500 if only color name is provided
|
|
1017
|
+
const normalizedColor = normalizeColorToken(color);
|
|
1018
|
+
const parts = normalizedColor?.split('-') ?? [];
|
|
1002
1019
|
if (parts.length === 2) {
|
|
1003
1020
|
const colorKey = parts[0];
|
|
1004
1021
|
const shade = parts[1];
|
|
1005
1022
|
const colorValue = palette[colorKey]?.[shade];
|
|
1006
1023
|
if (!colorValue) {
|
|
1007
|
-
if (isValidColor(
|
|
1008
|
-
return convertColorValueToNumber(
|
|
1024
|
+
if (isValidColor(normalizedColor)) {
|
|
1025
|
+
return convertColorValueToNumber(normalizedColor);
|
|
1009
1026
|
}
|
|
1010
1027
|
throw new Error(`Color token "${colorKey}-${shade}" not found`);
|
|
1011
1028
|
}
|
|
1012
1029
|
return convertColorValueToNumber(colorValue);
|
|
1013
1030
|
}
|
|
1014
|
-
const colorToConvert = palette[
|
|
1031
|
+
const colorToConvert = palette[normalizedColor];
|
|
1015
1032
|
if (isValidColor(colorToConvert)) {
|
|
1016
1033
|
return convertColorValueToNumber(colorToConvert);
|
|
1017
1034
|
}
|
|
1018
|
-
throw new Error(`Color token "${
|
|
1035
|
+
throw new Error(`Color token "${normalizedColor}" not found`);
|
|
1019
1036
|
};
|
|
1020
1037
|
const api = {
|
|
1021
1038
|
rgb,
|
|
@@ -1685,7 +1702,8 @@
|
|
|
1685
1702
|
// Border constants
|
|
1686
1703
|
var BLACK_BORDER_THICKNESS$b = 2;
|
|
1687
1704
|
var WHITE_BORDER_EXTRA_PIXELS_PER_SIDE$b = 2;
|
|
1688
|
-
|
|
1705
|
+
// eslint-disable-next-line no-magic-numbers
|
|
1706
|
+
var WHITE_BORDER_TOTAL_EXTRA_PIXELS$b = WHITE_BORDER_EXTRA_PIXELS_PER_SIDE$b * 3; // 6 pixels total
|
|
1689
1707
|
var WHITE_BORDER_RADIUS_EXTRA$b = 2;
|
|
1690
1708
|
/**
|
|
1691
1709
|
* A flexible card component that adapts to its child content size
|
|
@@ -4220,8 +4238,8 @@
|
|
|
4220
4238
|
var POINTER_DOWN_SCALE$5 = 0.95;
|
|
4221
4239
|
// Border constants
|
|
4222
4240
|
var BLACK_BORDER_THICKNESS$a = 2;
|
|
4223
|
-
var WHITE_BORDER_EXTRA_PIXELS_PER_SIDE$a =
|
|
4224
|
-
var WHITE_BORDER_TOTAL_EXTRA_PIXELS$a = WHITE_BORDER_EXTRA_PIXELS_PER_SIDE$a * 2; //
|
|
4241
|
+
var WHITE_BORDER_EXTRA_PIXELS_PER_SIDE$a = 3;
|
|
4242
|
+
var WHITE_BORDER_TOTAL_EXTRA_PIXELS$a = WHITE_BORDER_EXTRA_PIXELS_PER_SIDE$a * 2; // 6 pixels total
|
|
4225
4243
|
var WHITE_BORDER_RADIUS_EXTRA$a = 2;
|
|
4226
4244
|
// Icon constants
|
|
4227
4245
|
var ICON_STROKE_THICKNESS$3 = 3;
|
|
@@ -4234,7 +4252,7 @@
|
|
|
4234
4252
|
var FlatIconButton$1 = /** @class */ (function (_super) {
|
|
4235
4253
|
__extends(FlatIconButton, _super);
|
|
4236
4254
|
function FlatIconButton(_a) {
|
|
4237
|
-
var scene = _a.scene, x = _a.x, y = _a.y, icon = _a.icon, _b = _a.iconStyle, iconStyle = _b === void 0 ? 'solid' : _b, size = _a.size, _c = _a.backgroundColor, backgroundColor = _c === void 0 ? '
|
|
4255
|
+
var scene = _a.scene, x = _a.x, y = _a.y, icon = _a.icon, _b = _a.iconStyle, iconStyle = _b === void 0 ? 'solid' : _b, size = _a.size, _c = _a.backgroundColor, backgroundColor = _c === void 0 ? 'blue-500' : _c, _d = _a.iconColor, iconColor = _d === void 0 ? 'white' : _d, onClick = _a.onClick, _e = _a.borderRadius, borderRadius = _e === void 0 ? 'md' : _e, _f = _a.backgroundOpacity, backgroundOpacity = _f === void 0 ? 1 : _f, _g = _a.iconOpacity, iconOpacity = _g === void 0 ? 1 : _g;
|
|
4238
4256
|
var _this = _super.call(this, scene, x, y) || this;
|
|
4239
4257
|
_this.backgroundOpacityValue = 1;
|
|
4240
4258
|
_this.iconOpacityValue = 1;
|
|
@@ -4590,7 +4608,8 @@
|
|
|
4590
4608
|
// Border constants
|
|
4591
4609
|
const BLACK_BORDER_THICKNESS$9 = 2;
|
|
4592
4610
|
const WHITE_BORDER_EXTRA_PIXELS_PER_SIDE$9 = 2;
|
|
4593
|
-
|
|
4611
|
+
// eslint-disable-next-line no-magic-numbers
|
|
4612
|
+
const WHITE_BORDER_TOTAL_EXTRA_PIXELS$9 = WHITE_BORDER_EXTRA_PIXELS_PER_SIDE$9 * 3; // 6 pixels total
|
|
4594
4613
|
const WHITE_BORDER_RADIUS_EXTRA$9 = 2;
|
|
4595
4614
|
/**
|
|
4596
4615
|
* A flexible card component that adapts to its child content size
|
|
@@ -5085,8 +5104,8 @@
|
|
|
5085
5104
|
const POINTER_DOWN_SCALE$4 = 0.95;
|
|
5086
5105
|
// Border constants
|
|
5087
5106
|
const BLACK_BORDER_THICKNESS$8 = 2;
|
|
5088
|
-
const WHITE_BORDER_EXTRA_PIXELS_PER_SIDE$8 =
|
|
5089
|
-
const WHITE_BORDER_TOTAL_EXTRA_PIXELS$8 = WHITE_BORDER_EXTRA_PIXELS_PER_SIDE$8 * 2; //
|
|
5107
|
+
const WHITE_BORDER_EXTRA_PIXELS_PER_SIDE$8 = 3;
|
|
5108
|
+
const WHITE_BORDER_TOTAL_EXTRA_PIXELS$8 = WHITE_BORDER_EXTRA_PIXELS_PER_SIDE$8 * 2; // 6 pixels total
|
|
5090
5109
|
const WHITE_BORDER_RADIUS_EXTRA$8 = 2;
|
|
5091
5110
|
// Icon constants
|
|
5092
5111
|
const ICON_STROKE_THICKNESS$2 = 3;
|
|
@@ -5107,7 +5126,7 @@
|
|
|
5107
5126
|
iconColorValue; // rgb string
|
|
5108
5127
|
backgroundOpacityValue = 1;
|
|
5109
5128
|
iconOpacityValue = 1;
|
|
5110
|
-
constructor({ scene, x, y, icon, iconStyle = 'solid', size, backgroundColor = '
|
|
5129
|
+
constructor({ scene, x, y, icon, iconStyle = 'solid', size, backgroundColor = 'blue-500', iconColor = 'white', onClick, borderRadius = 'md', backgroundOpacity = 1, iconOpacity = 1, }) {
|
|
5111
5130
|
super(scene, x, y);
|
|
5112
5131
|
this.pw = getPWFromScene(scene);
|
|
5113
5132
|
this.baseSizePx =
|
|
@@ -5386,7 +5405,7 @@
|
|
|
5386
5405
|
/**
|
|
5387
5406
|
* Calculates a color variant by adjusting brightness.
|
|
5388
5407
|
*
|
|
5389
|
-
* @param color - The base color (can be a Phaser Wind token like "blue-500" or a CSS color like "#3B82F6")
|
|
5408
|
+
* @param color - The base color (can be a Phaser Wind token like "blue-500", a color name like "red", or a CSS color like "#3B82F6")
|
|
5390
5409
|
* @param tokenDiff - Amount to adjust the shade for color tokens. Positive values make it darker, negative lighter.
|
|
5391
5410
|
* For example: -400 for lighter (blue-500 → blue-100), +400 for darker (blue-500 → blue-900)
|
|
5392
5411
|
* @param colorDiff - Amount to lighten/darken CSS colors. Positive values lighten, negative values darken.
|
|
@@ -5394,6 +5413,7 @@
|
|
|
5394
5413
|
* @returns The adjusted color as a number
|
|
5395
5414
|
*
|
|
5396
5415
|
* @remarks
|
|
5416
|
+
* - If only a color name is provided without a shade (e.g., "red"), it automatically adds "-500" as the default shade
|
|
5397
5417
|
* - If a color token is provided (e.g., "blue-500"), it uses the token system to calculate variants
|
|
5398
5418
|
* by adjusting the shade value with tokenDiff (clamped between 100-900)
|
|
5399
5419
|
* - If a CSS color is provided (hex or rgb), it uses Phaser's lighten/darken methods
|
|
@@ -5401,6 +5421,10 @@
|
|
|
5401
5421
|
*
|
|
5402
5422
|
* @example
|
|
5403
5423
|
* ```typescript
|
|
5424
|
+
* // Using color name only - defaults to -500
|
|
5425
|
+
* const defaultRed = getColorVariant('red', 0, 0);
|
|
5426
|
+
* // Returns red-500 color value
|
|
5427
|
+
*
|
|
5404
5428
|
* // Using color token - lighter variant
|
|
5405
5429
|
* const lightBlue = getColorVariant('blue-500', -400, 0);
|
|
5406
5430
|
* // Returns blue-100 color value
|
|
@@ -5419,10 +5443,18 @@
|
|
|
5419
5443
|
* ```
|
|
5420
5444
|
*/
|
|
5421
5445
|
const getColorVariant$1 = (color, tokenDiff, colorDiff) => {
|
|
5422
|
-
|
|
5423
|
-
|
|
5446
|
+
// If only the color name is provided (without shade), validate and add -500 as default
|
|
5447
|
+
let normalizedColor = color;
|
|
5448
|
+
if (typeof color === 'string' && !color.includes('-') && !Color.isValidColorToken(color)) {
|
|
5449
|
+
// Check if the color exists in the palette
|
|
5450
|
+
if (color in palette && color !== 'black' && color !== 'white') {
|
|
5451
|
+
normalizedColor = `${color}-500`;
|
|
5452
|
+
}
|
|
5453
|
+
}
|
|
5454
|
+
const colorRgb = Color.rgb(normalizedColor);
|
|
5455
|
+
if (Color.isValidColorToken(normalizedColor)) {
|
|
5424
5456
|
// Token-based calculation
|
|
5425
|
-
const parts =
|
|
5457
|
+
const parts = normalizedColor.split('-');
|
|
5426
5458
|
const colorShade = parseInt(parts[1].toString(), 10);
|
|
5427
5459
|
const shadeMin = 100;
|
|
5428
5460
|
const shadeMax = 900;
|
|
@@ -5455,7 +5487,8 @@
|
|
|
5455
5487
|
// Border constants
|
|
5456
5488
|
const BLACK_BORDER_THICKNESS$7 = 2;
|
|
5457
5489
|
const WHITE_BORDER_EXTRA_PIXELS_PER_SIDE$7 = 2;
|
|
5458
|
-
|
|
5490
|
+
// eslint-disable-next-line no-magic-numbers
|
|
5491
|
+
const WHITE_BORDER_TOTAL_EXTRA_PIXELS$7 = WHITE_BORDER_EXTRA_PIXELS_PER_SIDE$7 * 3; // 5 pixels total
|
|
5459
5492
|
const WHITE_BORDER_RADIUS_EXTRA$7 = 2;
|
|
5460
5493
|
// Overlay constants
|
|
5461
5494
|
const LIGHT_OVERLAY_SCALE$1 = 0.6;
|
|
@@ -5484,7 +5517,7 @@
|
|
|
5484
5517
|
const sizePx = typeof size === 'number'
|
|
5485
5518
|
? size
|
|
5486
5519
|
: this.pw.fontSize.px(size ?? 'md');
|
|
5487
|
-
const baseColor = color ?? '
|
|
5520
|
+
const baseColor = color ?? 'blue-500';
|
|
5488
5521
|
this.sizePx = sizePx;
|
|
5489
5522
|
this.updateSize();
|
|
5490
5523
|
this.baseColor = baseColor;
|
|
@@ -6694,7 +6727,7 @@
|
|
|
6694
6727
|
// Border constants
|
|
6695
6728
|
const BLACK_BORDER_THICKNESS$5 = 2;
|
|
6696
6729
|
const WHITE_BORDER_EXTRA_PIXELS_PER_SIDE$5 = 2;
|
|
6697
|
-
const WHITE_BORDER_TOTAL_EXTRA_PIXELS$5 = WHITE_BORDER_EXTRA_PIXELS_PER_SIDE$5 *
|
|
6730
|
+
const WHITE_BORDER_TOTAL_EXTRA_PIXELS$5 = WHITE_BORDER_EXTRA_PIXELS_PER_SIDE$5 * 3; // 6 pixels total
|
|
6698
6731
|
const WHITE_BORDER_RADIUS_EXTRA$5 = 2;
|
|
6699
6732
|
/**
|
|
6700
6733
|
* A flat section header component without gradient overlays, with text stroke and auto-sizing
|
|
@@ -7122,8 +7155,8 @@
|
|
|
7122
7155
|
var POINTER_DOWN_SCALE$2 = 0.95;
|
|
7123
7156
|
// Border constants
|
|
7124
7157
|
var BLACK_BORDER_THICKNESS$4 = 2;
|
|
7125
|
-
var WHITE_BORDER_EXTRA_PIXELS_PER_SIDE$4 =
|
|
7126
|
-
var WHITE_BORDER_TOTAL_EXTRA_PIXELS$4 = WHITE_BORDER_EXTRA_PIXELS_PER_SIDE$4 * 2; //
|
|
7158
|
+
var WHITE_BORDER_EXTRA_PIXELS_PER_SIDE$4 = 3;
|
|
7159
|
+
var WHITE_BORDER_TOTAL_EXTRA_PIXELS$4 = WHITE_BORDER_EXTRA_PIXELS_PER_SIDE$4 * 2; // 6 pixels total
|
|
7127
7160
|
var WHITE_BORDER_RADIUS_EXTRA$4 = 2;
|
|
7128
7161
|
/**
|
|
7129
7162
|
* A customizable flat text button component for Phaser, supporting auto-sizing,
|
|
@@ -7136,7 +7169,7 @@
|
|
|
7136
7169
|
* @param params FlatTextButtonParams
|
|
7137
7170
|
*/
|
|
7138
7171
|
function FlatTextButton(_a) {
|
|
7139
|
-
var scene = _a.scene, x = _a.x, y = _a.y, text = _a.text, _b = _a.fontSize, fontSize = _b === void 0 ? 'lg' : _b, font = _a.font, _c = _a.color, color = _c === void 0 ? 'blue' : _c, _d = _a.textColor, textColor = _d === void 0 ? 'white' : _d, _e = _a.borderRadius, borderRadius = _e === void 0 ? 'md' : _e, _f = _a.padding, padding = _f === void 0 ? '4' : _f, onClick = _a.onClick;
|
|
7172
|
+
var scene = _a.scene, x = _a.x, y = _a.y, text = _a.text, _b = _a.fontSize, fontSize = _b === void 0 ? 'lg' : _b, font = _a.font, _c = _a.color, color = _c === void 0 ? 'blue-500' : _c, _d = _a.textColor, textColor = _d === void 0 ? 'white' : _d, _e = _a.borderRadius, borderRadius = _e === void 0 ? 'md' : _e, _f = _a.padding, padding = _f === void 0 ? '4' : _f, onClick = _a.onClick;
|
|
7140
7173
|
var _this = _super.call(this, { scene: scene, x: x, y: y }) || this;
|
|
7141
7174
|
_this.pw = getPWFromScene$1(scene);
|
|
7142
7175
|
// Store values
|
|
@@ -7433,7 +7466,7 @@
|
|
|
7433
7466
|
/**
|
|
7434
7467
|
* Calculates a color variant by adjusting brightness.
|
|
7435
7468
|
*
|
|
7436
|
-
* @param color - The base color (can be a Phaser Wind token like "blue-500" or a CSS color like "#3B82F6")
|
|
7469
|
+
* @param color - The base color (can be a Phaser Wind token like "blue-500", a color name like "red", or a CSS color like "#3B82F6")
|
|
7437
7470
|
* @param tokenDiff - Amount to adjust the shade for color tokens. Positive values make it darker, negative lighter.
|
|
7438
7471
|
* For example: -400 for lighter (blue-500 → blue-100), +400 for darker (blue-500 → blue-900)
|
|
7439
7472
|
* @param colorDiff - Amount to lighten/darken CSS colors. Positive values lighten, negative values darken.
|
|
@@ -7441,6 +7474,7 @@
|
|
|
7441
7474
|
* @returns The adjusted color as a number
|
|
7442
7475
|
*
|
|
7443
7476
|
* @remarks
|
|
7477
|
+
* - If only a color name is provided without a shade (e.g., "red"), it automatically adds "-500" as the default shade
|
|
7444
7478
|
* - If a color token is provided (e.g., "blue-500"), it uses the token system to calculate variants
|
|
7445
7479
|
* by adjusting the shade value with tokenDiff (clamped between 100-900)
|
|
7446
7480
|
* - If a CSS color is provided (hex or rgb), it uses Phaser's lighten/darken methods
|
|
@@ -7448,6 +7482,10 @@
|
|
|
7448
7482
|
*
|
|
7449
7483
|
* @example
|
|
7450
7484
|
* ```typescript
|
|
7485
|
+
* // Using color name only - defaults to -500
|
|
7486
|
+
* const defaultRed = getColorVariant('red', 0, 0);
|
|
7487
|
+
* // Returns red-500 color value
|
|
7488
|
+
*
|
|
7451
7489
|
* // Using color token - lighter variant
|
|
7452
7490
|
* const lightBlue = getColorVariant('blue-500', -400, 0);
|
|
7453
7491
|
* // Returns blue-100 color value
|
|
@@ -7466,10 +7504,18 @@
|
|
|
7466
7504
|
* ```
|
|
7467
7505
|
*/
|
|
7468
7506
|
var getColorVariant = function (color, tokenDiff, colorDiff) {
|
|
7469
|
-
|
|
7470
|
-
|
|
7507
|
+
// If only the color name is provided (without shade), validate and add -500 as default
|
|
7508
|
+
var normalizedColor = color;
|
|
7509
|
+
if (typeof color === 'string' && !color.includes('-') && !Color.isValidColorToken(color)) {
|
|
7510
|
+
// Check if the color exists in the palette
|
|
7511
|
+
if (color in palette && color !== 'black' && color !== 'white') {
|
|
7512
|
+
normalizedColor = "".concat(color, "-500");
|
|
7513
|
+
}
|
|
7514
|
+
}
|
|
7515
|
+
var colorRgb = Color.rgb(normalizedColor);
|
|
7516
|
+
if (Color.isValidColorToken(normalizedColor)) {
|
|
7471
7517
|
// Token-based calculation
|
|
7472
|
-
var parts =
|
|
7518
|
+
var parts = normalizedColor.split('-');
|
|
7473
7519
|
var colorShade = parseInt(parts[1].toString(), 10);
|
|
7474
7520
|
var shadeMin = 100;
|
|
7475
7521
|
var shadeMax = 900;
|
|
@@ -7500,7 +7546,8 @@
|
|
|
7500
7546
|
// Border constants
|
|
7501
7547
|
var BLACK_BORDER_THICKNESS$3 = 2;
|
|
7502
7548
|
var WHITE_BORDER_EXTRA_PIXELS_PER_SIDE$3 = 2;
|
|
7503
|
-
|
|
7549
|
+
// eslint-disable-next-line no-magic-numbers
|
|
7550
|
+
var WHITE_BORDER_TOTAL_EXTRA_PIXELS$3 = WHITE_BORDER_EXTRA_PIXELS_PER_SIDE$3 * 3; // 5 pixels total
|
|
7504
7551
|
var WHITE_BORDER_RADIUS_EXTRA$3 = 2;
|
|
7505
7552
|
// Overlay constants
|
|
7506
7553
|
var LIGHT_OVERLAY_SCALE = 0.6;
|
|
@@ -7521,7 +7568,7 @@
|
|
|
7521
7568
|
var sizePx = typeof size === 'number'
|
|
7522
7569
|
? size
|
|
7523
7570
|
: _this.pw.fontSize.px(size !== null && size !== void 0 ? size : 'md');
|
|
7524
|
-
var baseColor = color !== null && color !== void 0 ? color : '
|
|
7571
|
+
var baseColor = color !== null && color !== void 0 ? color : 'blue-500';
|
|
7525
7572
|
_this.sizePx = sizePx;
|
|
7526
7573
|
_this.updateSize();
|
|
7527
7574
|
_this.baseColor = baseColor;
|
|
@@ -8701,7 +8748,7 @@
|
|
|
8701
8748
|
// Border constants
|
|
8702
8749
|
var BLACK_BORDER_THICKNESS$1 = 2;
|
|
8703
8750
|
var WHITE_BORDER_EXTRA_PIXELS_PER_SIDE$1 = 2;
|
|
8704
|
-
var WHITE_BORDER_TOTAL_EXTRA_PIXELS$1 = WHITE_BORDER_EXTRA_PIXELS_PER_SIDE$1 *
|
|
8751
|
+
var WHITE_BORDER_TOTAL_EXTRA_PIXELS$1 = WHITE_BORDER_EXTRA_PIXELS_PER_SIDE$1 * 3; // 6 pixels total
|
|
8705
8752
|
var WHITE_BORDER_RADIUS_EXTRA$1 = 2;
|
|
8706
8753
|
/**
|
|
8707
8754
|
* A flat section header component without gradient overlays, with text stroke and auto-sizing
|
|
@@ -9016,8 +9063,8 @@
|
|
|
9016
9063
|
var COLOR_DARKER_AMOUNT = -30;
|
|
9017
9064
|
// Border constants
|
|
9018
9065
|
var BLACK_BORDER_THICKNESS = 2;
|
|
9019
|
-
var WHITE_BORDER_EXTRA_PIXELS_PER_SIDE =
|
|
9020
|
-
var WHITE_BORDER_TOTAL_EXTRA_PIXELS = WHITE_BORDER_EXTRA_PIXELS_PER_SIDE * 2; //
|
|
9066
|
+
var WHITE_BORDER_EXTRA_PIXELS_PER_SIDE = 3;
|
|
9067
|
+
var WHITE_BORDER_TOTAL_EXTRA_PIXELS = WHITE_BORDER_EXTRA_PIXELS_PER_SIDE * 2; // 6 pixels total
|
|
9021
9068
|
var WHITE_BORDER_RADIUS_EXTRA = 2;
|
|
9022
9069
|
/**
|
|
9023
9070
|
* A customizable text button component for Phaser, supporting auto-sizing,
|
|
@@ -9030,7 +9077,7 @@
|
|
|
9030
9077
|
* @param params TextButtonParams
|
|
9031
9078
|
*/
|
|
9032
9079
|
function TextButton(_a) {
|
|
9033
|
-
var scene = _a.scene, x = _a.x, y = _a.y, text = _a.text, _b = _a.fontSize, fontSize = _b === void 0 ? 'lg' : _b, font = _a.font, _c = _a.color, color = _c === void 0 ? 'blue' : _c, _d = _a.textColor, textColor = _d === void 0 ? 'white' : _d, _e = _a.borderRadius, borderRadius = _e === void 0 ? 'md' : _e, _f = _a.padding, padding = _f === void 0 ? '4' : _f, onClick = _a.onClick;
|
|
9080
|
+
var scene = _a.scene, x = _a.x, y = _a.y, text = _a.text, _b = _a.fontSize, fontSize = _b === void 0 ? 'lg' : _b, font = _a.font, _c = _a.color, color = _c === void 0 ? 'blue-500' : _c, _d = _a.textColor, textColor = _d === void 0 ? 'white' : _d, _e = _a.borderRadius, borderRadius = _e === void 0 ? 'md' : _e, _f = _a.padding, padding = _f === void 0 ? '4' : _f, onClick = _a.onClick;
|
|
9034
9081
|
var _this = _super.call(this, { scene: scene, x: x, y: y }) || this;
|
|
9035
9082
|
_this.pw = getPWFromScene$1(scene);
|
|
9036
9083
|
// Store values
|