@carbon/ibm-products-web-components 0.26.0 → 0.27.0-rc.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/custom-elements.json +109 -0
- package/es/components/checklist/checklist-item.d.ts +1 -0
- package/es/components/checklist/checklist-item.js +8 -2
- package/es/components/checklist/checklist-item.js.map +1 -1
- package/es/components/checklist/checklist.d.ts +2 -0
- package/es/components/checklist/checklist.js +15 -3
- package/es/components/checklist/checklist.js.map +1 -1
- package/es/components/coachmark/coachmark-beacon/coachmark-beacon.d.ts +397 -0
- package/es/components/coachmark/coachmark-beacon/coachmark-beacon.js +126 -0
- package/es/components/coachmark/coachmark-beacon/coachmark-beacon.js.map +1 -0
- package/es/components/coachmark/coachmark-beacon/coachmark-beacon.scss.js +13 -0
- package/es/components/coachmark/coachmark-beacon/coachmark-beacon.scss.js.map +1 -0
- package/es/components/coachmark/coachmark-beacon/coachmark-beacon.test.d.ts +9 -0
- package/es/components/coachmark/coachmark-beacon/coachmark-beacon.test.js +70 -0
- package/es/components/coachmark/coachmark-beacon/coachmark-beacon.test.js.map +1 -0
- package/es/components/coachmark/coachmark-beacon/defs.d.ts +14 -0
- package/es/components/coachmark/coachmark-beacon/defs.js +25 -0
- package/es/components/coachmark/coachmark-beacon/defs.js.map +1 -0
- package/es/components/coachmark/coachmark-beacon/index.d.ts +9 -0
- package/es/components/coachmark/coachmark-beacon/index.js +9 -0
- package/es/components/coachmark/coachmark-beacon/index.js.map +1 -0
- package/es/components/page-header/page-header-tabs.js +1 -1
- package/es/components/page-header/page-header.scss.js +1 -1
- package/es/components/side-panel/side-panel.scss.js +1 -1
- package/es/packages/ibm-products-web-components/package.json.js +1 -1
- package/es-custom/components/checklist/checklist-item.d.ts +1 -0
- package/es-custom/components/checklist/checklist-item.js +8 -2
- package/es-custom/components/checklist/checklist-item.js.map +1 -1
- package/es-custom/components/checklist/checklist.d.ts +2 -0
- package/es-custom/components/checklist/checklist.js +15 -3
- package/es-custom/components/checklist/checklist.js.map +1 -1
- package/es-custom/components/coachmark/coachmark-beacon/coachmark-beacon.d.ts +397 -0
- package/es-custom/components/coachmark/coachmark-beacon/coachmark-beacon.js +126 -0
- package/es-custom/components/coachmark/coachmark-beacon/coachmark-beacon.js.map +1 -0
- package/es-custom/components/coachmark/coachmark-beacon/coachmark-beacon.scss.js +13 -0
- package/es-custom/components/coachmark/coachmark-beacon/coachmark-beacon.scss.js.map +1 -0
- package/es-custom/components/coachmark/coachmark-beacon/coachmark-beacon.test.d.ts +9 -0
- package/es-custom/components/coachmark/coachmark-beacon/coachmark-beacon.test.js +70 -0
- package/es-custom/components/coachmark/coachmark-beacon/coachmark-beacon.test.js.map +1 -0
- package/es-custom/components/coachmark/coachmark-beacon/defs.d.ts +14 -0
- package/es-custom/components/coachmark/coachmark-beacon/defs.js +25 -0
- package/es-custom/components/coachmark/coachmark-beacon/defs.js.map +1 -0
- package/es-custom/components/coachmark/coachmark-beacon/index.d.ts +9 -0
- package/es-custom/components/coachmark/coachmark-beacon/index.js +9 -0
- package/es-custom/components/coachmark/coachmark-beacon/index.js.map +1 -0
- package/es-custom/components/page-header/page-header-tabs.js +1 -1
- package/es-custom/components/page-header/page-header.scss.js +1 -1
- package/es-custom/components/side-panel/side-panel.scss.js +1 -1
- package/es-custom/packages/ibm-products-web-components/package.json.js +1 -1
- package/lib/components/checklist/checklist-item.d.ts +1 -0
- package/lib/components/checklist/checklist.d.ts +2 -0
- package/lib/components/coachmark/coachmark-beacon/coachmark-beacon.d.ts +397 -0
- package/lib/components/coachmark/coachmark-beacon/coachmark-beacon.test.d.ts +9 -0
- package/lib/components/coachmark/coachmark-beacon/defs.d.ts +14 -0
- package/lib/components/coachmark/coachmark-beacon/defs.js +25 -0
- package/lib/components/coachmark/coachmark-beacon/defs.js.map +1 -0
- package/lib/components/coachmark/coachmark-beacon/index.d.ts +9 -0
- package/package.json +8 -8
- package/scss/components/coachmark/coachmark-beacon/coachmark-beacon.scss +90 -0
- package/scss/components/page-header/page-header.scss +3 -1
- package/telemetry.yml +2 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2024
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { __decorate } from 'tslib';
|
|
9
|
+
import { LitElement, html } from 'lit';
|
|
10
|
+
import { property, state } from 'lit/decorators.js';
|
|
11
|
+
import { prefix } from '../../../globals/settings.js';
|
|
12
|
+
import HostListenerMixin from '@carbon/web-components/es/globals/mixins/host-listener.js';
|
|
13
|
+
import { carbonElement } from '@carbon/web-components/es/globals/decorators/carbon-element.js';
|
|
14
|
+
import styles from './coachmark-beacon.scss.js';
|
|
15
|
+
import '@carbon/web-components/es/components/button/button.js';
|
|
16
|
+
import { BEACON_KIND } from './defs.js';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @license
|
|
20
|
+
*
|
|
21
|
+
* Copyright IBM Corp. 2025
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/
|
|
26
|
+
const blockClass = `${prefix}--coachmark-beacon`;
|
|
27
|
+
/**
|
|
28
|
+
* CoachmarkBeacon.
|
|
29
|
+
*
|
|
30
|
+
* @element c4p-coachmark-beacon
|
|
31
|
+
* @fires c4p-coachmark-beacon-clicked Custom event fired when beacon is clicked
|
|
32
|
+
* */
|
|
33
|
+
let CDSCoachmarkBeacon = class CDSCoachmarkBeacon extends HostListenerMixin(LitElement) {
|
|
34
|
+
constructor() {
|
|
35
|
+
super(...arguments);
|
|
36
|
+
/**
|
|
37
|
+
* What style of beacon.
|
|
38
|
+
* BEACON_KIND is an enum from the Coachmark and can be used for this value.
|
|
39
|
+
* @see {@Link BEACON_KIND}
|
|
40
|
+
*/
|
|
41
|
+
this.kind = BEACON_KIND.DEFAULT;
|
|
42
|
+
/**
|
|
43
|
+
* The aria label.
|
|
44
|
+
*/
|
|
45
|
+
this.label = 'Show information';
|
|
46
|
+
/**
|
|
47
|
+
* id for the coachmark beacon
|
|
48
|
+
*/
|
|
49
|
+
this.id = crypto.randomUUID();
|
|
50
|
+
this.expanded = false;
|
|
51
|
+
this.handleOutsideClick = (event) => {
|
|
52
|
+
if (!this.contains(event.target)) {
|
|
53
|
+
this.expanded = false;
|
|
54
|
+
document.removeEventListener('click', this.handleOutsideClick);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
firstUpdated() {
|
|
59
|
+
this.classList.add(blockClass);
|
|
60
|
+
if (this.kind) {
|
|
61
|
+
this.classList.add(`${blockClass}-${this.kind}`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
_handleClick() {
|
|
65
|
+
this.expanded = !this.expanded;
|
|
66
|
+
if (this.expanded) {
|
|
67
|
+
document.addEventListener('click', this.handleOutsideClick);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
document.removeEventListener('click', this.handleOutsideClick);
|
|
71
|
+
}
|
|
72
|
+
this.dispatchEvent(new CustomEvent(this.constructor.beaconClicked, {
|
|
73
|
+
detail: { expanded: this.expanded },
|
|
74
|
+
bubbles: true,
|
|
75
|
+
composed: true,
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
78
|
+
render() {
|
|
79
|
+
return html `
|
|
80
|
+
<cds-button
|
|
81
|
+
class="${blockClass}__target"
|
|
82
|
+
type="button"
|
|
83
|
+
id=${this.id}
|
|
84
|
+
aria-expanded="${String(this.expanded)}"
|
|
85
|
+
@click=${this._handleClick}
|
|
86
|
+
>
|
|
87
|
+
<slot name="icon">
|
|
88
|
+
<svg
|
|
89
|
+
class="${blockClass}__center"
|
|
90
|
+
aria-label=${this.label}
|
|
91
|
+
width="76"
|
|
92
|
+
height="76"
|
|
93
|
+
viewBox="0 0 76 76"
|
|
94
|
+
>
|
|
95
|
+
<title>${this.label}</title>
|
|
96
|
+
<circle r="1" cx="36" cy="36"></circle>
|
|
97
|
+
</svg>
|
|
98
|
+
</slot>
|
|
99
|
+
</cds-button>
|
|
100
|
+
`;
|
|
101
|
+
}
|
|
102
|
+
static get beaconClicked() {
|
|
103
|
+
return `${prefix}-coachmark-beacon-clicked`;
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
CDSCoachmarkBeacon.shadowRootOptions = Object.assign(Object.assign({}, LitElement.shadowRootOptions), { delegatesFocus: true });
|
|
107
|
+
CDSCoachmarkBeacon.styles = styles;
|
|
108
|
+
__decorate([
|
|
109
|
+
property({ reflect: true })
|
|
110
|
+
], CDSCoachmarkBeacon.prototype, "kind", void 0);
|
|
111
|
+
__decorate([
|
|
112
|
+
property({ type: String, reflect: true })
|
|
113
|
+
], CDSCoachmarkBeacon.prototype, "label", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
property({ type: String, reflect: true })
|
|
116
|
+
], CDSCoachmarkBeacon.prototype, "id", void 0);
|
|
117
|
+
__decorate([
|
|
118
|
+
state()
|
|
119
|
+
], CDSCoachmarkBeacon.prototype, "expanded", void 0);
|
|
120
|
+
CDSCoachmarkBeacon = __decorate([
|
|
121
|
+
carbonElement(`${prefix}-coachmark-beacon`)
|
|
122
|
+
], CDSCoachmarkBeacon);
|
|
123
|
+
var CDSCoachmarkBeacon$1 = CDSCoachmarkBeacon;
|
|
124
|
+
|
|
125
|
+
export { CDSCoachmarkBeacon$1 as default };
|
|
126
|
+
//# sourceMappingURL=coachmark-beacon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coachmark-beacon.js","sources":["../../../../src/components/coachmark/coachmark-beacon/coachmark-beacon.ts"],"sourcesContent":[null],"names":["customElement"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;AAOG;AAWH,MAAM,UAAU,GAAG,CAAG,EAAA,MAAM,oBAAoB;AAE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KAAK;AAA4B,CAAA,EAAA,kBAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AApB9B,kBAAkB,GAAA,UAAA,CAAA;AADvB,IAAAA,aAAa,CAAC,CAAA,EAAG,MAAM,CAAA,iBAAA,CAAmB;AACrC,CAAA,EAAA,kBAAkB,CA2FvB;AACD,2BAAe,kBAAkB;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2024
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { css } from 'lit';
|
|
9
|
+
|
|
10
|
+
var styles = css([".c4p--coachmark-beacon{position:relative}.c4p--coachmark-beacon-default .c4p--coachmark-beacon__target:before{display:none}.c4p--coachmark-beacon-default .c4p--coachmark-beacon__target:after{background-color:#4589ff;block-size:.75rem;border-radius:50%;content:\"\";inline-size:.75rem;inset-block-start:.625rem;inset-inline-start:.625rem;position:absolute}.c4p--coachmark-beacon-default .c4p--coachmark-beacon__target:focus{outline:transparent}.c4p--coachmark-beacon-default .c4p--coachmark-beacon__target:focus:before{block-size:18px;border-radius:100%;content:\"\";display:block;inline-size:18px;inset-block-start:7px;inset-inline-start:7px;outline:.125rem var(--cds-focus,#0f62fe) solid;position:absolute}.c4p--coachmark-beacon .c4p--coachmark-beacon__target{background-color:transparent;block-size:2rem;border:none;border-radius:50%;cursor:pointer;display:flex;inline-size:2rem;padding:0}.c4p--coachmark-beacon .c4p--coachmark-beacon__target[aria-expanded=true] circle{animation:none}.c4p--coachmark-beacon__center{block-size:5rem;inline-size:5rem;inset-block-start:-1.375rem;inset-inline-start:-1.375rem;pointer-events:none;position:absolute;z-index:6900}.c4p--coachmark-beacon__center circle{animation:ripple 2s infinite;fill:var(--cds-support-info,#0043ce);fill-opacity:0;-webkit-mask-image:none;mask-image:none;stroke:var(--cds-support-info,#0043ce);stroke-opacity:0;stroke-width:1px;transition-timing-function:motion exit,productive}@media (prefers-reduced-motion){.c4p--coachmark-beacon__center circle{animation:none}}@keyframes ripple{0%{fill-opacity:0;r:1px;stroke-opacity:0;transition-timing-function:cubic-bezier(0,0,.38,.9)}31%{fill-opacity:.2;stroke-opacity:1}62%{fill-opacity:0;r:32px;stroke-opacity:0}to{fill-opacity:0;r:32px;stroke-opacity:0}}@keyframes ring-ripple{0%{fill-opacity:0;r:12px;stroke-opacity:0;transition-timing-function:cubic-bezier(0,0,.38,.9)}31%{fill-opacity:.2;stroke-opacity:1}62%{fill-opacity:0;r:32px;stroke-opacity:0}to{fill-opacity:0;r:32px;stroke-opacity:0}}:host(c4p-coachmark-beacon){position:relative}:host(.c4p--coachmark-beacon-default) .c4p--coachmark-beacon__target:before{display:none}:host(.c4p--coachmark-beacon-default) .c4p--coachmark-beacon__target:after{background-color:#4589ff;block-size:.75rem;border-radius:50%;content:\"\";inline-size:.75rem;inset-block-start:.625rem;inset-inline-start:.625rem;position:absolute}:host(.c4p--coachmark-beacon-default) .c4p--coachmark-beacon__target:focus{outline:transparent}:host(.c4p--coachmark-beacon-default) .c4p--coachmark-beacon__target:focus:before{block-size:18px;border-radius:100%;content:\"\";display:block;inline-size:18px;inset-block-start:7px;inset-inline-start:7px;outline:.125rem var(--cds-focus,#0f62fe) solid;position:absolute}:host(.c4p--coachmark-beacon-default) .c4p--coachmark-beacon__target{background-color:transparent;block-size:2rem;border:none;border-radius:50%;box-shadow:none;cursor:pointer;display:flex;inline-size:2rem;padding:0}:host(.c4p--coachmark-beacon-default) .c4p--coachmark-beacon__target[aria-expanded=true] circle{animation:none}:host(.c4p--coachmark-beacon-default) .c4p--coachmark-beacon__target::part(button){background-color:transparent;max-block-size:0;min-block-size:0;padding-inline:0}:host(.c4p--coachmark-beacon-default) .c4p--coachmark-beacon__target::part(button):focus{border-color:transparent;box-shadow:none}"]);
|
|
11
|
+
|
|
12
|
+
export { styles as default };
|
|
13
|
+
//# sourceMappingURL=coachmark-beacon.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coachmark-beacon.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2024
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { describe, it, expect } from 'vitest';
|
|
9
|
+
import { fixture, oneEvent, html } from '@open-wc/testing';
|
|
10
|
+
import './coachmark-beacon.js';
|
|
11
|
+
import { prefix } from '../../../globals/settings.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @license
|
|
15
|
+
*
|
|
16
|
+
* Copyright IBM Corp. 2025
|
|
17
|
+
*
|
|
18
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
19
|
+
* LICENSE file in the root directory of this source tree.
|
|
20
|
+
*/
|
|
21
|
+
const blockClass = `${prefix}--coachmark-beacon`;
|
|
22
|
+
const defaultProps = {
|
|
23
|
+
label: 'show information',
|
|
24
|
+
id: 'coachmarkBeacon',
|
|
25
|
+
};
|
|
26
|
+
const template = (props = defaultProps) => html `
|
|
27
|
+
<c4p-coachmark-beacon
|
|
28
|
+
label=${props.label}
|
|
29
|
+
@c4p-coachmark-beacon-clicked=${(e) => {
|
|
30
|
+
console.log('Beacon clicked!', e.detail.expanded);
|
|
31
|
+
}}
|
|
32
|
+
>
|
|
33
|
+
</c4p-coachmark-beacon>
|
|
34
|
+
`;
|
|
35
|
+
describe('c4p-coachmark-beacon', () => {
|
|
36
|
+
it('should render a beacon', async () => {
|
|
37
|
+
const beacon = await fixture(template(Object.assign({}, defaultProps)));
|
|
38
|
+
expect(beacon).toBeDefined();
|
|
39
|
+
});
|
|
40
|
+
it('has correct host classes', async () => {
|
|
41
|
+
const el = await fixture(template(Object.assign({}, defaultProps)));
|
|
42
|
+
expect(el.classList.contains(blockClass)).to.be.true;
|
|
43
|
+
expect(el.classList.contains(`${blockClass}-default`)).to.be.true;
|
|
44
|
+
});
|
|
45
|
+
it('applies className to the containing node', async () => {
|
|
46
|
+
const customClass = 'test';
|
|
47
|
+
const beacon = await fixture(template(Object.assign({}, defaultProps)));
|
|
48
|
+
beacon.classList.add(customClass);
|
|
49
|
+
expect(beacon.getAttribute('class')).to.include(customClass);
|
|
50
|
+
});
|
|
51
|
+
it('should render icon for the beacon', async () => {
|
|
52
|
+
var _a;
|
|
53
|
+
const beacon = await fixture(template(Object.assign({}, defaultProps)));
|
|
54
|
+
const renderedSVG = (_a = beacon === null || beacon === void 0 ? void 0 : beacon.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('slot[name="icon"]');
|
|
55
|
+
expect(renderedSVG).to.exist;
|
|
56
|
+
const assignedNodes = renderedSVG.assignedNodes({ flatten: true });
|
|
57
|
+
const svg = assignedNodes.find((node) => node.nodeName.toLowerCase() === 'svg');
|
|
58
|
+
expect(svg).to.exist;
|
|
59
|
+
});
|
|
60
|
+
it('toggles expanded state and dispatches event on click', async () => {
|
|
61
|
+
const el = await fixture(template(Object.assign({}, defaultProps)));
|
|
62
|
+
const button = el.shadowRoot.querySelector('cds-button');
|
|
63
|
+
const eventPromise = oneEvent(el, 'c4p-coachmark-beacon-clicked');
|
|
64
|
+
button.click();
|
|
65
|
+
const event = await eventPromise;
|
|
66
|
+
expect(event).to.exist;
|
|
67
|
+
expect(event.detail.expanded).to.be.true;
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
//# sourceMappingURL=coachmark-beacon.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coachmark-beacon.test.js","sources":["../../../../src/components/coachmark/coachmark-beacon/coachmark-beacon.test.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;AAAA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QAAQ,CAAC,EAAE,EAAE,8BAA8B,CAAC;QAEjE,MAAM,CAAC,KAAK,EAAE;AAEd,QAAA,MAAM,KAAK,GAAG,MAAM,YAAY;AAChC,QAAA,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK;AACtB,QAAA,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI;AAC1C,KAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*
|
|
4
|
+
* Copyright IBM Corp. 2023, 2024
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Reserved for future expansion, i.e. "RING".
|
|
11
|
+
*/
|
|
12
|
+
export declare enum BEACON_KIND {
|
|
13
|
+
DEFAULT = "default"
|
|
14
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2024
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @license
|
|
10
|
+
*
|
|
11
|
+
* Copyright IBM Corp. 2023, 2024
|
|
12
|
+
*
|
|
13
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
14
|
+
* LICENSE file in the root directory of this source tree.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Reserved for future expansion, i.e. "RING".
|
|
18
|
+
*/
|
|
19
|
+
var BEACON_KIND;
|
|
20
|
+
(function (BEACON_KIND) {
|
|
21
|
+
BEACON_KIND["DEFAULT"] = "default";
|
|
22
|
+
})(BEACON_KIND || (BEACON_KIND = {}));
|
|
23
|
+
|
|
24
|
+
export { BEACON_KIND };
|
|
25
|
+
//# sourceMappingURL=defs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defs.js","sources":["../../../../src/components/coachmark/coachmark-beacon/defs.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAAA;;;;;;;AAOG;AACH;;AAEG;IACS;AAAZ,CAAA,UAAY,WAAW,EAAA;AACrB,IAAA,WAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACrB,CAAC,EAFW,WAAW,KAAX,WAAW,GAEtB,EAAA,CAAA,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -25,7 +25,7 @@ import { carbonElement } from '@carbon/web-components/es/globals/decorators/carb
|
|
|
25
25
|
*/
|
|
26
26
|
let CDSPageHeaderTabs = class CDSPageHeaderTabs extends LitElement {
|
|
27
27
|
render() {
|
|
28
|
-
return html ` <div class="${carbonPrefix}--css-grid">
|
|
28
|
+
return html ` <div class="${carbonPrefix}--css-grid" condensed="">
|
|
29
29
|
<div
|
|
30
30
|
class="${carbonPrefix}--sm:col-span-4 ${carbonPrefix}--md:col-span-8 ${carbonPrefix}--lg:col-span-16 ${carbonPrefix}--css-grid-column"
|
|
31
31
|
>
|