@rblabs-dev/axiom 0.0.0-stage → 1.2.1
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 +21 -0
- package/README.md +155 -2
- package/brand/favicon.template.svg +21 -0
- package/brand/og-image.template.svg +37 -0
- package/brand/rb-monogram.svg +16 -0
- package/cli/axiom.mjs +56 -0
- package/cli/build-brand-assets.mjs +115 -0
- package/cli/build-icon-font.mjs +134 -0
- package/cli/check-style-literals.mjs +94 -0
- package/cli/project.mjs +105 -0
- package/cli/verify-production-assets.mjs +146 -0
- package/fesm2022/rblabs-dev-axiom-showcase.mjs +1027 -0
- package/fesm2022/rblabs-dev-axiom-showcase.mjs.map +1 -0
- package/fesm2022/rblabs-dev-axiom.mjs +2955 -0
- package/fesm2022/rblabs-dev-axiom.mjs.map +1 -0
- package/material-symbols-icons.txt +24 -0
- package/package.json +67 -4
- package/showcase/package.json +4 -0
- package/styles/_base.scss +135 -0
- package/styles/_breakpoints.scss +35 -0
- package/styles/_components.scss +560 -0
- package/styles/_fonts.scss +63 -0
- package/styles/_index.scss +72 -0
- package/styles/_material-overrides.scss +79 -0
- package/styles/_palette.scss +139 -0
- package/styles/_theme.scss +183 -0
- package/styles/_tokens.scss +341 -0
- package/types/rblabs-dev-axiom-showcase.d.ts +81 -0
- package/types/rblabs-dev-axiom.d.ts +675 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// Component shape and size adjustments (docs/design-system.md, sections 7.2 and 7.3), only through
|
|
2
|
+
// Material's documented `mat.<component>-overrides()` mixins. No `!important`, no selectors
|
|
3
|
+
// targeting Material internals.
|
|
4
|
+
|
|
5
|
+
@use '@angular/material' as mat;
|
|
6
|
+
|
|
7
|
+
// Emits inside the current selector (html, or the scope selector).
|
|
8
|
+
@mixin overrides() {
|
|
9
|
+
// Buttons: 8px corners instead of Material's full pill (radius `sm`).
|
|
10
|
+
@include mat.button-overrides(
|
|
11
|
+
(
|
|
12
|
+
filled-container-shape: var(--rb-radius-sm),
|
|
13
|
+
outlined-container-shape: var(--rb-radius-sm),
|
|
14
|
+
protected-container-shape: var(--rb-radius-sm),
|
|
15
|
+
text-container-shape: var(--rb-radius-sm),
|
|
16
|
+
tonal-container-shape: var(--rb-radius-sm),
|
|
17
|
+
)
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
@include mat.form-field-overrides(
|
|
21
|
+
(
|
|
22
|
+
outlined-container-shape: var(--rb-radius-sm),
|
|
23
|
+
)
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
@include mat.card-overrides(
|
|
27
|
+
(
|
|
28
|
+
elevated-container-shape: var(--rb-radius-lg),
|
|
29
|
+
outlined-container-shape: var(--rb-radius-lg),
|
|
30
|
+
filled-container-shape: var(--rb-radius-lg),
|
|
31
|
+
)
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
// Material paints dialogs on `surface` (the page background) without a shadow; the system puts
|
|
35
|
+
// them on the raised surface with elevation 3 (5.4 and 7.4).
|
|
36
|
+
@include mat.dialog-overrides(
|
|
37
|
+
(
|
|
38
|
+
container-shape: var(--rb-radius-lg),
|
|
39
|
+
container-color: var(--rb-color-surface-raised),
|
|
40
|
+
container-elevation-shadow: var(--rb-elevation-3),
|
|
41
|
+
)
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
// Square edges against the viewport, and the system scrim behind the drawer (5.7).
|
|
45
|
+
@include mat.sidenav-overrides(
|
|
46
|
+
(
|
|
47
|
+
container-shape: 0,
|
|
48
|
+
scrim-color: var(--rb-color-scrim),
|
|
49
|
+
)
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
@include mat.menu-overrides(
|
|
53
|
+
(
|
|
54
|
+
container-shape: var(--rb-radius-sm),
|
|
55
|
+
)
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
@include mat.snack-bar-overrides(
|
|
59
|
+
(
|
|
60
|
+
container-shape: var(--rb-radius-sm),
|
|
61
|
+
)
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
// Icon buttons reach the 44px target on coarse pointers (7.2). Chips grow to the same height, so
|
|
65
|
+
// their 44px remove action (_base.scss) stays inside the chip instead of overlapping a neighbor.
|
|
66
|
+
@media (pointer: coarse) {
|
|
67
|
+
@include mat.icon-button-overrides(
|
|
68
|
+
(
|
|
69
|
+
state-layer-size: var(--rb-size-touch-target),
|
|
70
|
+
)
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
@include mat.chips-overrides(
|
|
74
|
+
(
|
|
75
|
+
container-height: var(--rb-size-touch-target),
|
|
76
|
+
)
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
// Material 3 palettes for docs/design-system.md, section 5.1. Generated, never hand-edited: re-run
|
|
2
|
+
// ng generate @angular/material:theme-color --primary-color='#2f78ed' --tertiary-color='#06b6d4' \
|
|
3
|
+
// --neutral-color='#0e1b2c' --is-scss --directory=projects/axiom/src/styles/
|
|
4
|
+
// and rename the output (_theme-colors.scss) to this file, keeping this header.
|
|
5
|
+
|
|
6
|
+
@use 'sass:map';
|
|
7
|
+
@use '@angular/material' as mat;
|
|
8
|
+
|
|
9
|
+
// Note: Color palettes are generated from primary: #2f78ed, tertiary: #06b6d4, neutral: #0e1b2c
|
|
10
|
+
$_palettes: (
|
|
11
|
+
primary: (
|
|
12
|
+
0: #000000,
|
|
13
|
+
10: #001a42,
|
|
14
|
+
20: #002e6b,
|
|
15
|
+
25: #003880,
|
|
16
|
+
30: #004396,
|
|
17
|
+
35: #004ead,
|
|
18
|
+
40: #005ac4,
|
|
19
|
+
50: #2773e7,
|
|
20
|
+
60: #4f8eff,
|
|
21
|
+
70: #82aaff,
|
|
22
|
+
80: #aec6ff,
|
|
23
|
+
90: #d8e2ff,
|
|
24
|
+
95: #edf0ff,
|
|
25
|
+
98: #faf9ff,
|
|
26
|
+
99: #fefbff,
|
|
27
|
+
100: #ffffff,
|
|
28
|
+
),
|
|
29
|
+
secondary: (
|
|
30
|
+
0: #000000,
|
|
31
|
+
10: #001a42,
|
|
32
|
+
20: #182f5a,
|
|
33
|
+
25: #243b66,
|
|
34
|
+
30: #304672,
|
|
35
|
+
35: #3d527e,
|
|
36
|
+
40: #495e8b,
|
|
37
|
+
50: #6277a6,
|
|
38
|
+
60: #7b90c1,
|
|
39
|
+
70: #96abdd,
|
|
40
|
+
80: #b1c6fa,
|
|
41
|
+
90: #d8e2ff,
|
|
42
|
+
95: #edf0ff,
|
|
43
|
+
98: #faf9ff,
|
|
44
|
+
99: #fefbff,
|
|
45
|
+
100: #ffffff,
|
|
46
|
+
),
|
|
47
|
+
tertiary: (
|
|
48
|
+
0: #000000,
|
|
49
|
+
10: #001f26,
|
|
50
|
+
20: #003640,
|
|
51
|
+
25: #00424e,
|
|
52
|
+
30: #004e5c,
|
|
53
|
+
35: #005b6b,
|
|
54
|
+
40: #00687a,
|
|
55
|
+
50: #008399,
|
|
56
|
+
60: #009eb9,
|
|
57
|
+
70: #1abbd9,
|
|
58
|
+
80: #4cd7f6,
|
|
59
|
+
90: #acedff,
|
|
60
|
+
95: #d8f6ff,
|
|
61
|
+
98: #f0fbff,
|
|
62
|
+
99: #f8fdff,
|
|
63
|
+
100: #ffffff,
|
|
64
|
+
),
|
|
65
|
+
neutral: (
|
|
66
|
+
0: #000000,
|
|
67
|
+
10: #0f1c2d,
|
|
68
|
+
20: #253143,
|
|
69
|
+
25: #303c4f,
|
|
70
|
+
30: #3b475a,
|
|
71
|
+
35: #475367,
|
|
72
|
+
40: #535f73,
|
|
73
|
+
50: #6b788c,
|
|
74
|
+
60: #8591a7,
|
|
75
|
+
70: #9facc2,
|
|
76
|
+
80: #bac7de,
|
|
77
|
+
90: #d6e3fb,
|
|
78
|
+
95: #ebf1ff,
|
|
79
|
+
98: #f8f9ff,
|
|
80
|
+
99: #fdfcff,
|
|
81
|
+
100: #ffffff,
|
|
82
|
+
4: #020f1f,
|
|
83
|
+
6: #061425,
|
|
84
|
+
12: #132031,
|
|
85
|
+
17: #1e2b3c,
|
|
86
|
+
22: #293548,
|
|
87
|
+
24: #2d3a4c,
|
|
88
|
+
87: #cedbf2,
|
|
89
|
+
92: #dde9ff,
|
|
90
|
+
94: #e6eeff,
|
|
91
|
+
96: #eff3ff,
|
|
92
|
+
),
|
|
93
|
+
neutral-variant: (
|
|
94
|
+
0: #000000,
|
|
95
|
+
10: #171b27,
|
|
96
|
+
20: #2b303d,
|
|
97
|
+
25: #363b48,
|
|
98
|
+
30: #424754,
|
|
99
|
+
35: #4d5260,
|
|
100
|
+
40: #595e6c,
|
|
101
|
+
50: #727785,
|
|
102
|
+
60: #8c909f,
|
|
103
|
+
70: #a6abba,
|
|
104
|
+
80: #c2c6d6,
|
|
105
|
+
90: #dee2f2,
|
|
106
|
+
95: #edf0ff,
|
|
107
|
+
98: #faf9ff,
|
|
108
|
+
99: #fefbff,
|
|
109
|
+
100: #ffffff,
|
|
110
|
+
),
|
|
111
|
+
error: (
|
|
112
|
+
0: #000000,
|
|
113
|
+
10: #410002,
|
|
114
|
+
20: #690005,
|
|
115
|
+
25: #7e0007,
|
|
116
|
+
30: #93000a,
|
|
117
|
+
35: #a80710,
|
|
118
|
+
40: #ba1a1a,
|
|
119
|
+
50: #de3730,
|
|
120
|
+
60: #ff5449,
|
|
121
|
+
70: #ff897d,
|
|
122
|
+
80: #ffb4ab,
|
|
123
|
+
90: #ffdad6,
|
|
124
|
+
95: #ffedea,
|
|
125
|
+
98: #fff8f7,
|
|
126
|
+
99: #fffbff,
|
|
127
|
+
100: #ffffff,
|
|
128
|
+
),
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
$_rest: (
|
|
132
|
+
secondary: map.get($_palettes, secondary),
|
|
133
|
+
neutral: map.get($_palettes, neutral),
|
|
134
|
+
neutral-variant: map.get($_palettes, neutral-variant),
|
|
135
|
+
error: map.get($_palettes, error),
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
$primary-palette: map.merge(map.get($_palettes, primary), $_rest);
|
|
139
|
+
$tertiary-palette: map.merge(map.get($_palettes, tertiary), $_rest);
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
// Angular Material 3 theme (docs/design-system.md, sections 3, 4.3 and 5.1).
|
|
2
|
+
//
|
|
3
|
+
// `mat.theme()` emits the full --mat-sys-* surface from the generated palette. The color map has no
|
|
4
|
+
// `theme-type`, so every color is a `light-dark()` value that follows `color-scheme`. The roles the
|
|
5
|
+
// brand defines are then pointed at the --rb-* tokens with `mat.theme-overrides()`, so Material
|
|
6
|
+
// components and kit components always read the same value.
|
|
7
|
+
|
|
8
|
+
@use 'sass:map';
|
|
9
|
+
@use '@angular/material' as mat;
|
|
10
|
+
@use 'palette';
|
|
11
|
+
@use 'tokens';
|
|
12
|
+
|
|
13
|
+
$_font-family: tokens.$font-sans;
|
|
14
|
+
|
|
15
|
+
$_color-overrides: (
|
|
16
|
+
primary: var(--rb-color-primary),
|
|
17
|
+
on-primary: var(--rb-color-on-primary),
|
|
18
|
+
primary-container: var(--rb-color-primary-soft),
|
|
19
|
+
on-primary-container: var(--rb-color-on-primary-soft),
|
|
20
|
+
surface-tint: var(--rb-color-primary),
|
|
21
|
+
tertiary: var(--rb-color-tertiary),
|
|
22
|
+
on-tertiary: var(--rb-color-on-tertiary),
|
|
23
|
+
error: var(--rb-color-danger),
|
|
24
|
+
on-error: var(--rb-color-on-danger),
|
|
25
|
+
error-container: var(--rb-color-danger-soft),
|
|
26
|
+
on-error-container: var(--rb-color-danger),
|
|
27
|
+
background: var(--rb-color-bg),
|
|
28
|
+
surface: var(--rb-color-bg),
|
|
29
|
+
surface-container-lowest: var(--rb-color-control),
|
|
30
|
+
surface-container-low: var(--rb-color-surface-sunken),
|
|
31
|
+
surface-container: var(--rb-color-surface),
|
|
32
|
+
surface-container-high: var(--rb-color-surface-raised),
|
|
33
|
+
surface-container-highest: var(--rb-color-surface-hover),
|
|
34
|
+
surface-variant: var(--rb-color-surface-hover),
|
|
35
|
+
on-background: var(--rb-color-text-strong),
|
|
36
|
+
on-surface: var(--rb-color-text-strong),
|
|
37
|
+
on-surface-variant: var(--rb-color-text-muted),
|
|
38
|
+
outline: var(--rb-color-outline),
|
|
39
|
+
outline-variant: var(--rb-color-border),
|
|
40
|
+
inverse-surface: var(--rb-color-text-strong),
|
|
41
|
+
inverse-on-surface: var(--rb-color-bg),
|
|
42
|
+
scrim: var(--rb-color-scrim),
|
|
43
|
+
shadow: var(--rb-color-shadow),
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
$_shape-overrides: (
|
|
47
|
+
corner-none: 0,
|
|
48
|
+
corner-extra-small: var(--rb-radius-xs),
|
|
49
|
+
corner-extra-small-top: var(--rb-radius-xs) var(--rb-radius-xs) 0 0,
|
|
50
|
+
corner-small: var(--rb-radius-sm),
|
|
51
|
+
corner-medium: var(--rb-radius-md),
|
|
52
|
+
corner-large: var(--rb-radius-lg),
|
|
53
|
+
corner-large-top: var(--rb-radius-lg) var(--rb-radius-lg) 0 0,
|
|
54
|
+
corner-large-start: var(--rb-radius-lg) 0 0 var(--rb-radius-lg),
|
|
55
|
+
corner-large-end: 0 var(--rb-radius-lg) var(--rb-radius-lg) 0,
|
|
56
|
+
corner-extra-large: var(--rb-radius-xl),
|
|
57
|
+
corner-extra-large-top: var(--rb-radius-xl) var(--rb-radius-xl) 0 0,
|
|
58
|
+
corner-full: var(--rb-radius-full),
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
$_elevation-overrides: (
|
|
62
|
+
level0: var(--rb-elevation-0),
|
|
63
|
+
level1: var(--rb-elevation-1),
|
|
64
|
+
level2: var(--rb-elevation-2),
|
|
65
|
+
level3: var(--rb-elevation-3),
|
|
66
|
+
level4: var(--rb-elevation-3),
|
|
67
|
+
level5: var(--rb-elevation-3),
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
@function _type-overrides() {
|
|
71
|
+
$overrides: ();
|
|
72
|
+
@each $role in tokens.$material-type-roles {
|
|
73
|
+
$overrides: map.merge(
|
|
74
|
+
$overrides,
|
|
75
|
+
(
|
|
76
|
+
'#{$role}': var(--rb-type-#{$role}),
|
|
77
|
+
'#{$role}-font': var(--rb-font-sans),
|
|
78
|
+
'#{$role}-size': var(--rb-type-#{$role}-size),
|
|
79
|
+
'#{$role}-line-height': var(--rb-type-#{$role}-line-height),
|
|
80
|
+
'#{$role}-weight': var(--rb-type-#{$role}-weight),
|
|
81
|
+
'#{$role}-tracking': var(--rb-type-#{$role}-tracking),
|
|
82
|
+
)
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
@return $overrides;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Emits the theme inside the current selector (html, or the scope selector).
|
|
89
|
+
@mixin theme() {
|
|
90
|
+
@include mat.theme(
|
|
91
|
+
(
|
|
92
|
+
color: (
|
|
93
|
+
primary: palette.$primary-palette,
|
|
94
|
+
tertiary: palette.$tertiary-palette,
|
|
95
|
+
),
|
|
96
|
+
typography: (
|
|
97
|
+
plain-family: $_font-family,
|
|
98
|
+
brand-family: $_font-family,
|
|
99
|
+
bold-weight: 700,
|
|
100
|
+
medium-weight: 500,
|
|
101
|
+
regular-weight: 400,
|
|
102
|
+
),
|
|
103
|
+
density: 0,
|
|
104
|
+
)
|
|
105
|
+
);
|
|
106
|
+
|
|
107
|
+
// Applied after the theme, so these declarations win over the generated values.
|
|
108
|
+
@include mat.theme-overrides(
|
|
109
|
+
map.merge(
|
|
110
|
+
map.merge(map.merge($_color-overrides, $_shape-overrides), $_elevation-overrides),
|
|
111
|
+
_type-overrides()
|
|
112
|
+
)
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
@include _danger-variants();
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Danger mapping. Material 3 ignores the `color` input, so `color="warn"` would render as a primary
|
|
119
|
+
// action. `mat.color-variants-backwards-compatibility()` restores it but emits about 70 KB for every
|
|
120
|
+
// component and variant; the kit only needs `warn` on the components used for destructive actions,
|
|
121
|
+
// so it maps those to the danger role directly. Material adds the `mat-warn` class for
|
|
122
|
+
// `color="warn"`. `primary` is the default and `accent` is not part of the system.
|
|
123
|
+
@function _state-layer($color, $opacity-token) {
|
|
124
|
+
@return color-mix(in srgb, #{$color} calc(var(#{$opacity-token}) * 100%), transparent);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
@mixin _danger-variants() {
|
|
128
|
+
.mat-warn.mat-mdc-button-base {
|
|
129
|
+
@include mat.button-overrides(
|
|
130
|
+
(
|
|
131
|
+
filled-container-color: var(--rb-color-danger),
|
|
132
|
+
filled-label-text-color: var(--rb-color-on-danger),
|
|
133
|
+
filled-state-layer-color: var(--rb-color-on-danger),
|
|
134
|
+
filled-ripple-color: _state-layer(
|
|
135
|
+
var(--rb-color-on-danger),
|
|
136
|
+
--mat-sys-pressed-state-layer-opacity
|
|
137
|
+
),
|
|
138
|
+
outlined-label-text-color: var(--rb-color-danger),
|
|
139
|
+
outlined-outline-color: var(--rb-color-danger-border),
|
|
140
|
+
outlined-state-layer-color: var(--rb-color-danger),
|
|
141
|
+
outlined-ripple-color: _state-layer(
|
|
142
|
+
var(--rb-color-danger),
|
|
143
|
+
--mat-sys-pressed-state-layer-opacity
|
|
144
|
+
),
|
|
145
|
+
text-label-text-color: var(--rb-color-danger),
|
|
146
|
+
text-state-layer-color: var(--rb-color-danger),
|
|
147
|
+
text-ripple-color: _state-layer(
|
|
148
|
+
var(--rb-color-danger),
|
|
149
|
+
--mat-sys-pressed-state-layer-opacity
|
|
150
|
+
),
|
|
151
|
+
protected-label-text-color: var(--rb-color-danger),
|
|
152
|
+
protected-state-layer-color: var(--rb-color-danger),
|
|
153
|
+
protected-ripple-color: _state-layer(
|
|
154
|
+
var(--rb-color-danger),
|
|
155
|
+
--mat-sys-pressed-state-layer-opacity
|
|
156
|
+
),
|
|
157
|
+
tonal-container-color: var(--rb-color-danger-soft),
|
|
158
|
+
tonal-label-text-color: var(--rb-color-danger),
|
|
159
|
+
tonal-state-layer-color: var(--rb-color-danger),
|
|
160
|
+
tonal-ripple-color: _state-layer(
|
|
161
|
+
var(--rb-color-danger),
|
|
162
|
+
--mat-sys-pressed-state-layer-opacity
|
|
163
|
+
),
|
|
164
|
+
)
|
|
165
|
+
);
|
|
166
|
+
|
|
167
|
+
@include mat.icon-button-overrides(
|
|
168
|
+
(
|
|
169
|
+
icon-color: var(--rb-color-danger),
|
|
170
|
+
state-layer-color: var(--rb-color-danger),
|
|
171
|
+
ripple-color: _state-layer(var(--rb-color-danger), --mat-sys-pressed-state-layer-opacity),
|
|
172
|
+
)
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.mat-warn.mat-icon {
|
|
177
|
+
@include mat.icon-overrides(
|
|
178
|
+
(
|
|
179
|
+
color: var(--rb-color-danger),
|
|
180
|
+
)
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
}
|