Skip to content

Commit 531f105

Browse files
committed
Added component PFooterHelp
1 parent fe42fa3 commit 531f105

File tree

8 files changed

+125
-3
lines changed

8 files changed

+125
-3
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"component library"
1919
],
2020
"license": "MIT",
21-
"version": "2.1.9",
21+
"version": "2.2.0",
2222
"scripts": {
2323
"serve": "vue-cli-service serve",
2424
"build": "vue-cli-service build",
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
PLink example:
2+
3+
Internal Link
4+
```vue
5+
<PFooterHelp>Learn more about fulfilling orders</PFooterHelp>
6+
```
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<template>
2+
<div :class="className">
3+
<div class="Polaris-FooterHelp__Content">
4+
<slot name="icon">
5+
<div class="Polaris-FooterHelp__Icon">
6+
<PIcon color="teal" source="CircleInformationMajorMonotone" />
7+
</div>
8+
</slot>
9+
<div class="Polaris-FooterHelp__Text">
10+
<slot/>
11+
</div>
12+
</div>
13+
</div>
14+
</template>
15+
16+
<script lang="ts">
17+
import {Component, Vue, Prop} from 'vue-property-decorator';
18+
import {classNames, variationName} from '@/utilities/css';
19+
import {PIcon} from '@/components/PIcon';
20+
21+
@Component({
22+
components: { PIcon },
23+
})
24+
25+
export default class PFooterHelp extends Vue {
26+
27+
@Prop(String) public id!: string;
28+
@Prop(String) public url!: string;
29+
@Prop(String) public to!: string;
30+
@Prop(Boolean) public external!: boolean;
31+
@Prop(Boolean) public monochrome!: boolean;
32+
33+
public get isStringSlot() {
34+
35+
const slots = (this.$slots.default || []);
36+
return this.external && slots.length === 1 && slots[0].text;
37+
}
38+
39+
public get className() {
40+
return classNames(
41+
'Polaris-FooterHelp',
42+
);
43+
}
44+
}
45+
</script>

src/components/PFooterHelp/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import PFooterHelp from './PFooterHelp.vue';
2+
export { PFooterHelp };

src/components/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ import { PDatePicker } from './PDatePicker';
5252
import { PMediaCard } from './PMediaCard';
5353
import { PChart } from './PChart';
5454
import { PEmptyState } from './PEmptyState';
55+
import { PFooterHelp } from './PFooterHelp';
5556
import VTooltip from 'v-tooltip'
5657

5758
import '@/scss/main.scss';
@@ -111,6 +112,7 @@ const Components = {
111112
PMediaCard,
112113
PChart,
113114
PEmptyState,
115+
PFooterHelp
114116
};
115117

116118
const PolarisVue = {

src/css/footer_help.scss

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
2+
.Polaris-FooterHelp {
3+
display: flex;
4+
justify-content: center;
5+
margin: 2rem 0;
6+
width: 100%;
7+
}
8+
9+
@media (max-width: 48.0625em) and (min-width: 30.625em), (min-width: 45.625em) {
10+
[data-has-navigation] .Polaris-FooterHelp {
11+
margin: 2rem;
12+
width: auto;
13+
}
14+
}
15+
16+
@media (min-width: 30.625em) {
17+
.Polaris-FooterHelp {
18+
margin: 2rem;
19+
width: auto;
20+
}
21+
}
22+
23+
.Polaris-FooterHelp__Content {
24+
display: inline-flex;
25+
align-items: center;
26+
padding: 2rem 2rem 2rem 1.6rem;
27+
border-top: var(--p-override-none, 0.1rem solid var(--p-border-subdued));
28+
border-bottom: var(--p-override-none, 0.1rem solid var(--p-border-subdued));
29+
width: 100%;
30+
justify-content: center;
31+
}
32+
33+
@media (max-width: 48.0625em) and (min-width: 30.625em), (min-width: 45.625em) {
34+
[data-has-navigation] .Polaris-FooterHelp__Content {
35+
width: auto;
36+
border: var(--p-override-none, 0.1rem solid var(--p-border-subdued));
37+
border-radius: var(--p-override-none, 999px);
38+
}
39+
}
40+
41+
@media (min-width: 30.625em) {
42+
.Polaris-FooterHelp__Content {
43+
width: auto;
44+
border: var(--p-override-none, 0.1rem solid var(--p-border-subdued));
45+
border-radius: var(--p-override-none, 999px);
46+
}
47+
}
48+
49+
.Polaris-FooterHelp__Icon {
50+
margin-right: 0.8rem;
51+
}
52+
53+
.Polaris-FooterHelp__Text {
54+
font-size: 1.6rem;
55+
font-weight: 400;
56+
line-height: 2.4rem;
57+
border: none;
58+
text-transform: initial;
59+
letter-spacing: initial;
60+
}
61+
62+
@media (min-width: 40em) {
63+
.Polaris-FooterHelp__Text {
64+
font-size: 1.4rem;
65+
}
66+
}

src/css/polaris.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,5 @@
3333
@import 'general';
3434
@import 'link';
3535
@import 'page';
36-
@import 'emptystate';
36+
@import 'emptystate';
37+
@import 'footer_help';

0 commit comments

Comments
 (0)