@sb1/ffe-tags-react 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/es/Tag.js +28 -0
- package/es/index.js +1 -0
- package/es/tsconfig.esm.tsbuildinfo +1 -0
- package/lib/Tag.js +34 -0
- package/lib/index.js +5 -0
- package/lib/tsconfig.cjs.tsbuildinfo +1 -0
- package/package.json +47 -0
- package/types/Tag.d.ts +10 -0
- package/types/index.d.ts +1 -0
- package/types/tsconfig.types.tsbuildinfo +1 -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/es/Tag.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import classNames from 'classnames';
|
|
24
|
+
import React from 'react';
|
|
25
|
+
export function Tag(_a) {
|
|
26
|
+
var className = _a.className, _b = _a.type, type = _b === void 0 ? 'emphasis' : _b, _c = _a.variant, variant = _c === void 0 ? 'neutral' : _c, children = _a.children, rest = __rest(_a, ["className", "type", "variant", "children"]);
|
|
27
|
+
return (React.createElement("span", __assign({ className: classNames('ffe-tag', "ffe-tag--".concat(variant, "-").concat(type), className) }, rest), children));
|
|
28
|
+
}
|
package/es/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tag } from './Tag';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["../src/Tag.tsx","../src/index.ts"],"version":"5.8.3"}
|
package/lib/Tag.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.Tag = Tag;
|
|
29
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
30
|
+
var react_1 = __importDefault(require("react"));
|
|
31
|
+
function Tag(_a) {
|
|
32
|
+
var className = _a.className, _b = _a.type, type = _b === void 0 ? 'emphasis' : _b, _c = _a.variant, variant = _c === void 0 ? 'neutral' : _c, children = _a.children, rest = __rest(_a, ["className", "type", "variant", "children"]);
|
|
33
|
+
return (react_1.default.createElement("span", __assign({ className: (0, classnames_1.default)('ffe-tag', "ffe-tag--".concat(variant, "-").concat(type), className) }, rest), children));
|
|
34
|
+
}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["../src/Tag.tsx","../src/index.ts"],"version":"5.8.3"}
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sb1/ffe-tags-react",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "React implementation of ffe-tags component",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ffe",
|
|
7
|
+
"tag",
|
|
8
|
+
"tags",
|
|
9
|
+
"badge",
|
|
10
|
+
"chip"
|
|
11
|
+
],
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"author": "SpareBank 1",
|
|
14
|
+
"files": [
|
|
15
|
+
"lib",
|
|
16
|
+
"es",
|
|
17
|
+
"types"
|
|
18
|
+
],
|
|
19
|
+
"main": "lib/index.js",
|
|
20
|
+
"module": "es/index.js",
|
|
21
|
+
"types": "types/index.d.ts",
|
|
22
|
+
"sideEffects": false,
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "ssh://git@github.com:SpareBank1/designsystem.git"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "ffe-buildtool tsc",
|
|
29
|
+
"build:es": "ffe-buildtool tsc --es",
|
|
30
|
+
"lint": "eslint \"src/**/*.{ts,tsx}\"",
|
|
31
|
+
"lint:fix": "eslint \"src/**/*.{ts,tsx}\" --fix",
|
|
32
|
+
"test": "ffe-buildtool jest",
|
|
33
|
+
"test:watch": "ffe-buildtool jest --watch"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@sb1/ffe-core": "^32.0.0",
|
|
37
|
+
"@sb1/ffe-tags": "^1.1.0"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"@sb1/ffe-icons-react": "^12.0.1",
|
|
41
|
+
"react": ">=18.2.0"
|
|
42
|
+
},
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public"
|
|
45
|
+
},
|
|
46
|
+
"gitHead": "8d09570673b7955a83e9ca4f5eb55ce50d24b781"
|
|
47
|
+
}
|
package/types/Tag.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type TagProps = {
|
|
3
|
+
/** Decides the emphasis of the tag, whether it has a strong or subtle look */
|
|
4
|
+
type?: 'emphasis' | 'subtle';
|
|
5
|
+
className?: string;
|
|
6
|
+
/** the color of the tag. Info, success, warning, critical, neutral or tip */
|
|
7
|
+
variant?: 'info' | 'success' | 'warning' | 'critical' | 'neutral' | 'tip';
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
};
|
|
10
|
+
export declare function Tag({ className, type, variant, children, ...rest }: TagProps): React.JSX.Element;
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tag, type TagProps } from './Tag';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["../src/Tag.tsx","../src/index.ts"],"version":"5.8.3"}
|