@grupalia/rn-ui-kit 0.32.0 → 0.34.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/AppNotificationModal.js +155 -0
- package/lib/commonjs/components/AppNotificationModal.js.map +1 -0
- package/lib/commonjs/components/AppNotifications.js +98 -0
- package/lib/commonjs/components/AppNotifications.js.map +1 -0
- package/lib/commonjs/components/BaseAlert.js +40 -96
- package/lib/commonjs/components/BaseAlert.js.map +1 -1
- package/lib/commonjs/components/BasePing.js +59 -0
- package/lib/commonjs/components/BasePing.js.map +1 -0
- package/lib/commonjs/components/DateTimeSelector.js +11 -6
- package/lib/commonjs/components/DateTimeSelector.js.map +1 -1
- package/lib/commonjs/components/NotificationDrawer.js +53 -0
- package/lib/commonjs/components/NotificationDrawer.js.map +1 -0
- package/lib/commonjs/components/index.js +28 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/components/notifications/types.js +2 -0
- package/lib/commonjs/components/notifications/types.js.map +1 -0
- package/lib/commonjs/utils/index.js +11 -0
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/svg.js +15 -0
- package/lib/commonjs/utils/svg.js.map +1 -0
- package/lib/module/components/AppNotificationModal.js +150 -0
- package/lib/module/components/AppNotificationModal.js.map +1 -0
- package/lib/module/components/AppNotifications.js +93 -0
- package/lib/module/components/AppNotifications.js.map +1 -0
- package/lib/module/components/BaseAlert.js +41 -97
- package/lib/module/components/BaseAlert.js.map +1 -1
- package/lib/module/components/BasePing.js +55 -0
- package/lib/module/components/BasePing.js.map +1 -0
- package/lib/module/components/DateTimeSelector.js +11 -6
- package/lib/module/components/DateTimeSelector.js.map +1 -1
- package/lib/module/components/NotificationDrawer.js +48 -0
- package/lib/module/components/NotificationDrawer.js.map +1 -0
- package/lib/module/components/index.js +4 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/notifications/types.js +2 -0
- package/lib/module/components/notifications/types.js.map +1 -0
- package/lib/module/utils/index.js +1 -0
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/svg.js +12 -0
- package/lib/module/utils/svg.js.map +1 -0
- package/lib/typescript/commonjs/components/AppNotificationModal.d.ts +10 -0
- package/lib/typescript/commonjs/components/AppNotificationModal.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/AppNotifications.d.ts +11 -0
- package/lib/typescript/commonjs/components/AppNotifications.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/BaseAlert.d.ts +1 -1
- package/lib/typescript/commonjs/components/BaseAlert.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/BasePing.d.ts +10 -0
- package/lib/typescript/commonjs/components/BasePing.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/DateTimeSelector.d.ts +2 -0
- package/lib/typescript/commonjs/components/DateTimeSelector.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/NotificationDrawer.d.ts +13 -0
- package/lib/typescript/commonjs/components/NotificationDrawer.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/index.d.ts +4 -0
- package/lib/typescript/commonjs/components/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/notifications/types.d.ts +14 -0
- package/lib/typescript/commonjs/components/notifications/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/index.d.ts +1 -0
- package/lib/typescript/commonjs/utils/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/utils/svg.d.ts +3 -0
- package/lib/typescript/commonjs/utils/svg.d.ts.map +1 -0
- package/lib/typescript/module/components/AppNotificationModal.d.ts +10 -0
- package/lib/typescript/module/components/AppNotificationModal.d.ts.map +1 -0
- package/lib/typescript/module/components/AppNotifications.d.ts +11 -0
- package/lib/typescript/module/components/AppNotifications.d.ts.map +1 -0
- package/lib/typescript/module/components/BaseAlert.d.ts +1 -1
- package/lib/typescript/module/components/BaseAlert.d.ts.map +1 -1
- package/lib/typescript/module/components/BasePing.d.ts +10 -0
- package/lib/typescript/module/components/BasePing.d.ts.map +1 -0
- package/lib/typescript/module/components/DateTimeSelector.d.ts +2 -0
- package/lib/typescript/module/components/DateTimeSelector.d.ts.map +1 -1
- package/lib/typescript/module/components/NotificationDrawer.d.ts +13 -0
- package/lib/typescript/module/components/NotificationDrawer.d.ts.map +1 -0
- package/lib/typescript/module/components/index.d.ts +4 -0
- package/lib/typescript/module/components/index.d.ts.map +1 -1
- package/lib/typescript/module/components/notifications/types.d.ts +14 -0
- package/lib/typescript/module/components/notifications/types.d.ts.map +1 -0
- package/lib/typescript/module/utils/index.d.ts +1 -0
- package/lib/typescript/module/utils/index.d.ts.map +1 -1
- package/lib/typescript/module/utils/svg.d.ts +3 -0
- package/lib/typescript/module/utils/svg.d.ts.map +1 -0
- package/package.json +3 -1
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = AppNotificationModal;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _reactNativeRenderHtml = _interopRequireDefault(require("react-native-render-html"));
|
|
9
|
+
var _reactNativeSvg = require("react-native-svg");
|
|
10
|
+
var _BaseButton = _interopRequireDefault(require("./BaseButton"));
|
|
11
|
+
var _BaseText = _interopRequireDefault(require("./BaseText"));
|
|
12
|
+
var _hocComponents = require("../hoc-components");
|
|
13
|
+
var _useTimezonedDate = require("../hooks/useTimezonedDate");
|
|
14
|
+
var _foregroundColors = _interopRequireDefault(require("../styles/foreground-colors"));
|
|
15
|
+
var _utilityColors = _interopRequireDefault(require("../styles/utility-colors"));
|
|
16
|
+
var _utils = require("../utils");
|
|
17
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
|
+
const BRAND_COLOR = _foregroundColors.default['fg-brand-primary'].light;
|
|
20
|
+
const htmlStyles = {
|
|
21
|
+
body: {
|
|
22
|
+
fontSize: 16,
|
|
23
|
+
lineHeight: 24,
|
|
24
|
+
color: _foregroundColors.default['fg-secondary'].light
|
|
25
|
+
},
|
|
26
|
+
p: {
|
|
27
|
+
marginVertical: 8
|
|
28
|
+
},
|
|
29
|
+
strong: {
|
|
30
|
+
fontWeight: 'bold',
|
|
31
|
+
color: BRAND_COLOR
|
|
32
|
+
},
|
|
33
|
+
b: {
|
|
34
|
+
fontWeight: 'bold',
|
|
35
|
+
color: BRAND_COLOR
|
|
36
|
+
},
|
|
37
|
+
em: {
|
|
38
|
+
fontStyle: 'italic'
|
|
39
|
+
},
|
|
40
|
+
i: {
|
|
41
|
+
fontStyle: 'italic'
|
|
42
|
+
},
|
|
43
|
+
u: {
|
|
44
|
+
textDecorationLine: 'underline'
|
|
45
|
+
},
|
|
46
|
+
s: {
|
|
47
|
+
textDecorationLine: 'line-through'
|
|
48
|
+
},
|
|
49
|
+
strike: {
|
|
50
|
+
textDecorationLine: 'line-through'
|
|
51
|
+
},
|
|
52
|
+
del: {
|
|
53
|
+
textDecorationLine: 'line-through'
|
|
54
|
+
},
|
|
55
|
+
a: {
|
|
56
|
+
fontWeight: '500',
|
|
57
|
+
color: BRAND_COLOR,
|
|
58
|
+
textDecorationLine: 'underline'
|
|
59
|
+
},
|
|
60
|
+
h1: {
|
|
61
|
+
fontSize: 24,
|
|
62
|
+
fontWeight: 'bold',
|
|
63
|
+
marginVertical: 12,
|
|
64
|
+
lineHeight: 32
|
|
65
|
+
},
|
|
66
|
+
blockquote: {
|
|
67
|
+
borderLeftWidth: 4,
|
|
68
|
+
borderLeftColor: _utilityColors.default['utility-gray-200'].light,
|
|
69
|
+
paddingLeft: 16,
|
|
70
|
+
marginVertical: 8,
|
|
71
|
+
backgroundColor: _utilityColors.default['utility-gray-50'].light,
|
|
72
|
+
paddingVertical: 8
|
|
73
|
+
},
|
|
74
|
+
code: {
|
|
75
|
+
backgroundColor: _utilityColors.default['utility-gray-100'].light,
|
|
76
|
+
paddingHorizontal: 4,
|
|
77
|
+
paddingVertical: 2,
|
|
78
|
+
fontSize: 14,
|
|
79
|
+
borderRadius: 4
|
|
80
|
+
},
|
|
81
|
+
pre: {
|
|
82
|
+
backgroundColor: _utilityColors.default['utility-gray-100'].light,
|
|
83
|
+
padding: 12,
|
|
84
|
+
marginVertical: 8,
|
|
85
|
+
fontSize: 14,
|
|
86
|
+
borderRadius: 8
|
|
87
|
+
},
|
|
88
|
+
div: {
|
|
89
|
+
marginVertical: 4
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
const htmlClassesStyles = {
|
|
93
|
+
'trix-content': {
|
|
94
|
+
fontSize: 14,
|
|
95
|
+
lineHeight: 20
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
function AppNotificationModal({
|
|
99
|
+
notification,
|
|
100
|
+
onClose,
|
|
101
|
+
onRead
|
|
102
|
+
}) {
|
|
103
|
+
const {
|
|
104
|
+
tz
|
|
105
|
+
} = (0, _useTimezonedDate.useTimezonedDate)();
|
|
106
|
+
const {
|
|
107
|
+
width
|
|
108
|
+
} = _reactNative.Dimensions.get('window');
|
|
109
|
+
function handleRead() {
|
|
110
|
+
if (!notification.readAt) {
|
|
111
|
+
onRead(notification.id, tz().toISOString());
|
|
112
|
+
}
|
|
113
|
+
onClose();
|
|
114
|
+
}
|
|
115
|
+
const imageUrl = notification.portrait?.small?.url;
|
|
116
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_hocComponents.Modal, {
|
|
117
|
+
visible: true,
|
|
118
|
+
transparent: true,
|
|
119
|
+
animationType: "fade",
|
|
120
|
+
onRequestClose: onClose,
|
|
121
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_hocComponents.View, {
|
|
122
|
+
className: "flex-1 items-center justify-center bg-overlay/90 px-8 py-16",
|
|
123
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_hocComponents.View, {
|
|
124
|
+
className: "w-full space-y-5 rounded-lg bg-white p-4",
|
|
125
|
+
children: [!!imageUrl && /*#__PURE__*/(0, _jsxRuntime.jsx)(_hocComponents.View, {
|
|
126
|
+
className: "flex w-full items-center rounded-lg bg-tertiary py-3",
|
|
127
|
+
children: (0, _utils.isSvg)(imageUrl) ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.SvgUri, {
|
|
128
|
+
width: "180",
|
|
129
|
+
height: "180",
|
|
130
|
+
uri: imageUrl
|
|
131
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_hocComponents.Image, {
|
|
132
|
+
source: {
|
|
133
|
+
uri: imageUrl
|
|
134
|
+
},
|
|
135
|
+
className: "h-10 w-10 rounded-full"
|
|
136
|
+
})
|
|
137
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_BaseText.default, {
|
|
138
|
+
className: "text-center font-semibold",
|
|
139
|
+
children: notification.title
|
|
140
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeRenderHtml.default, {
|
|
141
|
+
contentWidth: width,
|
|
142
|
+
source: {
|
|
143
|
+
html: notification.body
|
|
144
|
+
},
|
|
145
|
+
tagsStyles: htmlStyles,
|
|
146
|
+
classesStyles: htmlClassesStyles
|
|
147
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_BaseButton.default, {
|
|
148
|
+
text: "Entendido",
|
|
149
|
+
onPress: () => handleRead()
|
|
150
|
+
})]
|
|
151
|
+
})
|
|
152
|
+
})
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=AppNotificationModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_reactNativeRenderHtml","_interopRequireDefault","_reactNativeSvg","_BaseButton","_BaseText","_hocComponents","_useTimezonedDate","_foregroundColors","_utilityColors","_utils","_jsxRuntime","e","__esModule","default","BRAND_COLOR","foregroundColors","light","htmlStyles","body","fontSize","lineHeight","color","p","marginVertical","strong","fontWeight","b","em","fontStyle","i","u","textDecorationLine","s","strike","del","a","h1","blockquote","borderLeftWidth","borderLeftColor","utilityColors","paddingLeft","backgroundColor","paddingVertical","code","paddingHorizontal","borderRadius","pre","padding","div","htmlClassesStyles","AppNotificationModal","notification","onClose","onRead","tz","useTimezonedDate","width","Dimensions","get","handleRead","readAt","id","toISOString","imageUrl","portrait","small","url","jsx","Modal","visible","transparent","animationType","onRequestClose","children","View","className","jsxs","isSvg","SvgUri","height","uri","Image","source","title","contentWidth","html","tagsStyles","classesStyles","text","onPress"],"sourceRoot":"../../../src","sources":["components/AppNotificationModal.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AAEA,IAAAI,WAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,SAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,cAAA,GAAAN,OAAA;AACA,IAAAO,iBAAA,GAAAP,OAAA;AACA,IAAAQ,iBAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,cAAA,GAAAP,sBAAA,CAAAF,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AAAiC,IAAAW,WAAA,GAAAX,OAAA;AAAA,SAAAE,uBAAAU,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGjC,MAAMG,WAAW,GAAGC,yBAAgB,CAAC,kBAAkB,CAAC,CAACC,KAAK;AAE9D,MAAMC,UAAU,GAAG;EACjBC,IAAI,EAAE;IACJC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,EAAE;IACdC,KAAK,EAAEN,yBAAgB,CAAC,cAAc,CAAC,CAACC;EAC1C,CAAC;EACDM,CAAC,EAAE;IACDC,cAAc,EAAE;EAClB,CAAC;EACDC,MAAM,EAAE;IACNC,UAAU,EAAE,MAAe;IAC3BJ,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IAAAtD,WAAA,CAAA0D,GAAA,EAAClE,eAAA,CAAA6E,MAAM;YACLtB,KAAK,EAAC,KAAK;YACXuB,MAAM,EAAC,KAAK;YACZC,GAAG,EAAEjB;UAAS,CACf,CAAC,gBAEF,IAAAtD,WAAA,CAAA0D,GAAA,EAAC/D,cAAA,CAAA6E,KAAK;YACJC,MAAM,EAAE;cAAEF,GAAG,EAAEjB;YAAS,CAAE;YAC1BY,SAAS,EAAC;UAAwB,CACnC;QACF,CACG,CACP,eACD,IAAAlE,WAAA,CAAA0D,GAAA,EAAChE,SAAA,CAAAS,OAAQ;UAAC+D,SAAS,EAAC,2BAA2B;UAAAF,QAAA,EAAEtB,YAAY,CAACgC;QAAK,CAAW,CAAC,eAC/E,IAAA1E,WAAA,CAAA0D,GAAA,EAACpE,sBAAA,CAAAa,OAAU;UACTwE,YAAY,EAAE5B,KAAM;UACpB0B,MAAM,EAAE;YAAEG,IAAI,EAAElC,YAAY,CAAClC;UAAK,CAAE;UACpCqE,UAAU,EAAEtE,UAAW;UACvBuE,aAAa,EAAEtC;QAAkB,CAClC,CAAC,eACF,IAAAxC,WAAA,CAAA0D,GAAA,EAACjE,WAAA,CAAAU,OAAU;UACT4E,IAAI,EAAC,WAAW;UAChBC,OAAO,EAAEA,CAAA,KAAM9B,UAAU,CAAC;QAAE,CAC7B,CAAC;MAAA,CACE;IAAC,CACH;EAAC,CACF,CAAC;AAEZ","ignoreList":[]}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = AppNotifications;
|
|
7
|
+
var _clsx = _interopRequireDefault(require("clsx"));
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _outline = require("react-native-heroicons/outline");
|
|
10
|
+
var _reactNativeSvg = require("react-native-svg");
|
|
11
|
+
var _AppNotificationModal = _interopRequireDefault(require("./AppNotificationModal"));
|
|
12
|
+
var _BaseIcon = _interopRequireDefault(require("./BaseIcon"));
|
|
13
|
+
var _BasePing = _interopRequireDefault(require("./BasePing"));
|
|
14
|
+
var _BaseText = _interopRequireDefault(require("./BaseText"));
|
|
15
|
+
var _PressableOpacity = _interopRequireDefault(require("./PressableOpacity"));
|
|
16
|
+
var _hocComponents = require("../hoc-components");
|
|
17
|
+
var _svg = require("../utils/svg");
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
|
+
function AppNotificationCard({
|
|
21
|
+
notification,
|
|
22
|
+
onPress,
|
|
23
|
+
className,
|
|
24
|
+
...props
|
|
25
|
+
}) {
|
|
26
|
+
const imageUrl = notification.portrait?.small?.url;
|
|
27
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_PressableOpacity.default, {
|
|
28
|
+
className: (0, _clsx.default)('flex flex-row items-center space-x-2', className),
|
|
29
|
+
onPress: onPress,
|
|
30
|
+
...props,
|
|
31
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_hocComponents.View, {
|
|
32
|
+
className: "h-14 w-14 items-center justify-center rounded-full border border-primary bg-quaternary",
|
|
33
|
+
children: [!!imageUrl && (0, _svg.isSvg)(imageUrl) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeSvg.SvgUri, {
|
|
34
|
+
width: "40",
|
|
35
|
+
height: "40",
|
|
36
|
+
uri: imageUrl
|
|
37
|
+
}), !!imageUrl && !(0, _svg.isSvg)(imageUrl) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_hocComponents.Image, {
|
|
38
|
+
source: {
|
|
39
|
+
uri: imageUrl
|
|
40
|
+
},
|
|
41
|
+
className: "h-10 w-10 rounded-full"
|
|
42
|
+
}), !notification.readAt && /*#__PURE__*/(0, _jsxRuntime.jsx)(_BasePing.default, {
|
|
43
|
+
className: "absolute -bottom-1 -right-1 mb-1 mr-1 h-3 w-3 rounded-full bg-warning-solid p-0.5"
|
|
44
|
+
})]
|
|
45
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_hocComponents.View, {
|
|
46
|
+
className: "flex-1",
|
|
47
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_BaseText.default, {
|
|
48
|
+
className: "text-sm font-medium text-secondary",
|
|
49
|
+
children: notification.title
|
|
50
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_BaseText.default, {
|
|
51
|
+
className: "text-sm text-tertiary",
|
|
52
|
+
children: notification.preview
|
|
53
|
+
})]
|
|
54
|
+
})]
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function AppNotifications({
|
|
58
|
+
visible,
|
|
59
|
+
onClose,
|
|
60
|
+
notifications,
|
|
61
|
+
onNotificationRead
|
|
62
|
+
}) {
|
|
63
|
+
const [selectedNotification, setSelectedNotification] = (0, _react.useState)(null);
|
|
64
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_hocComponents.Modal, {
|
|
65
|
+
visible: visible,
|
|
66
|
+
transparent: true,
|
|
67
|
+
onRequestClose: onClose,
|
|
68
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PressableOpacity.default, {
|
|
69
|
+
className: "flex-1 items-center justify-center bg-overlay/80 pl-10",
|
|
70
|
+
onPress: onClose,
|
|
71
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_hocComponents.Pressable, {
|
|
72
|
+
className: "w-full flex-1 bg-primary p-6",
|
|
73
|
+
onPress: e => e.stopPropagation(),
|
|
74
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_hocComponents.View, {
|
|
75
|
+
className: "mb-6 flex flex-row items-center justify-between",
|
|
76
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_BaseText.default, {
|
|
77
|
+
className: "font-semibold text-primary",
|
|
78
|
+
children: "Notificaciones"
|
|
79
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_BaseIcon.default, {
|
|
80
|
+
icon: _outline.XMarkIcon,
|
|
81
|
+
size: 24,
|
|
82
|
+
color: "fg-primary",
|
|
83
|
+
onPress: onClose
|
|
84
|
+
})]
|
|
85
|
+
}), notifications.map(notification => /*#__PURE__*/(0, _jsxRuntime.jsx)(AppNotificationCard, {
|
|
86
|
+
className: "mb-4",
|
|
87
|
+
notification: notification,
|
|
88
|
+
onPress: () => setSelectedNotification(notification)
|
|
89
|
+
}, notification.id)), selectedNotification && /*#__PURE__*/(0, _jsxRuntime.jsx)(_AppNotificationModal.default, {
|
|
90
|
+
notification: selectedNotification,
|
|
91
|
+
onClose: () => setSelectedNotification(null),
|
|
92
|
+
onRead: onNotificationRead
|
|
93
|
+
})]
|
|
94
|
+
})
|
|
95
|
+
})
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=AppNotifications.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_react","_outline","_reactNativeSvg","_AppNotificationModal","_BaseIcon","_BasePing","_BaseText","_PressableOpacity","_hocComponents","_svg","_jsxRuntime","e","__esModule","default","AppNotificationCard","notification","onPress","className","props","imageUrl","portrait","small","url","jsxs","clsx","children","View","isSvg","jsx","SvgUri","width","height","uri","Image","source","readAt","title","preview","AppNotifications","visible","onClose","notifications","onNotificationRead","selectedNotification","setSelectedNotification","useState","Modal","transparent","onRequestClose","Pressable","stopPropagation","icon","XMarkIcon","size","color","map","id","onRead"],"sourceRoot":"../../../src","sources":["components/AppNotifications.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AAEA,IAAAI,qBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,SAAA,GAAAN,sBAAA,CAAAC,OA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A,CAAAa,IAAA,EAACf,cAAA,CAAAkB,IAAI;UAACT,SAAS,EAAC,iDAAiD;UAAAQ,QAAA,gBAC/D,IAAAf,WAAA,CAAAkB,GAAA,EAACtB,SAAA,CAAAO,OAAQ;YAACI,SAAS,EAAC,4BAA4B;YAAAQ,QAAA,EAAC;UAAc,CAAU,CAAC,eAC1E,IAAAf,WAAA,CAAAkB,GAAA,EAACxB,SAAA,CAAAS,OAAQ;YACPsC,IAAI,EAAEC,kBAAU;YAChBC,IAAI,EAAE,EAAG;YACTC,KAAK,EAAC,YAAY;YAClBtC,OAAO,EAAEwB;UAAQ,CAClB,CAAC;QAAA,CACE,CAAC,EACNC,aAAa,CAACc,GAAG,CAAExC,YAAY,iBAC9B,IAAAL,WAAA,CAAAkB,GAAA,EAACd,mBAAmB;UAElBG,SAAS,EAAC,MAAM;UAChBF,YAAY,EAAEA,YAAa;UAC3BC,OAAO,EAAEA,CAAA,KAAM4B,uBAAuB,CAAC7B,YAAY;QAAE,GAHhDA,YAAY,CAACyC,EAInB,CACF,CAAC,EACDb,oBAAoB,iBACnB,IAAAjC,WAAA,CAAAkB,GAAA,EAACzB,qBAAA,CAAAU,OAAoB;UACnBE,YAAY,EAAE4B,oBAAqB;UACnCH,OAAO,EAAEA,CAAA,KAAMI,uBAAuB,CAAC,IAAI,CAAE;UAC7Ca,MAAM,EAAEf;QAAmB,CAC5B,CACF;MAAA,CACQ;IAAC,CACI;EAAC,CACd,CAAC;AAEZ","ignoreList":[]}
|
|
@@ -7,49 +7,27 @@ exports.default = void 0;
|
|
|
7
7
|
var _clsx = _interopRequireDefault(require("clsx"));
|
|
8
8
|
var _nativewind = require("nativewind");
|
|
9
9
|
var _outline = require("react-native-heroicons/outline");
|
|
10
|
-
var _solid = require("react-native-heroicons/solid");
|
|
11
10
|
var _hocComponents = require("../hoc-components");
|
|
12
11
|
var _BaseIcon = _interopRequireDefault(require("./BaseIcon"));
|
|
13
12
|
var _BaseText = _interopRequireDefault(require("./BaseText"));
|
|
14
13
|
var _useIsAboveBreakpoint = require("../hooks/useIsAboveBreakpoint");
|
|
14
|
+
var _foregroundColors = _interopRequireDefault(require("../styles/foreground-colors"));
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
17
|
function IconComponent({
|
|
18
|
-
type
|
|
19
|
-
variant = 'primary'
|
|
18
|
+
type
|
|
20
19
|
}) {
|
|
21
20
|
const iconColors = {
|
|
22
|
-
brand:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
},
|
|
26
|
-
error: {
|
|
27
|
-
primary: 'fg-white',
|
|
28
|
-
secondary: 'fg-error-primary'
|
|
29
|
-
},
|
|
30
|
-
success: {
|
|
31
|
-
primary: 'fg-white',
|
|
32
|
-
secondary: 'fg-success-primary'
|
|
33
|
-
},
|
|
34
|
-
alert: {
|
|
35
|
-
primary: 'fg-white',
|
|
36
|
-
secondary: 'fg-warning-primary'
|
|
37
|
-
}
|
|
21
|
+
brand: 'fg-brand-primary',
|
|
22
|
+
error: 'fg-error-primary',
|
|
23
|
+
alert: 'fg-warning-primary'
|
|
38
24
|
};
|
|
39
|
-
const icons = {
|
|
40
|
-
brand: _solid.InformationCircleIcon,
|
|
41
|
-
error: _solid.XCircleIcon,
|
|
42
|
-
success: _solid.CheckCircleIcon,
|
|
43
|
-
alert: _solid.ExclamationTriangleIcon
|
|
44
|
-
};
|
|
45
|
-
if (variant === 'secondary') {
|
|
46
|
-
icons.brand = _outline.InformationCircleIcon;
|
|
47
|
-
}
|
|
48
25
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_BaseIcon.default, {
|
|
49
|
-
icon:
|
|
50
|
-
size:
|
|
51
|
-
color: iconColors[type]
|
|
52
|
-
|
|
26
|
+
icon: _outline.InformationCircleIcon,
|
|
27
|
+
size: 16,
|
|
28
|
+
color: iconColors[type],
|
|
29
|
+
strokeWidth: 2,
|
|
30
|
+
className: "shrink-0"
|
|
53
31
|
});
|
|
54
32
|
}
|
|
55
33
|
function BaseAlert({
|
|
@@ -62,82 +40,48 @@ function BaseAlert({
|
|
|
62
40
|
}) {
|
|
63
41
|
const largePhone = (0, _useIsAboveBreakpoint.useIsAboveBreakpoint)('xs');
|
|
64
42
|
const alertClasses = () => {
|
|
65
|
-
if (variant === '
|
|
66
|
-
switch (type) {
|
|
67
|
-
case 'error':
|
|
68
|
-
return 'bg-error-solid';
|
|
69
|
-
case 'success':
|
|
70
|
-
return 'bg-success-solid';
|
|
71
|
-
case 'alert':
|
|
72
|
-
return 'bg-warning-solid';
|
|
73
|
-
case 'brand':
|
|
74
|
-
default:
|
|
75
|
-
return 'bg-brand-solid';
|
|
76
|
-
}
|
|
77
|
-
} else {
|
|
78
|
-
switch (type) {
|
|
79
|
-
case 'error':
|
|
80
|
-
return 'bg-white border border-error';
|
|
81
|
-
case 'success':
|
|
82
|
-
case 'alert':
|
|
83
|
-
return 'bg-white border border-primary';
|
|
84
|
-
case 'brand':
|
|
85
|
-
default:
|
|
86
|
-
return 'bg-white border border-brand';
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
const messageTextColor = () => {
|
|
91
|
-
if (variant === 'primary') {
|
|
92
|
-
return 'text-white';
|
|
93
|
-
}
|
|
43
|
+
if (variant === 'secondary') return 'bg-primary';
|
|
94
44
|
switch (type) {
|
|
95
45
|
case 'error':
|
|
96
|
-
return '
|
|
97
|
-
case 'success':
|
|
98
|
-
return 'text-success-primary';
|
|
46
|
+
return 'bg-error-primary';
|
|
99
47
|
case 'alert':
|
|
100
|
-
return '
|
|
48
|
+
return 'bg-warning-primary';
|
|
101
49
|
case 'brand':
|
|
102
50
|
default:
|
|
103
|
-
return '
|
|
51
|
+
return 'bg-brand-primary';
|
|
104
52
|
}
|
|
105
53
|
};
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
return 'text-error-primary';
|
|
113
|
-
case 'success':
|
|
114
|
-
return 'text-success-primary';
|
|
115
|
-
case 'alert':
|
|
116
|
-
return 'text-warning-primary';
|
|
117
|
-
case 'brand':
|
|
118
|
-
default:
|
|
119
|
-
return 'text-brand-tertiary';
|
|
120
|
-
}
|
|
54
|
+
|
|
55
|
+
// @TODO handle dark mode colors
|
|
56
|
+
const iconBorderColors = {
|
|
57
|
+
brand: _foregroundColors.default['fg-brand-primary'].light,
|
|
58
|
+
error: _foregroundColors.default['fg-error-primary'].light,
|
|
59
|
+
alert: _foregroundColors.default['fg-warning-primary'].light
|
|
121
60
|
};
|
|
122
61
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_hocComponents.View, {
|
|
123
|
-
className: (0, _clsx.default)('flex flex-
|
|
62
|
+
className: (0, _clsx.default)('flex w-full flex-col rounded-xl border border-primary', alertClasses(), largePhone ? 'p-4' : 'p-2'),
|
|
124
63
|
...props,
|
|
125
64
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_hocComponents.View, {
|
|
126
|
-
className: "
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
65
|
+
className: "items-center -ml-1.5 justify-center self-start rounded-full border-2 p-[4px]",
|
|
66
|
+
style: {
|
|
67
|
+
borderColor: `${iconBorderColors[type]}19`
|
|
68
|
+
},
|
|
69
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_hocComponents.View, {
|
|
70
|
+
className: "items-center justify-center self-start rounded-full border-2 p-[2px]",
|
|
71
|
+
style: {
|
|
72
|
+
borderColor: `${iconBorderColors[type]}66`
|
|
73
|
+
},
|
|
74
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(IconComponent, {
|
|
75
|
+
type: type
|
|
76
|
+
})
|
|
130
77
|
})
|
|
131
|
-
}), /*#__PURE__*/(0, _jsxRuntime.
|
|
132
|
-
className: (0, _clsx.default)('
|
|
133
|
-
children:
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
children: description
|
|
139
|
-
}), children]
|
|
140
|
-
})]
|
|
78
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_BaseText.default, {
|
|
79
|
+
className: (0, _clsx.default)('mt-2 font-semibold text-secondary', largePhone ? 'text-sm' : 'text-xs'),
|
|
80
|
+
children: message
|
|
81
|
+
}), description && /*#__PURE__*/(0, _jsxRuntime.jsx)(_BaseText.default, {
|
|
82
|
+
className: (0, _clsx.default)('text-sm text-quaternary', largePhone ? 'mt-3' : 'mt-1'),
|
|
83
|
+
children: description
|
|
84
|
+
}), children]
|
|
141
85
|
});
|
|
142
86
|
}
|
|
143
87
|
var _default = exports.default = (0, _nativewind.styled)(BaseAlert);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_nativewind","_outline","
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_nativewind","_outline","_hocComponents","_BaseIcon","_BaseText","_useIsAboveBreakpoint","_foregroundColors","_jsxRuntime","e","__esModule","default","IconComponent","type","iconColors","brand","error","alert","jsx","icon","InformationCircleIcon","size","color","strokeWidth","className","BaseAlert","message","description","variant","children","props","largePhone","useIsAboveBreakpoint","alertClasses","iconBorderColors","foregroundColors","light","jsxs","View","clsx","style","borderColor","_default","exports","styled"],"sourceRoot":"../../../src","sources":["components/BaseAlert.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAEA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,SAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,qBAAA,GAAAN,OAAA;AACA,IAAAO,iBAAA,GAAAR,sBAAA,CAAAC,OAAA;AAA2D,IAAAQ,WAAA,GAAAR,OAAA;AAAA,SAA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|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _nativewind = require("nativewind");
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _reactNative = require("react-native");
|
|
10
|
+
var _hocComponents = require("../hoc-components");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function BasePing({
|
|
13
|
+
style,
|
|
14
|
+
...props
|
|
15
|
+
}) {
|
|
16
|
+
const pingScale = (0, _react.useRef)(new _reactNative.Animated.Value(1)).current;
|
|
17
|
+
const pingOpacity = (0, _react.useRef)(new _reactNative.Animated.Value(1)).current;
|
|
18
|
+
(0, _react.useEffect)(() => {
|
|
19
|
+
const startPingAnimation = () => {
|
|
20
|
+
pingScale.setValue(1);
|
|
21
|
+
pingOpacity.setValue(1);
|
|
22
|
+
_reactNative.Animated.parallel([_reactNative.Animated.timing(pingScale, {
|
|
23
|
+
toValue: 2,
|
|
24
|
+
duration: 1500,
|
|
25
|
+
useNativeDriver: true
|
|
26
|
+
}), _reactNative.Animated.timing(pingOpacity, {
|
|
27
|
+
toValue: 0,
|
|
28
|
+
duration: 1500,
|
|
29
|
+
useNativeDriver: true
|
|
30
|
+
})]).start(() => {
|
|
31
|
+
startPingAnimation();
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
startPingAnimation();
|
|
35
|
+
return () => {
|
|
36
|
+
pingScale.stopAnimation();
|
|
37
|
+
pingOpacity.stopAnimation();
|
|
38
|
+
};
|
|
39
|
+
}, [pingScale, pingOpacity]);
|
|
40
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
41
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_hocComponents.View, {
|
|
42
|
+
style: [style, {
|
|
43
|
+
zIndex: 1
|
|
44
|
+
}],
|
|
45
|
+
...props
|
|
46
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
|
|
47
|
+
style: [style, {
|
|
48
|
+
opacity: pingOpacity,
|
|
49
|
+
transform: [{
|
|
50
|
+
scale: pingScale
|
|
51
|
+
}],
|
|
52
|
+
zIndex: 0
|
|
53
|
+
}],
|
|
54
|
+
...props
|
|
55
|
+
})]
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
var _default = exports.default = (0, _nativewind.styled)(BasePing);
|
|
59
|
+
//# sourceMappingURL=BasePing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_nativewind","require","_react","_reactNative","_hocComponents","_jsxRuntime","BasePing","style","props","pingScale","useRef","Animated","Value","current","pingOpacity","useEffect","startPingAnimation","setValue","parallel","timing","toValue","duration","useNativeDriver","start","stopAnimation","jsxs","Fragment","children","jsx","View","zIndex","opacity","transform","scale","_default","exports","default","styled"],"sourceRoot":"../../../src","sources":["components/BasePing.tsx"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAEA,IAAAG,cAAA,GAAAH,OAAA;AAAyC,IAAAI,WAAA,GAAAJ,OAAA;AAEzC,SAASK,QAAQA,CAAC;EAAEC,KAAK;EAAE,GAAGC;AAAiB,CAAC,EAAE;EAChD,MAAMC,SAAS,GAAG,IAAAC,aAAM,EAAC,IAAIC,qBAAQ,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC,CAACC,OAAO;EACvD,MAAMC,WAAW,GAAG,IAAAJ,aAAM,EAAC,IAAIC,qBAAQ,CAACC,KAAK,CAAC,CAAC,CAAC,CAAC,CAACC,OAAO;EAEzD,IAAAE,gBAAS,EAAC,MAAM;IACd,MAAMC,kBAAkB,GAAGA,CAAA,KAAM;MAC/BP,SAAS,CAACQ,QAAQ,CAAC,CAAC,CAAC;MACrBH,WAAW,CAACG,QAAQ,CAAC,CAAC,CAAC;MAEvBN,qBAAQ,CAACO,QAAQ,CAAC,CAChBP,qBAAQ,CAACQ,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
|
|
|
13
13
|
var _BaseRadioGroup = _interopRequireDefault(require("./BaseRadioGroup"));
|
|
14
14
|
var _BaseText = _interopRequireDefault(require("./BaseText"));
|
|
15
15
|
var _hooks = require("../hooks");
|
|
16
|
+
var _BaseAlert = _interopRequireDefault(require("./BaseAlert"));
|
|
16
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
18
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
19
|
function parseMilitaryTime(time) {
|
|
@@ -102,6 +103,8 @@ function DateTimeSelector({
|
|
|
102
103
|
error,
|
|
103
104
|
allowPastDatetimes = false,
|
|
104
105
|
availableDates,
|
|
106
|
+
emptyTimeSlotsMessage = 'No hay horarios disponibles para este día',
|
|
107
|
+
emptyTimeSlotsDescription = 'Por favor, selecciona otro día.',
|
|
105
108
|
...props
|
|
106
109
|
}) {
|
|
107
110
|
const {
|
|
@@ -113,10 +116,7 @@ function DateTimeSelector({
|
|
|
113
116
|
const maxDateEndOfDay = (0, _react.useMemo)(() => maxDate ? (0, _dateFns.startOfDay)(tz(maxDate)) : null, [maxDate, tz]);
|
|
114
117
|
const dateRange = (0, _react.useMemo)(() => {
|
|
115
118
|
if (availableDates && availableDates.length > 0) {
|
|
116
|
-
return availableDates.
|
|
117
|
-
const availableTimeBlocks = availableDate.availableTimeBlocks.filter(block => (0, _dateFns.isAfter)(block.startsAt, new _tz.TZDate()));
|
|
118
|
-
return availableTimeBlocks.length > 0;
|
|
119
|
-
}).map(availableDate => (0, _dateFns.parse)(availableDate.date, 'yyyy-MM-dd', new _tz.TZDate()));
|
|
119
|
+
return availableDates.map(availableDate => (0, _dateFns.parse)(availableDate.date, 'yyyy-MM-dd', new _tz.TZDate()));
|
|
120
120
|
}
|
|
121
121
|
const startDate = minDateStartOfDay;
|
|
122
122
|
const endDate = maxDateEndOfDay || (0, _dateFns.addDays)(startDate, 7);
|
|
@@ -228,7 +228,7 @@ function DateTimeSelector({
|
|
|
228
228
|
if (availableDates && availableDates.length > 0) {
|
|
229
229
|
const dateStr = (0, _dateFns.format)(day, 'yyyy-MM-dd');
|
|
230
230
|
const availableDate = availableDates.find(avail => avail.date === dateStr);
|
|
231
|
-
return !availableDate
|
|
231
|
+
return !availableDate;
|
|
232
232
|
}
|
|
233
233
|
if (minDateStartOfDay && (0, _dateFns.isBefore)(day, minDateStartOfDay)) return true;
|
|
234
234
|
if (maxDateEndOfDay && (0, _dateFns.isAfter)(day, maxDateEndOfDay)) return true;
|
|
@@ -267,12 +267,17 @@ function DateTimeSelector({
|
|
|
267
267
|
selectedDate: selectedDate,
|
|
268
268
|
isDayDisabled: isDayDisabled,
|
|
269
269
|
onDayPress: handleDayPress
|
|
270
|
-
}), selectedDate && /*#__PURE__*/(0, _jsxRuntime.jsx)(TimeSlots, {
|
|
270
|
+
}), selectedDate && timeSlots.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(TimeSlots, {
|
|
271
271
|
timeSlots: timeSlots,
|
|
272
272
|
selectedTime: selectedTime,
|
|
273
273
|
handleTimePress: handleTimePress,
|
|
274
274
|
disabled: disabled,
|
|
275
275
|
timeLabel: timeLabel
|
|
276
|
+
}), selectedDate && timeSlots.length === 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_BaseAlert.default, {
|
|
277
|
+
className: "mt-10",
|
|
278
|
+
type: "alert",
|
|
279
|
+
message: emptyTimeSlotsMessage,
|
|
280
|
+
description: emptyTimeSlotsDescription
|
|
276
281
|
}), error && /*#__PURE__*/(0, _jsxRuntime.jsx)(_BaseText.default, {
|
|
277
282
|
className: "mt-2 text-error-primary",
|
|
278
283
|
children: error
|