@number10/jsx-core 5.0.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 +38 -0
- package/dist/animation/animated-signal.cjs +19 -0
- package/dist/animation/animated-signal.cjs.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/animated-signal.js +19 -0
- package/dist/animation/animated-signal.js.map +1 -0
- package/dist/animation/create-spring.cjs +80 -0
- package/dist/animation/create-spring.cjs.map +1 -0
- package/dist/animation/create-spring.d.ts +56 -0
- package/dist/animation/create-spring.d.ts.map +1 -0
- package/dist/animation/create-spring.js +80 -0
- package/dist/animation/create-spring.js.map +1 -0
- package/dist/animation/easing.cjs +76 -0
- package/dist/animation/easing.cjs.map +1 -0
- package/dist/animation/easing.d.ts +45 -0
- package/dist/animation/easing.d.ts.map +1 -0
- package/dist/animation/easing.js +76 -0
- package/dist/animation/easing.js.map +1 -0
- package/dist/animation/effect-definitions.cjs +441 -0
- package/dist/animation/effect-definitions.cjs.map +1 -0
- package/dist/animation/effect-definitions.d.ts +60 -0
- package/dist/animation/effect-definitions.d.ts.map +1 -0
- package/dist/animation/effect-definitions.js +441 -0
- package/dist/animation/effect-definitions.js.map +1 -0
- package/dist/animation/effect-engine.cjs +189 -0
- package/dist/animation/effect-engine.cjs.map +1 -0
- package/dist/animation/effect-engine.d.ts +70 -0
- package/dist/animation/effect-engine.d.ts.map +1 -0
- package/dist/animation/effect-engine.js +189 -0
- package/dist/animation/effect-engine.js.map +1 -0
- package/dist/animation/index.d.ts +24 -0
- package/dist/animation/index.d.ts.map +1 -0
- package/dist/animation/spring-physics.cjs +94 -0
- package/dist/animation/spring-physics.cjs.map +1 -0
- package/dist/animation/spring-physics.d.ts +145 -0
- package/dist/animation/spring-physics.d.ts.map +1 -0
- package/dist/animation/spring-physics.js +94 -0
- package/dist/animation/spring-physics.js.map +1 -0
- package/dist/animation/tween.cjs +67 -0
- package/dist/animation/tween.cjs.map +1 -0
- package/dist/animation/tween.d.ts +60 -0
- package/dist/animation/tween.d.ts.map +1 -0
- package/dist/animation/tween.js +67 -0
- package/dist/animation/tween.js.map +1 -0
- package/dist/animation/types.d.ts +31 -0
- package/dist/animation/types.d.ts.map +1 -0
- package/dist/animation/useSpring.cjs +152 -0
- package/dist/animation/useSpring.cjs.map +1 -0
- package/dist/animation/useSpring.d.ts +55 -0
- package/dist/animation/useSpring.d.ts.map +1 -0
- package/dist/animation/useSpring.js +149 -0
- package/dist/animation/useSpring.js.map +1 -0
- package/dist/animation/useTween.cjs +208 -0
- package/dist/animation/useTween.cjs.map +1 -0
- package/dist/animation/useTween.d.ts +116 -0
- package/dist/animation/useTween.d.ts.map +1 -0
- package/dist/animation/useTween.js +208 -0
- package/dist/animation/useTween.js.map +1 -0
- package/dist/border-geometry.cjs +447 -0
- package/dist/border-geometry.cjs.map +1 -0
- package/dist/border-geometry.d.ts +114 -0
- package/dist/border-geometry.d.ts.map +1 -0
- package/dist/border-geometry.js +447 -0
- package/dist/border-geometry.js.map +1 -0
- package/dist/colors/color-presets.cjs +236 -0
- package/dist/colors/color-presets.cjs.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-presets.js +236 -0
- package/dist/colors/color-presets.js.map +1 -0
- package/dist/colors/color-theme-helpers.cjs +32 -0
- package/dist/colors/color-theme-helpers.cjs.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-theme-helpers.js +32 -0
- package/dist/colors/color-theme-helpers.js.map +1 -0
- package/dist/colors/color-types.cjs +38 -0
- package/dist/colors/color-types.cjs.map +1 -0
- package/dist/colors/color-types.d.ts +112 -0
- package/dist/colors/color-types.d.ts.map +1 -0
- package/dist/colors/color-types.js +38 -0
- package/dist/colors/color-types.js.map +1 -0
- package/dist/colors/color-utils.cjs +197 -0
- package/dist/colors/color-utils.cjs.map +1 -0
- package/dist/colors/color-utils.d.ts +216 -0
- package/dist/colors/color-utils.d.ts.map +1 -0
- package/dist/colors/color-utils.js +197 -0
- package/dist/colors/color-utils.js.map +1 -0
- package/dist/colors/contrast-contracts.cjs +265 -0
- package/dist/colors/contrast-contracts.cjs.map +1 -0
- package/dist/colors/contrast-contracts.d.ts +289 -0
- package/dist/colors/contrast-contracts.d.ts.map +1 -0
- package/dist/colors/contrast-contracts.js +265 -0
- package/dist/colors/contrast-contracts.js.map +1 -0
- package/dist/colors/index.cjs +55 -0
- package/dist/colors/index.cjs.map +1 -0
- package/dist/colors/index.d.ts +16 -0
- package/dist/colors/index.d.ts.map +1 -0
- package/dist/colors/index.js +55 -0
- package/dist/colors/index.js.map +1 -0
- package/dist/core-props.cjs +66 -0
- package/dist/core-props.cjs.map +1 -0
- package/dist/core-props.d.ts +395 -0
- package/dist/core-props.d.ts.map +1 -0
- package/dist/core-props.js +66 -0
- package/dist/core-props.js.map +1 -0
- package/dist/design-tokens/design-token-presets.cjs +91 -0
- package/dist/design-tokens/design-token-presets.cjs.map +1 -0
- package/dist/design-tokens/design-token-presets.d.ts +34 -0
- package/dist/design-tokens/design-token-presets.d.ts.map +1 -0
- package/dist/design-tokens/design-token-presets.js +91 -0
- package/dist/design-tokens/design-token-presets.js.map +1 -0
- package/dist/design-tokens/design-token-types.d.ts +97 -0
- package/dist/design-tokens/design-token-types.d.ts.map +1 -0
- package/dist/design-tokens/index.cjs +10 -0
- package/dist/design-tokens/index.cjs.map +1 -0
- package/dist/design-tokens/index.d.ts +9 -0
- package/dist/design-tokens/index.d.ts.map +1 -0
- package/dist/design-tokens/index.js +10 -0
- package/dist/design-tokens/index.js.map +1 -0
- package/dist/dev-config.cjs +296 -0
- package/dist/dev-config.cjs.map +1 -0
- package/dist/dev-config.d.ts +238 -0
- package/dist/dev-config.d.ts.map +1 -0
- package/dist/dev-config.js +296 -0
- package/dist/dev-config.js.map +1 -0
- package/dist/effects.cjs +69 -0
- package/dist/effects.cjs.map +1 -0
- package/dist/effects.d.ts +152 -0
- package/dist/effects.d.ts.map +1 -0
- package/dist/effects.js +69 -0
- package/dist/effects.js.map +1 -0
- package/dist/global-registry.cjs +25 -0
- package/dist/global-registry.cjs.map +1 -0
- package/dist/global-registry.d.ts +19 -0
- package/dist/global-registry.d.ts.map +1 -0
- package/dist/global-registry.js +25 -0
- package/dist/global-registry.js.map +1 -0
- package/dist/hooks.cjs +378 -0
- package/dist/hooks.cjs.map +1 -0
- package/dist/hooks.d.ts +322 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +378 -0
- package/dist/hooks.js.map +1 -0
- package/dist/host-adapter.d.ts +414 -0
- package/dist/host-adapter.d.ts.map +1 -0
- package/dist/index.cjs +229 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +226 -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 +44 -0
- package/dist/jsx-runtime.cjs.map +1 -0
- package/dist/jsx-runtime.d.ts +24 -0
- package/dist/jsx-runtime.d.ts.map +1 -0
- package/dist/jsx-runtime.js +44 -0
- package/dist/jsx-runtime.js.map +1 -0
- package/dist/jsx-types.d.ts +25 -0
- package/dist/jsx-types.d.ts.map +1 -0
- package/dist/layout/appliers/container-applier.cjs +20 -0
- package/dist/layout/appliers/container-applier.cjs.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/container-applier.js +20 -0
- package/dist/layout/appliers/container-applier.js.map +1 -0
- package/dist/layout/appliers/position-applier.cjs +31 -0
- package/dist/layout/appliers/position-applier.cjs.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/appliers/position-applier.js +31 -0
- package/dist/layout/appliers/position-applier.js.map +1 -0
- package/dist/layout/layout-engine-test-utils.d.ts +26 -0
- package/dist/layout/layout-engine-test-utils.d.ts.map +1 -0
- package/dist/layout/layout-engine.cjs +628 -0
- package/dist/layout/layout-engine.cjs.map +1 -0
- package/dist/layout/layout-engine.d.ts +140 -0
- package/dist/layout/layout-engine.d.ts.map +1 -0
- package/dist/layout/layout-engine.js +628 -0
- package/dist/layout/layout-engine.js.map +1 -0
- package/dist/layout/strategies/base-strategy.cjs +31 -0
- package/dist/layout/strategies/base-strategy.cjs.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/base-strategy.js +31 -0
- package/dist/layout/strategies/base-strategy.js.map +1 -0
- package/dist/layout/strategies/column-layout.cjs +145 -0
- package/dist/layout/strategies/column-layout.cjs.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/column-layout.js +145 -0
- package/dist/layout/strategies/column-layout.js.map +1 -0
- package/dist/layout/strategies/row-layout.cjs +145 -0
- package/dist/layout/strategies/row-layout.cjs.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/row-layout.js +145 -0
- package/dist/layout/strategies/row-layout.js.map +1 -0
- package/dist/layout/strategies/stack-layout.cjs +94 -0
- package/dist/layout/strategies/stack-layout.cjs.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/strategies/stack-layout.js +94 -0
- package/dist/layout/strategies/stack-layout.js.map +1 -0
- package/dist/layout/types.d.ts +134 -0
- package/dist/layout/types.d.ts.map +1 -0
- package/dist/layout/utils/child-utils.cjs +129 -0
- package/dist/layout/utils/child-utils.cjs.map +1 -0
- package/dist/layout/utils/child-utils.d.ts +54 -0
- package/dist/layout/utils/child-utils.d.ts.map +1 -0
- package/dist/layout/utils/child-utils.js +129 -0
- package/dist/layout/utils/child-utils.js.map +1 -0
- package/dist/layout/utils/dimension-calculator.cjs +109 -0
- package/dist/layout/utils/dimension-calculator.cjs.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/dimension-calculator.js +109 -0
- package/dist/layout/utils/dimension-calculator.js.map +1 -0
- package/dist/layout/utils/flex-distributor.cjs +173 -0
- package/dist/layout/utils/flex-distributor.cjs.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/flex-distributor.js +173 -0
- package/dist/layout/utils/flex-distributor.js.map +1 -0
- package/dist/layout/utils/size-resolver.cjs +280 -0
- package/dist/layout/utils/size-resolver.cjs.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/size-resolver.js +280 -0
- package/dist/layout/utils/size-resolver.js.map +1 -0
- package/dist/layout/utils/spacing-calculator.cjs +50 -0
- package/dist/layout/utils/spacing-calculator.cjs.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/layout/utils/spacing-calculator.js +50 -0
- package/dist/layout/utils/spacing-calculator.js.map +1 -0
- package/dist/memo.cjs +18 -0
- package/dist/memo.cjs.map +1 -0
- package/dist/memo.d.ts +29 -0
- package/dist/memo.d.ts.map +1 -0
- package/dist/memo.js +18 -0
- package/dist/memo.js.map +1 -0
- package/dist/nineslice-contract.cjs +60 -0
- package/dist/nineslice-contract.cjs.map +1 -0
- package/dist/nineslice-contract.d.ts +107 -0
- package/dist/nineslice-contract.d.ts.map +1 -0
- package/dist/nineslice-contract.js +60 -0
- package/dist/nineslice-contract.js.map +1 -0
- package/dist/placeholder.cjs +12 -0
- package/dist/placeholder.cjs.map +1 -0
- package/dist/placeholder.d.ts +44 -0
- package/dist/placeholder.d.ts.map +1 -0
- package/dist/placeholder.js +12 -0
- package/dist/placeholder.js.map +1 -0
- package/dist/portal.cjs +89 -0
- package/dist/portal.cjs.map +1 -0
- package/dist/portal.d.ts +62 -0
- package/dist/portal.d.ts.map +1 -0
- package/dist/portal.js +89 -0
- package/dist/portal.js.map +1 -0
- package/dist/primitive-contracts.cjs +12 -0
- package/dist/primitive-contracts.cjs.map +1 -0
- package/dist/primitive-contracts.d.ts +186 -0
- package/dist/primitive-contracts.d.ts.map +1 -0
- package/dist/primitive-contracts.js +12 -0
- package/dist/primitive-contracts.js.map +1 -0
- package/dist/theme.cjs +332 -0
- package/dist/theme.cjs.map +1 -0
- package/dist/theme.d.ts +204 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +332 -0
- package/dist/theme.js.map +1 -0
- package/dist/types.d.ts +86 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/vdom/create-runtime.cjs +79 -0
- package/dist/vdom/create-runtime.cjs.map +1 -0
- package/dist/vdom/create-runtime.d.ts +7 -0
- package/dist/vdom/create-runtime.d.ts.map +1 -0
- package/dist/vdom/create-runtime.js +79 -0
- package/dist/vdom/create-runtime.js.map +1 -0
- package/dist/vdom/index.cjs +8 -0
- package/dist/vdom/index.cjs.map +1 -0
- package/dist/vdom/index.d.ts +4 -0
- package/dist/vdom/index.d.ts.map +1 -0
- package/dist/vdom/index.js +8 -0
- package/dist/vdom/index.js.map +1 -0
- package/dist/vdom/mount.cjs +161 -0
- package/dist/vdom/mount.cjs.map +1 -0
- package/dist/vdom/mount.d.ts +6 -0
- package/dist/vdom/mount.d.ts.map +1 -0
- package/dist/vdom/mount.js +161 -0
- package/dist/vdom/mount.js.map +1 -0
- package/dist/vdom/patch.cjs +163 -0
- package/dist/vdom/patch.cjs.map +1 -0
- package/dist/vdom/patch.d.ts +3 -0
- package/dist/vdom/patch.d.ts.map +1 -0
- package/dist/vdom/patch.js +163 -0
- package/dist/vdom/patch.js.map +1 -0
- package/dist/vdom/registry.cjs +85 -0
- package/dist/vdom/registry.cjs.map +1 -0
- package/dist/vdom/registry.d.ts +28 -0
- package/dist/vdom/registry.d.ts.map +1 -0
- package/dist/vdom/registry.js +85 -0
- package/dist/vdom/registry.js.map +1 -0
- package/dist/vdom/runtime-helpers.cjs +23 -0
- package/dist/vdom/runtime-helpers.cjs.map +1 -0
- package/dist/vdom/runtime-helpers.d.ts +8 -0
- package/dist/vdom/runtime-helpers.d.ts.map +1 -0
- package/dist/vdom/runtime-helpers.js +23 -0
- package/dist/vdom/runtime-helpers.js.map +1 -0
- package/dist/vdom/surface.cjs +107 -0
- package/dist/vdom/surface.cjs.map +1 -0
- package/dist/vdom/surface.d.ts +9 -0
- package/dist/vdom/surface.d.ts.map +1 -0
- package/dist/vdom/surface.js +107 -0
- package/dist/vdom/surface.js.map +1 -0
- package/dist/vdom/types.d.ts +104 -0
- package/dist/vdom/types.d.ts.map +1 -0
- package/dist/vdom/utils.cjs +146 -0
- package/dist/vdom/utils.cjs.map +1 -0
- package/dist/vdom/utils.d.ts +24 -0
- package/dist/vdom/utils.d.ts.map +1 -0
- package/dist/vdom/utils.js +146 -0
- package/dist/vdom/utils.js.map +1 -0
- package/dist/vdom.d.ts +4 -0
- package/dist/vdom.d.ts.map +1 -0
- package/dist/vector-draw-context.d.ts +63 -0
- package/dist/vector-draw-context.d.ts.map +1 -0
- package/package.json +161 -0
- package/vdom/index.cjs +1 -0
- package/vdom/index.d.ts +1 -0
- package/vdom/index.js +1 -0
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
import { AnimatedSignal } from './animation/animated-signal';
|
|
2
|
+
/**
|
|
3
|
+
* Utility type that allows a value to be either a direct value or an
|
|
4
|
+
* {@link AnimatedSignal}. Enables direct binding of `useSpring` / `useTween`
|
|
5
|
+
* signals to JSX props without needing `useForceRedraw` + `.value`.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* const [x, setX] = useSpring(0)
|
|
10
|
+
* <View x={x} /> // ✅ x is Animatable<number> → accepts AnimatedSignal
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export type Animatable<T> = T | AnimatedSignal;
|
|
14
|
+
/**
|
|
15
|
+
* Valid CSS-like size values with type safety
|
|
16
|
+
* - Fixed pixels: number or "20px"
|
|
17
|
+
* - Percentage: "50%", "100%"
|
|
18
|
+
* - Viewport units: "100vw", "50vh"
|
|
19
|
+
* - Keywords: "auto", "fill"
|
|
20
|
+
* - Calc expressions: "calc(100% - 20px)"
|
|
21
|
+
*/
|
|
22
|
+
export type SizeValue = number | 'auto' | 'fill' | `${number}%` | `${number}px` | `${number}vw` | `${number}vh` | `calc(${string})`;
|
|
23
|
+
/**
|
|
24
|
+
* Flex basis size values (subset of SizeValue, no "fill" keyword)
|
|
25
|
+
*/
|
|
26
|
+
export type FlexBasisValue = number | 'auto' | `${number}%` | `${number}px` | `${number}vw` | `${number}vh` | `calc(${string})`;
|
|
27
|
+
/**
|
|
28
|
+
* Display mode for visibility control
|
|
29
|
+
* - 'visible': Rendered and takes up layout space (default)
|
|
30
|
+
* - 'invisible': Not rendered but takes up layout space
|
|
31
|
+
* - 'none': Not rendered and does not take up layout space
|
|
32
|
+
*/
|
|
33
|
+
export type Display = 'visible' | 'invisible' | 'none';
|
|
34
|
+
/**
|
|
35
|
+
* Viewport dimensions used for overlay clamping and positioning.
|
|
36
|
+
*/
|
|
37
|
+
export interface ViewportSize {
|
|
38
|
+
width: number;
|
|
39
|
+
height: number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Clamp a position so that a box of the given size stays within the viewport.
|
|
43
|
+
* @param x - Desired x position (left edge of the box)
|
|
44
|
+
* @param y - Desired y position (top edge of the box)
|
|
45
|
+
* @param boxWidth - Width of the box to clamp
|
|
46
|
+
* @param boxHeight - Height of the box to clamp
|
|
47
|
+
* @param viewport - Viewport dimensions
|
|
48
|
+
* @param padding - Minimum padding from viewport edges (default 8)
|
|
49
|
+
* @returns Clamped { x, y } position
|
|
50
|
+
*/
|
|
51
|
+
export declare function clampToViewport(x: number, y: number, boxWidth: number, boxHeight: number, viewport: ViewportSize, padding?: number): {
|
|
52
|
+
x: number;
|
|
53
|
+
y: number;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Calculate the preferred placement for an overlay relative to an anchor rect.
|
|
57
|
+
* Returns the anchor-relative position before viewport clamping.
|
|
58
|
+
* @param placement - Preferred placement direction
|
|
59
|
+
* @param anchor - Anchor rect in viewport coordinates
|
|
60
|
+
* @param contentWidth - Width of the overlay content
|
|
61
|
+
* @param contentHeight - Height of the overlay content
|
|
62
|
+
* @param offset - Gap between anchor and overlay (default 4)
|
|
63
|
+
* @returns Position relative to the anchor
|
|
64
|
+
*/
|
|
65
|
+
export declare function getOverlayPosition(placement: 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end', anchor: {
|
|
66
|
+
x: number;
|
|
67
|
+
y: number;
|
|
68
|
+
width: number;
|
|
69
|
+
height: number;
|
|
70
|
+
}, contentWidth: number, contentHeight: number, offset?: number): {
|
|
71
|
+
x: number;
|
|
72
|
+
y: number;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Transform properties — geometric transformations (position, rotation, scale)
|
|
76
|
+
* and visual opacity.
|
|
77
|
+
*/
|
|
78
|
+
export interface TransformProps {
|
|
79
|
+
x?: Animatable<number>;
|
|
80
|
+
y?: Animatable<number>;
|
|
81
|
+
rotation?: Animatable<number>;
|
|
82
|
+
scale?: Animatable<number>;
|
|
83
|
+
scaleX?: Animatable<number>;
|
|
84
|
+
scaleY?: Animatable<number>;
|
|
85
|
+
/** Alpha transparency (0 = fully transparent, 1 = fully opaque) */
|
|
86
|
+
alpha?: Animatable<number>;
|
|
87
|
+
/**
|
|
88
|
+
* Z-order / render depth. Higher values render on top.
|
|
89
|
+
* Supported by both Phaser (native depth property) and Pixi (child index).
|
|
90
|
+
*/
|
|
91
|
+
depth?: number;
|
|
92
|
+
}
|
|
93
|
+
/** Edge insets for margins and padding */
|
|
94
|
+
export interface EdgeInsets {
|
|
95
|
+
top?: number;
|
|
96
|
+
right?: number;
|
|
97
|
+
bottom?: number;
|
|
98
|
+
left?: number;
|
|
99
|
+
}
|
|
100
|
+
/** Gap insets for horizontal and vertical gaps */
|
|
101
|
+
export interface GapInsets {
|
|
102
|
+
horizontal?: number;
|
|
103
|
+
vertical?: number;
|
|
104
|
+
}
|
|
105
|
+
/** Corner radius specification */
|
|
106
|
+
export interface CornerRadiusInsets {
|
|
107
|
+
tl?: number;
|
|
108
|
+
tr?: number;
|
|
109
|
+
bl?: number;
|
|
110
|
+
br?: number;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Normalize edge insets — converts number to all-sides object
|
|
114
|
+
*/
|
|
115
|
+
export declare function normalizeEdgeInsets(value: number | EdgeInsets | undefined): EdgeInsets;
|
|
116
|
+
/**
|
|
117
|
+
* Normalize corner radius — converts number to all-corners object
|
|
118
|
+
*/
|
|
119
|
+
export declare function normalizeCornerRadius(value: number | CornerRadiusInsets | undefined): number | CornerRadiusInsets;
|
|
120
|
+
/**
|
|
121
|
+
* Normalize gap values — converts number to GapInsets object
|
|
122
|
+
*/
|
|
123
|
+
export declare function normalizeGap(value: number | GapInsets | undefined): {
|
|
124
|
+
horizontal: number;
|
|
125
|
+
vertical: number;
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* Layout properties — sizing, spacing, and layout participation.
|
|
129
|
+
* Renderer-neutral. Every renderer maps these to its native layout system.
|
|
130
|
+
*/
|
|
131
|
+
export interface LayoutProps {
|
|
132
|
+
/** Visibility and layout participation */
|
|
133
|
+
visible?: boolean | Display;
|
|
134
|
+
/** If true, object is rendered but excluded from layout calculations */
|
|
135
|
+
headless?: boolean;
|
|
136
|
+
/** Width: number (px), "50%", "100vw", "auto", "fill", "calc(...)" */
|
|
137
|
+
width?: SizeValue | undefined;
|
|
138
|
+
/** Height: number (px), "50%", "100vh", "auto", "fill", "calc(...)" */
|
|
139
|
+
height?: SizeValue | undefined;
|
|
140
|
+
/** Minimum width constraint */
|
|
141
|
+
minWidth?: SizeValue | undefined;
|
|
142
|
+
/** Minimum height constraint */
|
|
143
|
+
minHeight?: SizeValue | undefined;
|
|
144
|
+
/** Maximum width constraint */
|
|
145
|
+
maxWidth?: SizeValue | undefined;
|
|
146
|
+
/** Maximum height constraint */
|
|
147
|
+
maxHeight?: SizeValue | undefined;
|
|
148
|
+
/** Margin outside the container */
|
|
149
|
+
margin?: number | EdgeInsets | undefined;
|
|
150
|
+
/** Padding inside the container */
|
|
151
|
+
padding?: number | EdgeInsets | undefined;
|
|
152
|
+
/** Layout direction: 'column' (default), 'row', 'stack' */
|
|
153
|
+
direction?: 'row' | 'column' | 'stack';
|
|
154
|
+
/** Gap between children */
|
|
155
|
+
gap?: number | GapInsets | undefined;
|
|
156
|
+
/** Main axis alignment */
|
|
157
|
+
justifyContent?: 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'space-evenly';
|
|
158
|
+
/** Cross axis alignment */
|
|
159
|
+
alignItems?: 'start' | 'center' | 'end' | 'stretch';
|
|
160
|
+
/** Flex grow factor */
|
|
161
|
+
flex?: number;
|
|
162
|
+
/** Flex shrink factor */
|
|
163
|
+
flexShrink?: number;
|
|
164
|
+
/** Flex basis — initial size before flex distribution */
|
|
165
|
+
flexBasis?: FlexBasisValue | undefined;
|
|
166
|
+
/** Overflow handling: 'visible' (default) or 'hidden' (clipped) */
|
|
167
|
+
overflow?: 'visible' | 'hidden';
|
|
168
|
+
/** Wrapping behavior for flex layouts */
|
|
169
|
+
flexWrap?: 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
170
|
+
/** Alignment of wrapped lines */
|
|
171
|
+
alignContent?: 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'stretch';
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Border line style for advanced border rendering.
|
|
175
|
+
* - `'solid'`: Continuous line (default)
|
|
176
|
+
* - `'dashed'`: Segmented line
|
|
177
|
+
* - `'dotted'`: Rounded dotted line
|
|
178
|
+
*/
|
|
179
|
+
export type BorderLineStyle = 'solid' | 'dashed' | 'dotted';
|
|
180
|
+
/**
|
|
181
|
+
* Per-side inset values for border widths.
|
|
182
|
+
* Each side can have a different thickness.
|
|
183
|
+
*/
|
|
184
|
+
export type BorderSideInsets<T> = {
|
|
185
|
+
top?: T;
|
|
186
|
+
right?: T;
|
|
187
|
+
bottom?: T;
|
|
188
|
+
left?: T;
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* Advanced border configuration — extended border styling beyond
|
|
192
|
+
* the legacy `borderWidth`/`borderColor`/`borderAlpha` props.
|
|
193
|
+
*
|
|
194
|
+
* When set on `BackgroundProps.border`, this object takes precedence
|
|
195
|
+
* over the legacy border props.
|
|
196
|
+
*/
|
|
197
|
+
export interface BorderPropsV2 {
|
|
198
|
+
/** Border color (number, e.g. 0xff0000 for red) */
|
|
199
|
+
color?: number;
|
|
200
|
+
/**
|
|
201
|
+
* Border opacity.
|
|
202
|
+
* Accepts either a plain value or an {@link AnimatedSignal}.
|
|
203
|
+
*/
|
|
204
|
+
alpha?: Animatable<number>;
|
|
205
|
+
/**
|
|
206
|
+
* Border width in pixels.
|
|
207
|
+
* - `number`: uniform width on all sides (supports `cornerRadius`)
|
|
208
|
+
* - `BorderSideInsets<number>`: per-side widths (supports `cornerRadius`)
|
|
209
|
+
*/
|
|
210
|
+
width?: number | BorderSideInsets<number>;
|
|
211
|
+
/** Line style: `'solid'` (default), `'dashed'`, or `'dotted'` */
|
|
212
|
+
style?: BorderLineStyle;
|
|
213
|
+
/**
|
|
214
|
+
* Stroke pattern configuration.
|
|
215
|
+
*
|
|
216
|
+
* For `style: 'dashed'`, values are interpreted as alternating dash/gap
|
|
217
|
+
* lengths, e.g. `[5, 3]`.
|
|
218
|
+
*
|
|
219
|
+
* For `style: 'dotted'`, `dash[0]` is the gap and `dash[1]` optionally
|
|
220
|
+
* overrides the dot diameter.
|
|
221
|
+
*/
|
|
222
|
+
dash?: number[];
|
|
223
|
+
/** Offset where the dash pattern starts */
|
|
224
|
+
dashOffset?: number;
|
|
225
|
+
/** Line cap style: `'butt'`, `'round'`, `'square'`. */
|
|
226
|
+
cap?: 'butt' | 'round' | 'square';
|
|
227
|
+
/** Line join style: `'miter'`, `'round'`, `'bevel'`. */
|
|
228
|
+
join?: 'miter' | 'round' | 'bevel';
|
|
229
|
+
/**
|
|
230
|
+
* Border alignment relative to the edge: `'center'`, `'inside'`, `'outside'`.
|
|
231
|
+
* - `center`: centered on the edge
|
|
232
|
+
* - `inside`: fully inside the box
|
|
233
|
+
* - `outside`: fully outside the box
|
|
234
|
+
*/
|
|
235
|
+
align?: 'center' | 'inside' | 'outside';
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Background styling properties — renderer-neutral.
|
|
239
|
+
* Each renderer maps colors and corner radii to its native drawing API.
|
|
240
|
+
*/
|
|
241
|
+
export interface BackgroundProps {
|
|
242
|
+
backgroundColor?: number | undefined;
|
|
243
|
+
/**
|
|
244
|
+
* Background fill opacity.
|
|
245
|
+
* Accepts either a plain value or an {@link AnimatedSignal}.
|
|
246
|
+
*/
|
|
247
|
+
backgroundAlpha?: Animatable<number> | undefined;
|
|
248
|
+
cornerRadius?: number | CornerRadiusInsets | undefined;
|
|
249
|
+
borderWidth?: number | undefined;
|
|
250
|
+
borderColor?: number | undefined;
|
|
251
|
+
/**
|
|
252
|
+
* Border stroke opacity.
|
|
253
|
+
* Accepts either a plain value or an {@link AnimatedSignal}.
|
|
254
|
+
*/
|
|
255
|
+
borderAlpha?: Animatable<number> | undefined;
|
|
256
|
+
/**
|
|
257
|
+
* Advanced border configuration (BorderPropsV2).
|
|
258
|
+
* When set, takes precedence over legacy `borderWidth`/`borderColor`/`borderAlpha`.
|
|
259
|
+
*/
|
|
260
|
+
border?: BorderPropsV2 | undefined;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Touch move gesture state.
|
|
264
|
+
*/
|
|
265
|
+
export type TouchMoveState = 'start' | 'move' | 'end';
|
|
266
|
+
/**
|
|
267
|
+
* Data passed to gesture event handlers.
|
|
268
|
+
* Renderer-agnostic — the pointer field is opaque.
|
|
269
|
+
* Each renderer fills it with its own pointer type.
|
|
270
|
+
*/
|
|
271
|
+
export interface GestureEventData<TPointer = unknown> {
|
|
272
|
+
/** Renderer-specific pointer object */
|
|
273
|
+
pointer: TPointer;
|
|
274
|
+
/** Local X coordinate relative to container origin (0,0) */
|
|
275
|
+
localX: number;
|
|
276
|
+
/** Local Y coordinate relative to container origin (0,0) */
|
|
277
|
+
localY: number;
|
|
278
|
+
/** Delta X since last move event (only for onTouchMove) */
|
|
279
|
+
dx?: number;
|
|
280
|
+
/** Delta Y since last move event (only for onTouchMove) */
|
|
281
|
+
dy?: number;
|
|
282
|
+
/** Width of the container's hit area */
|
|
283
|
+
width: number;
|
|
284
|
+
/** Height of the container's hit area */
|
|
285
|
+
height: number;
|
|
286
|
+
/** Whether pointer is currently inside the container hit area */
|
|
287
|
+
isInside?: boolean;
|
|
288
|
+
/** Current state of touch move gesture (only for onTouchMove) */
|
|
289
|
+
state?: TouchMoveState;
|
|
290
|
+
/** Stop event propagation to parent containers (DOM-style bubbling) */
|
|
291
|
+
stopPropagation(): void;
|
|
292
|
+
/** Check if propagation has been stopped */
|
|
293
|
+
isPropagationStopped(): boolean;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Data passed to wheel event handlers.
|
|
297
|
+
* Renderer-agnostic — pointer/originalEvent are opaque.
|
|
298
|
+
*/
|
|
299
|
+
export interface WheelEventData<TPointer = unknown, TOriginalEvent = unknown> {
|
|
300
|
+
/** Renderer-specific pointer object, if available */
|
|
301
|
+
pointer: TPointer;
|
|
302
|
+
/** Local X coordinate relative to container origin (0,0) */
|
|
303
|
+
localX: number;
|
|
304
|
+
/** Local Y coordinate relative to container origin (0,0) */
|
|
305
|
+
localY: number;
|
|
306
|
+
/** Wheel scroll delta X (horizontal scrolling) */
|
|
307
|
+
deltaX: number;
|
|
308
|
+
/** Wheel scroll delta Y (vertical scrolling) */
|
|
309
|
+
deltaY: number;
|
|
310
|
+
/** Wheel scroll delta Z */
|
|
311
|
+
deltaZ: number;
|
|
312
|
+
/** Delta mode: 0 = pixels, 1 = lines, 2 = pages */
|
|
313
|
+
deltaMode: number;
|
|
314
|
+
/** Width of the container's hit area */
|
|
315
|
+
width: number;
|
|
316
|
+
/** Height of the container's hit area */
|
|
317
|
+
height: number;
|
|
318
|
+
/** Original platform wheel event */
|
|
319
|
+
originalEvent: TOriginalEvent;
|
|
320
|
+
/** Stop event propagation to parent containers (DOM-style bubbling) */
|
|
321
|
+
stopPropagation(): void;
|
|
322
|
+
/** Check if propagation has been stopped */
|
|
323
|
+
isPropagationStopped(): boolean;
|
|
324
|
+
/** Prevent default browser behavior */
|
|
325
|
+
preventDefault(): void;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Tooltip position relative to the target element.
|
|
329
|
+
*/
|
|
330
|
+
export type TooltipPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
331
|
+
/**
|
|
332
|
+
* Renderer-neutral tooltip animation configuration.
|
|
333
|
+
* Renderers may ignore fields they cannot represent.
|
|
334
|
+
*/
|
|
335
|
+
export interface TooltipAnimation {
|
|
336
|
+
fadeIn?: number;
|
|
337
|
+
fadeOut?: number;
|
|
338
|
+
move?: {
|
|
339
|
+
dx?: number;
|
|
340
|
+
dy?: number;
|
|
341
|
+
};
|
|
342
|
+
pulse?: boolean;
|
|
343
|
+
pulseScale?: [number, number];
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Tooltip configuration returned by `onTooltip`.
|
|
347
|
+
* Text-only on purpose so each renderer can draw it natively.
|
|
348
|
+
*/
|
|
349
|
+
export interface TooltipConfig {
|
|
350
|
+
content: string;
|
|
351
|
+
position?: TooltipPosition;
|
|
352
|
+
showDelay?: number;
|
|
353
|
+
hideDelay?: number;
|
|
354
|
+
offset?: number;
|
|
355
|
+
disabled?: boolean;
|
|
356
|
+
autoDismiss?: number;
|
|
357
|
+
animation?: TooltipAnimation;
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Tooltip callback function.
|
|
361
|
+
* Return `null` / `undefined` to disable the tooltip for the current hover.
|
|
362
|
+
*/
|
|
363
|
+
export type TooltipCallback = () => TooltipConfig | string | null | undefined;
|
|
364
|
+
/**
|
|
365
|
+
* High-level gesture interaction props.
|
|
366
|
+
* Renderer-neutral — each renderer provides its own GestureManager.
|
|
367
|
+
*/
|
|
368
|
+
export interface GestureProps<TPointer = unknown> {
|
|
369
|
+
/** Enable gesture system for this container */
|
|
370
|
+
enableGestures?: boolean;
|
|
371
|
+
/** Called on pointer down + up on the same target (click/tap) */
|
|
372
|
+
onTouch?: (data: GestureEventData<TPointer>) => void;
|
|
373
|
+
/** Called when pointer up occurs outside the container */
|
|
374
|
+
onTouchOutside?: (data: GestureEventData<TPointer>) => void;
|
|
375
|
+
/** Called during pointer movement */
|
|
376
|
+
onTouchMove?: (data: GestureEventData<TPointer>) => void;
|
|
377
|
+
/** Called when double tap/click is detected */
|
|
378
|
+
onDoubleTap?: (data: GestureEventData<TPointer>) => void;
|
|
379
|
+
/** Called when pointer is held down for configured duration */
|
|
380
|
+
onLongPress?: (data: GestureEventData<TPointer>) => void;
|
|
381
|
+
/** Called when mouse wheel / trackpad scroll occurs over the container */
|
|
382
|
+
onWheel?: (data: WheelEventData<TPointer>) => void;
|
|
383
|
+
/**
|
|
384
|
+
* Tooltip configuration callback (desktop / pointer hover only).
|
|
385
|
+
* The API is portable, the renderer decides how to draw it.
|
|
386
|
+
*/
|
|
387
|
+
onTooltip?: TooltipCallback;
|
|
388
|
+
/** Duration in ms to trigger long press (default: 500ms) */
|
|
389
|
+
longPressDuration?: number;
|
|
390
|
+
/** Max time in ms between taps for double tap (default: 300ms) */
|
|
391
|
+
doubleTapDelay?: number;
|
|
392
|
+
/** Max time in ms for a valid touch/click (default: 500ms) */
|
|
393
|
+
maxTouchDuration?: number;
|
|
394
|
+
}
|
|
395
|
+
//# sourceMappingURL=core-props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-props.d.ts","sourceRoot":"","sources":["../src/core-props.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAMjE;;;;;;;;;;GAUG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,cAAc,CAAA;AAM9C;;;;;;;GAOG;AACH,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,MAAM,GACN,MAAM,GACN,GAAG,MAAM,GAAG,GACZ,GAAG,MAAM,IAAI,GACb,GAAG,MAAM,IAAI,GACb,GAAG,MAAM,IAAI,GACb,QAAQ,MAAM,GAAG,CAAA;AAErB;;GAEG;AACH,MAAM,MAAM,cAAc,GACtB,MAAM,GACN,MAAM,GACN,GAAG,MAAM,GAAG,GACZ,GAAG,MAAM,IAAI,GACb,GAAG,MAAM,IAAI,GACb,GAAG,MAAM,IAAI,GACb,QAAQ,MAAM,GAAG,CAAA;AAErB;;;;;GAKG;AACH,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,WAAW,GAAG,MAAM,CAAA;AAMtD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC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IAAI,EAAE,gBAAgB,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAA;IAEpD,0DAA0D;IAC1D,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAA;IAE3D,qCAAqC;IACrC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAA;IAExD,+CAA+C;IAC/C,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAA;IAExD,+DAA+D;IAC/D,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAA;IAExD,0EAA0E;IAC1E,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAA;IAElD;;;OAGG;IACH,SAAS,CAAC,EAAE,eAAe,CAAA;IAE3B,4DAA4D;IAC5D,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAE1B,kEAAkE;IAClE,cAAc,CAAC,EAAE,MAAM,CAAA;IAEvB,8DAA8D;IAC9D,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
function clampToViewport(x, y, boxWidth, boxHeight, viewport, padding = 8) {
|
|
2
|
+
return {
|
|
3
|
+
x: Math.min(Math.max(padding, x), Math.max(padding, viewport.width - boxWidth - padding)),
|
|
4
|
+
y: Math.min(Math.max(padding, y), Math.max(padding, viewport.height - boxHeight - padding))
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
function getOverlayPosition(placement, anchor, contentWidth, contentHeight, offset = 4) {
|
|
8
|
+
const cx = anchor.x + anchor.width / 2;
|
|
9
|
+
const cy = anchor.y + anchor.height / 2;
|
|
10
|
+
switch (placement) {
|
|
11
|
+
case "top":
|
|
12
|
+
return { x: cx - contentWidth / 2, y: anchor.y - contentHeight - offset };
|
|
13
|
+
case "bottom":
|
|
14
|
+
return { x: cx - contentWidth / 2, y: anchor.y + anchor.height + offset };
|
|
15
|
+
case "left":
|
|
16
|
+
return { x: anchor.x - contentWidth - offset, y: cy - contentHeight / 2 };
|
|
17
|
+
case "right":
|
|
18
|
+
return { x: anchor.x + anchor.width + offset, y: cy - contentHeight / 2 };
|
|
19
|
+
case "top-start":
|
|
20
|
+
return { x: anchor.x, y: anchor.y - contentHeight - offset };
|
|
21
|
+
case "top-end":
|
|
22
|
+
return { x: anchor.x + anchor.width - contentWidth, y: anchor.y - contentHeight - offset };
|
|
23
|
+
case "bottom-start":
|
|
24
|
+
return { x: anchor.x, y: anchor.y + anchor.height + offset };
|
|
25
|
+
case "bottom-end":
|
|
26
|
+
return { x: anchor.x + anchor.width - contentWidth, y: anchor.y + anchor.height + offset };
|
|
27
|
+
case "left-start":
|
|
28
|
+
return { x: anchor.x - contentWidth - offset, y: anchor.y };
|
|
29
|
+
case "left-end":
|
|
30
|
+
return { x: anchor.x - contentWidth - offset, y: anchor.y + anchor.height - contentHeight };
|
|
31
|
+
case "right-start":
|
|
32
|
+
return { x: anchor.x + anchor.width + offset, y: anchor.y };
|
|
33
|
+
case "right-end":
|
|
34
|
+
return { x: anchor.x + anchor.width + offset, y: anchor.y + anchor.height - contentHeight };
|
|
35
|
+
default:
|
|
36
|
+
return { x: cx - contentWidth / 2, y: anchor.y + anchor.height + offset };
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function normalizeEdgeInsets(value) {
|
|
40
|
+
if (value === void 0) return {};
|
|
41
|
+
if (typeof value === "number") {
|
|
42
|
+
return { top: value, right: value, bottom: value, left: value };
|
|
43
|
+
}
|
|
44
|
+
return value;
|
|
45
|
+
}
|
|
46
|
+
function normalizeCornerRadius(value) {
|
|
47
|
+
if (value === void 0) return 0;
|
|
48
|
+
if (typeof value === "number") return value;
|
|
49
|
+
return value;
|
|
50
|
+
}
|
|
51
|
+
function normalizeGap(value) {
|
|
52
|
+
if (value === void 0) return { horizontal: 0, vertical: 0 };
|
|
53
|
+
if (typeof value === "number") return { horizontal: value, vertical: value };
|
|
54
|
+
return {
|
|
55
|
+
horizontal: value.horizontal ?? 0,
|
|
56
|
+
vertical: value.vertical ?? 0
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export {
|
|
60
|
+
clampToViewport,
|
|
61
|
+
getOverlayPosition,
|
|
62
|
+
normalizeCornerRadius,
|
|
63
|
+
normalizeEdgeInsets,
|
|
64
|
+
normalizeGap
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=core-props.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-props.js","sources":["../src/core-props.ts"],"sourcesContent":["/**\n * Core prop type definitions — renderer-neutral component properties.\n * These prop groups can be composed to build component-specific props.\n *\n * @migration(audit:scene-portal-mount) Phase 3A — split from packages/ui/src/core-props.ts.\n * Portable types live here in @number10/jsx-core. Phaser-specific props\n * (PhaserProps, TextSpecificProps, GestureProps) remain in the Phaser package.\n */\n\nimport type { AnimatedSignal } from './animation/animated-signal'\n\n// ---------------------------------------------------------------------------\n// Animatable value helper\n// ---------------------------------------------------------------------------\n\n/**\n * Utility type that allows a value to be either a direct value or an\n * {@link AnimatedSignal}. Enables direct binding of `useSpring` / `useTween`\n * signals to JSX props without needing `useForceRedraw` + `.value`.\n *\n * @example\n * ```tsx\n * const [x, setX] = useSpring(0)\n * <View x={x} /> // ✅ x is Animatable<number> → accepts AnimatedSignal\n * ```\n */\nexport type Animatable<T> = T | AnimatedSignal\n\n// ---------------------------------------------------------------------------\n// Size value types\n// ---------------------------------------------------------------------------\n\n/**\n * Valid CSS-like size values with type safety\n * - Fixed pixels: number or \"20px\"\n * - Percentage: \"50%\", \"100%\"\n * - Viewport units: \"100vw\", \"50vh\"\n * - Keywords: \"auto\", \"fill\"\n * - Calc expressions: \"calc(100% - 20px)\"\n */\nexport type SizeValue =\n | number\n | 'auto'\n | 'fill'\n | `${number}%`\n | `${number}px`\n | `${number}vw`\n | `${number}vh`\n | `calc(${string})`\n\n/**\n * Flex basis size values (subset of SizeValue, no \"fill\" keyword)\n */\nexport type FlexBasisValue =\n | number\n | 'auto'\n | `${number}%`\n | `${number}px`\n | `${number}vw`\n | `${number}vh`\n | `calc(${string})`\n\n/**\n * Display mode for visibility control\n * - 'visible': Rendered and takes up layout space (default)\n * - 'invisible': Not rendered but takes up layout space\n * - 'none': Not rendered and does not take up layout space\n */\nexport type Display = 'visible' | 'invisible' | 'none'\n\n// ---------------------------------------------------------------------------\n// Viewport helpers (portable, for overlay positioning)\n// ---------------------------------------------------------------------------\n\n/**\n * Viewport dimensions used for overlay clamping and positioning.\n */\nexport interface ViewportSize {\n width: number\n height: number\n}\n\n/**\n * Clamp a position so that a box of the given size stays within the viewport.\n * @param x - Desired x position (left edge of the box)\n * @param y - Desired y position (top edge of the box)\n * @param boxWidth - Width of the box to clamp\n * @param boxHeight - Height of the box to clamp\n * @param viewport - Viewport dimensions\n * @param padding - Minimum padding from viewport edges (default 8)\n * @returns Clamped { x, y } position\n */\nexport function clampToViewport(\n x: number,\n y: number,\n boxWidth: number,\n boxHeight: number,\n viewport: ViewportSize,\n padding = 8\n): { x: number; y: number } {\n return {\n x: Math.min(Math.max(padding, x), Math.max(padding, viewport.width - boxWidth - padding)),\n y: Math.min(Math.max(padding, y), Math.max(padding, viewport.height - boxHeight - padding)),\n }\n}\n\n/**\n * Calculate the preferred placement for an overlay relative to an anchor rect.\n * Returns the anchor-relative position before viewport clamping.\n * @param placement - Preferred placement direction\n * @param anchor - Anchor rect in viewport coordinates\n * @param contentWidth - Width of the overlay content\n * @param contentHeight - Height of the overlay content\n * @param offset - Gap between anchor and overlay (default 4)\n * @returns Position relative to the anchor\n */\nexport function getOverlayPosition(\n placement:\n | 'top'\n | 'bottom'\n | 'left'\n | 'right'\n | 'top-start'\n | 'top-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'left-start'\n | 'left-end'\n | 'right-start'\n | 'right-end',\n anchor: { x: number; y: number; width: number; height: number },\n contentWidth: number,\n contentHeight: number,\n offset = 4\n): { x: number; y: number } {\n const cx = anchor.x + anchor.width / 2\n const cy = anchor.y + anchor.height / 2\n\n switch (placement) {\n case 'top':\n return { x: cx - contentWidth / 2, y: anchor.y - contentHeight - offset }\n case 'bottom':\n return { x: cx - contentWidth / 2, y: anchor.y + anchor.height + offset }\n case 'left':\n return { x: anchor.x - contentWidth - offset, y: cy - contentHeight / 2 }\n case 'right':\n return { x: anchor.x + anchor.width + offset, y: cy - contentHeight / 2 }\n case 'top-start':\n return { x: anchor.x, y: anchor.y - contentHeight - offset }\n case 'top-end':\n return { x: anchor.x + anchor.width - contentWidth, y: anchor.y - contentHeight - offset }\n case 'bottom-start':\n return { x: anchor.x, y: anchor.y + anchor.height + offset }\n case 'bottom-end':\n return { x: anchor.x + anchor.width - contentWidth, y: anchor.y + anchor.height + offset }\n case 'left-start':\n return { x: anchor.x - contentWidth - offset, y: anchor.y }\n case 'left-end':\n return { x: anchor.x - contentWidth - offset, y: anchor.y + anchor.height - contentHeight }\n case 'right-start':\n return { x: anchor.x + anchor.width + offset, y: anchor.y }\n case 'right-end':\n return { x: anchor.x + anchor.width + offset, y: anchor.y + anchor.height - contentHeight }\n default:\n return { x: cx - contentWidth / 2, y: anchor.y + anchor.height + offset }\n }\n}\n\n// ---------------------------------------------------------------------------\n// Geometric properties\n// ---------------------------------------------------------------------------\n\n/**\n * Transform properties — geometric transformations (position, rotation, scale)\n * and visual opacity.\n */\nexport interface TransformProps {\n x?: Animatable<number>\n y?: Animatable<number>\n rotation?: Animatable<number>\n scale?: Animatable<number>\n scaleX?: Animatable<number>\n scaleY?: Animatable<number>\n /** Alpha transparency (0 = fully transparent, 1 = fully opaque) */\n alpha?: Animatable<number>\n /**\n * Z-order / render depth. Higher values render on top.\n * Supported by both Phaser (native depth property) and Pixi (child index).\n */\n depth?: number\n}\n\n// ---------------------------------------------------------------------------\n// Spacing types\n// ---------------------------------------------------------------------------\n\n/** Edge insets for margins and padding */\nexport interface EdgeInsets {\n top?: number\n right?: number\n bottom?: number\n left?: number\n}\n\n/** Gap insets for horizontal and vertical gaps */\nexport interface GapInsets {\n horizontal?: number\n vertical?: number\n}\n\n/** Corner radius specification */\nexport interface CornerRadiusInsets {\n tl?: number\n tr?: number\n bl?: number\n br?: number\n}\n\n// ---------------------------------------------------------------------------\n// Normalization helpers\n// ---------------------------------------------------------------------------\n\n/**\n * Normalize edge insets — converts number to all-sides object\n */\nexport function normalizeEdgeInsets(value: number | EdgeInsets | undefined): EdgeInsets {\n if (value === undefined) return {}\n if (typeof value === 'number') {\n return { top: value, right: value, bottom: value, left: value }\n }\n return value\n}\n\n/**\n * Normalize corner radius — converts number to all-corners object\n */\nexport function normalizeCornerRadius(\n value: number | CornerRadiusInsets | undefined\n): number | CornerRadiusInsets {\n if (value === undefined) return 0\n if (typeof value === 'number') return value\n return value\n}\n\n/**\n * Normalize gap values — converts number to GapInsets object\n */\nexport function normalizeGap(value: number | GapInsets | undefined): {\n horizontal: number\n vertical: number\n} {\n if (value === undefined) return { horizontal: 0, vertical: 0 }\n if (typeof value === 'number') return { horizontal: value, vertical: value }\n return {\n horizontal: value.horizontal ?? 0,\n vertical: value.vertical ?? 0,\n }\n}\n\n// ---------------------------------------------------------------------------\n// Layout properties\n// ---------------------------------------------------------------------------\n\n/**\n * Layout properties — sizing, spacing, and layout participation.\n * Renderer-neutral. Every renderer maps these to its native layout system.\n */\nexport interface LayoutProps {\n /** Visibility and layout participation */\n visible?: boolean | Display\n\n /** If true, object is rendered but excluded from layout calculations */\n headless?: boolean\n\n /** Width: number (px), \"50%\", \"100vw\", \"auto\", \"fill\", \"calc(...)\" */\n width?: SizeValue | undefined\n\n /** Height: number (px), \"50%\", \"100vh\", \"auto\", \"fill\", \"calc(...)\" */\n height?: SizeValue | undefined\n\n /** Minimum width constraint */\n minWidth?: SizeValue | undefined\n\n /** Minimum height constraint */\n minHeight?: SizeValue | undefined\n\n /** Maximum width constraint */\n maxWidth?: SizeValue | undefined\n\n /** Maximum height constraint */\n maxHeight?: SizeValue | undefined\n\n /** Margin outside the container */\n margin?: number | EdgeInsets | undefined\n\n /** Padding inside the container */\n padding?: number | EdgeInsets | undefined\n\n /** Layout direction: 'column' (default), 'row', 'stack' */\n direction?: 'row' | 'column' | 'stack'\n\n /** Gap between children */\n gap?: number | GapInsets | undefined\n\n /** Main axis alignment */\n justifyContent?: 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'space-evenly'\n\n /** Cross axis alignment */\n alignItems?: 'start' | 'center' | 'end' | 'stretch'\n\n /** Flex grow factor */\n flex?: number\n\n /** Flex shrink factor */\n flexShrink?: number\n\n /** Flex basis — initial size before flex distribution */\n flexBasis?: FlexBasisValue | undefined\n\n /** Overflow handling: 'visible' (default) or 'hidden' (clipped) */\n overflow?: 'visible' | 'hidden'\n\n /** Wrapping behavior for flex layouts */\n flexWrap?: 'nowrap' | 'wrap' | 'wrap-reverse'\n\n /** Alignment of wrapped lines */\n alignContent?: 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'stretch'\n}\n\n// ---------------------------------------------------------------------------\n// Advanced border types (BorderPropsV2)\n// ---------------------------------------------------------------------------\n\n/**\n * Border line style for advanced border rendering.\n * - `'solid'`: Continuous line (default)\n * - `'dashed'`: Segmented line\n * - `'dotted'`: Rounded dotted line\n */\nexport type BorderLineStyle = 'solid' | 'dashed' | 'dotted'\n\n/**\n * Per-side inset values for border widths.\n * Each side can have a different thickness.\n */\nexport type BorderSideInsets<T> = {\n top?: T\n right?: T\n bottom?: T\n left?: T\n}\n\n/**\n * Advanced border configuration — extended border styling beyond\n * the legacy `borderWidth`/`borderColor`/`borderAlpha` props.\n *\n * When set on `BackgroundProps.border`, this object takes precedence\n * over the legacy border props.\n */\nexport interface BorderPropsV2 {\n /** Border color (number, e.g. 0xff0000 for red) */\n color?: number\n /**\n * Border opacity.\n * Accepts either a plain value or an {@link AnimatedSignal}.\n */\n alpha?: Animatable<number>\n /**\n * Border width in pixels.\n * - `number`: uniform width on all sides (supports `cornerRadius`)\n * - `BorderSideInsets<number>`: per-side widths (supports `cornerRadius`)\n */\n width?: number | BorderSideInsets<number>\n /** Line style: `'solid'` (default), `'dashed'`, or `'dotted'` */\n style?: BorderLineStyle\n /**\n * Stroke pattern configuration.\n *\n * For `style: 'dashed'`, values are interpreted as alternating dash/gap\n * lengths, e.g. `[5, 3]`.\n *\n * For `style: 'dotted'`, `dash[0]` is the gap and `dash[1]` optionally\n * overrides the dot diameter.\n */\n dash?: number[]\n /** Offset where the dash pattern starts */\n dashOffset?: number\n /** Line cap style: `'butt'`, `'round'`, `'square'`. */\n cap?: 'butt' | 'round' | 'square'\n /** Line join style: `'miter'`, `'round'`, `'bevel'`. */\n join?: 'miter' | 'round' | 'bevel'\n /**\n * Border alignment relative to the edge: `'center'`, `'inside'`, `'outside'`.\n * - `center`: centered on the edge\n * - `inside`: fully inside the box\n * - `outside`: fully outside the box\n */\n align?: 'center' | 'inside' | 'outside'\n}\n\n// ---------------------------------------------------------------------------\n// Background properties\n// ---------------------------------------------------------------------------\n\n/**\n * Background styling properties — renderer-neutral.\n * Each renderer maps colors and corner radii to its native drawing API.\n */\nexport interface BackgroundProps {\n backgroundColor?: number | undefined\n /**\n * Background fill opacity.\n * Accepts either a plain value or an {@link AnimatedSignal}.\n */\n backgroundAlpha?: Animatable<number> | undefined\n cornerRadius?: number | CornerRadiusInsets | undefined\n borderWidth?: number | undefined\n borderColor?: number | undefined\n /**\n * Border stroke opacity.\n * Accepts either a plain value or an {@link AnimatedSignal}.\n */\n borderAlpha?: Animatable<number> | undefined\n /**\n * Advanced border configuration (BorderPropsV2).\n * When set, takes precedence over legacy `borderWidth`/`borderColor`/`borderAlpha`.\n */\n border?: BorderPropsV2 | undefined\n}\n\n// ---------------------------------------------------------------------------\n// Gesture properties — renderer-neutral touch / mouse / pointer contracts\n// ---------------------------------------------------------------------------\n\n/**\n * Touch move gesture state.\n */\nexport type TouchMoveState = 'start' | 'move' | 'end'\n\n/**\n * Data passed to gesture event handlers.\n * Renderer-agnostic — the pointer field is opaque.\n * Each renderer fills it with its own pointer type.\n */\nexport interface GestureEventData<TPointer = unknown> {\n /** Renderer-specific pointer object */\n pointer: TPointer\n /** Local X coordinate relative to container origin (0,0) */\n localX: number\n /** Local Y coordinate relative to container origin (0,0) */\n localY: number\n /** Delta X since last move event (only for onTouchMove) */\n dx?: number\n /** Delta Y since last move event (only for onTouchMove) */\n dy?: number\n /** Width of the container's hit area */\n width: number\n /** Height of the container's hit area */\n height: number\n /** Whether pointer is currently inside the container hit area */\n isInside?: boolean\n /** Current state of touch move gesture (only for onTouchMove) */\n state?: TouchMoveState\n\n /** Stop event propagation to parent containers (DOM-style bubbling) */\n stopPropagation(): void\n\n /** Check if propagation has been stopped */\n isPropagationStopped(): boolean\n}\n\n/**\n * Data passed to wheel event handlers.\n * Renderer-agnostic — pointer/originalEvent are opaque.\n */\nexport interface WheelEventData<TPointer = unknown, TOriginalEvent = unknown> {\n /** Renderer-specific pointer object, if available */\n pointer: TPointer\n /** Local X coordinate relative to container origin (0,0) */\n localX: number\n /** Local Y coordinate relative to container origin (0,0) */\n localY: number\n /** Wheel scroll delta X (horizontal scrolling) */\n deltaX: number\n /** Wheel scroll delta Y (vertical scrolling) */\n deltaY: number\n /** Wheel scroll delta Z */\n deltaZ: number\n /** Delta mode: 0 = pixels, 1 = lines, 2 = pages */\n deltaMode: number\n /** Width of the container's hit area */\n width: number\n /** Height of the container's hit area */\n height: number\n /** Original platform wheel event */\n originalEvent: TOriginalEvent\n\n /** Stop event propagation to parent containers (DOM-style bubbling) */\n stopPropagation(): void\n\n /** Check if propagation has been stopped */\n isPropagationStopped(): boolean\n\n /** Prevent default browser behavior */\n preventDefault(): void\n}\n\n/**\n * Tooltip position relative to the target element.\n */\nexport type TooltipPosition = 'top' | 'bottom' | 'left' | 'right'\n\n/**\n * Renderer-neutral tooltip animation configuration.\n * Renderers may ignore fields they cannot represent.\n */\nexport interface TooltipAnimation {\n fadeIn?: number\n fadeOut?: number\n move?: { dx?: number; dy?: number }\n pulse?: boolean\n pulseScale?: [number, number]\n}\n\n/**\n * Tooltip configuration returned by `onTooltip`.\n * Text-only on purpose so each renderer can draw it natively.\n */\nexport interface TooltipConfig {\n content: string\n position?: TooltipPosition\n showDelay?: number\n hideDelay?: number\n offset?: number\n disabled?: boolean\n autoDismiss?: number\n animation?: TooltipAnimation\n}\n\n/**\n * Tooltip callback function.\n * Return `null` / `undefined` to disable the tooltip for the current hover.\n */\nexport type TooltipCallback = () => TooltipConfig | string | null | undefined\n\n/**\n * High-level gesture interaction props.\n * Renderer-neutral — each renderer provides its own GestureManager.\n */\nexport interface GestureProps<TPointer = unknown> {\n /** Enable gesture system for this container */\n enableGestures?: boolean\n\n /** Called on pointer down + up on the same target (click/tap) */\n onTouch?: (data: GestureEventData<TPointer>) => void\n\n /** Called when pointer up occurs outside the container */\n onTouchOutside?: (data: GestureEventData<TPointer>) => void\n\n /** Called during pointer movement */\n onTouchMove?: (data: GestureEventData<TPointer>) => void\n\n /** Called when double tap/click is detected */\n onDoubleTap?: (data: GestureEventData<TPointer>) => void\n\n /** Called when pointer is held down for configured duration */\n onLongPress?: (data: GestureEventData<TPointer>) => void\n\n /** Called when mouse wheel / trackpad scroll occurs over the container */\n onWheel?: (data: WheelEventData<TPointer>) => void\n\n /**\n * Tooltip configuration callback (desktop / pointer hover only).\n * The API is portable, the renderer decides how to draw it.\n */\n onTooltip?: TooltipCallback\n\n /** Duration in ms to trigger long press (default: 500ms) */\n longPressDuration?: number\n\n /** Max time in ms between taps for double tap (default: 300ms) */\n doubleTapDelay?: number\n\n /** Max time in ms for a valid touch/click (default: 500ms) */\n maxTouchDuration?: number\n}\n"],"names":[],"mappings":"AA4FO,SAAS,gBACd,GACA,GACA,UACA,WACA,UACA,UAAU,GACgB;AAC1B,SAAO;AAAA,IACL,GAAG,KAAK,IAAI,KAAK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|
12
|
+
xs: 16,
|
|
13
|
+
sm: 24,
|
|
14
|
+
md: 32,
|
|
15
|
+
lg: 48,
|
|
16
|
+
xl: 64,
|
|
17
|
+
xxl: 96
|
|
18
|
+
};
|
|
19
|
+
const defaultRadiusTokens = {
|
|
20
|
+
none: 0,
|
|
21
|
+
sm: 4,
|
|
22
|
+
md: 8,
|
|
23
|
+
lg: 16,
|
|
24
|
+
xl: 24,
|
|
25
|
+
xxl: 48
|
|
26
|
+
};
|
|
27
|
+
function createTextStyleTokens(textColor) {
|
|
28
|
+
return {
|
|
29
|
+
DEFAULT: {
|
|
30
|
+
fontSize: "16px",
|
|
31
|
+
color: textColor,
|
|
32
|
+
fontFamily: "Arial",
|
|
33
|
+
align: "left"
|
|
34
|
+
},
|
|
35
|
+
small: {
|
|
36
|
+
fontSize: "12px",
|
|
37
|
+
color: textColor,
|
|
38
|
+
fontFamily: "Arial",
|
|
39
|
+
align: "left"
|
|
40
|
+
},
|
|
41
|
+
medium: {
|
|
42
|
+
fontSize: "16px",
|
|
43
|
+
color: textColor,
|
|
44
|
+
fontFamily: "Arial",
|
|
45
|
+
align: "left"
|
|
46
|
+
},
|
|
47
|
+
large: {
|
|
48
|
+
fontSize: "20px",
|
|
49
|
+
color: textColor,
|
|
50
|
+
fontFamily: "Arial",
|
|
51
|
+
align: "left"
|
|
52
|
+
},
|
|
53
|
+
title: {
|
|
54
|
+
fontSize: "28px",
|
|
55
|
+
color: textColor,
|
|
56
|
+
fontFamily: "Arial",
|
|
57
|
+
fontStyle: "bold",
|
|
58
|
+
align: "left"
|
|
59
|
+
},
|
|
60
|
+
heading: {
|
|
61
|
+
fontSize: "36px",
|
|
62
|
+
color: textColor,
|
|
63
|
+
fontFamily: "Arial",
|
|
64
|
+
fontStyle: "bold",
|
|
65
|
+
align: "left"
|
|
66
|
+
},
|
|
67
|
+
caption: {
|
|
68
|
+
fontSize: "10px",
|
|
69
|
+
color: textColor,
|
|
70
|
+
fontFamily: "Arial",
|
|
71
|
+
align: "left"
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
const defaultTextStyleTokens = createTextStyleTokens("#ffffff");
|
|
76
|
+
function createDesignTokens(preset) {
|
|
77
|
+
return {
|
|
78
|
+
colors: preset.colors,
|
|
79
|
+
textStyles: createTextStyleTokens(preset.colors.text.DEFAULT.toString()),
|
|
80
|
+
spacing: defaultSpacingTokens,
|
|
81
|
+
sizes: defaultSizeTokens,
|
|
82
|
+
radius: defaultRadiusTokens
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
exports.createDesignTokens = createDesignTokens;
|
|
86
|
+
exports.createTextStyleTokens = createTextStyleTokens;
|
|
87
|
+
exports.defaultRadiusTokens = defaultRadiusTokens;
|
|
88
|
+
exports.defaultSizeTokens = defaultSizeTokens;
|
|
89
|
+
exports.defaultSpacingTokens = defaultSpacingTokens;
|
|
90
|
+
exports.defaultTextStyleTokens = defaultTextStyleTokens;
|
|
91
|
+
//# sourceMappingURL=design-token-presets.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"design-token-presets.cjs","sources":["../../src/design-tokens/design-token-presets.ts"],"sourcesContent":["/**\n * Default design token presets\n * Provides sensible defaults for text styles, spacing, sizes, and radius,\n * plus factory functions to create complete DesignTokens from color presets.\n */\nimport type { ColorPreset } from '../colors/color-presets'\nimport type {\n DesignTokens,\n RadiusTokens,\n SizeTokens,\n SpacingTokens,\n TextStyleTokens,\n} from './design-token-types'\n\n/**\n * Default spacing scale\n * Based on 4px base unit\n */\nexport const defaultSpacingTokens: SpacingTokens = {\n xs: 4,\n sm: 8,\n md: 16,\n lg: 24,\n xl: 32,\n xxl: 48,\n}\n\n/**\n * Default size scale\n * For width, height, icon sizes, etc.\n */\nexport const defaultSizeTokens: SizeTokens = {\n xs: 16,\n sm: 24,\n md: 32,\n lg: 48,\n xl: 64,\n xxl: 96,\n}\n\n/**\n * Default border radius scale\n */\nexport const defaultRadiusTokens: RadiusTokens = {\n none: 0,\n sm: 4,\n md: 8,\n lg: 16,\n xl: 24,\n xxl: 48,\n}\n\n/**\n * Create text style tokens with the given base text color\n * @param textColor - Base text color (hex string)\n * @returns TextStyleTokens with color applied\n */\nexport function createTextStyleTokens(textColor: string): TextStyleTokens {\n return {\n DEFAULT: {\n fontSize: '16px',\n color: textColor,\n fontFamily: 'Arial',\n align: 'left',\n },\n small: {\n fontSize: '12px',\n color: textColor,\n fontFamily: 'Arial',\n align: 'left',\n },\n medium: {\n fontSize: '16px',\n color: textColor,\n fontFamily: 'Arial',\n align: 'left',\n },\n large: {\n fontSize: '20px',\n color: textColor,\n fontFamily: 'Arial',\n align: 'left',\n },\n title: {\n fontSize: '28px',\n color: textColor,\n fontFamily: 'Arial',\n fontStyle: 'bold',\n align: 'left',\n },\n heading: {\n fontSize: '36px',\n color: textColor,\n fontFamily: 'Arial',\n fontStyle: 'bold',\n align: 'left',\n },\n caption: {\n fontSize: '10px',\n color: textColor,\n fontFamily: 'Arial',\n align: 'left',\n },\n }\n}\n\n/**\n * Default text style tokens (white text)\n */\nexport const defaultTextStyleTokens: TextStyleTokens = createTextStyleTokens('#ffffff')\n\n/**\n * Create complete design tokens from a color preset.\n * Combines colors with default text styles, spacing, sizes, and radius tokens.\n * @param preset - Color preset (e.g., oceanBluePreset)\n * @returns Complete DesignTokens object\n */\nexport function createDesignTokens(preset: ColorPreset): DesignTokens {\n return {\n colors: preset.colors,\n textStyles: createTextStyleTokens(preset.colors.text.DEFAULT.toString()),\n spacing: defaultSpacingTokens,\n sizes: defaultSizeTokens,\n radius: defaultRadiusTokens,\n }\n}\n"],"names":[],"mappings":";;AAkBO,MAAM,uBAAsC;AAAA,EACjD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,KAAK;AACP;AAMO,MAAM,oBAAgC;AAAA,EAC3C,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAA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
|
1
|
+
import { ColorPreset } from '../colors/color-presets';
|
|
2
|
+
import { DesignTokens, RadiusTokens, SizeTokens, SpacingTokens, TextStyleTokens } from './design-token-types';
|
|
3
|
+
/**
|
|
4
|
+
* Default spacing scale
|
|
5
|
+
* Based on 4px base unit
|
|
6
|
+
*/
|
|
7
|
+
export declare const defaultSpacingTokens: SpacingTokens;
|
|
8
|
+
/**
|
|
9
|
+
* Default size scale
|
|
10
|
+
* For width, height, icon sizes, etc.
|
|
11
|
+
*/
|
|
12
|
+
export declare const defaultSizeTokens: SizeTokens;
|
|
13
|
+
/**
|
|
14
|
+
* Default border radius scale
|
|
15
|
+
*/
|
|
16
|
+
export declare const defaultRadiusTokens: RadiusTokens;
|
|
17
|
+
/**
|
|
18
|
+
* Create text style tokens with the given base text color
|
|
19
|
+
* @param textColor - Base text color (hex string)
|
|
20
|
+
* @returns TextStyleTokens with color applied
|
|
21
|
+
*/
|
|
22
|
+
export declare function createTextStyleTokens(textColor: string): TextStyleTokens;
|
|
23
|
+
/**
|
|
24
|
+
* Default text style tokens (white text)
|
|
25
|
+
*/
|
|
26
|
+
export declare const defaultTextStyleTokens: TextStyleTokens;
|
|
27
|
+
/**
|
|
28
|
+
* Create complete design tokens from a color preset.
|
|
29
|
+
* Combines colors with default text styles, spacing, sizes, and radius tokens.
|
|
30
|
+
* @param preset - Color preset (e.g., oceanBluePreset)
|
|
31
|
+
* @returns Complete DesignTokens object
|
|
32
|
+
*/
|
|
33
|
+
export declare function createDesignTokens(preset: ColorPreset): DesignTokens;
|
|
34
|
+
//# sourceMappingURL=design-token-presets.d.ts.map
|