hudini 0.17.2 → 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.
Files changed (105) hide show
  1. package/dist/components/card/card.d.ts +34 -9
  2. package/dist/components/card/card.d.ts.map +1 -1
  3. package/dist/components/card/card.js +117 -49
  4. package/dist/components/card/card.js.map +1 -1
  5. package/dist/components/card/card.spec.js +28 -1
  6. package/dist/components/card/card.spec.js.map +1 -1
  7. package/dist/components/circular-progress/circular-progress.d.ts +4 -4
  8. package/dist/components/circular-progress/circular-progress.d.ts.map +1 -1
  9. package/dist/components/circular-progress/circular-progress.js +9 -8
  10. package/dist/components/circular-progress/circular-progress.js.map +1 -1
  11. package/dist/components/circular-progress/circular-progress.spec.js +4 -4
  12. package/dist/components/circular-progress/circular-progress.spec.js.map +1 -1
  13. package/dist/components/container-interactive/container-interactive.d.ts +65 -0
  14. package/dist/components/container-interactive/container-interactive.d.ts.map +1 -0
  15. package/dist/components/container-interactive/container-interactive.js +99 -0
  16. package/dist/components/container-interactive/container-interactive.js.map +1 -0
  17. package/dist/components/container-interactive/index.d.ts +2 -0
  18. package/dist/components/container-interactive/index.d.ts.map +1 -0
  19. package/dist/components/container-interactive/index.js +2 -0
  20. package/dist/components/container-interactive/index.js.map +1 -0
  21. package/dist/components/flat-icon-button/flat-icon-button.d.ts +3 -0
  22. package/dist/components/flat-icon-button/flat-icon-button.d.ts.map +1 -1
  23. package/dist/components/flat-icon-button/flat-icon-button.js +110 -19
  24. package/dist/components/flat-icon-button/flat-icon-button.js.map +1 -1
  25. package/dist/components/flat-section-header/flat-section-header.d.ts +143 -0
  26. package/dist/components/flat-section-header/flat-section-header.d.ts.map +1 -0
  27. package/dist/components/flat-section-header/flat-section-header.js +275 -0
  28. package/dist/components/flat-section-header/flat-section-header.js.map +1 -0
  29. package/dist/components/flat-section-header/flat-section-header.spec.d.ts +2 -0
  30. package/dist/components/flat-section-header/flat-section-header.spec.d.ts.map +1 -0
  31. package/dist/components/flat-section-header/flat-section-header.spec.js +255 -0
  32. package/dist/components/flat-section-header/flat-section-header.spec.js.map +1 -0
  33. package/dist/components/flat-section-header/index.d.ts +2 -0
  34. package/dist/components/flat-section-header/index.d.ts.map +1 -0
  35. package/dist/components/flat-section-header/index.js +2 -0
  36. package/dist/components/flat-section-header/index.js.map +1 -0
  37. package/dist/components/flat-text-button/flat-text-button.d.ts +165 -0
  38. package/dist/components/flat-text-button/flat-text-button.d.ts.map +1 -0
  39. package/dist/components/flat-text-button/flat-text-button.js +325 -0
  40. package/dist/components/flat-text-button/flat-text-button.js.map +1 -0
  41. package/dist/components/flat-text-button/flat-text-button.spec.d.ts +2 -0
  42. package/dist/components/flat-text-button/flat-text-button.spec.d.ts.map +1 -0
  43. package/dist/components/flat-text-button/flat-text-button.spec.js +243 -0
  44. package/dist/components/flat-text-button/flat-text-button.spec.js.map +1 -0
  45. package/dist/components/flat-text-button/index.d.ts +2 -0
  46. package/dist/components/flat-text-button/index.d.ts.map +1 -0
  47. package/dist/components/flat-text-button/index.js +2 -0
  48. package/dist/components/flat-text-button/index.js.map +1 -0
  49. package/dist/components/icon-button/icon-button.d.ts +11 -3
  50. package/dist/components/icon-button/icon-button.d.ts.map +1 -1
  51. package/dist/components/icon-button/icon-button.js +124 -70
  52. package/dist/components/icon-button/icon-button.js.map +1 -1
  53. package/dist/components/index.d.ts +4 -0
  54. package/dist/components/index.d.ts.map +1 -1
  55. package/dist/components/index.js +4 -0
  56. package/dist/components/index.js.map +1 -1
  57. package/dist/components/panel/panel.d.ts +0 -1
  58. package/dist/components/panel/panel.d.ts.map +1 -1
  59. package/dist/components/panel/panel.js +7 -10
  60. package/dist/components/panel/panel.js.map +1 -1
  61. package/dist/components/section-header/section-header.d.ts +33 -39
  62. package/dist/components/section-header/section-header.d.ts.map +1 -1
  63. package/dist/components/section-header/section-header.js +124 -155
  64. package/dist/components/section-header/section-header.js.map +1 -1
  65. package/dist/components/section-header/section-header.spec.js +57 -17
  66. package/dist/components/section-header/section-header.spec.js.map +1 -1
  67. package/dist/components/text/index.d.ts +2 -0
  68. package/dist/components/text/index.d.ts.map +1 -0
  69. package/dist/components/text/index.js +2 -0
  70. package/dist/components/text/index.js.map +1 -0
  71. package/dist/components/text/text.d.ts +45 -0
  72. package/dist/components/text/text.d.ts.map +1 -0
  73. package/dist/components/text/text.js +35 -0
  74. package/dist/components/text/text.js.map +1 -0
  75. package/dist/components/text-button/text-button.d.ts +26 -23
  76. package/dist/components/text-button/text-button.d.ts.map +1 -1
  77. package/dist/components/text-button/text-button.js +114 -88
  78. package/dist/components/text-button/text-button.js.map +1 -1
  79. package/dist/components/text-button/text-button.spec.js +98 -8
  80. package/dist/components/text-button/text-button.spec.js.map +1 -1
  81. package/dist/hudini.js +4166 -460
  82. package/dist/hudini.min.js +1 -1
  83. package/dist/index.d.ts +1 -0
  84. package/dist/index.d.ts.map +1 -1
  85. package/dist/index.js +1 -0
  86. package/dist/index.js.map +1 -1
  87. package/dist/loaders/index.d.ts +2 -0
  88. package/dist/loaders/index.d.ts.map +1 -0
  89. package/dist/loaders/index.js +2 -0
  90. package/dist/loaders/index.js.map +1 -0
  91. package/dist/loaders/load-fonts.d.ts +8 -0
  92. package/dist/loaders/load-fonts.d.ts.map +1 -0
  93. package/dist/loaders/load-fonts.js +41 -0
  94. package/dist/loaders/load-fonts.js.map +1 -0
  95. package/dist/test-setup.js +8 -2
  96. package/dist/test-setup.js.map +1 -1
  97. package/dist/utils/color-variants.d.ts +38 -0
  98. package/dist/utils/color-variants.d.ts.map +1 -0
  99. package/dist/utils/color-variants.js +59 -0
  100. package/dist/utils/color-variants.js.map +1 -0
  101. package/dist/utils/index.d.ts +1 -0
  102. package/dist/utils/index.d.ts.map +1 -1
  103. package/dist/utils/index.js +1 -0
  104. package/dist/utils/index.js.map +1 -1
  105. package/package.json +3 -3
@@ -0,0 +1,65 @@
1
+ import { GameObjects, Scene } from 'phaser';
2
+ /**
3
+ *
4
+ * @property {Scene} scene - The Phaser scene where this container will be added.
5
+ * @property {number} [x] - The X position of the container. Optional.
6
+ * @property {number} [y] - The Y position of the container. Optional.
7
+ *
8
+ * @remarks
9
+ * As the Phaser `Container` does not have its own size or support for pointer events,
10
+ * all interactivity (such as pointer events and hit testing) is delegated to the supplied `hitArea`,
11
+ * which must be declared and configured in the parent component. This pattern ensures that interactive
12
+ * behavior is associated with an explicit display object that can be sized and made interactive.
13
+ */
14
+ type ContainerInteractiveParams = {
15
+ scene: Scene;
16
+ x?: number;
17
+ y?: number;
18
+ };
19
+ /**
20
+ * An interactive Container for Phaser that extends `Phaser.GameObjects.Container`.
21
+ *
22
+ * @template HitArea The type of the hit area object (e.g., `Phaser.GameObjects.Rectangle`).
23
+ *
24
+ * @remarks
25
+ * The `Phaser.GameObjects.Container` does not inherently have a size or built-in pointer events.
26
+ * Therefore, all interactive functionality (e.g., pointer events like onPointerDown, onPointerUp, hit testing)
27
+ * must be managed via a `hitArea` object, which is supplied and configured by the parent component.
28
+ * This allows developers to define a custom hit area that determines how and where pointer interactivity
29
+ * occurs within the container.
30
+ */
31
+ export declare class ContainerInteractive<HitArea extends Phaser.GameObjects.GameObject = Phaser.GameObjects.Rectangle> extends GameObjects.Container {
32
+ /**
33
+ * The hit area used for managing interactive pointer events.
34
+ *
35
+ * @remarks
36
+ * As the container itself does not handle pointer events, all pointer event logic will be forwarded
37
+ * to this hit area, which should be a properly configured and interactive Phaser game object.
38
+ */
39
+ protected hitArea?: HitArea;
40
+ /**
41
+ * Creates a new ContainerInteractive instance.
42
+ *
43
+ * @param {ContainerInteractiveParams<HitArea>} params - Parameter object.
44
+ * @param {Scene} params.scene - The Phaser scene where the container will be added.
45
+ * @param {number} [params.x] - The X position of the container.
46
+ * @param {number} [params.y] - The Y position of the container.
47
+ * @param {HitArea} params.hitArea - The hit area object to manage all interactivity for this container.
48
+ *
49
+ * @remarks
50
+ * Since this container does not have its own size or interactivity, all event handling must be attached
51
+ * to the provided hit area.
52
+ */
53
+ constructor({ scene, x, y }: ContainerInteractiveParams);
54
+ on(event: string | symbol, fn: (...args: unknown[]) => void, context?: unknown): this;
55
+ off(event: string | symbol, fn?: (...args: unknown[]) => void, context?: unknown, once?: boolean): this;
56
+ once(event: string | symbol, fn: (...args: unknown[]) => void, context?: unknown): this;
57
+ setInteractive(hitArea?: Phaser.Types.Input.InputConfiguration | unknown, callback?: Phaser.Types.Input.HitAreaCallback, dropZone?: boolean): this;
58
+ setSize(width: number, height: number): this;
59
+ get width(): number;
60
+ get height(): number;
61
+ set width(width: number);
62
+ set height(height: number);
63
+ }
64
+ export {};
65
+ //# sourceMappingURL=container-interactive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container-interactive.d.ts","sourceRoot":"","sources":["../../../src/components/container-interactive/container-interactive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE5C;;;;;;;;;;;GAWG;AACH,KAAK,0BAA0B,GAAG;IAChC,KAAK,EAAE,KAAK,CAAC;IACb,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;CACZ,CAAA;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,oBAAoB,CAAC,OAAO,SAAS,MAAM,CAAC,WAAW,CAAC,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC,SAAS,CAAE,SAAQ,WAAW,CAAC,SAAS;IAC3I;;;;;;OAMG;IACH,SAAS,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAE5B;;;;;;;;;;;;OAYG;gBACS,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,0BAA0B;IAIvC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI;IAQrF,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI;IAQvG,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI;IAQvF,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,kBAAkB,GAAG,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,eAAe,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,IAAI;IAQlJ,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAS5D,IAAoB,KAAK,IAAI,MAAM,CAKlC;IAGD,IAAoB,MAAM,IAAI,MAAM,CAKnC;IAED,IAAoB,KAAK,CAAC,KAAK,EAAE,MAAM,EAItC;IAED,IAAoB,MAAM,CAAC,MAAM,EAAE,MAAM,EAIxC;CACF"}
@@ -0,0 +1,99 @@
1
+ import { GameObjects } from 'phaser';
2
+ /**
3
+ * An interactive Container for Phaser that extends `Phaser.GameObjects.Container`.
4
+ *
5
+ * @template HitArea The type of the hit area object (e.g., `Phaser.GameObjects.Rectangle`).
6
+ *
7
+ * @remarks
8
+ * The `Phaser.GameObjects.Container` does not inherently have a size or built-in pointer events.
9
+ * Therefore, all interactive functionality (e.g., pointer events like onPointerDown, onPointerUp, hit testing)
10
+ * must be managed via a `hitArea` object, which is supplied and configured by the parent component.
11
+ * This allows developers to define a custom hit area that determines how and where pointer interactivity
12
+ * occurs within the container.
13
+ */
14
+ export class ContainerInteractive extends GameObjects.Container {
15
+ /**
16
+ * The hit area used for managing interactive pointer events.
17
+ *
18
+ * @remarks
19
+ * As the container itself does not handle pointer events, all pointer event logic will be forwarded
20
+ * to this hit area, which should be a properly configured and interactive Phaser game object.
21
+ */
22
+ hitArea;
23
+ /**
24
+ * Creates a new ContainerInteractive instance.
25
+ *
26
+ * @param {ContainerInteractiveParams<HitArea>} params - Parameter object.
27
+ * @param {Scene} params.scene - The Phaser scene where the container will be added.
28
+ * @param {number} [params.x] - The X position of the container.
29
+ * @param {number} [params.y] - The Y position of the container.
30
+ * @param {HitArea} params.hitArea - The hit area object to manage all interactivity for this container.
31
+ *
32
+ * @remarks
33
+ * Since this container does not have its own size or interactivity, all event handling must be attached
34
+ * to the provided hit area.
35
+ */
36
+ constructor({ scene, x, y }) {
37
+ super(scene, x, y);
38
+ }
39
+ on(event, fn, context) {
40
+ if (this.hitArea) {
41
+ this.hitArea.on(event, fn, context);
42
+ return this;
43
+ }
44
+ return super.on(event, fn, context);
45
+ }
46
+ off(event, fn, context, once) {
47
+ if (this.hitArea) {
48
+ this.hitArea.off(event, fn, context, once);
49
+ return this;
50
+ }
51
+ return super.off(event, fn, context, once);
52
+ }
53
+ once(event, fn, context) {
54
+ if (this.hitArea) {
55
+ this.hitArea.once(event, fn, context);
56
+ return this;
57
+ }
58
+ return super.once(event, fn, context);
59
+ }
60
+ setInteractive(hitArea, callback, dropZone) {
61
+ if (this.hitArea) {
62
+ this.hitArea.setInteractive(hitArea, callback, dropZone);
63
+ return this;
64
+ }
65
+ return super.setInteractive(hitArea, callback, dropZone);
66
+ }
67
+ setSize(width, height) {
68
+ if (this.hitArea && 'setSize' in this.hitArea) {
69
+ this.hitArea.setSize(width, height);
70
+ return this;
71
+ }
72
+ return super.setSize(width, height);
73
+ }
74
+ // @ts-expect-error - width is a property in Container, but we override it here
75
+ get width() {
76
+ if (this.hitArea && 'width' in this.hitArea) {
77
+ return this.hitArea.width;
78
+ }
79
+ return 0;
80
+ }
81
+ // @ts-expect-error - height is a property in Container, but we override it here
82
+ get height() {
83
+ if (this.hitArea && 'height' in this.hitArea) {
84
+ return this.hitArea.height;
85
+ }
86
+ return 0;
87
+ }
88
+ set width(width) {
89
+ if (this.hitArea && 'width' in this.hitArea) {
90
+ this.hitArea.width = width;
91
+ }
92
+ }
93
+ set height(height) {
94
+ if (this.hitArea && 'height' in this.hitArea) {
95
+ this.hitArea.height = height;
96
+ }
97
+ }
98
+ }
99
+ //# sourceMappingURL=container-interactive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container-interactive.js","sourceRoot":"","sources":["../../../src/components/container-interactive/container-interactive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAS,MAAM,QAAQ,CAAC;AAoB5C;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,oBAAmG,SAAQ,WAAW,CAAC,SAAS;IAC3I;;;;;;OAMG;IACO,OAAO,CAAW;IAE5B;;;;;;;;;;;;OAYG;IACH,YAAY,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAA8B;QACrD,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACrB,CAAC;IAEe,EAAE,CAAC,KAAsB,EAAE,EAAgC,EAAE,OAAiB;QAC5F,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YAChB,IAAI,CAAC,OAAyC,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;YACvE,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;IAEe,GAAG,CAAC,KAAsB,EAAE,EAAiC,EAAE,OAAiB,EAAE,IAAc;QAC9G,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YAChB,IAAI,CAAC,OAAyC,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;YAC9E,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,KAAK,CAAC,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,MAAM;QACxB,IAAI,IAAI,CAAC,OAAO,IAAI,QAAQ,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YAC7C,OAAQ,IAAI,CAAC,OAAyC,CAAC,MAAM,CAAC;QAChE,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC;IAED,IAAoB,KAAK,CAAC,KAAa;QACrC,IAAI,IAAI,CAAC,OAAO,IAAI,OAAO,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YAC3C,IAAI,CAAC,OAAwC,CAAC,KAAK,GAAG,KAAK,CAAC;QAC/D,CAAC;IACH,CAAC;IAED,IAAoB,MAAM,CAAC,MAAc;QACvC,IAAI,IAAI,CAAC,OAAO,IAAI,QAAQ,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YAC5C,IAAI,CAAC,OAAyC,CAAC,MAAM,GAAG,MAAM,CAAC;QAClE,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,2 @@
1
+ export * from './container-interactive';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/container-interactive/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './container-interactive';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/container-interactive/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"}
@@ -17,6 +17,7 @@ export type FlatIconButtonParams = {
17
17
  };
18
18
  export declare class FlatIconButton extends GameObjects.Container {
19
19
  backgroundSprite: GameObjects.Sprite;
20
+ whiteBorderSprite: GameObjects.Sprite;
20
21
  iconText: IconText;
21
22
  private pw;
22
23
  private baseSizePx;
@@ -36,8 +37,10 @@ export declare class FlatIconButton extends GameObjects.Container {
36
37
  }): this;
37
38
  setButtonSize(size: FontSizeKey | number): this;
38
39
  private updateSize;
40
+ private createWhiteBorderSprite;
39
41
  private createBackgroundSprite;
40
42
  private regenerateBackgroundTexture;
43
+ private createWhiteBorderTexture;
41
44
  private createBackgroundTexture;
42
45
  private createIconText;
43
46
  private setupContainer;
@@ -1 +1 @@
1
- {"version":3,"file":"flat-icon-button.d.ts","sourceRoot":"","sources":["../../../src/components/flat-icon-button/flat-icon-button.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,SAAS,EACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,WAAW,EAEjB,MAAM,aAAa,CAAC;AAIrB,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,KAAK,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,IAAI,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IACpC,SAAS,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAWF,qBAAa,cAAe,SAAQ,WAAW,CAAC,SAAS;IAChD,gBAAgB,EAAG,WAAW,CAAC,MAAM,CAAC;IACtC,QAAQ,EAAG,QAAQ,CAAC;IAC3B,OAAO,CAAC,EAAE,CAAuB;IAEjC,OAAO,CAAC,UAAU,CAAU;IAC5B,OAAO,CAAC,cAAc,CAAU;IAChC,OAAO,CAAC,oBAAoB,CAAU;IACt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} from 'phaser-wind';
4
5
  import { getPWFromScene } from '../../utils/get-pw-from-scene';
5
6
  const durations = {
6
- click: 100,
7
- hover: 150,
7
+ click: 60,
8
+ hover: 100,
8
9
  };
9
- const CLICK_OFFSET = 2;
10
10
  const BUTTON_SCALE = 2.2;
11
11
  const CENTER_OFFSET = 1.1;
12
+ const HOVER_SCALE = 1.05;
13
+ const POINTER_DOWN_SCALE = 0.95;
14
+ // Border constants
15
+ const BLACK_BORDER_THICKNESS = 2;
16
+ const WHITE_BORDER_EXTRA_PIXELS_PER_SIDE = 2;
17
+ const WHITE_BORDER_TOTAL_EXTRA_PIXELS = WHITE_BORDER_EXTRA_PIXELS_PER_SIDE * 2; // 4 pixels total
18
+ const WHITE_BORDER_RADIUS_EXTRA = 2;
19
+ // Icon constants
20
+ const ICON_STROKE_THICKNESS = 3;
21
+ const ICON_SHADOW_OFFSET_X = 0;
22
+ const ICON_SHADOW_OFFSET_Y = 3;
23
+ const ICON_SHADOW_BLUR = 0;
24
+ const ICON_OFFSET_Y = -1.5; // Half of shadow offset to keep visually centered
25
+ // Origin constants
26
+ const SPRITE_ORIGIN = 0.5;
12
27
  export class FlatIconButton extends GameObjects.Container {
13
28
  backgroundSprite;
29
+ whiteBorderSprite;
14
30
  iconText;
15
31
  pw;
16
32
  baseSizePx;
@@ -35,6 +51,7 @@ export class FlatIconButton extends GameObjects.Container {
35
51
  this.iconColorValue = Color.rgb(iconColor);
36
52
  this.backgroundOpacityValue = backgroundOpacity;
37
53
  this.iconOpacityValue = iconOpacity;
54
+ this.createWhiteBorderSprite(scene);
38
55
  this.createBackgroundSprite(scene);
39
56
  this.createIconText(scene, icon, iconStyle);
40
57
  this.setupContainer();
@@ -71,7 +88,12 @@ export class FlatIconButton extends GameObjects.Container {
71
88
  if (this.borderRadiusPx === newRadiusPx)
72
89
  return this;
73
90
  this.borderRadiusPx = newRadiusPx;
74
- this.regenerateBackgroundTexture();
91
+ // Regenerate textures for white border and background
92
+ const whiteBorderTexture = this.createWhiteBorderTexture(this.scene);
93
+ const backgroundTexture = this.createBackgroundTexture(this.scene);
94
+ this.whiteBorderSprite.setTexture(whiteBorderTexture);
95
+ this.backgroundSprite.setTexture(backgroundTexture);
96
+ this.backgroundSprite.setAlpha(this.backgroundOpacityValue);
75
97
  return this;
76
98
  }
77
99
  // API: icon
@@ -86,24 +108,54 @@ export class FlatIconButton extends GameObjects.Container {
86
108
  : this.pw.fontSize.px(size ?? 'md');
87
109
  this.iconText.setFontSize(`${this.baseSizePx}px`);
88
110
  this.updateSize();
89
- this.regenerateBackgroundTexture();
111
+ const whiteBorderTexture = this.createWhiteBorderTexture(this.scene);
112
+ const backgroundTexture = this.createBackgroundTexture(this.scene);
113
+ this.whiteBorderSprite.setTexture(whiteBorderTexture);
114
+ this.backgroundSprite.setTexture(backgroundTexture);
115
+ this.backgroundSprite.setAlpha(this.backgroundOpacityValue);
90
116
  return this;
91
117
  }
92
118
  updateSize() {
93
119
  this.width = this.baseSizePx * BUTTON_SCALE;
94
120
  this.height = this.baseSizePx * BUTTON_SCALE;
95
121
  }
122
+ createWhiteBorderSprite(scene) {
123
+ const whiteBorderTexture = this.createWhiteBorderTexture(scene);
124
+ this.whiteBorderSprite = scene.add.sprite(0, 0, whiteBorderTexture);
125
+ this.whiteBorderSprite.setOrigin(SPRITE_ORIGIN, SPRITE_ORIGIN);
126
+ }
96
127
  createBackgroundSprite(scene) {
97
128
  const textureKey = this.createBackgroundTexture(scene);
98
129
  this.backgroundSprite = scene.add.sprite(0, 0, textureKey);
99
- this.backgroundSprite.setOrigin(0.5, 0.5);
130
+ this.backgroundSprite.setOrigin(SPRITE_ORIGIN, SPRITE_ORIGIN);
100
131
  this.backgroundSprite.setAlpha(this.backgroundOpacityValue);
101
132
  }
102
133
  regenerateBackgroundTexture() {
103
- const textureKey = this.createBackgroundTexture(this.scene);
104
- this.backgroundSprite.setTexture(textureKey);
134
+ const whiteBorderTexture = this.createWhiteBorderTexture(this.scene);
135
+ const backgroundTexture = this.createBackgroundTexture(this.scene);
136
+ this.whiteBorderSprite.setTexture(whiteBorderTexture);
137
+ this.backgroundSprite.setTexture(backgroundTexture);
105
138
  this.backgroundSprite.setAlpha(this.backgroundOpacityValue);
106
139
  }
140
+ createWhiteBorderTexture(scene) {
141
+ const textureKey = `flatIconButton_whiteBorder_r${this.borderRadiusPx}_${this.baseSizePx}`;
142
+ // White border is larger on each side
143
+ const side = this.baseSizePx * 2 + WHITE_BORDER_TOTAL_EXTRA_PIXELS;
144
+ // Increase texture size to accommodate the larger border
145
+ const textureSize = this.baseSizePx * BUTTON_SCALE + WHITE_BORDER_TOTAL_EXTRA_PIXELS;
146
+ const centerX = textureSize / 2;
147
+ const centerY = textureSize / 2;
148
+ const graphics = scene.add.graphics();
149
+ const maxRadius = Math.floor(Math.min(side / 2, side / 2));
150
+ const effectiveRadius = Math.min(this.borderRadiusPx + WHITE_BORDER_RADIUS_EXTRA, maxRadius);
151
+ const finalRadius = Math.max(0, effectiveRadius);
152
+ // White border (outer)
153
+ graphics.fillStyle(Color.hex('white'), 1);
154
+ graphics.fillRoundedRect(centerX - side / 2, centerY - side / 2, side, side, finalRadius);
155
+ graphics.generateTexture(textureKey, textureSize, textureSize);
156
+ graphics.destroy();
157
+ return textureKey;
158
+ }
107
159
  createBackgroundTexture(scene) {
108
160
  const size = this.baseSizePx;
109
161
  const textureKey = `flatIconButton_${this.backgroundColorValue}_${this.borderRadiusPx}_${size}`;
@@ -111,47 +163,86 @@ export class FlatIconButton extends GameObjects.Container {
111
163
  const centerX = size * CENTER_OFFSET;
112
164
  const centerY = size * CENTER_OFFSET;
113
165
  const graphics = scene.add.graphics();
114
- graphics.fillStyle(Color.hex(this.backgroundColorValue), 1);
115
166
  const side = size * 2;
116
- const radius = Math.min(this.borderRadiusPx, side / 2);
117
- graphics.fillRoundedRect(centerX - side / 2, centerY - side / 2, side, side, radius);
167
+ const maxRadius = Math.floor(Math.min(side / 2, side / 2));
168
+ const effectiveRadius = Math.min(this.borderRadiusPx, maxRadius);
169
+ const finalRadius = Math.max(0, effectiveRadius);
170
+ // Main background (flat, no gradient overlays)
171
+ graphics.fillStyle(Color.hex(this.backgroundColorValue), 1);
172
+ graphics.fillRoundedRect(centerX - side / 2, centerY - side / 2, side, side, finalRadius);
173
+ // Black stroke border
174
+ graphics.lineStyle(BLACK_BORDER_THICKNESS, Color.hex('black'), 1);
175
+ graphics.strokeRoundedRect(centerX - side / 2, centerY - side / 2, side, side, finalRadius);
118
176
  graphics.generateTexture(textureKey, textureSize, textureSize);
119
177
  graphics.destroy();
120
178
  return textureKey;
121
179
  }
122
180
  createIconText(scene, icon, iconStyle) {
181
+ // Use black for stroke and shadow (same as IconButton behavior)
182
+ const darkColorString = Color.rgb('black');
123
183
  this.iconText = new IconText({
124
184
  scene,
125
185
  x: 0,
126
- y: 0,
186
+ y: ICON_OFFSET_Y,
127
187
  icon,
128
188
  size: this.baseSizePx,
129
189
  style: {
130
190
  color: this.iconColorValue,
131
- strokeThickness: 0,
191
+ strokeThickness: ICON_STROKE_THICKNESS,
192
+ stroke: darkColorString,
193
+ shadow: {
194
+ offsetX: ICON_SHADOW_OFFSET_X,
195
+ offsetY: ICON_SHADOW_OFFSET_Y,
196
+ color: darkColorString,
197
+ blur: ICON_SHADOW_BLUR,
198
+ stroke: true,
199
+ fill: true,
200
+ },
132
201
  },
133
202
  iconStyle,
134
203
  });
135
204
  this.iconText.setAlpha(this.iconOpacityValue);
136
- this.iconText.setOrigin(0.5, 0.5);
205
+ this.iconText.setOrigin(SPRITE_ORIGIN, SPRITE_ORIGIN);
137
206
  }
138
207
  setupContainer() {
139
- this.add([this.backgroundSprite, this.iconText]);
208
+ this.add([this.whiteBorderSprite, this.backgroundSprite, this.iconText]);
140
209
  }
141
210
  setupInteractivity(onClick) {
142
211
  this.backgroundSprite.setInteractive({ useHandCursor: true });
212
+ // Hover effects
213
+ this.backgroundSprite.on('pointerover', () => {
214
+ this.scene.tweens.add({
215
+ targets: this,
216
+ duration: durations.hover,
217
+ scaleX: HOVER_SCALE,
218
+ scaleY: HOVER_SCALE,
219
+ ease: 'Back.easeOut',
220
+ });
221
+ });
222
+ this.backgroundSprite.on('pointerout', () => {
223
+ this.scene.tweens.add({
224
+ targets: this,
225
+ duration: durations.hover,
226
+ scaleX: 1,
227
+ scaleY: 1,
228
+ ease: 'Back.easeOut',
229
+ });
230
+ });
231
+ // Click effects
143
232
  this.backgroundSprite.on('pointerdown', () => {
144
233
  this.scene.tweens.add({
145
- targets: [this.backgroundSprite, this.iconText],
146
- y: CLICK_OFFSET,
234
+ targets: [this.whiteBorderSprite, this.backgroundSprite, this.iconText],
235
+ scaleX: POINTER_DOWN_SCALE,
236
+ scaleY: POINTER_DOWN_SCALE,
147
237
  duration: durations.click,
148
238
  ease: 'Linear',
149
239
  });
150
240
  });
151
241
  this.backgroundSprite.on('pointerup', () => {
152
242
  this.scene.tweens.add({
153
- targets: [this.backgroundSprite, this.iconText],
154
- y: 0,
243
+ targets: [this.whiteBorderSprite, this.backgroundSprite, this.iconText],
244
+ scaleX: 1,
245
+ scaleY: 1,
155
246
  duration: durations.click,
156
247
  ease: 'Linear',
157
248
  });
@@ -1 +1 @@
1
- {"version":3,"file":"flat-icon-button.js","sourceRoot":"","sources":["../../../src/components/flat-icon-button/flat-icon-button.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,GAGT,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAS,MAAM,QAAQ,CAAC;AAC5C,OAAO,EACL,KAAK,GAKN,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAiB/D,MAAM,SAAS,GAAG;IAChB,KAAK,EAAE,GAAG;IACV,KAAK,EAAE,GAAG;CACX,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,CAAC;AACvB,MAAM,YAAY,GAAG,GAAG,CAAC;AACzB,MAAM,aAAa,GAAG,GAAG,CAAC;AAE1B,MAAM,OAAO,cAAe,SA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AC;QAED,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAC9B,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,EAClB,IAAI,CAAC,CAAC,GAAG,MAAM,GAAG,CAAC,EACnB,KAAK,EACL,MAAM,CACP,CAAC;IACJ,CAAC;CACF"}
1
+ {"version":3,"file":"flat-icon-button.js","sourceRoot":"","sources":["../../../src/components/flat-icon-button/flat-icon-button.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,OAAO,EACL,QAAQ,GAGT,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAS,MAAM,QAAQ,CAAC;AAC5C,OAAO,EACL,KAAK,GAKN,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAiB/D,MAAM,SAAS,GAAG;IAChB,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,GAAG;CACX,CAAC;AAEF,MAAM,YAAY,GAAG,GAAG,CAAC;AACzB,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,WAAW,GAAG,IAAI,CAAC;AACzB,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAEhC,mBAAmB;AACnB,MAAM,sBAAsB,GAAG,CAAC,CAAC;AACjC,MAAM,kCAAkC,GAAG,CAAC,CAAC;AAC7C,MAAM,+BAA+B,GAAG,kCAAkC,GAAG,CAAC,CAAC,CAAC,iBAAiB;AACjG,MAAM,yBAAyB,GAAG,CAAC,CAAC;AAEpC,iBAAiB;AACjB,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAChC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAC/B,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAC/B,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B,MAAM,aAAa,GAAG,CAAC,GAAG,CAAC,CAAC,kDAAkD;AAE9E,mBAAmB;AACnB,MAAM,aAAa,GAAG,GAAG,CAAC;AAE1B,MAAM,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C,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,GAAG,YAAY,CAAC;QAE9C,IAAI,MAAM,EAAE,CAAC;YACX,OAAO,MAAM,CAAC,KAAK,CACjB,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,EAClB,IAAI,CAAC,CAAC,GAAG,MAAM,GAAG,CAAC,EACnB,KAAK,EACL,MAAM,CACP,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAC9B,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,EAClB,IAAI,CAAC,CAAC,GAAG,MAAM,GAAG,CAAC,EACnB,KAAK,EACL,MAAM,CACP,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,143 @@
1
+ import { GameObjects, Scene } from 'phaser';
2
+ import { type ColorKey, type FontKey, type FontSizeKey, type RadiusKey, type SpacingKey } from 'phaser-wind';
3
+ export type FlatSectionHeaderParams = {
4
+ /** The Phaser scene to add the header to */
5
+ scene: Scene;
6
+ /** X position of the header */
7
+ x: number;
8
+ /** Y position of the header */
9
+ y: number;
10
+ /** Text content of the header */
11
+ text: string;
12
+ /** Font size in px (number) or a Phaser Wind font size token (string). Defaults to 'lg'. */
13
+ fontSize?: FontSizeKey | number;
14
+ /** Font family. Defaults to 'display'. */
15
+ font?: FontKey | string;
16
+ /** Background color. Defaults to 'blue-600'. */
17
+ backgroundColor?: ColorKey | string;
18
+ /** Text color. Defaults to 'white'. */
19
+ textColor?: ColorKey | string;
20
+ /** Border radius in px (number) or a Phaser Wind radius token (string). Defaults to 'md'. */
21
+ borderRadius?: RadiusKey | number;
22
+ /** Margin/padding in px (number) or a Phaser Wind spacing token (string). Defaults to '4'. */
23
+ margin?: SpacingKey | number;
24
+ };
25
+ /**
26
+ * A flat section header component without gradient overlays, with text stroke and auto-sizing
27
+ */
28
+ export declare class FlatSectionHeader extends GameObjects.Container {
29
+ /** The white border sprite of the header */
30
+ whiteBorderSprite: GameObjects.Sprite;
31
+ /** The background sprite of the header */
32
+ backgroundSprite: GameObjects.Sprite;
33
+ /** The text object of the header */
34
+ headerText: GameObjects.Text;
35
+ /** Reference to the PhaserWind plugin */
36
+ private pw;
37
+ /** Font size in pixels */
38
+ private fontSizePx;
39
+ /** Margin size in pixels */
40
+ private marginPx;
41
+ /** Border radius in pixels */
42
+ private borderRadiusPx;
43
+ /** Background color value */
44
+ private colorButton;
45
+ /** Text color value */
46
+ private textColorValue;
47
+ /** Font family value */
48
+ private fontFamily;
49
+ /** Text content value */
50
+ private textValue;
51
+ /**
52
+ * Creates a new FlatSectionHeader
53
+ * @param params Configuration parameters for the header
54
+ */
55
+ constructor({ scene, x, y, text, fontSize, font, backgroundColor, textColor, borderRadius, margin, }: FlatSectionHeaderParams);
56
+ /**
57
+ * Sets the text content of the header
58
+ * @param text New text content
59
+ * @returns this for chaining
60
+ */
61
+ setText(text: string): this;
62
+ /**
63
+ * Sets the font size of the header text
64
+ * @param fontSize New font size (number in px or FontSizeKey)
65
+ * @returns this for chaining
66
+ */
67
+ setFontSize(fontSize: FontSizeKey | number): this;
68
+ /**
69
+ * Sets the font family of the header text
70
+ * @param font New font family (FontKey or string)
71
+ * @returns this for chaining
72
+ */
73
+ setFont(font: FontKey | string): this;
74
+ /**
75
+ * Sets the background color of the header
76
+ * @param color New background color (ColorKey or string)
77
+ * @returns this for chaining
78
+ */
79
+ setBackgroundColor(color: ColorKey | string): this;
80
+ /**
81
+ * Sets the text color of the header
82
+ * @param color New text color (ColorKey or string)
83
+ * @returns this for chaining
84
+ */
85
+ setTextColor(color: ColorKey | string): this;
86
+ /**
87
+ * Sets the border radius of the header
88
+ * @param borderRadius New border radius (number in px or RadiusKey)
89
+ * @returns this for chaining
90
+ */
91
+ setBorderRadius(borderRadius: RadiusKey | number): this;
92
+ /**
93
+ * Sets the margin/padding of the header
94
+ * @param margin New margin size (number in px or SpacingKey)
95
+ * @returns this for chaining
96
+ */
97
+ setMargin(margin: SpacingKey | number): this;
98
+ /**
99
+ * Creates the header text game object
100
+ * @param scene The scene to add the text to
101
+ */
102
+ private createHeaderText;
103
+ /**
104
+ * Creates the white border sprite for the header
105
+ * @param scene The scene to add the sprite to
106
+ */
107
+ private createWhiteBorderSprite;
108
+ /**
109
+ * Creates the background sprite for the header
110
+ * @param scene The scene to add the sprite to
111
+ */
112
+ private createBackgroundSprite;
113
+ /**
114
+ * Regenerates all graphics after a property change
115
+ */
116
+ private regenerateGraphics;
117
+ /**
118
+ * Creates a texture for the header's white border.
119
+ * @param scene Phaser scene.
120
+ * @returns The texture key.
121
+ */
122
+ private createWhiteBorderTexture;
123
+ /**
124
+ * Creates a texture for the header's background.
125
+ * @param scene Phaser scene.
126
+ * @returns The texture key.
127
+ */
128
+ private createBackgroundTexture;
129
+ /**
130
+ * Gets the dimensions of the header based on text content
131
+ * @returns Object containing width and height
132
+ */
133
+ private getHeaderDimensions;
134
+ /**
135
+ * Sets up the container with all sprites in the correct order
136
+ */
137
+ private setupContainer;
138
+ /**
139
+ * Sets up interactivity for the header
140
+ */
141
+ private setupInteractivity;
142
+ }
143
+ //# sourceMappingURL=flat-section-header.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flat-section-header.d.ts","sourceRoot":"","sources":["../../../src/components/flat-section-header/flat-section-header.ts"],"names":[],"mappings":"AACA,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;AAKrB,MAAM,MAAM,uBAAuB,GAAG;IACpC,4CAA4C;IAC5C,KAAK,EAAE,KAAK,CAAC;IACb,+BAA+B;IAC/B,CAAC,EAAE,MAAM,CAAC;IACV,+BAA+B;IAC/B,CAAC,EAAE,MAAM,CAAC;IACV,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,4FAA4F;IAC5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