@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,236 @@
|
|
|
1
|
+
import { HexColor } from "./color-types.js";
|
|
2
|
+
import { hexToNumber, numberToHex, hslToNumber, numberToHsl } from "./color-utils.js";
|
|
3
|
+
const LIGHT_NEUTRALS = {
|
|
4
|
+
background: {
|
|
5
|
+
lightest: "#ffffff",
|
|
6
|
+
light: "#fafafa",
|
|
7
|
+
medium: "#f0f0f0",
|
|
8
|
+
dark: "#e5e5e5",
|
|
9
|
+
darkest: "#d0d0d0"
|
|
10
|
+
},
|
|
11
|
+
surface: {
|
|
12
|
+
lightest: "#f5f5f5",
|
|
13
|
+
light: "#ebebeb",
|
|
14
|
+
medium: "#e0e0e0",
|
|
15
|
+
dark: "#d5d5d5",
|
|
16
|
+
darkest: "#c8c8c8"
|
|
17
|
+
},
|
|
18
|
+
text: {
|
|
19
|
+
lightest: "#e0e0e0",
|
|
20
|
+
light: "#666666",
|
|
21
|
+
medium: "#555555",
|
|
22
|
+
dark: "#424242",
|
|
23
|
+
darkest: "#212121"
|
|
24
|
+
},
|
|
25
|
+
border: {
|
|
26
|
+
lightest: "#d5d5d5",
|
|
27
|
+
light: "#c0c0c0",
|
|
28
|
+
medium: "#a8a8a8",
|
|
29
|
+
dark: "#8e8e8e",
|
|
30
|
+
darkest: "#6e6e6e"
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const DARK_NEUTRALS = {
|
|
34
|
+
background: {
|
|
35
|
+
lightest: "#3a3a3a",
|
|
36
|
+
light: "#2e2e2e",
|
|
37
|
+
medium: "#1e1e1e",
|
|
38
|
+
dark: "#161616",
|
|
39
|
+
darkest: "#0a0a0a"
|
|
40
|
+
},
|
|
41
|
+
surface: {
|
|
42
|
+
lightest: "#4a4a4a",
|
|
43
|
+
light: "#3e3e3e",
|
|
44
|
+
medium: "#333333",
|
|
45
|
+
dark: "#2a2a2a",
|
|
46
|
+
darkest: "#222222"
|
|
47
|
+
},
|
|
48
|
+
text: {
|
|
49
|
+
lightest: "#ffffff",
|
|
50
|
+
light: "#e8e8e8",
|
|
51
|
+
medium: "#cccccc",
|
|
52
|
+
dark: "#bebebe",
|
|
53
|
+
darkest: "#808080"
|
|
54
|
+
},
|
|
55
|
+
border: {
|
|
56
|
+
lightest: "#757575",
|
|
57
|
+
light: "#616161",
|
|
58
|
+
medium: "#4a4a4a",
|
|
59
|
+
dark: "#3a3a3a",
|
|
60
|
+
darkest: "#2e2e2e"
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
function toColorShade(shades) {
|
|
64
|
+
return {
|
|
65
|
+
lightest: HexColor.from(shades.lightest),
|
|
66
|
+
light: HexColor.from(shades.light),
|
|
67
|
+
medium: HexColor.from(shades.medium),
|
|
68
|
+
dark: HexColor.from(shades.dark),
|
|
69
|
+
darkest: HexColor.from(shades.darkest),
|
|
70
|
+
DEFAULT: HexColor.from(shades.medium)
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function addDefault(shade) {
|
|
74
|
+
return { ...shade, DEFAULT: shade.medium };
|
|
75
|
+
}
|
|
76
|
+
function generateColorScale(baseColor) {
|
|
77
|
+
const num = hexToNumber(baseColor);
|
|
78
|
+
const hsl = numberToHsl(num);
|
|
79
|
+
return addDefault({
|
|
80
|
+
lightest: HexColor.from(numberToHex(hslToNumber(hsl.h, hsl.s, 0.92))),
|
|
81
|
+
light: HexColor.from(numberToHex(hslToNumber(hsl.h, hsl.s * 0.7, 0.72))),
|
|
82
|
+
medium: HexColor.from(baseColor),
|
|
83
|
+
dark: HexColor.from(numberToHex(hslToNumber(hsl.h, hsl.s * 0.8, 0.35))),
|
|
84
|
+
darkest: HexColor.from(numberToHex(hslToNumber(hsl.h, hsl.s * 0.6, 0.15)))
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
const oceanBluePreset = {
|
|
88
|
+
name: "oceanBlue",
|
|
89
|
+
colors: {
|
|
90
|
+
// Brand colors
|
|
91
|
+
primary: generateColorScale("#2196f3"),
|
|
92
|
+
// Material Blue
|
|
93
|
+
secondary: generateColorScale("#607d8b"),
|
|
94
|
+
// Blue Grey
|
|
95
|
+
accent: generateColorScale("#00bcd4"),
|
|
96
|
+
// Cyan
|
|
97
|
+
// Feedback colors
|
|
98
|
+
success: generateColorScale("#4caf50"),
|
|
99
|
+
// Green
|
|
100
|
+
warning: generateColorScale("#ff9800"),
|
|
101
|
+
// Orange
|
|
102
|
+
error: generateColorScale("#f44336"),
|
|
103
|
+
// Red
|
|
104
|
+
info: generateColorScale("#2196f3"),
|
|
105
|
+
// Blue (same as primary)
|
|
106
|
+
// Neutral colors - designed for light mode
|
|
107
|
+
background: toColorShade(LIGHT_NEUTRALS.background),
|
|
108
|
+
surface: toColorShade(LIGHT_NEUTRALS.surface),
|
|
109
|
+
text: toColorShade(LIGHT_NEUTRALS.text),
|
|
110
|
+
border: toColorShade(LIGHT_NEUTRALS.border)
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
const forestGreenPreset = {
|
|
114
|
+
name: "forestGreen",
|
|
115
|
+
colors: {
|
|
116
|
+
// Brand colors
|
|
117
|
+
primary: generateColorScale("#4caf50"),
|
|
118
|
+
// Green
|
|
119
|
+
secondary: generateColorScale("#8bc34a"),
|
|
120
|
+
// Light Green
|
|
121
|
+
accent: generateColorScale("#ff8f00"),
|
|
122
|
+
// Amber (warm earth tone)
|
|
123
|
+
// Feedback colors
|
|
124
|
+
success: generateColorScale("#66bb6a"),
|
|
125
|
+
// Light Green
|
|
126
|
+
warning: generateColorScale("#ffa726"),
|
|
127
|
+
// Orange
|
|
128
|
+
error: generateColorScale("#ef5350"),
|
|
129
|
+
// Red
|
|
130
|
+
info: generateColorScale("#29b6f6"),
|
|
131
|
+
// Light Blue
|
|
132
|
+
// Neutral colors - green-tinted
|
|
133
|
+
background: toColorShade({
|
|
134
|
+
lightest: "#ffffff",
|
|
135
|
+
light: "#f1f8e9",
|
|
136
|
+
medium: "#dcedc8",
|
|
137
|
+
dark: "#c5e1a5",
|
|
138
|
+
darkest: "#aed581"
|
|
139
|
+
}),
|
|
140
|
+
surface: toColorShade({
|
|
141
|
+
lightest: "#ffffff",
|
|
142
|
+
light: "#f9fbe7",
|
|
143
|
+
medium: "#f0f4c3",
|
|
144
|
+
dark: "#e6ee9c",
|
|
145
|
+
darkest: "#dce775"
|
|
146
|
+
}),
|
|
147
|
+
text: toColorShade({
|
|
148
|
+
lightest: "#9e9e9e",
|
|
149
|
+
light: "#757575",
|
|
150
|
+
medium: "#616161",
|
|
151
|
+
dark: "#424242",
|
|
152
|
+
darkest: "#1b5e20"
|
|
153
|
+
}),
|
|
154
|
+
border: toColorShade({
|
|
155
|
+
lightest: "#dcedc8",
|
|
156
|
+
light: "#c5e1a5",
|
|
157
|
+
medium: "#aed581",
|
|
158
|
+
dark: "#9ccc65",
|
|
159
|
+
darkest: "#7cb342"
|
|
160
|
+
})
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
const midnightPreset = {
|
|
164
|
+
name: "midnight",
|
|
165
|
+
colors: {
|
|
166
|
+
// Brand colors
|
|
167
|
+
primary: generateColorScale("#9c27b0"),
|
|
168
|
+
// Purple
|
|
169
|
+
secondary: generateColorScale("#673ab7"),
|
|
170
|
+
// Deep Purple
|
|
171
|
+
accent: generateColorScale("#e91e63"),
|
|
172
|
+
// Pink
|
|
173
|
+
// Feedback colors
|
|
174
|
+
success: generateColorScale("#66bb6a"),
|
|
175
|
+
// Green
|
|
176
|
+
warning: generateColorScale("#ffa726"),
|
|
177
|
+
// Orange
|
|
178
|
+
error: generateColorScale("#ef5350"),
|
|
179
|
+
// Red
|
|
180
|
+
info: generateColorScale("#42a5f5"),
|
|
181
|
+
// Blue
|
|
182
|
+
// Neutral colors - designed for dark mode
|
|
183
|
+
background: toColorShade(DARK_NEUTRALS.background),
|
|
184
|
+
surface: toColorShade(DARK_NEUTRALS.surface),
|
|
185
|
+
text: toColorShade(DARK_NEUTRALS.text),
|
|
186
|
+
border: toColorShade(DARK_NEUTRALS.border)
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
function applyLightMode(preset) {
|
|
190
|
+
return {
|
|
191
|
+
...preset,
|
|
192
|
+
colors: {
|
|
193
|
+
...preset.colors,
|
|
194
|
+
background: toColorShade(LIGHT_NEUTRALS.background),
|
|
195
|
+
surface: toColorShade(LIGHT_NEUTRALS.surface),
|
|
196
|
+
text: toColorShade(LIGHT_NEUTRALS.text),
|
|
197
|
+
border: toColorShade(LIGHT_NEUTRALS.border)
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
function applyDarkMode(preset) {
|
|
202
|
+
return {
|
|
203
|
+
...preset,
|
|
204
|
+
colors: {
|
|
205
|
+
...preset.colors,
|
|
206
|
+
background: toColorShade(DARK_NEUTRALS.background),
|
|
207
|
+
surface: toColorShade(DARK_NEUTRALS.surface),
|
|
208
|
+
text: toColorShade(DARK_NEUTRALS.text),
|
|
209
|
+
border: toColorShade(DARK_NEUTRALS.border)
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
const presets = {
|
|
214
|
+
oceanBlue: oceanBluePreset,
|
|
215
|
+
forestGreen: forestGreenPreset,
|
|
216
|
+
midnight: midnightPreset
|
|
217
|
+
};
|
|
218
|
+
function getPreset(name) {
|
|
219
|
+
return presets[name];
|
|
220
|
+
}
|
|
221
|
+
function getPresetWithMode(name, mode) {
|
|
222
|
+
const preset = getPreset(name);
|
|
223
|
+
return mode === "light" ? applyLightMode(preset) : applyDarkMode(preset);
|
|
224
|
+
}
|
|
225
|
+
export {
|
|
226
|
+
applyDarkMode,
|
|
227
|
+
applyLightMode,
|
|
228
|
+
forestGreenPreset,
|
|
229
|
+
generateColorScale,
|
|
230
|
+
getPreset,
|
|
231
|
+
getPresetWithMode,
|
|
232
|
+
midnightPreset,
|
|
233
|
+
oceanBluePreset,
|
|
234
|
+
presets
|
|
235
|
+
};
|
|
236
|
+
//# sourceMappingURL=color-presets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-presets.js","sources":["../../src/colors/color-presets.ts"],"sourcesContent":["/**\n * Color preset definitions for PhaserJSX UI\n * Provides pre-configured color palettes with light/dark mode support\n */\n\nimport { HexColor, type ColorShade, type ColorTokens } from './color-types'\nimport { hexToNumber, hslToNumber, numberToHex, numberToHsl } from './color-utils'\n\n/**\n * Base ColorShade without DEFAULT property\n */\ntype ColorShadeBase = Omit<ColorShade, 'DEFAULT'>\n\n/** Neutral color hex values per shade level */\ntype NeutralHexValues = Record<'lightest' | 'light' | 'medium' | 'dark' | 'darkest', string>\n\n/** Light mode neutral color definitions */\nconst LIGHT_NEUTRALS = {\n background: {\n lightest: '#ffffff',\n light: '#fafafa',\n medium: '#f0f0f0',\n dark: '#e5e5e5',\n darkest: '#d0d0d0',\n },\n surface: {\n lightest: '#f5f5f5',\n light: '#ebebeb',\n medium: '#e0e0e0',\n dark: '#d5d5d5',\n darkest: '#c8c8c8',\n },\n text: {\n lightest: '#e0e0e0',\n light: '#666666',\n medium: '#555555',\n dark: '#424242',\n darkest: '#212121',\n },\n border: {\n lightest: '#d5d5d5',\n light: '#c0c0c0',\n medium: '#a8a8a8',\n dark: '#8e8e8e',\n darkest: '#6e6e6e',\n },\n} as const satisfies Record<string, NeutralHexValues>\n\n/** Dark mode neutral color definitions */\nconst DARK_NEUTRALS = {\n background: {\n lightest: '#3a3a3a',\n light: '#2e2e2e',\n medium: '#1e1e1e',\n dark: '#161616',\n darkest: '#0a0a0a',\n },\n surface: {\n lightest: '#4a4a4a',\n light: '#3e3e3e',\n medium: '#333333',\n dark: '#2a2a2a',\n darkest: '#222222',\n },\n text: {\n lightest: '#ffffff',\n light: '#e8e8e8',\n medium: '#cccccc',\n dark: '#bebebe',\n darkest: '#808080',\n },\n border: {\n lightest: '#757575',\n light: '#616161',\n medium: '#4a4a4a',\n dark: '#3a3a3a',\n darkest: '#2e2e2e',\n },\n} as const satisfies Record<string, NeutralHexValues>\n\n/**\n * Convert neutral hex values to a full ColorShade with DEFAULT alias\n * @param shades - Record of shade level to hex string\n * @returns ColorShade with HexColor instances and DEFAULT pointing to medium\n */\nfunction toColorShade(shades: NeutralHexValues): ColorShade {\n return {\n lightest: HexColor.from(shades.lightest),\n light: HexColor.from(shades.light),\n medium: HexColor.from(shades.medium),\n dark: HexColor.from(shades.dark),\n darkest: HexColor.from(shades.darkest),\n DEFAULT: HexColor.from(shades.medium),\n }\n}\n\n/**\n * Create a ColorShade with DEFAULT pointing to medium\n * @param shade - ColorShade object without DEFAULT\n * @returns ColorShade with DEFAULT set to medium\n */\nfunction addDefault(shade: ColorShadeBase): ColorShade {\n return { ...shade, DEFAULT: shade.medium }\n}\n\n/**\n * Generate a complete color scale from a base color using HSL-based perceptual scaling\n * Creates shades from lightest to darkest with DEFAULT pointing to medium\n * @param baseColor - The base color in hex format (e.g., '#2196f3')\n * @returns Complete ColorShade with all semantic levels as HexColor objects\n * @example\n * ```typescript\n * const primaryScale = generateColorScale('#2196f3')\n * // Usage: colors.primary.medium.toNumber()\n * // DEFAULT also works: colors.primary.DEFAULT.toNumber()\n * ```\n */\nexport function generateColorScale(baseColor: string): ColorShade {\n const num = hexToNumber(baseColor)\n const hsl = numberToHsl(num)\n\n return addDefault({\n lightest: HexColor.from(numberToHex(hslToNumber(hsl.h, hsl.s, 0.92))),\n light: HexColor.from(numberToHex(hslToNumber(hsl.h, hsl.s * 0.7, 0.72))),\n medium: HexColor.from(baseColor),\n dark: HexColor.from(numberToHex(hslToNumber(hsl.h, hsl.s * 0.8, 0.35))),\n darkest: HexColor.from(numberToHex(hslToNumber(hsl.h, hsl.s * 0.6, 0.15))),\n })\n}\n\n/**\n * Color preset configuration\n * Defines a complete set of semantic colors for a theme\n */\nexport interface ColorPreset {\n /** Preset name for identification */\n name: string\n /** Complete color token set */\n colors: ColorTokens\n}\n\n/**\n * Ocean Blue Preset\n * Clean, professional blue-based palette\n */\nexport const oceanBluePreset: ColorPreset = {\n name: 'oceanBlue',\n colors: {\n // Brand colors\n primary: generateColorScale('#2196f3'), // Material Blue\n secondary: generateColorScale('#607d8b'), // Blue Grey\n accent: generateColorScale('#00bcd4'), // Cyan\n\n // Feedback colors\n success: generateColorScale('#4caf50'), // Green\n warning: generateColorScale('#ff9800'), // Orange\n error: generateColorScale('#f44336'), // Red\n info: generateColorScale('#2196f3'), // Blue (same as primary)\n\n // Neutral colors - designed for light mode\n background: toColorShade(LIGHT_NEUTRALS.background),\n surface: toColorShade(LIGHT_NEUTRALS.surface),\n text: toColorShade(LIGHT_NEUTRALS.text),\n border: toColorShade(LIGHT_NEUTRALS.border),\n },\n}\n\n/**\n * Forest Green Preset\n * Nature-inspired green-based palette\n */\nexport const forestGreenPreset: ColorPreset = {\n name: 'forestGreen',\n colors: {\n // Brand colors\n primary: generateColorScale('#4caf50'), // Green\n secondary: generateColorScale('#8bc34a'), // Light Green\n accent: generateColorScale('#ff8f00'), // Amber (warm earth tone)\n\n // Feedback colors\n success: generateColorScale('#66bb6a'), // Light Green\n warning: generateColorScale('#ffa726'), // Orange\n error: generateColorScale('#ef5350'), // Red\n info: generateColorScale('#29b6f6'), // Light Blue\n\n // Neutral colors - green-tinted\n background: toColorShade({\n lightest: '#ffffff',\n light: '#f1f8e9',\n medium: '#dcedc8',\n dark: '#c5e1a5',\n darkest: '#aed581',\n }),\n surface: toColorShade({\n lightest: '#ffffff',\n light: '#f9fbe7',\n medium: '#f0f4c3',\n dark: '#e6ee9c',\n darkest: '#dce775',\n }),\n text: toColorShade({\n lightest: '#9e9e9e',\n light: '#757575',\n medium: '#616161',\n dark: '#424242',\n darkest: '#1b5e20',\n }),\n border: toColorShade({\n lightest: '#dcedc8',\n light: '#c5e1a5',\n medium: '#aed581',\n dark: '#9ccc65',\n darkest: '#7cb342',\n }),\n },\n}\n\n/**\n * Midnight Preset\n * Dark, elegant purple-based palette\n */\nexport const midnightPreset: ColorPreset = {\n name: 'midnight',\n colors: {\n // Brand colors\n primary: generateColorScale('#9c27b0'), // Purple\n secondary: generateColorScale('#673ab7'), // Deep Purple\n accent: generateColorScale('#e91e63'), // Pink\n\n // Feedback colors\n success: generateColorScale('#66bb6a'), // Green\n warning: generateColorScale('#ffa726'), // Orange\n error: generateColorScale('#ef5350'), // Red\n info: generateColorScale('#42a5f5'), // Blue\n\n // Neutral colors - designed for dark mode\n background: toColorShade(DARK_NEUTRALS.background),\n surface: toColorShade(DARK_NEUTRALS.surface),\n text: toColorShade(DARK_NEUTRALS.text),\n border: toColorShade(DARK_NEUTRALS.border),\n },\n}\n\n/**\n * Apply light mode overrides to a preset\n * Adjusts neutral colors for optimal light mode appearance\n * @param preset - Base preset to modify\n * @returns New preset with light mode neutral colors\n */\nexport function applyLightMode(preset: ColorPreset): ColorPreset {\n return {\n ...preset,\n colors: {\n ...preset.colors,\n background: toColorShade(LIGHT_NEUTRALS.background),\n surface: toColorShade(LIGHT_NEUTRALS.surface),\n text: toColorShade(LIGHT_NEUTRALS.text),\n border: toColorShade(LIGHT_NEUTRALS.border),\n },\n }\n}\n\n/**\n * Apply dark mode overrides to a preset\n * Adjusts neutral colors for optimal dark mode appearance\n * @param preset - Base preset to modify\n * @returns New preset with dark mode neutral colors\n */\nexport function applyDarkMode(preset: ColorPreset): ColorPreset {\n return {\n ...preset,\n colors: {\n ...preset.colors,\n background: toColorShade(DARK_NEUTRALS.background),\n surface: toColorShade(DARK_NEUTRALS.surface),\n text: toColorShade(DARK_NEUTRALS.text),\n border: toColorShade(DARK_NEUTRALS.border),\n },\n }\n}\n\n/**\n * All available presets\n */\nexport const presets = {\n oceanBlue: oceanBluePreset,\n forestGreen: forestGreenPreset,\n midnight: midnightPreset,\n} as const\n\n/**\n * Preset names for type safety\n */\nexport type PresetName = keyof typeof presets\n\n/**\n * Get a preset by name\n * @param name - Preset name\n * @returns Color preset\n * @example\n * ```typescript\n * const preset = getPreset('oceanBlue')\n * const primaryColor = preset.colors.primary.DEFAULT\n * ```\n */\nexport function getPreset(name: PresetName): ColorPreset {\n return presets[name]\n}\n\n/**\n * Get a preset with color mode applied\n * @param name - Preset name\n * @param mode - Color mode ('light' or 'dark')\n * @returns Color preset with mode-specific neutral colors\n * @example\n * ```typescript\n * const darkPreset = getPresetWithMode('oceanBlue', 'dark')\n * const bgColor = darkPreset.colors.background.DEFAULT\n * ```\n */\nexport function getPresetWithMode(name: PresetName, mode: 'light' | 'dark'): ColorPreset {\n const preset = getPreset(name)\n return mode === 'light' ? applyLightMode(preset) : applyDarkMode(preset)\n}\n"],"names":[],"mappings":";;AAiBA,MAAM,iBAAiB;AAAA,EACrB,YAAY;AAAA,IACV,UAAU;AAAA,IACV,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,SAAS;AAAA,EAAA;AAAA,EAEX,SAAS;AAAA,IACP,UAAU;AAAA,IACV,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,SAAS;AAAA,EAAA;AAAA,EAEX,MAAM;AAAA,IACJ,UAAU;AAAA,IACV,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,SAAS;AAAA,EAAA;AAAA,EAEX,QAAQ;AAAA,IACN,UAAU;AAAA,IACV,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,SAAS;AAAA,EAAA;AAEb;AAGA,MAAM,gBAAgB;AAAA,EACpB,YAAY;AAAA,IACV,UAAU;AAAA,IACV,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,SAAS;AAAA,EAAA;AAAA,EAEX,SAAS;AAAA,IACP,UAAU;AAAA,IACV,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,SAAS;AAAA,EAAA;AAAA,EAEX,MAAM;AAAA,IACJ,UAAU;AAAA,IACV,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,SAAS;AAAA,EAAA;AAAA,EAEX,QAAQ;AAAA,IACN,UAAU;AAAA,IACV,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,SA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ict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const colorUtils = require("./color-utils.cjs");
|
|
4
|
+
function colorsToTheme(colors, colorKey, options = {}) {
|
|
5
|
+
const { backgroundShade = "DEFAULT", borderShade = "dark", includeBorder = true } = options;
|
|
6
|
+
const result = {
|
|
7
|
+
backgroundColor: colors[colorKey][backgroundShade].toNumber()
|
|
8
|
+
};
|
|
9
|
+
if (includeBorder) {
|
|
10
|
+
result.borderColor = colors[colorKey][borderShade].toNumber();
|
|
11
|
+
}
|
|
12
|
+
return result;
|
|
13
|
+
}
|
|
14
|
+
function getTextColor(colors, shade = "DEFAULT", alphaValue) {
|
|
15
|
+
const color = colors.text[shade];
|
|
16
|
+
return alphaValue !== void 0 ? colorUtils.alpha(color.toNumber(), alphaValue) : color.toString();
|
|
17
|
+
}
|
|
18
|
+
function getBackgroundColor(colors, shade = "DEFAULT") {
|
|
19
|
+
return colors.background[shade].toNumber();
|
|
20
|
+
}
|
|
21
|
+
function getSurfaceColor(colors, shade = "DEFAULT") {
|
|
22
|
+
return colors.surface[shade].toNumber();
|
|
23
|
+
}
|
|
24
|
+
function getBorderColor(colors, shade = "DEFAULT") {
|
|
25
|
+
return colors.border[shade].toNumber();
|
|
26
|
+
}
|
|
27
|
+
exports.colorsToTheme = colorsToTheme;
|
|
28
|
+
exports.getBackgroundColor = getBackgroundColor;
|
|
29
|
+
exports.getBorderColor = getBorderColor;
|
|
30
|
+
exports.getSurfaceColor = getSurfaceColor;
|
|
31
|
+
exports.getTextColor = getTextColor;
|
|
32
|
+
//# sourceMappingURL=color-theme-helpers.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-theme-helpers.cjs","sources":["../../src/colors/color-theme-helpers.ts"],"sourcesContent":["/**\n * Helper functions for color system integration with theme\n */\nimport type { ColorTokens } from './color-types'\nimport { alpha } from './color-utils'\n\n/**\n * Convert ColorTokens to a theme-compatible object\n * Maps semantic color names to Phaser number format for View/Button components\n * @param colors - ColorTokens to convert\n * @returns Object with backgroundColor, borderColor, etc.\n * @example\n * ```typescript\n * const colors = getPreset('oceanBlue').colors\n * const buttonTheme = {\n * ...colorsToTheme(colors, 'primary'),\n * padding: 8,\n * }\n * // Returns: { backgroundColor: 0x2196f3, borderColor: 0x... }\n * ```\n */\nexport function colorsToTheme(\n colors: ColorTokens,\n colorKey: keyof Pick<\n ColorTokens,\n 'primary' | 'secondary' | 'accent' | 'success' | 'warning' | 'error' | 'info'\n >,\n options: {\n /** Which shade to use for background (default: 'DEFAULT') */\n backgroundShade?: 'lightest' | 'light' | 'medium' | 'dark' | 'darkest' | 'DEFAULT'\n /** Which shade to use for border (default: 'dark') */\n borderShade?: 'lightest' | 'light' | 'medium' | 'dark' | 'darkest' | 'DEFAULT'\n /** Include border color (default: true) */\n includeBorder?: boolean\n } = {}\n): {\n backgroundColor: number\n borderColor?: number\n} {\n const { backgroundShade = 'DEFAULT', borderShade = 'dark', includeBorder = true } = options\n\n const result: { backgroundColor: number; borderColor?: number } = {\n backgroundColor: colors[colorKey][backgroundShade].toNumber(),\n }\n\n if (includeBorder) {\n result.borderColor = colors[colorKey][borderShade].toNumber()\n }\n\n return result\n}\n\n/**\n * Get text color from ColorTokens as hex string for Phaser Text style\n * @param colors - ColorTokens to use\n * @param shade - Which text shade to use (default: 'DEFAULT')\n * @param alphaValue - Optional alpha value (0-1)\n * @returns Hex string or rgba string for Text style\n * @example\n * ```typescript\n * const colors = getPreset('oceanBlue').colors\n * const textStyle = {\n * color: getTextColor(colors),\n * fontSize: '18px'\n * }\n * ```\n */\nexport function getTextColor(\n colors: ColorTokens,\n shade: 'lightest' | 'light' | 'medium' | 'dark' | 'darkest' | 'DEFAULT' = 'DEFAULT',\n alphaValue?: number\n): string {\n const color = colors.text[shade]\n return alphaValue !== undefined ? alpha(color.toNumber(), alphaValue) : color.toString()\n}\n\n/**\n * Get background color from ColorTokens\n * @param colors - ColorTokens to use\n * @param shade - Which shade to use (default: 'DEFAULT')\n * @returns Phaser color number\n */\nexport function getBackgroundColor(\n colors: ColorTokens,\n shade: 'lightest' | 'light' | 'medium' | 'dark' | 'darkest' | 'DEFAULT' = 'DEFAULT'\n): number {\n return colors.background[shade].toNumber()\n}\n\n/**\n * Get surface color from ColorTokens\n * @param colors - ColorTokens to use\n * @param shade - Which shade to use (default: 'DEFAULT')\n * @returns Phaser color number\n */\nexport function getSurfaceColor(\n colors: ColorTokens,\n shade: 'lightest' | 'light' | 'medium' | 'dark' | 'darkest' | 'DEFAULT' = 'DEFAULT'\n): number {\n return colors.surface[shade].toNumber()\n}\n\n/**\n * Get border color from ColorTokens\n * @param colors - ColorTokens to use\n * @param shade - Which shade to use (default: 'DEFAULT')\n * @returns Phaser color number\n */\nexport function getBorderColor(\n colors: ColorTokens,\n shade: 'lightest' | 'light' | 'medium' | 'dark' | 'darkest' | 'DEFAULT' = 'DEFAULT'\n): number {\n return colors.border[shade].toNumber()\n}\n"],"names":["alpha"],"mappings":";;;AAqBO,SAAS,cACd,QACA,UAIA,UAOI,CAAA,GAIJ;AACA,QAAM,EAAE,kBAAkB,WAAW,cAAc,QAAQ,gBAAgB,SAAS;AAEpF,QAAM,SAA4D;AAAA,IAChE,iBAAiB,OAAO,QAAQ,EAAE,eAAe,EAAE,SAAA;AAAA,EAAS;AAG9D,MAAI,eAAe;AACjB,WAAO,cAAc,OAAO,QAAQ,EAAE,WAAW,EAAE,SAAA;AAAA,EACrD;AAEA,SAAO;AACT;AAiBO,SAAS,aACd,QACA,QAA0E,WAC1E,YACQ;AACR,QAAM,QAAQ,OAAO,KAAK,KAAK;AAC/B,SAAO,eAAe,SAAYA,WAAAA,MAAM,MAAM,YAAY,UAAU,IAAI,MAAM,SAAA;AAChF;AAQO,SAAS,mBACd,QACA,QAA0E,WAClE;AACR,SAAO,OAAO,WAAW,KAAK,EAAE,SAAA;AAClC;AAQO,SAAS,gBACd,QACA,QAA0E,WAClE;AACR,SAAO,OAAO,QAAQ,KAAK,EAAE,SAAA;AAC/B;AAQO,SAAS,eACd,QACA,QAA0E,WAClE;AACR,SAAO,OAAO,OAAO,KAAK,EAAE,SAAA;AAC9B;;;;;;"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ColorTokens } from './color-types';
|
|
2
|
+
/**
|
|
3
|
+
* Convert ColorTokens to a theme-compatible object
|
|
4
|
+
* Maps semantic color names to Phaser number format for View/Button components
|
|
5
|
+
* @param colors - ColorTokens to convert
|
|
6
|
+
* @returns Object with backgroundColor, borderColor, etc.
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* const colors = getPreset('oceanBlue').colors
|
|
10
|
+
* const buttonTheme = {
|
|
11
|
+
* ...colorsToTheme(colors, 'primary'),
|
|
12
|
+
* padding: 8,
|
|
13
|
+
* }
|
|
14
|
+
* // Returns: { backgroundColor: 0x2196f3, borderColor: 0x... }
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare function colorsToTheme(colors: ColorTokens, colorKey: keyof Pick<ColorTokens, 'primary' | 'secondary' | 'accent' | 'success' | 'warning' | 'error' | 'info'>, options?: {
|
|
18
|
+
/** Which shade to use for background (default: 'DEFAULT') */
|
|
19
|
+
backgroundShade?: 'lightest' | 'light' | 'medium' | 'dark' | 'darkest' | 'DEFAULT';
|
|
20
|
+
/** Which shade to use for border (default: 'dark') */
|
|
21
|
+
borderShade?: 'lightest' | 'light' | 'medium' | 'dark' | 'darkest' | 'DEFAULT';
|
|
22
|
+
/** Include border color (default: true) */
|
|
23
|
+
includeBorder?: boolean;
|
|
24
|
+
}): {
|
|
25
|
+
backgroundColor: number;
|
|
26
|
+
borderColor?: number;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Get text color from ColorTokens as hex string for Phaser Text style
|
|
30
|
+
* @param colors - ColorTokens to use
|
|
31
|
+
* @param shade - Which text shade to use (default: 'DEFAULT')
|
|
32
|
+
* @param alphaValue - Optional alpha value (0-1)
|
|
33
|
+
* @returns Hex string or rgba string for Text style
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* const colors = getPreset('oceanBlue').colors
|
|
37
|
+
* const textStyle = {
|
|
38
|
+
* color: getTextColor(colors),
|
|
39
|
+
* fontSize: '18px'
|
|
40
|
+
* }
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare function getTextColor(colors: ColorTokens, shade?: 'lightest' | 'light' | 'medium' | 'dark' | 'darkest' | 'DEFAULT', alphaValue?: number): string;
|
|
44
|
+
/**
|
|
45
|
+
* Get background color from ColorTokens
|
|
46
|
+
* @param colors - ColorTokens to use
|
|
47
|
+
* @param shade - Which shade to use (default: 'DEFAULT')
|
|
48
|
+
* @returns Phaser color number
|
|
49
|
+
*/
|
|
50
|
+
export declare function getBackgroundColor(colors: ColorTokens, shade?: 'lightest' | 'light' | 'medium' | 'dark' | 'darkest' | 'DEFAULT'): number;
|
|
51
|
+
/**
|
|
52
|
+
* Get surface color from ColorTokens
|
|
53
|
+
* @param colors - ColorTokens to use
|
|
54
|
+
* @param shade - Which shade to use (default: 'DEFAULT')
|
|
55
|
+
* @returns Phaser color number
|
|
56
|
+
*/
|
|
57
|
+
export declare function getSurfaceColor(colors: ColorTokens, shade?: 'lightest' | 'light' | 'medium' | 'dark' | 'darkest' | 'DEFAULT'): number;
|
|
58
|
+
/**
|
|
59
|
+
* Get border color from ColorTokens
|
|
60
|
+
* @param colors - ColorTokens to use
|
|
61
|
+
* @param shade - Which shade to use (default: 'DEFAULT')
|
|
62
|
+
* @returns Phaser color number
|
|
63
|
+
*/
|
|
64
|
+
export declare function getBorderColor(colors: ColorTokens, shade?: 'lightest' | 'light' | 'medium' | 'dark' | 'darkest' | 'DEFAULT'): number;
|
|
65
|
+
//# sourceMappingURL=color-theme-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-theme-helpers.d.ts","sourceRoot":"","sources":["../../src/colors/color-the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ACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,WAAW,EACnB,KAAK,GAAE,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,SAAqB,GAClF,MAAM,CAER"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { alpha } from "./color-utils.js";
|
|
2
|
+
function colorsToTheme(colors, colorKey, options = {}) {
|
|
3
|
+
const { backgroundShade = "DEFAULT", borderShade = "dark", includeBorder = true } = options;
|
|
4
|
+
const result = {
|
|
5
|
+
backgroundColor: colors[colorKey][backgroundShade].toNumber()
|
|
6
|
+
};
|
|
7
|
+
if (includeBorder) {
|
|
8
|
+
result.borderColor = colors[colorKey][borderShade].toNumber();
|
|
9
|
+
}
|
|
10
|
+
return result;
|
|
11
|
+
}
|
|
12
|
+
function getTextColor(colors, shade = "DEFAULT", alphaValue) {
|
|
13
|
+
const color = colors.text[shade];
|
|
14
|
+
return alphaValue !== void 0 ? alpha(color.toNumber(), alphaValue) : color.toString();
|
|
15
|
+
}
|
|
16
|
+
function getBackgroundColor(colors, shade = "DEFAULT") {
|
|
17
|
+
return colors.background[shade].toNumber();
|
|
18
|
+
}
|
|
19
|
+
function getSurfaceColor(colors, shade = "DEFAULT") {
|
|
20
|
+
return colors.surface[shade].toNumber();
|
|
21
|
+
}
|
|
22
|
+
function getBorderColor(colors, shade = "DEFAULT") {
|
|
23
|
+
return colors.border[shade].toNumber();
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
colorsToTheme,
|
|
27
|
+
getBackgroundColor,
|
|
28
|
+
getBorderColor,
|
|
29
|
+
getSurfaceColor,
|
|
30
|
+
getTextColor
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=color-theme-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-theme-helpers.js","sources":["../../src/colors/color-theme-helpers.ts"],"sourcesContent":["/**\n * Helper functions for color system integration with theme\n */\nimport type { ColorTokens } from './color-types'\nimport { alpha } from './color-utils'\n\n/**\n * Convert ColorTokens to a theme-compatible object\n * Maps semantic color names to Phaser number format for View/Button components\n * @param colors - ColorTokens to convert\n * @returns Object with backgroundColor, borderColor, etc.\n * @example\n * ```typescript\n * const colors = getPreset('oceanBlue').colors\n * const buttonTheme = {\n * ...colorsToTheme(colors, 'primary'),\n * padding: 8,\n * }\n * // Returns: { backgroundColor: 0x2196f3, borderColor: 0x... }\n * ```\n */\nexport function colorsToTheme(\n colors: ColorTokens,\n colorKey: keyof Pick<\n ColorTokens,\n 'primary' | 'secondary' | 'accent' | 'success' | 'warning' | 'error' | 'info'\n >,\n options: {\n /** Which shade to use for background (default: 'DEFAULT') */\n backgroundShade?: 'lightest' | 'light' | 'medium' | 'dark' | 'darkest' | 'DEFAULT'\n /** Which shade to use for border (default: 'dark') */\n borderShade?: 'lightest' | 'light' | 'medium' | 'dark' | 'darkest' | 'DEFAULT'\n /** Include border color (default: true) */\n includeBorder?: boolean\n } = {}\n): {\n backgroundColor: number\n borderColor?: number\n} {\n const { backgroundShade = 'DEFAULT', borderShade = 'dark', includeBorder = true } = options\n\n const result: { backgroundColor: number; borderColor?: number } = {\n backgroundColor: colors[colorKey][backgroundShade].toNumber(),\n }\n\n if (includeBorder) {\n result.borderColor = colors[colorKey][borderShade].toNumber()\n }\n\n return result\n}\n\n/**\n * Get text color from ColorTokens as hex string for Phaser Text style\n * @param colors - ColorTokens to use\n * @param shade - Which text shade to use (default: 'DEFAULT')\n * @param alphaValue - Optional alpha value (0-1)\n * @returns Hex string or rgba string for Text style\n * @example\n * ```typescript\n * const colors = getPreset('oceanBlue').colors\n * const textStyle = {\n * color: getTextColor(colors),\n * fontSize: '18px'\n * }\n * ```\n */\nexport function getTextColor(\n colors: ColorTokens,\n shade: 'lightest' | 'light' | 'medium' | 'dark' | 'darkest' | 'DEFAULT' = 'DEFAULT',\n alphaValue?: number\n): string {\n const color = colors.text[shade]\n return alphaValue !== undefined ? alpha(color.toNumber(), alphaValue) : color.toString()\n}\n\n/**\n * Get background color from ColorTokens\n * @param colors - ColorTokens to use\n * @param shade - Which shade to use (default: 'DEFAULT')\n * @returns Phaser color number\n */\nexport function getBackgroundColor(\n colors: ColorTokens,\n shade: 'lightest' | 'light' | 'medium' | 'dark' | 'darkest' | 'DEFAULT' = 'DEFAULT'\n): number {\n return colors.background[shade].toNumber()\n}\n\n/**\n * Get surface color from ColorTokens\n * @param colors - ColorTokens to use\n * @param shade - Which shade to use (default: 'DEFAULT')\n * @returns Phaser color number\n */\nexport function getSurfaceColor(\n colors: ColorTokens,\n shade: 'lightest' | 'light' | 'medium' | 'dark' | 'darkest' | 'DEFAULT' = 'DEFAULT'\n): number {\n return colors.surface[shade].toNumber()\n}\n\n/**\n * Get border color from ColorTokens\n * @param colors - ColorTokens to use\n * @param shade - Which shade to use (default: 'DEFAULT')\n * @returns Phaser color number\n */\nexport function getBorderColor(\n colors: ColorTokens,\n shade: 'lightest' | 'light' | 'medium' | 'dark' | 'darkest' | 'DEFAULT' = 'DEFAULT'\n): number {\n return colors.border[shade].toNumber()\n}\n"],"names":[],"mappings":";AAqBO,SAAS,cACd,QACA,UAIA,UAOI,CAAA,GAIJ;AACA,QAAM,EAAE,kBAAkB,WAAW,cAAc,QAAQ,gBAAgB,SAAS;AAEpF,QAAM,SAA4D;AAAA,IAChE,iBAAiB,OAAO,QAAQ,EAAE,eAAe,EAAE,SAAA;AAAA,EAAS;AAG9D,MAAI,eAAe;AACjB,WAAO,cAAc,OAAO,QAAQ,EAAE,WAAW,EAAE,SAAA;AAAA,EACrD;AAEA,SAAO;AACT;AAiBO,SAAS,aACd,QACA,QAA0E,WAC1E,YACQ;AACR,QAAM,QAAQ,OAAO,KAAK,KAAK;AAC/B,SAAO,eAAe,SAAY,MAAM,MAAM,YAAY,UAAU,IAAI,MAAM,SAAA;AAChF;AAQO,SAAS,mBACd,QACA,QAA0E,WAClE;AACR,SAAO,OAAO,WAAW,KAAK,EAAE,SAAA;AAClC;AAQO,SAAS,gBACd,QACA,QAA0E,WAClE;AACR,SAAO,OAAO,QAAQ,KAAK,EAAE,SAAA;AAC/B;AAQO,SAAS,eACd,QACA,QAA0E,WAClE;AACR,SAAO,OAAO,OAAO,KAAK,EAAE,SAAA;AAC9B;"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
class HexColor {
|
|
4
|
+
#value;
|
|
5
|
+
constructor(hex) {
|
|
6
|
+
this.#value = hex;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Convert to Phaser number format
|
|
10
|
+
* @returns Color as number (0xffffff)
|
|
11
|
+
*/
|
|
12
|
+
toNumber() {
|
|
13
|
+
return parseInt(this.#value.replace("#", ""), 16);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Return the hex string value
|
|
17
|
+
* @returns Hex color string
|
|
18
|
+
*/
|
|
19
|
+
toString() {
|
|
20
|
+
return this.#value;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Primitive string value for coercion contexts
|
|
24
|
+
* @returns Hex color string
|
|
25
|
+
*/
|
|
26
|
+
valueOf() {
|
|
27
|
+
return this.#value;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Create a HexColor from a hex string
|
|
31
|
+
* @param hex - Hex color string
|
|
32
|
+
*/
|
|
33
|
+
static from(hex) {
|
|
34
|
+
return new HexColor(hex);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.HexColor = HexColor;
|
|
38
|
+
//# sourceMappingURL=color-types.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-types.cjs","sources":["../../src/colors/color-types.ts"],"sourcesContent":["/**\n * Color system types for PhaserJSX UI\n * Provides semantic color tokens with named shade levels\n */\n\n/**\n * Named shade levels for color scales\n * Uses semantic names instead of numeric values\n */\nexport type ShadeLevel = 'lightest' | 'light' | 'medium' | 'dark' | 'darkest'\n\n/**\n * Hex color with conversion method for Phaser compatibility\n * Wraps a string value and provides toNumber() for Phaser color integration\n */\nexport class HexColor {\n readonly #value: string\n\n constructor(hex: string) {\n this.#value = hex\n }\n\n /**\n * Convert to Phaser number format\n * @returns Color as number (0xffffff)\n */\n toNumber(): number {\n return parseInt(this.#value.replace('#', ''), 16)\n }\n\n /**\n * Return the hex string value\n * @returns Hex color string\n */\n toString(): string {\n return this.#value\n }\n\n /**\n * Primitive string value for coercion contexts\n * @returns Hex color string\n */\n valueOf(): string {\n return this.#value\n }\n\n /**\n * Create a HexColor from a hex string\n * @param hex - Hex color string\n */\n static from(hex: string): HexColor {\n return new HexColor(hex)\n }\n}\n\n/**\n * Color shade scale with semantic naming\n * Each color token has multiple shades for different use cases\n * Uses HexColor type for VS Code color picker support and .toNumber() method\n * DEFAULT is an alias for medium\n * @example\n * ```typescript\n * const primaryShade: ColorShade = {\n * lightest: HexColor.from('#e3f2fd'),\n * light: HexColor.from('#90caf9'),\n * medium: HexColor.from('#42a5f5'),\n * dark: HexColor.from('#1976d2'),\n * darkest: HexColor.from('#0d47a1'),\n * DEFAULT: HexColor.from('#42a5f5'), // alias to medium\n * }\n * // Usage:\n * backgroundColor: colors.primary.DEFAULT.toNumber() // same as medium\n * backgroundColor: colors.primary.medium.toNumber()\n * ```\n */\nexport interface ColorShade {\n /** Lightest shade - backgrounds, hover states */\n lightest: HexColor\n /** Light shade - secondary elements */\n light: HexColor\n /** Medium shade - interactive elements (also available as DEFAULT) */\n medium: HexColor\n /** Dark shade - borders, dividers */\n dark: HexColor\n /** Darkest shade - text, emphasis */\n darkest: HexColor\n /** DEFAULT shade - alias for medium */\n readonly DEFAULT: HexColor\n}\n\n/**\n * Complete color token system with semantic color categories\n * Designed for global theme usage with nested theme support\n */\nexport interface ColorTokens {\n /** Primary brand color - main actions and emphasis */\n primary: ColorShade\n /** Secondary brand color - supporting actions */\n secondary: ColorShade\n /** Accent color - highlights and special elements */\n accent: ColorShade\n\n /** Success state color - confirmations, positive feedback */\n success: ColorShade\n /** Warning state color - cautions, alerts */\n warning: ColorShade\n /** Error state color - errors, destructive actions */\n error: ColorShade\n /** Info state color - informational messages */\n info: ColorShade\n\n /** Background colors - main app backgrounds */\n background: ColorShade\n /** Surface colors - cards, panels, elevated elements */\n surface: ColorShade\n /** Text colors - typography hierarchy */\n text: ColorShade\n /** Border colors - dividers, outlines */\n border: ColorShade\n}\n\n/**\n * Color mode enum for light/dark theme switching\n */\nexport type ColorMode = 'light' | 'dark'\n\n/**\n * RGB color representation\n */\nexport interface RGBColor {\n r: number\n g: number\n b: number\n}\n"],"names":[],"mappings":";;AAeO,MAAM,SAAS;AAAA,EACX;AAAA,EAET,YAAY,KAAa;AACvB,SAAK,SAAS;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,WAAmB;AACjB,WAAO,SAAS,KAAK,OAAO,QAAQ,KAAK,EAAE,GAAG,EAAE;AAAA,EAClD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,WAAmB;AACjB,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,UAAkB;AAChB,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OAAO,KAAK,KAAuB;AACjC,WAAO,IAAI,SAAS,GAAG;AAAA,EACzB;AACF;;"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Color system types for PhaserJSX UI
|
|
3
|
+
* Provides semantic color tokens with named shade levels
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Named shade levels for color scales
|
|
7
|
+
* Uses semantic names instead of numeric values
|
|
8
|
+
*/
|
|
9
|
+
export type ShadeLevel = 'lightest' | 'light' | 'medium' | 'dark' | 'darkest';
|
|
10
|
+
/**
|
|
11
|
+
* Hex color with conversion method for Phaser compatibility
|
|
12
|
+
* Wraps a string value and provides toNumber() for Phaser color integration
|
|
13
|
+
*/
|
|
14
|
+
export declare class HexColor {
|
|
15
|
+
#private;
|
|
16
|
+
constructor(hex: string);
|
|
17
|
+
/**
|
|
18
|
+
* Convert to Phaser number format
|
|
19
|
+
* @returns Color as number (0xffffff)
|
|
20
|
+
*/
|
|
21
|
+
toNumber(): number;
|
|
22
|
+
/**
|
|
23
|
+
* Return the hex string value
|
|
24
|
+
* @returns Hex color string
|
|
25
|
+
*/
|
|
26
|
+
toString(): string;
|
|
27
|
+
/**
|
|
28
|
+
* Primitive string value for coercion contexts
|
|
29
|
+
* @returns Hex color string
|
|
30
|
+
*/
|
|
31
|
+
valueOf(): string;
|
|
32
|
+
/**
|
|
33
|
+
* Create a HexColor from a hex string
|
|
34
|
+
* @param hex - Hex color string
|
|
35
|
+
*/
|
|
36
|
+
static from(hex: string): HexColor;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Color shade scale with semantic naming
|
|
40
|
+
* Each color token has multiple shades for different use cases
|
|
41
|
+
* Uses HexColor type for VS Code color picker support and .toNumber() method
|
|
42
|
+
* DEFAULT is an alias for medium
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* const primaryShade: ColorShade = {
|
|
46
|
+
* lightest: HexColor.from('#e3f2fd'),
|
|
47
|
+
* light: HexColor.from('#90caf9'),
|
|
48
|
+
* medium: HexColor.from('#42a5f5'),
|
|
49
|
+
* dark: HexColor.from('#1976d2'),
|
|
50
|
+
* darkest: HexColor.from('#0d47a1'),
|
|
51
|
+
* DEFAULT: HexColor.from('#42a5f5'), // alias to medium
|
|
52
|
+
* }
|
|
53
|
+
* // Usage:
|
|
54
|
+
* backgroundColor: colors.primary.DEFAULT.toNumber() // same as medium
|
|
55
|
+
* backgroundColor: colors.primary.medium.toNumber()
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export interface ColorShade {
|
|
59
|
+
/** Lightest shade - backgrounds, hover states */
|
|
60
|
+
lightest: HexColor;
|
|
61
|
+
/** Light shade - secondary elements */
|
|
62
|
+
light: HexColor;
|
|
63
|
+
/** Medium shade - interactive elements (also available as DEFAULT) */
|
|
64
|
+
medium: HexColor;
|
|
65
|
+
/** Dark shade - borders, dividers */
|
|
66
|
+
dark: HexColor;
|
|
67
|
+
/** Darkest shade - text, emphasis */
|
|
68
|
+
darkest: HexColor;
|
|
69
|
+
/** DEFAULT shade - alias for medium */
|
|
70
|
+
readonly DEFAULT: HexColor;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Complete color token system with semantic color categories
|
|
74
|
+
* Designed for global theme usage with nested theme support
|
|
75
|
+
*/
|
|
76
|
+
export interface ColorTokens {
|
|
77
|
+
/** Primary brand color - main actions and emphasis */
|
|
78
|
+
primary: ColorShade;
|
|
79
|
+
/** Secondary brand color - supporting actions */
|
|
80
|
+
secondary: ColorShade;
|
|
81
|
+
/** Accent color - highlights and special elements */
|
|
82
|
+
accent: ColorShade;
|
|
83
|
+
/** Success state color - confirmations, positive feedback */
|
|
84
|
+
success: ColorShade;
|
|
85
|
+
/** Warning state color - cautions, alerts */
|
|
86
|
+
warning: ColorShade;
|
|
87
|
+
/** Error state color - errors, destructive actions */
|
|
88
|
+
error: ColorShade;
|
|
89
|
+
/** Info state color - informational messages */
|
|
90
|
+
info: ColorShade;
|
|
91
|
+
/** Background colors - main app backgrounds */
|
|
92
|
+
background: ColorShade;
|
|
93
|
+
/** Surface colors - cards, panels, elevated elements */
|
|
94
|
+
surface: ColorShade;
|
|
95
|
+
/** Text colors - typography hierarchy */
|
|
96
|
+
text: ColorShade;
|
|
97
|
+
/** Border colors - dividers, outlines */
|
|
98
|
+
border: ColorShade;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Color mode enum for light/dark theme switching
|
|
102
|
+
*/
|
|
103
|
+
export type ColorMode = 'light' | 'dark';
|
|
104
|
+
/**
|
|
105
|
+
* RGB color representation
|
|
106
|
+
*/
|
|
107
|
+
export interface RGBColor {
|
|
108
|
+
r: number;
|
|
109
|
+
g: number;
|
|
110
|
+
b: number;
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=color-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-types.d.ts","sourceRoot":"","sources":["../../src/colors/color-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAA;AAE7E;;;GAGG;AACH,qBAAa,QAAQ;;gBAGP,GAAG,EAAE,MAAM;IAIvB;;;OAGG;IACH,QAAQ,IAAI,MAAM;IAIlB;;;OAGG;IACH,QAAQ,IAAI,MAAM;IAIlB;;;OAGG;IACH,OAAO,IAAI,MAAM;IAIjB;;;OAGG;IACH,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ;CAGnC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,UAAU;IACzB,iDAAiD;IACjD,QAAQ,EAAE,QAAQ,CAAA;IAClB,uCAAuC;IACvC,KAAK,EAAE,QAAQ,CAAA;IACf,sEAAsE;IACtE,MAAM,EAAE,QAAQ,CAAA;IAChB,qCAAqC;IACrC,IAAI,EAAE,QAAQ,CAAA;IACd,qCAAqC;IACrC,OAAO,EAAE,QAAQ,CAAA;IACjB,uCAAuC;IACvC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAA;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,sDAAsD;IACtD,OAAO,EAAE,UAAU,CAAA;IACnB,iDAAiD;IACjD,SAAS,EAAE,UAAU,CAAA;IACrB,qDAAqD;IACrD,MAAM,EAAE,UAAU,CAAA;IAElB,6DAA6D;IAC7D,OAAO,EAAE,UAAU,CAAA;IACnB,6CAA6C;IAC7C,OAAO,EAAE,UAAU,CAAA;IACnB,sDAAsD;IACtD,KAAK,EAAE,UAAU,CAAA;IACjB,gDAAgD;IAChD,IAAI,EAAE,UAAU,CAAA;IAEhB,+CAA+C;IAC/C,UAAU,EAAE,UAAU,CAAA;IACtB,wDAAwD;IACxD,OAAO,EAAE,UAAU,CAAA;IACnB,yCAAyC;IACzC,IAAI,EAAE,UAAU,CAAA;IAChB,yCAAyC;IACzC,MAAM,EAAE,UAAU,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,CAAA;AAExC;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACV"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
class HexColor {
|
|
2
|
+
#value;
|
|
3
|
+
constructor(hex) {
|
|
4
|
+
this.#value = hex;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Convert to Phaser number format
|
|
8
|
+
* @returns Color as number (0xffffff)
|
|
9
|
+
*/
|
|
10
|
+
toNumber() {
|
|
11
|
+
return parseInt(this.#value.replace("#", ""), 16);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Return the hex string value
|
|
15
|
+
* @returns Hex color string
|
|
16
|
+
*/
|
|
17
|
+
toString() {
|
|
18
|
+
return this.#value;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Primitive string value for coercion contexts
|
|
22
|
+
* @returns Hex color string
|
|
23
|
+
*/
|
|
24
|
+
valueOf() {
|
|
25
|
+
return this.#value;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Create a HexColor from a hex string
|
|
29
|
+
* @param hex - Hex color string
|
|
30
|
+
*/
|
|
31
|
+
static from(hex) {
|
|
32
|
+
return new HexColor(hex);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
HexColor
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=color-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color-types.js","sources":["../../src/colors/color-types.ts"],"sourcesContent":["/**\n * Color system types for PhaserJSX UI\n * Provides semantic color tokens with named shade levels\n */\n\n/**\n * Named shade levels for color scales\n * Uses semantic names instead of numeric values\n */\nexport type ShadeLevel = 'lightest' | 'light' | 'medium' | 'dark' | 'darkest'\n\n/**\n * Hex color with conversion method for Phaser compatibility\n * Wraps a string value and provides toNumber() for Phaser color integration\n */\nexport class HexColor {\n readonly #value: string\n\n constructor(hex: string) {\n this.#value = hex\n }\n\n /**\n * Convert to Phaser number format\n * @returns Color as number (0xffffff)\n */\n toNumber(): number {\n return parseInt(this.#value.replace('#', ''), 16)\n }\n\n /**\n * Return the hex string value\n * @returns Hex color string\n */\n toString(): string {\n return this.#value\n }\n\n /**\n * Primitive string value for coercion contexts\n * @returns Hex color string\n */\n valueOf(): string {\n return this.#value\n }\n\n /**\n * Create a HexColor from a hex string\n * @param hex - Hex color string\n */\n static from(hex: string): HexColor {\n return new HexColor(hex)\n }\n}\n\n/**\n * Color shade scale with semantic naming\n * Each color token has multiple shades for different use cases\n * Uses HexColor type for VS Code color picker support and .toNumber() method\n * DEFAULT is an alias for medium\n * @example\n * ```typescript\n * const primaryShade: ColorShade = {\n * lightest: HexColor.from('#e3f2fd'),\n * light: HexColor.from('#90caf9'),\n * medium: HexColor.from('#42a5f5'),\n * dark: HexColor.from('#1976d2'),\n * darkest: HexColor.from('#0d47a1'),\n * DEFAULT: HexColor.from('#42a5f5'), // alias to medium\n * }\n * // Usage:\n * backgroundColor: colors.primary.DEFAULT.toNumber() // same as medium\n * backgroundColor: colors.primary.medium.toNumber()\n * ```\n */\nexport interface ColorShade {\n /** Lightest shade - backgrounds, hover states */\n lightest: HexColor\n /** Light shade - secondary elements */\n light: HexColor\n /** Medium shade - interactive elements (also available as DEFAULT) */\n medium: HexColor\n /** Dark shade - borders, dividers */\n dark: HexColor\n /** Darkest shade - text, emphasis */\n darkest: HexColor\n /** DEFAULT shade - alias for medium */\n readonly DEFAULT: HexColor\n}\n\n/**\n * Complete color token system with semantic color categories\n * Designed for global theme usage with nested theme support\n */\nexport interface ColorTokens {\n /** Primary brand color - main actions and emphasis */\n primary: ColorShade\n /** Secondary brand color - supporting actions */\n secondary: ColorShade\n /** Accent color - highlights and special elements */\n accent: ColorShade\n\n /** Success state color - confirmations, positive feedback */\n success: ColorShade\n /** Warning state color - cautions, alerts */\n warning: ColorShade\n /** Error state color - errors, destructive actions */\n error: ColorShade\n /** Info state color - informational messages */\n info: ColorShade\n\n /** Background colors - main app backgrounds */\n background: ColorShade\n /** Surface colors - cards, panels, elevated elements */\n surface: ColorShade\n /** Text colors - typography hierarchy */\n text: ColorShade\n /** Border colors - dividers, outlines */\n border: ColorShade\n}\n\n/**\n * Color mode enum for light/dark theme switching\n */\nexport type ColorMode = 'light' | 'dark'\n\n/**\n * RGB color representation\n */\nexport interface RGBColor {\n r: number\n g: number\n b: number\n}\n"],"names":[],"mappings":"AAeO,MAAM,SAAS;AAAA,EACX;AAAA,EAET,YAAY,KAAa;AACvB,SAAK,SAAS;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,WAAmB;AACjB,WAAO,SAAS,KAAK,OAAO,QAAQ,KAAK,EAAE,GAAG,EAAE;AAAA,EAClD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,WAAmB;AACjB,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,UAAkB;AAChB,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,OAAO,KAAK,KAAuB;AACjC,WAAO,IAAI,SAAS,GAAG;AAAA,EACzB;AACF;"}
|