@grupalia/rn-ui-kit 0.13.0 → 0.14.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/lib/commonjs/components/BaseConfirmationModal.js +54 -0
- package/lib/commonjs/components/BaseConfirmationModal.js.map +1 -0
- package/lib/commonjs/components/BaseIconBox.js +77 -0
- package/lib/commonjs/components/BaseIconBox.js.map +1 -0
- package/lib/commonjs/components/index.js +14 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/module/components/BaseConfirmationModal.js +49 -0
- package/lib/module/components/BaseConfirmationModal.js.map +1 -0
- package/lib/module/components/BaseIconBox.js +73 -0
- package/lib/module/components/BaseIconBox.js.map +1 -0
- package/lib/module/components/index.js +2 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/typescript/commonjs/components/BaseConfirmationModal.d.ts +16 -0
- package/lib/typescript/commonjs/components/BaseConfirmationModal.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/BaseIconBox.d.ts +12 -0
- package/lib/typescript/commonjs/components/BaseIconBox.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/index.d.ts +2 -0
- package/lib/typescript/commonjs/components/index.d.ts.map +1 -1
- package/lib/typescript/module/components/BaseConfirmationModal.d.ts +16 -0
- package/lib/typescript/module/components/BaseConfirmationModal.d.ts.map +1 -0
- package/lib/typescript/module/components/BaseIconBox.d.ts +12 -0
- package/lib/typescript/module/components/BaseIconBox.d.ts.map +1 -0
- package/lib/typescript/module/components/index.d.ts +2 -0
- package/lib/typescript/module/components/index.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/components/BaseConfirmationModal.tsx +63 -0
- package/src/components/BaseIconBox.tsx +65 -0
- package/src/components/index.ts +2 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = BaseConfirmationModal;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _BaseButton = _interopRequireDefault(require("./BaseButton"));
|
|
9
|
+
var _BaseText = _interopRequireDefault(require("./BaseText"));
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
function BaseConfirmationModal({
|
|
13
|
+
visible,
|
|
14
|
+
title,
|
|
15
|
+
body,
|
|
16
|
+
confirmText = 'Aceptar',
|
|
17
|
+
cancelText = 'Cancelar',
|
|
18
|
+
onConfirm,
|
|
19
|
+
onCancel,
|
|
20
|
+
countdownSecs = 0,
|
|
21
|
+
loading = false,
|
|
22
|
+
...props
|
|
23
|
+
}) {
|
|
24
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Modal, {
|
|
25
|
+
animationType: "fade",
|
|
26
|
+
transparent: true,
|
|
27
|
+
visible: visible,
|
|
28
|
+
onRequestClose: () => onCancel(),
|
|
29
|
+
...props,
|
|
30
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
31
|
+
className: "flex-1 items-center justify-center bg-overlay",
|
|
32
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
33
|
+
className: "m-4 flex flex-col space-y-4 rounded-lg bg-primary p-8",
|
|
34
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_BaseText.default, {
|
|
35
|
+
className: "mb-4 text-lg font-semibold",
|
|
36
|
+
children: title
|
|
37
|
+
}), typeof body === 'string' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_BaseText.default, {
|
|
38
|
+
className: "text-base",
|
|
39
|
+
children: body
|
|
40
|
+
}) : body, /*#__PURE__*/(0, _jsxRuntime.jsx)(_BaseButton.default, {
|
|
41
|
+
text: confirmText,
|
|
42
|
+
onPress: onConfirm,
|
|
43
|
+
loading: loading,
|
|
44
|
+
countdownSecs: countdownSecs
|
|
45
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_BaseButton.default, {
|
|
46
|
+
variant: "secondary",
|
|
47
|
+
text: cancelText,
|
|
48
|
+
onPress: onCancel
|
|
49
|
+
})]
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=BaseConfirmationModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_BaseButton","_interopRequireDefault","_BaseText","_jsxRuntime","e","__esModule","default","BaseConfirmationModal","visible","title","body","confirmText","cancelText","onConfirm","onCancel","countdownSecs","loading","props","jsx","Modal","animationType","transparent","onRequestClose","children","View","className","jsxs","text","onPress","variant"],"sourceRoot":"../../../src","sources":["components/BaseConfirmationModal.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,SAAA,GAAAD,sBAAA,CAAAF,OAAA;AAAkC,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAcnB,SAASG,qBAAqBA,CAAC;EAC5CC,OAAO;EACPC,KAAK;EACLC,IAAI;EACJC,WAAW,GAAG,SAAS;EACvBC,UAAU,GAAG,UAAU;EACvBC,SAAS;EACTC,QAAQ;EACRC,aAAa,GAAG,CAAC;EACjBC,OAAO,GAAG,KAAK;EACf,GAAGC;AACE,CAAC,EAAE;EACR,oBACE,IAAAd,WAAA,CAAAe,GAAA,EAACpB,YAAA,CAAAqB,KAAK;IACJC,aAAa,EAAC,MAAM;IACpBC,WAAW;IACXb,OAAO,EAAEA,OAAQ;IACjBc,cAAc,EAAEA,CAAA,KAAMR,QAAQ,CAAC,CAAE;IAAA,GAC7BG,KAAK;IAAAM,QAAA,eAET,IAAApB,WAAA,CAAAe,GAAA,EAACpB,YAAA,CAAA0B,IAAI;MAACC,SAAS,EAAC,+CAA+C;MAAAF,QAAA,eAC7D,IAAApB,WAAA,CAAAuB,IAAA,EAAC5B,YAAA,CAAA0B,IAAI;QAACC,SAAS,EAAC,uDAAuD;QAAAF,QAAA,gBACrE,IAAApB,WAAA,CAAAe,GAAA,EAAChB,SAAA,CAAAI,OAAQ;UAACmB,SAAS,EAAC,4BAA4B;UAAAF,QAAA,EAC7Cd;QAAK,CACE,CAAC,EACV,OAAOC,IAAI,KAAK,QAAQ,gBACvB,IAAAP,WAAA,CAAAe,GAAA,EAAChB,SAAA,CAAAI,OAAQ;UAACmB,SAAS,EAAC,WAAW;UAAAF,QAAA,EAC5Bb;QAAI,CACG,CAAC,GACTA,IAAI,eACR,IAAAP,WAAA,CAAAe,GAAA,EAAClB,WAAA,CAAAM,OAAU;UACTqB,IAAI,EAAEhB,WAAY;UAClBiB,OAAO,EAAEf,SAAU;UACnBG,OAAO,EAAEA,OAAQ;UACjBD,aAAa,EAAEA;QAAc,CAC9B,CAAC,eACF,IAAAZ,WAAA,CAAAe,GAAA,EAAClB,WAAA,CAAAM,OAAU;UACTuB,OAAO,EAAC,WAAW;UACnBF,IAAI,EAAEf,UAAW;UACjBgB,OAAO,EAAEd;QAAS,CACnB,CAAC;MAAA,CACE;IAAC,CACH;EAAC,CACF,CAAC;AAEZ","ignoreList":[]}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = BaseIconBox;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
|
+
function getColorClasses(color) {
|
|
10
|
+
switch (color) {
|
|
11
|
+
case 'primary':
|
|
12
|
+
return {
|
|
13
|
+
box: 'bg-brand-solid',
|
|
14
|
+
icon: 'text-primary_on-brand'
|
|
15
|
+
};
|
|
16
|
+
case 'light-blue':
|
|
17
|
+
return {
|
|
18
|
+
box: 'bg-utility-blue-100',
|
|
19
|
+
icon: 'text-utility-blue-700'
|
|
20
|
+
};
|
|
21
|
+
case 'green':
|
|
22
|
+
return {
|
|
23
|
+
box: 'bg-success-primary',
|
|
24
|
+
icon: 'text-success-primary'
|
|
25
|
+
};
|
|
26
|
+
case 'white':
|
|
27
|
+
default:
|
|
28
|
+
return {
|
|
29
|
+
box: 'bg-transparent',
|
|
30
|
+
icon: 'text-primary'
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function getSizeClasses(size) {
|
|
35
|
+
switch (size) {
|
|
36
|
+
case 'xxs':
|
|
37
|
+
return {
|
|
38
|
+
box: 'h-6 w-6'
|
|
39
|
+
};
|
|
40
|
+
case 'xs':
|
|
41
|
+
return {
|
|
42
|
+
box: 'w-8 h-8'
|
|
43
|
+
};
|
|
44
|
+
case 'sm':
|
|
45
|
+
return {
|
|
46
|
+
box: 'w-12 h-12'
|
|
47
|
+
};
|
|
48
|
+
case 'lg':
|
|
49
|
+
return {
|
|
50
|
+
box: 'w-16 h-16'
|
|
51
|
+
};
|
|
52
|
+
case 'md':
|
|
53
|
+
default:
|
|
54
|
+
return {
|
|
55
|
+
box: 'w-20 h-20'
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function BaseIconBox({
|
|
60
|
+
color = 'primary',
|
|
61
|
+
size = 'sm',
|
|
62
|
+
Icon,
|
|
63
|
+
style = {},
|
|
64
|
+
...iconProps
|
|
65
|
+
}) {
|
|
66
|
+
const colorClasses = getColorClasses(color);
|
|
67
|
+
const sizeClasses = getSizeClasses(size);
|
|
68
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
69
|
+
className: `${colorClasses.box} ${sizeClasses.box} flex shrink-0 items-center justify-center rounded-md p-1`,
|
|
70
|
+
style: style,
|
|
71
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, {
|
|
72
|
+
className: colorClasses.icon,
|
|
73
|
+
...iconProps
|
|
74
|
+
})
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=BaseIconBox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_jsxRuntime","getColorClasses","color","box","icon","getSizeClasses","size","BaseIconBox","Icon","style","iconProps","colorClasses","sizeClasses","jsx","View","className","children"],"sourceRoot":"../../../src","sources":["components/BaseIconBox.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAAoC,IAAAC,WAAA,GAAAD,OAAA;AAapC,SAASE,eAAeA,CAACC,KAAgB,EAAiC;EACxE,QAAQA,KAAK;IACX,KAAK,SAAS;MACZ,OAAO;QAAEC,GAAG,EAAE,gBAAgB;QAAEC,IAAI,EAAE;MAAwB,CAAC;IACjE,KAAK,YAAY;MACf,OAAO;QAAED,GAAG,EAAE,qBAAqB;QAAEC,IAAI,EAAE;MAAwB,CAAC;IACtE,KAAK,OAAO;MACV,OAAO;QAAED,GAAG,EAAE,oBAAoB;QAAEC,IAAI,EAAE;MAAuB,CAAC;IACpE,KAAK,OAAO;IACZ;MACE,OAAO;QAAED,GAAG,EAAE,gBAAgB;QAAEC,IAAI,EAAE;MAAe,CAAC;EAC1D;AACF;AAEA,SAASC,cAAcA,CAACC,IAAc,EAAmB;EACvD,QAAQA,IAAI;IACV,KAAK,KAAK;MACR,OAAO;QAAEH,GAAG,EAAE;MAAU,CAAC;IAC3B,KAAK,IAAI;MACP,OAAO;QAAEA,GAAG,EAAE;MAAU,CAAC;IAC3B,KAAK,IAAI;MACP,OAAO;QAAEA,GAAG,EAAE;MAAY,CAAC;IAC7B,KAAK,IAAI;MACP,OAAO;QAAEA,GAAG,EAAE;MAAY,CAAC;IAC7B,KAAK,IAAI;IACT;MACE,OAAO;QAAEA,GAAG,EAAE;MAAY,CAAC;EAC/B;AACF;AAEe,SAASI,WAAWA,CAAC;EAClCL,KAAK,GAAG,SAAS;EACjBI,IAAI,GAAG,IAAI;EACXE,IAAI;EACJC,KAAK,GAAG,CAAC,CAAC;EACV,GAAGC;AACa,CAAC,EAAE;EACnB,MAAMC,YAAY,GAAGV,eAAe,CAACC,KAAK,CAAC;EAC3C,MAAMU,WAAW,GAAGP,cAAc,CAACC,IAAI,CAAC;EAExC,oBACE,IAAAN,WAAA,CAAAa,GAAA,EAACf,YAAA,CAAAgB,IAAI;IACHC,SAAS,EAAE,GAAGJ,YAAY,CAACR,GAAG,IAAIS,WAAW,CAACT,GAAG,2DAA4D;IAC7GM,KAAK,EAAEA,KAAM;IAAAO,QAAA,eAEb,IAAAhB,WAAA,CAAAa,GAAA,EAACL,IAAI;MACHO,SAAS,EAAEJ,YAAY,CAACP,IAAK;MAAA,GACzBM;IAAS,CACd;EAAC,CACE,CAAC;AAEX","ignoreList":[]}
|
|
@@ -21,6 +21,12 @@ Object.defineProperty(exports, "BaseButton", {
|
|
|
21
21
|
return _BaseButton.default;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
+
Object.defineProperty(exports, "BaseConfirmationModal", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _BaseConfirmationModal.default;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
24
30
|
Object.defineProperty(exports, "BaseDateInput", {
|
|
25
31
|
enumerable: true,
|
|
26
32
|
get: function () {
|
|
@@ -39,6 +45,12 @@ Object.defineProperty(exports, "BaseIcon", {
|
|
|
39
45
|
return _BaseIcon.default;
|
|
40
46
|
}
|
|
41
47
|
});
|
|
48
|
+
Object.defineProperty(exports, "BaseIconBox", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _BaseIconBox.default;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
42
54
|
Object.defineProperty(exports, "BaseRadioGroup", {
|
|
43
55
|
enumerable: true,
|
|
44
56
|
get: function () {
|
|
@@ -119,6 +131,8 @@ Object.defineProperty(exports, "Tab", {
|
|
|
119
131
|
});
|
|
120
132
|
var _BaseButton = _interopRequireDefault(require("./BaseButton"));
|
|
121
133
|
var _BaseBadge = _interopRequireDefault(require("./BaseBadge"));
|
|
134
|
+
var _BaseConfirmationModal = _interopRequireDefault(require("./BaseConfirmationModal"));
|
|
135
|
+
var _BaseIconBox = _interopRequireDefault(require("./BaseIconBox"));
|
|
122
136
|
var _BaseSpinner = _interopRequireDefault(require("./BaseSpinner"));
|
|
123
137
|
var _BaseStackedList = _interopRequireDefault(require("./BaseStackedList"));
|
|
124
138
|
var _BaseIcon = _interopRequireDefault(require("./BaseIcon"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_BaseButton","_interopRequireDefault","require","_BaseBadge","_BaseSpinner","_BaseStackedList","_BaseIcon","_BaseAlert","_BaseSelect","_interopRequireWildcard","_FormikSelect","_BaseHorizontalTabs","_BaseSelectionItem","_BaseRadioGroup","_FormikRadioGroup","_BaseDateInput","_FormikDateInput","_BaseSwitch","_PressableOpacity","_BaseText","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_BaseButton","_interopRequireDefault","require","_BaseBadge","_BaseConfirmationModal","_BaseIconBox","_BaseSpinner","_BaseStackedList","_BaseIcon","_BaseAlert","_BaseSelect","_interopRequireWildcard","_FormikSelect","_BaseHorizontalTabs","_BaseSelectionItem","_BaseRadioGroup","_FormikRadioGroup","_BaseDateInput","_FormikDateInput","_BaseSwitch","_PressableOpacity","_BaseText","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";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AAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAAA,SAAAtB,uBAAAqB,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAK,UAAA,GAAAL,CAAA,KAAAU,OAAA,EAAAV,CAAA","ignoreList":[]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { View, Modal } from 'react-native';
|
|
4
|
+
import BaseButton from "./BaseButton.js";
|
|
5
|
+
import BaseText from "./BaseText.js";
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
export default function BaseConfirmationModal({
|
|
8
|
+
visible,
|
|
9
|
+
title,
|
|
10
|
+
body,
|
|
11
|
+
confirmText = 'Aceptar',
|
|
12
|
+
cancelText = 'Cancelar',
|
|
13
|
+
onConfirm,
|
|
14
|
+
onCancel,
|
|
15
|
+
countdownSecs = 0,
|
|
16
|
+
loading = false,
|
|
17
|
+
...props
|
|
18
|
+
}) {
|
|
19
|
+
return /*#__PURE__*/_jsx(Modal, {
|
|
20
|
+
animationType: "fade",
|
|
21
|
+
transparent: true,
|
|
22
|
+
visible: visible,
|
|
23
|
+
onRequestClose: () => onCancel(),
|
|
24
|
+
...props,
|
|
25
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
26
|
+
className: "flex-1 items-center justify-center bg-overlay",
|
|
27
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
28
|
+
className: "m-4 flex flex-col space-y-4 rounded-lg bg-primary p-8",
|
|
29
|
+
children: [/*#__PURE__*/_jsx(BaseText, {
|
|
30
|
+
className: "mb-4 text-lg font-semibold",
|
|
31
|
+
children: title
|
|
32
|
+
}), typeof body === 'string' ? /*#__PURE__*/_jsx(BaseText, {
|
|
33
|
+
className: "text-base",
|
|
34
|
+
children: body
|
|
35
|
+
}) : body, /*#__PURE__*/_jsx(BaseButton, {
|
|
36
|
+
text: confirmText,
|
|
37
|
+
onPress: onConfirm,
|
|
38
|
+
loading: loading,
|
|
39
|
+
countdownSecs: countdownSecs
|
|
40
|
+
}), /*#__PURE__*/_jsx(BaseButton, {
|
|
41
|
+
variant: "secondary",
|
|
42
|
+
text: cancelText,
|
|
43
|
+
onPress: onCancel
|
|
44
|
+
})]
|
|
45
|
+
})
|
|
46
|
+
})
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=BaseConfirmationModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["View","Modal","BaseButton","BaseText","jsx","_jsx","jsxs","_jsxs","BaseConfirmationModal","visible","title","body","confirmText","cancelText","onConfirm","onCancel","countdownSecs","loading","props","animationType","transparent","onRequestClose","children","className","text","onPress","variant"],"sourceRoot":"../../../src","sources":["components/BaseConfirmationModal.tsx"],"mappings":";;A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F,CAAC;AAEZ","ignoreList":[]}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { View } from 'react-native';
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
function getColorClasses(color) {
|
|
6
|
+
switch (color) {
|
|
7
|
+
case 'primary':
|
|
8
|
+
return {
|
|
9
|
+
box: 'bg-brand-solid',
|
|
10
|
+
icon: 'text-primary_on-brand'
|
|
11
|
+
};
|
|
12
|
+
case 'light-blue':
|
|
13
|
+
return {
|
|
14
|
+
box: 'bg-utility-blue-100',
|
|
15
|
+
icon: 'text-utility-blue-700'
|
|
16
|
+
};
|
|
17
|
+
case 'green':
|
|
18
|
+
return {
|
|
19
|
+
box: 'bg-success-primary',
|
|
20
|
+
icon: 'text-success-primary'
|
|
21
|
+
};
|
|
22
|
+
case 'white':
|
|
23
|
+
default:
|
|
24
|
+
return {
|
|
25
|
+
box: 'bg-transparent',
|
|
26
|
+
icon: 'text-primary'
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function getSizeClasses(size) {
|
|
31
|
+
switch (size) {
|
|
32
|
+
case 'xxs':
|
|
33
|
+
return {
|
|
34
|
+
box: 'h-6 w-6'
|
|
35
|
+
};
|
|
36
|
+
case 'xs':
|
|
37
|
+
return {
|
|
38
|
+
box: 'w-8 h-8'
|
|
39
|
+
};
|
|
40
|
+
case 'sm':
|
|
41
|
+
return {
|
|
42
|
+
box: 'w-12 h-12'
|
|
43
|
+
};
|
|
44
|
+
case 'lg':
|
|
45
|
+
return {
|
|
46
|
+
box: 'w-16 h-16'
|
|
47
|
+
};
|
|
48
|
+
case 'md':
|
|
49
|
+
default:
|
|
50
|
+
return {
|
|
51
|
+
box: 'w-20 h-20'
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
export default function BaseIconBox({
|
|
56
|
+
color = 'primary',
|
|
57
|
+
size = 'sm',
|
|
58
|
+
Icon,
|
|
59
|
+
style = {},
|
|
60
|
+
...iconProps
|
|
61
|
+
}) {
|
|
62
|
+
const colorClasses = getColorClasses(color);
|
|
63
|
+
const sizeClasses = getSizeClasses(size);
|
|
64
|
+
return /*#__PURE__*/_jsx(View, {
|
|
65
|
+
className: `${colorClasses.box} ${sizeClasses.box} flex shrink-0 items-center justify-center rounded-md p-1`,
|
|
66
|
+
style: style,
|
|
67
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
68
|
+
className: colorClasses.icon,
|
|
69
|
+
...iconProps
|
|
70
|
+
})
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=BaseIconBox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["View","jsx","_jsx","getColorClasses","color","box","icon","getSizeClasses","size","BaseIconBox","Icon","style","iconProps","colorClasses","sizeClasses","className","children"],"sourceRoot":"../../../src","sources":["components/BaseIconBox.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAapC,SAASC,eAAeA,CAACC,KAAgB,EAAiC;EACxE,QAAQA,KAAK;IACX,KAAK,SAAS;MACZ,OAAO;QAAEC,GAAG,EAAE,gBAAgB;QAAEC,IAAI,EAAE;MAAwB,CAAC;IACjE,KAAK,YAAY;MACf,OAAO;QAAED,GAAG,EAAE,qBAAqB;QAAEC,IAAI,EAAE;MAAwB,CAAC;IACtE,KAAK,OAAO;MACV,OAAO;QAAED,GAAG,EAAE,oBAAoB;QAAEC,IAAI,EAAE;MAAuB,CAAC;IACpE,KAAK,OAAO;IACZ;MACE,OAAO;QAAED,GAAG,EAAE,gBAAgB;QAAEC,IAAI,EAAE;MAAe,CAAC;EAC1D;AACF;AAEA,SAASC,cAAcA,CAACC,IAAc,EAAmB;EACvD,QAAQA,IAAI;IACV,KAAK,KAAK;MACR,OAAO;QAAEH,GAAG,EAAE;MAAU,CAAC;IAC3B,KAAK,IAAI;MACP,OAAO;QAAEA,GAAG,EAAE;MAAU,CAAC;IAC3B,KAAK,IAAI;MACP,OAAO;QAAEA,GAAG,EAAE;MAAY,CAAC;IAC7B,KAAK,IAAI;MACP,OAAO;QAAEA,GAAG,EAAE;MAAY,CAAC;IAC7B,KAAK,IAAI;IACT;MACE,OAAO;QAAEA,GAAG,EAAE;MAAY,CAAC;EAC/B;AACF;AAEA,eAAe,SAASI,WAAWA,CAAC;EAClCL,KAAK,GAAG,SAAS;EACjBI,IAAI,GAAG,IAAI;EACXE,IAAI;EACJC,KAAK,GAAG,CAAC,CAAC;EACV,GAAGC;AACa,CAAC,EAAE;EACnB,MAAMC,YAAY,GAAGV,eAAe,CAACC,KAAK,CAAC;EAC3C,MAAMU,WAAW,GAAGP,cAAc,CAACC,IAAI,CAAC;EAExC,oBACEN,IAAA,CAACF,IAAI;IACHe,SAAS,EAAE,GAAGF,YAAY,CAACR,GAAG,IAAIS,WAAW,CAACT,GAAG,2DAA4D;IAC7GM,KAAK,EAAEA,KAAM;IAAAK,QAAA,eAEbd,IAAA,CAACQ,IAAI;MACHK,SAAS,EAAEF,YAAY,CAACP,IAAK;MAAA,GACzBM;IAAS,CACd;EAAC,CACE,CAAC;AAEX","ignoreList":[]}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
export { default as BaseButton } from "./BaseButton.js";
|
|
4
4
|
export { default as BaseBadge } from "./BaseBadge.js";
|
|
5
|
+
export { default as BaseConfirmationModal } from "./BaseConfirmationModal.js";
|
|
6
|
+
export { default as BaseIconBox } from "./BaseIconBox.js";
|
|
5
7
|
export { default as BaseSpinner } from "./BaseSpinner.js";
|
|
6
8
|
export { default as BaseStackedList } from "./BaseStackedList.js";
|
|
7
9
|
export { default as BaseIcon } from "./BaseIcon.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["default","BaseButton","BaseBadge","BaseSpinner","BaseStackedList","BaseIcon","BaseAlert","BaseSelect","SelectOption","FormikSelect","BaseHorizontalTabs","Tab","BaseSelectionItem","BaseRadioGroup","FormikRadioGroup","BaseDateInput","FormikDateInput","BaseSwitch","PressableOpacity","BaseText"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA,SAASA,OAAO,IAAIC,UAAU,QAAQ,iBAAc;AACpD,SAASD,OAAO,IAAIE,SAAS,QAAQ,gBAAa;AAClD,SAASF,OAAO,IAAIG,WAAW,QAAQ,kBAAe;AACtD,
|
|
1
|
+
{"version":3,"names":["default","BaseButton","BaseBadge","BaseConfirmationModal","BaseIconBox","BaseSpinner","BaseStackedList","BaseIcon","BaseAlert","BaseSelect","SelectOption","FormikSelect","BaseHorizontalTabs","Tab","BaseSelectionItem","BaseRadioGroup","FormikRadioGroup","BaseDateInput","FormikDateInput","BaseSwitch","PressableOpacity","BaseText"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA,SAASA,OAAO,IAAIC,UAAU,QAAQ,iBAAc;AACpD,SAASD,OAAO,IAAIE,SAAS,QAAQ,gBAAa;AAClD,SAASF,OAAO,IAAIG,qBAAqB,QAAQ,4BAAyB;AAC1E,SAASH,OAAO,IAAII,WAAW,QAAQ,kBAAe;AACtD,SAASJ,OAAO,IAAIK,WAAW,QAAQ,kBAAe;AACtD,SAASL,OAAO,IAAIM,eAAe,QAAQ,sBAAmB;AAC9D,SAASN,OAAO,IAAIO,QAAQ,QAAQ,eAAY;AAChD,SAASP,OAAO,IAAIQ,SAAS,QAAQ,gBAAa;AAClD,SAASR,OAAO,IAAIS,UAAU,EAAEC,YAAY,QAAQ,iBAAc;AAClE,SAASV,OAAO,IAAIW,YAAY,QAAQ,mBAAgB;AACxD,SAASX,OAAO,IAAIY,kBAAkB,EAAEC,GAAG,QAAQ,yBAAsB;AACzE,SAASb,OAAO,IAAIc,iBAAiB,QAAQ,wBAAqB;AAClE,SAASd,OAAO,IAAIe,cAAc,QAAQ,qBAAkB;AAC5D,SAASf,OAAO,IAAIgB,gBAAgB,QAAQ,uBAAoB;AAChE,SAAShB,OAAO,IAAIiB,aAAa,QAAQ,oBAAiB;AAC1D,SAASjB,OAAO,IAAIkB,eAAe,QAAQ,sBAAmB;AAC9D,SAASlB,OAAO,IAAImB,UAAU,QAAQ,iBAAc;AACpD,SAASnB,OAAO,IAAIoB,gBAAgB,QAAQ,uBAAoB;AAChE,SAASpB,OAAO,IAAIqB,QAAQ,QAAQ,eAAY","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Modal } from 'react-native';
|
|
3
|
+
interface Props extends React.ComponentProps<typeof Modal> {
|
|
4
|
+
visible: boolean;
|
|
5
|
+
title: string;
|
|
6
|
+
body: string | React.ReactNode;
|
|
7
|
+
confirmText?: string;
|
|
8
|
+
cancelText?: string;
|
|
9
|
+
onConfirm: () => void;
|
|
10
|
+
onCancel: () => void;
|
|
11
|
+
countdownSecs?: number;
|
|
12
|
+
loading?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export default function BaseConfirmationModal({ visible, title, body, confirmText, cancelText, onConfirm, onCancel, countdownSecs, loading, ...props }: Props): import("react").JSX.Element;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=BaseConfirmationModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseConfirmationModal.d.ts","sourceRoot":"","sources":["../../../../src/components/BaseConfirmationModal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAQ,KAAK,EAAE,MAAM,cAAc,CAAC;AAK3C,UAAU,KAAM,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC;IACxD,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,EAC5C,OAAO,EACP,KAAK,EACL,IAAI,EACJ,WAAuB,EACvB,UAAuB,EACvB,SAAS,EACT,QAAQ,EACR,aAAiB,EACjB,OAAe,EACf,GAAG,KAAK,EACT,EAAE,KAAK,+BAkCP"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { HeroIconProps } from '../types/heroicons';
|
|
3
|
+
type ColorType = 'primary' | 'white' | 'light-blue' | 'green';
|
|
4
|
+
type SizeType = 'xxs' | 'xs' | 'sm' | 'md' | 'lg';
|
|
5
|
+
interface BaseIconBoxProps extends HeroIconProps {
|
|
6
|
+
color?: ColorType;
|
|
7
|
+
size?: SizeType;
|
|
8
|
+
Icon: React.ComponentType;
|
|
9
|
+
}
|
|
10
|
+
export default function BaseIconBox({ color, size, Icon, style, ...iconProps }: BaseIconBoxProps): import("react").JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=BaseIconBox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseIconBox.d.ts","sourceRoot":"","sources":["../../../../src/components/BaseIconBox.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,KAAK,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,YAAY,GAAG,OAAO,CAAC;AAC9D,KAAK,QAAQ,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAElD,UAAU,gBAAiB,SAAQ,aAAa;IAC9C,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC;CAC3B;AAgCD,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,KAAiB,EACjB,IAAW,EACX,IAAI,EACJ,KAAU,EACV,GAAG,SAAS,EACb,EAAE,gBAAgB,+BAelB"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { default as BaseButton } from './BaseButton';
|
|
2
2
|
export { default as BaseBadge } from './BaseBadge';
|
|
3
|
+
export { default as BaseConfirmationModal } from './BaseConfirmationModal';
|
|
4
|
+
export { default as BaseIconBox } from './BaseIconBox';
|
|
3
5
|
export { default as BaseSpinner } from './BaseSpinner';
|
|
4
6
|
export { default as BaseStackedList } from './BaseStackedList';
|
|
5
7
|
export { default as BaseIcon } from './BaseIcon';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC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OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Modal } from 'react-native';
|
|
3
|
+
interface Props extends React.ComponentProps<typeof Modal> {
|
|
4
|
+
visible: boolean;
|
|
5
|
+
title: string;
|
|
6
|
+
body: string | React.ReactNode;
|
|
7
|
+
confirmText?: string;
|
|
8
|
+
cancelText?: string;
|
|
9
|
+
onConfirm: () => void;
|
|
10
|
+
onCancel: () => void;
|
|
11
|
+
countdownSecs?: number;
|
|
12
|
+
loading?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export default function BaseConfirmationModal({ visible, title, body, confirmText, cancelText, onConfirm, onCancel, countdownSecs, loading, ...props }: Props): import("react").JSX.Element;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=BaseConfirmationModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseConfirmationModal.d.ts","sourceRoot":"","sources":["../../../../src/components/BaseConfirmationModal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAQ,KAAK,EAAE,MAAM,cAAc,CAAC;AAK3C,UAAU,KAAM,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC;IACxD,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,EAC5C,OAAO,EACP,KAAK,EACL,IAAI,EACJ,WAAuB,EACvB,UAAuB,EACvB,SAAS,EACT,QAAQ,EACR,aAAiB,EACjB,OAAe,EACf,GAAG,KAAK,EACT,EAAE,KAAK,+BAkCP"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { HeroIconProps } from '../types/heroicons';
|
|
3
|
+
type ColorType = 'primary' | 'white' | 'light-blue' | 'green';
|
|
4
|
+
type SizeType = 'xxs' | 'xs' | 'sm' | 'md' | 'lg';
|
|
5
|
+
interface BaseIconBoxProps extends HeroIconProps {
|
|
6
|
+
color?: ColorType;
|
|
7
|
+
size?: SizeType;
|
|
8
|
+
Icon: React.ComponentType;
|
|
9
|
+
}
|
|
10
|
+
export default function BaseIconBox({ color, size, Icon, style, ...iconProps }: BaseIconBoxProps): import("react").JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=BaseIconBox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseIconBox.d.ts","sourceRoot":"","sources":["../../../../src/components/BaseIconBox.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,KAAK,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,YAAY,GAAG,OAAO,CAAC;AAC9D,KAAK,QAAQ,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAElD,UAAU,gBAAiB,SAAQ,aAAa;IAC9C,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC;CAC3B;AAgCD,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,KAAiB,EACjB,IAAW,EACX,IAAI,EACJ,KAAU,EACV,GAAG,SAAS,EACb,EAAE,gBAAgB,+BAelB"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { default as BaseButton } from './BaseButton';
|
|
2
2
|
export { default as BaseBadge } from './BaseBadge';
|
|
3
|
+
export { default as BaseConfirmationModal } from './BaseConfirmationModal';
|
|
4
|
+
export { default as BaseIconBox } from './BaseIconBox';
|
|
3
5
|
export { default as BaseSpinner } from './BaseSpinner';
|
|
4
6
|
export { default as BaseStackedList } from './BaseStackedList';
|
|
5
7
|
export { default as BaseIcon } from './BaseIcon';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,YAAY,EAAE,MA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AAC;AACnD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grupalia/rn-ui-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "Grupalia React Native UI Kit",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/module/index.d.ts",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"build": "bob build",
|
|
18
18
|
"typecheck": "tsc --noEmit",
|
|
19
19
|
"prepare": "bob build",
|
|
20
|
-
"publish-local": "npx yalc publish"
|
|
20
|
+
"publish-local": "npx yalc publish",
|
|
21
|
+
"bump-version": "npm version minor --message 'chore(release): bump version'"
|
|
21
22
|
},
|
|
22
23
|
"peerDependencies": {
|
|
23
24
|
"@gorhom/bottom-sheet": "^5",
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { View, Modal } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import BaseButton from './BaseButton';
|
|
4
|
+
import BaseText from './BaseText';
|
|
5
|
+
|
|
6
|
+
interface Props extends React.ComponentProps<typeof Modal> {
|
|
7
|
+
visible: boolean;
|
|
8
|
+
title: string;
|
|
9
|
+
body: string | React.ReactNode;
|
|
10
|
+
confirmText?: string;
|
|
11
|
+
cancelText?: string;
|
|
12
|
+
onConfirm: () => void;
|
|
13
|
+
onCancel: () => void;
|
|
14
|
+
countdownSecs?: number;
|
|
15
|
+
loading?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default function BaseConfirmationModal({
|
|
19
|
+
visible,
|
|
20
|
+
title,
|
|
21
|
+
body,
|
|
22
|
+
confirmText = 'Aceptar',
|
|
23
|
+
cancelText = 'Cancelar',
|
|
24
|
+
onConfirm,
|
|
25
|
+
onCancel,
|
|
26
|
+
countdownSecs = 0,
|
|
27
|
+
loading = false,
|
|
28
|
+
...props
|
|
29
|
+
}: Props) {
|
|
30
|
+
return (
|
|
31
|
+
<Modal
|
|
32
|
+
animationType="fade"
|
|
33
|
+
transparent
|
|
34
|
+
visible={visible}
|
|
35
|
+
onRequestClose={() => onCancel()}
|
|
36
|
+
{...props}
|
|
37
|
+
>
|
|
38
|
+
<View className="flex-1 items-center justify-center bg-overlay">
|
|
39
|
+
<View className="m-4 flex flex-col space-y-4 rounded-lg bg-primary p-8">
|
|
40
|
+
<BaseText className="mb-4 text-lg font-semibold">
|
|
41
|
+
{title}
|
|
42
|
+
</BaseText>
|
|
43
|
+
{typeof body === 'string' ? (
|
|
44
|
+
<BaseText className="text-base">
|
|
45
|
+
{body}
|
|
46
|
+
</BaseText>
|
|
47
|
+
) : body}
|
|
48
|
+
<BaseButton
|
|
49
|
+
text={confirmText}
|
|
50
|
+
onPress={onConfirm}
|
|
51
|
+
loading={loading}
|
|
52
|
+
countdownSecs={countdownSecs}
|
|
53
|
+
/>
|
|
54
|
+
<BaseButton
|
|
55
|
+
variant="secondary"
|
|
56
|
+
text={cancelText}
|
|
57
|
+
onPress={onCancel}
|
|
58
|
+
/>
|
|
59
|
+
</View>
|
|
60
|
+
</View>
|
|
61
|
+
</Modal>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { View } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import { HeroIconProps } from '../types/heroicons';
|
|
4
|
+
|
|
5
|
+
type ColorType = 'primary' | 'white' | 'light-blue' | 'green';
|
|
6
|
+
type SizeType = 'xxs' | 'xs' | 'sm' | 'md' | 'lg';
|
|
7
|
+
|
|
8
|
+
interface BaseIconBoxProps extends HeroIconProps {
|
|
9
|
+
color?: ColorType;
|
|
10
|
+
size?: SizeType;
|
|
11
|
+
Icon: React.ComponentType;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function getColorClasses(color: ColorType): { box: string; icon: string } {
|
|
15
|
+
switch (color) {
|
|
16
|
+
case 'primary':
|
|
17
|
+
return { box: 'bg-brand-solid', icon: 'text-primary_on-brand' };
|
|
18
|
+
case 'light-blue':
|
|
19
|
+
return { box: 'bg-utility-blue-100', icon: 'text-utility-blue-700' };
|
|
20
|
+
case 'green':
|
|
21
|
+
return { box: 'bg-success-primary', icon: 'text-success-primary' };
|
|
22
|
+
case 'white':
|
|
23
|
+
default:
|
|
24
|
+
return { box: 'bg-transparent', icon: 'text-primary' };
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function getSizeClasses(size: SizeType): { box: string } {
|
|
29
|
+
switch (size) {
|
|
30
|
+
case 'xxs':
|
|
31
|
+
return { box: 'h-6 w-6' };
|
|
32
|
+
case 'xs':
|
|
33
|
+
return { box: 'w-8 h-8' };
|
|
34
|
+
case 'sm':
|
|
35
|
+
return { box: 'w-12 h-12' };
|
|
36
|
+
case 'lg':
|
|
37
|
+
return { box: 'w-16 h-16' };
|
|
38
|
+
case 'md':
|
|
39
|
+
default:
|
|
40
|
+
return { box: 'w-20 h-20' };
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default function BaseIconBox({
|
|
45
|
+
color = 'primary',
|
|
46
|
+
size = 'sm',
|
|
47
|
+
Icon,
|
|
48
|
+
style = {},
|
|
49
|
+
...iconProps
|
|
50
|
+
}: BaseIconBoxProps) {
|
|
51
|
+
const colorClasses = getColorClasses(color);
|
|
52
|
+
const sizeClasses = getSizeClasses(size);
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<View
|
|
56
|
+
className={`${colorClasses.box} ${sizeClasses.box} flex shrink-0 items-center justify-center rounded-md p-1`}
|
|
57
|
+
style={style}
|
|
58
|
+
>
|
|
59
|
+
<Icon
|
|
60
|
+
className={colorClasses.icon}
|
|
61
|
+
{...iconProps}
|
|
62
|
+
/>
|
|
63
|
+
</View>
|
|
64
|
+
);
|
|
65
|
+
}
|
package/src/components/index.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { default as BaseButton } from './BaseButton';
|
|
2
2
|
export { default as BaseBadge } from './BaseBadge';
|
|
3
|
+
export { default as BaseConfirmationModal } from './BaseConfirmationModal';
|
|
4
|
+
export { default as BaseIconBox } from './BaseIconBox';
|
|
3
5
|
export { default as BaseSpinner } from './BaseSpinner';
|
|
4
6
|
export { default as BaseStackedList } from './BaseStackedList';
|
|
5
7
|
export { default as BaseIcon } from './BaseIcon';
|