Skip to content

Commit acc5856

Browse files
authored
Merge branch 'master' into feat-issue-741-add-event-cta
2 parents 6d07267 + eb4a9f6 commit acc5856

File tree

10 files changed

+364
-375
lines changed

10 files changed

+364
-375
lines changed

.travis.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
language: node_js
22
sudo: false
33
node_js:
4-
- "12"
4+
- "12"
55
os:
6-
- linux
6+
- linux
77
addons:
8-
firefox: latest
9-
chrome: stable
8+
firefox: latest
9+
chrome: stable
1010
script:
11-
- npm test -- --verbose
11+
- npm test -- --verbose
1212
cache:
13-
directories:
14-
- node_modules
13+
directories:
14+
- node_modules
1515
# matrix:
1616
# exclude:
1717
# - os: osx # skip this because on Travis, node.js segfaults on osx+node 9

CHANGELOG-prerelease.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
Tag: [v1.0.0-prerelease.40](https://github.com/patternfly/patternfly-elements/releases/tag/v1.0.0-prerelease.40)
44

5+
- [7deb9bb](https://github.com/patternfly/patternfly-elements/commit/7deb9bb6227c0560b60a665ecd43b450db0f90e1) fix: Prevent default pfe-cta arrow from wrapping to a new line by itself (#679)
56
- [](https://github.com/patternfly/patternfly-elements/commit/) feat: adding event to pfe-cta component
67

78
## Prerelease 39 ( 2020-02-19 )

elements/pfe-cta/demo/demo.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,4 @@ pfe-band[pfe-color="lightest"] pfe-card[pfe-color="lightest"] {
8383
padding: 15px;
8484
background: #0c8488;
8585
--theme: saturated;
86-
}
86+
}

elements/pfe-cta/demo/index.html

Lines changed: 292 additions & 311 deletions
Large diffs are not rendered by default.

elements/pfe-cta/src/pfe-cta.html

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
11
<span class="pfe-cta--wrapper">
2-
<slot></slot>${this.isDefault ? `<svg
3-
class="pfe-cta--arrow"
4-
xmlns="http://www.w3.org/2000/svg"
5-
viewBox="0 0 31.56 31.56"
6-
focusable="false"
7-
>
8-
<path
9-
d="M15.78 0l-3.1 3.1 10.5 10.49H0v4.38h23.18l-10.5 10.49 3.1 3.1 15.78-15.78L15.78 0z"
10-
/></svg
11-
>` : ``}
2+
<slot></slot>${this.isDefault ? `&#160;<svg class="pfe-cta--arrow" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 31.56 31.56" focusable="false"><path d="M15.78 0l-3.1 3.1 10.5 10.49H0v4.38h23.18l-10.5 10.49 3.1 3.1 15.78-15.78L15.78 0z"/></svg>` : ``}
123
<span class="pfe-cta--inner"></span>
134
</span>

elements/pfe-cta/src/pfe-cta.scss

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
$LOCAL: cta;
44

5-
$pfe-cta__arrow-size: 0.313em;
5+
66
$pfe-cta--BackgroundColor--focus: rgba(40, 151, 240, 0.2);
77
$pfe-cta--Color--fallback: #003366;
88

@@ -94,9 +94,8 @@ $variables: (
9494
}
9595

9696
::slotted(*) {
97-
white-space: normal;
98-
display: inline;
99-
97+
white-space: normal;
98+
display: inline;
10099
padding: #{pfe-local($cssvar: Padding)} !important;
101100
color: #{pfe-local(Color, $pfe-cta--Color--fallback)} !important;
102101
font-family: #{pfe-local(
@@ -132,6 +131,7 @@ $variables: (
132131

133132
.pfe-cta {
134133
&--wrapper {
134+
display: block;
135135
white-space: nowrap;
136136

137137
:host([pfe-priority]) &,
@@ -141,7 +141,12 @@ $variables: (
141141
align-items: center;
142142
height: 100%;
143143
}
144-
144+
// Default CTA arrow wrap fix for Firefox
145+
:host(:not([pfe-priority]):not([aria-disabled="true"])) & {
146+
@include browser-query(firefox) {
147+
max-width: calc(100% - 1ch - #{pfe-local($cssvar: size, $region: arrow)});
148+
}
149+
}
145150
@include browser-query(edge) {
146151
button,
147152
input {

elements/pfe-sass/mixins/_mixins.scss

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
@mixin browser-query($browser-list) {
22
@each $browser in $browser-list {
3-
43
@if $browser == ie11 {
54
@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) { /* IE10+ */
65
@content;
76
}
87
}
9-
108
@if $browser == edge12 {
119
@supports (-ms-accelerator: true) { /* Microsoft Edge Browser 12+ */
1210
@content;
11+
}
1312
}
14-
}
15-
1613
@if $browser == edge {
1714
@supports (-ms-ime-align: auto) { /* Microsoft Edge Browser 16+ (All) */
1815
@content;
1916
}
2017
}
18+
@if $browser == firefox {
19+
@media all and (min--moz-device-pixel-ratio:0) { /* Mozilla Firefox (All) */
20+
@content;
21+
}
22+
}
2123
}
2224
}
2325

scripts/doc-listing-inject.js

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,42 @@ let elementNames = fs
1414
.filter(file => fs.statSync(path.join(elementsDir, file)).isDirectory());
1515

1616
// Remove base class and sass helpers from listing
17-
elementNames = elementNames.filter(folder => folder !== "pfelement" && !folder.includes("sass"));
17+
elementNames = elementNames.filter(
18+
folder => folder !== "pfelement" && !folder.includes("sass")
19+
);
1820

1921
let items = [];
20-
22+
2123
// -> todos contains the array of todos/fixme/polyfills, parsed
2224
glob(`${elementsDir}/*/src/*.js`, (er, files) => {
2325
files.forEach(file => {
2426
items = items.concat(
25-
leasot.parse(
26-
fs.readFileSync(file, "utf8"), {
27-
extension: ".js",
28-
customTags: [ "POLYFILL" ],
29-
filename: file
30-
}
31-
)
27+
leasot.parse(fs.readFileSync(file, "utf8"), {
28+
extension: ".js",
29+
customTags: ["POLYFILL"],
30+
filename: file
31+
})
3232
);
3333
});
34-
34+
3535
let regex = new RegExp(/\[(.*?)\]\((.*?)\)/g);
3636

3737
// -> markdown output of the todos
3838
let output = "";
3939
output += leasot.report(items, "markdown");
40-
40+
4141
output = output.replace(regex, (full, label, link) => {
42-
return "[" + path.basename(label, ".js").split("--").slice(-1).pop() + "](" + path.relative(__dirname, link) + ")";
42+
return (
43+
"[" +
44+
path
45+
.basename(label, ".js")
46+
.split("--")
47+
.slice(-1)
48+
.pop() +
49+
"](" +
50+
path.relative(__dirname, link) +
51+
")"
52+
);
4353
});
4454

4555
let markup = "";
@@ -54,17 +64,16 @@ glob(`${elementsDir}/*/src/*.js`, (er, files) => {
5464
const tmpl = fs.readFileSync(wrapper, "utf8");
5565
const compiledTpl = template(tmpl);
5666
const newContents = compiledTpl({
57-
"components": markup,
58-
"todo": items.length > 0 ? output : ""
67+
components: markup,
68+
todo: items.length > 0 ? output : ""
5969
});
6070

6171
// // Read in the wrapper template
6272
fs.readFile(wrapper, (err, data) => {
6373
if (err) throw err;
64-
// // Output the updated index file
74+
// // Output the updated index file
6575
fs.writeFile(index, newContents, function(err) {
6676
if (err) throw err;
6777
});
6878
});
69-
70-
});
79+
});

scripts/gulpfile.factory.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ module.exports = function factory({
2727
`${elementName}--*.min.css.map`,
2828
`${elementName}.json`
2929
]);
30-
30+
3131
// Dedupe any items
32-
files = files.filter((item,index) => files.indexOf(item) === index);
32+
files = files.filter((item, index) => files.indexOf(item) === index);
3333

3434
// Tooling
3535
const fs = require("fs");
@@ -62,10 +62,7 @@ module.exports = function factory({
6262

6363
// Delete the temp directory
6464
task("clean", () => {
65-
return src([
66-
paths.temp,
67-
paths.compiled
68-
], {
65+
return src([paths.temp, paths.compiled], {
6966
cwd: paths.root,
7067
read: false,
7168
allowEmpty: true
@@ -79,9 +76,7 @@ module.exports = function factory({
7976
cwd: paths.source
8077
})
8178
.pipe(sourcemaps.init())
82-
.pipe(
83-
sass().on('error', sass.logError)
84-
)
79+
.pipe(sass().on("error", sass.logError))
8580
// Compile the Sass into CSS
8681
.pipe(
8782
sass({
@@ -90,10 +85,13 @@ module.exports = function factory({
9085
)
9186
// Adds autoprefixing to the compiled sass
9287
.pipe(
93-
postcss([postcssCustomProperties(), autoprefixer({
94-
grid: "autoplace",
95-
overrideBrowserslist: browser_support
96-
})])
88+
postcss([
89+
postcssCustomProperties(),
90+
autoprefixer({
91+
grid: "autoplace",
92+
overrideBrowserslist: browser_support
93+
})
94+
])
9795
)
9896
// Write the sourcemap
9997
.pipe(sourcemaps.write("./"))
@@ -286,7 +284,13 @@ ${fs
286284
task("copy:compiled", () => {
287285
return src(["*"], {
288286
cwd: paths.temp
289-
}).pipe(gulpif((file) => (files.length > 0 && gulpmatch(file, files)) || files.length === 0, dest(paths.compiled)));
287+
}).pipe(
288+
gulpif(
289+
file =>
290+
(files.length > 0 && gulpmatch(file, files)) || files.length === 0,
291+
dest(paths.compiled)
292+
)
293+
);
290294
});
291295

292296
task("compile", () => {
@@ -311,10 +315,7 @@ ${fs
311315

312316
// Delete the temp directory
313317
task("clean:post", () => {
314-
return src([
315-
"*.min.css",
316-
"*.umd.js"
317-
], {
318+
return src(["*.min.css", "*.umd.js"], {
318319
cwd: paths.temp,
319320
read: false,
320321
allowEmpty: true
@@ -365,4 +366,3 @@ ${fs
365366

366367
task("dev:nojs", parallel("build:nojs", "watch:nojs"));
367368
};
368-

spandx.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// If we have a .env file respect the LOCALHOST setting
22
// If not default to localhost
3-
require('dotenv').config();
3+
require("dotenv").config();
44

55
module.exports = {
66
host: process.env.LOCALHOST || "localhost",

0 commit comments

Comments
 (0)