@spectrum-web-components/coachmark 0.41.1 → 0.42.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/README.md +20 -7
- package/custom-elements.json +0 -24
- package/package.json +13 -13
- package/src/Coachmark.d.ts +1 -7
- package/src/Coachmark.dev.js +2 -8
- package/src/Coachmark.dev.js.map +2 -2
- package/src/Coachmark.js +16 -16
- package/src/Coachmark.js.map +3 -3
- package/src/coach-indicator.css.dev.js +1 -85
- package/src/coach-indicator.css.dev.js.map +2 -2
- package/src/coach-indicator.css.js +1 -85
- package/src/coach-indicator.css.js.map +2 -2
- package/src/coachmark.css.dev.js +1 -99
- package/src/coachmark.css.dev.js.map +2 -2
- package/src/coachmark.css.js +1 -99
- package/src/coachmark.css.js.map +2 -2
- package/src/spectrum-coach-indicator.css.dev.js +1 -85
- package/src/spectrum-coach-indicator.css.dev.js.map +2 -2
- package/src/spectrum-coach-indicator.css.js +1 -85
- package/src/spectrum-coach-indicator.css.js.map +2 -2
- package/src/spectrum-coachmark.css.dev.js +1 -97
- package/src/spectrum-coachmark.css.dev.js.map +2 -2
- package/src/spectrum-coachmark.css.js +1 -97
- package/src/spectrum-coachmark.css.js.map +2 -2
package/README.md
CHANGED
|
@@ -29,8 +29,6 @@ import { Coachmark } from '@spectrum-web-components/coachmark';
|
|
|
29
29
|
|
|
30
30
|
## Default
|
|
31
31
|
|
|
32
|
-
Coachmark can take a `placement` and an `offset` similar to the [Overlay](https://opensource.adobe.com/spectrum-web-components/components/overlay/).
|
|
33
|
-
|
|
34
32
|
```html
|
|
35
33
|
<sp-coachmark open>
|
|
36
34
|
<div slot="title">Coachmark with Text Only</div>
|
|
@@ -56,7 +54,12 @@ Coach marks can include an `<sp-action-menu>`, which appears at the top right of
|
|
|
56
54
|
<div slot="content">
|
|
57
55
|
This is a Coachmark with nothing but text in it. Kind of lonely in here.
|
|
58
56
|
</div>
|
|
59
|
-
<sp-action-menu
|
|
57
|
+
<sp-action-menu
|
|
58
|
+
label="More Actions"
|
|
59
|
+
placement="bottom-end"
|
|
60
|
+
quiet
|
|
61
|
+
slot="actions"
|
|
62
|
+
>
|
|
60
63
|
<sp-menu-item>Skip tour</sp-menu-item>
|
|
61
64
|
<sp-menu-item>Restart tour</sp-menu-item>
|
|
62
65
|
</sp-action-menu>
|
|
@@ -86,7 +89,7 @@ The primary and secondary CTA buttons within the coachmark popover can be config
|
|
|
86
89
|
<div slot="content">
|
|
87
90
|
This is a Coachmark with nothing but text in it. Kind of lonely in here.
|
|
88
91
|
</div>
|
|
89
|
-
<sp-action-menu placement="bottom-end" quiet slot="actions">
|
|
92
|
+
<sp-action-menu label="More Actions" placement="bottom-end" quiet slot="actions">
|
|
90
93
|
<sp-menu-item>Skip tour</sp-menu-item>
|
|
91
94
|
<sp-menu-item>Restart tour</sp-menu-item>
|
|
92
95
|
</sp-action-menu>
|
|
@@ -137,7 +140,12 @@ Media Types allowed: `Images & Gifs`
|
|
|
137
140
|
>
|
|
138
141
|
<div slot="title">Coachmark with 16:9 image</div>
|
|
139
142
|
<div slot="content">This is a Coachmark with some description</div>
|
|
140
|
-
<sp-action-menu
|
|
143
|
+
<sp-action-menu
|
|
144
|
+
label="More Actions"
|
|
145
|
+
placement="bottom-end"
|
|
146
|
+
quiet
|
|
147
|
+
slot="actions"
|
|
148
|
+
>
|
|
141
149
|
<sp-menu-item>Skip tour</sp-menu-item>
|
|
142
150
|
<sp-menu-item>Restart tour</sp-menu-item>
|
|
143
151
|
</sp-action-menu>
|
|
@@ -159,7 +167,12 @@ A custom media can also be added via `<slot name="cover-photo"></slot>`
|
|
|
159
167
|
<div slot="title">Coachmark with 16:9 image</div>
|
|
160
168
|
<div slot="content">This is a Coachmark with some description</div>
|
|
161
169
|
<img slot="asset" src="https://picsum.photos/id/237/200/300" alt="" />
|
|
162
|
-
<sp-action-menu
|
|
170
|
+
<sp-action-menu
|
|
171
|
+
label="More Actions"
|
|
172
|
+
placement="bottom-end"
|
|
173
|
+
quiet
|
|
174
|
+
slot="actions"
|
|
175
|
+
>
|
|
163
176
|
<sp-menu-item>Skip tour</sp-menu-item>
|
|
164
177
|
<sp-menu-item>Restart tour</sp-menu-item>
|
|
165
178
|
</sp-action-menu>
|
|
@@ -182,7 +195,7 @@ The `shortcutKey` is the primary key used to trigger an interaction and are typi
|
|
|
182
195
|
secondary-cta="Previous"
|
|
183
196
|
id="coachmark-keys"
|
|
184
197
|
>
|
|
185
|
-
<sp-action-menu placement="bottom-end" quiet slot="actions">
|
|
198
|
+
<sp-action-menu label="More Actions" placement="bottom-end" quiet slot="actions">
|
|
186
199
|
<sp-menu-item>Skip tour</sp-menu-item>
|
|
187
200
|
<sp-menu-item>Restart tour</sp-menu-item>
|
|
188
201
|
</sp-action-menu>
|
package/custom-elements.json
CHANGED
|
@@ -326,24 +326,6 @@
|
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
},
|
|
329
|
-
{
|
|
330
|
-
"kind": "method",
|
|
331
|
-
"name": "stopPropagationOnHref",
|
|
332
|
-
"privacy": "private",
|
|
333
|
-
"return": {
|
|
334
|
-
"type": {
|
|
335
|
-
"text": "void"
|
|
336
|
-
}
|
|
337
|
-
},
|
|
338
|
-
"parameters": [
|
|
339
|
-
{
|
|
340
|
-
"name": "event",
|
|
341
|
-
"type": {
|
|
342
|
-
"text": "Event"
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
]
|
|
346
|
-
},
|
|
347
329
|
{
|
|
348
330
|
"kind": "method",
|
|
349
331
|
"name": "handlePrimaryCTA",
|
|
@@ -510,12 +492,6 @@
|
|
|
510
492
|
"fieldName": "secondaryCTA"
|
|
511
493
|
}
|
|
512
494
|
],
|
|
513
|
-
"mixins": [
|
|
514
|
-
{
|
|
515
|
-
"name": "LikeAnchor",
|
|
516
|
-
"package": "@spectrum-web-components/shared/src/like-anchor.js"
|
|
517
|
-
}
|
|
518
|
-
],
|
|
519
495
|
"superclass": {
|
|
520
496
|
"name": "Popover",
|
|
521
497
|
"package": "@spectrum-web-components/popover"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/coachmark",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.42.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -70,19 +70,19 @@
|
|
|
70
70
|
"lit-html"
|
|
71
71
|
],
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@spectrum-web-components/asset": "^0.
|
|
74
|
-
"@spectrum-web-components/base": "^0.
|
|
75
|
-
"@spectrum-web-components/button": "^0.
|
|
76
|
-
"@spectrum-web-components/button-group": "^0.
|
|
77
|
-
"@spectrum-web-components/icon": "^0.
|
|
78
|
-
"@spectrum-web-components/icons-ui": "^0.
|
|
79
|
-
"@spectrum-web-components/quick-actions": "^0.
|
|
80
|
-
"@spectrum-web-components/reactive-controllers": "^0.
|
|
81
|
-
"@spectrum-web-components/shared": "^0.
|
|
73
|
+
"@spectrum-web-components/asset": "^0.42.0",
|
|
74
|
+
"@spectrum-web-components/base": "^0.42.0",
|
|
75
|
+
"@spectrum-web-components/button": "^0.42.0",
|
|
76
|
+
"@spectrum-web-components/button-group": "^0.42.0",
|
|
77
|
+
"@spectrum-web-components/icon": "^0.42.0",
|
|
78
|
+
"@spectrum-web-components/icons-ui": "^0.42.0",
|
|
79
|
+
"@spectrum-web-components/quick-actions": "^0.42.0",
|
|
80
|
+
"@spectrum-web-components/reactive-controllers": "^0.42.0",
|
|
81
|
+
"@spectrum-web-components/shared": "^0.42.0"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
|
-
"@spectrum-css/coachindicator": "^1.1.
|
|
85
|
-
"@spectrum-css/coachmark": "^6.1.
|
|
84
|
+
"@spectrum-css/coachindicator": "^1.1.4",
|
|
85
|
+
"@spectrum-css/coachmark": "^6.1.4"
|
|
86
86
|
},
|
|
87
87
|
"types": "./src/index.d.ts",
|
|
88
88
|
"customElements": "custom-elements.json",
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
"./sp-*.js",
|
|
91
91
|
"./**/*.dev.js"
|
|
92
92
|
],
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "9b3bd55ff8e8f9438817255976e77fd456b19d72"
|
|
94
94
|
}
|
package/src/Coachmark.d.ts
CHANGED
|
@@ -7,10 +7,6 @@ import '@spectrum-web-components/asset/sp-asset.js';
|
|
|
7
7
|
import '@spectrum-web-components/button/sp-button.js';
|
|
8
8
|
import '@spectrum-web-components/button-group/sp-button-group.js';
|
|
9
9
|
import '@spectrum-web-components/quick-actions/sp-quick-actions.js';
|
|
10
|
-
declare const Coachmark_base: typeof Popover & {
|
|
11
|
-
new (...args: any[]): import("@spectrum-web-components/shared/src/like-anchor.js").LikeAnchorInterface;
|
|
12
|
-
prototype: import("@spectrum-web-components/shared/src/like-anchor.js").LikeAnchorInterface;
|
|
13
|
-
};
|
|
14
10
|
/**
|
|
15
11
|
* @element sp-coachmark
|
|
16
12
|
* @fires primary - Announces that the "primary" button has been clicked.
|
|
@@ -20,7 +16,7 @@ declare const Coachmark_base: typeof Popover & {
|
|
|
20
16
|
* @slot description - A description of the card
|
|
21
17
|
* @slot actions - an `sp-action-menu` element outlining actions to take on the represened object
|
|
22
18
|
*/
|
|
23
|
-
export declare class Coachmark extends
|
|
19
|
+
export declare class Coachmark extends Popover {
|
|
24
20
|
static get styles(): CSSResultArray;
|
|
25
21
|
item?: CoachmarkItem;
|
|
26
22
|
placement: Placement;
|
|
@@ -40,7 +36,6 @@ export declare class Coachmark extends Coachmark_base {
|
|
|
40
36
|
private renderJoiner;
|
|
41
37
|
private renderHeader;
|
|
42
38
|
private renderContent;
|
|
43
|
-
private stopPropagationOnHref;
|
|
44
39
|
private handlePrimaryCTA;
|
|
45
40
|
private handleSecondaryCTA;
|
|
46
41
|
private renderSecondaryButton;
|
|
@@ -52,4 +47,3 @@ export declare class Coachmark extends Coachmark_base {
|
|
|
52
47
|
protected renderActionMenu: () => TemplateResult;
|
|
53
48
|
protected render(): TemplateResult;
|
|
54
49
|
}
|
|
55
|
-
export {};
|
package/src/Coachmark.dev.js
CHANGED
|
@@ -16,7 +16,6 @@ import {
|
|
|
16
16
|
} from "@spectrum-web-components/base";
|
|
17
17
|
import { property } from "@spectrum-web-components/base/src/decorators.js";
|
|
18
18
|
import { when } from "@spectrum-web-components/base/src/directives.js";
|
|
19
|
-
import { LikeAnchor } from "@spectrum-web-components/shared/src/like-anchor.js";
|
|
20
19
|
import coachmarkStyles from "./coachmark.css.js";
|
|
21
20
|
import chevronStyles from "@spectrum-web-components/icon/src/spectrum-icon-chevron.css.js";
|
|
22
21
|
import "@spectrum-web-components/icons-ui/icons/sp-icon-chevron200.js";
|
|
@@ -28,7 +27,7 @@ import "@spectrum-web-components/asset/sp-asset.js";
|
|
|
28
27
|
import "@spectrum-web-components/button/sp-button.js";
|
|
29
28
|
import "@spectrum-web-components/button-group/sp-button-group.js";
|
|
30
29
|
import "@spectrum-web-components/quick-actions/sp-quick-actions.js";
|
|
31
|
-
export class Coachmark extends
|
|
30
|
+
export class Coachmark extends Popover {
|
|
32
31
|
constructor() {
|
|
33
32
|
super(...arguments);
|
|
34
33
|
this.placement = "right";
|
|
@@ -99,7 +98,7 @@ export class Coachmark extends LikeAnchor(Popover) {
|
|
|
99
98
|
// render action menu
|
|
100
99
|
this.renderActionMenu = () => {
|
|
101
100
|
return html`
|
|
102
|
-
<div class="action-menu"
|
|
101
|
+
<div class="action-menu">
|
|
103
102
|
<slot name="actions"></slot>
|
|
104
103
|
</div>
|
|
105
104
|
`;
|
|
@@ -186,11 +185,6 @@ export class Coachmark extends LikeAnchor(Popover) {
|
|
|
186
185
|
<div>${(_b = this.content) == null ? void 0 : _b.description}</div>
|
|
187
186
|
`;
|
|
188
187
|
}
|
|
189
|
-
stopPropagationOnHref(event) {
|
|
190
|
-
if (this.href) {
|
|
191
|
-
event.stopPropagation();
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
188
|
// event on primary button
|
|
195
189
|
handlePrimaryCTA() {
|
|
196
190
|
this.dispatchEvent(
|
package/src/Coachmark.dev.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["Coachmark.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2023 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n nothing,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { when } from '@spectrum-web-components/base/src/directives.js';\nimport { LikeAnchor } from '@spectrum-web-components/shared/src/like-anchor.js';\nimport coachmarkStyles from './coachmark.css.js';\nimport chevronStyles from '@spectrum-web-components/icon/src/spectrum-icon-chevron.css.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-chevron200.js';\nimport { Popover } from '@spectrum-web-components/popover';\nimport { join } from 'lit/directives/join.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport type { Placement } from '@spectrum-web-components/overlay';\nimport { MediaType } from './CoachmarkItem.dev.js'\nimport type { CoachmarkItem } from './CoachmarkItem.dev.js'\nimport '@spectrum-web-components/asset/sp-asset.js';\nimport '@spectrum-web-components/button/sp-button.js';\nimport '@spectrum-web-components/button-group/sp-button-group.js';\nimport '@spectrum-web-components/quick-actions/sp-quick-actions.js';\n\n/**\n * @element sp-coachmark\n * @fires primary - Announces that the \"primary\" button has been clicked.\n * @fires secondary - Announces that the \"secondary\" button has been clicked.\n * @slot cover-photo - This is the cover photo for Default and Quiet Coachmark\n * @slot heading - HTML content to be listed as the heading\n * @slot description - A description of the card\n * @slot actions - an `sp-action-menu` element outlining actions to take on the represened object\n */\nexport class Coachmark extends LikeAnchor(Popover) {\n public static override get styles(): CSSResultArray {\n return [...super.styles, coachmarkStyles, chevronStyles];\n }\n @property({ type: Object })\n public item?: CoachmarkItem;\n\n @property({ type: String })\n public override placement: Placement = 'right';\n\n @property({ type: Object, attribute: false })\n private content?: {\n title?: string;\n description?: string;\n imageAlt?: string;\n };\n\n @property({ attribute: 'shortcut-key' })\n private shortcutKey?: string;\n\n @property({ type: Array })\n public modifierKeys?: string[] = [];\n\n @property({ attribute: 'src' })\n private source?: string;\n\n @property({ attribute: 'media-type' })\n private mediaType?: MediaType;\n\n @property({ type: Boolean, attribute: 'has-asset', reflect: true })\n public hasAsset = false;\n\n @property()\n public asset?: 'file' | 'folder';\n\n @property({ type: Number, attribute: 'current-step' })\n public currentStep?: number;\n\n @property({ type: Number, attribute: 'total-steps' })\n public totalSteps?: number;\n\n @property({ type: String, attribute: 'primary-cta' })\n primaryCTA?: string;\n\n @property({ type: String, attribute: 'secondary-cta' })\n secondaryCTA?: string;\n\n // render video and images\n private renderMedia(): TemplateResult {\n const isImage = this.mediaType === MediaType.IMAGE;\n if (!isImage) {\n return html`\n <slot name=\"asset\"></slot>\n `;\n }\n return html`\n <sp-asset id=\"cover-photo\">\n <div class=\"image-wrapper\">\n <img\n class=\"image\"\n loading=\"lazy\"\n slot=\"cover-photo\"\n src=\"${ifDefined(this.source)}\"\n alt=\"${ifDefined(this?.content?.imageAlt)}\"\n />\n </div>\n </sp-asset>\n `;\n }\n // method to render modifier\n private renderModifier(\n modifierKey: string,\n type: 'modifier' | 'shortcut' = 'modifier'\n ): TemplateResult {\n return html`\n <span type=\"${type}\" class=\"keyboard-shortcut\">${modifierKey}</span>\n `;\n }\n\n private renderJoiner(): TemplateResult {\n return html`\n <span class=\"plus\">+</span>\n `;\n }\n // render heading title and modifier\n private renderHeader(): TemplateResult {\n const hasModifier = this.modifierKeys && this.modifierKeys?.length > 0;\n const hasShortcut = Boolean(this.shortcutKey);\n const hasTitle = Boolean(this.content?.title);\n if (!hasTitle && !hasModifier && !hasShortcut) {\n return html`\n <div class=\"title\"><slot name=\"title\"></slot></div>\n `;\n }\n return html`\n ${hasTitle\n ? html`\n <div class=\"title\">${this.content?.title}</div>\n `\n : nothing}\n ${hasModifier || hasShortcut\n ? html`\n <kbd class=\"keys spectrum-Body spectrum-Body--sizeS\">\n ${hasModifier\n ? join(\n this.modifierKeys?.map((k) =>\n this.renderModifier(k)\n ),\n this.renderJoiner()\n )\n : nothing}\n ${hasShortcut && hasModifier\n ? this.renderJoiner()\n : nothing}\n ${hasShortcut\n ? this.renderModifier(\n this.shortcutKey!,\n 'shortcut'\n )\n : nothing}\n </kbd>\n `\n : nothing}\n `;\n }\n // render description\n private renderContent(): TemplateResult {\n const hasDescription = Boolean(this.content?.description);\n if (!hasDescription)\n return html`\n <slot name=\"content\"></slot>\n `;\n return html`\n <div>${this.content?.description}</div>\n `;\n }\n\n private stopPropagationOnHref(event: Event): void {\n if (this.href) {\n event.stopPropagation();\n }\n }\n\n // event on primary button\n private handlePrimaryCTA(): void {\n this.dispatchEvent(\n new Event('primary', {\n bubbles: true,\n composed: true,\n })\n );\n }\n // event on secondary button\n private handleSecondaryCTA(): void {\n this.dispatchEvent(\n new Event('secondary', {\n bubbles: true,\n composed: true,\n })\n );\n }\n\n private renderSecondaryButton = (): TemplateResult => {\n return html`\n <sp-button\n treatment=\"outline\"\n variant=\"secondary\"\n @click=${this.handleSecondaryCTA}\n >\n ${this.secondaryCTA}\n </sp-button>\n `;\n };\n\n private renderPrimaryButton = (): TemplateResult => {\n return html`\n <sp-button\n size=\"s\"\n treatment=\"outline\"\n variant=\"primary\"\n @click=${this.handlePrimaryCTA}\n >\n ${this.primaryCTA}\n </sp-button>\n `;\n };\n\n private renderSecondaryButtonMobile = (): TemplateResult => {\n return html`\n <sp-button\n variant=\"secondary\"\n treatment=\"outline\"\n icon-only\n aria-label=\"previous\"\n @click=${this.handleSecondaryCTA}\n >\n <sp-icon-chevron200\n size=\"s\"\n class=\"spectrum-UIIcon-ChevronLeft75\"\n slot=\"icon\"\n ></sp-icon-chevron200>\n </sp-button>\n `;\n };\n\n private renderPrimaryButtonMobile = (): TemplateResult => {\n return html`\n <sp-button\n size=\"s\"\n treatment=\"outline\"\n variant=\"primary\"\n @click=${this.handlePrimaryCTA}\n >\n ${this.primaryCTA}\n </sp-button>\n `;\n };\n\n protected renderButtons(): TemplateResult {\n return html`\n <sp-button-group class=\"spectrum-ButtonGroup buttongroup\">\n ${when(this.secondaryCTA, this.renderSecondaryButton)}\n ${when(this.primaryCTA, this.renderPrimaryButton)}\n </sp-button-group>\n <sp-button-group\n class=\"spectrum-ButtonGroup buttongroup-mobile\"\n size=\"s\"\n >\n ${when(this.secondaryCTA, this.renderSecondaryButtonMobile)}\n ${when(this.primaryCTA, this.renderPrimaryButtonMobile)}\n </sp-button-group>\n `;\n }\n\n // render steps\n protected renderSteps = (): TemplateResult => {\n return html`\n <div class=\"step\" role=\"status\">\n <span aria-live=\"polite\">\n ${this.currentStep} of ${this.totalSteps}\n </span>\n </div>\n `;\n };\n // render action menu\n protected renderActionMenu = (): TemplateResult => {\n return html`\n <div class=\"action-menu\" @pointerdown=${this.stopPropagationOnHref}>\n <slot name=\"actions\"></slot>\n </div>\n `;\n };\n\n protected override render(): TemplateResult {\n return html`\n ${this.renderMedia()}\n <div class=\"header\">\n <div class=\"flex-container\">${this.renderHeader()}</div>\n <div class=\"static-item\">\n ${when(\n this.secondaryCTA && this.primaryCTA,\n this.renderActionMenu\n )}\n </div>\n </div>\n\n <div class=\"content\">${this.renderContent()}</div>\n <div class=\"footer\">\n ${when(\n this.totalSteps && this.totalSteps > 1,\n this.renderSteps\n )}\n ${this.renderButtons()}\n </div>\n `;\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;AAWA;AAAA,EAEI;AAAA,EACA;AAAA,OAEG;AACP,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB,
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2023 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n nothing,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { when } from '@spectrum-web-components/base/src/directives.js';\nimport coachmarkStyles from './coachmark.css.js';\nimport chevronStyles from '@spectrum-web-components/icon/src/spectrum-icon-chevron.css.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-chevron200.js';\nimport { Popover } from '@spectrum-web-components/popover';\nimport { join } from 'lit/directives/join.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport type { Placement } from '@spectrum-web-components/overlay';\nimport { MediaType } from './CoachmarkItem.dev.js'\nimport type { CoachmarkItem } from './CoachmarkItem.dev.js'\nimport '@spectrum-web-components/asset/sp-asset.js';\nimport '@spectrum-web-components/button/sp-button.js';\nimport '@spectrum-web-components/button-group/sp-button-group.js';\nimport '@spectrum-web-components/quick-actions/sp-quick-actions.js';\n\n/**\n * @element sp-coachmark\n * @fires primary - Announces that the \"primary\" button has been clicked.\n * @fires secondary - Announces that the \"secondary\" button has been clicked.\n * @slot cover-photo - This is the cover photo for Default and Quiet Coachmark\n * @slot heading - HTML content to be listed as the heading\n * @slot description - A description of the card\n * @slot actions - an `sp-action-menu` element outlining actions to take on the represened object\n */\nexport class Coachmark extends Popover {\n public static override get styles(): CSSResultArray {\n return [...super.styles, coachmarkStyles, chevronStyles];\n }\n @property({ type: Object })\n public item?: CoachmarkItem;\n\n @property({ type: String })\n public override placement: Placement = 'right';\n\n @property({ type: Object, attribute: false })\n private content?: {\n title?: string;\n description?: string;\n imageAlt?: string;\n };\n\n @property({ attribute: 'shortcut-key' })\n private shortcutKey?: string;\n\n @property({ type: Array })\n public modifierKeys?: string[] = [];\n\n @property({ attribute: 'src' })\n private source?: string;\n\n @property({ attribute: 'media-type' })\n private mediaType?: MediaType;\n\n @property({ type: Boolean, attribute: 'has-asset', reflect: true })\n public hasAsset = false;\n\n @property()\n public asset?: 'file' | 'folder';\n\n @property({ type: Number, attribute: 'current-step' })\n public currentStep?: number;\n\n @property({ type: Number, attribute: 'total-steps' })\n public totalSteps?: number;\n\n @property({ type: String, attribute: 'primary-cta' })\n primaryCTA?: string;\n\n @property({ type: String, attribute: 'secondary-cta' })\n secondaryCTA?: string;\n\n // render video and images\n private renderMedia(): TemplateResult {\n const isImage = this.mediaType === MediaType.IMAGE;\n if (!isImage) {\n return html`\n <slot name=\"asset\"></slot>\n `;\n }\n return html`\n <sp-asset id=\"cover-photo\">\n <div class=\"image-wrapper\">\n <img\n class=\"image\"\n loading=\"lazy\"\n slot=\"cover-photo\"\n src=\"${ifDefined(this.source)}\"\n alt=\"${ifDefined(this?.content?.imageAlt)}\"\n />\n </div>\n </sp-asset>\n `;\n }\n // method to render modifier\n private renderModifier(\n modifierKey: string,\n type: 'modifier' | 'shortcut' = 'modifier'\n ): TemplateResult {\n return html`\n <span type=\"${type}\" class=\"keyboard-shortcut\">${modifierKey}</span>\n `;\n }\n\n private renderJoiner(): TemplateResult {\n return html`\n <span class=\"plus\">+</span>\n `;\n }\n // render heading title and modifier\n private renderHeader(): TemplateResult {\n const hasModifier = this.modifierKeys && this.modifierKeys?.length > 0;\n const hasShortcut = Boolean(this.shortcutKey);\n const hasTitle = Boolean(this.content?.title);\n if (!hasTitle && !hasModifier && !hasShortcut) {\n return html`\n <div class=\"title\"><slot name=\"title\"></slot></div>\n `;\n }\n return html`\n ${hasTitle\n ? html`\n <div class=\"title\">${this.content?.title}</div>\n `\n : nothing}\n ${hasModifier || hasShortcut\n ? html`\n <kbd class=\"keys spectrum-Body spectrum-Body--sizeS\">\n ${hasModifier\n ? join(\n this.modifierKeys?.map((k) =>\n this.renderModifier(k)\n ),\n this.renderJoiner()\n )\n : nothing}\n ${hasShortcut && hasModifier\n ? this.renderJoiner()\n : nothing}\n ${hasShortcut\n ? this.renderModifier(\n this.shortcutKey!,\n 'shortcut'\n )\n : nothing}\n </kbd>\n `\n : nothing}\n `;\n }\n // render description\n private renderContent(): TemplateResult {\n const hasDescription = Boolean(this.content?.description);\n if (!hasDescription)\n return html`\n <slot name=\"content\"></slot>\n `;\n return html`\n <div>${this.content?.description}</div>\n `;\n }\n\n // event on primary button\n private handlePrimaryCTA(): void {\n this.dispatchEvent(\n new Event('primary', {\n bubbles: true,\n composed: true,\n })\n );\n }\n // event on secondary button\n private handleSecondaryCTA(): void {\n this.dispatchEvent(\n new Event('secondary', {\n bubbles: true,\n composed: true,\n })\n );\n }\n\n private renderSecondaryButton = (): TemplateResult => {\n return html`\n <sp-button\n treatment=\"outline\"\n variant=\"secondary\"\n @click=${this.handleSecondaryCTA}\n >\n ${this.secondaryCTA}\n </sp-button>\n `;\n };\n\n private renderPrimaryButton = (): TemplateResult => {\n return html`\n <sp-button\n size=\"s\"\n treatment=\"outline\"\n variant=\"primary\"\n @click=${this.handlePrimaryCTA}\n >\n ${this.primaryCTA}\n </sp-button>\n `;\n };\n\n private renderSecondaryButtonMobile = (): TemplateResult => {\n return html`\n <sp-button\n variant=\"secondary\"\n treatment=\"outline\"\n icon-only\n aria-label=\"previous\"\n @click=${this.handleSecondaryCTA}\n >\n <sp-icon-chevron200\n size=\"s\"\n class=\"spectrum-UIIcon-ChevronLeft75\"\n slot=\"icon\"\n ></sp-icon-chevron200>\n </sp-button>\n `;\n };\n\n private renderPrimaryButtonMobile = (): TemplateResult => {\n return html`\n <sp-button\n size=\"s\"\n treatment=\"outline\"\n variant=\"primary\"\n @click=${this.handlePrimaryCTA}\n >\n ${this.primaryCTA}\n </sp-button>\n `;\n };\n\n protected renderButtons(): TemplateResult {\n return html`\n <sp-button-group class=\"spectrum-ButtonGroup buttongroup\">\n ${when(this.secondaryCTA, this.renderSecondaryButton)}\n ${when(this.primaryCTA, this.renderPrimaryButton)}\n </sp-button-group>\n <sp-button-group\n class=\"spectrum-ButtonGroup buttongroup-mobile\"\n size=\"s\"\n >\n ${when(this.secondaryCTA, this.renderSecondaryButtonMobile)}\n ${when(this.primaryCTA, this.renderPrimaryButtonMobile)}\n </sp-button-group>\n `;\n }\n\n // render steps\n protected renderSteps = (): TemplateResult => {\n return html`\n <div class=\"step\" role=\"status\">\n <span aria-live=\"polite\">\n ${this.currentStep} of ${this.totalSteps}\n </span>\n </div>\n `;\n };\n // render action menu\n protected renderActionMenu = (): TemplateResult => {\n return html`\n <div class=\"action-menu\">\n <slot name=\"actions\"></slot>\n </div>\n `;\n };\n\n protected override render(): TemplateResult {\n return html`\n ${this.renderMedia()}\n <div class=\"header\">\n <div class=\"flex-container\">${this.renderHeader()}</div>\n <div class=\"static-item\">\n ${when(\n this.secondaryCTA && this.primaryCTA,\n this.renderActionMenu\n )}\n </div>\n </div>\n\n <div class=\"content\">${this.renderContent()}</div>\n <div class=\"footer\">\n ${when(\n this.totalSteps && this.totalSteps > 1,\n this.renderSteps\n )}\n ${this.renderButtons()}\n </div>\n `;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;AAWA;AAAA,EAEI;AAAA,EACA;AAAA,OAEG;AACP,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB,OAAO,qBAAqB;AAC5B,OAAO,mBAAmB;AAC1B,OAAO;AACP,SAAS,eAAe;AACxB,SAAS,YAAY;AACrB,SAAS,iBAAiB;AAE1B,SAAS,iBAAiB;AAE1B,OAAO;AACP,OAAO;AACP,OAAO;AACP,OAAO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M,MAAM,CAAC;AAAA,GApBhB,UAqBF;AAGC;AAAA,EADP,SAAS,EAAE,WAAW,MAAM,CAAC;AAAA,GAvBrB,UAwBD;AAGA;AAAA,EADP,SAAS,EAAE,WAAW,aAAa,CAAC;AAAA,GA1B5B,UA2BD;AAGD;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,WAAW,aAAa,SAAS,KAAK,CAAC;AAAA,GA7BzD,UA8BF;AAGA;AAAA,EADN,SAAS;AAAA,GAhCD,UAiCF;AAGA;AAAA,EADN,SAAS,EAAE,MAAM,QAAQ,WAAW,eAAe,CAAC;AAAA,GAnC5C,UAoCF;AAGA;AAAA,EADN,SAAS,EAAE,MAAM,QAAQ,WAAW,cAAc,CAAC;AAAA,GAtC3C,UAuCF;AAGP;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,WAAW,cAAc,CAAC;AAAA,GAzC3C,UA0CT;AAGA;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,WAAW,gBAAgB,CAAC;AAAA,GA5C7C,UA6CT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/Coachmark.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var v=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var
|
|
1
|
+
"use strict";var v=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var r=(d,l,n,e)=>{for(var i=e>1?void 0:e?b(l,n):l,o=d.length-1,a;o>=0;o--)(a=d[o])&&(i=(e?a(l,n,i):a(i))||i);return e&&i&&v(l,n,i),i};import{html as t,nothing as u}from"@spectrum-web-components/base";import{property as s}from"@spectrum-web-components/base/src/decorators.js";import{when as p}from"@spectrum-web-components/base/src/directives.js";import T from"./coachmark.css.js";import f from"@spectrum-web-components/icon/src/spectrum-icon-chevron.css.js";import"@spectrum-web-components/icons-ui/icons/sp-icon-chevron200.js";import{Popover as g}from"@spectrum-web-components/popover";import{join as $}from"lit/directives/join.js";import{ifDefined as y}from"@spectrum-web-components/base/src/directives.js";import{MediaType as A}from"./CoachmarkItem.js";import"@spectrum-web-components/asset/sp-asset.js";import"@spectrum-web-components/button/sp-button.js";import"@spectrum-web-components/button-group/sp-button-group.js";import"@spectrum-web-components/quick-actions/sp-quick-actions.js";export class Coachmark extends g{constructor(){super(...arguments);this.placement="right";this.modifierKeys=[];this.hasAsset=!1;this.renderSecondaryButton=()=>t`
|
|
2
2
|
<sp-button
|
|
3
3
|
treatment="outline"
|
|
4
4
|
variant="secondary"
|
|
@@ -45,45 +45,45 @@
|
|
|
45
45
|
</span>
|
|
46
46
|
</div>
|
|
47
47
|
`;this.renderActionMenu=()=>t`
|
|
48
|
-
<div class="action-menu"
|
|
48
|
+
<div class="action-menu">
|
|
49
49
|
<slot name="actions"></slot>
|
|
50
50
|
</div>
|
|
51
|
-
`}static get styles(){return[...super.styles,T,
|
|
51
|
+
`}static get styles(){return[...super.styles,T,f]}renderMedia(){var e;return this.mediaType===A.IMAGE?t`
|
|
52
52
|
<sp-asset id="cover-photo">
|
|
53
53
|
<div class="image-wrapper">
|
|
54
54
|
<img
|
|
55
55
|
class="image"
|
|
56
56
|
loading="lazy"
|
|
57
57
|
slot="cover-photo"
|
|
58
|
-
src="${
|
|
59
|
-
alt="${
|
|
58
|
+
src="${y(this.source)}"
|
|
59
|
+
alt="${y((e=this==null?void 0:this.content)==null?void 0:e.imageAlt)}"
|
|
60
60
|
/>
|
|
61
61
|
</div>
|
|
62
62
|
</sp-asset>
|
|
63
63
|
`:t`
|
|
64
64
|
<slot name="asset"></slot>
|
|
65
|
-
`}renderModifier(
|
|
66
|
-
<span type="${e}" class="keyboard-shortcut">${
|
|
65
|
+
`}renderModifier(n,e="modifier"){return t`
|
|
66
|
+
<span type="${e}" class="keyboard-shortcut">${n}</span>
|
|
67
67
|
`}renderJoiner(){return t`
|
|
68
68
|
<span class="plus">+</span>
|
|
69
|
-
`}renderHeader(){var o,a,c,m;const
|
|
69
|
+
`}renderHeader(){var o,a,c,m;const n=this.modifierKeys&&((o=this.modifierKeys)==null?void 0:o.length)>0,e=!!this.shortcutKey,i=!!((a=this.content)!=null&&a.title);return!i&&!n&&!e?t`
|
|
70
70
|
<div class="title"><slot name="title"></slot></div>
|
|
71
71
|
`:t`
|
|
72
|
-
${
|
|
72
|
+
${i?t`
|
|
73
73
|
<div class="title">${(c=this.content)==null?void 0:c.title}</div>
|
|
74
74
|
`:u}
|
|
75
|
-
${
|
|
75
|
+
${n||e?t`
|
|
76
76
|
<kbd class="keys spectrum-Body spectrum-Body--sizeS">
|
|
77
|
-
${
|
|
78
|
-
${e&&
|
|
77
|
+
${n?$((m=this.modifierKeys)==null?void 0:m.map(h=>this.renderModifier(h)),this.renderJoiner()):u}
|
|
78
|
+
${e&&n?this.renderJoiner():u}
|
|
79
79
|
${e?this.renderModifier(this.shortcutKey,"shortcut"):u}
|
|
80
80
|
</kbd>
|
|
81
81
|
`:u}
|
|
82
|
-
`}renderContent(){var e,
|
|
82
|
+
`}renderContent(){var e,i;return!((e=this.content)!=null&&e.description)?t`
|
|
83
83
|
<slot name="content"></slot>
|
|
84
84
|
`:t`
|
|
85
|
-
<div>${(
|
|
86
|
-
`}
|
|
85
|
+
<div>${(i=this.content)==null?void 0:i.description}</div>
|
|
86
|
+
`}handlePrimaryCTA(){this.dispatchEvent(new Event("primary",{bubbles:!0,composed:!0}))}handleSecondaryCTA(){this.dispatchEvent(new Event("secondary",{bubbles:!0,composed:!0}))}renderButtons(){return t`
|
|
87
87
|
<sp-button-group class="spectrum-ButtonGroup buttongroup">
|
|
88
88
|
${p(this.secondaryCTA,this.renderSecondaryButton)}
|
|
89
89
|
${p(this.primaryCTA,this.renderPrimaryButton)}
|
|
@@ -109,5 +109,5 @@
|
|
|
109
109
|
${p(this.totalSteps&&this.totalSteps>1,this.renderSteps)}
|
|
110
110
|
${this.renderButtons()}
|
|
111
111
|
</div>
|
|
112
|
-
`}}
|
|
112
|
+
`}}r([s({type:Object})],Coachmark.prototype,"item",2),r([s({type:String})],Coachmark.prototype,"placement",2),r([s({type:Object,attribute:!1})],Coachmark.prototype,"content",2),r([s({attribute:"shortcut-key"})],Coachmark.prototype,"shortcutKey",2),r([s({type:Array})],Coachmark.prototype,"modifierKeys",2),r([s({attribute:"src"})],Coachmark.prototype,"source",2),r([s({attribute:"media-type"})],Coachmark.prototype,"mediaType",2),r([s({type:Boolean,attribute:"has-asset",reflect:!0})],Coachmark.prototype,"hasAsset",2),r([s()],Coachmark.prototype,"asset",2),r([s({type:Number,attribute:"current-step"})],Coachmark.prototype,"currentStep",2),r([s({type:Number,attribute:"total-steps"})],Coachmark.prototype,"totalSteps",2),r([s({type:String,attribute:"primary-cta"})],Coachmark.prototype,"primaryCTA",2),r([s({type:String,attribute:"secondary-cta"})],Coachmark.prototype,"secondaryCTA",2);
|
|
113
113
|
//# sourceMappingURL=Coachmark.js.map
|
package/src/Coachmark.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["Coachmark.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2023 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n nothing,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { when } from '@spectrum-web-components/base/src/directives.js';\nimport { LikeAnchor } from '@spectrum-web-components/shared/src/like-anchor.js';\nimport coachmarkStyles from './coachmark.css.js';\nimport chevronStyles from '@spectrum-web-components/icon/src/spectrum-icon-chevron.css.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-chevron200.js';\nimport { Popover } from '@spectrum-web-components/popover';\nimport { join } from 'lit/directives/join.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport type { Placement } from '@spectrum-web-components/overlay';\nimport { MediaType } from './CoachmarkItem.js';\nimport type { CoachmarkItem } from './CoachmarkItem.js';\nimport '@spectrum-web-components/asset/sp-asset.js';\nimport '@spectrum-web-components/button/sp-button.js';\nimport '@spectrum-web-components/button-group/sp-button-group.js';\nimport '@spectrum-web-components/quick-actions/sp-quick-actions.js';\n\n/**\n * @element sp-coachmark\n * @fires primary - Announces that the \"primary\" button has been clicked.\n * @fires secondary - Announces that the \"secondary\" button has been clicked.\n * @slot cover-photo - This is the cover photo for Default and Quiet Coachmark\n * @slot heading - HTML content to be listed as the heading\n * @slot description - A description of the card\n * @slot actions - an `sp-action-menu` element outlining actions to take on the represened object\n */\nexport class Coachmark extends LikeAnchor(Popover) {\n public static override get styles(): CSSResultArray {\n return [...super.styles, coachmarkStyles, chevronStyles];\n }\n @property({ type: Object })\n public item?: CoachmarkItem;\n\n @property({ type: String })\n public override placement: Placement = 'right';\n\n @property({ type: Object, attribute: false })\n private content?: {\n title?: string;\n description?: string;\n imageAlt?: string;\n };\n\n @property({ attribute: 'shortcut-key' })\n private shortcutKey?: string;\n\n @property({ type: Array })\n public modifierKeys?: string[] = [];\n\n @property({ attribute: 'src' })\n private source?: string;\n\n @property({ attribute: 'media-type' })\n private mediaType?: MediaType;\n\n @property({ type: Boolean, attribute: 'has-asset', reflect: true })\n public hasAsset = false;\n\n @property()\n public asset?: 'file' | 'folder';\n\n @property({ type: Number, attribute: 'current-step' })\n public currentStep?: number;\n\n @property({ type: Number, attribute: 'total-steps' })\n public totalSteps?: number;\n\n @property({ type: String, attribute: 'primary-cta' })\n primaryCTA?: string;\n\n @property({ type: String, attribute: 'secondary-cta' })\n secondaryCTA?: string;\n\n // render video and images\n private renderMedia(): TemplateResult {\n const isImage = this.mediaType === MediaType.IMAGE;\n if (!isImage) {\n return html`\n <slot name=\"asset\"></slot>\n `;\n }\n return html`\n <sp-asset id=\"cover-photo\">\n <div class=\"image-wrapper\">\n <img\n class=\"image\"\n loading=\"lazy\"\n slot=\"cover-photo\"\n src=\"${ifDefined(this.source)}\"\n alt=\"${ifDefined(this?.content?.imageAlt)}\"\n />\n </div>\n </sp-asset>\n `;\n }\n // method to render modifier\n private renderModifier(\n modifierKey: string,\n type: 'modifier' | 'shortcut' = 'modifier'\n ): TemplateResult {\n return html`\n <span type=\"${type}\" class=\"keyboard-shortcut\">${modifierKey}</span>\n `;\n }\n\n private renderJoiner(): TemplateResult {\n return html`\n <span class=\"plus\">+</span>\n `;\n }\n // render heading title and modifier\n private renderHeader(): TemplateResult {\n const hasModifier = this.modifierKeys && this.modifierKeys?.length > 0;\n const hasShortcut = Boolean(this.shortcutKey);\n const hasTitle = Boolean(this.content?.title);\n if (!hasTitle && !hasModifier && !hasShortcut) {\n return html`\n <div class=\"title\"><slot name=\"title\"></slot></div>\n `;\n }\n return html`\n ${hasTitle\n ? html`\n <div class=\"title\">${this.content?.title}</div>\n `\n : nothing}\n ${hasModifier || hasShortcut\n ? html`\n <kbd class=\"keys spectrum-Body spectrum-Body--sizeS\">\n ${hasModifier\n ? join(\n this.modifierKeys?.map((k) =>\n this.renderModifier(k)\n ),\n this.renderJoiner()\n )\n : nothing}\n ${hasShortcut && hasModifier\n ? this.renderJoiner()\n : nothing}\n ${hasShortcut\n ? this.renderModifier(\n this.shortcutKey!,\n 'shortcut'\n )\n : nothing}\n </kbd>\n `\n : nothing}\n `;\n }\n // render description\n private renderContent(): TemplateResult {\n const hasDescription = Boolean(this.content?.description);\n if (!hasDescription)\n return html`\n <slot name=\"content\"></slot>\n `;\n return html`\n <div>${this.content?.description}</div>\n `;\n }\n\n private stopPropagationOnHref(event: Event): void {\n if (this.href) {\n event.stopPropagation();\n }\n }\n\n // event on primary button\n private handlePrimaryCTA(): void {\n this.dispatchEvent(\n new Event('primary', {\n bubbles: true,\n composed: true,\n })\n );\n }\n // event on secondary button\n private handleSecondaryCTA(): void {\n this.dispatchEvent(\n new Event('secondary', {\n bubbles: true,\n composed: true,\n })\n );\n }\n\n private renderSecondaryButton = (): TemplateResult => {\n return html`\n <sp-button\n treatment=\"outline\"\n variant=\"secondary\"\n @click=${this.handleSecondaryCTA}\n >\n ${this.secondaryCTA}\n </sp-button>\n `;\n };\n\n private renderPrimaryButton = (): TemplateResult => {\n return html`\n <sp-button\n size=\"s\"\n treatment=\"outline\"\n variant=\"primary\"\n @click=${this.handlePrimaryCTA}\n >\n ${this.primaryCTA}\n </sp-button>\n `;\n };\n\n private renderSecondaryButtonMobile = (): TemplateResult => {\n return html`\n <sp-button\n variant=\"secondary\"\n treatment=\"outline\"\n icon-only\n aria-label=\"previous\"\n @click=${this.handleSecondaryCTA}\n >\n <sp-icon-chevron200\n size=\"s\"\n class=\"spectrum-UIIcon-ChevronLeft75\"\n slot=\"icon\"\n ></sp-icon-chevron200>\n </sp-button>\n `;\n };\n\n private renderPrimaryButtonMobile = (): TemplateResult => {\n return html`\n <sp-button\n size=\"s\"\n treatment=\"outline\"\n variant=\"primary\"\n @click=${this.handlePrimaryCTA}\n >\n ${this.primaryCTA}\n </sp-button>\n `;\n };\n\n protected renderButtons(): TemplateResult {\n return html`\n <sp-button-group class=\"spectrum-ButtonGroup buttongroup\">\n ${when(this.secondaryCTA, this.renderSecondaryButton)}\n ${when(this.primaryCTA, this.renderPrimaryButton)}\n </sp-button-group>\n <sp-button-group\n class=\"spectrum-ButtonGroup buttongroup-mobile\"\n size=\"s\"\n >\n ${when(this.secondaryCTA, this.renderSecondaryButtonMobile)}\n ${when(this.primaryCTA, this.renderPrimaryButtonMobile)}\n </sp-button-group>\n `;\n }\n\n // render steps\n protected renderSteps = (): TemplateResult => {\n return html`\n <div class=\"step\" role=\"status\">\n <span aria-live=\"polite\">\n ${this.currentStep} of ${this.totalSteps}\n </span>\n </div>\n `;\n };\n // render action menu\n protected renderActionMenu = (): TemplateResult => {\n return html`\n <div class=\"action-menu\" @pointerdown=${this.stopPropagationOnHref}>\n <slot name=\"actions\"></slot>\n </div>\n `;\n };\n\n protected override render(): TemplateResult {\n return html`\n ${this.renderMedia()}\n <div class=\"header\">\n <div class=\"flex-container\">${this.renderHeader()}</div>\n <div class=\"static-item\">\n ${when(\n this.secondaryCTA && this.primaryCTA,\n this.renderActionMenu\n )}\n </div>\n </div>\n\n <div class=\"content\">${this.renderContent()}</div>\n <div class=\"footer\">\n ${when(\n this.totalSteps && this.totalSteps > 1,\n this.renderSteps\n )}\n ${this.renderButtons()}\n </div>\n `;\n }\n}\n"],
|
|
5
|
-
"mappings": "qNAWA,OAEI,QAAAA,EACA,WAAAC,MAEG,gCACP,OAAS,YAAAC,MAAgB,kDACzB,OAAS,QAAAC,MAAY,kDACrB,
|
|
6
|
-
"names": ["html", "nothing", "property", "when", "
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2023 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n nothing,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { when } from '@spectrum-web-components/base/src/directives.js';\nimport coachmarkStyles from './coachmark.css.js';\nimport chevronStyles from '@spectrum-web-components/icon/src/spectrum-icon-chevron.css.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-chevron200.js';\nimport { Popover } from '@spectrum-web-components/popover';\nimport { join } from 'lit/directives/join.js';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport type { Placement } from '@spectrum-web-components/overlay';\nimport { MediaType } from './CoachmarkItem.js';\nimport type { CoachmarkItem } from './CoachmarkItem.js';\nimport '@spectrum-web-components/asset/sp-asset.js';\nimport '@spectrum-web-components/button/sp-button.js';\nimport '@spectrum-web-components/button-group/sp-button-group.js';\nimport '@spectrum-web-components/quick-actions/sp-quick-actions.js';\n\n/**\n * @element sp-coachmark\n * @fires primary - Announces that the \"primary\" button has been clicked.\n * @fires secondary - Announces that the \"secondary\" button has been clicked.\n * @slot cover-photo - This is the cover photo for Default and Quiet Coachmark\n * @slot heading - HTML content to be listed as the heading\n * @slot description - A description of the card\n * @slot actions - an `sp-action-menu` element outlining actions to take on the represened object\n */\nexport class Coachmark extends Popover {\n public static override get styles(): CSSResultArray {\n return [...super.styles, coachmarkStyles, chevronStyles];\n }\n @property({ type: Object })\n public item?: CoachmarkItem;\n\n @property({ type: String })\n public override placement: Placement = 'right';\n\n @property({ type: Object, attribute: false })\n private content?: {\n title?: string;\n description?: string;\n imageAlt?: string;\n };\n\n @property({ attribute: 'shortcut-key' })\n private shortcutKey?: string;\n\n @property({ type: Array })\n public modifierKeys?: string[] = [];\n\n @property({ attribute: 'src' })\n private source?: string;\n\n @property({ attribute: 'media-type' })\n private mediaType?: MediaType;\n\n @property({ type: Boolean, attribute: 'has-asset', reflect: true })\n public hasAsset = false;\n\n @property()\n public asset?: 'file' | 'folder';\n\n @property({ type: Number, attribute: 'current-step' })\n public currentStep?: number;\n\n @property({ type: Number, attribute: 'total-steps' })\n public totalSteps?: number;\n\n @property({ type: String, attribute: 'primary-cta' })\n primaryCTA?: string;\n\n @property({ type: String, attribute: 'secondary-cta' })\n secondaryCTA?: string;\n\n // render video and images\n private renderMedia(): TemplateResult {\n const isImage = this.mediaType === MediaType.IMAGE;\n if (!isImage) {\n return html`\n <slot name=\"asset\"></slot>\n `;\n }\n return html`\n <sp-asset id=\"cover-photo\">\n <div class=\"image-wrapper\">\n <img\n class=\"image\"\n loading=\"lazy\"\n slot=\"cover-photo\"\n src=\"${ifDefined(this.source)}\"\n alt=\"${ifDefined(this?.content?.imageAlt)}\"\n />\n </div>\n </sp-asset>\n `;\n }\n // method to render modifier\n private renderModifier(\n modifierKey: string,\n type: 'modifier' | 'shortcut' = 'modifier'\n ): TemplateResult {\n return html`\n <span type=\"${type}\" class=\"keyboard-shortcut\">${modifierKey}</span>\n `;\n }\n\n private renderJoiner(): TemplateResult {\n return html`\n <span class=\"plus\">+</span>\n `;\n }\n // render heading title and modifier\n private renderHeader(): TemplateResult {\n const hasModifier = this.modifierKeys && this.modifierKeys?.length > 0;\n const hasShortcut = Boolean(this.shortcutKey);\n const hasTitle = Boolean(this.content?.title);\n if (!hasTitle && !hasModifier && !hasShortcut) {\n return html`\n <div class=\"title\"><slot name=\"title\"></slot></div>\n `;\n }\n return html`\n ${hasTitle\n ? html`\n <div class=\"title\">${this.content?.title}</div>\n `\n : nothing}\n ${hasModifier || hasShortcut\n ? html`\n <kbd class=\"keys spectrum-Body spectrum-Body--sizeS\">\n ${hasModifier\n ? join(\n this.modifierKeys?.map((k) =>\n this.renderModifier(k)\n ),\n this.renderJoiner()\n )\n : nothing}\n ${hasShortcut && hasModifier\n ? this.renderJoiner()\n : nothing}\n ${hasShortcut\n ? this.renderModifier(\n this.shortcutKey!,\n 'shortcut'\n )\n : nothing}\n </kbd>\n `\n : nothing}\n `;\n }\n // render description\n private renderContent(): TemplateResult {\n const hasDescription = Boolean(this.content?.description);\n if (!hasDescription)\n return html`\n <slot name=\"content\"></slot>\n `;\n return html`\n <div>${this.content?.description}</div>\n `;\n }\n\n // event on primary button\n private handlePrimaryCTA(): void {\n this.dispatchEvent(\n new Event('primary', {\n bubbles: true,\n composed: true,\n })\n );\n }\n // event on secondary button\n private handleSecondaryCTA(): void {\n this.dispatchEvent(\n new Event('secondary', {\n bubbles: true,\n composed: true,\n })\n );\n }\n\n private renderSecondaryButton = (): TemplateResult => {\n return html`\n <sp-button\n treatment=\"outline\"\n variant=\"secondary\"\n @click=${this.handleSecondaryCTA}\n >\n ${this.secondaryCTA}\n </sp-button>\n `;\n };\n\n private renderPrimaryButton = (): TemplateResult => {\n return html`\n <sp-button\n size=\"s\"\n treatment=\"outline\"\n variant=\"primary\"\n @click=${this.handlePrimaryCTA}\n >\n ${this.primaryCTA}\n </sp-button>\n `;\n };\n\n private renderSecondaryButtonMobile = (): TemplateResult => {\n return html`\n <sp-button\n variant=\"secondary\"\n treatment=\"outline\"\n icon-only\n aria-label=\"previous\"\n @click=${this.handleSecondaryCTA}\n >\n <sp-icon-chevron200\n size=\"s\"\n class=\"spectrum-UIIcon-ChevronLeft75\"\n slot=\"icon\"\n ></sp-icon-chevron200>\n </sp-button>\n `;\n };\n\n private renderPrimaryButtonMobile = (): TemplateResult => {\n return html`\n <sp-button\n size=\"s\"\n treatment=\"outline\"\n variant=\"primary\"\n @click=${this.handlePrimaryCTA}\n >\n ${this.primaryCTA}\n </sp-button>\n `;\n };\n\n protected renderButtons(): TemplateResult {\n return html`\n <sp-button-group class=\"spectrum-ButtonGroup buttongroup\">\n ${when(this.secondaryCTA, this.renderSecondaryButton)}\n ${when(this.primaryCTA, this.renderPrimaryButton)}\n </sp-button-group>\n <sp-button-group\n class=\"spectrum-ButtonGroup buttongroup-mobile\"\n size=\"s\"\n >\n ${when(this.secondaryCTA, this.renderSecondaryButtonMobile)}\n ${when(this.primaryCTA, this.renderPrimaryButtonMobile)}\n </sp-button-group>\n `;\n }\n\n // render steps\n protected renderSteps = (): TemplateResult => {\n return html`\n <div class=\"step\" role=\"status\">\n <span aria-live=\"polite\">\n ${this.currentStep} of ${this.totalSteps}\n </span>\n </div>\n `;\n };\n // render action menu\n protected renderActionMenu = (): TemplateResult => {\n return html`\n <div class=\"action-menu\">\n <slot name=\"actions\"></slot>\n </div>\n `;\n };\n\n protected override render(): TemplateResult {\n return html`\n ${this.renderMedia()}\n <div class=\"header\">\n <div class=\"flex-container\">${this.renderHeader()}</div>\n <div class=\"static-item\">\n ${when(\n this.secondaryCTA && this.primaryCTA,\n this.renderActionMenu\n )}\n </div>\n </div>\n\n <div class=\"content\">${this.renderContent()}</div>\n <div class=\"footer\">\n ${when(\n this.totalSteps && this.totalSteps > 1,\n this.renderSteps\n )}\n ${this.renderButtons()}\n </div>\n `;\n }\n}\n"],
|
|
5
|
+
"mappings": "qNAWA,OAEI,QAAAA,EACA,WAAAC,MAEG,gCACP,OAAS,YAAAC,MAAgB,kDACzB,OAAS,QAAAC,MAAY,kDACrB,OAAOC,MAAqB,qBAC5B,OAAOC,MAAmB,iEAC1B,MAAO,gEACP,OAAS,WAAAC,MAAe,mCACxB,OAAS,QAAAC,MAAY,yBACrB,OAAS,aAAAC,MAAiB,kDAE1B,OAAS,aAAAC,MAAiB,qBAE1B,MAAO,6CACP,MAAO,+CACP,MAAO,2DACP,MAAO,6DAWA,aAAM,kBAAkBH,CAAQ,CAAhC,kCAQH,KAAgB,UAAuB,QAavC,KAAO,aAA0B,CAAC,EASlC,KAAO,SAAW,GA8HlB,KAAQ,sBAAwB,IACrBN;AAAA;AAAA;AAAA;AAAA,yBAIU,KAAK,kBAAkB;AAAA;AAAA,kBAE9B,KAAK,YAAY;AAAA;AAAA,UAK/B,KAAQ,oBAAsB,IACnBA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAKU,KAAK,gBAAgB;AAAA;AAAA,kBAE5B,KAAK,UAAU;AAAA;AAAA,UAK7B,KAAQ,4BAA8B,IAC3BA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAMU,KAAK,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,UAW5C,KAAQ,0BAA4B,IACzBA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAKU,KAAK,gBAAgB;AAAA;AAAA,kBAE5B,KAAK,UAAU;AAAA;AAAA,UAsB7B,KAAU,YAAc,IACbA;AAAA;AAAA;AAAA,sBAGO,KAAK,WAAW,OAAO,KAAK,UAAU;AAAA;AAAA;AAAA,UAMxD,KAAU,iBAAmB,IAClBA;AAAA;AAAA;AAAA;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B9B,UAkBD,2BAGDkB,EAAA,CADNlB,EAAS,CAAE,KAAM,KAAM,CAAC,GApBhB,UAqBF,4BAGCkB,EAAA,CADPlB,EAAS,CAAE,UAAW,KAAM,CAAC,GAvBrB,UAwBD,sBAGAkB,EAAA,CADPlB,EAAS,CAAE,UAAW,YAAa,CAAC,GA1B5B,UA2BD,yBAGDkB,EAAA,CADNlB,EAAS,CAAE,KAAM,QAAS,UAAW,YAAa,QAAS,EAAK,CAAC,GA7BzD,UA8BF,wBAGAkB,EAAA,CADNlB,EAAS,GAhCD,UAiCF,qBAGAkB,EAAA,CADNlB,EAAS,CAAE,KAAM,OAAQ,UAAW,cAAe,CAAC,GAnC5C,UAoCF,2BAGAkB,EAAA,CADNlB,EAAS,CAAE,KAAM,OAAQ,UAAW,aAAc,CAAC,GAtC3C,UAuCF,0BAGPkB,EAAA,CADClB,EAAS,CAAE,KAAM,OAAQ,UAAW,aAAc,CAAC,GAzC3C,UA0CT,0BAGAkB,EAAA,CADClB,EAAS,CAAE,KAAM,OAAQ,UAAW,eAAgB,CAAC,GA5C7C,UA6CT",
|
|
6
|
+
"names": ["html", "nothing", "property", "when", "coachmarkStyles", "chevronStyles", "Popover", "join", "ifDefined", "MediaType", "_a", "modifierKey", "type", "_b", "_c", "_d", "hasModifier", "hasShortcut", "hasTitle", "k", "__decorateClass"]
|
|
7
7
|
}
|
|
@@ -1,91 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { css } from "@spectrum-web-components/base";
|
|
3
3
|
const styles = css`
|
|
4
|
-
:host{--spectrum-coach-indicator-animation-keyframe-0-scale:1;--spectrum-coach-indicator-animation-keyframe-0-opacity:0;--spectrum-coach-indicator-animation-keyframe-50-scale:1.5;--spectrum-coach-indicator-animation-keyframe-50-opacity:1;--spectrum-coach-indicator-animation-keyframe-100-scale:2;--spectrum-coach-indicator-animation-keyframe-100-opacity:0;--spectrum-coach-indicator-quiet-animation-keyframe-0-scale
|
|
5
|
-
--spectrum-border-width-200
|
|
6
|
-
);--spectrum-coach-indicator-min-inline-size:calc(var(--spectrum-coach-indicator-ring-diameter)*3);--spectrum-coach-indicator-min-block-size:calc(var(--spectrum-coach-indicator-ring-diameter)*3);--spectrum-coach-indicator-inline-size:var(
|
|
7
|
-
--spectrum-coach-indicator-min-inline-size
|
|
8
|
-
);--spectrum-coach-indicator-block-size:var(
|
|
9
|
-
--spectrum-coach-indicator-min-block-size
|
|
10
|
-
);--spectrum-coach-indicator-ring-inline-size:var(
|
|
11
|
-
--spectrum-coach-indicator-ring-diameter
|
|
12
|
-
);--spectrum-coach-indicator-ring-block-size:var(
|
|
13
|
-
--spectrum-coach-indicator-ring-diameter
|
|
14
|
-
);--spectrum-coach-indicator-top:calc(var(--spectrum-coach-indicator-block-size)/3 - var(--spectrum-coach-indicator-ring-border-size));--spectrum-coach-indicator-left:calc(var(--spectrum-coach-indicator-inline-size)/3 - var(--spectrum-coach-indicator-ring-border-size));--spectrum-coach-animation-indicator-ring-duration:var(
|
|
15
|
-
--spectrum-animation-duration-6000
|
|
16
|
-
);--spectrum-coach-animation-indicator-ring-inner-delay-multiple:-0.5;--spectrum-coach-animation-indicator-ring-center-delay-multiple:-0.66;--spectrum-coach-animation-indicator-ring-outer-delay-multiple:-1;--spectrum-coach-indicator-quiet-animation-ring-inner-delay-multiple:-0.33;--spectrum-coach-indicator-animation-name:pulse;--spectrum-coach-indicator-inner-animation-delay-multiple:var(
|
|
17
|
-
--spectrum-coach-animation-indicator-ring-inner-delay-multiple
|
|
18
|
-
)}:host([quiet]){--mod-coach-indicator-min-inline-size:calc(var(
|
|
19
|
-
--mod-coach-indicator-quiet-ring-diameter,
|
|
20
|
-
var(--spectrum-coach-indicator-quiet-ring-diameter)
|
|
21
|
-
)*2.75);--mod-coach-indicator-min-block-size:calc(var(
|
|
22
|
-
--mod-coach-indicator-quiet-ring-diameter,
|
|
23
|
-
var(--spectrum-coach-indicator-quiet-ring-diameter)
|
|
24
|
-
)*2.75);--mod-coach-indicator-inline-size:calc(var(
|
|
25
|
-
--mod-coach-indicator-quiet-ring-diameter,
|
|
26
|
-
var(--spectrum-coach-indicator-quiet-ring-diameter)
|
|
27
|
-
)*2.75);--mod-coach-indicator-block-size:calc(var(
|
|
28
|
-
--mod-coach-indicator-quiet-ring-diameter,
|
|
29
|
-
var(--spectrum-coach-indicator-quiet-ring-diameter)
|
|
30
|
-
)*2.75);--mod-coach-indicator-ring-inline-size:var(
|
|
31
|
-
--mod-coach-indicator-quiet-ring-diameter,var(--spectrum-coach-indicator-quiet-ring-diameter)
|
|
32
|
-
);--mod-coach-indicator-ring-block-size:var(
|
|
33
|
-
--mod-coach-indicator-quiet-ring-diameter,var(--spectrum-coach-indicator-quiet-ring-diameter)
|
|
34
|
-
);--mod-coach-indicator-top:calc(var(--mod-coach-indicator-min-inline-size)/3 - var(--spectrum-coach-indicator-ring-border-size));--mod-coach-indicator-left:calc(var(--mod-coach-indicator-min-inline-size)/3 - var(--spectrum-coach-indicator-ring-border-size));--mod-coach-indicator-animation-name:pulse--quiet;--mod-coach-indicator-inner-animation-delay-multiple:var(
|
|
35
|
-
--mod-coach-indicator-quiet-animation-ring-inner-delay-multiple,var(
|
|
36
|
-
--spectrum-coach-indicator-quiet-animation-ring-inner-delay-multiple
|
|
37
|
-
)
|
|
38
|
-
)}:host{block-size:var(
|
|
39
|
-
--mod-coach-indicator-block-size,var(--spectrum-coach-indicator-block-size)
|
|
40
|
-
);inline-size:var(
|
|
41
|
-
--mod-coach-indicator-inline-size,var(--spectrum-coach-indicator-inline-size)
|
|
42
|
-
);margin:var(--mod-coach-indicator-gap,var(--spectrum-coach-indicator-gap));min-block-size:var(
|
|
43
|
-
--mod-coach-indicator-min-block-size,var(--spectrum-coach-indicator-min-block-size)
|
|
44
|
-
);min-inline-size:var(
|
|
45
|
-
--mod-coach-indicator-min-inline-size,var(--spectrum-coach-indicator-min-inline-size)
|
|
46
|
-
);position:relative}.ring{animation:var(
|
|
47
|
-
--mod-coach-indicator-animation-name,var(--spectrum-coach-indicator-animation-name)
|
|
48
|
-
) var(
|
|
49
|
-
--mod-coach-animation-indicator-ring-duration,var(--spectrum-coach-animation-indicator-ring-duration)
|
|
50
|
-
) linear infinite;block-size:var(
|
|
51
|
-
--mod-coach-indicator-ring-block-size,var(--spectrum-coach-indicator-ring-block-size)
|
|
52
|
-
);border-color:var(
|
|
53
|
-
--mod-coach-indicator-ring-default-color,var(--spectrum-coach-indicator-ring-default-color)
|
|
54
|
-
);border-radius:50%;border-style:solid;border-width:var(
|
|
55
|
-
--mod-coach-indicator-ring-border-size,var(--spectrum-coach-indicator-ring-border-size)
|
|
56
|
-
);display:block;inline-size:var(
|
|
57
|
-
--mod-coach-indicator-ring-inline-size,var(--spectrum-coach-indicator-ring-inline-size)
|
|
58
|
-
);inset-block-start:var(
|
|
59
|
-
--mod-coach-indicator-top,var(--spectrum-coach-indicator-top)
|
|
60
|
-
);inset-inline-start:var(
|
|
61
|
-
--mod-coach-indicator-left,var(--spectrum-coach-indicator-left)
|
|
62
|
-
);position:absolute}.ring:first-child{animation-delay:calc(var(
|
|
63
|
-
--mod-coach-animation-indicator-ring-duration,
|
|
64
|
-
var(--spectrum-coach-animation-indicator-ring-duration)
|
|
65
|
-
)*var(
|
|
66
|
-
--mod-coach-indicator-inner-animation-delay-multiple,
|
|
67
|
-
var(--spectrum-coach-indicator-inner-animation-delay-multiple)
|
|
68
|
-
))}.ring:nth-child(2){animation-delay:calc(var(
|
|
69
|
-
--mod-coach-animation-indicator-ring-duration,
|
|
70
|
-
var(--spectrum-coach-animation-indicator-ring-duration)
|
|
71
|
-
)*var(
|
|
72
|
-
--mod-coach-animation-indicator-ring-center-delay-multiple,
|
|
73
|
-
var(
|
|
74
|
-
--spectrum-coach-animation-indicator-ring-center-delay-multiple
|
|
75
|
-
)
|
|
76
|
-
))}.ring:nth-child(3){animation-delay:calc(var(
|
|
77
|
-
--mod-coach-animation-indicator-ring-duration,
|
|
78
|
-
var(--spectrum-coach-animation-indicator-ring-duration)
|
|
79
|
-
)*var(
|
|
80
|
-
--mod-coach-animation-indicator-ring-outer-delay-multiple,
|
|
81
|
-
var(
|
|
82
|
-
--spectrum-coach-animation-indicator-ring-outer-delay-multiple
|
|
83
|
-
)
|
|
84
|
-
))}:host([static=white]) .ring{border-color:var(
|
|
85
|
-
--mod-coach-indicator-ring-light-color,var(--spectrum-coach-indicator-ring-light-color)
|
|
86
|
-
)}:host([static=black]) .ring{border-color:var(
|
|
87
|
-
--mod-coach-indicator-ring-dark-color,var(--spectrum-coach-indicator-ring-dark-color)
|
|
88
|
-
)}@media (prefers-reduced-motion:reduce){.ring{animation:none}}:host{display:inline-block}
|
|
4
|
+
:host{--spectrum-coach-indicator-animation-keyframe-0-scale:1;--spectrum-coach-indicator-animation-keyframe-0-opacity:0;--spectrum-coach-indicator-animation-keyframe-50-scale:1.5;--spectrum-coach-indicator-animation-keyframe-50-opacity:1;--spectrum-coach-indicator-animation-keyframe-100-scale:2;--spectrum-coach-indicator-animation-keyframe-100-opacity:0;--spectrum-coach-indicator-quiet-animation-keyframe-0-scale:.8}@keyframes pulse{0%{-webkit-transform:scale(var(--spectrum-coach-indicator-animation-keyframe-0-scale));opacity:var(--spectrum-coach-indicator-animation-keyframe-0-opacity)}50%{-webkit-transform:scale(var(--spectrum-coach-indicator-animation-keyframe-50-scale));opacity:var(--spectrum-coach-indicator-animation-keyframe-50-opacity)}to{-webkit-transform:scale(var(--spectrum-coach-indicator-animation-keyframe-100-scale));opacity:var(--spectrum-coach-indicator-animation-keyframe-100-opacity)}}@keyframes pulse--quiet{0%{-webkit-transform:scale(var(--spectrum-coach-indicator-quiet-animation-keyframe-0-scale));opacity:var(--spectrum-coach-indicator-animation-keyframe-0-opacity)}50%{-webkit-transform:scale(var(--spectrum-coach-indicator-animation-keyframe-50-scale));opacity:var(--spectrum-coach-indicator-animation-keyframe-50-opacity)}to{-webkit-transform:scale(var(--spectrum-coach-indicator-animation-keyframe-100-scale));opacity:var(--spectrum-coach-indicator-animation-keyframe-100-opacity)}}:host{--spectrum-coach-indicator-ring-border-size:var(--spectrum-border-width-200);--spectrum-coach-indicator-min-inline-size:calc(var(--spectrum-coach-indicator-ring-diameter)*3);--spectrum-coach-indicator-min-block-size:calc(var(--spectrum-coach-indicator-ring-diameter)*3);--spectrum-coach-indicator-inline-size:var(--spectrum-coach-indicator-min-inline-size);--spectrum-coach-indicator-block-size:var(--spectrum-coach-indicator-min-block-size);--spectrum-coach-indicator-ring-inline-size:var(--spectrum-coach-indicator-ring-diameter);--spectrum-coach-indicator-ring-block-size:var(--spectrum-coach-indicator-ring-diameter);--spectrum-coach-indicator-top:calc(var(--spectrum-coach-indicator-block-size)/3 - var(--spectrum-coach-indicator-ring-border-size));--spectrum-coach-indicator-left:calc(var(--spectrum-coach-indicator-inline-size)/3 - var(--spectrum-coach-indicator-ring-border-size));--spectrum-coach-animation-indicator-ring-duration:var(--spectrum-animation-duration-6000);--spectrum-coach-animation-indicator-ring-inner-delay-multiple:-.5;--spectrum-coach-animation-indicator-ring-center-delay-multiple:-.66;--spectrum-coach-animation-indicator-ring-outer-delay-multiple:-1;--spectrum-coach-indicator-quiet-animation-ring-inner-delay-multiple:-.33;--spectrum-coach-indicator-animation-name:pulse;--spectrum-coach-indicator-inner-animation-delay-multiple:var(--spectrum-coach-animation-indicator-ring-inner-delay-multiple)}:host([quiet]){--mod-coach-indicator-min-inline-size:calc(var(--mod-coach-indicator-quiet-ring-diameter,var(--spectrum-coach-indicator-quiet-ring-diameter))*2.75);--mod-coach-indicator-min-block-size:calc(var(--mod-coach-indicator-quiet-ring-diameter,var(--spectrum-coach-indicator-quiet-ring-diameter))*2.75);--mod-coach-indicator-inline-size:calc(var(--mod-coach-indicator-quiet-ring-diameter,var(--spectrum-coach-indicator-quiet-ring-diameter))*2.75);--mod-coach-indicator-block-size:calc(var(--mod-coach-indicator-quiet-ring-diameter,var(--spectrum-coach-indicator-quiet-ring-diameter))*2.75);--mod-coach-indicator-ring-inline-size:var(--mod-coach-indicator-quiet-ring-diameter,var(--spectrum-coach-indicator-quiet-ring-diameter));--mod-coach-indicator-ring-block-size:var(--mod-coach-indicator-quiet-ring-diameter,var(--spectrum-coach-indicator-quiet-ring-diameter));--mod-coach-indicator-top:calc(var(--mod-coach-indicator-min-inline-size)/3 - var(--spectrum-coach-indicator-ring-border-size));--mod-coach-indicator-left:calc(var(--mod-coach-indicator-min-inline-size)/3 - var(--spectrum-coach-indicator-ring-border-size));--mod-coach-indicator-animation-name:pulse--quiet;--mod-coach-indicator-inner-animation-delay-multiple:var(--mod-coach-indicator-quiet-animation-ring-inner-delay-multiple,var(--spectrum-coach-indicator-quiet-animation-ring-inner-delay-multiple))}:host{margin:var(--mod-coach-indicator-gap,var(--spectrum-coach-indicator-gap));min-inline-size:var(--mod-coach-indicator-min-inline-size,var(--spectrum-coach-indicator-min-inline-size));min-block-size:var(--mod-coach-indicator-min-block-size,var(--spectrum-coach-indicator-min-block-size));inline-size:var(--mod-coach-indicator-inline-size,var(--spectrum-coach-indicator-inline-size));block-size:var(--mod-coach-indicator-block-size,var(--spectrum-coach-indicator-block-size));position:relative}.ring{border-style:solid;border-width:var(--mod-coach-indicator-ring-border-size,var(--spectrum-coach-indicator-ring-border-size));border-color:var(--mod-coach-indicator-ring-default-color,var(--spectrum-coach-indicator-ring-default-color));inline-size:var(--mod-coach-indicator-ring-inline-size,var(--spectrum-coach-indicator-ring-inline-size));block-size:var(--mod-coach-indicator-ring-block-size,var(--spectrum-coach-indicator-ring-block-size));animation:var(--mod-coach-indicator-animation-name,var(--spectrum-coach-indicator-animation-name))var(--mod-coach-animation-indicator-ring-duration,var(--spectrum-coach-animation-indicator-ring-duration))linear infinite;border-radius:50%;display:block;position:absolute;inset-block-start:var(--mod-coach-indicator-top,var(--spectrum-coach-indicator-top));inset-inline-start:var(--mod-coach-indicator-left,var(--spectrum-coach-indicator-left))}.ring:first-child{animation-delay:calc(var(--mod-coach-animation-indicator-ring-duration,var(--spectrum-coach-animation-indicator-ring-duration))*var(--mod-coach-indicator-inner-animation-delay-multiple,var(--spectrum-coach-indicator-inner-animation-delay-multiple)))}.ring:nth-child(2){animation-delay:calc(var(--mod-coach-animation-indicator-ring-duration,var(--spectrum-coach-animation-indicator-ring-duration))*var(--mod-coach-animation-indicator-ring-center-delay-multiple,var(--spectrum-coach-animation-indicator-ring-center-delay-multiple)))}.ring:nth-child(3){animation-delay:calc(var(--mod-coach-animation-indicator-ring-duration,var(--spectrum-coach-animation-indicator-ring-duration))*var(--mod-coach-animation-indicator-ring-outer-delay-multiple,var(--spectrum-coach-animation-indicator-ring-outer-delay-multiple)))}:host([static=white]) .ring{border-color:var(--mod-coach-indicator-ring-light-color,var(--spectrum-coach-indicator-ring-light-color))}:host([static=black]) .ring{border-color:var(--mod-coach-indicator-ring-dark-color,var(--spectrum-coach-indicator-ring-dark-color))}@media (prefers-reduced-motion:reduce){.ring{animation:none}}:host{display:inline-block}
|
|
89
5
|
`;
|
|
90
6
|
export default styles;
|
|
91
7
|
//# sourceMappingURL=coach-indicator.css.dev.js.map
|