@ieeesa-npm/shared-styles 0.7.2 → 0.7.3

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/styles/mixins.scss +88 -25
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ieeesa-npm/shared-styles",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^16.1.0",
6
6
  "@angular/core": "^16.1.0"
@@ -111,35 +111,98 @@
111
111
  border-left: $left;
112
112
  }
113
113
 
114
- @mixin create-form-scroll-shell($offset-variable, $fallback-offset: 320px) {
114
+ // ── Create / edit form shells ────────────────────────────────────────────────
115
+ //
116
+ // A create/edit form has a fixed set of fields. It does not grow with data, so
117
+ // it is sized to its content and the page is the single scroll surface. Its
118
+ // navigation chrome (tab strip / stepper header) and action bar are pinned
119
+ // instead, which keeps them reachable without shrinking the field area.
120
+ //
121
+ // Capping these shells to a slice of the viewport was tried and rejected: it
122
+ // left the field area as short as ~167px on a 1366x600 screen (about one field
123
+ // out of ~25), produced a page scrollbar alongside the inner one, and detached
124
+ // open Material dropdown panels from fields that had scrolled out of the pane.
125
+ // Regions that DO grow with data are bounded individually — see
126
+ // `bounded-record-region`.
127
+ @mixin create-form-dynamic-shell() {
115
128
  display: flex;
116
129
  flex-direction: column;
117
- max-height: calc(100vh - var(#{$offset-variable}, #{$fallback-offset}));
118
- min-height: max(0px, min(240px, calc(100vh - var(#{$offset-variable}, #{$fallback-offset}))));
130
+ max-height: none;
131
+ min-height: 0;
119
132
  }
120
133
 
121
- @mixin create-form-scroll-surface() {
122
- flex: 1 1 auto;
134
+ // Field area of a dynamic-height form. Grows to fit its fields and never
135
+ // introduces its own scrollbar.
136
+ @mixin create-form-dynamic-surface() {
137
+ flex: 0 0 auto;
123
138
  min-height: 0;
124
- overflow-y: auto;
125
- overflow-x: hidden;
126
- padding-right: 8px;
127
- background:
128
- linear-gradient($ieeesa-white 30%, rgba($ieeesa-white, 0)) top / 100% 28px
129
- no-repeat local,
130
- linear-gradient(rgba($ieeesa-white, 0), $ieeesa-white 70%) bottom / 100%
131
- 28px no-repeat local,
132
- radial-gradient(
133
- farthest-side at 50% 0,
134
- rgba(0, 0, 0, 0.18),
135
- rgba(0, 0, 0, 0)
136
- )
137
- top / 100% 12px no-repeat scroll,
138
- radial-gradient(
139
- farthest-side at 50% 100%,
140
- rgba(0, 0, 0, 0.18),
141
- rgba(0, 0, 0, 0)
142
- )
143
- bottom / 100% 12px no-repeat scroll;
139
+ overflow: visible;
140
+ background: none;
141
+ background-color: $ieeesa-white;
142
+ }
143
+
144
+ // ── Sticky form chrome ───────────────────────────────────────────────────────
145
+
146
+ // Pins a form's navigation chrome (tab strip or stepper header) to the top of
147
+ // the viewport while long content scrolls underneath.
148
+ //
149
+ // The host app publishes the heights of anything already pinned above the routed
150
+ // content, and this chrome stacks below the total:
151
+ // --ieeesa-sticky-header-offset the fixed global header
152
+ // --ieeesa-sticky-subheader-offset a pinned breadcrumb / sub-header, if any
153
+ // Both are live measurements, so chrome that wraps taller on narrow screens is
154
+ // followed automatically, and both resolve to 0 when the host pins nothing —
155
+ // which is why these are additive rather than a single value.
156
+ @mixin sticky-form-nav() {
157
+ position: sticky;
158
+ top: calc(
159
+ var(--ieeesa-sticky-header-offset, 0px) +
160
+ var(--ieeesa-sticky-subheader-offset, 0px)
161
+ );
162
+ z-index: 6;
144
163
  background-color: $ieeesa-white;
164
+ box-shadow: 0 4px 8px -4px rgba(0, 0, 0, 0.18);
165
+ }
166
+
167
+ // Pins a form's action bar to the bottom of the viewport so the primary and
168
+ // secondary buttons stay reachable without scrolling to the end of the form.
169
+ // When the content is shorter than the viewport the bar simply sits at the end
170
+ // of the content.
171
+ @mixin sticky-form-actions() {
172
+ position: sticky;
173
+ bottom: 0;
174
+ z-index: 5;
175
+ background-color: $ieeesa-white;
176
+ border-top: 1px solid $ieeesa-disabled-border-color;
177
+ box-shadow: 0 -4px 8px 0 rgba(0, 0, 0, 0.12);
178
+ }
179
+
180
+ // Applied to the page scroll container of a form that uses `sticky-form-nav`
181
+ // and `sticky-form-actions`. Programmatic scrolls — focusing the first invalid
182
+ // field on submit, anchor navigation — would otherwise land the target behind
183
+ // the fixed app header, the sticky nav chrome or the sticky action bar.
184
+ // `$nav-height` is the height of that nav chrome and `$actions-height` the
185
+ // height of the action bar.
186
+ @mixin sticky-form-scroll-padding($nav-height: 64px, $actions-height: 72px) {
187
+ scroll-padding-top: calc(
188
+ var(--ieeesa-sticky-header-offset, 0px) +
189
+ var(--ieeesa-sticky-subheader-offset, 0px) + #{$nav-height}
190
+ );
191
+ scroll-padding-bottom: $actions-height;
192
+ }
193
+
194
+ // ── Record regions ───────────────────────────────────────────────────────────
195
+
196
+ // Bounds a region that grows with the number of records it displays (a
197
+ // timeslot/agenda/meeting list) so adding records scrolls the region instead of
198
+ // lengthening the page. This is the case the "must not expand indefinitely as
199
+ // additional records are displayed" requirement is about.
200
+ //
201
+ // `auto` on both axes means a scrollbar appears only when the content actually
202
+ // overflows, so short lists stay scrollbar-free, and wide rows scroll sideways
203
+ // rather than being wrapped or clipped.
204
+ @mixin bounded-record-region($max-height) {
205
+ max-height: $max-height;
206
+ overflow-y: auto;
207
+ overflow-x: auto;
145
208
  }