@brightspace-ui/core 3.316.0 → 3.317.1

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.
@@ -16765,80 +16765,6 @@
16765
16765
  "name": "d2l-tabs-array",
16766
16766
  "path": "./components/tabs/demo/tabs-array.js"
16767
16767
  },
16768
- {
16769
- "name": "d2l-tab-internal",
16770
- "path": "./components/tabs/tab-internal.js",
16771
- "attributes": [
16772
- {
16773
- "name": "controls-panel",
16774
- "type": "string"
16775
- },
16776
- {
16777
- "name": "text",
16778
- "type": "string"
16779
- },
16780
- {
16781
- "name": "aria-selected",
16782
- "type": "string",
16783
- "default": "\"false\""
16784
- },
16785
- {
16786
- "name": "role",
16787
- "type": "string",
16788
- "default": "\"tab\""
16789
- },
16790
- {
16791
- "name": "skeleton",
16792
- "description": "Render the component as a [skeleton loader](https://github.com/BrightspaceUI/core/tree/main/components/skeleton).",
16793
- "type": "boolean"
16794
- }
16795
- ],
16796
- "properties": [
16797
- {
16798
- "name": "controlsPanel",
16799
- "attribute": "controls-panel",
16800
- "type": "string"
16801
- },
16802
- {
16803
- "name": "text",
16804
- "attribute": "text",
16805
- "type": "string"
16806
- },
16807
- {
16808
- "name": "styles",
16809
- "type": "array",
16810
- "default": "[\"styles\",null]"
16811
- },
16812
- {
16813
- "name": "ariaSelected",
16814
- "attribute": "aria-selected",
16815
- "type": "string",
16816
- "default": "\"false\""
16817
- },
16818
- {
16819
- "name": "role",
16820
- "attribute": "role",
16821
- "type": "string",
16822
- "default": "\"tab\""
16823
- },
16824
- {
16825
- "name": "tabIndex",
16826
- "type": "number",
16827
- "default": "-1"
16828
- },
16829
- {
16830
- "name": "skeleton",
16831
- "attribute": "skeleton",
16832
- "description": "Render the component as a [skeleton loader](https://github.com/BrightspaceUI/core/tree/main/components/skeleton).",
16833
- "type": "boolean"
16834
- }
16835
- ],
16836
- "events": [
16837
- {
16838
- "name": "d2l-tab-selected"
16839
- }
16840
- ]
16841
- },
16842
16768
  {
16843
16769
  "name": "d2l-tab-panel",
16844
16770
  "path": "./components/tabs/tab-panel.js",
@@ -16849,16 +16775,6 @@
16849
16775
  "description": "REQUIRED: Id of the tab that labels this panel",
16850
16776
  "type": "string"
16851
16777
  },
16852
- {
16853
- "name": "selected",
16854
- "description": "DEPRECATED: Use to select the tab. Do NOT set if using the d2l-tab/d2l-tab-panel implementation.\nRemove with GAUD-8299-core-tabs-use-new-structure flag clean up.",
16855
- "type": "boolean"
16856
- },
16857
- {
16858
- "name": "text",
16859
- "description": "DEPRECATED: The text used for the tab, as well as labelling the panel. Required if not using d2l-tab/d2l-tab-panel implementation.\nRemove with GAUD-8299-core-tabs-use-new-structure flag clean up.",
16860
- "type": "string"
16861
- },
16862
16778
  {
16863
16779
  "name": "no-padding",
16864
16780
  "description": "Opt out of default padding/whitespace around the panel",
@@ -16873,21 +16789,9 @@
16873
16789
  "description": "REQUIRED: Id of the tab that labels this panel",
16874
16790
  "type": "string"
16875
16791
  },
16876
- {
16877
- "name": "selected",
16878
- "attribute": "selected",
16879
- "description": "DEPRECATED: Use to select the tab. Do NOT set if using the d2l-tab/d2l-tab-panel implementation.\nRemove with GAUD-8299-core-tabs-use-new-structure flag clean up.",
16880
- "type": "boolean"
16881
- },
16882
- {
16883
- "name": "text",
16884
- "attribute": "text",
16885
- "description": "DEPRECATED: The text used for the tab, as well as labelling the panel. Required if not using d2l-tab/d2l-tab-panel implementation.\nRemove with GAUD-8299-core-tabs-use-new-structure flag clean up.",
16886
- "type": "string"
16887
- },
16888
16792
  {
16889
16793
  "name": "styles",
16890
- "default": "\"css`\\n\\t\\t:host {\\n\\t\\t\\tbox-sizing: border-box;\\n\\t\\t\\tdisplay: none;\\n\\t\\t\\tmargin: 1.2rem 0 0 0;\\n\\t\\t}\\n\\t\\t:host([no-padding]) {\\n\\t\\t\\tmargin: 0;\\n\\t\\t}\\n\\t\\t/* clean up with GAUD-8299-core-tabs-use-new-structure flag clean up */\\n\\t\\t:host([selected]) {\\n\\t\\t\\tdisplay: block;\\n\\t\\t}\\n\\t\\t:host([_selected]) {\\n\\t\\t\\tdisplay: block;\\n\\t\\t}\\n\\t`\""
16794
+ "default": "\"css`\\n\\t\\t:host {\\n\\t\\t\\tbox-sizing: border-box;\\n\\t\\t\\tdisplay: none;\\n\\t\\t\\tmargin: 1.2rem 0 0 0;\\n\\t\\t}\\n\\t\\t:host([no-padding]) {\\n\\t\\t\\tmargin: 0;\\n\\t\\t}\\n\\t\\t:host([_selected]) {\\n\\t\\t\\tdisplay: block;\\n\\t\\t}\\n\\t`\""
16891
16795
  },
16892
16796
  {
16893
16797
  "name": "noPadding",
@@ -16897,16 +16801,6 @@
16897
16801
  "default": "false"
16898
16802
  }
16899
16803
  ],
16900
- "events": [
16901
- {
16902
- "name": "d2l-tab-panel-selected",
16903
- "description": "DEPRECATED: Dispatched when a tab is selected"
16904
- },
16905
- {
16906
- "name": "d2l-tab-panel-text-changed",
16907
- "description": "DEPRECATED: Dispatched when the text attribute is changed"
16908
- }
16909
- ],
16910
16804
  "slots": [
16911
16805
  {
16912
16806
  "name": "",
@@ -17060,10 +16954,6 @@
17060
16954
  }
17061
16955
  ],
17062
16956
  "slots": [
17063
- {
17064
- "name": "",
17065
- "description": "DEPRECATED: Contains the tab panels (e.g., \"d2l-tab-panel\" components)"
17066
- },
17067
16957
  {
17068
16958
  "name": "ext",
17069
16959
  "description": "Additional content (e.g., a button) positioned at right"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.316.0",
3
+ "version": "3.317.1",
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",
@@ -1,144 +0,0 @@
1
- import '../colors/colors.js';
2
- import { css, html, LitElement } from 'lit';
3
- import { classMap } from 'lit/directives/class-map.js';
4
- import { getFocusRingStyles } from '../../helpers/focus.js';
5
- import { overflowEllipsisDeclarations } from '../../helpers/overflow.js';
6
- import { SkeletonMixin } from '../skeleton/skeleton-mixin.js';
7
-
8
- const keyCodes = {
9
- ENTER: 13,
10
- SPACE: 32
11
- };
12
-
13
- // remove file with GAUD-8299-core-tabs-use-new-structure flag clean up
14
- class Tab extends SkeletonMixin(LitElement) {
15
-
16
- static properties = {
17
- ariaSelected: { type: String, reflect: true, attribute: 'aria-selected' },
18
- controlsPanel: { type: String, reflect: true, attribute: 'controls-panel' },
19
- // eslint-disable-next-line lit/no-native-attributes
20
- role: { type: String, reflect: true },
21
- text: { type: String }
22
- };
23
-
24
- static styles = [super.styles, css`
25
- :host {
26
- box-sizing: border-box;
27
- display: inline-block;
28
- max-width: 200px;
29
- outline: none;
30
- position: relative;
31
- vertical-align: middle;
32
- }
33
- .d2l-tab-text {
34
- --d2l-focus-ring-offset: 0;
35
- margin: 0.5rem;
36
- padding: 0.1rem;
37
- ${overflowEllipsisDeclarations}
38
- }
39
- :host([skeleton]) .d2l-tab-text.d2l-skeletize::before {
40
- bottom: 0.15rem;
41
- top: 0.15rem;
42
- }
43
- :host(:first-child) .d2l-tab-text {
44
- margin-inline-start: 0;
45
- }
46
- .d2l-tab-selected-indicator {
47
- border-top: 4px solid var(--d2l-theme-brand-color-primary-default);
48
- border-top-left-radius: 4px;
49
- border-top-right-radius: 4px;
50
- bottom: 0;
51
- display: none;
52
- margin: 1px 0.6rem 0 0.6rem;
53
- position: absolute;
54
- -webkit-transition: box-shadow 0.2s;
55
- transition: box-shadow 0.2s;
56
- width: calc(100% - 1.2rem);
57
- }
58
- :host([skeleton]) .d2l-tab-selected-indicator {
59
- position: absolute; /* make sure skeleton styles do not override this */
60
- }
61
- .d2l-tab-text-skeletize-override {
62
- min-width: 50px;
63
- }
64
- :host(:first-child) .d2l-tab-selected-indicator {
65
- margin-inline-start: 0;
66
- width: calc(100% - 0.6rem);
67
- }
68
- ${getFocusRingStyles(pseudoClass => `:host(:${pseudoClass}) > .d2l-tab-text`, { extraStyles: css`border-radius: 0.3rem; color: var(--d2l-theme-text-color-interactive-default);` })}
69
- :host([aria-selected="true"]:focus) {
70
- text-decoration: none;
71
- }
72
- :host(:hover) {
73
- color: var(--d2l-theme-text-color-interactive-default);
74
- cursor: pointer;
75
- }
76
- :host([aria-selected="true"]:hover) {
77
- color: inherit;
78
- cursor: default;
79
- }
80
- :host([aria-selected="true"]) .d2l-tab-selected-indicator {
81
- display: block;
82
- }
83
-
84
- @media (prefers-reduced-motion: reduce) {
85
- .d2l-tab-selected-indicator {
86
- -webkit-transition: none;
87
- transition: none;
88
- }
89
- }
90
- `];
91
-
92
- constructor() {
93
- super();
94
- this.ariaSelected = 'false';
95
- this.role = 'tab';
96
- this.tabIndex = -1;
97
- }
98
-
99
- firstUpdated(changedProperties) {
100
- super.firstUpdated(changedProperties);
101
- this.addEventListener('click', () => {
102
- this.ariaSelected = 'true';
103
- });
104
- this.addEventListener('keydown', (e) => {
105
- if (e.keyCode !== keyCodes.SPACE) return;
106
- e.stopPropagation();
107
- e.preventDefault();
108
- });
109
- this.addEventListener('keyup', (e) => {
110
- if (e.keyCode !== keyCodes.ENTER && e.keyCode !== keyCodes.SPACE) return;
111
- this.ariaSelected = 'true';
112
- });
113
- }
114
-
115
- render() {
116
- const overrideSkeletonText = this.skeleton && (!this.text || this.text.length === 0);
117
- const textClasses = {
118
- 'd2l-tab-text': true,
119
- 'd2l-skeletize': true,
120
- 'd2l-tab-text-skeletize-override': overrideSkeletonText
121
- };
122
-
123
- return html`
124
- <div class="${classMap(textClasses)}">${overrideSkeletonText ? html`&nbsp;` : this.text}</div>
125
- <div class="d2l-tab-selected-indicator d2l-skeletize-container"></div>
126
- `;
127
- }
128
-
129
- update(changedProperties) {
130
- super.update(changedProperties);
131
- changedProperties.forEach((oldVal, prop) => {
132
- if (prop === 'ariaSelected' && this.ariaSelected === 'true') {
133
- this.dispatchEvent(new CustomEvent(
134
- 'd2l-tab-selected', { bubbles: true, composed: true }
135
- ));
136
- } else if (prop === 'text') {
137
- this.title = this.text;
138
- }
139
- });
140
- }
141
-
142
- }
143
-
144
- customElements.define('d2l-tab-internal', Tab);