@ebay/skin 14.1.0 → 14.1.3
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/_cdn/skin/v14.1.3/skin-default.min.css +6 -0
- package/_cdn/skin/v14.1.3/skin-full.min.css +6 -0
- package/_cdn/skin/v14.1.3/skin-headless.min.css +6 -0
- package/_cdn/skin/v14.1.3/skin-legacy.min.css +6 -0
- package/dist/button/button.css +6 -0
- package/dist/floating-label/floating-label.css +2 -5
- package/dist/legacy-tokens/ds4-light.css +1 -1
- package/dist/select/select.css +4 -0
- package/dist/textbox/textbox.css +7 -0
- package/dist/tokens/evo-light.css +1 -1
- package/package.json +1 -1
- package/scripts/generate-bundle.js +46 -22
- package/src/less/button/button.less +7 -0
- package/src/less/button/stories/button/borderless.stories.js +28 -0
- package/src/less/floating-label/floating-label.less +3 -5
- package/src/less/select/select.less +5 -0
- package/src/less/select/stories/floating-label.stories.js +66 -0
- package/src/less/textbox/textbox.less +8 -0
- package/src/less/toast-dialog/stories/toast-dialog.stories.js +9 -9
- package/src/tokens/evo-light.css +1 -1
- package/_cdn/skin/v14.1.0/skin-default.min.css +0 -6
- package/_cdn/skin/v14.1.0/skin-full.min.css +0 -6
- package/_cdn/skin/v14.1.0/skin-headless.min.css +0 -6
- package/_cdn/skin/v14.1.0/skin-legacy.min.css +0 -6
|
@@ -14,16 +14,22 @@ const cleanCSSInstance = new CleanCSS({
|
|
|
14
14
|
const currentDir = path.dirname(__dirname);
|
|
15
15
|
const { exec } = require('child_process');
|
|
16
16
|
const bodyMatch = new RegExp('body ?({(?:.|\\s|\\S)*?})', 'm');
|
|
17
|
+
const rootMatch = new RegExp(':root ?({(?:.|\\s|\\S)*?})', 'm');
|
|
17
18
|
|
|
18
19
|
// The list of directories in the dist to pull
|
|
19
|
-
const
|
|
20
|
+
const tokensList = [
|
|
21
|
+
['evo-core', 'evo-light'],
|
|
22
|
+
['ds4-core', 'ds4-light'],
|
|
23
|
+
];
|
|
24
|
+
const tokensDirList = ['evo', 'ds4'];
|
|
20
25
|
|
|
21
26
|
/**
|
|
22
27
|
* Main Processing class. Holds info about args passed and ds version
|
|
23
28
|
*/
|
|
24
29
|
class CssProcesser {
|
|
25
|
-
constructor(
|
|
26
|
-
this.
|
|
30
|
+
constructor(tokensFile, tokensDir, args) {
|
|
31
|
+
this.tokensFile = tokensFile;
|
|
32
|
+
this.tokensDir = tokensDir;
|
|
27
33
|
this.args = args;
|
|
28
34
|
this.processed = [];
|
|
29
35
|
this.skipped = [];
|
|
@@ -52,10 +58,11 @@ class CssProcesser {
|
|
|
52
58
|
|
|
53
59
|
getDistCss() {
|
|
54
60
|
return new Promise((resolve, reject) => {
|
|
55
|
-
glob(`${currentDir}/dist
|
|
61
|
+
glob(`${currentDir}/dist/**/*.css`, (err, files) => {
|
|
56
62
|
if (err) {
|
|
57
63
|
return reject(err);
|
|
58
64
|
}
|
|
65
|
+
console.log(files);
|
|
59
66
|
resolve(files);
|
|
60
67
|
});
|
|
61
68
|
});
|
|
@@ -80,6 +87,18 @@ class CssProcesser {
|
|
|
80
87
|
return this.wrap(cssContents);
|
|
81
88
|
}
|
|
82
89
|
|
|
90
|
+
rewrapRoot(cssContents) {
|
|
91
|
+
const root = rootMatch.exec(cssContents);
|
|
92
|
+
if (root && root[1]) {
|
|
93
|
+
// Add newroot
|
|
94
|
+
const newContents = cssContents.replace(rootMatch, '');
|
|
95
|
+
return `${this.classDef} ${root[1]}
|
|
96
|
+
${this.wrap(newContents)}
|
|
97
|
+
`;
|
|
98
|
+
}
|
|
99
|
+
return this.wrap(cssContents);
|
|
100
|
+
}
|
|
101
|
+
|
|
83
102
|
/**
|
|
84
103
|
* Generates a raw less file for given css file
|
|
85
104
|
* @param {*} file
|
|
@@ -87,8 +106,10 @@ class CssProcesser {
|
|
|
87
106
|
generateRawLess(file) {
|
|
88
107
|
const fileName = path.basename(file, '.css');
|
|
89
108
|
if (this.args.modules.length > 0 && this.args.modules.indexOf(fileName) === -1) {
|
|
90
|
-
this.
|
|
91
|
-
|
|
109
|
+
if (this.tokensFile.indexOf(fileName) === -1) {
|
|
110
|
+
this.skipped.push(fileName);
|
|
111
|
+
return '';
|
|
112
|
+
}
|
|
92
113
|
}
|
|
93
114
|
this.processed.push(fileName);
|
|
94
115
|
|
|
@@ -99,6 +120,9 @@ class CssProcesser {
|
|
|
99
120
|
if (fileName === 'global') {
|
|
100
121
|
return this.rewrapBody(cssContents);
|
|
101
122
|
}
|
|
123
|
+
if (this.tokensFile.indexOf(fileName) > -1) {
|
|
124
|
+
return this.rewrapRoot(cssContents);
|
|
125
|
+
}
|
|
102
126
|
return this.wrap(cssContents);
|
|
103
127
|
}
|
|
104
128
|
return `@import (inline) "${file}";`;
|
|
@@ -109,23 +133,23 @@ class CssProcesser {
|
|
|
109
133
|
const compiled = files.map((file) => this.generateRawLess(file)).join('\n');
|
|
110
134
|
const processed = this.processed;
|
|
111
135
|
const skipped = this.skipped;
|
|
112
|
-
const
|
|
136
|
+
const tokensFile = this.tokensFile;
|
|
113
137
|
|
|
114
138
|
if (this.args.modules.length > 0 || this.args.verbose) {
|
|
115
|
-
console.log(`Processed ${processed.length} modules for ${
|
|
139
|
+
console.log(`Processed ${processed.length} modules for ${tokensFile}`);
|
|
116
140
|
}
|
|
117
141
|
if (this.args.verbose) {
|
|
118
|
-
console.log(`Modules processed: ${processed.join(',')} for ${
|
|
142
|
+
console.log(`Modules processed: ${processed.join(',')} for ${tokensFile}`);
|
|
119
143
|
|
|
120
|
-
console.log(`Skipped ${skipped.length} modules for ${
|
|
121
|
-
console.log(`Modules skipped: ${skipped.join(',')} for ${
|
|
144
|
+
console.log(`Skipped ${skipped.length} modules for ${tokensFile}`);
|
|
145
|
+
console.log(`Modules skipped: ${skipped.join(',')} for ${tokensFile}`);
|
|
122
146
|
}
|
|
123
147
|
resolve(compiled);
|
|
124
148
|
});
|
|
125
149
|
}
|
|
126
150
|
|
|
127
151
|
generateLESS() {
|
|
128
|
-
return this.getDistCss(this.
|
|
152
|
+
return this.getDistCss(this.tokensFile).then((files) => this.processFiles(files));
|
|
129
153
|
}
|
|
130
154
|
|
|
131
155
|
compileLess(raw) {
|
|
@@ -133,24 +157,24 @@ class CssProcesser {
|
|
|
133
157
|
}
|
|
134
158
|
|
|
135
159
|
writeAllFiles(raw) {
|
|
136
|
-
const cdnPath = getCDNPath(this.args.name
|
|
160
|
+
const cdnPath = getCDNPath(this.args.name);
|
|
137
161
|
rimraf.sync(cdnPath);
|
|
138
162
|
return makeDir(cdnPath).then(() =>
|
|
139
163
|
writeFile(
|
|
140
|
-
`${cdnPath}/skin.${this.minify ? 'min.' : ''}css`,
|
|
164
|
+
`${cdnPath}/skin-${this.tokensDir}.${this.minify ? 'min.' : ''}css`,
|
|
141
165
|
`/* autoprefixer: off */\n${raw}\n/* autoprefixer: on */`
|
|
142
166
|
)
|
|
143
167
|
);
|
|
144
168
|
}
|
|
145
169
|
}
|
|
146
170
|
|
|
147
|
-
function getCDNPath(bundle
|
|
148
|
-
return `${currentDir}/_cdn/${bundle}/v${pkg.version}
|
|
171
|
+
function getCDNPath(bundle) {
|
|
172
|
+
return `${currentDir}/_cdn/${bundle}/v${pkg.version}`;
|
|
149
173
|
}
|
|
150
174
|
|
|
151
175
|
/**
|
|
152
176
|
* Runs the compilation of less
|
|
153
|
-
* @param {*} res The response with
|
|
177
|
+
* @param {*} res The response with tokensFile and raw css/less
|
|
154
178
|
* @param {*} plugin The given plugin to run the render with
|
|
155
179
|
*/
|
|
156
180
|
/**
|
|
@@ -200,8 +224,8 @@ function runCSSBuild(name, args) {
|
|
|
200
224
|
prebuild()
|
|
201
225
|
.then(() =>
|
|
202
226
|
Promise.all(
|
|
203
|
-
|
|
204
|
-
const cssProcesser = new CssProcesser(
|
|
227
|
+
tokensList.map((token, index) => {
|
|
228
|
+
const cssProcesser = new CssProcesser(token, tokensDirList[index], args);
|
|
205
229
|
return cssProcesser.run();
|
|
206
230
|
})
|
|
207
231
|
)
|
|
@@ -218,11 +242,11 @@ Please upload the ./_cdn/${args.name}/v${pkg.version} directory to CDN
|
|
|
218
242
|
|
|
219
243
|
async function listBundles(argv) {
|
|
220
244
|
await prebuild();
|
|
221
|
-
|
|
222
|
-
const cssProcesser = new CssProcesser(
|
|
245
|
+
tokensList.forEach((tokensFile) => {
|
|
246
|
+
const cssProcesser = new CssProcesser(tokensFile, argv);
|
|
223
247
|
cssProcesser.getDistCss().then((files) => {
|
|
224
248
|
console.log(`======================`);
|
|
225
|
-
console.log(`${
|
|
249
|
+
console.log(`${tokensFile} - modules avaiable`);
|
|
226
250
|
console.log(`======================`);
|
|
227
251
|
files.forEach((file) => {
|
|
228
252
|
console.log(path.basename(file, '.css'));
|
|
@@ -52,6 +52,13 @@ a.fake-btn--borderless {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
button.btn--borderless[disabled],
|
|
56
|
+
a.fake-btn--borderless[disabled],
|
|
57
|
+
button.btn--borderless[aria-disabled="true"],
|
|
58
|
+
a.fake-btn--borderless[aria-disabled="true"] {
|
|
59
|
+
border-color: transparent;
|
|
60
|
+
}
|
|
61
|
+
|
|
55
62
|
button.btn--slim,
|
|
56
63
|
a.fake-btn--slim {
|
|
57
64
|
height: @button-height-small;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export default { title: 'Button/Borderless' };
|
|
2
|
+
|
|
3
|
+
export const base = () => `<button class="btn btn--borderless">
|
|
4
|
+
<span class="btn__cell">
|
|
5
|
+
<span class="btn__text">Button</span>
|
|
6
|
+
<svg class="icon icon--dropdown" focusable="false" height="8" width="8" aria-hidden="true">
|
|
7
|
+
<use xlink:href="#icon-dropdown"></use>
|
|
8
|
+
</svg>
|
|
9
|
+
</span>
|
|
10
|
+
</button>`;
|
|
11
|
+
|
|
12
|
+
export const disabled = () => `<button class="btn btn--borderless" disabled="true">
|
|
13
|
+
<span class="btn__cell">
|
|
14
|
+
<span class="btn__text">Button</span>
|
|
15
|
+
<svg class="icon icon--dropdown" focusable="false" height="8" width="8" aria-hidden="true">
|
|
16
|
+
<use xlink:href="#icon-dropdown"></use>
|
|
17
|
+
</svg>
|
|
18
|
+
</span>
|
|
19
|
+
</button>`;
|
|
20
|
+
|
|
21
|
+
export const ariaDisabled = () => `<button class="btn btn--borderless" aria-disabled="true">
|
|
22
|
+
<span class="btn__cell">
|
|
23
|
+
<span class="btn__text">Button</span>
|
|
24
|
+
<svg class="icon icon--dropdown" focusable="false" height="8" width="8" aria-hidden="true">
|
|
25
|
+
<use xlink:href="#icon-dropdown"></use>
|
|
26
|
+
</svg>
|
|
27
|
+
</span>
|
|
28
|
+
</button>`;
|
|
@@ -14,16 +14,16 @@ div.floating-label {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
label.floating-label__label {
|
|
17
|
-
.background-color-token(floating-label-background-color, color-background-secondary);
|
|
18
17
|
.color-token(floating-label-color, color-foreground-primary);
|
|
18
|
+
|
|
19
|
+
background-color: transparent;
|
|
19
20
|
display: inline-block;
|
|
20
21
|
left: 16px;
|
|
21
22
|
overflow: hidden;
|
|
22
|
-
padding-top: 3px;
|
|
23
23
|
pointer-events: none;
|
|
24
24
|
position: absolute;
|
|
25
25
|
text-overflow: ellipsis;
|
|
26
|
-
top:
|
|
26
|
+
top: 0;
|
|
27
27
|
transform: scale(0.75, 0.75) translate(0, 2px);
|
|
28
28
|
transform-origin: left;
|
|
29
29
|
white-space: nowrap;
|
|
@@ -32,7 +32,6 @@ label.floating-label__label {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
label.floating-label__label--focus {
|
|
35
|
-
.background-color-token(floating-label-focus-background-color, color-background-primary);
|
|
36
35
|
color: var(--color-background-inverse);
|
|
37
36
|
}
|
|
38
37
|
|
|
@@ -55,7 +54,6 @@ label.floating-label__label--animate {
|
|
|
55
54
|
}
|
|
56
55
|
|
|
57
56
|
label.floating-label__label--disabled {
|
|
58
|
-
.background-color-token(floating-label-disabled-background-color, color-background-secondary);
|
|
59
57
|
.color-token(floating-label-disabled-color, color-foreground-disabled);
|
|
60
58
|
}
|
|
61
59
|
|
|
@@ -54,10 +54,15 @@ span.select {
|
|
|
54
54
|
width: auto;
|
|
55
55
|
|
|
56
56
|
&:focus {
|
|
57
|
+
background-color: transparent;
|
|
57
58
|
text-decoration: underline;
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
61
|
|
|
62
|
+
.select select:focus {
|
|
63
|
+
.background-color-token(select-focus-background-color, color-background-primary);
|
|
64
|
+
}
|
|
65
|
+
|
|
61
66
|
.select select:focus:not(:read-only) {
|
|
62
67
|
.background-color-token(select-focus-background-color, color-background-primary);
|
|
63
68
|
.border-color-token(select-focus-border-color, color-stroke-default);
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export default { title: 'Select/Select/Floating Label' };
|
|
2
|
+
|
|
3
|
+
export const defaultLabel = () => `
|
|
4
|
+
<span class="floating-label">
|
|
5
|
+
<label class="floating-label__label" for="select-01">Choose Option</label>
|
|
6
|
+
<span class="select">
|
|
7
|
+
<select id="select-01">
|
|
8
|
+
<option value="1">Option 1 with long text</option>
|
|
9
|
+
<option value="2">Option 2</option>
|
|
10
|
+
<option value="3">Option 3</option>
|
|
11
|
+
</select>
|
|
12
|
+
<svg class="icon icon--dropdown" focusable="false" height="8" width="8" aria-hidden="true">
|
|
13
|
+
<use xlink:href="#icon-dropdown"></use>
|
|
14
|
+
</svg>
|
|
15
|
+
</span>
|
|
16
|
+
</span>
|
|
17
|
+
`;
|
|
18
|
+
|
|
19
|
+
export const selectedOption = () => `
|
|
20
|
+
<span class="floating-label">
|
|
21
|
+
<label class="floating-label__label floating-label__label--inline" for="select-01">Here are your options</label>
|
|
22
|
+
<span class="select">
|
|
23
|
+
<select id="select-01">
|
|
24
|
+
<option value=""></option>
|
|
25
|
+
<option value="1">Option 1 with long text</option>
|
|
26
|
+
<option value="2">Option 2</option>
|
|
27
|
+
<option value="3">Option 3</option>
|
|
28
|
+
</select>
|
|
29
|
+
<svg class="icon icon--dropdown" focusable="false" height="8" width="8" aria-hidden="true">
|
|
30
|
+
<use xlink:href="#icon-dropdown"></use>
|
|
31
|
+
</svg>
|
|
32
|
+
</span>
|
|
33
|
+
</span>
|
|
34
|
+
`;
|
|
35
|
+
|
|
36
|
+
export const errorState = () => `
|
|
37
|
+
<span class="floating-label">
|
|
38
|
+
<label class="floating-label__label floating-label__label--invalid" for="select-03">Choose Option</label>
|
|
39
|
+
<span class="select">
|
|
40
|
+
<select id="select-03" aria-invalid="true">
|
|
41
|
+
<option value="1">Option 1 with long text</option>
|
|
42
|
+
<option value="2">Option 2</option>
|
|
43
|
+
<option value="3">Option 3</option>
|
|
44
|
+
</select>
|
|
45
|
+
<svg class="icon icon--dropdown" focusable="false" height="8" width="8" aria-hidden="true">
|
|
46
|
+
<use xlink:href="#icon-dropdown"></use>
|
|
47
|
+
</svg>
|
|
48
|
+
</span>
|
|
49
|
+
</span>
|
|
50
|
+
`;
|
|
51
|
+
|
|
52
|
+
export const disabled = () => `
|
|
53
|
+
<span class="floating-label">
|
|
54
|
+
<label class="floating-label__label" for="select-03">Choose Option</label>
|
|
55
|
+
<span class="select">
|
|
56
|
+
<select disabled>
|
|
57
|
+
<option value="1">Option 1</option>
|
|
58
|
+
<option value="2">Option 2 can't pick</option>
|
|
59
|
+
<option value="3">Option 3</option>
|
|
60
|
+
</select>
|
|
61
|
+
<svg class="icon icon--dropdown" focusable="false" height="8" width="8" aria-hidden="true">
|
|
62
|
+
<use xlink:href="#icon-dropdown"></use>
|
|
63
|
+
</svg>
|
|
64
|
+
</span>
|
|
65
|
+
</span>
|
|
66
|
+
`;
|
|
@@ -71,6 +71,8 @@ textarea.textbox__control {
|
|
|
71
71
|
&[readonly] {
|
|
72
72
|
background-color: transparent;
|
|
73
73
|
border: none;
|
|
74
|
+
padding-left: 0;
|
|
75
|
+
padding-right: 0;
|
|
74
76
|
}
|
|
75
77
|
|
|
76
78
|
&[aria-invalid="true"] {
|
|
@@ -133,6 +135,12 @@ textarea.textbox__control:not(:read-only):focus {
|
|
|
133
135
|
outline: 0;
|
|
134
136
|
}
|
|
135
137
|
|
|
138
|
+
input.textbox__control[readonly]:focus,
|
|
139
|
+
textarea.textbox__control[readonly]:focus {
|
|
140
|
+
outline: 0;
|
|
141
|
+
text-decoration: underline;
|
|
142
|
+
}
|
|
143
|
+
|
|
136
144
|
.textbox > svg:first-child {
|
|
137
145
|
left: @spacing-200;
|
|
138
146
|
|
|
@@ -5,9 +5,9 @@ export const primaryAction = () => `
|
|
|
5
5
|
<div class="toast-dialog__window">
|
|
6
6
|
<div class="toast-dialog__header">
|
|
7
7
|
<h2>User Privacy Preferences</h2>
|
|
8
|
-
<button class="icon-btn toast-dialog__close" type="button" aria-label="Close notification dialog">
|
|
9
|
-
<svg class="icon icon--close" focusable="false"
|
|
10
|
-
<use
|
|
8
|
+
<button class="icon-btn icon-btn--transparent toast-dialog__close" type="button" aria-label="Close notification dialog">
|
|
9
|
+
<svg class="icon icon--close icon--close-small" focusable="false">
|
|
10
|
+
<use href="#icon-close-small"></use>
|
|
11
11
|
</svg>
|
|
12
12
|
</button>
|
|
13
13
|
</div>
|
|
@@ -27,9 +27,9 @@ export const secondaryAction = () => `
|
|
|
27
27
|
<div class="toast-dialog__window">
|
|
28
28
|
<div class="toast-dialog__header">
|
|
29
29
|
<h2>User Privacy Preferences</h2>
|
|
30
|
-
<button class="icon-btn toast-dialog__close" type="button" aria-label="Close notification dialog">
|
|
31
|
-
<svg class="icon icon--close" focusable="false"
|
|
32
|
-
<use
|
|
30
|
+
<button class="icon-btn icon-btn--transparent toast-dialog__close" type="button" aria-label="Close notification dialog">
|
|
31
|
+
<svg class="icon icon--close icon--close-small" focusable="false">
|
|
32
|
+
<use href="#icon-close-small"></use>
|
|
33
33
|
</svg>
|
|
34
34
|
</button>
|
|
35
35
|
</div>
|
|
@@ -51,9 +51,9 @@ export const RTL = () => `
|
|
|
51
51
|
<div class="toast-dialog__window">
|
|
52
52
|
<div class="toast-dialog__header">
|
|
53
53
|
<h2>User Privacy Preferences</h2>
|
|
54
|
-
<button
|
|
55
|
-
<svg class="icon icon--close" focusable="false"
|
|
56
|
-
<use
|
|
54
|
+
<button class="icon-btn icon-btn--transparent toast-dialog__close" type="button" aria-label="Close notification dialog">
|
|
55
|
+
<svg class="icon icon--close icon--close-small" focusable="false">
|
|
56
|
+
<use href="#icon-close-small"></use>
|
|
57
57
|
</svg>
|
|
58
58
|
</button>
|
|
59
59
|
</div>
|
package/src/tokens/evo-light.css
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
--color-background-disabled: var(--color-neutral-3);
|
|
5
5
|
--color-background-inverse: var(--color-neutral-6);
|
|
6
6
|
--color-background-attention: var(--color-red-4);
|
|
7
|
-
--color-background-confirmation: var(--color-green-
|
|
7
|
+
--color-background-confirmation: var(--color-green-6);
|
|
8
8
|
--color-background-information: var(--color-blue-4);
|
|
9
9
|
--color-background-accent: var(--color-blue-4);
|
|
10
10
|
--color-background-invalid: var(--color-red-1);
|