@dropi/react-native-design-system 0.2.13 → 0.2.15
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/lib/molecules/Chip/Chip.d.ts +11 -0
- package/lib/molecules/Chip/Chip.js +49 -0
- package/lib/molecules/Chip/index.d.ts +1 -0
- package/lib/molecules/Chip/index.js +16 -0
- package/lib/molecules/Chip/styles.d.ts +31 -0
- package/lib/molecules/Chip/styles.js +38 -0
- package/lib/molecules/index.d.ts +1 -0
- package/lib/molecules/index.js +11 -0
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IconName } from "dropi-lib-icons";
|
|
2
|
+
type ChipVariant = "primary" | "tertiary";
|
|
3
|
+
type ChipProps = {
|
|
4
|
+
variant?: ChipVariant;
|
|
5
|
+
preIcon?: IconName;
|
|
6
|
+
label: string;
|
|
7
|
+
isDismissable?: boolean;
|
|
8
|
+
onDismiss?: () => void;
|
|
9
|
+
};
|
|
10
|
+
export declare const Chip: ({ variant, preIcon, label, isDismissable, onDismiss, }: ChipProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Chip = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _reactNative2 = _interopRequireDefault(require("dropi-lib-icons/react-native"));
|
|
9
|
+
var _constants = require("../../constants");
|
|
10
|
+
var _styles = _interopRequireDefault(require("./styles"));
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
const Chip = ({
|
|
14
|
+
variant = "tertiary",
|
|
15
|
+
preIcon,
|
|
16
|
+
label,
|
|
17
|
+
isDismissable = false,
|
|
18
|
+
onDismiss
|
|
19
|
+
}) => {
|
|
20
|
+
const containerStyle = variant === "primary" ? _styles.default.primaryContainer : _styles.default.tertiaryContainer;
|
|
21
|
+
const textStyle = variant === "primary" ? _styles.default.primaryText : _styles.default.tertiaryText;
|
|
22
|
+
const iconColor = variant === "primary" ? _constants.colors["Primary-500"].light : _constants.colors["Gray-600"].light;
|
|
23
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
24
|
+
style: [_styles.default.container, containerStyle],
|
|
25
|
+
children: [preIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative2.default, {
|
|
26
|
+
name: preIcon,
|
|
27
|
+
size: _constants.sizes.s,
|
|
28
|
+
color: iconColor
|
|
29
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
30
|
+
style: [_styles.default.text, textStyle],
|
|
31
|
+
children: label
|
|
32
|
+
}), isDismissable && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
33
|
+
onPress: onDismiss,
|
|
34
|
+
hitSlop: {
|
|
35
|
+
top: 8,
|
|
36
|
+
bottom: 8,
|
|
37
|
+
left: 8,
|
|
38
|
+
right: 8
|
|
39
|
+
},
|
|
40
|
+
activeOpacity: 0.7,
|
|
41
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative2.default, {
|
|
42
|
+
name: "cross-circle",
|
|
43
|
+
size: _constants.sizes.s,
|
|
44
|
+
color: iconColor
|
|
45
|
+
})
|
|
46
|
+
})]
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
exports.Chip = Chip;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Chip";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _Chip = require("./Chip");
|
|
7
|
+
Object.keys(_Chip).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _Chip[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _Chip[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
container: {
|
|
3
|
+
flexDirection: "row";
|
|
4
|
+
alignItems: "center";
|
|
5
|
+
alignSelf: "flex-start";
|
|
6
|
+
paddingHorizontal: number;
|
|
7
|
+
paddingVertical: number;
|
|
8
|
+
borderRadius: number;
|
|
9
|
+
gap: number;
|
|
10
|
+
borderWidth: number;
|
|
11
|
+
borderColor: "#C3C9D9";
|
|
12
|
+
};
|
|
13
|
+
primaryContainer: {
|
|
14
|
+
backgroundColor: "#FEF8F1";
|
|
15
|
+
};
|
|
16
|
+
tertiaryContainer: {
|
|
17
|
+
backgroundColor: "#F7F8FA";
|
|
18
|
+
};
|
|
19
|
+
text: {
|
|
20
|
+
fontSize: number;
|
|
21
|
+
fontWeight: "700";
|
|
22
|
+
lineHeight: number;
|
|
23
|
+
};
|
|
24
|
+
primaryText: {
|
|
25
|
+
color: "#F49A3D";
|
|
26
|
+
};
|
|
27
|
+
tertiaryText: {
|
|
28
|
+
color: "#475066";
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export default _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _constants = require("../../constants");
|
|
9
|
+
var _default = exports.default = _reactNative.StyleSheet.create({
|
|
10
|
+
container: {
|
|
11
|
+
flexDirection: "row",
|
|
12
|
+
alignItems: "center",
|
|
13
|
+
alignSelf: "flex-start",
|
|
14
|
+
paddingHorizontal: _constants.spacing["size-2"],
|
|
15
|
+
paddingVertical: _constants.spacing["size-1"],
|
|
16
|
+
borderRadius: _constants.radius["border-1"],
|
|
17
|
+
gap: _constants.spacing["size-1"],
|
|
18
|
+
borderWidth: 1,
|
|
19
|
+
borderColor: _constants.colors["Gray-200"].light
|
|
20
|
+
},
|
|
21
|
+
primaryContainer: {
|
|
22
|
+
backgroundColor: _constants.colors["Primary-50"].light
|
|
23
|
+
},
|
|
24
|
+
tertiaryContainer: {
|
|
25
|
+
backgroundColor: _constants.colors["Gray-50"].light
|
|
26
|
+
},
|
|
27
|
+
text: {
|
|
28
|
+
fontSize: _constants.sizes.xs,
|
|
29
|
+
fontWeight: _constants.weights.bold,
|
|
30
|
+
lineHeight: 14
|
|
31
|
+
},
|
|
32
|
+
primaryText: {
|
|
33
|
+
color: _constants.colors["Primary-500"].light
|
|
34
|
+
},
|
|
35
|
+
tertiaryText: {
|
|
36
|
+
color: _constants.colors["Gray-600"].light
|
|
37
|
+
}
|
|
38
|
+
});
|
package/lib/molecules/index.d.ts
CHANGED
package/lib/molecules/index.js
CHANGED
|
@@ -25,6 +25,17 @@ Object.keys(_BottomSheet).forEach(function (key) {
|
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
});
|
|
28
|
+
var _Chip = require("./Chip");
|
|
29
|
+
Object.keys(_Chip).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _Chip[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _Chip[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
28
39
|
var _EmptyState = require("./EmptyState");
|
|
29
40
|
Object.keys(_EmptyState).forEach(function (key) {
|
|
30
41
|
if (key === "default" || key === "__esModule") return;
|