@sb1/ffe-chips-react 100.12.4 → 101.0.1
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/es/Chip.js +5 -27
- package/es/ChipRemovable.js +3 -14
- package/es/ChipSelectable.js +5 -27
- package/es/fixedForwardRef.js +1 -1
- package/lib/Chip.js +7 -29
- package/lib/ChipRemovable.js +6 -17
- package/lib/ChipSelectable.js +9 -31
- package/lib/fixedForwardRef.js +1 -1
- package/package.json +6 -6
package/es/Chip.js
CHANGED
|
@@ -1,40 +1,18 @@
|
|
|
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
1
|
import classNames from 'classnames';
|
|
24
2
|
import React from 'react';
|
|
25
3
|
import { fixedForwardRef } from './fixedForwardRef';
|
|
26
4
|
function ChipWithForwardRef(props, ref) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return (React.createElement(Comp,
|
|
5
|
+
const { as: Comp = 'button', className, size, leftIcon, rightIcon, children, ...rest } = props;
|
|
6
|
+
const wrappedChildren = (React.createElement("span", { className: classNames('ffe-chip__label', size === 'sm' && 'ffe-chip__label--sm') }, children));
|
|
7
|
+
return (React.createElement(Comp, { className: classNames('ffe-chip', {
|
|
30
8
|
'ffe-chip--sm': size === 'sm',
|
|
31
9
|
'ffe-chip--md': size === 'md',
|
|
32
10
|
'ffe-chip--lg': size === 'lg',
|
|
33
11
|
'ffe-chip--icon-left': !!leftIcon,
|
|
34
12
|
'ffe-chip--icon-right': !!rightIcon,
|
|
35
|
-
}, className)
|
|
13
|
+
}, className), ...rest, ref: ref },
|
|
36
14
|
leftIcon,
|
|
37
15
|
wrappedChildren,
|
|
38
16
|
rightIcon));
|
|
39
17
|
}
|
|
40
|
-
export
|
|
18
|
+
export const Chip = fixedForwardRef(ChipWithForwardRef);
|
package/es/ChipRemovable.js
CHANGED
|
@@ -1,20 +1,9 @@
|
|
|
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
1
|
import React from 'react';
|
|
13
2
|
import { Chip } from './Chip';
|
|
14
3
|
import { Icon } from '@sb1/ffe-icons-react';
|
|
15
4
|
import { fixedForwardRef } from './fixedForwardRef';
|
|
16
|
-
|
|
5
|
+
const closeOpen400Sm = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iMjAiPjxwYXRoIGQ9Ik00ODAtNDI5IDMxNi0yNjVxLTExIDExLTI1IDEwLjVUMjY2LTI2NnEtMTEtMTEtMTEtMjUuNXQxMS0yNS41bDE2My0xNjMtMTY0LTE2NHEtMTEtMTEtMTAuNS0yNS41VDI2Ni02OTVxMTEtMTEgMjUuNS0xMXQyNS41IDExbDE2MyAxNjQgMTY0LTE2NHExMS0xMSAyNS41LTExdDI1LjUgMTFxMTEgMTEgMTEgMjUuNVQ2OTUtNjQ0TDUzMS00ODBsMTY0IDE2NHExMSAxMSAxMSAyNXQtMTEgMjVxLTExIDExLTI1LjUgMTFUNjQ0LTI2Nkw0ODAtNDI5WiIvPjwvc3ZnPg==';
|
|
17
6
|
function ChipRemovableForwardRef(props, ref) {
|
|
18
|
-
return (React.createElement(Chip,
|
|
7
|
+
return (React.createElement(Chip, { ref: ref, rightIcon: React.createElement(Icon, { size: "sm", fileUrl: closeOpen400Sm }), ...props }));
|
|
19
8
|
}
|
|
20
|
-
export
|
|
9
|
+
export const ChipRemovable = fixedForwardRef(ChipRemovableForwardRef);
|
package/es/ChipSelectable.js
CHANGED
|
@@ -1,36 +1,14 @@
|
|
|
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
1
|
import { Icon } from '@sb1/ffe-icons-react';
|
|
24
2
|
import React from 'react';
|
|
25
3
|
import { Chip } from './Chip';
|
|
26
4
|
import { fixedForwardRef } from './fixedForwardRef';
|
|
27
5
|
import classNames from 'classnames';
|
|
28
|
-
|
|
6
|
+
const checkOpen400Sm = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iMjAiPjxwYXRoIGQ9Im0zODktMzY5IDI5OS0yOTlxMTAuOTA5LTExIDI1LjQ1NS0xMVE3MjgtNjc5IDczOS02NjhxMTEgMTEgMTEgMjUuNTgyIDAgMTQuNTgzLTEwLjYwNyAyNS4xODhMNDE1LTI5MnEtMTAuOTA5IDExLTI1LjQ1NSAxMVEzNzUtMjgxIDM2NC0yOTJMMjIxLTQzNXEtMTEtMTEtMTEtMjUuNXQxMS0yNS41cTExLTExIDI1LjY2Ny0xMSAxNC42NjYgMCAyNS4zMzMgMTFsMTE3IDExN1oiLz48L3N2Zz4=';
|
|
29
7
|
function ChipSelectableForwardRef(props, ref) {
|
|
30
|
-
|
|
31
|
-
return (React.createElement(Chip,
|
|
8
|
+
const { className, isSelected, ...rest } = props;
|
|
9
|
+
return (React.createElement(Chip, { ref: ref, leftIcon: React.createElement(Icon, { size: "sm", fileUrl: checkOpen400Sm }), className: classNames(className, {
|
|
32
10
|
'ffe-chip--selectable': !isSelected,
|
|
33
11
|
'ffe-chip--selected': isSelected,
|
|
34
|
-
})
|
|
12
|
+
}), ...rest }));
|
|
35
13
|
}
|
|
36
|
-
export
|
|
14
|
+
export const ChipSelectable = fixedForwardRef(ChipSelectableForwardRef);
|
package/es/fixedForwardRef.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export const fixedForwardRef = forwardRef;
|
package/lib/Chip.js
CHANGED
|
@@ -1,44 +1,22 @@
|
|
|
1
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
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
4
|
};
|
|
27
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
6
|
exports.Chip = void 0;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
7
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const fixedForwardRef_1 = require("./fixedForwardRef");
|
|
32
10
|
function ChipWithForwardRef(props, ref) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return (react_1.default.createElement(Comp,
|
|
11
|
+
const { as: Comp = 'button', className, size, leftIcon, rightIcon, children, ...rest } = props;
|
|
12
|
+
const wrappedChildren = (react_1.default.createElement("span", { className: (0, classnames_1.default)('ffe-chip__label', size === 'sm' && 'ffe-chip__label--sm') }, children));
|
|
13
|
+
return (react_1.default.createElement(Comp, { className: (0, classnames_1.default)('ffe-chip', {
|
|
36
14
|
'ffe-chip--sm': size === 'sm',
|
|
37
15
|
'ffe-chip--md': size === 'md',
|
|
38
16
|
'ffe-chip--lg': size === 'lg',
|
|
39
17
|
'ffe-chip--icon-left': !!leftIcon,
|
|
40
18
|
'ffe-chip--icon-right': !!rightIcon,
|
|
41
|
-
}, className)
|
|
19
|
+
}, className), ...rest, ref: ref },
|
|
42
20
|
leftIcon,
|
|
43
21
|
wrappedChildren,
|
|
44
22
|
rightIcon));
|
package/lib/ChipRemovable.js
CHANGED
|
@@ -1,26 +1,15 @@
|
|
|
1
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
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
16
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
6
|
exports.ChipRemovable = void 0;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const Chip_1 = require("./Chip");
|
|
9
|
+
const ffe_icons_react_1 = require("@sb1/ffe-icons-react");
|
|
10
|
+
const fixedForwardRef_1 = require("./fixedForwardRef");
|
|
11
|
+
const closeOpen400Sm = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iMjAiPjxwYXRoIGQ9Ik00ODAtNDI5IDMxNi0yNjVxLTExIDExLTI1IDEwLjVUMjY2LTI2NnEtMTEtMTEtMTEtMjUuNXQxMS0yNS41bDE2My0xNjMtMTY0LTE2NHEtMTEtMTEtMTAuNS0yNS41VDI2Ni02OTVxMTEtMTEgMjUuNS0xMXQyNS41IDExbDE2MyAxNjQgMTY0LTE2NHExMS0xMSAyNS41LTExdDI1LjUgMTFxMTEgMTEgMTEgMjUuNVQ2OTUtNjQ0TDUzMS00ODBsMTY0IDE2NHExMSAxMSAxMSAyNXQtMTEgMjVxLTExIDExLTI1LjUgMTFUNjQ0LTI2Nkw0ODAtNDI5WiIvPjwvc3ZnPg==';
|
|
23
12
|
function ChipRemovableForwardRef(props, ref) {
|
|
24
|
-
return (react_1.default.createElement(Chip_1.Chip,
|
|
13
|
+
return (react_1.default.createElement(Chip_1.Chip, { ref: ref, rightIcon: react_1.default.createElement(ffe_icons_react_1.Icon, { size: "sm", fileUrl: closeOpen400Sm }), ...props }));
|
|
25
14
|
}
|
|
26
15
|
exports.ChipRemovable = (0, fixedForwardRef_1.fixedForwardRef)(ChipRemovableForwardRef);
|
package/lib/ChipSelectable.js
CHANGED
|
@@ -1,42 +1,20 @@
|
|
|
1
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
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
4
|
};
|
|
27
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
6
|
exports.ChipSelectable = void 0;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
7
|
+
const ffe_icons_react_1 = require("@sb1/ffe-icons-react");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const Chip_1 = require("./Chip");
|
|
10
|
+
const fixedForwardRef_1 = require("./fixedForwardRef");
|
|
11
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
12
|
+
const checkOpen400Sm = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgLTk2MCA5NjAgOTYwIiB3aWR0aD0iMjAiPjxwYXRoIGQ9Im0zODktMzY5IDI5OS0yOTlxMTAuOTA5LTExIDI1LjQ1NS0xMVE3MjgtNjc5IDczOS02NjhxMTEgMTEgMTEgMjUuNTgyIDAgMTQuNTgzLTEwLjYwNyAyNS4xODhMNDE1LTI5MnEtMTAuOTA5IDExLTI1LjQ1NSAxMVEzNzUtMjgxIDM2NC0yOTJMMjIxLTQzNXEtMTEtMTEtMTEtMjUuNXQxMS0yNS41cTExLTExIDI1LjY2Ny0xMSAxNC42NjYgMCAyNS4zMzMgMTFsMTE3IDExN1oiLz48L3N2Zz4=';
|
|
35
13
|
function ChipSelectableForwardRef(props, ref) {
|
|
36
|
-
|
|
37
|
-
return (react_1.default.createElement(Chip_1.Chip,
|
|
14
|
+
const { className, isSelected, ...rest } = props;
|
|
15
|
+
return (react_1.default.createElement(Chip_1.Chip, { ref: ref, leftIcon: react_1.default.createElement(ffe_icons_react_1.Icon, { size: "sm", fileUrl: checkOpen400Sm }), className: (0, classnames_1.default)(className, {
|
|
38
16
|
'ffe-chip--selectable': !isSelected,
|
|
39
17
|
'ffe-chip--selected': isSelected,
|
|
40
|
-
})
|
|
18
|
+
}), ...rest }));
|
|
41
19
|
}
|
|
42
20
|
exports.ChipSelectable = (0, fixedForwardRef_1.fixedForwardRef)(ChipSelectableForwardRef);
|
package/lib/fixedForwardRef.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sb1/ffe-chips-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "101.0.1",
|
|
4
4
|
"description": "React implementation of ffe-chips component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ffe"
|
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
"test:watch": "ffe-buildtool jest --watch"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@sb1/ffe-chips": "^
|
|
32
|
-
"@sb1/ffe-core": "^
|
|
33
|
-
"@sb1/ffe-icons-react": "^
|
|
31
|
+
"@sb1/ffe-chips": "^101.0.1",
|
|
32
|
+
"@sb1/ffe-core": "^101.0.1",
|
|
33
|
+
"@sb1/ffe-icons-react": "^101.0.1",
|
|
34
34
|
"classnames": "^2.5.1"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@sb1/ffe-buildtool": "^
|
|
37
|
+
"@sb1/ffe-buildtool": "^101.0.1",
|
|
38
38
|
"react": "^18.2.0",
|
|
39
39
|
"react-dom": "^18.2.0"
|
|
40
40
|
},
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "2f1f2f2f93e52a5fc5429cbe29538f6016702cf3"
|
|
48
48
|
}
|