@rangular-framework/compiler 0.0.0-stage → 1.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/dist/compiler/src/catalog.d.ts +63 -0
- package/dist/compiler/src/catalog.js +198 -0
- package/dist/compiler/src/class/formInit.d.ts +119 -0
- package/dist/compiler/src/class/formInit.js +370 -0
- package/dist/compiler/src/class/parseComponent.d.ts +232 -0
- package/dist/compiler/src/class/parseComponent.js +430 -0
- package/dist/compiler/src/class/parseDirective.d.ts +42 -0
- package/dist/compiler/src/class/parseDirective.js +227 -0
- package/dist/compiler/src/class/parseRoutes.d.ts +59 -0
- package/dist/compiler/src/class/parseRoutes.js +163 -0
- package/dist/compiler/src/codegen/generate.d.ts +166 -0
- package/dist/compiler/src/codegen/generate.js +3466 -0
- package/dist/compiler/src/codegen/methods.d.ts +148 -0
- package/dist/compiler/src/codegen/methods.js +975 -0
- package/dist/compiler/src/codegen/sourceMap.d.ts +42 -0
- package/dist/compiler/src/codegen/sourceMap.js +77 -0
- package/dist/compiler/src/compile.d.ts +101 -0
- package/dist/compiler/src/compile.js +775 -0
- package/dist/compiler/src/diagnostics.d.ts +37 -0
- package/dist/compiler/src/diagnostics.js +113 -0
- package/dist/compiler/src/doctor.d.ts +35 -0
- package/dist/compiler/src/doctor.js +144 -0
- package/dist/compiler/src/fix.d.ts +21 -0
- package/dist/compiler/src/fix.js +44 -0
- package/dist/compiler/src/index.d.ts +22 -0
- package/dist/compiler/src/index.js +38 -0
- package/dist/compiler/src/preview/renderPreview.d.ts +101 -0
- package/dist/compiler/src/preview/renderPreview.js +7158 -0
- package/dist/compiler/src/preview/styleSnapshot.d.ts +36 -0
- package/dist/compiler/src/preview/styleSnapshot.js +268 -0
- package/dist/compiler/src/propTable.d.ts +22 -0
- package/dist/compiler/src/propTable.js +107 -0
- package/dist/compiler/src/style/css.d.ts +23 -0
- package/dist/compiler/src/style/css.js +161 -0
- package/dist/compiler/src/template/ast.d.ts +66 -0
- package/dist/compiler/src/template/ast.js +19 -0
- package/dist/compiler/src/template/evaluate.d.ts +45 -0
- package/dist/compiler/src/template/evaluate.js +151 -0
- package/dist/compiler/src/template/expr.d.ts +94 -0
- package/dist/compiler/src/template/expr.js +360 -0
- package/dist/compiler/src/template/forms.d.ts +42 -0
- package/dist/compiler/src/template/forms.js +80 -0
- package/dist/compiler/src/template/literal.d.ts +38 -0
- package/dist/compiler/src/template/literal.js +248 -0
- package/dist/compiler/src/template/parser.d.ts +14 -0
- package/dist/compiler/src/template/parser.js +230 -0
- package/dist/compiler/src/template/pipes.d.ts +48 -0
- package/dist/compiler/src/template/pipes.js +225 -0
- package/dist/compiler/src/template/printAst.d.ts +3 -0
- package/dist/compiler/src/template/printAst.js +38 -0
- package/dist/compiler/src/template/structural.d.ts +27 -0
- package/dist/compiler/src/template/structural.js +51 -0
- package/dist/runtime/src/index.d.ts +486 -0
- package/dist/runtime/src/index.js +1197 -0
- package/dist/ui/src/chart.d.ts +81 -0
- package/dist/ui/src/chart.js +196 -0
- package/dist/ui/src/datetime.d.ts +92 -0
- package/dist/ui/src/datetime.js +240 -0
- package/dist/ui/src/icons.d.ts +63 -0
- package/dist/ui/src/icons.js +310 -0
- package/dist/ui/src/mask.d.ts +38 -0
- package/dist/ui/src/mask.js +103 -0
- package/dist/ui/src/palette.d.ts +66 -0
- package/dist/ui/src/palette.js +141 -0
- package/dist/ui/src/tokens.d.ts +129 -0
- package/dist/ui/src/tokens.js +173 -0
- package/package.json +24 -4
- package/README.md +0 -3
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SV_BLACK = exports.SV_WHITE = exports.HUE_STOPS = exports.AVATAR_TONE_NAMES = exports.AVATAR_TONES = exports.CHECKLIST_COLOR = exports.COLOR_SWATCHES = void 0;
|
|
4
|
+
exports.hexToHsv = hexToHsv;
|
|
5
|
+
exports.hsvToHex = hsvToHex;
|
|
6
|
+
/**
|
|
7
|
+
* Data colours (Stage 15), pure TypeScript with no imports.
|
|
8
|
+
*
|
|
9
|
+
* These are not theme colours and they are not design tokens: they
|
|
10
|
+
* are the fixed categorical palette that charts colour their series
|
|
11
|
+
* with and the colour picker offers as preset swatches. Data colours
|
|
12
|
+
* behave like brand colours (the dinacharya gold is the in-repo
|
|
13
|
+
* precedent): they stay the same in light and dark themes, because a
|
|
14
|
+
* chart series or a picked colour must not change identity when the
|
|
15
|
+
* theme flips. A chart point may override its colour with its own
|
|
16
|
+
* `color` field; the colour picker's value is a hex string from (or
|
|
17
|
+
* beyond) this list.
|
|
18
|
+
*
|
|
19
|
+
* The list lives here, not in primitives.tsx, because primitives
|
|
20
|
+
* hold no hard-coded hex values at all (a guard test enforces it):
|
|
21
|
+
* theme colours come from tokens, data colours come from here.
|
|
22
|
+
*/
|
|
23
|
+
exports.COLOR_SWATCHES = [
|
|
24
|
+
'#0b57d0', '#1e8e3e', '#f9ab00', '#d93025',
|
|
25
|
+
'#9334e6', '#e37400', '#12a5af', '#c2185b',
|
|
26
|
+
'#5f6368', '#80868b', '#202124', '#ffffff',
|
|
27
|
+
];
|
|
28
|
+
// The block editor's checklist amber (framework 0.5.0): the ring
|
|
29
|
+
// a checklist block wears, filled when the item is done. It is
|
|
30
|
+
// the palette's own amber swatch, named for its one job so the
|
|
31
|
+
// primitives file still holds no hex of its own.
|
|
32
|
+
exports.CHECKLIST_COLOR = '#f9ab00';
|
|
33
|
+
/**
|
|
34
|
+
* Avatar tones (Gmail light round, 2026-11-17): pastel background
|
|
35
|
+
* and foreground pairs for row avatar tiles that vary by label,
|
|
36
|
+
* the Gmail list look. Data colours, like the swatches above:
|
|
37
|
+
* they do not change with the theme.
|
|
38
|
+
*/
|
|
39
|
+
exports.AVATAR_TONES = [
|
|
40
|
+
{ bg: '#e8f0fe', fg: '#0b57d0' },
|
|
41
|
+
{ bg: '#f3e8fd', fg: '#9334e6' },
|
|
42
|
+
{ bg: '#fce8e6', fg: '#c5221f' },
|
|
43
|
+
{ bg: '#e6f4ea', fg: '#137333' },
|
|
44
|
+
{ bg: '#fef7e0', fg: '#b06000' },
|
|
45
|
+
];
|
|
46
|
+
/**
|
|
47
|
+
* The same five pairs under names (Option A round, 2026-11-17),
|
|
48
|
+
* so a row can ask for a tone by meaning: a done lesson's tile is
|
|
49
|
+
* `green`, the current lesson's is `blue`. `varied` keeps the
|
|
50
|
+
* hash pick from the array above.
|
|
51
|
+
*/
|
|
52
|
+
exports.AVATAR_TONE_NAMES = {
|
|
53
|
+
blue: exports.AVATAR_TONES[0],
|
|
54
|
+
purple: exports.AVATAR_TONES[1],
|
|
55
|
+
red: exports.AVATAR_TONES[2],
|
|
56
|
+
green: exports.AVATAR_TONES[3],
|
|
57
|
+
amber: exports.AVATAR_TONES[4],
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Hue stops for the colour picker's rainbow bar: the pure hues
|
|
61
|
+
* at full saturation and value, in wheel order, returning to
|
|
62
|
+
* red at the bottom so the bar loops seamlessly.
|
|
63
|
+
*/
|
|
64
|
+
exports.HUE_STOPS = [
|
|
65
|
+
'#ff0000', '#ffff00', '#00ff00', '#00ffff',
|
|
66
|
+
'#0000ff', '#ff00ff', '#ff0000',
|
|
67
|
+
];
|
|
68
|
+
/**
|
|
69
|
+
* The saturation and value square's two anchors: true white at
|
|
70
|
+
* the top left corner and true black along the bottom edge, in
|
|
71
|
+
* every theme, because they are points in the colour space,
|
|
72
|
+
* not theme roles.
|
|
73
|
+
*/
|
|
74
|
+
exports.SV_WHITE = '#ffffff';
|
|
75
|
+
exports.SV_BLACK = '#000000';
|
|
76
|
+
/**
|
|
77
|
+
* A six digit hex string as hue (0 to 360), saturation and
|
|
78
|
+
* value (0 to 1), or null when the text is not a hex colour.
|
|
79
|
+
* The colour picker drafts in hsv: the hue bar sets h, the
|
|
80
|
+
* square sets s and v, and hsvToHex commits the result.
|
|
81
|
+
*/
|
|
82
|
+
function hexToHsv(hex) {
|
|
83
|
+
const m = /^#?([0-9a-fA-F]{6})$/.exec(String(hex).trim());
|
|
84
|
+
if (!m)
|
|
85
|
+
return null;
|
|
86
|
+
const n = parseInt(m[1], 16);
|
|
87
|
+
const r = ((n >> 16) & 255) / 255;
|
|
88
|
+
const g = ((n >> 8) & 255) / 255;
|
|
89
|
+
const b = (n & 255) / 255;
|
|
90
|
+
const max = Math.max(r, g, b);
|
|
91
|
+
const min = Math.min(r, g, b);
|
|
92
|
+
const d = max - min;
|
|
93
|
+
let h = 0;
|
|
94
|
+
if (d > 0) {
|
|
95
|
+
if (max === r)
|
|
96
|
+
h = 60 * (((g - b) / d) % 6);
|
|
97
|
+
else if (max === g)
|
|
98
|
+
h = 60 * ((b - r) / d + 2);
|
|
99
|
+
else
|
|
100
|
+
h = 60 * ((r - g) / d + 4);
|
|
101
|
+
}
|
|
102
|
+
if (h < 0)
|
|
103
|
+
h += 360;
|
|
104
|
+
return { h, s: max === 0 ? 0 : d / max, v: max };
|
|
105
|
+
}
|
|
106
|
+
/** Hue, saturation and value back to a lowercase hex string. */
|
|
107
|
+
function hsvToHex(h, s, v) {
|
|
108
|
+
const hh = ((h % 360) + 360) % 360;
|
|
109
|
+
const c = v * s;
|
|
110
|
+
const x = c * (1 - Math.abs(((hh / 60) % 2) - 1));
|
|
111
|
+
const m = v - c;
|
|
112
|
+
let r = 0;
|
|
113
|
+
let g = 0;
|
|
114
|
+
let b = 0;
|
|
115
|
+
if (hh < 60) {
|
|
116
|
+
r = c;
|
|
117
|
+
g = x;
|
|
118
|
+
}
|
|
119
|
+
else if (hh < 120) {
|
|
120
|
+
r = x;
|
|
121
|
+
g = c;
|
|
122
|
+
}
|
|
123
|
+
else if (hh < 180) {
|
|
124
|
+
g = c;
|
|
125
|
+
b = x;
|
|
126
|
+
}
|
|
127
|
+
else if (hh < 240) {
|
|
128
|
+
g = x;
|
|
129
|
+
b = c;
|
|
130
|
+
}
|
|
131
|
+
else if (hh < 300) {
|
|
132
|
+
r = x;
|
|
133
|
+
b = c;
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
r = c;
|
|
137
|
+
b = x;
|
|
138
|
+
}
|
|
139
|
+
const part = (n) => Math.round((n + m) * 255).toString(16).padStart(2, '0');
|
|
140
|
+
return '#' + part(r) + part(g) + part(b);
|
|
141
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rangular Material design tokens, pure TypeScript, no react-native imports.
|
|
3
|
+
* Every visual value in a generated app comes from here; generated code never
|
|
4
|
+
* contains magic numbers. See docs/UI_POLISH.md.
|
|
5
|
+
*/
|
|
6
|
+
export declare const spacing: {
|
|
7
|
+
readonly xs: 4;
|
|
8
|
+
readonly sm: 8;
|
|
9
|
+
readonly md: 12;
|
|
10
|
+
readonly lg: 16;
|
|
11
|
+
readonly xl: 20;
|
|
12
|
+
readonly xxl: 24;
|
|
13
|
+
readonly xxxl: 32;
|
|
14
|
+
};
|
|
15
|
+
export declare const spacingScale: number[];
|
|
16
|
+
export declare const radius: {
|
|
17
|
+
readonly sm: 8;
|
|
18
|
+
readonly md: 12;
|
|
19
|
+
readonly lg: 16;
|
|
20
|
+
readonly xl: 20;
|
|
21
|
+
readonly full: 9999;
|
|
22
|
+
};
|
|
23
|
+
export declare const radiusScale: number[];
|
|
24
|
+
export interface TypeStep {
|
|
25
|
+
fontSize: number;
|
|
26
|
+
lineHeight: number;
|
|
27
|
+
fontWeight: string;
|
|
28
|
+
}
|
|
29
|
+
export declare const typeScale: Record<'caption' | 'body' | 'bodyLarge' | 'label' | 'title' | 'heading' | 'display', TypeStep>;
|
|
30
|
+
/**
|
|
31
|
+
* Colour roles, the same role names exist in both modes, always.
|
|
32
|
+
*
|
|
33
|
+
* Stage 4 completed the set to the full Material 3 role list the polish
|
|
34
|
+
* system needs. Two naming families coexist on purpose:
|
|
35
|
+
* - the Material names (onSurface, onSurfaceVariant, error, ...) and
|
|
36
|
+
* - the original Rangular aliases (text === onSurface,
|
|
37
|
+
* textMuted === onSurfaceVariant, danger === error, border is the
|
|
38
|
+
* hairline colour next to outline).
|
|
39
|
+
* Aliases always carry the SAME value as their Material counterpart in
|
|
40
|
+
* each mode, existing code referencing the old names keeps working and
|
|
41
|
+
* keeps meaning the same thing.
|
|
42
|
+
*/
|
|
43
|
+
export interface ColourRoles {
|
|
44
|
+
primary: string;
|
|
45
|
+
onPrimary: string;
|
|
46
|
+
primaryContainer: string;
|
|
47
|
+
onPrimaryContainer: string;
|
|
48
|
+
secondary: string;
|
|
49
|
+
secondaryContainer: string;
|
|
50
|
+
onSecondaryContainer: string;
|
|
51
|
+
accent: string;
|
|
52
|
+
background: string;
|
|
53
|
+
surface: string;
|
|
54
|
+
surfaceVariant: string;
|
|
55
|
+
onSurface: string;
|
|
56
|
+
onSurfaceVariant: string;
|
|
57
|
+
text: string;
|
|
58
|
+
textMuted: string;
|
|
59
|
+
error: string;
|
|
60
|
+
onError: string;
|
|
61
|
+
danger: string;
|
|
62
|
+
success: string;
|
|
63
|
+
border: string;
|
|
64
|
+
outline: string;
|
|
65
|
+
scrim: string;
|
|
66
|
+
avatar: string;
|
|
67
|
+
onAvatar: string;
|
|
68
|
+
codeSurface: string;
|
|
69
|
+
codeText: string;
|
|
70
|
+
toastSurface: string;
|
|
71
|
+
toastText: string;
|
|
72
|
+
toastAction: string;
|
|
73
|
+
gradientFrom: string;
|
|
74
|
+
gradientVia: string;
|
|
75
|
+
gradientTo: string;
|
|
76
|
+
washFrom: string;
|
|
77
|
+
washVia: string;
|
|
78
|
+
washTo: string;
|
|
79
|
+
primaryDeep: string;
|
|
80
|
+
onGradient: string;
|
|
81
|
+
primaryHi: string;
|
|
82
|
+
dangerHi: string;
|
|
83
|
+
dangerVia: string;
|
|
84
|
+
dangerDeep: string;
|
|
85
|
+
warningHi: string;
|
|
86
|
+
warningVia: string;
|
|
87
|
+
warningDeep: string;
|
|
88
|
+
warningText: string;
|
|
89
|
+
successHi: string;
|
|
90
|
+
successVia: string;
|
|
91
|
+
successDeep: string;
|
|
92
|
+
neutralHi: string;
|
|
93
|
+
neutralVia: string;
|
|
94
|
+
neutralDeep: string;
|
|
95
|
+
secondaryHi: string;
|
|
96
|
+
secondaryVia: string;
|
|
97
|
+
secondaryDeep: string;
|
|
98
|
+
secondaryBorder: string;
|
|
99
|
+
secondaryLabel: string;
|
|
100
|
+
disabledHi: string;
|
|
101
|
+
disabledVia: string;
|
|
102
|
+
disabledDeep: string;
|
|
103
|
+
}
|
|
104
|
+
export declare const colours: Record<'light' | 'dark', ColourRoles>;
|
|
105
|
+
/** One elevation preset: an RN shadow style object, never free-hand values. */
|
|
106
|
+
export interface ElevationPreset {
|
|
107
|
+
shadowColor: string;
|
|
108
|
+
shadowOpacity: number;
|
|
109
|
+
shadowRadius: number;
|
|
110
|
+
shadowOffset: {
|
|
111
|
+
width: number;
|
|
112
|
+
height: number;
|
|
113
|
+
};
|
|
114
|
+
elevation: number;
|
|
115
|
+
}
|
|
116
|
+
/** Elevation presets, 3 named levels (docs/UI_POLISH.md part 1). */
|
|
117
|
+
export declare const elevation: Record<'level0' | 'level1' | 'level2', ElevationPreset>;
|
|
118
|
+
export type ThemeMode = 'light' | 'dark';
|
|
119
|
+
export interface Theme {
|
|
120
|
+
mode: ThemeMode;
|
|
121
|
+
spacing: typeof spacing;
|
|
122
|
+
radius: typeof radius;
|
|
123
|
+
typography: typeof typeScale;
|
|
124
|
+
colors: ColourRoles;
|
|
125
|
+
elevation: typeof elevation;
|
|
126
|
+
}
|
|
127
|
+
export declare function theme(mode: ThemeMode): Theme;
|
|
128
|
+
/** Both themes as ready-made objects: `themes.light` / `themes.dark`. */
|
|
129
|
+
export declare const themes: Record<ThemeMode, Theme>;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Rangular Material design tokens, pure TypeScript, no react-native imports.
|
|
4
|
+
* Every visual value in a generated app comes from here; generated code never
|
|
5
|
+
* contains magic numbers. See docs/UI_POLISH.md.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.themes = exports.elevation = exports.colours = exports.typeScale = exports.radiusScale = exports.radius = exports.spacingScale = exports.spacing = void 0;
|
|
9
|
+
exports.theme = theme;
|
|
10
|
+
exports.spacing = {
|
|
11
|
+
xs: 4, sm: 8, md: 12, lg: 16, xl: 20, xxl: 24, xxxl: 32,
|
|
12
|
+
};
|
|
13
|
+
exports.spacingScale = [4, 8, 12, 16, 20, 24, 32];
|
|
14
|
+
exports.radius = {
|
|
15
|
+
sm: 8, md: 12, lg: 16, xl: 20, full: 9999,
|
|
16
|
+
};
|
|
17
|
+
exports.radiusScale = [8, 12, 16, 20, 9999];
|
|
18
|
+
exports.typeScale = {
|
|
19
|
+
caption: { fontSize: 12, lineHeight: 16, fontWeight: '400' },
|
|
20
|
+
body: { fontSize: 14, lineHeight: 20, fontWeight: '400' },
|
|
21
|
+
bodyLarge: { fontSize: 16, lineHeight: 24, fontWeight: '400' },
|
|
22
|
+
label: { fontSize: 14, lineHeight: 20, fontWeight: '600' },
|
|
23
|
+
title: { fontSize: 20, lineHeight: 28, fontWeight: '600' },
|
|
24
|
+
heading: { fontSize: 24, lineHeight: 32, fontWeight: '700' },
|
|
25
|
+
display: { fontSize: 32, lineHeight: 40, fontWeight: '700' },
|
|
26
|
+
};
|
|
27
|
+
exports.colours = {
|
|
28
|
+
light: {
|
|
29
|
+
primary: '#0b57d0',
|
|
30
|
+
onPrimary: '#ffffff',
|
|
31
|
+
primaryContainer: '#e8f0fe',
|
|
32
|
+
onPrimaryContainer: '#041e49',
|
|
33
|
+
secondary: '#00639b',
|
|
34
|
+
secondaryContainer: '#cde6ff',
|
|
35
|
+
onSecondaryContainer: '#001d32',
|
|
36
|
+
accent: '#0b57d0',
|
|
37
|
+
background: '#ffffff',
|
|
38
|
+
surface: '#ffffff',
|
|
39
|
+
surfaceVariant: '#f0f4f9',
|
|
40
|
+
onSurface: '#1f1f1f',
|
|
41
|
+
onSurfaceVariant: '#5f6368',
|
|
42
|
+
text: '#1f1f1f',
|
|
43
|
+
textMuted: '#5f6368',
|
|
44
|
+
error: '#b3261e',
|
|
45
|
+
onError: '#ffffff',
|
|
46
|
+
danger: '#b3261e',
|
|
47
|
+
success: '#34a853',
|
|
48
|
+
border: '#dadce0',
|
|
49
|
+
outline: '#747775',
|
|
50
|
+
scrim: '#000000',
|
|
51
|
+
avatar: '#7b1fa2',
|
|
52
|
+
onAvatar: '#ffffff',
|
|
53
|
+
codeSurface: '#1e1e1e',
|
|
54
|
+
codeText: '#d4d4d4',
|
|
55
|
+
toastSurface: '#000000d9',
|
|
56
|
+
toastText: '#f1f3f4',
|
|
57
|
+
toastAction: '#a8c7fa',
|
|
58
|
+
gradientFrom: '#0849ad',
|
|
59
|
+
gradientVia: '#0b57d0',
|
|
60
|
+
gradientTo: '#4285f4',
|
|
61
|
+
washFrom: '#dde7f5',
|
|
62
|
+
washVia: '#e9eff8',
|
|
63
|
+
washTo: '#fbfcfe',
|
|
64
|
+
primaryDeep: '#0849ad',
|
|
65
|
+
onGradient: '#ffffff',
|
|
66
|
+
primaryHi: '#6ea8ff',
|
|
67
|
+
dangerHi: '#f08379',
|
|
68
|
+
dangerVia: '#d93025',
|
|
69
|
+
dangerDeep: '#a50e0e',
|
|
70
|
+
warningHi: '#fbbc04',
|
|
71
|
+
warningVia: '#f29900',
|
|
72
|
+
warningDeep: '#e37400',
|
|
73
|
+
warningText: '#b06000',
|
|
74
|
+
successHi: '#5fbf77',
|
|
75
|
+
successVia: '#34a853',
|
|
76
|
+
successDeep: '#20713a',
|
|
77
|
+
neutralHi: '#bdc1c6',
|
|
78
|
+
neutralVia: '#80868b',
|
|
79
|
+
neutralDeep: '#5f6368',
|
|
80
|
+
secondaryHi: '#ffffff',
|
|
81
|
+
secondaryVia: '#eef3fd',
|
|
82
|
+
secondaryDeep: '#dbe7fc',
|
|
83
|
+
secondaryBorder: '#c6dafc',
|
|
84
|
+
secondaryLabel: '#0b57d0',
|
|
85
|
+
disabledHi: '#eef0f2',
|
|
86
|
+
disabledVia: '#e3e5e8',
|
|
87
|
+
disabledDeep: '#dadce0',
|
|
88
|
+
},
|
|
89
|
+
dark: {
|
|
90
|
+
primary: '#a8c7fa',
|
|
91
|
+
onPrimary: '#062e6f',
|
|
92
|
+
primaryContainer: '#004a77',
|
|
93
|
+
onPrimaryContainer: '#d3e3fd',
|
|
94
|
+
secondary: '#8ecbf2',
|
|
95
|
+
secondaryContainer: '#004b70',
|
|
96
|
+
onSecondaryContainer: '#cde6ff',
|
|
97
|
+
accent: '#a8c7fa',
|
|
98
|
+
background: '#131314',
|
|
99
|
+
surface: '#1e1f20',
|
|
100
|
+
surfaceVariant: '#282a2c',
|
|
101
|
+
onSurface: '#e3e3e3',
|
|
102
|
+
onSurfaceVariant: '#9aa0a6',
|
|
103
|
+
text: '#e3e3e3',
|
|
104
|
+
textMuted: '#9aa0a6',
|
|
105
|
+
error: '#f2b8b5',
|
|
106
|
+
onError: '#601410',
|
|
107
|
+
danger: '#f2b8b5',
|
|
108
|
+
success: '#81c995',
|
|
109
|
+
border: '#444746',
|
|
110
|
+
outline: '#8e918f',
|
|
111
|
+
scrim: '#000000',
|
|
112
|
+
avatar: '#d0bcff',
|
|
113
|
+
onAvatar: '#381e72',
|
|
114
|
+
codeSurface: '#1e1e1e',
|
|
115
|
+
codeText: '#d4d4d4',
|
|
116
|
+
toastSurface: '#000000d9',
|
|
117
|
+
toastText: '#f1f3f4',
|
|
118
|
+
toastAction: '#a8c7fa',
|
|
119
|
+
gradientFrom: '#0849ad',
|
|
120
|
+
gradientVia: '#0b57d0',
|
|
121
|
+
gradientTo: '#4285f4',
|
|
122
|
+
washFrom: '#262c38',
|
|
123
|
+
washVia: '#1e242e',
|
|
124
|
+
washTo: '#14161a',
|
|
125
|
+
primaryDeep: '#8fb4f5',
|
|
126
|
+
onGradient: '#ffffff',
|
|
127
|
+
primaryHi: '#6ea8ff',
|
|
128
|
+
dangerHi: '#f08379',
|
|
129
|
+
dangerVia: '#d93025',
|
|
130
|
+
dangerDeep: '#a50e0e',
|
|
131
|
+
warningHi: '#fbbc04',
|
|
132
|
+
warningVia: '#f29900',
|
|
133
|
+
warningDeep: '#e37400',
|
|
134
|
+
warningText: '#f9ab00',
|
|
135
|
+
successHi: '#5fbf77',
|
|
136
|
+
successVia: '#34a853',
|
|
137
|
+
successDeep: '#20713a',
|
|
138
|
+
neutralHi: '#bdc1c6',
|
|
139
|
+
neutralVia: '#80868b',
|
|
140
|
+
neutralDeep: '#5f6368',
|
|
141
|
+
secondaryHi: '#ffffff',
|
|
142
|
+
secondaryVia: '#eef3fd',
|
|
143
|
+
secondaryDeep: '#dbe7fc',
|
|
144
|
+
secondaryBorder: '#c6dafc',
|
|
145
|
+
secondaryLabel: '#0b57d0',
|
|
146
|
+
disabledHi: '#eef0f2',
|
|
147
|
+
disabledVia: '#e3e5e8',
|
|
148
|
+
disabledDeep: '#dadce0',
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
/** Elevation presets, 3 named levels (docs/UI_POLISH.md part 1). */
|
|
152
|
+
exports.elevation = {
|
|
153
|
+
level0: {
|
|
154
|
+
shadowColor: '#000000', shadowOpacity: 0, shadowRadius: 0,
|
|
155
|
+
shadowOffset: { width: 0, height: 0 }, elevation: 0,
|
|
156
|
+
},
|
|
157
|
+
level1: {
|
|
158
|
+
shadowColor: '#000000', shadowOpacity: 0.15, shadowRadius: 3,
|
|
159
|
+
shadowOffset: { width: 0, height: 1 }, elevation: 1,
|
|
160
|
+
},
|
|
161
|
+
level2: {
|
|
162
|
+
shadowColor: '#000000', shadowOpacity: 0.25, shadowRadius: 4,
|
|
163
|
+
shadowOffset: { width: 0, height: 2 }, elevation: 3,
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
function theme(mode) {
|
|
167
|
+
return { mode, spacing: exports.spacing, radius: exports.radius, typography: exports.typeScale, colors: exports.colours[mode], elevation: exports.elevation };
|
|
168
|
+
}
|
|
169
|
+
/** Both themes as ready-made objects: `themes.light` / `themes.dark`. */
|
|
170
|
+
exports.themes = {
|
|
171
|
+
light: theme('light'),
|
|
172
|
+
dark: theme('dark'),
|
|
173
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
{
|
|
2
|
+
"dependencies": {
|
|
3
|
+
"typescript": "^5.9.0"
|
|
4
|
+
},
|
|
5
|
+
"description": "Rangular template + class compiler: Angular-style components to React Native TSX.",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"main": "dist/compiler/src/index.js",
|
|
2
8
|
"name": "@rangular-framework/compiler",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
9
|
+
"types": "dist/compiler/src/index.d.ts",
|
|
10
|
+
"version": "1.0.0",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc -p tsconfig.publish.json",
|
|
16
|
+
"prepack": "npm run build"
|
|
17
|
+
},
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public"
|
|
20
|
+
},
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/bigyanchap/rangular-framework.git",
|
|
24
|
+
"directory": "packages/compiler"
|
|
25
|
+
}
|
|
26
|
+
}
|
package/README.md
DELETED