@salesforcedevs/dx-components 0.25.2 → 0.26.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/lwc.config.json CHANGED
@@ -63,8 +63,8 @@
63
63
  "dx/select",
64
64
  "dx/sidebar",
65
65
  "dx/sidebarOld",
66
+ "dx/skipNavLink",
66
67
  "dx/slackCta",
67
- "dx/slackButton",
68
68
  "dx/socials",
69
69
  "dx/toc",
70
70
  "dx/tree",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dx-components",
3
- "version": "0.25.2",
3
+ "version": "0.26.0",
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": "66db495d67f1b7280ad0946332910f38c563d39b"
32
+ "gitHead": "e3cf39d3be484acbf9bae459659f6e65f1f932cf"
33
33
  }
@@ -1,7 +1,8 @@
1
1
  <template>
2
2
  <dx-brand-theme-provider brand={brand}>
3
3
  <header class={className}>
4
- <dx-banner
4
+ <dx-skip-nav-link></dx-skip-nav-link>
5
+ <dx-banner
5
6
  if:true={bannerMarkup}
6
7
  banner-markup={bannerMarkup}
7
8
  ></dx-banner>
@@ -0,0 +1,21 @@
1
+ @import "helpers/text";
2
+
3
+ a {
4
+ left: 0;
5
+ top: 0;
6
+ position: absolute;
7
+ padding: 0 var(--dx-g-spacing-mlg);
8
+ height: var(--dx-g-spacing-3xl);
9
+ transform: translateY(-1000%);
10
+ background: var(--dx-g-indigo-natural-20);
11
+ border-radius: 0 5px 5px 0;
12
+ z-index: 100000000;
13
+ text-decoration: none;
14
+ display: flex;
15
+ justify-content: center;
16
+ align-items: center;
17
+ }
18
+
19
+ a:focus {
20
+ transform: translateY(var(--dx-g-spacing-xl));
21
+ }
@@ -0,0 +1,3 @@
1
+ <template>
2
+ <a class="dx-text-button-light" href="#maincontent">Skip Navigation</a>
3
+ </template>
@@ -0,0 +1,3 @@
1
+ import { LightningElement } from "lwc";
2
+
3
+ export default class SkipNavLink extends LightningElement {}
@@ -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(".slack-cta-btn");
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-size: 40% 40%;
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
- <dx-slack-button class="slack-cta-btn">{innerText}</dx-slack-button>
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&amp;user_scope=&amp;redirect_uri=https%3A%2F%2Fdsc-slack-app.herokuapp.com%2Fslack%2Foauth_redirect&amp;client_id=1814240140212.2864842743411"
12
+ class="button"
13
+ >
14
+ {innerText}
15
+ </dx-button>
5
16
  </div>
6
17
  </template>
@@ -21,7 +21,7 @@ header {
21
21
  position: relative;
22
22
  }
23
23
 
24
- header > * {
24
+ header > *:not(dx-skip-nav-link) {
25
25
  width: 100%;
26
26
  display: flex;
27
27
  flex-direction: row;
@@ -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&amp;user_scope=&amp;redirect_uri=https%3A%2F%2Fdsc-slack-app.herokuapp.com%2Fslack%2Foauth_redirect&amp;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
- `;
@@ -1,3 +0,0 @@
1
- import { LightningElement } from "lwc";
2
-
3
- export default class SlackAdd extends LightningElement {}