@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
@@ -29,258 +29,252 @@ import { styleMap } from 'lit/directives/style-map.js';
29
29
  */
30
30
  class InputText extends InputInlineHelpMixin(PropertyRequiredMixin(FocusMixin(LabelledMixin(FormElementMixin(SkeletonMixin(RtlMixin(LitElement))))))) {
31
31
 
32
- static get properties() {
33
- return {
34
- /**
35
- * ADVANCED: Indicates that the input has a popup menu
36
- * @type {string}
37
- */
38
- ariaHaspopup: { type: String, attribute: 'aria-haspopup' },
39
- /**
40
- * ADVANCED: Indicates that the input value is invalid
41
- * @type {string}
42
- */
43
- ariaInvalid: { type: String, attribute: 'aria-invalid' },
44
- /**
45
- * ADVANCED: Specifies which types of values can be autofilled by the browser
46
- * @type {string}
47
- */
48
- autocomplete: { type: String },
49
- /**
50
- * @ignore
51
- */
52
- // eslint-disable-next-line lit/no-native-attributes
53
- autofocus: { type: Boolean },
54
- /**
55
- * Additional information communicated in the aria-describedby on the input
56
- * @type {string}
57
- */
58
- description: { type: String, reflect: true },
59
- /**
60
- * Disables the input
61
- * @type {boolean}
62
- */
63
- disabled: { type: Boolean, reflect: true },
64
- /**
65
- * ADVANCED: Hide the alert icon when input is invalid
66
- * @type {boolean}
67
- */
68
- hideInvalidIcon: { attribute: 'hide-invalid-icon', type: Boolean, reflect: true },
69
- /**
70
- * ADVANCED: Hide the tooltip when input is invalid
71
- * @type {boolean}
72
- */
73
- hideInvalidTooltip: { attribute: 'hide-invalid-tooltip', type: Boolean, reflect: true },
74
- /**
75
- * Restricts the maximum width of the input box without restricting the width of the label.
76
- * @type {string}
77
- */
78
- inputWidth: { attribute: 'input-width', type: String },
79
- /**
80
- * ADVANCED: Additional information relating to how to use the component
81
- * @type {string}
82
- */
83
- instructions: { type: String, attribute: 'instructions' },
84
- /**
85
- * Hides the label visually (moves it to the input's "aria-label" attribute)
86
- * @type {boolean}
87
- */
88
- labelHidden: { type: Boolean, attribute: 'label-hidden' },
89
- /**
90
- * For number inputs, maximum value
91
- * @type {string}
92
- */
93
- max: { type: String },
94
- /**
95
- * Imposes an upper character limit
96
- * @type {number}
97
- */
98
- maxlength: { type: Number },
99
- /**
100
- * For number inputs, minimum value
101
- * @type {string}
102
- */
103
- min: { type: String },
104
- /**
105
- * Imposes a lower character limit
106
- * @type {number}
107
- */
108
- minlength: { type: Number },
109
- /**
110
- * ADVANCED: Regular expression pattern to validate the value
111
- * @type {string}
112
- */
113
- pattern: { type: String },
114
- /**
115
- * ADVANCED: Text to display when input fails validation against the pattern. If a list of characters is included in the message, use `LocalizeMixin`'s `localizeCharacter`.
116
- */
117
- patternFailureText: { type: String, attribute: 'pattern-failure-text' },
118
- /**
119
- * @ignore
120
- */
121
- placeholder: { type: String },
122
- /**
123
- * Prevents pressing ENTER from submitting forms
124
- * @type {boolean}
125
- */
126
- preventSubmit: { type: Boolean, attribute: 'prevent-submit' },
127
- /**
128
- * ADVANCED: Makes the input read-only
129
- * @type {boolean}
130
- */
131
- readonly: { type: Boolean },
132
- /**
133
- * Indicates that a value is required
134
- * @type {boolean}
135
- */
136
- required: { type: Boolean, reflect: true },
137
- /**
138
- * Size of the input
139
- * @type {number}
140
- */
141
- size: { type: Number },
142
- /**
143
- * ADVANCED: For number inputs, sets the step size
144
- * @type {number}
145
- */
146
- step: { type: Number },
147
- /**
148
- * @ignore
149
- */
150
- // eslint-disable-next-line lit/no-native-attributes
151
- title: { type: String },
152
- /**
153
- * The type of the text input
154
- * @type {'text'|'email'|'number'|'password'|'search'|'tel'|'url'}
155
- */
156
- type: { type: String },
157
- /**
158
- * Unit associated with the input value, displayed next to input and announced as part of the label
159
- * @type {string}
160
- */
161
- unit: { type: String },
162
- /**
163
- * Accessible label for the unit which will not be visually rendered
164
- * @type {string}
165
- */
166
- unitLabel: {
167
- attribute: 'unit-label',
168
- required: {
169
- dependentProps: ['unit'],
170
- message: (_value, elem) => `<d2l-input-text>: missing required attribute "unit-label" for unit "${elem.unit}"`,
171
- validator: (_value, elem, hasValue) => {
172
- const hasUnit = (typeof elem.unit === 'string') && elem.unit.length > 0;
173
- return !(hasUnit && elem.unit !== '%' && !hasValue);
174
- }
175
- },
176
- type: String
177
- },
178
- /**
179
- * Value of the input
180
- * @type {string}
181
- */
182
- value: { type: String },
183
- /**
184
- * ADVANCED: Alignment of the value text within the input
185
- * @type {'start'|'end'}
186
- */
187
- valueAlign: { attribute: 'value-align', type: String },
188
- _firstSlotWidth: { type: Number },
189
- _hasAfterContent: { type: Boolean, attribute: false },
190
- _focused: { type: Boolean },
191
- _hovered: { type: Boolean },
192
- _lastSlotWidth: { type: Number }
193
- };
194
- }
195
-
196
- static get styles() {
197
- return [ super.styles, inputStyles, inputLabelStyles, offscreenStyles,
198
- css`
199
- :host {
200
- display: inline-block;
201
- width: 100%;
202
- }
203
- :host([hidden]) {
204
- display: none;
205
- }
206
- :host([value-align="end"]) {
207
- --d2l-input-text-align: end;
208
- }
209
- .d2l-input-label {
210
- display: inline-block;
211
- vertical-align: bottom;
212
- }
213
- :host(:not([skeleton])) .d2l-input-label {
214
- margin: 0;
215
- padding-block: 0 0.4rem;
216
- padding-inline: 0;
217
- }
218
- :host(:not([skeleton]):not([input-width])) .d2l-input-label {
219
- width: 100%;
220
- }
221
- .d2l-input-container {
222
- display: flex;
223
- }
224
- .d2l-input-text-container {
225
- flex: 1 1 auto;
226
- position: var(--d2l-input-position, relative); /* overridden by sticky headers in grades */
227
- }
228
- .d2l-input {
229
- -webkit-appearance: textfield;
230
- appearance: textfield;
231
- overflow: hidden;
232
- text-overflow: ellipsis;
233
- white-space: nowrap;
234
- }
235
- #after-slot {
236
- display: inline-block;
237
- flex: 0 0 auto;
238
- }
239
- .d2l-input-inside-before, .d2l-input-inside-after {
240
- align-items: center;
241
- display: flex;
242
- position: absolute;
243
- top: 50%;
244
- transform: translateY(-50%);
245
- }
246
- .d2l-input-inside-before {
247
- left: 0;
248
- }
249
- .d2l-input-inside-after {
250
- right: 0;
251
- }
252
- .d2l-input-unit {
253
- color: var(--d2l-theme-text-color-static-faint);
254
- font-size: 0.7rem;
255
- margin-top: 0.05rem;
256
- }
257
- .d2l-input-inside-before .d2l-input-unit {
258
- margin-left: 12px;
259
- margin-right: 6px;
260
- }
261
- .d2l-input-inside-after .d2l-input-unit {
262
- display: inline-block;
263
- margin-left: 6px;
264
- margin-right: 12px;
265
- }
266
- :host([disabled]) .d2l-input-unit {
267
- opacity: var(--d2l-theme-opacity-disabled-control);
268
- }
269
- .d2l-input-text-invalid-icon {
270
- background-image: var(--d2l-input-invalid-image);
271
- background-position: center center;
272
- background-repeat: no-repeat;
273
- background-size: 0.8rem 0.8rem;
274
- display: flex;
275
- height: 22px;
276
- position: absolute;
277
- top: 50%;
278
- transform: translateY(-50%);
279
- width: 22px;
32
+ static properties = {
33
+ /**
34
+ * ADVANCED: Indicates that the input has a popup menu
35
+ * @type {string}
36
+ */
37
+ ariaHaspopup: { type: String, attribute: 'aria-haspopup' },
38
+ /**
39
+ * ADVANCED: Indicates that the input value is invalid
40
+ * @type {string}
41
+ */
42
+ ariaInvalid: { type: String, attribute: 'aria-invalid' },
43
+ /**
44
+ * ADVANCED: Specifies which types of values can be autofilled by the browser
45
+ * @type {string}
46
+ */
47
+ autocomplete: { type: String },
48
+ /**
49
+ * @ignore
50
+ */
51
+ // eslint-disable-next-line lit/no-native-attributes
52
+ autofocus: { type: Boolean },
53
+ /**
54
+ * Additional information communicated in the aria-describedby on the input
55
+ * @type {string}
56
+ */
57
+ description: { type: String, reflect: true },
58
+ /**
59
+ * Disables the input
60
+ * @type {boolean}
61
+ */
62
+ disabled: { type: Boolean, reflect: true },
63
+ /**
64
+ * ADVANCED: Hide the alert icon when input is invalid
65
+ * @type {boolean}
66
+ */
67
+ hideInvalidIcon: { attribute: 'hide-invalid-icon', type: Boolean, reflect: true },
68
+ /**
69
+ * ADVANCED: Hide the tooltip when input is invalid
70
+ * @type {boolean}
71
+ */
72
+ hideInvalidTooltip: { attribute: 'hide-invalid-tooltip', type: Boolean, reflect: true },
73
+ /**
74
+ * Restricts the maximum width of the input box without restricting the width of the label.
75
+ * @type {string}
76
+ */
77
+ inputWidth: { attribute: 'input-width', type: String },
78
+ /**
79
+ * ADVANCED: Additional information relating to how to use the component
80
+ * @type {string}
81
+ */
82
+ instructions: { type: String, attribute: 'instructions' },
83
+ /**
84
+ * Hides the label visually (moves it to the input's "aria-label" attribute)
85
+ * @type {boolean}
86
+ */
87
+ labelHidden: { type: Boolean, attribute: 'label-hidden' },
88
+ /**
89
+ * For number inputs, maximum value
90
+ * @type {string}
91
+ */
92
+ max: { type: String },
93
+ /**
94
+ * Imposes an upper character limit
95
+ * @type {number}
96
+ */
97
+ maxlength: { type: Number },
98
+ /**
99
+ * For number inputs, minimum value
100
+ * @type {string}
101
+ */
102
+ min: { type: String },
103
+ /**
104
+ * Imposes a lower character limit
105
+ * @type {number}
106
+ */
107
+ minlength: { type: Number },
108
+ /**
109
+ * ADVANCED: Regular expression pattern to validate the value
110
+ * @type {string}
111
+ */
112
+ pattern: { type: String },
113
+ /**
114
+ * ADVANCED: Text to display when input fails validation against the pattern. If a list of characters is included in the message, use `LocalizeMixin`'s `localizeCharacter`.
115
+ */
116
+ patternFailureText: { type: String, attribute: 'pattern-failure-text' },
117
+ /**
118
+ * @ignore
119
+ */
120
+ placeholder: { type: String },
121
+ /**
122
+ * Prevents pressing ENTER from submitting forms
123
+ * @type {boolean}
124
+ */
125
+ preventSubmit: { type: Boolean, attribute: 'prevent-submit' },
126
+ /**
127
+ * ADVANCED: Makes the input read-only
128
+ * @type {boolean}
129
+ */
130
+ readonly: { type: Boolean },
131
+ /**
132
+ * Indicates that a value is required
133
+ * @type {boolean}
134
+ */
135
+ required: { type: Boolean, reflect: true },
136
+ /**
137
+ * Size of the input
138
+ * @type {number}
139
+ */
140
+ size: { type: Number },
141
+ /**
142
+ * ADVANCED: For number inputs, sets the step size
143
+ * @type {number}
144
+ */
145
+ step: { type: Number },
146
+ /**
147
+ * @ignore
148
+ */
149
+ // eslint-disable-next-line lit/no-native-attributes
150
+ title: { type: String },
151
+ /**
152
+ * The type of the text input
153
+ * @type {'text'|'email'|'number'|'password'|'search'|'tel'|'url'}
154
+ */
155
+ type: { type: String },
156
+ /**
157
+ * Unit associated with the input value, displayed next to input and announced as part of the label
158
+ * @type {string}
159
+ */
160
+ unit: { type: String },
161
+ /**
162
+ * Accessible label for the unit which will not be visually rendered
163
+ * @type {string}
164
+ */
165
+ unitLabel: {
166
+ attribute: 'unit-label',
167
+ required: {
168
+ dependentProps: ['unit'],
169
+ message: (_value, elem) => `<d2l-input-text>: missing required attribute "unit-label" for unit "${elem.unit}"`,
170
+ validator: (_value, elem, hasValue) => {
171
+ const hasUnit = (typeof elem.unit === 'string') && elem.unit.length > 0;
172
+ return !(hasUnit && elem.unit !== '%' && !hasValue);
280
173
  }
281
- `
282
- ];
283
- }
174
+ },
175
+ type: String
176
+ },
177
+ /**
178
+ * Value of the input
179
+ * @type {string}
180
+ */
181
+ value: { type: String },
182
+ /**
183
+ * ADVANCED: Alignment of the value text within the input
184
+ * @type {'start'|'end'}
185
+ */
186
+ valueAlign: { attribute: 'value-align', type: String },
187
+ _firstSlotWidth: { type: Number },
188
+ _hasAfterContent: { type: Boolean, attribute: false },
189
+ _focused: { type: Boolean },
190
+ _hovered: { type: Boolean },
191
+ _lastSlotWidth: { type: Number }
192
+ };
193
+
194
+ static styles = [super.styles, inputStyles, inputLabelStyles, offscreenStyles, css`
195
+ :host {
196
+ display: inline-block;
197
+ width: 100%;
198
+ }
199
+ :host([hidden]) {
200
+ display: none;
201
+ }
202
+ :host([value-align="end"]) {
203
+ --d2l-input-text-align: end;
204
+ }
205
+ .d2l-input-label {
206
+ display: inline-block;
207
+ vertical-align: bottom;
208
+ }
209
+ :host(:not([skeleton])) .d2l-input-label {
210
+ margin: 0;
211
+ padding-block: 0 0.4rem;
212
+ padding-inline: 0;
213
+ }
214
+ :host(:not([skeleton]):not([input-width])) .d2l-input-label {
215
+ width: 100%;
216
+ }
217
+ .d2l-input-container {
218
+ display: flex;
219
+ }
220
+ .d2l-input-text-container {
221
+ flex: 1 1 auto;
222
+ position: var(--d2l-input-position, relative); /* overridden by sticky headers in grades */
223
+ }
224
+ .d2l-input {
225
+ -webkit-appearance: textfield;
226
+ appearance: textfield;
227
+ overflow: hidden;
228
+ text-overflow: ellipsis;
229
+ white-space: nowrap;
230
+ }
231
+ #after-slot {
232
+ display: inline-block;
233
+ flex: 0 0 auto;
234
+ }
235
+ .d2l-input-inside-before, .d2l-input-inside-after {
236
+ align-items: center;
237
+ display: flex;
238
+ position: absolute;
239
+ top: 50%;
240
+ transform: translateY(-50%);
241
+ }
242
+ .d2l-input-inside-before {
243
+ left: 0;
244
+ }
245
+ .d2l-input-inside-after {
246
+ right: 0;
247
+ }
248
+ .d2l-input-unit {
249
+ color: var(--d2l-theme-text-color-static-faint);
250
+ font-size: 0.7rem;
251
+ margin-top: 0.05rem;
252
+ }
253
+ .d2l-input-inside-before .d2l-input-unit {
254
+ margin-left: 12px;
255
+ margin-right: 6px;
256
+ }
257
+ .d2l-input-inside-after .d2l-input-unit {
258
+ display: inline-block;
259
+ margin-left: 6px;
260
+ margin-right: 12px;
261
+ }
262
+ :host([disabled]) .d2l-input-unit {
263
+ opacity: var(--d2l-theme-opacity-disabled-control);
264
+ }
265
+ .d2l-input-text-invalid-icon {
266
+ background-image: var(--d2l-input-invalid-image);
267
+ background-position: center center;
268
+ background-repeat: no-repeat;
269
+ background-size: 0.8rem 0.8rem;
270
+ display: flex;
271
+ height: 22px;
272
+ position: absolute;
273
+ top: 50%;
274
+ transform: translateY(-50%);
275
+ width: 22px;
276
+ }
277
+ `];
284
278
 
285
279
  constructor() {
286
280
  super();