@brightspace-ui/core 2.26.3 → 2.28.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/components/alert/README.md +0 -4
- package/components/breadcrumbs/README.md +0 -12
- package/components/button/README.md +0 -12
- package/components/button/floating-buttons.md +0 -4
- package/components/calendar/README.md +0 -4
- package/components/card/README.md +0 -4
- package/components/colors/README.md +0 -12
- package/components/count-badge/README.md +0 -9
- package/components/dialog/README.md +0 -12
- package/components/dropdown/README.md +0 -29
- package/components/expand-collapse/README.md +0 -8
- package/components/filter/README.md +0 -15
- package/components/form/docs/form-element-nesting.md +0 -4
- package/components/form/docs/form.md +0 -4
- package/components/html-block/demo/html-block-code.html +47 -0
- package/components/html-block/html-block.js +4 -2
- package/components/inputs/README.md +0 -4
- package/components/inputs/docs/input-checkbox.md +0 -8
- package/components/inputs/docs/input-date-time.md +0 -24
- package/components/inputs/docs/input-numeric.md +0 -8
- package/components/inputs/docs/input-radio.md +0 -4
- package/components/inputs/docs/input-search.md +0 -4
- package/components/inputs/docs/input-select-styles.md +0 -4
- package/components/inputs/docs/input-text.md +0 -12
- package/components/link/README.md +0 -6
- package/components/list/README.md +0 -24
- package/components/loading-spinner/README.md +0 -3
- package/components/menu/README.md +0 -20
- package/components/meter/README.md +0 -19
- package/components/overflow-group/README.md +0 -4
- package/components/scroll-wrapper/README.md +0 -4
- package/components/selection/README.md +0 -6
- package/components/skeleton/README.md +1 -11
- package/components/status-indicator/README.md +0 -4
- package/components/switch/README.md +0 -7
- package/components/table/README.md +0 -16
- package/components/tabs/README.md +0 -8
- package/components/tooltip/README.md +0 -8
- package/components/typography/README.md +0 -10
- package/components/typography/demo/typography.html +6 -0
- package/components/typography/styles.js +38 -0
- package/components/typography/typography.js +39 -0
- package/directives/animate/README.md +1 -5
- package/helpers/demo/prism.html +417 -0
- package/helpers/prism.js +430 -0
- package/package.json +1 -2
- package/templates/primary-secondary/README.md +0 -4
- package/components/alert/screenshots/alert.png +0 -0
- package/components/breadcrumbs/screenshots/basic.png +0 -0
- package/components/breadcrumbs/screenshots/compact.png +0 -0
- package/components/breadcrumbs/screenshots/limited-width.png +0 -0
- package/components/button/screenshots/button-icon.png +0 -0
- package/components/button/screenshots/button-subtle.png +0 -0
- package/components/button/screenshots/button.png +0 -0
- package/components/button/screenshots/floating-buttons.png +0 -0
- package/components/calendar/screenshots/calendar.png +0 -0
- package/components/card/screenshots/card.png +0 -0
- package/components/colors/screenshots/basic-greys.png +0 -0
- package/components/colors/screenshots/feedback.png +0 -0
- package/components/colors/screenshots/primary-accents.png +0 -0
- package/components/count-badge/screenshots/count-badge-count-large.png +0 -0
- package/components/count-badge/screenshots/count-badge-icon.png +0 -0
- package/components/count-badge/screenshots/count-badge-notification-small.png +0 -0
- package/components/dialog/screenshots/dialog-confirm.png +0 -0
- package/components/dialog/screenshots/dialog-fullscreen.png +0 -0
- package/components/dialog/screenshots/dialog.png +0 -0
- package/components/dropdown/screenshots/dropdown-button-subtle.png +0 -0
- package/components/dropdown/screenshots/dropdown-button.png +0 -0
- package/components/dropdown/screenshots/dropdown-content-mobile-tray.png +0 -0
- package/components/dropdown/screenshots/dropdown-content.png +0 -0
- package/components/dropdown/screenshots/dropdown-context-menu.png +0 -0
- package/components/dropdown/screenshots/dropdown-menu.png +0 -0
- package/components/dropdown/screenshots/dropdown-more.png +0 -0
- package/components/dropdown/screenshots/dropdown-tabs.png +0 -0
- package/components/expand-collapse/screenshots/expand-collapse-content.gif +0 -0
- package/components/expand-collapse/screenshots/more-less.png +0 -0
- package/components/filter/screenshots/filter-mobile.png +0 -0
- package/components/filter/screenshots/filter-multi-dim.png +0 -0
- package/components/filter/screenshots/filter.png +0 -0
- package/components/form/screenshots/form-native.gif +0 -0
- package/components/form/screenshots/nesting-invalid-styling.png +0 -0
- package/components/form/screenshots/nesting-tooltip-conflict.png +0 -0
- package/components/inputs/screenshots/checkbox.gif +0 -0
- package/components/inputs/screenshots/date-range.gif +0 -0
- package/components/inputs/screenshots/date-time-range.gif +0 -0
- package/components/inputs/screenshots/date-time.gif +0 -0
- package/components/inputs/screenshots/date.gif +0 -0
- package/components/inputs/screenshots/label-required.png +0 -0
- package/components/inputs/screenshots/label.png +0 -0
- package/components/inputs/screenshots/number.png +0 -0
- package/components/inputs/screenshots/percent.png +0 -0
- package/components/inputs/screenshots/radio.gif +0 -0
- package/components/inputs/screenshots/search.gif +0 -0
- package/components/inputs/screenshots/select.gif +0 -0
- package/components/inputs/screenshots/text.gif +0 -0
- package/components/inputs/screenshots/textarea-styles.gif +0 -0
- package/components/inputs/screenshots/textarea.gif +0 -0
- package/components/inputs/screenshots/time-range.gif +0 -0
- package/components/inputs/screenshots/time.gif +0 -0
- package/components/link/screenshots/main.png +0 -0
- package/components/link/screenshots/small.png +0 -0
- package/components/link/screenshots/standard.png +0 -0
- package/components/list/screenshots/drag-and-drop.gif +0 -0
- package/components/list/screenshots/list-item-content.png +0 -0
- package/components/list/screenshots/list-item.png +0 -0
- package/components/list/screenshots/list-selection.png +0 -0
- package/components/list/screenshots/list.png +0 -0
- package/components/loading-spinner/screenshots/loading-spinner.gif +0 -0
- package/components/menu/screenshots/checkbox-menu.png +0 -0
- package/components/menu/screenshots/menu-items.png +0 -0
- package/components/menu/screenshots/menu.png +0 -0
- package/components/menu/screenshots/nested-menu.png +0 -0
- package/components/menu/screenshots/radio-menu.png +0 -0
- package/components/meter/screenshots/d2l-meter-circle-completed.png +0 -0
- package/components/meter/screenshots/d2l-meter-circle-has-progress.png +0 -0
- package/components/meter/screenshots/d2l-meter-circle-no-progress.png +0 -0
- package/components/meter/screenshots/d2l-meter-linear-completed.png +0 -0
- package/components/meter/screenshots/d2l-meter-linear-has-progress.png +0 -0
- package/components/meter/screenshots/d2l-meter-linear-no-progress.png +0 -0
- package/components/meter/screenshots/d2l-meter-radial-completed.png +0 -0
- package/components/meter/screenshots/d2l-meter-radial-has-progress.png +0 -0
- package/components/meter/screenshots/d2l-meter-radial-no-progress.png +0 -0
- package/components/meter/screenshots/d2l-meter-radial-with-text.png +0 -0
- package/components/overflow-group/screenshots/overflow-group.png +0 -0
- package/components/scroll-wrapper/screenshots/scroll-wrapper.gif +0 -0
- package/components/selection/screenshots/selection-multiple.png +0 -0
- package/components/selection/screenshots/selection-single.png +0 -0
- package/components/skeleton/screenshots/container.png +0 -0
- package/components/skeleton/screenshots/overview.png +0 -0
- package/components/skeleton/screenshots/paragraph.png +0 -0
- package/components/skeleton/screenshots/text-input.png +0 -0
- package/components/status-indicator/screenshots/bold-indicators.png +0 -0
- package/components/status-indicator/screenshots/default-indicator.png +0 -0
- package/components/status-indicator/screenshots/subtle-indicators.png +0 -0
- package/components/switch/screenshots/switch-visibility.png +0 -0
- package/components/switch/screenshots/switch.png +0 -0
- package/components/table/screenshots/default.png +0 -0
- package/components/table/screenshots/light.png +0 -0
- package/components/table/screenshots/selection.gif +0 -0
- package/components/table/screenshots/sorting.gif +0 -0
- package/components/table/screenshots/sticky.gif +0 -0
- package/components/tabs/screenshots/tabs.png +0 -0
- package/components/tooltip/screenshots/tooltip-boundary.png +0 -0
- package/components/tooltip/screenshots/tooltip-error.png +0 -0
- package/components/typography/screenshots/body-compact.png +0 -0
- package/components/typography/screenshots/body-small.png +0 -0
- package/components/typography/screenshots/body-standard.png +0 -0
- package/components/typography/screenshots/headings.png +0 -0
- package/components/typography/screenshots/labels.png +0 -0
- package/directives/animate/screenshots/focus.gif +0 -0
- package/directives/animate/screenshots/show-hide.gif +0 -0
- package/templates/primary-secondary/screenshots/primary-secondary.gif +0 -0
|
@@ -102,10 +102,6 @@ When using `d2l-list`, the `grid` attribute will enable the table-like keyboard
|
|
|
102
102
|
|
|
103
103
|
The `d2l-list` is the container to create a styled list of items using `d2l-list-item` or `d2l-list-item-button`. It provides the appropriate `list` semantics as well as options for displaying separators, etc.
|
|
104
104
|
|
|
105
|
-
<!-- docs: start hidden content -->
|
|
106
|
-

|
|
107
|
-
<!-- docs: end hidden content -->
|
|
108
|
-
|
|
109
105
|
<!-- docs: demo live name:d2l-list autoSize:false size:medium -->
|
|
110
106
|
```html
|
|
111
107
|
<script type="module">
|
|
@@ -201,10 +197,6 @@ If a `d2l-list-item` is selectable then it should have a `label` attribute that
|
|
|
201
197
|
|
|
202
198
|
The `d2l-list` supports drag & drop.
|
|
203
199
|
|
|
204
|
-
<!-- docs: start hidden content -->
|
|
205
|
-

|
|
206
|
-
<!-- docs: end hidden content -->
|
|
207
|
-
|
|
208
200
|
The `d2l-list` is simply a rendering component, so there is some light work involved in hooking up this behaviour. In order for items to be draggable, they must have their `draggable` and `key` attributes set. Optionally, the `drop-nested` attribute can be applied to items to indicate whether other items can be dropped as nested children on the item.
|
|
209
201
|
|
|
210
202
|
Reordering and re-rendering is the consuming component's responsibility. For a simple flat list, listen for the `d2l-list-item-position-change` event and call the `reorder` helper method. Alternatively, or for more complex lists such as those with nested lists, listen for the `d2l-list-items-move` event on the root list and update the consumer data using the provided source and target event detail.
|
|
@@ -272,10 +264,6 @@ If an item is draggable, the `drag-handle-text` attribute should be used to prov
|
|
|
272
264
|
|
|
273
265
|
The `d2l-list-header` component can be placed in the `d2l-list`'s `header` slot to provide a select-all checkbox, summary, a slot for `d2l-selection-action`s, and overflow-group behaviour.
|
|
274
266
|
|
|
275
|
-
<!-- docs: start hidden content -->
|
|
276
|
-

|
|
277
|
-
<!-- docs: end hidden content -->
|
|
278
|
-
|
|
279
267
|
<!-- docs: demo live name:d2l-list-header autoSize:false size:medium -->
|
|
280
268
|
```html
|
|
281
269
|
<script type="module">
|
|
@@ -320,10 +308,6 @@ The `d2l-list-header` component can be placed in the `d2l-list`'s `header` slot
|
|
|
320
308
|
|
|
321
309
|
The `d2l-list-item` provides the appropriate `listitem` semantics for children within a list. It also provides some basic layout, breakpoints for responsiveness, a navigation link for the primary action, and selection.
|
|
322
310
|
|
|
323
|
-
<!-- docs: start hidden content -->
|
|
324
|
-

|
|
325
|
-
<!-- docs: end hidden content -->
|
|
326
|
-
|
|
327
311
|
<!-- docs: demo live name:d2l-list-item autoSize:false size:small -->
|
|
328
312
|
```html
|
|
329
313
|
<script type="module">
|
|
@@ -400,10 +384,6 @@ The `d2l-list-item` provides the appropriate `listitem` semantics for children w
|
|
|
400
384
|
|
|
401
385
|
The `d2l-list-item-button` provides the same functionality as `d2l-list-item` except with button semantics for its primary action.
|
|
402
386
|
|
|
403
|
-
<!-- docs: start hidden content -->
|
|
404
|
-

|
|
405
|
-
<!-- docs: end hidden content -->
|
|
406
|
-
|
|
407
387
|
<!-- docs: demo live name:d2l-list-item-button -->
|
|
408
388
|
```html
|
|
409
389
|
<script type="module">
|
|
@@ -487,10 +467,6 @@ Where the parameters correspond to the slots of `d2l-list-item`:
|
|
|
487
467
|
|
|
488
468
|
The `d2l-list-item-content` provides additional consistent layout for primary and secondary text in item content. It may be used with or without the `illustration` and `action` slots mentioned above.
|
|
489
469
|
|
|
490
|
-
<!-- docs: start hidden content -->
|
|
491
|
-

|
|
492
|
-
<!-- docs: end hidden content -->
|
|
493
|
-
|
|
494
470
|
<!-- docs: demo live name:d2l-list-item-content -->
|
|
495
471
|
```html
|
|
496
472
|
<script type="module">
|
|
@@ -10,9 +10,6 @@ A loading spinner indicates that something is happening and we don't know how lo
|
|
|
10
10
|
|
|
11
11
|
<d2l-loading-spinner></d2l-loading-spinner>
|
|
12
12
|
```
|
|
13
|
-
<!-- docs: start hidden content -->
|
|
14
|
-

|
|
15
|
-
<!-- docs: end hidden content -->
|
|
16
13
|
|
|
17
14
|
## Best Practices
|
|
18
15
|
|
|
@@ -27,10 +27,6 @@ A basic menu can be defined using `d2l-menu` and a combination of menu items (e.
|
|
|
27
27
|
|
|
28
28
|
**Note:** `d2l-menu` renders without an outer border since it's typically used in a context where a containing element defines a border (ex. `d2l-dropdown-menu` or side nav).
|
|
29
29
|
|
|
30
|
-
<!-- docs: start hidden content -->
|
|
31
|
-

|
|
32
|
-
<!-- docs: end hidden content -->
|
|
33
|
-
|
|
34
30
|
<!-- docs: demo live name:d2l-menu -->
|
|
35
31
|
```html
|
|
36
32
|
<script type="module">
|
|
@@ -68,10 +64,6 @@ To make your usage of `d2l-menu` accessible, use the following property:
|
|
|
68
64
|
|
|
69
65
|
The `d2l-menu item` component is used with JS handlers and can be wired-up to the `d2l-menu-item-select` event.
|
|
70
66
|
|
|
71
|
-
<!-- docs: start hidden content -->
|
|
72
|
-

|
|
73
|
-
<!-- docs: end hidden content -->
|
|
74
|
-
|
|
75
67
|
<!-- docs: demo live name:d2l-menu-item -->
|
|
76
68
|
```html
|
|
77
69
|
<script type="module">
|
|
@@ -160,10 +152,6 @@ To make your usage of `d2l-menu-item-link` accessible, use the following propert
|
|
|
160
152
|
|
|
161
153
|
The `d2l-menu-item-checkbox` component is used for selection. It can be wired-up to the `d2l-menu-item-change` event. Multiple checkboxes can be selected at once.
|
|
162
154
|
|
|
163
|
-
<!-- docs: start hidden content -->
|
|
164
|
-

|
|
165
|
-
<!-- docs: end hidden content -->
|
|
166
|
-
|
|
167
155
|
<!-- docs: demo live name:d2l-menu-item-checkbox -->
|
|
168
156
|
```html
|
|
169
157
|
<script type="module">
|
|
@@ -210,10 +198,6 @@ To make your usage of `d2l-menu-item-checkbox` accessible, use the following pro
|
|
|
210
198
|
|
|
211
199
|
The `d2l-menu-item-radio` component is used for selection. It can be wired-up to the `d2l-menu-item-change` event. Only one radio item in a given `<d2l-menu>` may be selected at once (i.e., selecting one option will deselect the other selected `d2l-menu-item-radio` item).
|
|
212
200
|
|
|
213
|
-
<!-- docs: start hidden content -->
|
|
214
|
-

|
|
215
|
-
<!-- docs: end hidden content -->
|
|
216
|
-
|
|
217
201
|
<!-- docs: demo live name:d2l-menu-item-radio -->
|
|
218
202
|
```html
|
|
219
203
|
<script type="module">
|
|
@@ -279,10 +263,6 @@ The `d2l-menu-item-separator` component can be used to semantically separate men
|
|
|
279
263
|
|
|
280
264
|
Nested menus can be defined by placing a `d2l-menu` inside a `d2l-menu-item`. For nested menus, a `label` attribute is automatically applied using the text attribute of the `d2l-menu-item` that contains it - no need to duplicate this value. A "return" menu item will be added to the top of the nested menu by default.
|
|
281
265
|
|
|
282
|
-
<!-- docs: start hidden content -->
|
|
283
|
-

|
|
284
|
-
<!-- docs: end hidden content -->
|
|
285
|
-
|
|
286
266
|
<!-- docs: demo code -->
|
|
287
267
|
```html
|
|
288
268
|
<script type="module">
|
|
@@ -36,12 +36,6 @@ Meters are a visually engaging way to communicate progress or measurements.
|
|
|
36
36
|
|
|
37
37
|
Linear meters show a horizontal progress bar.
|
|
38
38
|
|
|
39
|
-
<!-- docs: start hidden content -->
|
|
40
|
-

|
|
41
|
-

|
|
42
|
-

|
|
43
|
-
<!-- docs: end hidden content -->
|
|
44
|
-
|
|
45
39
|
<!-- docs: demo live name:d2l-meter-linear -->
|
|
46
40
|
```html
|
|
47
41
|
<script type="module">
|
|
@@ -67,13 +61,6 @@ Linear meters show a horizontal progress bar.
|
|
|
67
61
|
|
|
68
62
|
Radial meters appear as a half circle. They have more visual weight than a linear meter and should only be used when the data is central to the user's task.
|
|
69
63
|
|
|
70
|
-
<!-- docs: start hidden content -->
|
|
71
|
-

|
|
72
|
-

|
|
73
|
-

|
|
74
|
-

|
|
75
|
-
<!-- docs: end hidden content -->
|
|
76
|
-
|
|
77
64
|
<!-- docs: demo live name:d2l-meter-radial size:medium -->
|
|
78
65
|
```html
|
|
79
66
|
<script type="module">
|
|
@@ -98,12 +85,6 @@ Radial meters appear as a half circle. They have more visual weight than a line
|
|
|
98
85
|
|
|
99
86
|
Circle meters display data in a compact circle format, so they're useful when horizontal space is at a premium.
|
|
100
87
|
|
|
101
|
-
<!-- docs: start hidden content -->
|
|
102
|
-

|
|
103
|
-

|
|
104
|
-

|
|
105
|
-
<!-- docs: end hidden content -->
|
|
106
|
-
|
|
107
88
|
<!-- docs: demo live name:d2l-meter-circle -->
|
|
108
89
|
```html
|
|
109
90
|
<script type="module">
|
|
@@ -30,10 +30,6 @@ The `d2l-overflow-group` element can be used to add responsiveness to a set of b
|
|
|
30
30
|
## Overflow Group [d2l-overflow-group]
|
|
31
31
|
Items added to this container element will no longer wrap onto a second line when the container becomes too small, but will be added to a dropdown menu with configurable styling.
|
|
32
32
|
|
|
33
|
-
<!-- docs: start hidden content -->
|
|
34
|
-

|
|
35
|
-
<!-- docs: end hidden content -->
|
|
36
|
-
|
|
37
33
|
<!-- docs: demo live name:d2l-overflow-group autoSize:false display:block size:medium -->
|
|
38
34
|
```html
|
|
39
35
|
<script type="module">
|
|
@@ -5,10 +5,6 @@ Scroll containers can be used to control how content acts when overflowing its c
|
|
|
5
5
|
|
|
6
6
|
The `d2l-scroll-wrapper` element can be used to wrap content which may overflow its horizontal boundaries, providing left/right scroll buttons.
|
|
7
7
|
|
|
8
|
-
<!-- docs: start hidden content -->
|
|
9
|
-

|
|
10
|
-
<!-- docs: end hidden content -->
|
|
11
|
-
|
|
12
8
|
<!-- docs: demo live name:d2l-scroll-wrapper -->
|
|
13
9
|
```html
|
|
14
10
|
<script type="module">
|
|
@@ -2,12 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
The selection components (`d2l-selection-action`, `d2l-selection-input`, `d2l-selection-select-all`, `d2l-selection-summary`, `d2l-selection-action`) are low-level components that provide the ability to create selection interfaces with select-all and bulk-action behaviours.
|
|
4
4
|
|
|
5
|
-
<!-- docs: start hidden content -->
|
|
6
|
-

|
|
7
|
-
|
|
8
|
-

|
|
9
|
-
<!-- docs: end hidden content -->
|
|
10
|
-
|
|
11
5
|
## Use Case
|
|
12
6
|
|
|
13
7
|
The `d2l-list` already extends `SelectionMixin` and should always be used for lists, however a custom selection control can be defined to enable the use of these selection controls in different semantic contexts or radically different layouts. See [SelectionMixin](#selectionmixin).
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Skeletons provide a low fidelity representation of an application before it has finished loading, improving the user's perception of performance.
|
|
4
4
|
|
|
5
|
-

|
|
6
|
-
|
|
7
5
|
## Skeleton-Aware Components
|
|
8
6
|
|
|
9
7
|
Components which are skeleton-aware extend the `SkeletonMixin` (more on that below). These components can be skeletized by setting the `skeleton` boolean attribute/property.
|
|
@@ -14,8 +12,6 @@ For example, this causes a text input to be skeletized:
|
|
|
14
12
|
<d2l-input-text label="Name" skeleton></d2l-input-text>
|
|
15
13
|
```
|
|
16
14
|
|
|
17
|
-

|
|
18
|
-
|
|
19
15
|
In a typical scenario, many skeleton-aware components would have their `skeleton` attributes bound to a single property on the host component, making it easy to toggle them all together:
|
|
20
16
|
|
|
21
17
|
```html
|
|
@@ -93,8 +89,6 @@ class MyElement extends SkeletonMixin(LitElement) {
|
|
|
93
89
|
|
|
94
90
|
You can also apply a skeleton to a native element you are using as a container using the `d2l-skeletize-container` CSS class. Instead of blocking out the whole box, this will skeletonize the text and the border and allow you to individually skeletonize the components/elements inside as you wish.
|
|
95
91
|
|
|
96
|
-

|
|
97
|
-
|
|
98
92
|
```javascript
|
|
99
93
|
render() {
|
|
100
94
|
return html`
|
|
@@ -111,11 +105,7 @@ render() {
|
|
|
111
105
|
|
|
112
106
|
Paragraphs of text that may span multiple lines are a special case for skeletons. The `d2l-skeletize` CSS class would turn the entire paragraph block into a skeleton box, which isn't quite what we want. Also, often we're showing a skeleton because we don't yet know how much data we'll have.
|
|
113
107
|
|
|
114
|
-
Ideally, we'd like to show several lines of skeletized text,
|
|
115
|
-
|
|
116
|
-

|
|
117
|
-
|
|
118
|
-
To accomplish this, three special CSS classes exist to provide skeletons that span 2, 3 or 5 lines: `d2l-skeletize-paragraph-2`, `d2l-skeletize-paragraph-3` and `d2l-skeletize-paragraph-5` respectively.
|
|
108
|
+
Ideally, we'd like to show several lines of skeletized text. To accomplish this, three special CSS classes exist to provide skeletons that span 2, 3 or 5 lines: `d2l-skeletize-paragraph-2`, `d2l-skeletize-paragraph-3` and `d2l-skeletize-paragraph-5` respectively.
|
|
119
109
|
|
|
120
110
|
Apply one of these classes plus any additional (optional) typography styles for your paragraph:
|
|
121
111
|
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
# Status Indicators
|
|
2
2
|
Status Indicators are used to communicate the status of an item. They are non-interactive and assert prominence on state.
|
|
3
3
|
|
|
4
|
-
<!-- docs: start hidden content -->
|
|
5
|
-

|
|
6
|
-
<!-- docs: end hidden content -->
|
|
7
|
-
|
|
8
4
|
<!-- docs: demo display:block -->
|
|
9
5
|
```html
|
|
10
6
|
<script type="module">
|
|
@@ -28,9 +28,6 @@ A switch is used to toggle between two states, on and off, just like a light swi
|
|
|
28
28
|
|
|
29
29
|
## Switch [d2l-switch]
|
|
30
30
|
The `d2l-switch` element is a generic switch with on/off semantics.
|
|
31
|
-
<!-- docs: start hidden content -->
|
|
32
|
-

|
|
33
|
-
<!-- docs: end hidden content -->
|
|
34
31
|
|
|
35
32
|
<!-- docs: demo live name:d2l-switch autoSize:false size:small -->
|
|
36
33
|
```html
|
|
@@ -66,10 +63,6 @@ To make your usage of `d2l-switch` accessible, use the following property:
|
|
|
66
63
|
|
|
67
64
|
The `d2l-switch-visibility` element is a variant of the generic switch configured with special icons and default text for toggling "visibility".
|
|
68
65
|
|
|
69
|
-
<!-- docs: start hidden content -->
|
|
70
|
-

|
|
71
|
-
<!-- docs: end hidden content -->
|
|
72
|
-
|
|
73
66
|
<!-- docs: demo live name:d2l-switch-visibility autoSize:false size:small -->
|
|
74
67
|
```html
|
|
75
68
|
<script type="module">
|
|
@@ -2,10 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Tables are used to display tabular data in rows and columns. They can allow users to select rows and sort by columns.
|
|
4
4
|
|
|
5
|
-
<!-- docs: start hidden content -->
|
|
6
|
-

|
|
7
|
-
<!-- docs: end hidden content -->
|
|
8
|
-
|
|
9
5
|
<!-- docs: demo display:block -->
|
|
10
6
|
```html
|
|
11
7
|
<script type="module">
|
|
@@ -124,8 +120,6 @@ The `d2l-table-wrapper` element can be combined with table styles to apply defau
|
|
|
124
120
|
|
|
125
121
|
For a table style with fewer borders and tighter padding, there's the `light` type:
|
|
126
122
|
|
|
127
|
-

|
|
128
|
-
|
|
129
123
|
```html
|
|
130
124
|
<d2l-table-wrapper type="light">
|
|
131
125
|
<table class="d2l-table">...</table>
|
|
@@ -136,8 +130,6 @@ For a table style with fewer borders and tighter padding, there's the `light` ty
|
|
|
136
130
|
|
|
137
131
|
For long tables, the header row can be made to "stick" in place as the user scrolls.
|
|
138
132
|
|
|
139
|
-

|
|
140
|
-
|
|
141
133
|
```html
|
|
142
134
|
<d2l-table-wrapper sticky-headers>
|
|
143
135
|
<table class="d2l-table">...</table>
|
|
@@ -149,10 +141,6 @@ For long tables, the header row can be made to "stick" in place as the user scro
|
|
|
149
141
|
|
|
150
142
|
When tabular data can be sorted, the `<d2l-table-col-sort-button>` can be used to provide an interactive sort button as well as arrows to indicate the ascending/descending sort direction.
|
|
151
143
|
|
|
152
|
-
<!-- docs: start hidden content -->
|
|
153
|
-

|
|
154
|
-
<!-- docs: end hidden content -->
|
|
155
|
-
|
|
156
144
|
<!-- docs: demo -->
|
|
157
145
|
```html
|
|
158
146
|
<script type="module">
|
|
@@ -250,10 +238,6 @@ When tabular data can be sorted, the `<d2l-table-col-sort-button>` can be used t
|
|
|
250
238
|
|
|
251
239
|
If your table supports row selection, apply the `selected` attribute to `<tr>` row elements which are actively selected.
|
|
252
240
|
|
|
253
|
-
<!-- docs: start hidden content -->
|
|
254
|
-

|
|
255
|
-
<!-- docs: end hidden content -->
|
|
256
|
-
|
|
257
241
|
<!-- docs: demo -->
|
|
258
242
|
```html
|
|
259
243
|
<script type="module">
|
|
@@ -39,10 +39,6 @@ Tabs are used to present related information in mutually exclusive panels, allow
|
|
|
39
39
|
|
|
40
40
|
The `d2l-tabs` element is a web component for tabbed content. It provides the `d2l-tab-panel` component for the content, renders tabs responsively, and provides virtual scrolling for large tab lists.
|
|
41
41
|
|
|
42
|
-
<!-- docs: start hidden content -->
|
|
43
|
-

|
|
44
|
-
<!-- docs: end hidden content -->
|
|
45
|
-
|
|
46
42
|
<!-- docs: demo live name:d2l-tabs display:block -->
|
|
47
43
|
```html
|
|
48
44
|
<script type="module">
|
|
@@ -73,10 +69,6 @@ The `d2l-tabs` element is a web component for tabbed content. It provides the `d
|
|
|
73
69
|
## Tab Panels [d2l-tab-panel]
|
|
74
70
|
Selecting a tab in the tab bar causes the relevant tab panel to be displayed. Tab panels can contain text, form controls, rich media, or just about anything else. There is an optional “slot” available for related controls such as a Settings button.
|
|
75
71
|
|
|
76
|
-
<!-- docs: start hidden content -->
|
|
77
|
-

|
|
78
|
-
<!-- docs: end hidden content -->
|
|
79
|
-
|
|
80
72
|
<!-- docs: demo live name:d2l-tab-panel display:block -->
|
|
81
73
|
```html
|
|
82
74
|
<script type="module">
|
|
@@ -2,10 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Tooltips display additional information when users focus or hover on a point of interest.
|
|
4
4
|
|
|
5
|
-
<!-- docs: start hidden content -->
|
|
6
|
-

|
|
7
|
-
<!-- docs: end hidden content -->
|
|
8
|
-
|
|
9
5
|
<!-- docs: demo autoSize:false size:small -->
|
|
10
6
|
```html
|
|
11
7
|
<script type="module">
|
|
@@ -119,10 +115,6 @@ This can be done with the `boundary` attribute that allows any of the tooltip's
|
|
|
119
115
|
|
|
120
116
|
In the following example to constrain the tooltip to the dashed boundary we can set the top boundary to `50`, the bottom boundary to `10`, the left boundary to `100`, and the right boundary to `0`.
|
|
121
117
|
|
|
122
|
-
<!-- docs: start hidden content -->
|
|
123
|
-

|
|
124
|
-
<!-- docs: end hidden content -->
|
|
125
|
-
|
|
126
118
|
<!-- docs: demo code -->
|
|
127
119
|
```html
|
|
128
120
|
<script type="module">
|
|
@@ -8,32 +8,22 @@ Importing `typography` will add the font-faces and prebuilt CSS classes to the d
|
|
|
8
8
|
|
|
9
9
|
"Standard Body" can be used to apply base font properties, but will also respond to viewport width changes.
|
|
10
10
|
|
|
11
|
-

|
|
12
|
-
|
|
13
11
|
### Compact Body
|
|
14
12
|
|
|
15
13
|
Compact body is a smaller version of the standard body style, for use in areas that prefer to be conservative with the amount of real estate used by text. It is **not** recommended for blocks of readable text, particularly in paragraph form. Rather, it is best employed for brief informative text or calls to action.
|
|
16
14
|
|
|
17
|
-

|
|
18
|
-
|
|
19
15
|
### Small Body
|
|
20
16
|
|
|
21
17
|
Never used by itself; always in support of another piece of content on the page. Used for inline assistive text in forms, and for specifying metadata or properties of an existing piece of content.
|
|
22
18
|
|
|
23
|
-

|
|
24
|
-
|
|
25
19
|
### Label Text
|
|
26
20
|
|
|
27
21
|
Used for labels. Its font size/line spacing is relative to the root font and responds to viewport width changes.
|
|
28
22
|
|
|
29
|
-

|
|
30
|
-
|
|
31
23
|
### Headings
|
|
32
24
|
|
|
33
25
|
There are four available heading styles. These are typically be applied to the `h1`, `h2`, `h3` and `h4` HTML elements, though it's not a requirement.
|
|
34
26
|
|
|
35
|
-

|
|
36
|
-
|
|
37
27
|
## Usage
|
|
38
28
|
|
|
39
29
|
### App
|
|
@@ -53,6 +53,12 @@
|
|
|
53
53
|
<label class="d2l-label-text">Fancy Shmancy Label</label>
|
|
54
54
|
</d2l-demo-snippet>
|
|
55
55
|
|
|
56
|
+
<h2>Blockquote</h2>
|
|
57
|
+
|
|
58
|
+
<d2l-demo-snippet>
|
|
59
|
+
<blockquote class="d2l-blockquote">Grumpy wizards make toxic brew for the evil Queen and Jack. Grumpy wizards make toxic brew for the evil Queen and Jack.</blockquote>
|
|
60
|
+
</d2l-demo-snippet>
|
|
61
|
+
|
|
56
62
|
</d2l-demo-page>
|
|
57
63
|
|
|
58
64
|
</body>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import '../colors/colors.js';
|
|
1
2
|
import { css } from 'lit';
|
|
2
3
|
|
|
3
4
|
export const bodyStandardStyles = css`
|
|
@@ -223,3 +224,40 @@ export const labelStyles = css`
|
|
|
223
224
|
top: 0.15rem;
|
|
224
225
|
}
|
|
225
226
|
`;
|
|
227
|
+
|
|
228
|
+
export const blockquoteStyles = css`
|
|
229
|
+
.d2l-blockquote {
|
|
230
|
+
color: var(--d2l-color-tungsten);
|
|
231
|
+
font-size: 0.8rem;
|
|
232
|
+
font-weight: 400;
|
|
233
|
+
line-height: 1.4rem;
|
|
234
|
+
margin: 0;
|
|
235
|
+
margin-right: 1.2rem;
|
|
236
|
+
padding: 0;
|
|
237
|
+
padding-left: 1.2rem;
|
|
238
|
+
padding-top: 0.5rem;
|
|
239
|
+
position: relative;
|
|
240
|
+
}
|
|
241
|
+
.d2l-blockquote::before {
|
|
242
|
+
content: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTEiIGhlaWdodD0iMTEiIHZpZXdCb3g9IjAgMCAyMiAyMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PHBhdGggaWQ9ImEiIGQ9Ik0wIDBoMjR2MjRIMHoiLz48L2RlZnM+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTEgLTEpIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxtYXNrIGlkPSJiIiBmaWxsPSIjZmZmIj48dXNlIHhsaW5rOmhyZWY9IiNhIi8+PC9tYXNrPjxwYXRoIGQ9Ik02IDIyLjY2N0E0LjY2NyA0LjY2NyAwIDAgMCAxMC42NjcgMThjMC0xLjIyNy0uNTU5LTIuNS0xLjMzNC0zLjMzM0M4LjQ4MSAxMy43NSA3LjM1IDEzLjMzMyA2IDEzLjMzM2MtLjQxMSAwIDEuMzMzLTYuNjY2IDMtOSAxLjY2Ny0yLjMzMyAxLjMzMy0zIC4zMzMtM0M4IDEuMzMzIDUuMjUzIDQuNTg2IDQgNy4yNTUgMS43NzMgMTIgMS4zMzMgMTUuMzkyIDEuMzMzIDE4QTQuNjY3IDQuNjY3IDAgMCAwIDYgMjIuNjY3em0xMiAwQTQuNjY3IDQuNjY3IDAgMCAwIDIyLjY2NyAxOGMwLTEuMjI3LS41NTktMi41LTEuMzM0LTMuMzMzLS44NTItLjkxNy0xLjk4My0xLjMzNC0zLjMzMy0xLjMzNC0uNDExIDAgMS4zMzMtNi42NjYgMy05IDEuNjY3LTIuMzMzIDEuMzMzLTMgLjMzMy0zLTEuMzMzIDAtNC4wOCAzLjI1My01LjMzMyA1LjkyMkMxMy43NzMgMTIgMTMuMzMzIDE1LjM5MiAxMy4zMzMgMThBNC42NjcgNC42NjcgMCAwIDAgMTggMjIuNjY3eiIgZmlsbD0iI0QzRDlFMyIgbWFzaz0idXJsKCNiKSIvPjwvZz48L3N2Zz4=");
|
|
243
|
+
left: 0;
|
|
244
|
+
position: absolute;
|
|
245
|
+
top: 0;
|
|
246
|
+
}
|
|
247
|
+
:host([dir="rtl"]) .d2l-blockquote {
|
|
248
|
+
margin-left: 1.2rem;
|
|
249
|
+
margin-right: 0;
|
|
250
|
+
padding-left: 0;
|
|
251
|
+
padding-right: 1.2rem;
|
|
252
|
+
}
|
|
253
|
+
:host([dir="rtl"]) .d2l-blockquote::before {
|
|
254
|
+
left: initial;
|
|
255
|
+
right: 0;
|
|
256
|
+
transform: scaleX(-1);
|
|
257
|
+
}
|
|
258
|
+
@media (max-width: 615px) {
|
|
259
|
+
.d2l-blockquote {
|
|
260
|
+
line-height: 1.2rem;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
`;
|
|
@@ -112,6 +112,41 @@ if (!document.head.querySelector('#d2l-typography-font-face')) {
|
|
|
112
112
|
margin: 1.5rem 0 1.5rem 0;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
+
.d2l-typography .d2l-blockquote {
|
|
116
|
+
color: var(--d2l-color-tungsten);
|
|
117
|
+
font-size: 0.8rem;
|
|
118
|
+
font-weight: 400;
|
|
119
|
+
line-height: 1.4rem;
|
|
120
|
+
margin: 0;
|
|
121
|
+
margin-right: 1.2rem;
|
|
122
|
+
padding: 0;
|
|
123
|
+
padding-left: 1.2rem;
|
|
124
|
+
padding-top: 0.5rem;
|
|
125
|
+
position: relative;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.d2l-typography .d2l-blockquote::before {
|
|
129
|
+
position: absolute;
|
|
130
|
+
content: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTEiIGhlaWdodD0iMTEiIHZpZXdCb3g9IjAgMCAyMiAyMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PHBhdGggaWQ9ImEiIGQ9Ik0wIDBoMjR2MjRIMHoiLz48L2RlZnM+PGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTEgLTEpIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxtYXNrIGlkPSJiIiBmaWxsPSIjZmZmIj48dXNlIHhsaW5rOmhyZWY9IiNhIi8+PC9tYXNrPjxwYXRoIGQ9Ik02IDIyLjY2N0E0LjY2NyA0LjY2NyAwIDAgMCAxMC42NjcgMThjMC0xLjIyNy0uNTU5LTIuNS0xLjMzNC0zLjMzM0M4LjQ4MSAxMy43NSA3LjM1IDEzLjMzMyA2IDEzLjMzM2MtLjQxMSAwIDEuMzMzLTYuNjY2IDMtOSAxLjY2Ny0yLjMzMyAxLjMzMy0zIC4zMzMtM0M4IDEuMzMzIDUuMjUzIDQuNTg2IDQgNy4yNTUgMS43NzMgMTIgMS4zMzMgMTUuMzkyIDEuMzMzIDE4QTQuNjY3IDQuNjY3IDAgMCAwIDYgMjIuNjY3em0xMiAwQTQuNjY3IDQuNjY3IDAgMCAwIDIyLjY2NyAxOGMwLTEuMjI3LS41NTktMi41LTEuMzM0LTMuMzMzLS44NTItLjkxNy0xLjk4My0xLjMzNC0zLjMzMy0xLjMzNC0uNDExIDAgMS4zMzMtNi42NjYgMy05IDEuNjY3LTIuMzMzIDEuMzMzLTMgLjMzMy0zLTEuMzMzIDAtNC4wOCAzLjI1My01LjMzMyA1LjkyMkMxMy43NzMgMTIgMTMuMzMzIDE1LjM5MiAxMy4zMzMgMThBNC42NjcgNC42NjcgMCAwIDAgMTggMjIuNjY3eiIgZmlsbD0iI0QzRDlFMyIgbWFzaz0idXJsKCNiKSIvPjwvZz48L3N2Zz4=");
|
|
131
|
+
top: 0;
|
|
132
|
+
left: 0;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
[dir="rtl"] .d2l-typography .d2l-blockquote,
|
|
136
|
+
.d2l-typography .d2l-blockquote[dir="rtl"] {
|
|
137
|
+
margin-left: 1.2rem;
|
|
138
|
+
margin-right: 0;
|
|
139
|
+
padding-left: 0;
|
|
140
|
+
padding-right: 1.2rem;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
[dir="rtl"] .d2l-typography .d2l-blockquote::before,
|
|
144
|
+
.d2l-typography .d2l-blockquote[dir="rtl"]::before {
|
|
145
|
+
left: initial;
|
|
146
|
+
right: 0;
|
|
147
|
+
transform: scaleX(-1);
|
|
148
|
+
}
|
|
149
|
+
|
|
115
150
|
@media (max-width: 615px) {
|
|
116
151
|
|
|
117
152
|
.d2l-typography .d2l-body-standard {
|
|
@@ -140,6 +175,10 @@ if (!document.head.querySelector('#d2l-typography-font-face')) {
|
|
|
140
175
|
line-height: 1.2rem;
|
|
141
176
|
}
|
|
142
177
|
|
|
178
|
+
.d2l-typography .d2l-blockquote {
|
|
179
|
+
line-height: 1.2rem;
|
|
180
|
+
}
|
|
181
|
+
|
|
143
182
|
}
|
|
144
183
|
`;
|
|
145
184
|
document.head.appendChild(style);
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
These directives can be used to animate the showing or hiding of elements in your application.
|
|
4
4
|
|
|
5
|
-
The animation will slide the element in (or out) of its final position, while transitioning its height and opacity
|
|
6
|
-
|
|
7
|
-

|
|
5
|
+
The animation will slide the element in (or out) of its final position, while transitioning its height and opacity.
|
|
8
6
|
|
|
9
7
|
## Using the directives
|
|
10
8
|
|
|
@@ -51,5 +49,3 @@ html`<some-elem .animate="${show({ skip: true })}"></some-elem>`;
|
|
|
51
49
|
When hiding an element, it's possible that the user's focus was inside that element. The act of hiding it would lose the user's focus point.
|
|
52
50
|
|
|
53
51
|
If this scenario is detected, focus will automatically be moved to the next focusable element after the element being hidden.
|
|
54
|
-
|
|
55
|
-

|