@number10/phaserjsx 0.1.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/LICENSE +667 -0
- package/README.md +238 -0
- package/dist/TransformOriginView-BYPbRH8N.cjs +17045 -0
- package/dist/TransformOriginView-BYPbRH8N.cjs.map +1 -0
- package/dist/TransformOriginView-CO-tJCmV.js +17046 -0
- package/dist/TransformOriginView-CO-tJCmV.js.map +1 -0
- package/dist/animation/animated-signal.d.ts +35 -0
- package/dist/animation/animated-signal.d.ts.map +1 -0
- package/dist/animation/index.d.ts +7 -0
- package/dist/animation/index.d.ts.map +1 -0
- package/dist/animation/spring-physics.d.ts +120 -0
- package/dist/animation/spring-physics.d.ts.map +1 -0
- package/dist/animation/useSpring.d.ts +54 -0
- package/dist/animation/useSpring.d.ts.map +1 -0
- package/dist/colors/color-presets.d.ts +89 -0
- package/dist/colors/color-presets.d.ts.map +1 -0
- package/dist/colors/color-theme-helpers.d.ts +65 -0
- package/dist/colors/color-theme-helpers.d.ts.map +1 -0
- package/dist/colors/color-types.d.ts +100 -0
- package/dist/colors/color-types.d.ts.map +1 -0
- package/dist/colors/color-utils.d.ts +171 -0
- package/dist/colors/color-utils.d.ts.map +1 -0
- package/dist/colors/index.d.ts +17 -0
- package/dist/colors/index.d.ts.map +1 -0
- package/dist/colors/preset-manager.d.ts +35 -0
- package/dist/colors/preset-manager.d.ts.map +1 -0
- package/dist/colors/use-color-mode.d.ts +22 -0
- package/dist/colors/use-color-mode.d.ts.map +1 -0
- package/dist/colors/use-colors.d.ts +40 -0
- package/dist/colors/use-colors.d.ts.map +1 -0
- package/dist/components/appliers/applyBackground.d.ts +13 -0
- package/dist/components/appliers/applyBackground.d.ts.map +1 -0
- package/dist/components/appliers/applyGestures.d.ts +12 -0
- package/dist/components/appliers/applyGestures.d.ts.map +1 -0
- package/dist/components/appliers/applyGraphics.d.ts +10 -0
- package/dist/components/appliers/applyGraphics.d.ts.map +1 -0
- package/dist/components/appliers/applyGraphicsLayout.d.ts +10 -0
- package/dist/components/appliers/applyGraphicsLayout.d.ts.map +1 -0
- package/dist/components/appliers/applyImage.d.ts +10 -0
- package/dist/components/appliers/applyImage.d.ts.map +1 -0
- package/dist/components/appliers/applyImageLayout.d.ts +15 -0
- package/dist/components/appliers/applyImageLayout.d.ts.map +1 -0
- package/dist/components/appliers/applyLayout.d.ts +15 -0
- package/dist/components/appliers/applyLayout.d.ts.map +1 -0
- package/dist/components/appliers/applyNineSlice.d.ts +11 -0
- package/dist/components/appliers/applyNineSlice.d.ts.map +1 -0
- package/dist/components/appliers/applyNineSliceLayout.d.ts +15 -0
- package/dist/components/appliers/applyNineSliceLayout.d.ts.map +1 -0
- package/dist/components/appliers/applyPhaser.d.ts +22 -0
- package/dist/components/appliers/applyPhaser.d.ts.map +1 -0
- package/dist/components/appliers/applySprite.d.ts +10 -0
- package/dist/components/appliers/applySprite.d.ts.map +1 -0
- package/dist/components/appliers/applySpriteLayout.d.ts +14 -0
- package/dist/components/appliers/applySpriteLayout.d.ts.map +1 -0
- package/dist/components/appliers/applyText.d.ts +25 -0
- package/dist/components/appliers/applyText.d.ts.map +1 -0
- package/dist/components/appliers/applyTextLayout.d.ts +15 -0
- package/dist/components/appliers/applyTextLayout.d.ts.map +1 -0
- package/dist/components/appliers/applyTooltip.d.ts +12 -0
- package/dist/components/appliers/applyTooltip.d.ts.map +1 -0
- package/dist/components/appliers/applyTransform.d.ts +21 -0
- package/dist/components/appliers/applyTransform.d.ts.map +1 -0
- package/dist/components/creators/createBackground.d.ts +15 -0
- package/dist/components/creators/createBackground.d.ts.map +1 -0
- package/dist/components/creators/createGestures.d.ts +11 -0
- package/dist/components/creators/createGestures.d.ts.map +1 -0
- package/dist/components/creators/createGraphicsLayout.d.ts +9 -0
- package/dist/components/creators/createGraphicsLayout.d.ts.map +1 -0
- package/dist/components/creators/createImageLayout.d.ts +14 -0
- package/dist/components/creators/createImageLayout.d.ts.map +1 -0
- package/dist/components/creators/createLayout.d.ts +15 -0
- package/dist/components/creators/createLayout.d.ts.map +1 -0
- package/dist/components/creators/createNineSliceLayout.d.ts +14 -0
- package/dist/components/creators/createNineSliceLayout.d.ts.map +1 -0
- package/dist/components/creators/createPhaser.d.ts +14 -0
- package/dist/components/creators/createPhaser.d.ts.map +1 -0
- package/dist/components/creators/createSpriteLayout.d.ts +15 -0
- package/dist/components/creators/createSpriteLayout.d.ts.map +1 -0
- package/dist/components/creators/createTextLayout.d.ts +14 -0
- package/dist/components/creators/createTextLayout.d.ts.map +1 -0
- package/dist/components/creators/createTransform.d.ts +11 -0
- package/dist/components/creators/createTransform.d.ts.map +1 -0
- package/dist/components/custom/Accordion.d.ts +34 -0
- package/dist/components/custom/Accordion.d.ts.map +1 -0
- package/dist/components/custom/AlertDialog.d.ts +63 -0
- package/dist/components/custom/AlertDialog.d.ts.map +1 -0
- package/dist/components/custom/Button.d.ts +44 -0
- package/dist/components/custom/Button.d.ts.map +1 -0
- package/dist/components/custom/CharText/CharText.d.ts +8 -0
- package/dist/components/custom/CharText/CharText.d.ts.map +1 -0
- package/dist/components/custom/CharText/index.d.ts +3 -0
- package/dist/components/custom/CharText/index.d.ts.map +1 -0
- package/dist/components/custom/CharText/types.d.ts +117 -0
- package/dist/components/custom/CharText/types.d.ts.map +1 -0
- package/dist/components/custom/CharText/utils.d.ts +34 -0
- package/dist/components/custom/CharText/utils.d.ts.map +1 -0
- package/dist/components/custom/CharTextInput.d.ts +62 -0
- package/dist/components/custom/CharTextInput.d.ts.map +1 -0
- package/dist/components/custom/Dialog.d.ts +60 -0
- package/dist/components/custom/Dialog.d.ts.map +1 -0
- package/dist/components/custom/Divider.d.ts +21 -0
- package/dist/components/custom/Divider.d.ts.map +1 -0
- package/dist/components/custom/Dropdown.d.ts +91 -0
- package/dist/components/custom/Dropdown.d.ts.map +1 -0
- package/dist/components/custom/Icon.d.ts +75 -0
- package/dist/components/custom/Icon.d.ts.map +1 -0
- package/dist/components/custom/Image.d.ts +50 -0
- package/dist/components/custom/Image.d.ts.map +1 -0
- package/dist/components/custom/Modal.d.ts +37 -0
- package/dist/components/custom/Modal.d.ts.map +1 -0
- package/dist/components/custom/NineSlice.d.ts +81 -0
- package/dist/components/custom/NineSlice.d.ts.map +1 -0
- package/dist/components/custom/NineSliceButton.d.ts +128 -0
- package/dist/components/custom/NineSliceButton.d.ts.map +1 -0
- package/dist/components/custom/Portal.d.ts +43 -0
- package/dist/components/custom/Portal.d.ts.map +1 -0
- package/dist/components/custom/Portal.test.d.ts +2 -0
- package/dist/components/custom/Portal.test.d.ts.map +1 -0
- package/dist/components/custom/RadioButton.d.ts +20 -0
- package/dist/components/custom/RadioButton.d.ts.map +1 -0
- package/dist/components/custom/RadioGroup.d.ts +33 -0
- package/dist/components/custom/RadioGroup.d.ts.map +1 -0
- package/dist/components/custom/RefOriginView.d.ts +45 -0
- package/dist/components/custom/RefOriginView.d.ts.map +1 -0
- package/dist/components/custom/ScrollSlider.d.ts +36 -0
- package/dist/components/custom/ScrollSlider.d.ts.map +1 -0
- package/dist/components/custom/ScrollView.d.ts +48 -0
- package/dist/components/custom/ScrollView.d.ts.map +1 -0
- package/dist/components/custom/Sidebar.d.ts +50 -0
- package/dist/components/custom/Sidebar.d.ts.map +1 -0
- package/dist/components/custom/Slider.d.ts +131 -0
- package/dist/components/custom/Slider.d.ts.map +1 -0
- package/dist/components/custom/Text.d.ts +26 -0
- package/dist/components/custom/Text.d.ts.map +1 -0
- package/dist/components/custom/Toggle.d.ts +51 -0
- package/dist/components/custom/Toggle.d.ts.map +1 -0
- package/dist/components/custom/TransformOriginView.d.ts +34 -0
- package/dist/components/custom/TransformOriginView.d.ts.map +1 -0
- package/dist/components/custom/View.d.ts +33 -0
- package/dist/components/custom/View.d.ts.map +1 -0
- package/dist/components/custom/WrapText.d.ts +60 -0
- package/dist/components/custom/WrapText.d.ts.map +1 -0
- package/dist/components/custom/index.cjs +32 -0
- package/dist/components/custom/index.cjs.map +1 -0
- package/dist/components/custom/index.d.ts +29 -0
- package/dist/components/custom/index.d.ts.map +1 -0
- package/dist/components/custom/index.js +32 -0
- package/dist/components/custom/index.js.map +1 -0
- package/dist/components/index.d.ts +28 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/internal/SceneWrapper.d.ts +20 -0
- package/dist/components/internal/SceneWrapper.d.ts.map +1 -0
- package/dist/components/primitives/graphics.d.ts +40 -0
- package/dist/components/primitives/graphics.d.ts.map +1 -0
- package/dist/components/primitives/image.d.ts +45 -0
- package/dist/components/primitives/image.d.ts.map +1 -0
- package/dist/components/primitives/nineslice.d.ts +111 -0
- package/dist/components/primitives/nineslice.d.ts.map +1 -0
- package/dist/components/primitives/sprite.d.ts +58 -0
- package/dist/components/primitives/sprite.d.ts.map +1 -0
- package/dist/components/primitives/text.d.ts +26 -0
- package/dist/components/primitives/text.d.ts.map +1 -0
- package/dist/components/primitives/tilesprite.d.ts +47 -0
- package/dist/components/primitives/tilesprite.d.ts.map +1 -0
- package/dist/components/primitives/view.d.ts +23 -0
- package/dist/components/primitives/view.d.ts.map +1 -0
- package/dist/core-props.d.ts +605 -0
- package/dist/core-props.d.ts.map +1 -0
- package/dist/core-types.d.ts +59 -0
- package/dist/core-types.d.ts.map +1 -0
- package/dist/design-tokens/design-token-presets.d.ts +26 -0
- package/dist/design-tokens/design-token-presets.d.ts.map +1 -0
- package/dist/design-tokens/design-token-types.d.ts +109 -0
- package/dist/design-tokens/design-token-types.d.ts.map +1 -0
- package/dist/design-tokens/index.d.ts +8 -0
- package/dist/design-tokens/index.d.ts.map +1 -0
- package/dist/design-tokens/use-theme-tokens.d.ts +28 -0
- package/dist/design-tokens/use-theme-tokens.d.ts.map +1 -0
- package/dist/dev-config.d.ts +238 -0
- package/dist/dev-config.d.ts.map +1 -0
- package/dist/effects/effect-registry.d.ts +54 -0
- package/dist/effects/effect-registry.d.ts.map +1 -0
- package/dist/effects/index.d.ts +56 -0
- package/dist/effects/index.d.ts.map +1 -0
- package/dist/effects/use-effect.d.ts +172 -0
- package/dist/effects/use-effect.d.ts.map +1 -0
- package/dist/fx/convenience-hooks/index.d.ts +7 -0
- package/dist/fx/convenience-hooks/index.d.ts.map +1 -0
- package/dist/fx/convenience-hooks/use-blur.d.ts +21 -0
- package/dist/fx/convenience-hooks/use-blur.d.ts.map +1 -0
- package/dist/fx/convenience-hooks/use-glow.d.ts +21 -0
- package/dist/fx/convenience-hooks/use-glow.d.ts.map +1 -0
- package/dist/fx/convenience-hooks/use-shadow.d.ts +21 -0
- package/dist/fx/convenience-hooks/use-shadow.d.ts.map +1 -0
- package/dist/fx/fx-creators/blur.d.ts +37 -0
- package/dist/fx/fx-creators/blur.d.ts.map +1 -0
- package/dist/fx/fx-creators/color-matrix.d.ts +31 -0
- package/dist/fx/fx-creators/color-matrix.d.ts.map +1 -0
- package/dist/fx/fx-creators/glow.d.ts +36 -0
- package/dist/fx/fx-creators/glow.d.ts.map +1 -0
- package/dist/fx/fx-creators/index.d.ts +10 -0
- package/dist/fx/fx-creators/index.d.ts.map +1 -0
- package/dist/fx/fx-creators/pixelate.d.ts +24 -0
- package/dist/fx/fx-creators/pixelate.d.ts.map +1 -0
- package/dist/fx/fx-creators/shadow.d.ts +43 -0
- package/dist/fx/fx-creators/shadow.d.ts.map +1 -0
- package/dist/fx/fx-creators/vignette.d.ts +33 -0
- package/dist/fx/fx-creators/vignette.d.ts.map +1 -0
- package/dist/fx/fx-registry.d.ts +59 -0
- package/dist/fx/fx-registry.d.ts.map +1 -0
- package/dist/fx/index.d.ts +51 -0
- package/dist/fx/index.d.ts.map +1 -0
- package/dist/fx/use-fx.d.ts +53 -0
- package/dist/fx/use-fx.d.ts.map +1 -0
- package/dist/gestures/gesture-manager.d.ts +149 -0
- package/dist/gestures/gesture-manager.d.ts.map +1 -0
- package/dist/gestures/gesture-types.d.ts +229 -0
- package/dist/gestures/gesture-types.d.ts.map +1 -0
- package/dist/hooks-svg.d.ts +104 -0
- package/dist/hooks-svg.d.ts.map +1 -0
- package/dist/hooks.d.ts +135 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/host.d.ts +74 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/index.cjs +584 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +582 -0
- package/dist/index.js.map +1 -0
- package/dist/jsx-dev-runtime.cjs +10 -0
- package/dist/jsx-dev-runtime.cjs.map +1 -0
- package/dist/jsx-dev-runtime.d.ts +5 -0
- package/dist/jsx-dev-runtime.d.ts.map +1 -0
- package/dist/jsx-dev-runtime.js +11 -0
- package/dist/jsx-dev-runtime.js.map +1 -0
- package/dist/jsx-runtime.cjs +43 -0
- package/dist/jsx-runtime.cjs.map +1 -0
- package/dist/jsx-runtime.d.ts +25 -0
- package/dist/jsx-runtime.d.ts.map +1 -0
- package/dist/jsx-runtime.js +43 -0
- package/dist/jsx-runtime.js.map +1 -0
- package/dist/jsx-types.d.ts +33 -0
- package/dist/jsx-types.d.ts.map +1 -0
- package/dist/layout/appliers/background-applier.d.ts +16 -0
- package/dist/layout/appliers/background-applier.d.ts.map +1 -0
- package/dist/layout/appliers/container-applier.d.ts +9 -0
- package/dist/layout/appliers/container-applier.d.ts.map +1 -0
- package/dist/layout/appliers/position-applier.d.ts +8 -0
- package/dist/layout/appliers/position-applier.d.ts.map +1 -0
- package/dist/layout/index.d.ts +22 -0
- package/dist/layout/index.d.ts.map +1 -0
- package/dist/layout/layout-engine-test-utils.d.ts +19 -0
- package/dist/layout/layout-engine-test-utils.d.ts.map +1 -0
- package/dist/layout/layout-engine.d.ts +98 -0
- package/dist/layout/layout-engine.d.ts.map +1 -0
- package/dist/layout/strategies/base-strategy.d.ts +59 -0
- package/dist/layout/strategies/base-strategy.d.ts.map +1 -0
- package/dist/layout/strategies/column-layout.d.ts +38 -0
- package/dist/layout/strategies/column-layout.d.ts.map +1 -0
- package/dist/layout/strategies/row-layout.d.ts +38 -0
- package/dist/layout/strategies/row-layout.d.ts.map +1 -0
- package/dist/layout/strategies/stack-layout.d.ts +30 -0
- package/dist/layout/strategies/stack-layout.d.ts.map +1 -0
- package/dist/layout/types.d.ts +137 -0
- package/dist/layout/types.d.ts.map +1 -0
- package/dist/layout/utils/child-utils.d.ts +74 -0
- package/dist/layout/utils/child-utils.d.ts.map +1 -0
- package/dist/layout/utils/dimension-calculator.d.ts +59 -0
- package/dist/layout/utils/dimension-calculator.d.ts.map +1 -0
- package/dist/layout/utils/flex-distributor.d.ts +18 -0
- package/dist/layout/utils/flex-distributor.d.ts.map +1 -0
- package/dist/layout/utils/size-resolver.d.ts +84 -0
- package/dist/layout/utils/size-resolver.d.ts.map +1 -0
- package/dist/layout/utils/spacing-calculator.d.ts +27 -0
- package/dist/layout/utils/spacing-calculator.d.ts.map +1 -0
- package/dist/memo.d.ts +29 -0
- package/dist/memo.d.ts.map +1 -0
- package/dist/portal/index.d.ts +6 -0
- package/dist/portal/index.d.ts.map +1 -0
- package/dist/portal/portal-registry.d.ts +97 -0
- package/dist/portal/portal-registry.d.ts.map +1 -0
- package/dist/portal/portal-types.d.ts +20 -0
- package/dist/portal/portal-types.d.ts.map +1 -0
- package/dist/render-context.d.ts +118 -0
- package/dist/render-context.d.ts.map +1 -0
- package/dist/scripts/generate-icon-loaders.d.ts +2 -0
- package/dist/scripts/generate-icon-loaders.d.ts.map +1 -0
- package/dist/scripts/generate-icon-loaders.js +195 -0
- package/dist/scripts/generate-icon-types.d.ts +2 -0
- package/dist/scripts/generate-icon-types.d.ts.map +1 -0
- package/dist/scripts/generate-icon-types.js +124 -0
- package/dist/scripts/generate-icons.d.ts +37 -0
- package/dist/scripts/generate-icons.d.ts.map +1 -0
- package/dist/scripts/generate-icons.js +494 -0
- package/dist/scripts/icon-generator-config.d.ts +87 -0
- package/dist/scripts/icon-generator-config.d.ts.map +1 -0
- package/dist/scripts/icon-generator-config.js +6 -0
- package/dist/theme-base.d.ts +116 -0
- package/dist/theme-base.d.ts.map +1 -0
- package/dist/theme-custom.d.ts +262 -0
- package/dist/theme-custom.d.ts.map +1 -0
- package/dist/theme-defaults.d.ts +6 -0
- package/dist/theme-defaults.d.ts.map +1 -0
- package/dist/theme.d.ts +132 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/tooltip/tooltip-types.d.ts +57 -0
- package/dist/tooltip/tooltip-types.d.ts.map +1 -0
- package/dist/types.d.ts +34 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/KeyboardInputManager.d.ts +48 -0
- package/dist/utils/KeyboardInputManager.d.ts.map +1 -0
- package/dist/utils/dom-input-manager.d.ts +109 -0
- package/dist/utils/dom-input-manager.d.ts.map +1 -0
- package/dist/utils/svg-texture.d.ts +30 -0
- package/dist/utils/svg-texture.d.ts.map +1 -0
- package/dist/utils/texture-registry.d.ts +49 -0
- package/dist/utils/texture-registry.d.ts.map +1 -0
- package/dist/vdom.d.ts +60 -0
- package/dist/vdom.d.ts.map +1 -0
- package/dist/viewport-context.d.ts +39 -0
- package/dist/viewport-context.d.ts.map +1 -0
- package/dist/vite-plugin-icons.d.ts +29 -0
- package/dist/vite-plugin-icons.d.ts.map +1 -0
- package/dist/vite-plugin-icons.js +95 -0
- package/package.json +117 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { ImageProps } from './Image';
|
|
2
|
+
/**
|
|
3
|
+
* Icon loader function type
|
|
4
|
+
* Takes an icon type string and returns a promise resolving to SVG string
|
|
5
|
+
*/
|
|
6
|
+
export interface IconLoaderFn<T extends string = string> {
|
|
7
|
+
(type: T): Promise<string>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Props for the generic Icon component
|
|
11
|
+
*/
|
|
12
|
+
export interface IconProps<T extends string = string> extends Omit<ImageProps, 'texture' | 'displayWidth' | 'displayHeight'> {
|
|
13
|
+
/** The icon type/name to load */
|
|
14
|
+
type: T | undefined;
|
|
15
|
+
/** Loader function that fetches the icon SVG */
|
|
16
|
+
loader: IconLoaderFn<T>;
|
|
17
|
+
/** Icon size in pixels (default: 32) */
|
|
18
|
+
size?: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Generic Icon component
|
|
22
|
+
* Loads and displays an icon using the provided loader function
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* <Icon
|
|
27
|
+
* type="check"
|
|
28
|
+
* loader={myIconLoader}
|
|
29
|
+
* size={24}
|
|
30
|
+
* />
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function Icon<T extends string = string>(props: IconProps<T>): any;
|
|
34
|
+
/**
|
|
35
|
+
* Factory function to create a typed Icon component with a specific loader
|
|
36
|
+
* This allows creating strongly-typed icon components for specific icon libraries
|
|
37
|
+
*
|
|
38
|
+
* @param loader - The icon loader function
|
|
39
|
+
* @returns A typed Icon component that doesn't require the loader prop
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* // Define your loader
|
|
44
|
+
* async function myIconLoader(type: MyIconType): Promise<string> {
|
|
45
|
+
* const module = await import(`./icons/${type}.svg`)
|
|
46
|
+
* return module.default
|
|
47
|
+
* }
|
|
48
|
+
*
|
|
49
|
+
* // Create typed component
|
|
50
|
+
* export const MyIcon = createIconComponent<MyIconType>(myIconLoader)
|
|
51
|
+
*
|
|
52
|
+
* // Use without loader prop
|
|
53
|
+
* <MyIcon type="check" size={24} />
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare function createIconComponent<T extends string>(loader: IconLoaderFn<T>): (props: Omit<IconProps<T>, "loader">) => any;
|
|
57
|
+
/**
|
|
58
|
+
* Hook to preload an icon and check if it's ready
|
|
59
|
+
* Useful for loading icons before they're displayed
|
|
60
|
+
*
|
|
61
|
+
* @param type - The icon type to load
|
|
62
|
+
* @param loader - The icon loader function
|
|
63
|
+
* @returns true when the icon is loaded and ready to use
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```tsx
|
|
67
|
+
* function MyComponent() {
|
|
68
|
+
* const iconReady = useIconPreload('check', myIconLoader)
|
|
69
|
+
*
|
|
70
|
+
* return iconReady ? <Icon type="check" loader={myIconLoader} /> : <Text text="Loading..." />
|
|
71
|
+
* }
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
export declare function useIconPreload<T extends string>(type: T, loader: IconLoaderFn<T>): boolean;
|
|
75
|
+
//# sourceMappingURL=Icon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/components/custom/Icon.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AAEhD;;;GAGG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IACrD,CAAC,IAAI,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,SAAS,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAClD,SAAQ,IAAI,CAAC,UAAU,EAAE,SAAS,GAAG,cAAc,GAAG,eAAe,CAAC;IACtE,iCAAiC;IACjC,IAAI,EAAE,CAAC,GAAG,SAAS,CAAA;IACnB,gDAAgD;IAChD,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,CAAA;IACvB,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,OAgBlE;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,IACjD,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,SAG9D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,OAAO,CAU1F"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { default as Phaser } from 'phaser';
|
|
2
|
+
import { LayoutProps, PhaserProps, TransformProps } from '../../core-props';
|
|
3
|
+
import { ChildrenType, PropsDefaultExtension } from '../../types';
|
|
4
|
+
/**
|
|
5
|
+
* Props for Image component
|
|
6
|
+
* Explicitly defined to ensure type safety in JSX usage
|
|
7
|
+
*/
|
|
8
|
+
export interface ImageProps extends Omit<TransformProps, 'scaleX' | 'scaleY' | 'scale'>, PhaserProps, Omit<LayoutProps, 'direction' | 'justifyContent' | 'alignItems' | 'gap' | 'flexWrap'>, PropsDefaultExtension<Phaser.GameObjects.Image> {
|
|
9
|
+
/** Texture key (loaded via Phaser's texture manager) */
|
|
10
|
+
texture: string;
|
|
11
|
+
/** Optional frame from texture atlas */
|
|
12
|
+
frame?: string | number;
|
|
13
|
+
/** Tint color applied to image (0xRRGGBB) */
|
|
14
|
+
tint?: number | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* How image should fit within bounds (if width/height set)
|
|
17
|
+
* - 'fill': Stretch to fill (default, may distort aspect ratio)
|
|
18
|
+
* - 'contain': Scale to fit within bounds, preserve aspect ratio
|
|
19
|
+
* - 'cover': Scale to cover bounds, preserve aspect ratio (may crop)
|
|
20
|
+
*/
|
|
21
|
+
fit?: 'fill' | 'contain' | 'cover';
|
|
22
|
+
/** Origin X (0-1, default based on headless: 0 for layout, 0.5 for headless) */
|
|
23
|
+
originX?: number;
|
|
24
|
+
/** Origin Y (0-1, default based on headless: 0 for layout, 0.5 for headless) */
|
|
25
|
+
originY?: number;
|
|
26
|
+
/** Children are not supported for Image component */
|
|
27
|
+
children?: ChildrenType;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Image component
|
|
31
|
+
* Displays Phaser textures as visual elements
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```tsx
|
|
35
|
+
* // Basic image with layout size
|
|
36
|
+
* <Image texture="avatar" width={64} height={64} />
|
|
37
|
+
*
|
|
38
|
+
* // Atlas frame
|
|
39
|
+
* <Image texture="sprites" frame="player" width={32} height={32} />
|
|
40
|
+
*
|
|
41
|
+
* // Tinted image
|
|
42
|
+
* <Image texture="icon" width={48} height={48} tint={0xff0000} />
|
|
43
|
+
*
|
|
44
|
+
* // Fit modes
|
|
45
|
+
* <Image texture="photo" width={200} height={200} fit="cover" />
|
|
46
|
+
* <Image texture="logo" width={100} height={100} fit="contain" />
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare function Image(props: ImageProps): any;
|
|
50
|
+
//# sourceMappingURL=Image.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../src/components/custom/Image.tsx"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B;;;GAGG;AACH,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAChC,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAGhF,OAAO,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAEtE;;;GAGG;AACH,MAAM,WAAW,UACf,SAAQ,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC,EACzD,WAAW,EACX,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,gBAAgB,GAAG,YAAY,GAAG,KAAK,GAAG,UAAU,CAAC,EACrF,qBAAqB,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC;IACjD,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAA;IAEf,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAEvB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAEzB;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAA;IAElC,gFAAgF;IAChF,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,gFAAgF;IAChF,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,qDAAqD;IACrD,QAAQ,CAAC,EAAE,YAAY,CAAA;CACxB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,OAqBtC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { EffectFn } from '../../effects/use-effect';
|
|
2
|
+
import { ChildrenType } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* ModalPortal component props
|
|
5
|
+
*/
|
|
6
|
+
export interface ModalProps {
|
|
7
|
+
/** Unique key for VDOM identification */
|
|
8
|
+
key?: string;
|
|
9
|
+
/** request if modal should change its open/close state */
|
|
10
|
+
show: boolean;
|
|
11
|
+
/** Callback when modal should start closing (backdrop/Escape) */
|
|
12
|
+
onRequestClose?: (() => void) | undefined;
|
|
13
|
+
/** Callback when modal has been opened (at start of animation) */
|
|
14
|
+
onOpen?: (() => void) | undefined;
|
|
15
|
+
/** Callback when modal has been closed (at end of animation) */
|
|
16
|
+
onClosed?: (() => void) | undefined;
|
|
17
|
+
/** Close on backdrop click (default: true) */
|
|
18
|
+
closeOnBackdrop?: boolean | undefined;
|
|
19
|
+
/** Close on Escape key (default: true) */
|
|
20
|
+
closeOnEscape?: boolean | undefined;
|
|
21
|
+
/** Portal depth (default: 1000) */
|
|
22
|
+
depth?: number | undefined;
|
|
23
|
+
/** Custom effect for showing modal content (default: fade in) */
|
|
24
|
+
viewOpenEffect?: EffectFn | undefined;
|
|
25
|
+
/** Custom effect for hiding modal content (default: fade out) */
|
|
26
|
+
viewCloseEffect?: EffectFn | undefined;
|
|
27
|
+
/** Modal content */
|
|
28
|
+
children?: ChildrenType;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Modal component with backdrop and animations
|
|
32
|
+
* Uses Portal for rendering above main UI
|
|
33
|
+
* @param props - Modal props
|
|
34
|
+
* @returns Modal component
|
|
35
|
+
*/
|
|
36
|
+
export declare function Modal(props: ModalProps): any;
|
|
37
|
+
//# sourceMappingURL=Modal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/components/custom/Modal.tsx"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B;;;;GAIG;AACH,OAAO,EAIL,KAAK,QAAQ,EACd,MAAM,0BAA0B,CAAA;AAKjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAI/C;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,yCAAyC;IACzC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,0DAA0D;IAC1D,IAAI,EAAE,OAAO,CAAA;IACb,iEAAiE;IACjE,cAAc,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAA;IACzC,kEAAkE;IAClE,MAAM,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAA;IACjC,gEAAgE;IAChE,QAAQ,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAA;IACnC,8CAA8C;IAC9C,eAAe,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACrC,0CAA0C;IAC1C,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACnC,mCAAmC;IACnC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,iEAAiE;IACjE,cAAc,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;IACrC,iEAAiE;IACjE,eAAe,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;IACtC,oBAAoB;IACpB,QAAQ,CAAC,EAAE,YAAY,CAAA;CACxB;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,OAoLtC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { default as Phaser } from 'phaser';
|
|
2
|
+
import { LayoutProps, PhaserProps, TransformProps } from '../../core-props';
|
|
3
|
+
import { ChildrenType, PropsDefaultExtension } from '../../types';
|
|
4
|
+
/**
|
|
5
|
+
* Props for NineSlice component
|
|
6
|
+
* Explicitly defined to ensure type safety in JSX usage
|
|
7
|
+
*/
|
|
8
|
+
export interface NineSliceProps extends Omit<TransformProps, 'scaleX' | 'scaleY' | 'scale'>, PhaserProps, Omit<LayoutProps, 'direction' | 'justifyContent' | 'alignItems' | 'gap' | 'flexWrap'>, PropsDefaultExtension<Phaser.GameObjects.NineSlice> {
|
|
9
|
+
/** Texture key (loaded via Phaser's texture manager) */
|
|
10
|
+
texture: string;
|
|
11
|
+
/** Optional frame from texture atlas */
|
|
12
|
+
frame?: string | number;
|
|
13
|
+
/** Tint color applied to NineSlice (0xRRGGBB) */
|
|
14
|
+
tint?: number | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Width of the left slice (in pixels of source texture)
|
|
17
|
+
* Defines the non-stretching left border/corner area
|
|
18
|
+
*/
|
|
19
|
+
leftWidth: number;
|
|
20
|
+
/**
|
|
21
|
+
* Width of the right slice (in pixels of source texture)
|
|
22
|
+
* Defines the non-stretching right border/corner area
|
|
23
|
+
*/
|
|
24
|
+
rightWidth: number;
|
|
25
|
+
/**
|
|
26
|
+
* Height of the top slice (in pixels of source texture)
|
|
27
|
+
* Optional - omit for 3-slice mode (horizontal only)
|
|
28
|
+
*/
|
|
29
|
+
topHeight?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Height of the bottom slice (in pixels of source texture)
|
|
32
|
+
* Optional - omit for 3-slice mode (horizontal only)
|
|
33
|
+
*/
|
|
34
|
+
bottomHeight?: number;
|
|
35
|
+
/** Children are not supported for NineSlice component */
|
|
36
|
+
children?: ChildrenType;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* NineSlice component
|
|
40
|
+
* Displays scalable 9-slice textures with preserved corners
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```tsx
|
|
44
|
+
* // Basic 9-slice panel
|
|
45
|
+
* <NineSlice
|
|
46
|
+
* texture="ui"
|
|
47
|
+
* frame="panel"
|
|
48
|
+
* width={300}
|
|
49
|
+
* height={200}
|
|
50
|
+
* leftWidth={20}
|
|
51
|
+
* rightWidth={20}
|
|
52
|
+
* topHeight={20}
|
|
53
|
+
* bottomHeight={20}
|
|
54
|
+
* />
|
|
55
|
+
*
|
|
56
|
+
* // 3-slice horizontal bar (no vertical slicing)
|
|
57
|
+
* <NineSlice
|
|
58
|
+
* texture="ui"
|
|
59
|
+
* frame="bar"
|
|
60
|
+
* width={400}
|
|
61
|
+
* height={60}
|
|
62
|
+
* leftWidth={15}
|
|
63
|
+
* rightWidth={15}
|
|
64
|
+
* />
|
|
65
|
+
*
|
|
66
|
+
* // Tinted panel
|
|
67
|
+
* <NineSlice
|
|
68
|
+
* texture="ui"
|
|
69
|
+
* frame="button"
|
|
70
|
+
* width={250}
|
|
71
|
+
* height={100}
|
|
72
|
+
* leftWidth={14}
|
|
73
|
+
* rightWidth={14}
|
|
74
|
+
* topHeight={14}
|
|
75
|
+
* bottomHeight={14}
|
|
76
|
+
* tint={0xff6600}
|
|
77
|
+
* />
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export declare function NineSlice(props: NineSliceProps): any;
|
|
81
|
+
//# sourceMappingURL=NineSlice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NineSlice.d.ts","sourceRoot":"","sources":["../../../src/components/custom/NineSlice.tsx"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B;;;GAGG;AACH,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAChC,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAGhF,OAAO,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAEtE;;;GAGG;AACH,MAAM,WAAW,cACf,SAAQ,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC,EACzD,WAAW,EACX,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,gBAAgB,GAAG,YAAY,GAAG,KAAK,GAAG,UAAU,CAAC,EACrF,qBAAqB,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC;IACrD,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAA;IAEf,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAEvB,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAEzB;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAA;IAEjB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAA;IAElB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,YAAY,CAAA;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,OAQ9C"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { ViewProps } from '..';
|
|
2
|
+
import { EffectDefinition } from '../../effects';
|
|
3
|
+
/**
|
|
4
|
+
* Props for NineSliceButton component
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* This component creates a button with a NineSlice background and a content area.
|
|
8
|
+
* The content area is automatically sized to exclude the slice borders.
|
|
9
|
+
*
|
|
10
|
+
* **IMPORTANT - Atlas/Texture Configuration:**
|
|
11
|
+
*
|
|
12
|
+
* The slice dimensions (leftWidth, rightWidth, topHeight, bottomHeight) must match
|
|
13
|
+
* the actual design of your texture asset in the texture atlas. These values define
|
|
14
|
+
* which parts of the source image are the "corners" and "edges" vs the "center".
|
|
15
|
+
*
|
|
16
|
+
* **Things to consider:**
|
|
17
|
+
* - Inspect your texture atlas to determine the correct slice values
|
|
18
|
+
* - The slice values are in pixels of the SOURCE texture, not the scaled button
|
|
19
|
+
* - Sum of leftWidth + rightWidth should be less than the source texture width
|
|
20
|
+
* - Sum of topHeight + bottomHeight should be less than the source texture height
|
|
21
|
+
* - Width and height props define the FINAL size of the button after scaling
|
|
22
|
+
* - The center area will stretch, but corners and edges maintain their size
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* // For a button texture that is 64x32 in the atlas with 8px corners:
|
|
27
|
+
* <NineSliceButton
|
|
28
|
+
* texture="ui"
|
|
29
|
+
* frame="button-green"
|
|
30
|
+
* width={200} // Final button width
|
|
31
|
+
* height={80} // Final button height
|
|
32
|
+
* leftWidth={8} // Left edge is 8px in source texture
|
|
33
|
+
* rightWidth={8} // Right edge is 8px in source texture
|
|
34
|
+
* topHeight={8} // Top edge is 8px in source texture
|
|
35
|
+
* bottomHeight={8} // Bottom edge is 8px in source texture
|
|
36
|
+
* onClick={() => console.log('clicked')}
|
|
37
|
+
* >
|
|
38
|
+
* <Text text="Click Me" />
|
|
39
|
+
* </NineSliceButton>
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```tsx
|
|
44
|
+
* // Horizontal-only (3-slice) button - omit topHeight/bottomHeight:
|
|
45
|
+
* <NineSliceButton
|
|
46
|
+
* texture="ui"
|
|
47
|
+
* frame="progress-bar"
|
|
48
|
+
* width={300}
|
|
49
|
+
* height={40}
|
|
50
|
+
* leftWidth={10}
|
|
51
|
+
* rightWidth={10}
|
|
52
|
+
* >
|
|
53
|
+
* <Text text="Progress: 75%" />
|
|
54
|
+
* </NineSliceButton>
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export interface NineSliceButtonProps extends ViewProps, EffectDefinition {
|
|
58
|
+
/**
|
|
59
|
+
* Texture key from the loaded texture atlas
|
|
60
|
+
* Must be loaded before use (e.g., in a preload scene)
|
|
61
|
+
*/
|
|
62
|
+
texture: string;
|
|
63
|
+
/**
|
|
64
|
+
* Frame name or index within the texture atlas
|
|
65
|
+
* Optional if the texture is not an atlas
|
|
66
|
+
*/
|
|
67
|
+
frame?: string | number;
|
|
68
|
+
/**
|
|
69
|
+
* Width of the left slice in pixels of the SOURCE texture
|
|
70
|
+
* This defines the non-stretching left border/corner area
|
|
71
|
+
*/
|
|
72
|
+
leftWidth: number;
|
|
73
|
+
/**
|
|
74
|
+
* Width of the right slice in pixels of the SOURCE texture
|
|
75
|
+
* This defines the non-stretching right border/corner area
|
|
76
|
+
*/
|
|
77
|
+
rightWidth: number;
|
|
78
|
+
/**
|
|
79
|
+
* Height of the top slice in pixels of the SOURCE texture
|
|
80
|
+
* This defines the non-stretching top border/corner area
|
|
81
|
+
* Optional - omit for 3-slice (horizontal only) mode
|
|
82
|
+
*/
|
|
83
|
+
topHeight?: number;
|
|
84
|
+
/**
|
|
85
|
+
* Height of the bottom slice in pixels of the SOURCE texture
|
|
86
|
+
* This defines the non-stretching bottom border/corner area
|
|
87
|
+
* Optional - omit for 3-slice (horizontal only) mode
|
|
88
|
+
*/
|
|
89
|
+
bottomHeight?: number;
|
|
90
|
+
/**
|
|
91
|
+
* Click handler for button interaction
|
|
92
|
+
*/
|
|
93
|
+
onClick?: () => void;
|
|
94
|
+
disabled?: boolean;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* NineSliceButton component - creates a scalable button with NineSlice background
|
|
98
|
+
*
|
|
99
|
+
* This is a convenience wrapper around NineSlice + View that handles:
|
|
100
|
+
* - Stack layout for background and content
|
|
101
|
+
* - Automatic inner content area calculation
|
|
102
|
+
* - Click interaction handling
|
|
103
|
+
* - Proper content alignment
|
|
104
|
+
*
|
|
105
|
+
* @param props - NineSliceButton properties
|
|
106
|
+
* @returns JSX element representing a button with NineSlice background
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```tsx
|
|
110
|
+
* <NineSliceButton
|
|
111
|
+
* texture="ui"
|
|
112
|
+
* frame="button-blue"
|
|
113
|
+
* width={250}
|
|
114
|
+
* height={100}
|
|
115
|
+
* leftWidth={20}
|
|
116
|
+
* rightWidth={20}
|
|
117
|
+
* topHeight={15}
|
|
118
|
+
* bottomHeight={15}
|
|
119
|
+
* onClick={() => console.log('Button clicked!')}
|
|
120
|
+
* alignItems="center"
|
|
121
|
+
* justifyContent="center"
|
|
122
|
+
* >
|
|
123
|
+
* <Text text="Click Me!" style={{ fontSize: 24 }} />
|
|
124
|
+
* </NineSliceButton>
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
export declare function NineSliceButton(props: NineSliceButtonProps): any;
|
|
128
|
+
//# sourceMappingURL=NineSliceButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NineSliceButton.d.ts","sourceRoot":"","sources":["../../../src/components/custom/NineSliceButton.tsx"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B;;;;;GAKG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAA;AACnC,OAAO,EAIL,KAAK,gBAAgB,EACtB,MAAM,eAAe,CAAA;AAMtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,MAAM,WAAW,oBAAqB,SAAQ,SAAS,EAAE,gBAAgB;IACvE;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAA;IAEf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAEvB;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAA;IAEjB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAA;IAElB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IAGpB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,OAgG1D"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ChildrenType } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Props for Portal component
|
|
4
|
+
*/
|
|
5
|
+
export interface PortalProps {
|
|
6
|
+
/** Unique key for VDOM identification */
|
|
7
|
+
key?: string | number | undefined;
|
|
8
|
+
/** Content to render in portal */
|
|
9
|
+
children: ChildrenType;
|
|
10
|
+
/** Z-depth for portal (higher = foreground) */
|
|
11
|
+
depth?: number;
|
|
12
|
+
/** Optional custom portal ID */
|
|
13
|
+
id?: string;
|
|
14
|
+
/** Block events (click-through and scrolling) - default: true */
|
|
15
|
+
blockEvents?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Portal component
|
|
19
|
+
* Renders child VNode into a separate container tree at specified depth.
|
|
20
|
+
* Automatically injects event blockers to prevent click-through and scrolling.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* // Basic portal (automatically blocks events in content area)
|
|
25
|
+
* <Portal depth={1000}>
|
|
26
|
+
* <View>Overlay content</View>
|
|
27
|
+
* </Portal>
|
|
28
|
+
*
|
|
29
|
+
* // Non-blocking portal (allows click-through)
|
|
30
|
+
* <Portal depth={500} blockEvents={false}>
|
|
31
|
+
* <View>Info overlay - clickable background</View>
|
|
32
|
+
* </Portal>
|
|
33
|
+
*
|
|
34
|
+
* // Portal with custom event handling (original handlers are preserved)
|
|
35
|
+
* <Portal depth={1000}>
|
|
36
|
+
* <View onTouch={(e) => console.log('clicked')}>
|
|
37
|
+
* Content
|
|
38
|
+
* </View>
|
|
39
|
+
* </Portal>
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare function Portal(props: PortalProps): null;
|
|
43
|
+
//# sourceMappingURL=Portal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Portal.d.ts","sourceRoot":"","sources":["../../../src/components/custom/Portal.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAG/C;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,yCAAyC;IACzC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IACjC,kCAAkC;IAClC,QAAQ,EAAE,YAAY,CAAA;IACtB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,gCAAgC;IAChC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,iEAAiE;IACjE,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,QAsGxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Portal.test.d.ts","sourceRoot":"","sources":["../../../src/components/custom/Portal.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props for RadioButton component
|
|
3
|
+
*/
|
|
4
|
+
export interface RadioButtonProps {
|
|
5
|
+
/** Unique key for VDOM identification */
|
|
6
|
+
key?: string | number | undefined;
|
|
7
|
+
/** Label text for the radio button */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Whether this radio button is selected */
|
|
10
|
+
selected?: boolean;
|
|
11
|
+
/** Callback when radio button is clicked */
|
|
12
|
+
onClick?: () => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* RadioButton component - displays a selectable circle with label
|
|
16
|
+
* @param props - RadioButton properties
|
|
17
|
+
* @returns RadioButton JSX element
|
|
18
|
+
*/
|
|
19
|
+
export declare function RadioButton(props: RadioButtonProps): any;
|
|
20
|
+
//# sourceMappingURL=RadioButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioButton.d.ts","sourceRoot":"","sources":["../../../src/components/custom/RadioButton.tsx"],"names":[],"mappings":"AAOA;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,yCAAyC;IACzC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IACjC,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAA;IACb,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,4CAA4C;IAC5C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,OAuClD"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** @jsxImportSource ../.. */
|
|
2
|
+
/**
|
|
3
|
+
* RadioGroup component - Manages a group of radio buttons with single-selection logic
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Option item for RadioGroup
|
|
7
|
+
*/
|
|
8
|
+
export interface RadioGroupOption {
|
|
9
|
+
/** Unique value for this option */
|
|
10
|
+
value: string;
|
|
11
|
+
/** Display label for this option */
|
|
12
|
+
label: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Props for RadioGroup component
|
|
16
|
+
*/
|
|
17
|
+
export interface RadioGroupProps {
|
|
18
|
+
/** Array of options to display */
|
|
19
|
+
options: RadioGroupOption[];
|
|
20
|
+
/** Currently selected value */
|
|
21
|
+
value?: string;
|
|
22
|
+
/** Callback when selection changes */
|
|
23
|
+
onChange?: (value: string) => void;
|
|
24
|
+
/** Layout direction (default: 'column') */
|
|
25
|
+
direction?: 'row' | 'column';
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* RadioGroup component - displays a group of radio buttons with single-selection
|
|
29
|
+
* @param props - RadioGroup properties
|
|
30
|
+
* @returns RadioGroup JSX element
|
|
31
|
+
*/
|
|
32
|
+
export declare function RadioGroup(props: RadioGroupProps): any;
|
|
33
|
+
//# sourceMappingURL=RadioGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../../src/components/custom/RadioGroup.tsx"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B;;GAEG;AAQH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAA;IACb,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,kCAAkC;IAClC,OAAO,EAAE,gBAAgB,EAAE,CAAA;IAC3B,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,sCAAsC;IACtC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,2CAA2C;IAC3C,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAA;CAC7B;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,OAqDhD"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ChildrenType } from '../../types';
|
|
2
|
+
import { ViewProps } from '..';
|
|
3
|
+
/**
|
|
4
|
+
* Extended ViewProps with origin support
|
|
5
|
+
*/
|
|
6
|
+
export interface RefOriginViewProps extends Omit<ViewProps, 'x' | 'y' | 'children'> {
|
|
7
|
+
/**
|
|
8
|
+
* Origin X for rotation and scale (0 = left, 0.5 = center, 1 = right)
|
|
9
|
+
* @default 0.5
|
|
10
|
+
*/
|
|
11
|
+
originX?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Origin Y for rotation and scale (0 = top, 0.5 = center, 1 = bottom)
|
|
14
|
+
* @default 0.5
|
|
15
|
+
*/
|
|
16
|
+
originY?: number;
|
|
17
|
+
/**
|
|
18
|
+
* X position of the view
|
|
19
|
+
*/
|
|
20
|
+
x?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Y position of the view
|
|
23
|
+
*/
|
|
24
|
+
y?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Children nodes.
|
|
27
|
+
*/
|
|
28
|
+
children?: ChildrenType;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* RefOriginView component - ref-based transforms around custom origin point
|
|
32
|
+
*
|
|
33
|
+
* Returns ref to middle View positioned at the origin point, enabling
|
|
34
|
+
* imperative transformations. Calculates actual dimensions after layout.
|
|
35
|
+
*
|
|
36
|
+
* Uses nested View structure internally:
|
|
37
|
+
* - Outer View: Defines bounding box and position
|
|
38
|
+
* - Middle View: Positioned at origin point, receives ref (transform target)
|
|
39
|
+
* - Inner View: Contains actual content, offset by negative padding
|
|
40
|
+
*
|
|
41
|
+
* @param props - RefOriginView props
|
|
42
|
+
* @returns JSX element
|
|
43
|
+
*/
|
|
44
|
+
export declare function RefOriginView({ originX, originY, x, y, width, height, ref, padding, children, ...viewProps }: RefOriginViewProps): any;
|
|
45
|
+
//# sourceMappingURL=RefOriginView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RefOriginView.d.ts","sourceRoot":"","sources":["../../../src/components/custom/RefOriginView.tsx"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAE7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAA;AAInC;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,SAAS,EAAE,GAAG,GAAG,GAAG,GAAG,UAAU,CAAC;IACjF;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,CAAA;IACV;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,CAAA;IACV;;OAEG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAA;CACxB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,EAC5B,OAAa,EACb,OAAa,EACb,CAAK,EACL,CAAK,EACL,KAAK,EACL,MAAM,EACN,GAAG,EACH,OAAO,EACP,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,kBAAkB,OA4DpB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** Size variants for the scroll slider */
|
|
2
|
+
export type SliderSize = 'large' | 'medium' | 'small' | 'tiny' | undefined;
|
|
3
|
+
/**
|
|
4
|
+
* Calculate slider dimensions based on size variant and theme
|
|
5
|
+
* @param size - Size variant
|
|
6
|
+
* @returns Calculated dimensions
|
|
7
|
+
*/
|
|
8
|
+
export declare function calculateSliderSize(size: SliderSize): {
|
|
9
|
+
border: number;
|
|
10
|
+
outer: number;
|
|
11
|
+
dimension: number;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Props for ScrollSlider component
|
|
15
|
+
*/
|
|
16
|
+
export interface ScrollSliderProps {
|
|
17
|
+
/** Direction of the slider */
|
|
18
|
+
direction: 'vertical' | 'horizontal';
|
|
19
|
+
/** Whether to a size variant, default is medium */
|
|
20
|
+
size?: SliderSize;
|
|
21
|
+
/** Current scroll position in pixels */
|
|
22
|
+
scrollPosition: number;
|
|
23
|
+
/** Viewport size in pixels */
|
|
24
|
+
viewportSize: number;
|
|
25
|
+
/** Content size in pixels */
|
|
26
|
+
contentSize: number;
|
|
27
|
+
/** Callback when slider is scrolled, returns new scroll position in pixels */
|
|
28
|
+
onScroll: (scrollPosition: number) => void;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* ScrollSlider component providing slider functionality for ScrollView
|
|
32
|
+
* @param props - ScrollSlider properties
|
|
33
|
+
* @returns JSX element
|
|
34
|
+
*/
|
|
35
|
+
export declare function ScrollSlider(props: ScrollSliderProps): any;
|
|
36
|
+
//# sourceMappingURL=ScrollSlider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollSlider.d.ts","sourceRoot":"","sources":["../../../src/components/custom/ScrollSlider.tsx"],"names":[],"mappings":"AAWA,0CAA0C;AAC1C,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAA;AAE1E;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU;;;;EAQnD;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,8BAA8B;IAC9B,SAAS,EAAE,UAAU,GAAG,YAAY,CAAA;IACpC,mDAAmD;IACnD,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,wCAAwC;IACxC,cAAc,EAAE,MAAM,CAAA;IACtB,8BAA8B;IAC9B,YAAY,EAAE,MAAM,CAAA;IACpB,6BAA6B;IAC7B,WAAW,EAAE,MAAM,CAAA;IACnB,8EAA8E;IAC9E,QAAQ,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI,CAAA;CAC3C;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,OAyHpD"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ViewProps } from '..';
|
|
2
|
+
import { SliderSize } from './ScrollSlider';
|
|
3
|
+
/**
|
|
4
|
+
* Scroll information data
|
|
5
|
+
*/
|
|
6
|
+
export interface ScrollInfo {
|
|
7
|
+
/** Current horizontal scroll position */
|
|
8
|
+
dx: number;
|
|
9
|
+
/** Current vertical scroll position */
|
|
10
|
+
dy: number;
|
|
11
|
+
/** Viewport width */
|
|
12
|
+
viewportWidth: number;
|
|
13
|
+
/** Viewport height */
|
|
14
|
+
viewportHeight: number;
|
|
15
|
+
/** Content width */
|
|
16
|
+
contentWidth: number;
|
|
17
|
+
/** Content height */
|
|
18
|
+
contentHeight: number;
|
|
19
|
+
/** Maximum horizontal scroll */
|
|
20
|
+
maxScrollX: number;
|
|
21
|
+
/** Maximum vertical scroll */
|
|
22
|
+
maxScrollY: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Props for ScrollView component
|
|
26
|
+
*/
|
|
27
|
+
export interface ScrollViewProps extends ViewProps {
|
|
28
|
+
/** Whether to show the vertical scroll slider (default: auto) */
|
|
29
|
+
showVerticalSlider?: boolean | 'auto' | undefined;
|
|
30
|
+
/** Whether to show the vertical scroll slider (default: auto) */
|
|
31
|
+
showHorizontalSlider?: boolean | 'auto' | undefined;
|
|
32
|
+
/** Size variant for the scroll sliders */
|
|
33
|
+
sliderSize?: SliderSize;
|
|
34
|
+
/** Initial scroll position */
|
|
35
|
+
scroll?: {
|
|
36
|
+
dx: number;
|
|
37
|
+
dy: number;
|
|
38
|
+
};
|
|
39
|
+
/** Callback when scroll information changes */
|
|
40
|
+
onScrollInfoChange?: (info: ScrollInfo) => void;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* ScrollView component providing a scrollable area with an optional vertical slider
|
|
44
|
+
* @param props - ScrollView properties
|
|
45
|
+
* @returns JSX element
|
|
46
|
+
*/
|
|
47
|
+
export declare function ScrollView(props: ScrollViewProps): any;
|
|
48
|
+
//# sourceMappingURL=ScrollView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollView.d.ts","sourceRoot":"","sources":["../../../src/components/custom/ScrollView.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAA;AAKnC,OAAO,EAAqC,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEnF;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,yCAAyC;IACzC,EAAE,EAAE,MAAM,CAAA;IACV,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAA;IACV,qBAAqB;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,sBAAsB;IACtB,cAAc,EAAE,MAAM,CAAA;IACtB,oBAAoB;IACpB,YAAY,EAAE,MAAM,CAAA;IACpB,qBAAqB;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,gCAAgC;IAChC,UAAU,EAAE,MAAM,CAAA;IAClB,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,iEAAiE;IACjE,kBAAkB,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAA;IACjD,iEAAiE;IACjE,oBAAoB,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAA;IACnD,0CAA0C;IAC1C,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,8BAA8B;IAC9B,MAAM,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAA;IACnC,+CAA+C;IAC/C,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAA;CAChD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,OAwQhD"}
|