@sb1/ffe-badge 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 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,47 @@
1
+ # @sb1/ffe-badges
2
+
3
+ ## Install
4
+
5
+ ```bash
6
+ npm install --save @sb1/ffe-core @sb1/ffe-badges
7
+ ```
8
+
9
+ ## Usage
10
+
11
+ ```less
12
+ @import 'path/to/node_modules/@sb1/ffe-badges/less/badge';
13
+ ```
14
+
15
+ ### Importing compiled CSS
16
+
17
+ If your project does not use Less, you can import the compiled styling:
18
+
19
+ ```css
20
+ @import '~@sb1/ffe-badges/css/badge.css';
21
+ ```
22
+
23
+ See also `@sb1/ffe-badges-react`.
24
+
25
+ ## Theming with CSS custom properties
26
+
27
+ In order to support theming of components, this package contains styling that depends on a set of custom properties, defined in `less/colors-semantic.less`. These properties in turn depend on a base theme defined in `ffe-core`.
28
+
29
+ If your project uses the `ffe-core`, you're probably good to go. If not, make sure to import the core properties in `ffe.less`:
30
+
31
+ ```css
32
+ @import '~@sb1/ffe-core/less/ffe';
33
+ ```
34
+
35
+ ## Development
36
+
37
+ To start a local development server, run the following from the designsystem root folder:
38
+
39
+ ```bash
40
+ npm install
41
+ npm run build
42
+ npm start
43
+ ```
44
+
45
+ A local instance of `component-overview` with live reloading will run at http://localhost:1234/.
46
+
47
+ Example implementations using the latest versions of all components are also available at https://sparebank1.github.io/designsystem.
package/css/badge.css ADDED
@@ -0,0 +1,17 @@
1
+ .ffe-badge {
2
+ display: -webkit-inline-box;
3
+ display: -ms-inline-flexbox;
4
+ display: inline-flex;
5
+ padding: var(--ffe-spacing-2xs) var(--ffe-spacing-xs);
6
+ background-color: var(--ffe-color-fill-feedback-critical);
7
+ color: var(--ffe-color-foreground-inverse);
8
+ border-radius: 50px;
9
+ font-size: var(--ffe-fontsize-small-text);
10
+ line-height: 1rem;
11
+ }
12
+ .ffe-badge--no-children {
13
+ height: 8px;
14
+ width: 8px;
15
+ padding: 0;
16
+ position: absolute;
17
+ }
@@ -0,0 +1,16 @@
1
+ .ffe-badge {
2
+ display: inline-flex;
3
+ padding: var(--ffe-spacing-2xs) var(--ffe-spacing-xs);
4
+ background-color: var(--ffe-color-fill-feedback-critical);
5
+ color: var(--ffe-color-foreground-inverse);
6
+ border-radius: 50px;
7
+ font-size: var(--ffe-fontsize-small-text);
8
+ line-height: 1rem;
9
+
10
+ &--no-children {
11
+ height: 8px;
12
+ width: 8px;
13
+ padding: 0;
14
+ position: absolute;
15
+ }
16
+ }
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@sb1/ffe-badge",
3
+ "version": "1.1.0",
4
+ "description": "En badge er en liten visuell indikator som viser antall uleste varsler, meldinger eller oppgaver.",
5
+ "keywords": [
6
+ "ffe",
7
+ "tag",
8
+ "tags",
9
+ "badge",
10
+ "chip"
11
+ ],
12
+ "license": "MIT",
13
+ "author": "SpareBank 1",
14
+ "files": [
15
+ "less",
16
+ "css"
17
+ ],
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "ssh://git@github.com:SpareBank1/designsystem.git"
21
+ },
22
+ "scripts": {
23
+ "lint": "ffe-buildtool stylelint less/*.less",
24
+ "test": "npm run lint",
25
+ "build": "lessc less/badge.less css/badge.css --autoprefix"
26
+ },
27
+ "dependencies": {
28
+ "@sb1/ffe-core": "^32.0.0"
29
+ },
30
+ "devDependencies": {
31
+ "lerna": "^8.1.3"
32
+ },
33
+ "publishConfig": {
34
+ "access": "public"
35
+ },
36
+ "gitHead": "8d09570673b7955a83e9ca4f5eb55ce50d24b781"
37
+ }