@sb1/ffe-shapes 1.1.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/LICENSE.md +21 -0
- package/README.md +39 -0
- package/css/shapes.css +54 -0
- package/less/wave.less +61 -0
- package/package.json +29 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 SpareBank 1
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# @sb1/ffe-shapes
|
|
2
|
+
|
|
3
|
+
## Install
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install --save @sb1/ffe-shapes
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
Full documentation on shapes usage is available at https://design.sparebank1.no/
|
|
12
|
+
|
|
13
|
+
```less
|
|
14
|
+
@import 'path/to/node_modules/@sb1/ffe-shapes/less/wave';
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Importing compiled CSS
|
|
18
|
+
|
|
19
|
+
If your project does not use Less, you can import the compiled styling:
|
|
20
|
+
|
|
21
|
+
```css
|
|
22
|
+
@import '~@sb1/ffe-shapes/css/shapes.css';
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
See also `@sb1/ffe-shapes-react`.
|
|
26
|
+
|
|
27
|
+
## Development
|
|
28
|
+
|
|
29
|
+
To start a local development server, run the following from the designsystem root folder:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm install
|
|
33
|
+
npm run build
|
|
34
|
+
npm start
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
A local instance of `component-overview` with live reloading will run at http://localhost:1234/.
|
|
38
|
+
|
|
39
|
+
Example implementations using the latest versions of all components are also available at https://sparebank1.github.io/designsystem.
|
package/css/shapes.css
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
.ffe-wave {
|
|
2
|
+
position: relative;
|
|
3
|
+
width: 100%;
|
|
4
|
+
background-color: var(--ffe-color-background-default);
|
|
5
|
+
}
|
|
6
|
+
.ffe-wave--bg-subtle {
|
|
7
|
+
background-color: var(--ffe-color-background-subtle);
|
|
8
|
+
}
|
|
9
|
+
.ffe-wave__content {
|
|
10
|
+
position: absolute;
|
|
11
|
+
z-index: 1;
|
|
12
|
+
width: 100%;
|
|
13
|
+
}
|
|
14
|
+
@media (prefers-color-scheme: dark) {
|
|
15
|
+
.ffe-wave--hide-in-dark-mode .ffe-wave__wave {
|
|
16
|
+
display: none;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
.ffe-wave__wave {
|
|
20
|
+
background-color: var(--ffe-color-background-default);
|
|
21
|
+
-webkit-mask-repeat: repeat-x;
|
|
22
|
+
mask-repeat: repeat-x;
|
|
23
|
+
min-height: 60px;
|
|
24
|
+
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 479.9 60' style='enable-background:new 0 0 479.9 148' xml:space='preserve'%3E%3Cpath d='M0 530V0c60.7 0 91.6 13.8 121.4 27.1 30.4 13.6 59.1 26.4 118.1 26.4s87.7-12.8 118.1-26.4C387.4 13.8 418.2 0 478.9 0s91.6 13.8 121.4 27.1c30.4 13.6 59.1 26.4 118.1 26.4s87.7-12.8 118.1-26.4C866.3 13.8 897.1 0 957.8 0s91.6 13.8 121.4 27.1c30.4 13.6 59.1 26.4 118.1 26.4s87.7-12.8 118.1-26.4C1345.2 13.8 1376 0 1436.7 0c60.7 0 91.6 13.8 121.4 27.1 30.4 13.6 59.1 26.4 118.1 26.4s87.7-12.8 118.1-26.4C1824.1 13.8 1854.9 0 1915.7 0v530'/%3E%3C/svg%3E");
|
|
25
|
+
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 479.9 60' style='enable-background:new 0 0 479.9 148' xml:space='preserve'%3E%3Cpath d='M0 530V0c60.7 0 91.6 13.8 121.4 27.1 30.4 13.6 59.1 26.4 118.1 26.4s87.7-12.8 118.1-26.4C387.4 13.8 418.2 0 478.9 0s91.6 13.8 121.4 27.1c30.4 13.6 59.1 26.4 118.1 26.4s87.7-12.8 118.1-26.4C866.3 13.8 897.1 0 957.8 0s91.6 13.8 121.4 27.1c30.4 13.6 59.1 26.4 118.1 26.4s87.7-12.8 118.1-26.4C1345.2 13.8 1376 0 1436.7 0c60.7 0 91.6 13.8 121.4 27.1 30.4 13.6 59.1 26.4 118.1 26.4s87.7-12.8 118.1-26.4C1824.1 13.8 1854.9 0 1915.7 0v530'/%3E%3C/svg%3E");
|
|
26
|
+
-webkit-mask-size: 480px;
|
|
27
|
+
mask-size: 480px;
|
|
28
|
+
}
|
|
29
|
+
@media (min-width: 480px) {
|
|
30
|
+
.ffe-wave__wave {
|
|
31
|
+
min-height: 119px;
|
|
32
|
+
-webkit-mask-position: 812px;
|
|
33
|
+
mask-position: 812px;
|
|
34
|
+
-webkit-mask-size: 950px;
|
|
35
|
+
mask-size: 950px;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
@media (min-width: 1024px) {
|
|
39
|
+
.ffe-wave__wave {
|
|
40
|
+
min-height: 250px;
|
|
41
|
+
-webkit-mask-position: 1931px;
|
|
42
|
+
mask-position: 1931px;
|
|
43
|
+
-webkit-mask-size: 2004px;
|
|
44
|
+
mask-size: 2004px;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
.ffe-wave__wave--flip {
|
|
48
|
+
rotate: 180deg;
|
|
49
|
+
}
|
|
50
|
+
/* stylelint-disable selector-class-pattern */
|
|
51
|
+
.dark-mode .ffe-wave--hide-in-dark-mode .ffe-wave__wave {
|
|
52
|
+
visibility: hidden;
|
|
53
|
+
}
|
|
54
|
+
/* stylelint-enable selector-class-pattern */
|
package/less/wave.less
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
@import (reference) '@sb1/ffe-core/less/breakpoints';
|
|
2
|
+
|
|
3
|
+
.ffe-wave {
|
|
4
|
+
position: relative;
|
|
5
|
+
width: 100%;
|
|
6
|
+
background-color: var(--ffe-color-background-default);
|
|
7
|
+
|
|
8
|
+
&--bg-subtle {
|
|
9
|
+
background-color: var(--ffe-color-background-subtle);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&__content {
|
|
13
|
+
position: absolute;
|
|
14
|
+
z-index: 1;
|
|
15
|
+
width: 100%;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&--hide-in-dark-mode {
|
|
19
|
+
@media (prefers-color-scheme: dark) {
|
|
20
|
+
.ffe-wave__wave {
|
|
21
|
+
display: none;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&__wave {
|
|
27
|
+
background-color: var(--ffe-color-background-default);
|
|
28
|
+
mask-repeat: repeat-x;
|
|
29
|
+
min-height: 60px;
|
|
30
|
+
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 479.9 60' style='enable-background:new 0 0 479.9 148' xml:space='preserve'%3E%3Cpath d='M0 530V0c60.7 0 91.6 13.8 121.4 27.1 30.4 13.6 59.1 26.4 118.1 26.4s87.7-12.8 118.1-26.4C387.4 13.8 418.2 0 478.9 0s91.6 13.8 121.4 27.1c30.4 13.6 59.1 26.4 118.1 26.4s87.7-12.8 118.1-26.4C866.3 13.8 897.1 0 957.8 0s91.6 13.8 121.4 27.1c30.4 13.6 59.1 26.4 118.1 26.4s87.7-12.8 118.1-26.4C1345.2 13.8 1376 0 1436.7 0c60.7 0 91.6 13.8 121.4 27.1 30.4 13.6 59.1 26.4 118.1 26.4s87.7-12.8 118.1-26.4C1824.1 13.8 1854.9 0 1915.7 0v530'/%3E%3C/svg%3E");
|
|
31
|
+
mask-size: 480px;
|
|
32
|
+
|
|
33
|
+
@media (min-width: @breakpoint-sm) {
|
|
34
|
+
min-height: 119px;
|
|
35
|
+
mask-position: 812px;
|
|
36
|
+
mask-size: 950px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@media (min-width: @breakpoint-lg) {
|
|
40
|
+
min-height: 250px;
|
|
41
|
+
mask-position: 1931px;
|
|
42
|
+
mask-size: 2004px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&--flip {
|
|
46
|
+
rotate: 180deg;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* stylelint-disable selector-class-pattern */
|
|
52
|
+
.dark-mode {
|
|
53
|
+
//Storybook specific
|
|
54
|
+
.ffe-wave--hide-in-dark-mode {
|
|
55
|
+
.ffe-wave__wave {
|
|
56
|
+
visibility: hidden;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/* stylelint-enable selector-class-pattern */
|
|
61
|
+
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sb1/ffe-shapes",
|
|
3
|
+
"license": "MIT",
|
|
4
|
+
"version": "1.1.0",
|
|
5
|
+
"author": "SpareBank 1",
|
|
6
|
+
"files": [
|
|
7
|
+
"less",
|
|
8
|
+
"css"
|
|
9
|
+
],
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "ssh://git@github.com:SpareBank1/designsystem.git"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"lint": "ffe-buildtool stylelint less/*.less",
|
|
16
|
+
"test": "npm run lint",
|
|
17
|
+
"build": "lessc less/wave.less css/shapes.css --autoprefix"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@sb1/ffe-core": "^31.0.0"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@sb1/ffe-buildtool": "^0.10.0"
|
|
24
|
+
},
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"gitHead": "e50b473f29109281adeb2f188a0f5391f4db1e9a"
|
|
29
|
+
}
|