@brightspace-ui/core 3.137.4 → 3.139.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.
@@ -10,6 +10,8 @@
10
10
  import '../object-property-list.js';
11
11
  import '../object-property-list-item.js';
12
12
  import '../object-property-list-item-link.js';
13
+ import '../object-property-list-item-tooltip-help.js';
14
+ import '../../icons/icon-custom.js';
13
15
  import '../../status-indicator/status-indicator.js';
14
16
  </script>
15
17
  </head>
@@ -37,6 +39,17 @@
37
39
  <d2l-object-property-list-item-link text="Example link" href="https://www.d2l.com/"></d2l-object-property-list-item-link>
38
40
  <d2l-object-property-list-item-link target="_blank" text="Example new tab link" href="https://www.d2l.com/"></d2l-object-property-list-item-link>
39
41
  <d2l-object-property-list-item-link text="Example link with icon" href="https://www.d2l.com/" icon="tier1:alert"></d2l-object-property-list-item-link>
42
+ <d2l-object-property-list-item-tooltip-help text="Example tooltip">These are extra details</d2l-object-property-list-item-tooltip-help>
43
+ <d2l-object-property-list-item-tooltip-help text="Example tooltip with icon" icon="tier1:alert">These are extra details</d2l-object-property-list-item-tooltip-help>
44
+ <d2l-object-property-list-item-tooltip-help text="Example tooltip with custom icon">
45
+ These are extra details
46
+ <d2l-icon-custom slot="icon">
47
+ <svg xmlns="http://www.w3.org/2000/svg" mirror-in-rtl="true">
48
+ <path fill="#494c4e" d="M18 12v5a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1v-5a1 1 0 0 1 2 0v4h14v-4a1 1 0 0 1 2 0z"/>
49
+ <path fill="#494c4e" d="M13.85 3.15l-2.99-3A.507.507 0 0 0 10.5 0H5.4A1.417 1.417 0 0 0 4 1.43v11.14A1.417 1.417 0 0 0 5.4 14h7.2a1.417 1.417 0 0 0 1.4-1.43V3.5a.47.47 0 0 0-.15-.35zM7 2h1a1 1 0 0 1 0 2H7a1 1 0 0 1 0-2zm4 10H7a1 1 0 0 1 0-2h4a1 1 0 0 1 0 2zm0-4H7a1 1 0 0 1 0-2h4a1 1 0 0 1 0 2z"/>
50
+ </svg>
51
+ </d2l-icon-custom>
52
+ </d2l-object-property-list-item-tooltip-help>
40
53
  </d2l-object-property-list>
41
54
  </template>
42
55
  </d2l-demo-snippet>
@@ -0,0 +1,42 @@
1
+ import '../tooltip/tooltip-help.js';
2
+ import { FocusMixin } from '../../mixins/focus/focus-mixin.js';
3
+ import { html } from 'lit';
4
+ import { ifDefined } from 'lit/directives/if-defined.js';
5
+ import { ObjectPropertyListItem } from './object-property-list-item.js';
6
+
7
+ /**
8
+ * A single object property, to be used within an object-property-list,
9
+ * rendered as a help tooltip and with an optional icon.
10
+ * @slot - Default content placed inside of the tooltip
11
+ */
12
+ class ObjectPropertyListItemTooltipHelp extends FocusMixin(ObjectPropertyListItem) {
13
+ static get properties() {
14
+ return {
15
+ /**
16
+ * Preset icon key (e.g. "tier1:gear")
17
+ * @type {string}
18
+ */
19
+ icon: { type: String, reflect: true, },
20
+ };
21
+ }
22
+
23
+ static get focusElementSelector() {
24
+ return 'd2l-tooltip-help';
25
+ }
26
+
27
+ _renderText() {
28
+ return html`
29
+ <d2l-tooltip-help
30
+ class="d2l-skeletize"
31
+ icon="${ifDefined(this.icon)}"
32
+ inherit-font-style
33
+ ?skeleton="${this.skeleton}"
34
+ text="${this.text}">
35
+ <slot></slot>
36
+ <slot slot="icon" name="icon"></slot>
37
+ </d2l-tooltip-help>
38
+ `;
39
+ }
40
+ }
41
+
42
+ customElements.define('d2l-object-property-list-item-tooltip-help', ObjectPropertyListItemTooltipHelp);
@@ -129,8 +129,8 @@ An element that displays the corresponding tab panel when selected.
129
129
 
130
130
  | Slot | Description |
131
131
  |--|--|
132
- | `before` | Slot for content to be displayed before the tab text |
133
- | `after` | Slot for content to be displayed after the tab text |
132
+ | `before` | Slot for content to be displayed before the tab text. Supports `d2l-icon`, `d2l-icon-custom`, and `d2l-count-badge`. Only the *first* item assigned to this slot will be shown. |
133
+ | `after` | Slot for content to be displayed after the tab text. Supports `d2l-icon`, `d2l-icon-custom`, and `d2l-count-badge`. Only the *last* item assigned to this slot will be shown. |
134
134
 
135
135
  ### Events
136
136
  - `d2l-tab-content-change`: Dispatched when the text attribute is changed. Triggers virtual scrolling calculations in parent `d2l-tabs`.
@@ -6,8 +6,8 @@ import { TabMixin } from './tab-mixin.js';
6
6
  /**
7
7
  * @attr {string} id - REQUIRED: Unique identifier for the tab
8
8
  * @fires d2l-tab-content-change - Dispatched when the text attribute is changed. Triggers virtual scrolling calculations in parent d2l-tabs.
9
- * @slot before - Slot for content to be displayed before the tab text
10
- * @slot after - Slot for content to be displayed after the tab text
9
+ * @slot before - Slot for content to be displayed before the tab text. Supports `d2l-icon`, `d2l-icon-custom`, and `d2l-count-badge`. Only the *first* item assigned to this slot will be shown.
10
+ * @slot after - Slot for content to be displayed after the tab text. Supports `d2l-icon`, `d2l-icon-custom`, and `d2l-count-badge`. Only the *last* item assigned to this slot will be shown.
11
11
  */
12
12
  class Tab extends TabMixin(LitElement) {
13
13
 
@@ -59,6 +59,16 @@ class Tab extends TabMixin(LitElement) {
59
59
  :host([skeleton]) .d2l-tab-content.d2l-skeletize::before {
60
60
  inset-block: 0.15rem;
61
61
  }
62
+
63
+ /**
64
+ * Only allow d2l-icon, d2l-count-badge, and d2l-icon-custom in the before/after slots
65
+ * Only show the first item in the before slot and the last item in the after slot
66
+ */
67
+ ::slotted([slot]:not(d2l-icon):not(d2l-count-badge):not(d2l-icon-custom)),
68
+ ::slotted([slot="before"]:not(:first-child)),
69
+ ::slotted([slot="after"]:not(:last-child)) {
70
+ display: none;
71
+ }
62
72
  `];
63
73
 
64
74
  super.styles && styles.unshift(super.styles);
@@ -89,6 +89,9 @@ class TooltipHelp extends SlottedIconMixin(SkeletonMixin(FocusMixin(LitElement))
89
89
  :host([skeleton]) #d2l-tooltip-help-text.d2l-skeletize {
90
90
  text-decoration: none;
91
91
  }
92
+ :host([skeleton]) slot[name="icon"]::slotted(d2l-icon-custom) {
93
+ display: none;
94
+ }
92
95
  `];
93
96
  }
94
97
 
@@ -11157,6 +11157,60 @@
11157
11157
  }
11158
11158
  ]
11159
11159
  },
11160
+ {
11161
+ "name": "d2l-object-property-list-item-tooltip-help",
11162
+ "path": "./components/object-property-list/object-property-list-item-tooltip-help.js",
11163
+ "description": "A single object property, to be used within an object-property-list,\nrendered as a help tooltip and with an optional icon.",
11164
+ "attributes": [
11165
+ {
11166
+ "name": "icon",
11167
+ "description": "Preset icon key (e.g. \"tier1:gear\")",
11168
+ "type": "string"
11169
+ },
11170
+ {
11171
+ "name": "text",
11172
+ "description": "REQUIRED: Text to display on the item",
11173
+ "type": "string"
11174
+ },
11175
+ {
11176
+ "name": "skeleton",
11177
+ "description": "Render the component as a [skeleton loader](https://github.com/BrightspaceUI/core/tree/main/components/skeleton).",
11178
+ "type": "boolean"
11179
+ }
11180
+ ],
11181
+ "properties": [
11182
+ {
11183
+ "name": "icon",
11184
+ "attribute": "icon",
11185
+ "description": "Preset icon key (e.g. \"tier1:gear\")",
11186
+ "type": "string"
11187
+ },
11188
+ {
11189
+ "name": "text",
11190
+ "attribute": "text",
11191
+ "description": "REQUIRED: Text to display on the item",
11192
+ "type": "string"
11193
+ },
11194
+ {
11195
+ "name": "skeleton",
11196
+ "attribute": "skeleton",
11197
+ "description": "Render the component as a [skeleton loader](https://github.com/BrightspaceUI/core/tree/main/components/skeleton).",
11198
+ "type": "boolean"
11199
+ }
11200
+ ],
11201
+ "events": [
11202
+ {
11203
+ "name": "d2l-object-property-list-item-visibility-change",
11204
+ "description": "Dispatched when the visibility of the item changes"
11205
+ }
11206
+ ],
11207
+ "slots": [
11208
+ {
11209
+ "name": "",
11210
+ "description": "Default content placed inside of the tooltip"
11211
+ }
11212
+ ]
11213
+ },
11160
11214
  {
11161
11215
  "name": "d2l-object-property-list-item",
11162
11216
  "path": "./components/object-property-list/object-property-list-item.js",
@@ -13799,11 +13853,11 @@
13799
13853
  "slots": [
13800
13854
  {
13801
13855
  "name": "before",
13802
- "description": "Slot for content to be displayed before the tab text"
13856
+ "description": "Slot for content to be displayed before the tab text. Supports `d2l-icon`, `d2l-icon-custom`, and `d2l-count-badge`. Only the *first* item assigned to this slot will be shown."
13803
13857
  },
13804
13858
  {
13805
13859
  "name": "after",
13806
- "description": "Slot for content to be displayed after the tab text"
13860
+ "description": "Slot for content to be displayed after the tab text. Supports `d2l-icon`, `d2l-icon-custom`, and `d2l-count-badge`. Only the *last* item assigned to this slot will be shown."
13807
13861
  }
13808
13862
  ]
13809
13863
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.137.4",
3
+ "version": "3.139.0",
4
4
  "description": "A collection of accessible, free, open-source web components for building Brightspace applications",
5
5
  "type": "module",
6
6
  "repository": "https://github.com/BrightspaceUI/core.git",