Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Share component code cleanup and refactor #848

Merged
merged 34 commits into from
Sep 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
1efe02f
fix: remove CSS and standardize props
mikemai2awesome Aug 16, 2018
9625d58
chore: remove quotes in schema
mikemai2awesome Aug 16, 2018
d3a7714
Merge branch 'master' into feature/bds-311-share-component-refactor
mikemai2awesome Aug 22, 2018
e225f3f
Merge branch 'feature/bolt-list' into feature/bds-311-share-component…
mikemai2awesome Aug 22, 2018
b26a991
styles: share links
mikemai2awesome Aug 23, 2018
e306033
docs: clean up doc pages
mikemai2awesome Aug 23, 2018
e272718
Merge branch 'master' into feature/bds-311-share-component-refactor
mikemai2awesome Aug 23, 2018
1f42fd0
fix: update js
mikemai2awesome Aug 23, 2018
4be80f0
fix: remove certain theme colors
mikemai2awesome Aug 23, 2018
29a09b6
fix: inline attribute
mikemai2awesome Aug 24, 2018
ae6ae7c
Merge branch 'master' into feature/bds-311-share-component-refactor
mikemai2awesome Aug 24, 2018
a787d29
fix: create variables to merge with
mikemai2awesome Aug 24, 2018
8109cca
Merge branch 'master' into feature/bds-311-share-component-refactor
mikemai2awesome Aug 27, 2018
3ff5a54
chore: set up innerattributes
mikemai2awesome Aug 27, 2018
c1b0bd2
fix: background animation transform fix
mikemai2awesome Aug 27, 2018
0dbb888
fix: deprecate copyToClipboard and standardize variable names
mikemai2awesome Aug 29, 2018
46ad1d1
fix: make inline the default
mikemai2awesome Aug 29, 2018
75579c3
styles: convert to small size
mikemai2awesome Aug 30, 2018
1629b0a
fix: boolean statement
mikemai2awesome Aug 30, 2018
cfb672a
fix: boolean statement default
remydenton Aug 30, 2018
d5146e5
styles: adding size and opacity options
mikemai2awesome Sep 18, 2018
f514843
styles: size option updates
mikemai2awesome Sep 19, 2018
42d6ba1
docs: adding theming demos
mikemai2awesome Sep 19, 2018
11ebbec
docs: improve theme demos
mikemai2awesome Sep 19, 2018
870918d
Merge branch 'master' into feature/bds-311-share-component-refactor
mikemai2awesome Sep 19, 2018
02e3733
Merge remote-tracking branch 'origin/release/2.x' into feature/bds-31…
mikemai2awesome Sep 19, 2018
e1c42d2
chore: convert label color to use new theming system
mikemai2awesome Sep 19, 2018
79330d2
Merge commit 'fc02d98550aa9b95f54a2ff042b9b9ee39900c54' into feature/…
remydenton Sep 21, 2018
5226955
chore: remove medium theme
mikemai2awesome Sep 21, 2018
e97d4ba
chore: convert to new copy to clipboard
mikemai2awesome Sep 24, 2018
72f4ea0
chore: removing button version and other code clean up
mikemai2awesome Sep 25, 2018
9bcabb5
chore: schema comments
mikemai2awesome Sep 25, 2018
6a7aff7
fix: more clean up
mikemai2awesome Sep 25, 2018
45262a9
Merge branch 'master' into feature/bds-311-share-component-refactor
remydenton Sep 26, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions apps/bolt-site/templates/_site-head.twig
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,22 @@
<meta name="msapplication-config" content="/browserconfig.xml?v=LbyzAXRqNz">
<meta name="theme-color" content="#1f2656">

<!-- Default OG Tag examples (related to Bolt Share Component) -->
{% include "@bolt-components-share/src/_share-meta-example.twig" %}
<!-- OG Tags -->
<meta property="og:type" content="article" />
<meta property="og:title" content="Bolt Design System: Page Title" />
<meta property="og:description" content="Sample description" />
<meta property="og:image" content="https://boltdesignsystem.com/images/500x500-480.jpg" />
<meta property="og:image:type" content="image/jpeg" />
<meta property="og:image:width" content="480" />
<meta property="og:image:height" content="480" />
<meta property="og:url" content="https://boltdesignsystem.com/some-page-title-here" />
<meta property="og:site_name" content="Bolt Design System" />
<!-- Twitter specific tags -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="Bolt Design System: Page Title" />
<meta name="twitter:description" content="Sample description" />
<meta name="twitter:image" content="https://boltdesignsystem.com/images/500x500-480.jpg" />
<meta name="twitter:site" content="@pega" />

<link rel="stylesheet" href="{{ assets["bolt-global.css"] | default("/build/bolt-global.css") }}" media="all" />

Expand All @@ -54,4 +68,4 @@
</script>

</head>
<body class="c-bds-layout c-bolt-site {% if currentUrl == 'index.html' %} t-bolt-xdark {% endif %} c-bds-layout--{{ urlChunks | length >= 2 ? urlChunks|first : 'parent' }} {{ hasSidebar ? 'c-bds-layout--has-sidebar' : ''}}">
<body class="c-bds-layout c-bolt-site {% if currentUrl == 'index.html' %} t-bolt-xdark {% endif %} c-bds-layout--{{ urlChunks | length >= 2 ? urlChunks|first : 'parent' }} {{ hasSidebar ? 'c-bds-layout--has-sidebar' : ''}}">
18 changes: 16 additions & 2 deletions apps/pattern-lab/src/_meta/_00-head.twig
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,22 @@
<meta name="msapplication-config" content="/browserconfig.xml?v=LbyzAXRqNz">
<meta name="theme-color" content="#1f2656">

<!-- Default OG Tag examples (related to Bolt Share Component) -->
{% include "@bolt-components-share/src/_share-meta-example.twig" %}
<!-- OG Tags -->
<meta property="og:type" content="article" />
<meta property="og:title" content="Bolt Design System: Page Title" />
<meta property="og:description" content="Sample description" />
<meta property="og:image" content="https://boltdesignsystem.com/images/500x500-480.jpg" />
<meta property="og:image:type" content="image/jpeg" />
<meta property="og:image:width" content="480" />
<meta property="og:image:height" content="480" />
<meta property="og:url" content="https://boltdesignsystem.com/some-page-title-here" />
<meta property="og:site_name" content="Bolt Design System" />
<!-- Twitter specific tags -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="Bolt Design System: Page Title" />
<meta name="twitter:description" content="Sample description" />
<meta name="twitter:image" content="https://boltdesignsystem.com/images/500x500-480.jpg" />
<meta name="twitter:site" content="@pega" />

<!-- async load PL's CSS -->
<link rel="preload" href="/pattern-lab/styleguide/css/pattern-lab.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set usage %}{% verbatim %}
{% include '@bolt-components-share/share.twig' with {
{% include "@bolt-components-share/share.twig" with {
sources: [
{
name: "facebook",
Expand All @@ -18,7 +18,7 @@
url: "mailto:?&body=Sample%20Text%20--%20https%3A//bolt-design-system.com"
}
],
copyToClipboard: {
copy_to_clipboard: {
text_to_copy: "http://pega.com"
}
} only %}
Expand Down
46 changes: 22 additions & 24 deletions apps/pattern-lab/src/_patterns/02-components/share/05-share.twig
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
<div style="margin: 0 auto; width: 100%; padding: 25rem 0 0;">
{% include '@bolt-components-share/share.twig' with {
sources: [
{
name: "facebook",
url: "https://www.facebook.com/sharer/sharer.php?u=https://5abd3062df99537b79e29496--bolt-design-system.netlify.com/pattern-lab/patterns/02-components-action-blocks-05-action-blocks/02-components-action-blocks-05-action-blocks.html&amp;src=sdkpreparse"
},
{
name: "twitter",
url: "https://twitter.com/intent/tweet?url=https://bolt-design-system.com&text=Sample%20Share%20Text&via=pega&hashtags=boltDesignSystemRocks!"
},
{
name: "linkedin",
url: "https://www.linkedin.com/shareArticle?url=https://5abd3062df99537b79e29496--bolt-design-system.netlify.com/pattern-lab/patterns/02-components-action-blocks-05-action-blocks/02-components-action-blocks-05-action-blocks.html"
},
{
name: "email",
url: "mailto:?&body=Sample%20Text%20--%20https%3A//bolt-design-system.com"
}
],
copyToClipboard: {
text_to_copy: "http://pega.com"
{% include "@bolt-components-share/share.twig" with {
sources: [
{
name: "facebook",
url: "https://www.facebook.com/sharer/sharer.php?u=https://boltdesignsystem.com&amp;src=sdkpreparse"
},
{
name: "twitter",
url: "https://twitter.com/intent/tweet?url=https://boltdesignsystem.com&text=Sample%20Share%20Text&via=pega&hashtags=boltDesignSystemRocks!"
},
{
name: "linkedin",
url: "https://www.linkedin.com/shareArticle?url=https://boltdesignsystem.com"
},
{
name: "email",
url: "mailto:?&body=Sample%20Text%20--%20https%3A//boltdesignsystem.com"
}
} only %}
</div>
],
copy_to_clipboard: {
text_to_copy: "http://boltdesignsystem.com"
},
} only %}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{% set schema = bolt.data.components["@bolt-components-share"].schema %}

{% for size in schema.properties.size.enum %}
<h3>{{ size|capitalize }} Size</h3>
{% include "@bolt-components-share/share.twig" with {
size: size,
sources: [
{
name: "facebook",
url: "https://www.facebook.com/sharer/sharer.php?u=https://boltdesignsystem.com&amp;src=sdkpreparse"
},
{
name: "twitter",
url: "https://twitter.com/intent/tweet?url=https://boltdesignsystem.com&text=Sample%20Share%20Text&via=pega&hashtags=boltDesignSystemRocks!"
},
{
name: "linkedin",
url: "https://www.linkedin.com/shareArticle?url=https://boltdesignsystem.com"
},
{
name: "email",
url: "mailto:?&body=Sample%20Text%20--%20https%3A//boltdesignsystem.com"
}
],
copy_to_clipboard: {
text_to_copy: "http://boltdesignsystem.com/#share-size"
}
} only %}
{% endfor %}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{% set schema = bolt.data.components["@bolt-components-share"].schema %}

<p><mark>Opacity will make the share tool semi-transparent, and transparency goes away if user hovers over it. This should be used if you don't want the share tool to create too much distractions on first impression.</mark></p>

{% for opacity in schema.properties.opacity.enum %}
<h3>Opacity: {{ opacity|capitalize }}</h3>
{% include "@bolt-components-share/share.twig" with {
opacity: opacity,
sources: [
{
name: "facebook",
url: "https://www.facebook.com/sharer/sharer.php?u=https://boltdesignsystem.com&amp;src=sdkpreparse"
},
{
name: "twitter",
url: "https://twitter.com/intent/tweet?url=https://boltdesignsystem.com&text=Sample%20Share%20Text&via=pega&hashtags=boltDesignSystemRocks!"
},
{
name: "linkedin",
url: "https://www.linkedin.com/shareArticle?url=https://boltdesignsystem.com"
},
{
name: "email",
url: "mailto:?&body=Sample%20Text%20--%20https%3A//boltdesignsystem.com"
}
],
copyToClipboard: {
text_to_copy: "http://boltdesignsystem.com/#share-opacity"
}
} only %}
{% endfor %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{% include "@bolt-components-share/share.twig" with {
text: "Custom label",
sources: [
{
name: "facebook",
url: "https://www.facebook.com/sharer/sharer.php?u=https://boltdesignsystem.com&amp;src=sdkpreparse"
},
{
name: "twitter",
url: "https://twitter.com/intent/tweet?url=https://boltdesignsystem.com&text=Sample%20Share%20Text&via=pega&hashtags=boltDesignSystemRocks!"
},
{
name: "linkedin",
url: "https://www.linkedin.com/shareArticle?url=https://boltdesignsystem.com"
},
{
name: "email",
url: "mailto:?&body=Sample%20Text%20--%20https%3A//boltdesignsystem.com"
}
],
copy_to_clipboard: {
text_to_copy: "http://boltdesignsystem.com/#share-label"
}
} only %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{% set schema = bolt.data.components["@bolt-components-share"].schema %}
{% set themes = get_data("@bolt/themes.schema.json") %}

{% for theme in themes.properties.colors.enum %}
<h3>{{ theme }}</h3>
<div class="u-bolt-margin-bottom-medium">
{% embed "@utils/theme-demo.twig" %}
{% block demo_content %}
{% for size in schema.properties.size.enum %}
{% include "@bolt-components-share/share.twig" with {
size: size,
sources: [
{
name: "facebook",
url: "https://www.facebook.com/sharer/sharer.php?u=https://boltdesignsystem.com&amp;src=sdkpreparse"
},
{
name: "twitter",
url: "https://twitter.com/intent/tweet?url=https://boltdesignsystem.com&text=Sample%20Share%20Text&via=pega&hashtags=boltDesignSystemRocks!"
},
{
name: "linkedin",
url: "https://www.linkedin.com/shareArticle?url=https://boltdesignsystem.com"
},
{
name: "email",
url: "mailto:?&body=Sample%20Text%20--%20https%3A//boltdesignsystem.com"
}
],
copy_to_clipboard: {
text_to_copy: "http://boltdesignsystem.com/#share-themes"
}
} only %}
{% endfor %}
{% include "@bolt-components-share/share.twig" with {
opacity: 60,
sources: [
{
name: "facebook",
url: "https://www.facebook.com/sharer/sharer.php?u=https://boltdesignsystem.com&amp;src=sdkpreparse"
},
{
name: "twitter",
url: "https://twitter.com/intent/tweet?url=https://boltdesignsystem.com&text=Sample%20Share%20Text&via=pega&hashtags=boltDesignSystemRocks!"
},
{
name: "linkedin",
url: "https://www.linkedin.com/shareArticle?url=https://boltdesignsystem.com"
},
{
name: "email",
url: "mailto:?&body=Sample%20Text%20--%20https%3A//boltdesignsystem.com"
}
],
copy_to_clipboard: {
text_to_copy: "http://boltdesignsystem.com/#share-themes"
}
} only %}
{% endblock %}
{% endembed %}
</div>
{% endfor %}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ $bolt-copy-to-clipboard-transition: all $bolt-copy-to-clipboard-animation-durati
transform: scale(0) rotate(0deg);
}
100% {
transform: scale(1) rotate(720deg);
transform: scale(1) rotate(900deg);
}
}
}
Expand Down Expand Up @@ -87,14 +87,16 @@ $bolt-copy-to-clipboard-transition: all $bolt-copy-to-clipboard-animation-durati

.c-bolt-copy-to-clipboard__action,
.c-bolt-copy-to-clipboard__info {
display: inline-flex;
align-items: center;

> *:first-child {
@include bolt-margin-right(xxsmall);
}
}

.c-bolt-copy-to-clipboard__action {
color: inherit;
color: var(--bolt-theme-link, inherit);
color: bolt-theme(link);

&:hover {
opacity: $bolt-global-link-hover-opacity;
Expand All @@ -111,8 +113,7 @@ $bolt-copy-to-clipboard-transition: all $bolt-copy-to-clipboard-animation-durati
}

.c-bolt-copy-to-clipboard__info {
color: inherit;
color: var(--bolt-theme-text, inherit);
color: bolt-theme(text);
opacity: 0.4;
}

Expand All @@ -130,6 +131,5 @@ $bolt-copy-to-clipboard-transition: all $bolt-copy-to-clipboard-animation-durati

.c-bolt-copy-to-clipboard__transition-animation {
display: inline-block;
color: inherit;
color: var(--bolt-theme-link, inherit);
color: bolt-theme(link);
}
Loading