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
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
export * from './card';
|
|
2
2
|
export * from './circular-progress';
|
|
3
|
+
export * from './container-interactive';
|
|
3
4
|
export * from './flat-icon-button';
|
|
5
|
+
export * from './flat-text-button';
|
|
4
6
|
export * from './icon-button';
|
|
5
7
|
export * from './linear-progress';
|
|
6
8
|
export * from './panel';
|
|
7
9
|
export * from './radial-progress';
|
|
8
10
|
export * from './section-header';
|
|
11
|
+
export * from './flat-section-header';
|
|
9
12
|
export * from './sized-box';
|
|
13
|
+
export * from './text';
|
|
10
14
|
export * from './text-button';
|
|
11
15
|
export { Column, Row } from 'phaser-wind';
|
|
12
16
|
export type { ColumnParams, HorizontalAlign, RowParams, VerticalAlign } from 'phaser-wind';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAG9B,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAC1C,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAG9B,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAC1C,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/components/index.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
export * from './card';
|
|
2
2
|
export * from './circular-progress';
|
|
3
|
+
export * from './container-interactive';
|
|
3
4
|
export * from './flat-icon-button';
|
|
5
|
+
export * from './flat-text-button';
|
|
4
6
|
export * from './icon-button';
|
|
5
7
|
export * from './linear-progress';
|
|
6
8
|
export * from './panel';
|
|
7
9
|
export * from './radial-progress';
|
|
8
10
|
export * from './section-header';
|
|
11
|
+
export * from './flat-section-header';
|
|
9
12
|
export * from './sized-box';
|
|
13
|
+
export * from './text';
|
|
10
14
|
export * from './text-button';
|
|
11
15
|
// Re-export Row and Column from phaser-wind
|
|
12
16
|
export { Column, Row } from 'phaser-wind';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAE9B,4CAA4C;AAC5C,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAE9B,4CAA4C;AAC5C,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panel.d.ts","sourceRoot":"","sources":["../../../src/components/panel/panel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE5C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"panel.d.ts","sourceRoot":"","sources":["../../../src/components/panel/panel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE5C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AASlD,MAAM,MAAM,WAAW,GAAG;IACtB,KAAK,EAAE,KAAK,CAAC;IACb,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,EAAE,WAAW,CAAC,UAAU,CAAC;CACjC,CAAC;AAEF,qBAAa,KAAM,SAAQ,WAAW,CAAC,SAAS;IAC5C,OAAO,CAAC,IAAI,CAAO;IACnB,OAAO,CAAC,aAAa,CAA8B;IACnD,OAAO,CAAC,WAAW,CAA+B;IAClD,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,eAAe,CAAU;IACjC,OAAO,CAAC,OAAO,CAAC,CAA2B;gBAE/B,MAAM,EAAE,WAAW;IAmC/B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAc3B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAkBzB;;OAEG;IACH,OAAO,CAAC,YAAY;IAmBpB;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAgB7B;;OAEG;IACH,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;IAcvC;;OAEG;IACH,UAAU,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IAKtC;;OAEG;IACH,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAQvC;;OAEG;IACH,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAMrC;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAM/B;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,UAAU,GAAG,IAAI;IAM7C;;OAEG;IACH,OAAO,IAAI,IAAI;IAIf;;OAEG;IACH,gBAAgB,IAAI,aAAa,GAAG,IAAI;IAIxC;;OAEG;IACH,cAAc,IAAI,cAAc,GAAG,IAAI;CAG1C"}
|
|
@@ -6,8 +6,7 @@ import { SectionHeader } from '../section-header';
|
|
|
6
6
|
const DEFAULT_BORDER_RADIUS = 8;
|
|
7
7
|
const DEFAULT_MARGIN = 16;
|
|
8
8
|
const DEFAULT_BACKGROUND_COLOR = 'red-500';
|
|
9
|
-
const
|
|
10
|
-
const CLOSE_BUTTON_SIZE = 32;
|
|
9
|
+
const CLOSE_BUTTON_SIZE = 18;
|
|
11
10
|
const CLOSE_BUTTON_MARGIN = 8;
|
|
12
11
|
export class Panel extends GameObjects.Container {
|
|
13
12
|
card;
|
|
@@ -16,13 +15,11 @@ export class Panel extends GameObjects.Container {
|
|
|
16
15
|
title;
|
|
17
16
|
showCloseButton;
|
|
18
17
|
onClose;
|
|
19
|
-
headerHeight;
|
|
20
18
|
constructor(params) {
|
|
21
19
|
super(params.scene, params.x ?? 0, params.y ?? 0);
|
|
22
20
|
this.title = params.title ?? '';
|
|
23
21
|
this.showCloseButton = params.showCloseButton ?? false;
|
|
24
22
|
this.onClose = params.onClose;
|
|
25
|
-
this.headerHeight = DEFAULT_HEADER_HEIGHT;
|
|
26
23
|
// Create the card first
|
|
27
24
|
this.card = new Card({
|
|
28
25
|
scene: params.scene,
|
|
@@ -84,18 +81,18 @@ export class Panel extends GameObjects.Container {
|
|
|
84
81
|
* Updates the layout after property changes
|
|
85
82
|
*/
|
|
86
83
|
updateLayout() {
|
|
87
|
-
// Get card
|
|
88
|
-
const
|
|
84
|
+
// Get card size
|
|
85
|
+
const cardSize = { width: this.card.width, height: this.card.height };
|
|
89
86
|
// Calculate header position (top of the card)
|
|
90
87
|
if (this.sectionHeader) {
|
|
91
|
-
const
|
|
88
|
+
const dividerSectionHeader = 4;
|
|
89
|
+
const headerY = -cardSize.height / 2 - this.sectionHeader.height / dividerSectionHeader;
|
|
92
90
|
this.sectionHeader.setPosition(0, headerY);
|
|
93
|
-
// Note: SectionHeader doesn't have setWidth, it auto-sizes to content
|
|
94
91
|
}
|
|
95
92
|
// Calculate close button position (top-right corner)
|
|
96
93
|
if (this.closeButton) {
|
|
97
|
-
const buttonX =
|
|
98
|
-
const buttonY = -
|
|
94
|
+
const buttonX = cardSize.width / 2 - CLOSE_BUTTON_SIZE / 2 + CLOSE_BUTTON_MARGIN;
|
|
95
|
+
const buttonY = -cardSize.height / 2 + CLOSE_BUTTON_SIZE / 2 - CLOSE_BUTTON_MARGIN;
|
|
99
96
|
this.closeButton.setPosition(buttonX, buttonY);
|
|
100
97
|
}
|
|
101
98
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panel.js","sourceRoot":"","sources":["../../../src/components/panel/panel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAS,MAAM,QAAQ,CAAC;AAE5C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,+BAA+B;AAC/B,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAChC,MAAM,cAAc,GAAG,EAAE,CAAC;AAC1B,MAAM,wBAAwB,GAAG,SAAS,CAAC;AAC3C,MAAM,
|
|
1
|
+
{"version":3,"file":"panel.js","sourceRoot":"","sources":["../../../src/components/panel/panel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAS,MAAM,QAAQ,CAAC;AAE5C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,+BAA+B;AAC/B,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAChC,MAAM,cAAc,GAAG,EAAE,CAAC;AAC1B,MAAM,wBAAwB,GAAG,SAAS,CAAC;AAC3C,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAC7B,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAe9B,MAAM,OAAO,KAAM,SAAQ,WAAW,CAAC,SAAS;IACpC,IAAI,CAAO;IACX,aAAa,GAAyB,IAAI,CAAC;IAC3C,WAAW,GAA0B,IAAI,CAAC;IAC1C,KAAK,CAAS;IACd,eAAe,CAAU;IACzB,OAAO,CAA4B;IAE3C,YAAY,MAAmB;QAC3B,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,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C,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QACpC,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACrB,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QACjD,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;OAEG;IACH,eAAe,CAAC,MAAc;QAC1B,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAClC,IAAI,CAAC,YAAY,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;OAEG;IACH,SAAS,CAAC,MAAc;QACpB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC5B,IAAI,CAAC,YAAY,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,KAA6B;QAClC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC1B,IAAI,CAAC,YAAY,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;OAEG;IACH,OAAO;QACH,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;IAED;;OAEG;IACH,gBAAgB;QACZ,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,cAAc;QACV,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;CACJ"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { GameObjects, Scene } from 'phaser';
|
|
2
2
|
import { type ColorKey, type FontKey, type FontSizeKey, type RadiusKey, type SpacingKey } from 'phaser-wind';
|
|
3
|
+
import { ContainerInteractive } from '../container-interactive';
|
|
3
4
|
export type SectionHeaderParams = {
|
|
4
5
|
/** The Phaser scene to add the header to */
|
|
5
6
|
scene: Scene;
|
|
@@ -17,8 +18,6 @@ export type SectionHeaderParams = {
|
|
|
17
18
|
backgroundColor?: ColorKey | string;
|
|
18
19
|
/** Text color. Defaults to 'white'. */
|
|
19
20
|
textColor?: ColorKey | string;
|
|
20
|
-
/** Text stroke color. Defaults to a darker version of backgroundColor. */
|
|
21
|
-
strokeColor?: ColorKey | string;
|
|
22
21
|
/** Border radius in px (number) or a Phaser Wind radius token (string). Defaults to 'md'. */
|
|
23
22
|
borderRadius?: RadiusKey | number;
|
|
24
23
|
/** Margin/padding in px (number) or a Phaser Wind spacing token (string). Defaults to '4'. */
|
|
@@ -27,11 +26,11 @@ export type SectionHeaderParams = {
|
|
|
27
26
|
/**
|
|
28
27
|
* A stylized section header component with shadow, text stroke and auto-sizing
|
|
29
28
|
*/
|
|
30
|
-
export declare class SectionHeader extends GameObjects.
|
|
31
|
-
/** The
|
|
32
|
-
|
|
33
|
-
/** The
|
|
34
|
-
|
|
29
|
+
export declare class SectionHeader extends ContainerInteractive<Phaser.GameObjects.Sprite> {
|
|
30
|
+
/** The white border sprite of the header */
|
|
31
|
+
whiteBorderSprite: GameObjects.Sprite;
|
|
32
|
+
/** The background sprite of the header */
|
|
33
|
+
backgroundSprite: GameObjects.Sprite;
|
|
35
34
|
/** The text object of the header */
|
|
36
35
|
headerText: GameObjects.Text;
|
|
37
36
|
/** Reference to the PhaserWind plugin */
|
|
@@ -43,20 +42,22 @@ export declare class SectionHeader extends GameObjects.Container {
|
|
|
43
42
|
/** Border radius in pixels */
|
|
44
43
|
private borderRadiusPx;
|
|
45
44
|
/** Background color value */
|
|
46
|
-
private
|
|
45
|
+
private colorButton;
|
|
46
|
+
/** Light color variant for gradient */
|
|
47
|
+
private lightColorButton;
|
|
48
|
+
/** Dark color variant for gradient */
|
|
49
|
+
private darkColorButton;
|
|
47
50
|
/** Text color value */
|
|
48
51
|
private textColorValue;
|
|
49
|
-
/** Stroke color value */
|
|
50
|
-
private strokeColorValue;
|
|
51
52
|
/** Font family value */
|
|
52
|
-
private
|
|
53
|
+
private fontFamily;
|
|
53
54
|
/** Text content value */
|
|
54
55
|
private textValue;
|
|
55
56
|
/**
|
|
56
57
|
* Creates a new SectionHeader
|
|
57
58
|
* @param params Configuration parameters for the header
|
|
58
59
|
*/
|
|
59
|
-
constructor({ scene, x, y, text, fontSize, font, backgroundColor, textColor,
|
|
60
|
+
constructor({ scene, x, y, text, fontSize, font, backgroundColor, textColor, borderRadius, margin, }: SectionHeaderParams);
|
|
60
61
|
/**
|
|
61
62
|
* Sets the text content of the header
|
|
62
63
|
* @param text New text content
|
|
@@ -87,12 +88,6 @@ export declare class SectionHeader extends GameObjects.Container {
|
|
|
87
88
|
* @returns this for chaining
|
|
88
89
|
*/
|
|
89
90
|
setTextColor(color: ColorKey | string): this;
|
|
90
|
-
/**
|
|
91
|
-
* Sets the stroke color of the header text
|
|
92
|
-
* @param color New stroke color (ColorKey or string)
|
|
93
|
-
* @returns this for chaining
|
|
94
|
-
*/
|
|
95
|
-
setStrokeColor(color: ColorKey | string): this;
|
|
96
91
|
/**
|
|
97
92
|
* Sets the border radius of the header
|
|
98
93
|
* @param borderRadius New border radius (number in px or RadiusKey)
|
|
@@ -111,45 +106,44 @@ export declare class SectionHeader extends GameObjects.Container {
|
|
|
111
106
|
*/
|
|
112
107
|
private createHeaderText;
|
|
113
108
|
/**
|
|
114
|
-
* Creates the
|
|
115
|
-
* @param scene The scene to add the
|
|
109
|
+
* Creates the white border sprite for the header
|
|
110
|
+
* @param scene The scene to add the sprite to
|
|
116
111
|
*/
|
|
117
|
-
private
|
|
112
|
+
private createWhiteBorderSprite;
|
|
118
113
|
/**
|
|
119
|
-
* Creates the background
|
|
120
|
-
* @param scene The scene to add the
|
|
114
|
+
* Creates the background sprite for the header
|
|
115
|
+
* @param scene The scene to add the sprite to
|
|
121
116
|
*/
|
|
122
|
-
private
|
|
117
|
+
private createBackgroundSprite;
|
|
123
118
|
/**
|
|
124
119
|
* Regenerates all graphics after a property change
|
|
125
120
|
*/
|
|
126
121
|
private regenerateGraphics;
|
|
127
122
|
/**
|
|
128
|
-
*
|
|
123
|
+
* Creates a texture for the header's white border.
|
|
124
|
+
* @param scene Phaser scene.
|
|
125
|
+
* @returns The texture key.
|
|
126
|
+
*/
|
|
127
|
+
private createWhiteBorderTexture;
|
|
128
|
+
/**
|
|
129
|
+
* Creates a texture for the header's background.
|
|
130
|
+
* @param scene Phaser scene.
|
|
131
|
+
* @returns The texture key.
|
|
129
132
|
*/
|
|
130
|
-
private
|
|
133
|
+
private createBackgroundTexture;
|
|
131
134
|
/**
|
|
132
|
-
* Draws
|
|
135
|
+
* Draws gradient using light/dark overlays on CSS color.
|
|
136
|
+
* Uses the same system as TextButton.
|
|
133
137
|
*/
|
|
134
|
-
private
|
|
138
|
+
private drawCssColorGradient;
|
|
135
139
|
/**
|
|
136
140
|
* Gets the dimensions of the header based on text content
|
|
137
141
|
* @returns Object containing width and height
|
|
138
142
|
*/
|
|
139
143
|
private getHeaderDimensions;
|
|
140
144
|
/**
|
|
141
|
-
* Sets up the container with all
|
|
145
|
+
* Sets up the container with all sprites in the correct order
|
|
142
146
|
*/
|
|
143
147
|
private setupContainer;
|
|
144
|
-
/**
|
|
145
|
-
* Sets up interactivity for the header
|
|
146
|
-
*/
|
|
147
|
-
private setupInteractivity;
|
|
148
|
-
/**
|
|
149
|
-
* Gets a darker version of the given color
|
|
150
|
-
* @param color Base color to darken
|
|
151
|
-
* @returns Darker color string
|
|
152
|
-
*/
|
|
153
|
-
private getDarkerColor;
|
|
154
148
|
}
|
|
155
149
|
//# sourceMappingURL=section-header.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"section-header.d.ts","sourceRoot":"","sources":["../../../src/components/section-header/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;AAIrB,MAAM,MAAM,mBAAmB,GAAG;IAChC,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;IAC5F,QAAQ,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC;IAChC,0CAA0C;IAC1C,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB,gDAAgD;IAChD,eAAe,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IACpC,uCAAuC;IACvC,SAAS,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC9B,
|
|
1
|
+
{"version":3,"file":"section-header.d.ts","sourceRoot":"","sources":["../../../src/components/section-header/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;AAIrB,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGhE,MAAM,MAAM,mBAAmB,GAAG;IAChC,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;IAC5F,QAAQ,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC;IAChC,0CAA0C;IAC1C,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB,gDAAgD;IAChD,eAAe,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IACpC,uCAAuC;IACvC,SA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