@dropi/react-native-design-system 0.2.13 → 0.2.14

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.
@@ -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,29 @@
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
+ };
11
+ primaryContainer: {
12
+ backgroundColor: "#FEF8F1";
13
+ };
14
+ tertiaryContainer: {
15
+ backgroundColor: "#E6EAF2";
16
+ };
17
+ text: {
18
+ fontSize: number;
19
+ fontWeight: "700";
20
+ lineHeight: number;
21
+ };
22
+ primaryText: {
23
+ color: "#F49A3D";
24
+ };
25
+ tertiaryText: {
26
+ color: "#475066";
27
+ };
28
+ };
29
+ export default _default;
@@ -0,0 +1,36 @@
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
+ },
19
+ primaryContainer: {
20
+ backgroundColor: _constants.colors["Primary-50"].light
21
+ },
22
+ tertiaryContainer: {
23
+ backgroundColor: _constants.colors["Gray-100"].light
24
+ },
25
+ text: {
26
+ fontSize: _constants.sizes.xs,
27
+ fontWeight: _constants.weights.bold,
28
+ lineHeight: 14
29
+ },
30
+ primaryText: {
31
+ color: _constants.colors["Primary-500"].light
32
+ },
33
+ tertiaryText: {
34
+ color: _constants.colors["Gray-600"].light
35
+ }
36
+ });
@@ -1,5 +1,6 @@
1
1
  export * from "./Alert";
2
2
  export * from "./BottomSheet";
3
+ export * from "./Chip";
3
4
  export * from "./EmptyState";
4
5
  export * from "./RadioButtons";
5
6
  export * from "./Search";
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dropi/react-native-design-system",
3
- "version": "0.2.13",
3
+ "version": "0.2.14",
4
4
  "description": "A React Native package built from scratch",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",