@brightspace-ui/core 3.321.3 → 3.323.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.
Files changed (42) hide show
  1. package/components/empty-state/README.md +13 -13
  2. package/components/empty-state/empty-state-action-button.js +2 -76
  3. package/components/empty-state/empty-state-action-link.js +2 -38
  4. package/components/empty-state/empty-state-illustrated.js +4 -126
  5. package/components/empty-state/empty-state-simple.js +7 -6
  6. package/components/empty-state/empty-state-styles.js +1 -88
  7. package/components/filter/filter.js +7 -7
  8. package/components/state/state-action-button.js +88 -0
  9. package/components/state/state-action-link.js +45 -0
  10. package/components/state/state-illustrated.js +129 -0
  11. package/components/{empty-state/empty-state-mixin.js → state/state-mixin.js} +3 -3
  12. package/components/state/state-styles.js +96 -0
  13. package/custom-elements.json +202 -18
  14. package/package.json +2 -2
  15. package/templates/primary-secondary/primary-secondary.js +44 -4
  16. /package/components/{empty-state → state}/images/assembly-line.svg +0 -0
  17. /package/components/{empty-state → state}/images/blueprint.svg +0 -0
  18. /package/components/{empty-state → state}/images/calendar.svg +0 -0
  19. /package/components/{empty-state → state}/images/cat-computer.svg +0 -0
  20. /package/components/{empty-state → state}/images/checklist.svg +0 -0
  21. /package/components/{empty-state → state}/images/data-tracking.svg +0 -0
  22. /package/components/{empty-state → state}/images/desert-road.svg +0 -0
  23. /package/components/{empty-state → state}/images/fish-hook.svg +0 -0
  24. /package/components/{empty-state → state}/images/oven.svg +0 -0
  25. /package/components/{empty-state → state}/images/pipeline.svg +0 -0
  26. /package/components/{empty-state → state}/images/race.svg +0 -0
  27. /package/components/{empty-state → state}/images/rockets.svg +0 -0
  28. /package/components/{empty-state → state}/images/tumbleweed.svg +0 -0
  29. /package/generated/{empty-state → state}/assembly-line.js +0 -0
  30. /package/generated/{empty-state → state}/blueprint.js +0 -0
  31. /package/generated/{empty-state → state}/calendar.js +0 -0
  32. /package/generated/{empty-state → state}/cat-computer.js +0 -0
  33. /package/generated/{empty-state → state}/checklist.js +0 -0
  34. /package/generated/{empty-state → state}/data-tracking.js +0 -0
  35. /package/generated/{empty-state → state}/desert-road.js +0 -0
  36. /package/generated/{empty-state → state}/fish-hook.js +0 -0
  37. /package/generated/{empty-state → state}/oven.js +0 -0
  38. /package/generated/{empty-state → state}/pipeline.js +0 -0
  39. /package/generated/{empty-state → state}/presetIllustrationLoader.js +0 -0
  40. /package/generated/{empty-state → state}/race.js +0 -0
  41. /package/generated/{empty-state → state}/rockets.js +0 -0
  42. /package/generated/{empty-state → state}/tumbleweed.js +0 -0
@@ -12,6 +12,7 @@ import { LocalizeCoreElement } from '../../helpers/localize-core-element.js';
12
12
  import { styleMap } from 'lit/directives/style-map.js';
13
13
 
14
14
  const reduceMotion = matchMedia('(prefers-reduced-motion: reduce)').matches;
15
+ const desktopMinHeight = 3 * 44; // Primary/Secondary panels have a min-height of 1/3 of the viewport on mobile view. This threshhold prevents them from being smaller than the recommended WCAG Target size(AAA)
15
16
 
16
17
  const desktopMinSize = 320;
17
18
 
@@ -375,7 +376,7 @@ class MobileMouseResizer extends Resizer {
375
376
  this._wasCollapsed = this.isCollapsed;
376
377
  this.dispatchResizeStart();
377
378
  e.preventDefault();
378
- const y = e.clientY - this.contentRect.top;
379
+ const y = this.#getY(e);
379
380
  this._offset = y - (this.contentRect.height - this.panelSize);
380
381
  this._isDragging = false;
381
382
  this._isResizing = true;
@@ -387,7 +388,7 @@ class MobileMouseResizer extends Resizer {
387
388
  if (!this._isResizing) {
388
389
  return;
389
390
  }
390
- const y = e.clientY - this.contentRect.top;
391
+ const y = this.#getY(e);
391
392
  const secondaryHeight = this.clampMaxHeight(this.contentRect.height - y + this._offset);
392
393
  this._isDragging = true;
393
394
  this.dispatchResize(secondaryHeight, false);
@@ -399,7 +400,7 @@ class MobileMouseResizer extends Resizer {
399
400
  }
400
401
  const expandedCollapseThreshold = this.contentBounds.minHeight * 0.75;
401
402
  const collapsedCollapseThreshold = this.contentBounds.minHeight * 0.1;
402
- const y = e.clientY - this.contentRect.top;
403
+ const y = this.#getY(e);
403
404
  const desiredSecondaryHeight = this.contentRect.height - y + this._offset;
404
405
  if (
405
406
  this._isDragging
@@ -414,6 +415,9 @@ class MobileMouseResizer extends Resizer {
414
415
  this._isResizing = false;
415
416
  this.dispatchResizeEnd();
416
417
  }
418
+ #getY(e) {
419
+ return e.clientY + document.documentElement.scrollTop - this.contentRect.top;
420
+ }
417
421
 
418
422
  }
419
423
 
@@ -595,6 +599,7 @@ class TemplatePrimarySecondary extends LocalizeCoreElement(LitElement) {
595
599
  * @type {boolean}
596
600
  */
597
601
  hasForm: { type: Boolean, attribute: 'has-form' },
602
+ _staticFooter: { type: Boolean, attribute: '_static-footer', reflect: true },
598
603
  _formErrorSummary: { type: Array },
599
604
  _hasFooter: { state: true },
600
605
  _isCollapsed: { state: true },
@@ -867,6 +872,35 @@ class TemplatePrimarySecondary extends LocalizeCoreElement(LitElement) {
867
872
  .d2l-template-primary-secondary-divider-handle-desktop {
868
873
  display: none;
869
874
  }
875
+
876
+ :host([_static-footer]),
877
+ :host([_static-footer]) > d2l-form {
878
+ bottom: unset;
879
+ }
880
+ :host([_static-footer]) .d2l-template-primary-secondary-container {
881
+ min-height: 100vh;
882
+ }
883
+ :host([_static-footer]) .d2l-template-primary-secondary-content {
884
+ display: grid;
885
+ flex-grow: 1;
886
+ grid-template: 1fr auto auto / 1fr;
887
+ }
888
+ :host([_static-footer]) .d2l-template-primary-secondary-content > * {
889
+ grid-column: 1/-1;
890
+ }
891
+ :host([_static-footer]) main {
892
+ grid-row: 1 / -1;
893
+ }
894
+ :host([_static-footer]) .d2l-template-primary-secondary-divider {
895
+ grid-row: 2 / 3;
896
+ }
897
+ :host([_static-footer]) .d2l-template-primary-secondary-secondary-container {
898
+ grid-row: 3 / 4;
899
+ }
900
+ :host([_static-footer]) :not([data-background-shading="secondary"]) > .d2l-template-primary-secondary-secondary-container {
901
+ background-color: white;
902
+ }
903
+
870
904
  /* Attribute selector is only used to increase specificity */
871
905
  :host([resizable]) .d2l-template-primary-secondary-divider,
872
906
  :host(:not([resizable])) .d2l-template-primary-secondary-divider {
@@ -1009,6 +1043,7 @@ class TemplatePrimarySecondary extends LocalizeCoreElement(LitElement) {
1009
1043
  this.widthType = 'fullscreen';
1010
1044
 
1011
1045
  this._animateResize = false;
1046
+ this._staticFooter = false;
1012
1047
  this._isCollapsed = false;
1013
1048
  this._isExpanded = false;
1014
1049
  this._isMobile = isMobile();
@@ -1151,11 +1186,13 @@ class TemplatePrimarySecondary extends LocalizeCoreElement(LitElement) {
1151
1186
  this.shadowRoot.querySelector('.d2l-template-primary-secondary-divider-not-resizable');
1152
1187
  const desktopDividerSize = divider.offsetWidth;
1153
1188
  const mobileDividerSize = divider.offsetHeight;
1189
+ const footerSize = this.shadowRoot.querySelector('footer')?.offsetHeight ?? 0;
1190
+ const maxAvailableHeight = !this._staticFooter ? contentRect.height : Math.min(contentRect.height, window.innerHeight - footerSize);
1154
1191
  return {
1155
1192
  height: contentRect.height,
1156
1193
  minWidth: desktopMinSize,
1157
1194
  maxWidth: contentRect.width - desktopMinSize - desktopDividerSize,
1158
- minHeight: (contentRect.height - mobileDividerSize) * (1 / 3),
1195
+ minHeight: (maxAvailableHeight - mobileDividerSize) * (1 / 3),
1159
1196
  maxHeight: (contentRect.height - mobileDividerSize) * (2 / 3),
1160
1197
  width: contentRect.width
1161
1198
  };
@@ -1173,6 +1210,9 @@ class TemplatePrimarySecondary extends LocalizeCoreElement(LitElement) {
1173
1210
  _onContentResize(entries) {
1174
1211
  const entry = entries[0];
1175
1212
  const contentRect = entry.target.getBoundingClientRect();
1213
+ const footerSize = this.shadowRoot.querySelector('footer')?.offsetHeight ?? 0;
1214
+ const headerSize = this.shadowRoot.querySelector('header')?.offsetHeight ?? 0;
1215
+ this._staticFooter = window.innerHeight - footerSize - headerSize < desktopMinHeight;
1176
1216
  this._contentBounds = this._computeContentBounds(contentRect);
1177
1217
  this._isMobile = isMobile();
1178
1218
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes