@herca/rn-kit 0.1.10 → 0.1.12
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/README.md +1 -1
- package/lib/module/Alert/Alert.js +2 -2
- package/lib/module/Alert/Alert.js.map +1 -1
- package/lib/module/Alert/README.md +1 -1
- package/lib/module/Chip/Chip.js +10 -5
- package/lib/module/Chip/Chip.js.map +1 -1
- package/lib/module/Drawing/Drawing.js +33 -12
- package/lib/module/Drawing/Drawing.js.map +1 -1
- package/lib/module/Drawing/README.md +33 -0
- package/lib/module/Drawing/type.js +2 -0
- package/lib/module/Drawing/type.js.map +1 -0
- package/lib/module/FileView/PdfView.js +12 -19
- package/lib/module/FileView/PdfView.js.map +1 -1
- package/lib/module/Icon/Icon.js +4 -4
- package/lib/module/Icon/Icon.js.map +1 -1
- package/lib/module/Icon/icons/Download.js +2 -2
- package/lib/module/Icon/icons/Download.js.map +1 -1
- package/lib/module/Icon/icons/{ExlmationMark.js → ExclamationMark.js} +3 -3
- package/lib/module/Icon/icons/ExclamationMark.js.map +1 -0
- package/lib/module/Provider/FooterProvider.js +4 -1
- package/lib/module/Provider/FooterProvider.js.map +1 -1
- package/lib/module/Select/Select.js +20 -13
- package/lib/module/Select/Select.js.map +1 -1
- package/lib/module/Tab/TabItem.js +1 -5
- package/lib/module/Tab/TabItem.js.map +1 -1
- package/lib/module/Toast/README.md +1 -1
- package/lib/module/Toast/Toast.js +1 -1
- package/lib/module/Toast/Toast.js.map +1 -1
- package/lib/module/Toast/ToastContext.js +1 -1
- package/lib/module/Ui/Footer.js +11 -9
- package/lib/module/Ui/Footer.js.map +1 -1
- package/lib/module/hooks/useOptionalFocusEffect.js +19 -0
- package/lib/module/hooks/useOptionalFocusEffect.js.map +1 -0
- package/lib/typescript/src/Chip/Chip.d.ts.map +1 -1
- package/lib/typescript/src/Chip/type.d.ts +2 -0
- package/lib/typescript/src/Chip/type.d.ts.map +1 -1
- package/lib/typescript/src/Drawing/Drawing.d.ts +4 -2
- package/lib/typescript/src/Drawing/Drawing.d.ts.map +1 -1
- package/lib/typescript/src/Drawing/type.d.ts +1 -0
- package/lib/typescript/src/Drawing/type.d.ts.map +1 -0
- package/lib/typescript/src/FileView/PdfView.d.ts +11 -1
- package/lib/typescript/src/FileView/PdfView.d.ts.map +1 -1
- package/lib/typescript/src/Icon/Icon.d.ts.map +1 -1
- package/lib/typescript/src/Icon/icons/Download.d.ts +2 -2
- package/lib/typescript/src/Icon/icons/Download.d.ts.map +1 -1
- package/lib/typescript/src/Icon/icons/ExclamationMark.d.ts +9 -0
- package/lib/typescript/src/Icon/icons/ExclamationMark.d.ts.map +1 -0
- package/lib/typescript/src/Icon/type.d.ts +1 -1
- package/lib/typescript/src/Icon/type.d.ts.map +1 -1
- package/lib/typescript/src/Provider/FooterProvider.d.ts.map +1 -1
- package/lib/typescript/src/Select/Select.d.ts +1 -1
- package/lib/typescript/src/Select/Select.d.ts.map +1 -1
- package/lib/typescript/src/Select/type.d.ts +2 -0
- package/lib/typescript/src/Select/type.d.ts.map +1 -1
- package/lib/typescript/src/Tab/TabItem.d.ts +3 -1
- package/lib/typescript/src/Tab/TabItem.d.ts.map +1 -1
- package/lib/typescript/src/Ui/Footer.d.ts +1 -1
- package/lib/typescript/src/Ui/Footer.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useOptionalFocusEffect.d.ts +2 -0
- package/lib/typescript/src/hooks/useOptionalFocusEffect.d.ts.map +1 -0
- package/package.json +14 -16
- package/src/Alert/Alert.tsx +2 -2
- package/src/Alert/README.md +1 -1
- package/src/Chip/Chip.tsx +9 -3
- package/src/Chip/type.tsx +2 -0
- package/src/Drawing/Drawing.tsx +44 -17
- package/src/Drawing/README.md +33 -0
- package/src/Drawing/type.tsx +0 -0
- package/src/FileView/PdfView.tsx +22 -19
- package/src/Icon/Icon.tsx +4 -4
- package/src/Icon/icons/Download.tsx +2 -2
- package/src/Icon/icons/{ExlmationMark.tsx → ExclamationMark.tsx} +2 -2
- package/src/Icon/type.tsx +1 -1
- package/src/Provider/FooterProvider.tsx +2 -1
- package/src/Select/Select.tsx +20 -11
- package/src/Select/type.tsx +2 -0
- package/src/Tab/TabItem.tsx +3 -4
- package/src/Toast/README.md +1 -1
- package/src/Toast/Toast.tsx +1 -1
- package/src/Toast/ToastContext.tsx +1 -1
- package/src/Ui/Footer.tsx +14 -9
- package/src/hooks/useOptionalFocusEffect.ts +18 -0
- package/lib/module/Icon/icons/ExlmationMark.js.map +0 -1
- package/lib/typescript/src/Icon/icons/ExlmationMark.d.ts +0 -9
- package/lib/typescript/src/Icon/icons/ExlmationMark.d.ts.map +0 -1
|
@@ -10,7 +10,7 @@ export const ToastProvider = ({
|
|
|
10
10
|
const [visible, setVisible] = useState(false);
|
|
11
11
|
const [message, setMessage] = useState('');
|
|
12
12
|
const [options, setOptions] = useState({
|
|
13
|
-
icon: '
|
|
13
|
+
icon: 'ExclamationMark'
|
|
14
14
|
});
|
|
15
15
|
const show = (msg, opts) => {
|
|
16
16
|
setMessage(msg);
|
package/lib/module/Ui/Footer.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
3
|
+
// Footer.tsx
|
|
4
|
+
import React, { useMemo } from 'react';
|
|
5
|
+
import { SafeAreaView, StyleSheet } from 'react-native';
|
|
6
6
|
import { useFooter } from "../Provider/Provider.js";
|
|
7
|
+
import Color from "../Color/Color.js";
|
|
8
|
+
import { useOptionalFocusEffect } from "../hooks/useOptionalFocusEffect.js";
|
|
7
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
10
|
const Footer = ({
|
|
9
11
|
children,
|
|
@@ -12,14 +14,14 @@ const Footer = ({
|
|
|
12
14
|
const {
|
|
13
15
|
setFooter
|
|
14
16
|
} = useFooter();
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
const footerElement = useMemo(() => /*#__PURE__*/_jsx(SafeAreaView, {
|
|
18
|
+
style: [styles.container, style],
|
|
19
|
+
children: children
|
|
20
|
+
}), [children, style]);
|
|
21
|
+
useOptionalFocusEffect(() => {
|
|
20
22
|
setFooter(footerElement);
|
|
21
23
|
return () => setFooter(null);
|
|
22
|
-
}
|
|
24
|
+
});
|
|
23
25
|
return null;
|
|
24
26
|
};
|
|
25
27
|
export default Footer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","
|
|
1
|
+
{"version":3,"names":["React","useMemo","SafeAreaView","StyleSheet","useFooter","Color","useOptionalFocusEffect","jsx","_jsx","Footer","children","style","setFooter","footerElement","styles","container","create","backgroundColor","base","white100","position","bottom","left","right","zIndex"],"sourceRoot":"../../../src","sources":["Ui/Footer.tsx"],"mappings":";;AAAA;AACA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,YAAY,EAAEC,UAAU,QAAwB,cAAc;AACvE,SAASC,SAAS,QAAQ,yBAAsB;AAChD,OAAOC,KAAK,MAAM,mBAAgB;AAClC,SAASC,sBAAsB,QAAQ,oCAAiC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAOzE,MAAMC,MAA6B,GAAGA,CAAC;EAAEC,QAAQ;EAAEC;AAAM,CAAC,KAAK;EAC7D,MAAM;IAAEC;EAAU,CAAC,GAAGR,SAAS,CAAC,CAAC;EAEjC,MAAMS,aAAa,GAAGZ,OAAO,CAC3B,mBACEO,IAAA,CAACN,YAAY;IAACS,KAAK,EAAE,CAACG,MAAM,CAACC,SAAS,EAAEJ,KAAK,CAAE;IAAAD,QAAA,EAAEA;EAAQ,CAAe,CACzE,EACD,CAACA,QAAQ,EAAEC,KAAK,CAClB,CAAC;EAEDL,sBAAsB,CAAC,MAAM;IAC3BM,SAAS,CAACC,aAAa,CAAC;IACxB,OAAO,MAAMD,SAAS,CAAC,IAAI,CAAC;EAC9B,CAAC,CAAC;EAEF,OAAO,IAAI;AACb,CAAC;AAED,eAAeH,MAAM;AAErB,MAAMK,MAAM,GAAGX,UAAU,CAACa,MAAM,CAAC;EAC/BD,SAAS,EAAE;IACTE,eAAe,EAAEZ,KAAK,CAACa,IAAI,CAACC,QAAQ;IACpCC,QAAQ,EAAE,UAAU;IACpBC,MAAM,EAAE,CAAC;IACTC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE;EACV;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// src/hooks/useOptionalFocusEffect.ts
|
|
4
|
+
import { useContext, useEffect, useCallback } from 'react';
|
|
5
|
+
import { NavigationContext, useFocusEffect } from '@react-navigation/native';
|
|
6
|
+
export function useOptionalFocusEffect(callback) {
|
|
7
|
+
const navigation = useContext(NavigationContext);
|
|
8
|
+
const effect = useCallback(callback, [callback]);
|
|
9
|
+
|
|
10
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
11
|
+
if (navigation) {
|
|
12
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
13
|
+
useFocusEffect(effect);
|
|
14
|
+
} else {
|
|
15
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
16
|
+
useEffect(() => effect(), [effect]);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=useOptionalFocusEffect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useContext","useEffect","useCallback","NavigationContext","useFocusEffect","useOptionalFocusEffect","callback","navigation","effect"],"sourceRoot":"../../../src","sources":["hooks/useOptionalFocusEffect.ts"],"mappings":";;AAAA;AACA,SAASA,UAAU,EAAEC,SAAS,EAAEC,WAAW,QAAQ,OAAO;AAC1D,SAASC,iBAAiB,EAAEC,cAAc,QAAQ,0BAA0B;AAE5E,OAAO,SAASC,sBAAsBA,CAACC,QAAmC,EAAE;EAC1E,MAAMC,UAAU,GAAGP,UAAU,CAACG,iBAAiB,CAAC;EAEhD,MAAMK,MAAM,GAAGN,WAAW,CAACI,QAAQ,EAAE,CAACA,QAAQ,CAAC,CAAC;;EAEhD;EACA,IAAIC,UAAU,EAAE;IACd;IACAH,cAAc,CAACI,MAAM,CAAC;EACxB,CAAC,MAAM;IACL;IACAP,SAAS,CAAC,MAAMO,MAAM,CAAC,CAAC,EAAE,CAACA,MAAM,CAAC,CAAC;EACrC;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../../src/Chip/Chip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAE5D,OAAO,EAEL,KAAK,SAAS,EAGf,MAAM,QAAQ,CAAC;AAGhB,QAAA,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../../src/Chip/Chip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAE5D,OAAO,EAEL,KAAK,SAAS,EAGf,MAAM,QAAQ,CAAC;AAGhB,QAAA,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAgG7B,CAAC;AAiCF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../../src/Chip/type.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,eAAO,MAAM,cAAc,EAAE,MAAM,CACjC,gBAAgB,EAChB;IACE,eAAe,EAAE,UAAU,CAAC;IAC5B,SAAS,EAAE,UAAU,CAAC;IACtB,WAAW,EAAE,UAAU,CAAC;IACx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AS,GAAG,IAAI,KAAK,IAAI,CAAC;IAC9D,SAAS,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACtC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;CAC7B"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
interface DrawingProps {
|
|
2
|
-
|
|
2
|
+
onChange?: (value?: string | undefined | null) => void;
|
|
3
|
+
onStart?: () => void;
|
|
4
|
+
onEnd?: () => void;
|
|
3
5
|
}
|
|
4
|
-
declare const Drawing: ({
|
|
6
|
+
declare const Drawing: ({ onChange, onEnd, onStart }: DrawingProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
7
|
export default Drawing;
|
|
6
8
|
//# sourceMappingURL=Drawing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawing.d.ts","sourceRoot":"","sources":["../../../../src/Drawing/Drawing.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Drawing.d.ts","sourceRoot":"","sources":["../../../../src/Drawing/Drawing.tsx"],"names":[],"mappings":"AASA,UAAU,YAAY;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,KAAK,IAAI,CAAC;IACvD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,QAAA,MAAM,OAAO,GAAI,8BAA8B,YAAY,4CAgG1D,CAAC;AA0BF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../../src/Drawing/type.tsx"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
+
type Source = {
|
|
2
|
+
uri?: string;
|
|
3
|
+
headers?: {
|
|
4
|
+
[key: string]: string;
|
|
5
|
+
};
|
|
6
|
+
cache?: boolean;
|
|
7
|
+
cacheFileName?: string;
|
|
8
|
+
expiration?: number;
|
|
9
|
+
method?: string;
|
|
10
|
+
};
|
|
1
11
|
declare const PdfView: ({ source }: {
|
|
2
|
-
source
|
|
12
|
+
source: Source;
|
|
3
13
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
4
14
|
export default PdfView;
|
|
5
15
|
//# sourceMappingURL=PdfView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdfView.d.ts","sourceRoot":"","sources":["../../../../src/FileView/PdfView.tsx"],"names":[],"mappings":"AAGA,QAAA,MAAM,OAAO,GAAI
|
|
1
|
+
{"version":3,"file":"PdfView.d.ts","sourceRoot":"","sources":["../../../../src/FileView/PdfView.tsx"],"names":[],"mappings":"AAGA,KAAK,MAAM,GAAG;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE;QACR,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;KACvB,CAAC;IACF,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,QAAA,MAAM,OAAO,GAAI,YAAY;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,4CAc9C,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../src/Icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../src/Icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAmB1B,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,QAAQ,CAAC;AAyCvD,QAAA,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAa7B,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Download.d.ts","sourceRoot":"","sources":["../../../../../src/Icon/icons/Download.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,KAAK;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,QAAA,MAAM,
|
|
1
|
+
{"version":3,"file":"Download.d.ts","sourceRoot":"","sources":["../../../../../src/Icon/icons/Download.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,KAAK;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAO7B,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExclamationMark.d.ts","sourceRoot":"","sources":["../../../../../src/Icon/icons/ExclamationMark.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,KAAK;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAWpC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ViewStyle } from 'react-native';
|
|
2
|
-
export type IconNameProps = 'Home' | 'Search' | 'User' | 'Eye' | 'EyeOpen' | 'ArrowRight' | 'ArrowLeft' | 'Document' | 'Calendar' | '
|
|
2
|
+
export type IconNameProps = 'Home' | 'Search' | 'User' | 'Eye' | 'EyeOpen' | 'ArrowRight' | 'ArrowLeft' | 'Document' | 'Calendar' | 'ExclamationMark' | 'Download' | 'x-circle' | 'StickyNote' | 'RadioButton' | 'Pdf' | 'ArrowBackAlt' | 'ArrowForwardAlt' | 'ArrowDown' | 'ArrowUp' | 'Check' | 'Filter' | 'AirPlane' | 'Camera' | 'Image' | 'Times';
|
|
3
3
|
export interface IconProps {
|
|
4
4
|
name: IconNameProps;
|
|
5
5
|
size?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../../src/Icon/type.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,MAAM,aAAa,GACrB,MAAM,GACN,QAAQ,GACR,MAAM,GACN,KAAK,GACL,SAAS,GACT,YAAY,GACZ,WAAW,GACX,UAAU,GACV,UAAU,GACV,
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../../src/Icon/type.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,MAAM,aAAa,GACrB,MAAM,GACN,QAAQ,GACR,MAAM,GACN,KAAK,GACL,SAAS,GACT,YAAY,GACZ,WAAW,GACX,UAAU,GACV,UAAU,GACV,iBAAiB,GACjB,UAAU,GACV,UAAU,GACV,YAAY,GACZ,aAAa,GACb,KAAK,GACL,cAAc,GACd,iBAAiB,GACjB,WAAW,GACX,SAAS,GACT,OAAO,GACP,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,OAAO,GACP,OAAO,CAAC;AAEZ,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FooterProvider.d.ts","sourceRoot":"","sources":["../../../../src/Provider/FooterProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FooterProvider.d.ts","sourceRoot":"","sources":["../../../../src/Provider/FooterProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5E,UAAU,iBAAiB;IACzB,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,KAAK,IAAI,CAAC;CAC/C;AAID,eAAO,MAAM,cAAc,GAAI,cAAc;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,4CAQnE,CAAC;AAEF,eAAO,MAAM,SAAS,yBAMrB,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type SelectProps } from './type';
|
|
2
|
-
export default function Select({ isOpen, data, renderItem, onClose, onSubmit, multiple, onSearch, required, loading, delaySearch, height, onRefresh, refreshing, }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function Select({ isOpen, data, renderItem, onClose, onSubmit, multiple, onSearch, required, loading, delaySearch, height, onRefresh, refreshing, footer, onEndReached, }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=Select.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../src/Select/Select.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,QAAQ,CAAC;AAQ1C,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,MAAM,EACN,IAAI,EACJ,UAAU,EACV,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAgB,EAChB,OAAe,EACf,WAAiB,EACjB,MAAM,EACN,SAAS,EACT,UAAU,
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../src/Select/Select.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,QAAQ,CAAC;AAQ1C,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,MAAM,EACN,IAAI,EACJ,UAAU,EACV,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAgB,EAChB,OAAe,EACf,WAAiB,EACjB,MAAM,EACN,SAAS,EACT,UAAU,EACV,MAAM,EACN,YAAY,GACb,EAAE,WAAW,2CAkFb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../../src/Select/type.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEjE,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MA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AQ,EAAE,OAAO,KACd,KAAK,CAAC,SAAS,CAAC;AAErB,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,eAAe,EAAE,CAAC;IACxB,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;CAC7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabItem.d.ts","sourceRoot":"","sources":["../../../../src/Tab/TabItem.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TabItem.d.ts","sourceRoot":"","sources":["../../../../src/Tab/TabItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAAoB,CAAC;AACzD,eAAe,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Footer.d.ts","sourceRoot":"","sources":["../../../../src/Ui/Footer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Footer.d.ts","sourceRoot":"","sources":["../../../../src/Ui/Footer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAKxE,UAAU,WAAW;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAgBjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOptionalFocusEffect.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useOptionalFocusEffect.ts"],"names":[],"mappings":"AAIA,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,QAazE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@herca/rn-kit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"description": "React Native UI Kit",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -86,7 +86,19 @@
|
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
88
|
"react": "*",
|
|
89
|
-
"react-native": "*"
|
|
89
|
+
"react-native": "*",
|
|
90
|
+
"@react-native-documents/picker": "^10.1.3",
|
|
91
|
+
"@react-native-documents/viewer": "^1.0.1",
|
|
92
|
+
"@react-navigation/native": "^7.1.14",
|
|
93
|
+
"react-native-blob-util": "^0.22.2",
|
|
94
|
+
"react-native-image-picker": "^8.2.1",
|
|
95
|
+
"react-native-pager-view": "^6.8.1",
|
|
96
|
+
"react-native-pdf": "^6.7.7",
|
|
97
|
+
"react-native-safe-area-context": "^5.5.1",
|
|
98
|
+
"react-native-screens": "^4.11.1",
|
|
99
|
+
"react-native-signature-canvas": "^5.0.1",
|
|
100
|
+
"react-native-svg": "^15.12.0",
|
|
101
|
+
"react-native-webview": "^13.15.0"
|
|
90
102
|
},
|
|
91
103
|
"workspaces": [
|
|
92
104
|
"example"
|
|
@@ -160,19 +172,5 @@
|
|
|
160
172
|
"languages": "kotlin-objc",
|
|
161
173
|
"type": "turbo-module",
|
|
162
174
|
"version": "0.51.1"
|
|
163
|
-
},
|
|
164
|
-
"dependencies": {
|
|
165
|
-
"@react-native-documents/picker": "^10.1.3",
|
|
166
|
-
"@react-native-documents/viewer": "^1.0.1",
|
|
167
|
-
"@react-navigation/native": "^7.1.14",
|
|
168
|
-
"react-native-blob-util": "^0.22.2",
|
|
169
|
-
"react-native-image-picker": "^8.2.1",
|
|
170
|
-
"react-native-pager-view": "^6.8.1",
|
|
171
|
-
"react-native-pdf": "^6.7.7",
|
|
172
|
-
"react-native-safe-area-context": "^5.5.1",
|
|
173
|
-
"react-native-screens": "^4.11.1",
|
|
174
|
-
"react-native-signature-canvas": "^5.0.1",
|
|
175
|
-
"react-native-svg": "^15.12.0",
|
|
176
|
-
"react-native-webview": "^13.15.0"
|
|
177
175
|
}
|
|
178
176
|
}
|
package/src/Alert/Alert.tsx
CHANGED
|
@@ -67,7 +67,7 @@ const COLORS: Record<
|
|
|
67
67
|
};
|
|
68
68
|
|
|
69
69
|
const Alert: React.FC<AlertProps> = ({
|
|
70
|
-
icon = '
|
|
70
|
+
icon = 'ExclamationMark',
|
|
71
71
|
title,
|
|
72
72
|
message,
|
|
73
73
|
color = 'primary',
|
|
@@ -84,7 +84,7 @@ const Alert: React.FC<AlertProps> = ({
|
|
|
84
84
|
]}
|
|
85
85
|
>
|
|
86
86
|
<View style={{ marginRight: 10 }}>
|
|
87
|
-
<Icon name={icon || '
|
|
87
|
+
<Icon name={icon || 'ExclamationMark'} color={fontColor} />
|
|
88
88
|
</View>
|
|
89
89
|
<View style={styles.textContainer}>
|
|
90
90
|
{title && (
|
package/src/Alert/README.md
CHANGED
|
@@ -15,7 +15,7 @@ Komponen `Alert` digunakan untuk menampilkan pesan notifikasi dengan ikon, judul
|
|
|
15
15
|
|
|
16
16
|
| Prop | Tipe | Default | Deskripsi |
|
|
17
17
|
|----------------|----------------------------------------------------------------------|---------------------|---------------------------------------------------------------------------|
|
|
18
|
-
| `icon` | `IconNameProps` | `'
|
|
18
|
+
| `icon` | `IconNameProps` | `'ExclamationMark'` | Nama ikon dari komponen `Icon` |
|
|
19
19
|
| `title` | `string` | `undefined` | Judul alert |
|
|
20
20
|
| `message` | `string` | `undefined` | Pesan tambahan |
|
|
21
21
|
| `color` | `'success' \| 'info' \| 'warning' \| 'danger' \| 'primary' \| 'orange' \| 'purple'` | `'primary'` | Warna tema alert |
|
package/src/Chip/Chip.tsx
CHANGED
|
@@ -22,6 +22,8 @@ const Chip: React.FC<ChipProps> = ({
|
|
|
22
22
|
size = 'medium',
|
|
23
23
|
onRefresh,
|
|
24
24
|
refreshing = false,
|
|
25
|
+
onEndReached,
|
|
26
|
+
footer,
|
|
25
27
|
}) => {
|
|
26
28
|
const isHorizontal = direction === 'horizontal';
|
|
27
29
|
|
|
@@ -85,6 +87,7 @@ const Chip: React.FC<ChipProps> = ({
|
|
|
85
87
|
)}
|
|
86
88
|
keyExtractor={(item) => String(item.value)}
|
|
87
89
|
horizontal={isHorizontal}
|
|
90
|
+
onEndReached={onEndReached}
|
|
88
91
|
onRefresh={onRefresh}
|
|
89
92
|
refreshing={refreshing}
|
|
90
93
|
scrollEnabled={scrollable}
|
|
@@ -97,9 +100,8 @@ const Chip: React.FC<ChipProps> = ({
|
|
|
97
100
|
alignItems: block ? 'stretch' : 'flex-start',
|
|
98
101
|
},
|
|
99
102
|
]}
|
|
100
|
-
columnWrapperStyle={
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
+
columnWrapperStyle={numColumns > 1 ? styles.wrapperStyle : undefined}
|
|
104
|
+
ListFooterComponent={footer}
|
|
103
105
|
/>
|
|
104
106
|
);
|
|
105
107
|
};
|
|
@@ -108,6 +110,10 @@ const styles = StyleSheet.create({
|
|
|
108
110
|
container: {
|
|
109
111
|
gap: 8,
|
|
110
112
|
},
|
|
113
|
+
wrapperStyle: {
|
|
114
|
+
gap: 8,
|
|
115
|
+
flexWrap: 'wrap',
|
|
116
|
+
},
|
|
111
117
|
chip: {
|
|
112
118
|
borderRadius: 8,
|
|
113
119
|
borderWidth: 1,
|
package/src/Chip/type.tsx
CHANGED
package/src/Drawing/Drawing.tsx
CHANGED
|
@@ -1,51 +1,78 @@
|
|
|
1
1
|
import { useRef } from 'react';
|
|
2
2
|
import { StyleSheet, View, TouchableOpacity } from 'react-native';
|
|
3
|
-
import SignatureCanvas, {
|
|
3
|
+
import SignatureCanvas, {
|
|
4
|
+
type SignatureViewRef,
|
|
5
|
+
} from 'react-native-signature-canvas';
|
|
4
6
|
import Icon from '../Icon';
|
|
5
7
|
import Button from '../Button/Button';
|
|
6
8
|
import Color from '../Color/Color';
|
|
7
9
|
|
|
8
10
|
interface DrawingProps {
|
|
9
|
-
|
|
11
|
+
onChange?: (value?: string | undefined | null) => void;
|
|
12
|
+
onStart?: () => void;
|
|
13
|
+
onEnd?: () => void;
|
|
10
14
|
}
|
|
11
15
|
|
|
12
|
-
const Drawing = ({
|
|
16
|
+
const Drawing = ({ onChange, onEnd, onStart }: DrawingProps) => {
|
|
13
17
|
const ref = useRef<SignatureViewRef | null>(null);
|
|
14
18
|
|
|
15
|
-
const handleSignature = (signature
|
|
16
|
-
if (signature &&
|
|
17
|
-
|
|
19
|
+
const handleSignature = (signature: string) => {
|
|
20
|
+
if (signature && onChange) {
|
|
21
|
+
onChange(signature);
|
|
18
22
|
}
|
|
19
23
|
};
|
|
20
24
|
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
};
|
|
25
|
+
const refreshSignature = () =>
|
|
26
|
+
requestAnimationFrame(() => ref.current?.readSignature());
|
|
24
27
|
|
|
25
|
-
const
|
|
26
|
-
|
|
28
|
+
const handleEmpty = () => {
|
|
29
|
+
if (onChange) {
|
|
30
|
+
onChange(null);
|
|
31
|
+
}
|
|
27
32
|
};
|
|
28
33
|
|
|
29
|
-
const handleError = (error
|
|
34
|
+
const handleError = (error: Error) => {
|
|
30
35
|
console.error('Signature pad error:', error);
|
|
31
36
|
};
|
|
32
37
|
|
|
33
38
|
const handleEnd = () => {
|
|
34
|
-
|
|
39
|
+
refreshSignature();
|
|
40
|
+
if (onEnd) {
|
|
41
|
+
onEnd();
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const handleBegin = () => {
|
|
46
|
+
if (onStart) {
|
|
47
|
+
onStart();
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const undo = () => {
|
|
52
|
+
ref.current?.undo();
|
|
53
|
+
refreshSignature();
|
|
35
54
|
};
|
|
36
55
|
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
56
|
+
const redo = () => {
|
|
57
|
+
ref.current?.redo();
|
|
58
|
+
refreshSignature();
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const clear = () => {
|
|
62
|
+
ref.current?.clearSignature();
|
|
63
|
+
if (onChange) {
|
|
64
|
+
onChange(null);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
40
67
|
|
|
41
68
|
return (
|
|
42
69
|
<View style={styles.container}>
|
|
43
70
|
<SignatureCanvas
|
|
44
71
|
ref={ref}
|
|
45
72
|
onEnd={handleEnd}
|
|
73
|
+
onBegin={handleBegin}
|
|
46
74
|
onOK={handleSignature}
|
|
47
75
|
onEmpty={handleEmpty}
|
|
48
|
-
onClear={handleClear}
|
|
49
76
|
onError={handleError}
|
|
50
77
|
descriptionText=" "
|
|
51
78
|
webStyle={`
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# 📅 Drawing
|
|
2
|
+
|
|
3
|
+
## Contoh
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
import React, { useState } from 'react';
|
|
7
|
+
import { View, Image } from 'react-native';
|
|
8
|
+
import Drawing from './components/Drawing/Drawing';
|
|
9
|
+
|
|
10
|
+
export default function SignatureForm() {
|
|
11
|
+
const [result, setResult] = useState<string | undefined>();
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<View style={{ flex: 1, padding: 16 }}>
|
|
15
|
+
<Drawing onDraw={setResult} />
|
|
16
|
+
|
|
17
|
+
{result && (
|
|
18
|
+
<Image
|
|
19
|
+
source={{ uri: result }}
|
|
20
|
+
style={{ width: 300, height: 100, marginTop: 24 }}
|
|
21
|
+
resizeMode="contain"
|
|
22
|
+
/>
|
|
23
|
+
)}
|
|
24
|
+
</View>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## props
|
|
30
|
+
|
|
31
|
+
| Prop | Tipe | Default | Deskripsi |
|
|
32
|
+
| -------- | -------------------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------- |
|
|
33
|
+
| `onDraw` | `(value?: string \| undefined) ⇒ void` | `undefined` | Callback berisi tanda tangan **base64** saat pengguna menggambar (dipicu otomatis di `onDraw`). |
|
|
File without changes
|
package/src/FileView/PdfView.tsx
CHANGED
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
import { View,
|
|
1
|
+
import { View, StyleSheet } from 'react-native';
|
|
2
2
|
import Pdf from 'react-native-pdf';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
type Source = {
|
|
5
|
+
uri?: string;
|
|
6
|
+
headers?: {
|
|
7
|
+
[key: string]: string;
|
|
8
|
+
};
|
|
9
|
+
cache?: boolean;
|
|
10
|
+
cacheFileName?: string;
|
|
11
|
+
expiration?: number;
|
|
12
|
+
method?: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const PdfView = ({ source }: { source: Source }) => {
|
|
16
|
+
if (!source) return <View />;
|
|
17
|
+
|
|
8
18
|
return (
|
|
9
|
-
<View style={styles.
|
|
19
|
+
<View style={styles.container}>
|
|
10
20
|
<Pdf
|
|
11
21
|
source={source}
|
|
12
|
-
onLoadComplete={(
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
console.log(`current page: ${page}`);
|
|
17
|
-
}}
|
|
18
|
-
onError={(error) => {
|
|
19
|
-
console.log(error);
|
|
20
|
-
}}
|
|
21
|
-
style={[styles.flex, { width: Dimensions.get('window').width }]}
|
|
22
|
+
onLoadComplete={(pages) => console.log('number of pages:', pages)}
|
|
23
|
+
onPageChanged={(page) => console.log('current page:', page)}
|
|
24
|
+
onError={(err) => console.error(err)}
|
|
25
|
+
style={styles.pdf}
|
|
22
26
|
/>
|
|
23
27
|
</View>
|
|
24
28
|
);
|
|
@@ -27,7 +31,6 @@ const PdfView = ({ source = null }) => {
|
|
|
27
31
|
export default PdfView;
|
|
28
32
|
|
|
29
33
|
const styles = StyleSheet.create({
|
|
30
|
-
flex:
|
|
31
|
-
|
|
32
|
-
},
|
|
34
|
+
container: { flex: 1 },
|
|
35
|
+
pdf: { flex: 1 },
|
|
33
36
|
});
|
package/src/Icon/Icon.tsx
CHANGED
|
@@ -6,8 +6,7 @@ import XCircle from './icons/XCircle';
|
|
|
6
6
|
import ArrowRight from './icons/ArrowRight';
|
|
7
7
|
import Document from './icons/Document';
|
|
8
8
|
import Calendar from './icons/Calendar';
|
|
9
|
-
import
|
|
10
|
-
import Downnload from './icons/Download';
|
|
9
|
+
import Download from './icons/Download';
|
|
11
10
|
import StickyNote from './icons/StickyNote';
|
|
12
11
|
import Pdf from './icons/Pdf';
|
|
13
12
|
import RadioButton from './icons/RadioButton';
|
|
@@ -26,6 +25,7 @@ import Search from './icons/Search';
|
|
|
26
25
|
import Home from './icons/Home';
|
|
27
26
|
import ArrowLeft from './icons/ArrowLeft';
|
|
28
27
|
import EyeOpen from './icons/EyeOpen';
|
|
28
|
+
import ExclamationMark from './icons/ExclamationMark';
|
|
29
29
|
|
|
30
30
|
const icons: Record<
|
|
31
31
|
IconNameProps,
|
|
@@ -40,8 +40,8 @@ const icons: Record<
|
|
|
40
40
|
'ArrowLeft': ArrowLeft,
|
|
41
41
|
'Document': Document,
|
|
42
42
|
'Calendar': Calendar,
|
|
43
|
-
'
|
|
44
|
-
'Download':
|
|
43
|
+
'ExclamationMark': ExclamationMark,
|
|
44
|
+
'Download': Download,
|
|
45
45
|
'x-circle': XCircle,
|
|
46
46
|
'StickyNote': StickyNote,
|
|
47
47
|
'RadioButton': RadioButton,
|