@brightspace-ui/core 3.267.0 → 3.267.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 (112) hide show
  1. package/components/alert/alert-toast.js +98 -102
  2. package/components/alert/alert.js +109 -113
  3. package/components/backdrop/backdrop-dirty-overlay.js +13 -17
  4. package/components/backdrop/backdrop-loading.js +105 -109
  5. package/components/backdrop/backdrop.js +50 -54
  6. package/components/breadcrumbs/breadcrumb-current-page.js +19 -23
  7. package/components/breadcrumbs/breadcrumb.js +50 -54
  8. package/components/breadcrumbs/breadcrumbs.js +34 -38
  9. package/components/button/button-add.js +156 -164
  10. package/components/button/button-copy-mixin.js +9 -11
  11. package/components/button/button-copy.js +15 -19
  12. package/components/button/button-icon.js +110 -114
  13. package/components/button/button-move.js +153 -157
  14. package/components/button/button-split-item.js +16 -20
  15. package/components/button/button-split.js +70 -74
  16. package/components/button/button-subtle-copy.js +17 -19
  17. package/components/button/button-subtle.js +145 -149
  18. package/components/button/button-toggle.js +25 -29
  19. package/components/button/button.js +70 -74
  20. package/components/button/floating-buttons.js +63 -67
  21. package/components/calendar/calendar.js +244 -248
  22. package/components/card/card-content-meta.js +13 -15
  23. package/components/card/card-content-title.js +9 -11
  24. package/components/card/card-footer-link.js +76 -80
  25. package/components/card/card-loading-shimmer.js +35 -39
  26. package/components/card/card.js +188 -192
  27. package/components/collapsible-panel/collapsible-panel-group.js +17 -21
  28. package/components/collapsible-panel/collapsible-panel-summary-item.js +27 -31
  29. package/components/collapsible-panel/collapsible-panel.js +258 -262
  30. package/components/count-badge/count-badge-icon.js +12 -16
  31. package/components/count-badge/count-badge-mixin.js +124 -128
  32. package/components/count-badge/count-badge.js +2 -4
  33. package/components/description-list/description-list-wrapper.js +27 -31
  34. package/components/dialog/dialog-confirm.js +55 -59
  35. package/components/dialog/dialog-fullscreen.js +128 -132
  36. package/components/dialog/dialog-mixin.js +39 -41
  37. package/components/dialog/dialog.js +61 -65
  38. package/components/dropdown/dropdown-button-subtle.js +21 -25
  39. package/components/dropdown/dropdown-button.js +31 -35
  40. package/components/dropdown/dropdown-context-menu.js +28 -31
  41. package/components/dropdown/dropdown-menu.js +27 -31
  42. package/components/dropdown/dropdown-more.js +23 -26
  43. package/components/dropdown/dropdown-opener-mixin.js +44 -46
  44. package/components/dropdown/dropdown-popover-mixin.js +155 -159
  45. package/components/dropdown/dropdown-tabs.js +5 -7
  46. package/components/dropdown/dropdown.js +1 -3
  47. package/components/empty-state/empty-state-action-button.js +18 -22
  48. package/components/empty-state/empty-state-action-link.js +14 -18
  49. package/components/empty-state/empty-state-illustrated.js +21 -25
  50. package/components/empty-state/empty-state-simple.js +8 -12
  51. package/components/expand-collapse/expand-collapse-content.js +48 -52
  52. package/components/filter/filter-dimension-set-date-text-value.js +34 -36
  53. package/components/filter/filter-dimension-set-date-time-range-value.js +45 -47
  54. package/components/filter/filter-dimension-set-empty-state.js +17 -19
  55. package/components/filter/filter-dimension-set-value.js +27 -29
  56. package/components/filter/filter-dimension-set.js +65 -67
  57. package/components/filter/filter-overflow-group.js +15 -19
  58. package/components/filter/filter-tags.js +16 -19
  59. package/components/filter/filter.js +115 -119
  60. package/components/focus-trap/focus-trap.js +17 -21
  61. package/components/form/form-element-mixin.js +33 -35
  62. package/components/form/form-error-summary.js +37 -42
  63. package/components/form/form.js +33 -37
  64. package/components/hierarchical-view/hierarchical-view-mixin.js +76 -80
  65. package/components/hierarchical-view/hierarchical-view.js +5 -7
  66. package/components/html-block/html-block.js +45 -49
  67. package/components/icons/icon-custom.js +20 -24
  68. package/components/icons/icon.js +20 -24
  69. package/components/icons/slotted-icon-mixin.js +16 -18
  70. package/components/inputs/input-checkbox-group.js +34 -38
  71. package/components/inputs/input-checkbox.js +106 -110
  72. package/components/inputs/input-color.js +142 -148
  73. package/components/inputs/input-date-range.js +90 -94
  74. package/components/inputs/input-date-time-range-to.js +70 -74
  75. package/components/inputs/input-date-time-range.js +110 -115
  76. package/components/inputs/input-date-time.js +75 -79
  77. package/components/inputs/input-date.js +101 -105
  78. package/components/inputs/input-fieldset.js +37 -43
  79. package/components/inputs/input-group.js +10 -12
  80. package/components/inputs/input-inline-help.js +4 -6
  81. package/components/inputs/input-number.js +112 -118
  82. package/components/inputs/input-percent.js +52 -58
  83. package/components/inputs/input-radio-group.js +45 -49
  84. package/components/inputs/input-radio-spacer.js +11 -13
  85. package/components/inputs/input-radio.js +62 -66
  86. package/components/inputs/input-search.js +63 -68
  87. package/components/inputs/input-styles.js +140 -3
  88. package/components/inputs/input-text.js +245 -251
  89. package/components/inputs/input-textarea.js +128 -132
  90. package/components/inputs/input-time-range.js +100 -104
  91. package/components/inputs/input-time.js +107 -113
  92. package/components/link/link-mixin.js +37 -41
  93. package/components/link/link.js +113 -119
  94. package/components/list/list-controls.js +25 -29
  95. package/components/list/list-item-button-mixin.js +10 -12
  96. package/components/list/list-item-checkbox-mixin.js +35 -37
  97. package/components/list/list-item-content.js +33 -35
  98. package/components/list/list-item-drag-drop-mixin.js +45 -47
  99. package/components/list/list-item-drag-handle.js +80 -84
  100. package/components/list/list-item-drag-image.js +77 -81
  101. package/components/list/list-item-expand-collapse-mixin.js +17 -19
  102. package/components/list/list-item-generic-layout.js +222 -226
  103. package/components/list/list-item-link-mixin.js +10 -12
  104. package/components/list/list-item-mixin.js +68 -70
  105. package/components/list/list-item-nav-mixin.js +17 -19
  106. package/components/list/list-item-placement-marker.js +65 -67
  107. package/components/list/list-item-role-mixin.js +9 -11
  108. package/components/list/list-item.js +7 -9
  109. package/components/list/list.js +121 -125
  110. package/components/loading-spinner/loading-spinner.js +93 -97
  111. package/custom-elements.json +1920 -6694
  112. package/package.json +3 -2
@@ -17,74 +17,69 @@ export const SUPPRESS_ENTER_TIMEOUT_MS = 1000;
17
17
  */
18
18
  class InputSearch extends FocusMixin(LocalizeCoreElement(LitElement)) {
19
19
 
20
- static get properties() {
21
- return {
22
- /**
23
- * ACCESSIBILITY: Additional information communicated to screenreader users when focusing on the input
24
- * @type {string}
25
- */
26
- description: { type: String, reflect: true },
27
- /**
28
- * Disables the input
29
- * @type {boolean}
30
- */
31
- disabled: { type: Boolean },
32
- /**
33
- * ACCESSIBILITY: REQUIRED: Acts as the primary label for the input. Not visible.
34
- * @type {string}
35
- */
36
- label: { type: String },
37
- /**
38
- * @ignore
39
- */
40
- lastSearchValue: { type: String, attribute: false },
41
- /**
42
- * Imposes an upper character limit
43
- * @type {number}
44
- */
45
- maxlength: { type: Number },
46
- /**
47
- * Prevents the "clear" button from appearing
48
- * @type {boolean}
49
- */
50
- noClear: { type: Boolean, attribute: 'no-clear' },
51
- /**
52
- * Placeholder text (default: "Search...")
53
- * @type {string}
54
- */
55
- placeholder: { type: String },
56
- /**
57
- * Dispatch search events after each input event
58
- * @type {boolean}
59
- */
60
- searchOnInput: { type: Boolean, attribute: 'search-on-input' },
61
- /**
62
- * Value of the input
63
- * @type {string}
64
- */
65
- value: { type: String }
66
- };
67
- }
68
-
69
- static get styles() {
70
- return [inputStyles, css`
71
- :host {
72
- display: inline-block;
73
- width: 100%;
74
- }
75
- :host([hidden]) {
76
- display: none;
77
- }
78
- d2l-button-icon {
79
- --d2l-button-icon-min-height: 1.5rem;
80
- --d2l-button-icon-min-width: 1.5rem;
81
- --d2l-button-icon-border-radius: 4px;
82
- --d2l-focus-ring-offset: 1px;
83
- margin-inline: 0.3rem;
84
- }
85
- `
86
- ];
87
- }
20
+ static properties = {
21
+ /**
22
+ * ACCESSIBILITY: Additional information communicated to screenreader users when focusing on the input
23
+ * @type {string}
24
+ */
25
+ description: { type: String, reflect: true },
26
+ /**
27
+ * Disables the input
28
+ * @type {boolean}
29
+ */
30
+ disabled: { type: Boolean },
31
+ /**
32
+ * ACCESSIBILITY: REQUIRED: Acts as the primary label for the input. Not visible.
33
+ * @type {string}
34
+ */
35
+ label: { type: String },
36
+ /**
37
+ * @ignore
38
+ */
39
+ lastSearchValue: { type: String, attribute: false },
40
+ /**
41
+ * Imposes an upper character limit
42
+ * @type {number}
43
+ */
44
+ maxlength: { type: Number },
45
+ /**
46
+ * Prevents the "clear" button from appearing
47
+ * @type {boolean}
48
+ */
49
+ noClear: { type: Boolean, attribute: 'no-clear' },
50
+ /**
51
+ * Placeholder text (default: "Search...")
52
+ * @type {string}
53
+ */
54
+ placeholder: { type: String },
55
+ /**
56
+ * Dispatch search events after each input event
57
+ * @type {boolean}
58
+ */
59
+ searchOnInput: { type: Boolean, attribute: 'search-on-input' },
60
+ /**
61
+ * Value of the input
62
+ * @type {string}
63
+ */
64
+ value: { type: String }
65
+ };
66
+
67
+ static styles = [inputStyles, css`
68
+ :host {
69
+ display: inline-block;
70
+ width: 100%;
71
+ }
72
+ :host([hidden]) {
73
+ display: none;
74
+ }
75
+ d2l-button-icon {
76
+ --d2l-button-icon-min-height: 1.5rem;
77
+ --d2l-button-icon-min-width: 1.5rem;
78
+ --d2l-button-icon-border-radius: 4px;
79
+ --d2l-focus-ring-offset: 1px;
80
+ margin-inline: 0.3rem;
81
+ }
82
+ `];
88
83
 
89
84
  constructor() {
90
85
  super();
@@ -1,8 +1,10 @@
1
1
  import { css, unsafeCSS } from 'lit';
2
- import { getFocusPseudoClass } from '../../helpers/focus.js';
2
+ import { getFocusPseudoClass, getFocusVisibleStyles } from '../../helpers/focus.js';
3
+ import { _isValidCssSelector } from '../../helpers/internal/css.js';
4
+ import { getFlag } from '../../helpers/flags.js';
3
5
  import { registerSemanticVariableForSvgImageUrl } from '../colors/colors.js';
4
6
 
5
- const focusClass = unsafeCSS(getFocusPseudoClass());
7
+ const focusClass = unsafeCSS(globalThis.document !== undefined ? getFocusPseudoClass() : 'focus-visible');
6
8
 
7
9
  registerSemanticVariableForSvgImageUrl(
8
10
  '--d2l-input-invalid-image',
@@ -12,7 +14,142 @@ registerSemanticVariableForSvgImageUrl(
12
14
  </svg>`
13
15
  );
14
16
 
15
- export const inputStyles = css`
17
+ function getStyleDelegates(selector, focusSelector, textAreaSelector) {
18
+ return {
19
+ input: {
20
+ selector: focusClass => `
21
+ ${focusSelector ? `${focusSelector},` : ''}
22
+ ${selector}:${focusClass}:not(:disabled),
23
+ ${selector}:hover:not(:disabled)
24
+ `,
25
+ style: fullSelector => css`
26
+ ${fullSelector} {
27
+ border-color: var(--d2l-theme-border-color-focus);
28
+ border-width: 2px;
29
+ outline: none;
30
+ padding: var(--d2l-input-padding-focus, calc(0.4rem - 1px) calc(0.75rem - 1px));
31
+ }
32
+ `
33
+ },
34
+ textarea: {
35
+ selector: focusClass => `
36
+ ${textAreaSelector}:hover:not(:disabled),
37
+ ${textAreaSelector}:${focusClass}:not(:disabled)
38
+ `,
39
+ style: fullSelector => css`
40
+ ${fullSelector} {
41
+ padding-block: calc(0.5rem - 1px);
42
+ }
43
+ `
44
+ },
45
+ textareaInvalid: {
46
+ selector: focusClass => `
47
+ ${textAreaSelector}-focus[aria-invalid="true"],
48
+ ${textAreaSelector}[aria-invalid="true"]:hover,
49
+ ${textAreaSelector}[aria-invalid="true"]:${focusClass}
50
+ `,
51
+ style: fullSelector => css`
52
+ ${fullSelector} {
53
+ background-position: top calc(12px - 1px) var(--d2l-inline-end, right) calc(18px - 1px);
54
+ padding-inline-end: calc(18px + 0.8rem - 1px);
55
+ }
56
+ `
57
+ }
58
+ };
59
+ }
60
+
61
+ export function _generateInputStyles(selector, focusSelector) {
62
+ if (!_isValidCssSelector(selector) || (focusSelector && !_isValidCssSelector(focusSelector))) return '';
63
+ const lastSpaceIndex = selector.lastIndexOf(' ');
64
+ const textareaSelector = unsafeCSS(`${selector.substring(0, lastSpaceIndex + 1)}textarea${selector.substring(lastSpaceIndex + 1)}`);
65
+ const delegates = getStyleDelegates(selector, focusSelector, textareaSelector);
66
+
67
+ selector = unsafeCSS(selector);
68
+ return css`
69
+ ${selector} {
70
+ background-color: var(--d2l-input-background-color, var(--d2l-theme-background-color-base));
71
+ border: 1px solid var(--d2l-input-border-color, var(--d2l-theme-border-color-emphasized));
72
+ border-radius: var(--d2l-input-border-radius, 0.3rem);
73
+ box-shadow: var(--d2l-theme-shadow-inset);
74
+ box-sizing: border-box;
75
+ color: var(--d2l-theme-text-color-static-standard);
76
+ display: inline-block;
77
+ font-family: inherit;
78
+ font-size: 0.8rem;
79
+ font-weight: 400;
80
+ height: var(--d2l-input-height, auto);
81
+ letter-spacing: 0.02rem;
82
+ line-height: 1.2rem;
83
+ margin: 0;
84
+ min-width: calc(2rem + 1em);
85
+ padding: var(--d2l-input-padding, 0.4rem 0.75rem);
86
+ position: var(--d2l-input-position, relative); /* overridden by sticky headers in grades */
87
+ text-align: var(--d2l-input-text-align, start);
88
+ vertical-align: middle;
89
+ width: 100%;
90
+ }
91
+ ${getFocusVisibleStyles(delegates.input.selector, delegates.input.style)}
92
+
93
+ ${selector}::placeholder {
94
+ color: var(--d2l-theme-text-color-static-faint);
95
+ font-size: 0.8rem;
96
+ font-weight: 400;
97
+ opacity: 1; /* Firefox has non-1 default */
98
+ }
99
+ ${selector}::-ms-input-placeholder {
100
+ color: var(--d2l-theme-text-color-static-faint);
101
+ font-size: 0.8rem;
102
+ font-weight: 400;
103
+ }
104
+
105
+ [aria-invalid="true"]${selector}:not(:disabled) {
106
+ border-color: var(--d2l-theme-status-color-error);
107
+ }
108
+ ${selector}:disabled {
109
+ opacity: var(--d2l-theme-opacity-disabled-control);
110
+ }
111
+ ${selector}::-webkit-search-cancel-button,
112
+ ${selector}::-webkit-search-decoration {
113
+ display: none;
114
+ }
115
+ ${selector}::-ms-clear {
116
+ display: none;
117
+ height: 0;
118
+ width: 0;
119
+ }
120
+ ${textareaSelector} {
121
+ line-height: normal;
122
+ padding-block: 0.5rem;
123
+ }
124
+ ${getFocusVisibleStyles(delegates.textarea.selector, delegates.textarea.style)}
125
+ ${textareaSelector}[aria-invalid="true"] {
126
+ background-image: var(--d2l-input-invalid-image);
127
+ background-position: top 12px var(--d2l-inline-end, right) 18px;
128
+ background-repeat: no-repeat;
129
+ background-size: 0.8rem 0.8rem;
130
+ padding-inline-end: calc(18px + 0.8rem);
131
+ }
132
+ ${getFocusVisibleStyles(delegates.textareaInvalid.selector, delegates.textareaInvalid.style)}
133
+ ${textareaSelector}[aria-invalid="true"]:disabled {
134
+ background-image: none;
135
+ }
136
+
137
+ @media (prefers-contrast: more) {
138
+ ${selector}[aria-invalid="true"] {
139
+ background-color: Field;
140
+ border-color: var(--d2l-theme-status-color-error);
141
+ box-shadow: none;
142
+ color: FieldText;
143
+ forced-color-adjust: none;
144
+ }
145
+ ${focusSelector ? css`${unsafeCSS(focusSelector)} {
146
+ border-color: Highlight;
147
+ }` : css``}
148
+ }
149
+ `;
150
+ }
151
+
152
+ export const inputStyles = getFlag('GAUD-8852-use-input-generated-styles', true) ? _generateInputStyles('.d2l-input', '.d2l-input-focus') : css`
16
153
  .d2l-input {
17
154
  background-color: var(--d2l-input-background-color, var(--d2l-theme-background-color-base));
18
155
  border-radius: var(--d2l-input-border-radius, 0.3rem);