@firestitch/style 18.0.72 → 18.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestitch/style",
3
- "version": "18.0.72",
3
+ "version": "18.1.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/Firestitch/ngx-style"
package/styles/_core.scss CHANGED
@@ -5,6 +5,7 @@
5
5
  @use 'overflow';
6
6
  @use 'typography';
7
7
  @use 'form-field';
8
+ @use 'form-controls';
8
9
  @use 'material';
9
10
 
10
11
 
@@ -17,6 +18,10 @@
17
18
  @include tokens.tokens();
18
19
  @include headings.headings();
19
20
  @include form-field.form-field();
21
+ // The selection controls - checkbox, radio, slide toggle, slider, chip. After
22
+ // form-field because it answers the same questions for the same family of
23
+ // inputs, and before material so an app's own Material overrides still win.
24
+ @include form-controls.form-controls();
20
25
  @include helpers.helpers();
21
26
  @include layout.layout();
22
27
  @include overflow.overflow();
@@ -0,0 +1,171 @@
1
+ // =============================================================================
2
+ // THE SELECTION CONTROLS
3
+ // =============================================================================
4
+ // Checkbox, radio, slide toggle, slider and chip.
5
+ //
6
+ // WHY THIS FILE EXISTS - Ray 2026-09-14. Material themes these five entirely
7
+ // through its own tokens, and an app on an M2 theme gets the LIGHT theme's
8
+ // values for all of them:
9
+ //
10
+ // --mat-checkbox-unselected-icon-color: rgba(0, 0, 0, 0.54)
11
+ // --mat-checkbox-label-text-color: rgba(0, 0, 0, 0.87)
12
+ // --mat-checkbox-selected-icon-color: var(--brand-primary-color)
13
+ //
14
+ // On a dark ground the first two are invisible - a black box outline and a black
15
+ // label on a dark surface, which is how a "Set as default" checkbox shipped
16
+ // looking disabled. The third is worse: it points at whatever name the app's
17
+ // palette happens to use, and an undefined custom property is invalid at
18
+ // computed-value time, so a CHECKED box renders unstyled rather than branded.
19
+ //
20
+ // Nothing here is app-specific. Every value is either the shared --fs-* contract
21
+ // or a light-dark() pair restating this package's own default, so an app that
22
+ // sets nothing still renders correctly in both schemes and an app that maps
23
+ // --fs-color-primary onto its brand gets its brand for free.
24
+ //
25
+ // ONE FILE FOR THE FAMILY, not one control at a time. These were fixed app-side
26
+ // one control at a time for years, which is why a project could have a correct
27
+ // select and an invisible checkbox in the same dialog. The five share three
28
+ // questions - what colour is the control unselected, selected, and what colour
29
+ // is its label - so they are answered together or they drift.
30
+ //
31
+ // GLOBAL, NOT SCOPED. These emit at :root like every other block in this
32
+ // package. A checkbox inside a dialog, menu or select panel renders in a CDK
33
+ // overlay attached to <body>, outside any app shell class, so a scoped block
34
+ // cannot reach it - the mistake that left dialog buttons unbranded.
35
+
36
+ @mixin form-controls() {
37
+ :root {
38
+ // =========================================================================
39
+ // CHECKBOX
40
+ // =========================================================================
41
+ // The unselected box is an OUTLINE, so it takes the hairline rather than a
42
+ // text colour: it is a drawn edge, and at text strength it reads as heavy.
43
+ --mat-checkbox-unselected-icon-color: var(--fs-hairline-strong, light-dark(rgba(0, 0, 0, 0.38), rgba(255, 255, 255, 0.38)));
44
+ --mat-checkbox-unselected-hover-icon-color: var(--fs-color-text-muted, light-dark(rgba(0, 0, 0, 0.54), #97A5A6));
45
+ --mat-checkbox-unselected-focus-icon-color: var(--fs-color-text-muted, light-dark(rgba(0, 0, 0, 0.54), #97A5A6));
46
+ --mat-checkbox-unselected-pressed-icon-color: var(--fs-color-text-muted, light-dark(rgba(0, 0, 0, 0.54), #97A5A6));
47
+
48
+ // Checked: the brand fills the box and the checkmark sits on it. The
49
+ // checkmark reads the SURFACE colour rather than white, so it stays legible
50
+ // if an app maps --fs-color-primary to a pale brand.
51
+ --mat-checkbox-selected-icon-color: var(--fs-color-primary, #1B474E);
52
+ --mat-checkbox-selected-hover-icon-color: var(--fs-color-primary, #1B474E);
53
+ --mat-checkbox-selected-focus-icon-color: var(--fs-color-primary, #1B474E);
54
+ --mat-checkbox-selected-checkmark-color: var(--fs-surface-background, light-dark(#FFFFFF, #232428));
55
+
56
+ --mat-checkbox-label-text-color: var(--fs-color-text, light-dark(rgba(0, 0, 0, 0.87), #E8EDEC));
57
+ --mat-checkbox-disabled-label-color: var(--fs-color-text-faint, light-dark(rgba(0, 0, 0, 0.38), #6A7779));
58
+ --mat-checkbox-disabled-unselected-icon-color: var(--fs-hairline, light-dark(#f0f0f0, rgba(255, 255, 255, 0.22)));
59
+ --mat-checkbox-disabled-selected-icon-color: var(--fs-hairline-strong, light-dark(rgba(0, 0, 0, 0.38), rgba(255, 255, 255, 0.38)));
60
+
61
+ // The wash under a hover or press. Translucent, never a fixed grey: it takes
62
+ // its tone from whatever is behind it and so reads in both schemes.
63
+ --mat-checkbox-unselected-hover-state-layer-color: var(--fs-color-hover, light-dark(rgba(0, 0, 0, 0.04), rgba(255, 255, 255, 0.08)));
64
+ --mat-checkbox-unselected-pressed-state-layer-color: var(--fs-color-hover, light-dark(rgba(0, 0, 0, 0.04), rgba(255, 255, 255, 0.08)));
65
+ --mat-checkbox-selected-hover-state-layer-color: var(--fs-color-selected, light-dark(rgba(0, 0, 0, 0.08), rgba(255, 255, 255, 0.12)));
66
+ --mat-checkbox-selected-pressed-state-layer-color: var(--fs-color-selected, light-dark(rgba(0, 0, 0, 0.08), rgba(255, 255, 255, 0.12)));
67
+
68
+ // =========================================================================
69
+ // RADIO
70
+ // =========================================================================
71
+ // Same three questions as the checkbox, same answers - the two controls
72
+ // differ in shape and in whether they are exclusive, never in colour.
73
+ --mat-radio-unselected-icon-color: var(--fs-hairline-strong, light-dark(rgba(0, 0, 0, 0.38), rgba(255, 255, 255, 0.38)));
74
+ --mat-radio-unselected-hover-icon-color: var(--fs-color-text-muted, light-dark(rgba(0, 0, 0, 0.54), #97A5A6));
75
+ --mat-radio-unselected-focus-icon-color: var(--fs-color-text-muted, light-dark(rgba(0, 0, 0, 0.54), #97A5A6));
76
+ --mat-radio-unselected-pressed-icon-color: var(--fs-color-text-muted, light-dark(rgba(0, 0, 0, 0.54), #97A5A6));
77
+
78
+ --mat-radio-selected-icon-color: var(--fs-color-primary, #1B474E);
79
+ --mat-radio-selected-hover-icon-color: var(--fs-color-primary, #1B474E);
80
+ --mat-radio-selected-focus-icon-color: var(--fs-color-primary, #1B474E);
81
+ --mat-radio-selected-pressed-icon-color: var(--fs-color-primary, #1B474E);
82
+
83
+ --mat-radio-label-text-color: var(--fs-color-text, light-dark(rgba(0, 0, 0, 0.87), #E8EDEC));
84
+ --mat-radio-disabled-label-color: var(--fs-color-text-faint, light-dark(rgba(0, 0, 0, 0.38), #6A7779));
85
+ --mat-radio-disabled-unselected-icon-color: var(--fs-hairline, light-dark(#f0f0f0, rgba(255, 255, 255, 0.22)));
86
+ --mat-radio-disabled-selected-icon-color: var(--fs-hairline-strong, light-dark(rgba(0, 0, 0, 0.38), rgba(255, 255, 255, 0.38)));
87
+ --mat-radio-ripple-color: var(--fs-color-hover, light-dark(rgba(0, 0, 0, 0.04), rgba(255, 255, 255, 0.08)));
88
+ --mat-radio-checked-ripple-color: var(--fs-color-selected, light-dark(rgba(0, 0, 0, 0.08), rgba(255, 255, 255, 0.12)));
89
+
90
+ // =========================================================================
91
+ // SLIDE TOGGLE
92
+ // =========================================================================
93
+ // The toggle is a TRACK with a HANDLE on it, so "unselected" is two colours
94
+ // rather than one: the track is the hairline it sits in, and the handle is
95
+ // the muted ink so it reads as an object on that track rather than a hole.
96
+ --mat-slide-toggle-unselected-track-color: var(--fs-hairline, light-dark(#f0f0f0, rgba(255, 255, 255, 0.22)));
97
+ --mat-slide-toggle-unselected-hover-track-color: var(--fs-hairline, light-dark(#f0f0f0, rgba(255, 255, 255, 0.22)));
98
+ --mat-slide-toggle-unselected-focus-track-color: var(--fs-hairline, light-dark(#f0f0f0, rgba(255, 255, 255, 0.22)));
99
+ --mat-slide-toggle-unselected-pressed-track-color: var(--fs-hairline, light-dark(#f0f0f0, rgba(255, 255, 255, 0.22)));
100
+ --mat-slide-toggle-unselected-handle-color: var(--fs-color-text-muted, light-dark(rgba(0, 0, 0, 0.54), #97A5A6));
101
+ --mat-slide-toggle-unselected-hover-handle-color: var(--fs-color-text, light-dark(rgba(0, 0, 0, 0.87), #E8EDEC));
102
+ --mat-slide-toggle-unselected-focus-handle-color: var(--fs-color-text, light-dark(rgba(0, 0, 0, 0.87), #E8EDEC));
103
+ --mat-slide-toggle-unselected-pressed-handle-color: var(--fs-color-text, light-dark(rgba(0, 0, 0, 0.87), #E8EDEC));
104
+ --mat-slide-toggle-unselected-icon-color: var(--fs-surface-background, light-dark(#FFFFFF, #232428));
105
+
106
+ // Selected: the brand fills the track, and the handle goes to the surface
107
+ // colour so it reads as a light knob on a coloured rail in both schemes.
108
+ --mat-slide-toggle-selected-track-color: var(--fs-color-primary, #1B474E);
109
+ --mat-slide-toggle-selected-hover-track-color: var(--fs-color-primary, #1B474E);
110
+ --mat-slide-toggle-selected-focus-track-color: var(--fs-color-primary, #1B474E);
111
+ --mat-slide-toggle-selected-pressed-track-color: var(--fs-color-primary, #1B474E);
112
+ --mat-slide-toggle-selected-handle-color: var(--fs-surface-background, light-dark(#FFFFFF, #232428));
113
+ --mat-slide-toggle-selected-hover-handle-color: var(--fs-surface-background, light-dark(#FFFFFF, #232428));
114
+ --mat-slide-toggle-selected-focus-handle-color: var(--fs-surface-background, light-dark(#FFFFFF, #232428));
115
+ --mat-slide-toggle-selected-pressed-handle-color: var(--fs-surface-background, light-dark(#FFFFFF, #232428));
116
+ --mat-slide-toggle-selected-icon-color: var(--fs-color-primary, #1B474E);
117
+
118
+ --mat-slide-toggle-label-text-color: var(--fs-color-text, light-dark(rgba(0, 0, 0, 0.87), #E8EDEC));
119
+ --mat-slide-toggle-disabled-label-text-color: var(--fs-color-text-faint, light-dark(rgba(0, 0, 0, 0.38), #6A7779));
120
+ --mat-slide-toggle-disabled-unselected-track-outline-color: var(--fs-hairline, light-dark(#f0f0f0, rgba(255, 255, 255, 0.22)));
121
+ --mat-slide-toggle-selected-focus-state-layer-color: var(--fs-color-selected, light-dark(rgba(0, 0, 0, 0.08), rgba(255, 255, 255, 0.12)));
122
+ --mat-slide-toggle-selected-hover-state-layer-color: var(--fs-color-selected, light-dark(rgba(0, 0, 0, 0.08), rgba(255, 255, 255, 0.12)));
123
+ --mat-slide-toggle-unselected-focus-state-layer-color: var(--fs-color-hover, light-dark(rgba(0, 0, 0, 0.04), rgba(255, 255, 255, 0.08)));
124
+ --mat-slide-toggle-unselected-hover-state-layer-color: var(--fs-color-hover, light-dark(rgba(0, 0, 0, 0.04), rgba(255, 255, 255, 0.08)));
125
+
126
+ // =========================================================================
127
+ // SLIDER
128
+ // =========================================================================
129
+ // The ACTIVE track is the brand, the INACTIVE track is the hairline, and the
130
+ // handle matches the active track rather than the surface - a slider's knob
131
+ // is part of the value it is showing.
132
+ --mat-slider-active-track-color: var(--fs-color-primary, #1B474E);
133
+ --mat-slider-inactive-track-color: var(--fs-hairline-strong, light-dark(rgba(0, 0, 0, 0.38), rgba(255, 255, 255, 0.38)));
134
+ --mat-slider-handle-color: var(--fs-color-primary, #1B474E);
135
+ --mat-slider-hover-handle-color: var(--fs-color-primary, #1B474E);
136
+ --mat-slider-focus-handle-color: var(--fs-color-primary, #1B474E);
137
+ --mat-slider-disabled-active-track-color: var(--fs-hairline-strong, light-dark(rgba(0, 0, 0, 0.38), rgba(255, 255, 255, 0.38)));
138
+ --mat-slider-disabled-inactive-track-color: var(--fs-hairline, light-dark(#f0f0f0, rgba(255, 255, 255, 0.22)));
139
+ --mat-slider-disabled-handle-color: var(--fs-hairline-strong, light-dark(rgba(0, 0, 0, 0.38), rgba(255, 255, 255, 0.38)));
140
+ --mat-slider-ripple-color: var(--fs-color-selected, light-dark(rgba(0, 0, 0, 0.08), rgba(255, 255, 255, 0.12)));
141
+ --mat-slider-hover-state-layer-color: var(--fs-color-hover, light-dark(rgba(0, 0, 0, 0.04), rgba(255, 255, 255, 0.08)));
142
+ --mat-slider-focus-state-layer-color: var(--fs-color-selected, light-dark(rgba(0, 0, 0, 0.08), rgba(255, 255, 255, 0.12)));
143
+
144
+ // The value bubble is a floating surface, so it takes the RAISED surface and
145
+ // the ink that reads on it.
146
+ --mat-slider-label-container-color: var(--fs-surface-background, light-dark(#FFFFFF, #232428));
147
+ --mat-slider-label-label-text-color: var(--fs-color-text, light-dark(rgba(0, 0, 0, 0.87), #E8EDEC));
148
+
149
+ // =========================================================================
150
+ // CHIP
151
+ // =========================================================================
152
+ // A chip is a SURFACE with a label, not an outline with a tint, so the flat
153
+ // (unselected) chip takes the hover wash rather than the page ground - that
154
+ // is what separates it from whatever it sits on without a border.
155
+ --mat-chip-elevated-container-color: var(--fs-color-hover, light-dark(rgba(0, 0, 0, 0.04), rgba(255, 255, 255, 0.08)));
156
+ --mat-chip-label-text-color: var(--fs-color-text, light-dark(rgba(0, 0, 0, 0.87), #E8EDEC));
157
+ --mat-chip-outline-color: var(--fs-hairline-strong, light-dark(rgba(0, 0, 0, 0.38), rgba(255, 255, 255, 0.38)));
158
+ --mat-chip-focus-outline-color: var(--fs-color-primary, #1B474E);
159
+
160
+ --mat-chip-elevated-selected-container-color: var(--fs-color-primary, #1B474E);
161
+ --mat-chip-selected-label-text-color: var(--fs-surface-background, light-dark(#FFFFFF, #232428));
162
+ --mat-chip-selected-trailing-icon-color: var(--fs-surface-background, light-dark(#FFFFFF, #232428));
163
+
164
+ --mat-chip-disabled-label-text-color: var(--fs-color-text-faint, light-dark(rgba(0, 0, 0, 0.38), #6A7779));
165
+ --mat-chip-disabled-outline-color: var(--fs-hairline, light-dark(#f0f0f0, rgba(255, 255, 255, 0.22)));
166
+ --mat-chip-hover-state-layer-color: var(--fs-color-hover, light-dark(rgba(0, 0, 0, 0.04), rgba(255, 255, 255, 0.08)));
167
+ --mat-chip-focus-state-layer-color: var(--fs-color-selected, light-dark(rgba(0, 0, 0, 0.08), rgba(255, 255, 255, 0.12)));
168
+ --mat-chip-selected-hover-state-layer-color: var(--fs-color-selected, light-dark(rgba(0, 0, 0, 0.08), rgba(255, 255, 255, 0.12)));
169
+ --mat-chip-selected-focus-state-layer-color: var(--fs-color-selected, light-dark(rgba(0, 0, 0, 0.08), rgba(255, 255, 255, 0.12)));
170
+ }
171
+ }
@@ -53,9 +53,9 @@
53
53
  // pair), so nothing about the light appearance moves. Only the dark half is
54
54
  // new, and light-dark() picks between them off the `color-scheme` the host
55
55
  // declares -- no class, no input, no media query.
56
- --mdc-filled-text-field-container-color: var(--fs-color-surface, light-dark(#FFFFFF, #232428));
56
+ --mdc-filled-text-field-container-color: var(--fs-surface-background, light-dark(#FFFFFF, #232428));
57
57
  --mdc-filled-text-field-disabled-container-color: var(--fs-color-hover, light-dark(#F5F5F5, rgba(255, 255, 255, 0.08)));
58
- --mat-form-field-filled-container-color: var(--fs-color-surface, light-dark(#FFFFFF, #232428));
58
+ --mat-form-field-filled-container-color: var(--fs-surface-background, light-dark(#FFFFFF, #232428));
59
59
  --mat-form-field-filled-disabled-container-color: var(--fs-color-hover, light-dark(#F5F5F5, rgba(255, 255, 255, 0.08)));
60
60
 
61
61
  .mat-mdc-text-field-wrapper {
@@ -41,12 +41,25 @@
41
41
  --fs-color-text-muted: light-dark(rgba(0, 0, 0, 0.54), #97A5A6);
42
42
  --fs-color-text-faint: light-dark(rgba(0, 0, 0, 0.38), #6A7779);
43
43
 
44
- // ===== SURFACES =====
45
- // The ground a component sits on, and the surface it draws for itself.
46
- // `raised` is for the surface that floats above the page — a menu panel, a
47
- // dropdown — which on a dark ground must be LIGHTER, not darker.
48
- --fs-color-surface: light-dark(#FFFFFF, #232428);
49
- --fs-color-surface-raised: light-dark(#FFFFFF, #292A2F);
44
+ // ===== SURFACE =====
45
+ // ONE surface colour for everything that is a surface: a page, a dialog, a
46
+ // card, a menu panel, a dropdown, a bottom sheet. They are all the same kind
47
+ // of thing, so they take the same colour and the app reads as one material.
48
+ //
49
+ // THERE IS DELIBERATELY NO `raised` VARIANT — Ray 2026-09-14. There used to
50
+ // be --fs-color-surface (#232428) and --fs-color-surface-raised (#292A2F),
51
+ // the second six luminance steps lighter so a floating panel read as above
52
+ // the page on a dark ground. Both were #FFFFFF in light mode, so the
53
+ // distinction only ever existed in dark, and it bought a difference nobody
54
+ // had asked for while forcing every consumer to decide which of two nearly
55
+ // identical greys it wanted — and to get it wrong silently, because the
56
+ // fallbacks differ.
57
+ //
58
+ // Elevation is not a colour problem. A surface that must read as floating
59
+ // separates with a shadow, a hairline or a blur; if a genuine need for a
60
+ // second surface colour appears later, add it then, with the case that
61
+ // justifies it. Do not reintroduce `raised` as a default.
62
+ --fs-surface-background: light-dark(#FFFFFF, #232428);
50
63
 
51
64
  // ===== LINES =====
52
65
  // The hairline does most of the structural work: chip outlines, dividers,