@salesforcedevs/dx-components 0.25.1 → 0.25.5
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/lwc.config.json +0 -1
- package/package.json +2 -2
- package/src/modules/dx/groupText/groupText.stories.ts +1 -1
- package/src/modules/dx/sidebar/sidebar.stories.ts +4 -1
- package/src/modules/dx/slackCta/__tests__/slackCta.test.ts +3 -7
- package/src/modules/dx/slackCta/slackCta.css +5 -10
- package/src/modules/dx/slackCta/slackCta.html +12 -1
- package/src/modules/dx/toc/__tests__/mockProps.ts +6 -0
- package/src/modules/dx/toc/toc.css +1 -0
- package/src/assets/svg/slack-logo.svg +0 -6
- package/src/modules/dx/slackButton/__tests__/slackButton.test.ts +0 -20
- package/src/modules/dx/slackButton/slackButton.css +0 -43
- package/src/modules/dx/slackButton/slackButton.html +0 -14
- package/src/modules/dx/slackButton/slackButton.stories.ts +0 -21
- package/src/modules/dx/slackButton/slackButton.ts +0 -3
package/lwc.config.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/dx-components",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.5",
|
|
4
4
|
"description": "DX Lightning web components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"@types/debounce": "^1.2.0",
|
|
30
30
|
"@types/lodash.get": "^4.4.6"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "df6cab7fd62a3d7bcb6796f0f16c17088682b0e9"
|
|
33
33
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { html } from "lit-html";
|
|
2
2
|
import mockProps from "./__tests__/mockProps";
|
|
3
3
|
import featureListMockProps from "../featuresList/__tests__/mockProps";
|
|
4
|
-
import { renderStyle } from "../../utils/storybook/storybook";
|
|
4
|
+
import { renderStyle } from "../../utils-internal/storybook/storybook";
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title: "dx/dx-group-text",
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { html } from "lit-html";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
coveoXMLDocsConfig,
|
|
4
|
+
coveoSFDocsConfig
|
|
5
|
+
} from "../../utils-internal/coveo/coveo";
|
|
3
6
|
import { SAMPLE_TREES, SAMPLE_TREES_WITH_METHODS } from "./__tests__/mockProps";
|
|
4
7
|
|
|
5
8
|
export default {
|
|
@@ -8,7 +8,7 @@ describe(TAG, () => {
|
|
|
8
8
|
it("renders the button linking to slack", () => {
|
|
9
9
|
const element = render();
|
|
10
10
|
|
|
11
|
-
const slackBtn = element.shadowRoot.querySelectorAll(".
|
|
11
|
+
const slackBtn = element.shadowRoot.querySelectorAll(".button");
|
|
12
12
|
expect(slackBtn).not.toBe(undefined);
|
|
13
13
|
return expect(slackBtn.length).toBe(1);
|
|
14
14
|
});
|
|
@@ -28,9 +28,7 @@ describe(TAG, () => {
|
|
|
28
28
|
.item(0);
|
|
29
29
|
expect(header.textContent).toBe("Follow along with Slackfoobar");
|
|
30
30
|
|
|
31
|
-
const slackBtn = element.shadowRoot
|
|
32
|
-
.querySelectorAll(".slack-cta-btn")
|
|
33
|
-
.item(0);
|
|
31
|
+
const slackBtn = element.shadowRoot.querySelectorAll(".button").item(0);
|
|
34
32
|
return expect(slackBtn.textContent).toBe("foobar");
|
|
35
33
|
});
|
|
36
34
|
|
|
@@ -39,9 +37,7 @@ describe(TAG, () => {
|
|
|
39
37
|
headerText: "foobar"
|
|
40
38
|
});
|
|
41
39
|
|
|
42
|
-
const slackBtn = element.shadowRoot
|
|
43
|
-
.querySelectorAll(".slack-cta-btn")
|
|
44
|
-
.item(0);
|
|
40
|
+
const slackBtn = element.shadowRoot.querySelectorAll(".button").item(0);
|
|
45
41
|
expect(slackBtn.textContent).toBe("Add to Slack");
|
|
46
42
|
|
|
47
43
|
const header = element.shadowRoot
|
|
@@ -11,11 +11,14 @@
|
|
|
11
11
|
text-align: center;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
.button {
|
|
15
|
+
padding: 10px;
|
|
16
|
+
}
|
|
17
|
+
|
|
14
18
|
.podcast {
|
|
15
19
|
background-image: url("/assets/svg/slack-cta-podcast-background-left.svg"),
|
|
16
20
|
url("/assets/svg/slack-cta-podcast-background-right.svg");
|
|
17
|
-
background-
|
|
18
|
-
background-position: 5% 25%, 95% 75%;
|
|
21
|
+
background-position: 20% 25%, 80% 75%;
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
.dx-text-heading-4 {
|
|
@@ -24,14 +27,6 @@
|
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
@media screen and (max-width: 768px) {
|
|
27
|
-
.container {
|
|
28
|
-
background-position: -100% 25%, 180% 75%;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.podcast.container {
|
|
32
|
-
background-size: 75% 60%;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
30
|
.dx-text-heading-4 {
|
|
36
31
|
max-width: 28ex;
|
|
37
32
|
font-size: var(--dx-g-text-lg);
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class={containerClass}>
|
|
3
3
|
<h2 class="dx-text-heading-4">{headerText}</h2>
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
<dx-button
|
|
6
|
+
size="large"
|
|
7
|
+
variant="secondary"
|
|
8
|
+
icon-symbol="slack"
|
|
9
|
+
icon-sprite="salesforcebrand"
|
|
10
|
+
icon-position="left"
|
|
11
|
+
href="https://slack.com/oauth/v2/authorize?scope=chat%3Awrite%2Ccommands&user_scope=&redirect_uri=https%3A%2F%2Fdsc-slack-app.herokuapp.com%2Fslack%2Foauth_redirect&client_id=1814240140212.2864842743411"
|
|
12
|
+
class="button"
|
|
13
|
+
>
|
|
14
|
+
{innerText}
|
|
15
|
+
</dx-button>
|
|
5
16
|
</div>
|
|
6
17
|
</template>
|
|
@@ -17,6 +17,12 @@ export default {
|
|
|
17
17
|
"Why build on Quip? This is an extra long blurb to test the toc wrapping ability",
|
|
18
18
|
id: "quip",
|
|
19
19
|
anchor: "#test3"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
label:
|
|
23
|
+
"SomeLongExampleWordWithoutAnyBreaks and Then a Word",
|
|
24
|
+
id: "long-word",
|
|
25
|
+
anchor: "#test4"
|
|
20
26
|
}
|
|
21
27
|
]
|
|
22
28
|
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" style="height:20px;width:20px;margin-right:12px" viewBox="0 0 122.8 122.8">
|
|
2
|
-
<path d="M25.8 77.6c0 7.1-5.8 12.9-12.9 12.9S0 84.7 0 77.6s5.8-12.9 12.9-12.9h12.9v12.9zm6.5 0c0-7.1 5.8-12.9 12.9-12.9s12.9 5.8 12.9 12.9v32.3c0 7.1-5.8 12.9-12.9 12.9s-12.9-5.8-12.9-12.9V77.6z" fill="#e01e5a"></path>
|
|
3
|
-
<path d="M45.2 25.8c-7.1 0-12.9-5.8-12.9-12.9S38.1 0 45.2 0s12.9 5.8 12.9 12.9v12.9H45.2zm0 6.5c7.1 0 12.9 5.8 12.9 12.9s-5.8 12.9-12.9 12.9H12.9C5.8 58.1 0 52.3 0 45.2s5.8-12.9 12.9-12.9h32.3z" fill="#36c5f0"></path>
|
|
4
|
-
<path d="M97 45.2c0-7.1 5.8-12.9 12.9-12.9s12.9 5.8 12.9 12.9-5.8 12.9-12.9 12.9H97V45.2zm-6.5 0c0 7.1-5.8 12.9-12.9 12.9s-12.9-5.8-12.9-12.9V12.9C64.7 5.8 70.5 0 77.6 0s12.9 5.8 12.9 12.9v32.3z" fill="#2eb67d"></path>
|
|
5
|
-
<path d="M77.6 97c7.1 0 12.9 5.8 12.9 12.9s-5.8 12.9-12.9 12.9-12.9-5.8-12.9-12.9V97h12.9zm0-6.5c-7.1 0-12.9-5.8-12.9-12.9s5.8-12.9 12.9-12.9h32.3c7.1 0 12.9 5.8 12.9 12.9s-5.8 12.9-12.9 12.9H77.6z" fill="#ecb22e"></path>
|
|
6
|
-
</svg>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import slackButton from "dx/slackButton";
|
|
2
|
-
import { createRenderComponent } from "utils-internal/tests";
|
|
3
|
-
|
|
4
|
-
const TAG = "dx-slack-button";
|
|
5
|
-
const render = createRenderComponent(TAG, slackButton);
|
|
6
|
-
|
|
7
|
-
describe(TAG, () => {
|
|
8
|
-
it("renders the button linking to slack", () => {
|
|
9
|
-
const element = render();
|
|
10
|
-
|
|
11
|
-
const slackBtn = element.shadowRoot.querySelectorAll(".slack-btn a");
|
|
12
|
-
expect(slackBtn).not.toBe(undefined);
|
|
13
|
-
return expect(slackBtn.length).toBe(1);
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
it("renders a button meeting all accesibilty requirements", () => {
|
|
17
|
-
const element = render();
|
|
18
|
-
return expect(element).toBeAccessible();
|
|
19
|
-
});
|
|
20
|
-
});
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
@import "helpers/reset";
|
|
2
|
-
@import "helpers/text";
|
|
3
|
-
|
|
4
|
-
.slack-cta-button {
|
|
5
|
-
align-items: center;
|
|
6
|
-
background-color: #fff;
|
|
7
|
-
border: 2px solid rgb(1, 118, 211);
|
|
8
|
-
border-radius: 4px;
|
|
9
|
-
display: inline-flex;
|
|
10
|
-
height: 48px;
|
|
11
|
-
justify-content: center;
|
|
12
|
-
text-decoration: none;
|
|
13
|
-
padding: 10px;
|
|
14
|
-
color: rgb(1, 118, 211);
|
|
15
|
-
font-size: 14px;
|
|
16
|
-
font-weight: 500;
|
|
17
|
-
letter-spacing: 0;
|
|
18
|
-
line-height: 20px;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
@media screen and (max-width: 768px) {
|
|
22
|
-
.slack-btn a {
|
|
23
|
-
display: inline-flex;
|
|
24
|
-
margin: 4px auto;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.slack-btn img {
|
|
28
|
-
height: 20px;
|
|
29
|
-
padding-right: 10px;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
@media screen and (min-width: 768px) {
|
|
34
|
-
.slack-btn a {
|
|
35
|
-
display: inline-flex;
|
|
36
|
-
margin: 22px 13px 8px 13px;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.slack-btn img {
|
|
40
|
-
height: 20px;
|
|
41
|
-
padding-right: 10px;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="slack-btn">
|
|
3
|
-
<a
|
|
4
|
-
class="slack-cta-button"
|
|
5
|
-
href="https://slack.com/oauth/v2/authorize?scope=chat%3Awrite%2Ccommands&user_scope=&redirect_uri=https%3A%2F%2Fdsc-slack-app.herokuapp.com%2Fslack%2Foauth_redirect&client_id=1814240140212.2864842743411"
|
|
6
|
-
>
|
|
7
|
-
<img
|
|
8
|
-
src="/assets/svg/slack-logo.svg"
|
|
9
|
-
alt="install slack extension"
|
|
10
|
-
/>
|
|
11
|
-
<slot></slot>
|
|
12
|
-
</a>
|
|
13
|
-
</div>
|
|
14
|
-
</template>
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
title: "dx/dx-slack-button",
|
|
3
|
-
component: "dx-slack-button"
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
const createStyles = () => `
|
|
7
|
-
<style>
|
|
8
|
-
h2 {
|
|
9
|
-
font-weight: bold;
|
|
10
|
-
font-size: 24px;
|
|
11
|
-
margin: 10px 0 30px 0;
|
|
12
|
-
}
|
|
13
|
-
</style>
|
|
14
|
-
`;
|
|
15
|
-
|
|
16
|
-
export const Base = () => `
|
|
17
|
-
${createStyles()}
|
|
18
|
-
<h2>Slack Button</h2>
|
|
19
|
-
|
|
20
|
-
<dx-slack-button>Slack</dx-slack-button>
|
|
21
|
-
`;
|