@campxdev/react-native-blueprint 0.1.15 → 0.1.16
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/global.css +672 -0
- package/lib/module/assets/Success-Tick.json +1 -0
- package/lib/module/assets/lotties/index.js +2 -1
- package/lib/module/assets/lotties/index.js.map +1 -1
- package/lib/module/components/DataDisplay/Banner/Banner.figma.js +25 -0
- package/lib/module/components/DataDisplay/Banner/Banner.figma.js.map +1 -0
- package/lib/module/components/DataDisplay/Banner/Banner.js +101 -0
- package/lib/module/components/DataDisplay/Banner/Banner.js.map +1 -0
- package/lib/module/components/DataDisplay/Greeting/Greeting.figma.js +15 -0
- package/lib/module/components/DataDisplay/Greeting/Greeting.figma.js.map +1 -0
- package/lib/module/components/DataDisplay/Greeting/Greeting.js +121 -0
- package/lib/module/components/DataDisplay/Greeting/Greeting.js.map +1 -0
- package/lib/module/components/DataDisplay/MonthCalendar/MonthCalendar.figma.js +5 -7
- package/lib/module/components/DataDisplay/MonthCalendar/MonthCalendar.figma.js.map +1 -1
- package/lib/module/components/Input/TextField/Textfield.js +77 -21
- package/lib/module/components/Input/TextField/Textfield.js.map +1 -1
- package/lib/module/components/ui/index.js +2 -1
- package/lib/module/components/ui/index.js.map +1 -1
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/patterns/pattern-components/BottomSheetPattern/index.js +4 -0
- package/lib/module/patterns/pattern-components/BottomSheetPattern/index.js.map +1 -0
- package/lib/module/patterns/pattern-components/CalendarPattern/index.js +4 -0
- package/lib/module/patterns/pattern-components/CalendarPattern/index.js.map +1 -0
- package/lib/module/patterns/pattern-components/DashboardPattern/index.js +4 -0
- package/lib/module/patterns/pattern-components/DashboardPattern/index.js.map +1 -0
- package/lib/module/patterns/pattern-components/EntityPatternGuided/index.js +4 -0
- package/lib/module/patterns/pattern-components/EntityPatternGuided/index.js.map +1 -0
- package/lib/module/patterns/pattern-components/SuccessPattern/SuccessPattern.figma.js +38 -0
- package/lib/module/patterns/pattern-components/SuccessPattern/SuccessPattern.figma.js.map +1 -0
- package/lib/module/patterns/pattern-components/SuccessPattern/SuccessPattern.js +91 -0
- package/lib/module/patterns/pattern-components/SuccessPattern/SuccessPattern.js.map +1 -0
- package/lib/module/patterns/pattern-components/SuccessPattern/index.js +4 -0
- package/lib/module/patterns/pattern-components/SuccessPattern/index.js.map +1 -0
- package/lib/module/patterns/pattern-components/index.js +4 -3
- package/lib/module/patterns/pattern-components/index.js.map +1 -1
- package/package.json +3 -2
- package/src/assets/Success-Tick.json +1 -0
- package/src/assets/lotties/index.ts +1 -0
- package/src/components/DataDisplay/Banner/Banner.figma.tsx +26 -0
- package/src/components/DataDisplay/Banner/Banner.tsx +108 -0
- package/src/components/DataDisplay/Greeting/Greeting.figma.tsx +12 -0
- package/src/components/DataDisplay/Greeting/Greeting.tsx +154 -0
- package/src/components/DataDisplay/MonthCalendar/MonthCalendar.figma.tsx +7 -11
- package/src/components/Input/TextField/Textfield.tsx +118 -33
- package/src/components/ui/index.ts +3 -1
- package/src/index.tsx +3 -0
- package/src/patterns/pattern-components/BottomSheetPattern/index.ts +1 -0
- package/src/patterns/pattern-components/CalendarPattern/index.ts +1 -0
- package/src/patterns/pattern-components/DashboardPattern/index.ts +1 -0
- package/src/patterns/pattern-components/EntityPatternGuided/index.ts +1 -0
- package/src/patterns/pattern-components/SuccessPattern/SuccessPattern.figma.tsx +38 -0
- package/src/patterns/pattern-components/SuccessPattern/SuccessPattern.tsx +119 -0
- package/src/patterns/pattern-components/SuccessPattern/index.ts +2 -0
- package/src/patterns/pattern-components/index.ts +2 -1
- package/lib/module/components/ui/Greeting-Card.js +0 -393
- package/lib/module/components/ui/Greeting-Card.js.map +0 -1
- package/src/components/ui/Greeting-Card.tsx +0 -472
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["default","RootLayout","cn","THEME","NAV_THEME","ThemeProvider","useTheme","getRadiusForHeight","getRadiusForDimensions","getCustomRadius","RADIUS","RADIUS_PRESET","CORNER_SMOOTHING","fonts"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA;AACA,cAAc,0BAAiB;;AAE/B;AACA,SAASA,OAAO,IAAIC,UAAU,QAAQ,kBAAe;;AAErD;AACA,SAASC,EAAE,QAAQ,gBAAa;AAChC,SAASC,KAAK,EAAEC,SAAS,QAAQ,gBAAa;AAC9C,SAASC,aAAa,EAAEC,QAAQ,QAAQ,wBAAqB;;AAE7D;AACA,SACEC,kBAAkB,EAClBC,sBAAsB,EACtBC,eAAe,EACfC,MAAM,EACNC,aAAa,EACbC,gBAAgB,QACX,uBAAoB;;AAE3B;AACA,SAASC,KAAK,QAAQ,gBAAa","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["default","RootLayout","cn","THEME","NAV_THEME","ThemeProvider","useTheme","getRadiusForHeight","getRadiusForDimensions","getCustomRadius","RADIUS","RADIUS_PRESET","CORNER_SMOOTHING","fonts"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA;AACA,cAAc,0BAAiB;;AAE/B;AACA,cAAc,wCAA+B;;AAE7C;AACA,SAASA,OAAO,IAAIC,UAAU,QAAQ,kBAAe;;AAErD;AACA,SAASC,EAAE,QAAQ,gBAAa;AAChC,SAASC,KAAK,EAAEC,SAAS,QAAQ,gBAAa;AAC9C,SAASC,aAAa,EAAEC,QAAQ,QAAQ,wBAAqB;;AAE7D;AACA,SACEC,kBAAkB,EAClBC,sBAAsB,EACtBC,eAAe,EACfC,MAAM,EACNC,aAAa,EACbC,gBAAgB,QACX,uBAAoB;;AAE3B;AACA,SAASC,KAAK,QAAQ,gBAAa","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BottomSheetPattern"],"sourceRoot":"../../../../../src","sources":["patterns/pattern-components/BottomSheetPattern/index.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,yBAAsB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CalendarPattern"],"sourceRoot":"../../../../../src","sources":["patterns/pattern-components/CalendarPattern/index.ts"],"mappings":";;AAAA,SAASA,eAAe,QAAQ,sBAAmB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DashboardPattern"],"sourceRoot":"../../../../../src","sources":["patterns/pattern-components/DashboardPattern/index.ts"],"mappings":";;AAAA,SAASA,gBAAgB,QAAQ,uBAAoB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["EntityPatternGuided"],"sourceRoot":"../../../../../src","sources":["patterns/pattern-components/EntityPatternGuided/index.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAAQ,0BAAuB","ignoreList":[]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import figma from '@figma/code-connect';
|
|
4
|
+
import { SuccessPattern } from "./SuccessPattern.js";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
const FIGMA_URL = 'https://www.figma.com/design/66WaqopqU3WXgwVtyQuTUf/React-Native-Blueprint-Library?node-id=411-3184';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* SuccessPattern - Success state pattern with animated checkmark
|
|
10
|
+
*
|
|
11
|
+
* Use cases:
|
|
12
|
+
* - Order confirmation screens
|
|
13
|
+
* - Form submission success
|
|
14
|
+
* - Action completion feedback
|
|
15
|
+
* - Payment confirmation
|
|
16
|
+
* - Task completion states
|
|
17
|
+
*
|
|
18
|
+
* Features:
|
|
19
|
+
* - Animated success tick using Lottie (Success-Tick.json)
|
|
20
|
+
* - Customizable success message
|
|
21
|
+
* - Optional description text
|
|
22
|
+
* - Configurable animation behavior (loop, autoplay, duration)
|
|
23
|
+
* - Callback when animation completes
|
|
24
|
+
*/
|
|
25
|
+
figma.connect(SuccessPattern, FIGMA_URL, {
|
|
26
|
+
props: {
|
|
27
|
+
successMessage: figma.string('SuccessMessage'),
|
|
28
|
+
description: figma.string('Description')
|
|
29
|
+
},
|
|
30
|
+
example: props => /*#__PURE__*/_jsx(SuccessPattern, {
|
|
31
|
+
successMessage: props.successMessage,
|
|
32
|
+
description: props.description,
|
|
33
|
+
showAnimation: true,
|
|
34
|
+
autoplay: true,
|
|
35
|
+
loop: false
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=SuccessPattern.figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["figma","SuccessPattern","jsx","_jsx","FIGMA_URL","connect","props","successMessage","string","description","example","showAnimation","autoplay","loop"],"sourceRoot":"../../../../../src","sources":["patterns/pattern-components/SuccessPattern/SuccessPattern.figma.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,qBAAqB;AACvC,SAASC,cAAc,QAAQ,qBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAElD,MAAMC,SAAS,GACb,qGAAqG;;AAEvG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACAJ,KAAK,CAACK,OAAO,CAACJ,cAAc,EAAEG,SAAS,EAAE;EACvCE,KAAK,EAAE;IACLC,cAAc,EAAEP,KAAK,CAACQ,MAAM,CAAC,gBAAgB,CAAC;IAC9CC,WAAW,EAAET,KAAK,CAACQ,MAAM,CAAC,aAAa;EACzC,CAAC;EACDE,OAAO,EAAGJ,KAAK,iBACbH,IAAA,CAACF,cAAc;IACbM,cAAc,EAAED,KAAK,CAACC,cAAe;IACrCE,WAAW,EAAEH,KAAK,CAACG,WAAY;IAC/BE,aAAa,EAAE,IAAK;IACpBC,QAAQ,EAAE,IAAK;IACfC,IAAI,EAAE;EAAM,CACb;AAEL,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { View as RNView } from 'react-native';
|
|
6
|
+
import { cssInterop } from 'nativewind';
|
|
7
|
+
import LottieView from 'lottie-react-native';
|
|
8
|
+
import { cn } from "../../../lib/utils.js";
|
|
9
|
+
import { Text } from "../../../components/Input/Text/Text.js";
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
cssInterop(RNView, {
|
|
12
|
+
className: 'style'
|
|
13
|
+
});
|
|
14
|
+
const View = RNView;
|
|
15
|
+
|
|
16
|
+
/* ============================================================================
|
|
17
|
+
* Types
|
|
18
|
+
* ============================================================================ */
|
|
19
|
+
|
|
20
|
+
/* ============================================================================
|
|
21
|
+
* Component
|
|
22
|
+
* ============================================================================ */
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* SuccessPattern Component
|
|
26
|
+
*
|
|
27
|
+
* A pattern component that displays a success state with:
|
|
28
|
+
* - Animated success tick/checkmark (Lottie animation)
|
|
29
|
+
* - Success message
|
|
30
|
+
* - Description text
|
|
31
|
+
*
|
|
32
|
+
* Perfect for use after form submissions, confirmations, or successful operations.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* <SuccessPattern
|
|
37
|
+
* successMessage="Order Placed Successfully!"
|
|
38
|
+
* description="Your order has been confirmed"
|
|
39
|
+
* showAnimation={true}
|
|
40
|
+
* onAnimationFinish={() => navigation.navigate('Home')}
|
|
41
|
+
* />
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export const SuccessPattern = ({
|
|
45
|
+
successMessage = 'This is the Success Message',
|
|
46
|
+
description = 'Success message descriptions goes here',
|
|
47
|
+
showAnimation = true,
|
|
48
|
+
animationDuration = 2000,
|
|
49
|
+
loop = false,
|
|
50
|
+
autoplay = true,
|
|
51
|
+
className,
|
|
52
|
+
testID,
|
|
53
|
+
onAnimationFinish
|
|
54
|
+
}) => {
|
|
55
|
+
const animationRef = React.useRef(null);
|
|
56
|
+
React.useEffect(() => {
|
|
57
|
+
if (autoplay && animationRef.current && showAnimation) {
|
|
58
|
+
animationRef.current.play();
|
|
59
|
+
}
|
|
60
|
+
}, [showAnimation, autoplay]);
|
|
61
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
62
|
+
testID: testID,
|
|
63
|
+
className: cn('w-full items-center justify-center bg-surface-page', className),
|
|
64
|
+
children: [showAnimation && /*#__PURE__*/_jsx(View, {
|
|
65
|
+
className: "h-60 w-60 items-center justify-center",
|
|
66
|
+
children: /*#__PURE__*/_jsx(LottieView, {
|
|
67
|
+
ref: animationRef,
|
|
68
|
+
source: require('../../../assets/Success-Tick.json'),
|
|
69
|
+
autoPlay: autoplay,
|
|
70
|
+
loop: loop,
|
|
71
|
+
duration: animationDuration,
|
|
72
|
+
onAnimationFinish: onAnimationFinish,
|
|
73
|
+
style: {
|
|
74
|
+
width: 300,
|
|
75
|
+
height: 300
|
|
76
|
+
}
|
|
77
|
+
})
|
|
78
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
79
|
+
className: "w-full items-center gap-2 text-center px-4 py-6",
|
|
80
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
81
|
+
className: "text-lg font-semibold text-text-primary",
|
|
82
|
+
children: successMessage
|
|
83
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
84
|
+
className: "text-sm font-medium text-text-secondary",
|
|
85
|
+
children: description
|
|
86
|
+
})]
|
|
87
|
+
})]
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
SuccessPattern.displayName = 'SuccessPattern';
|
|
91
|
+
//# sourceMappingURL=SuccessPattern.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","RNView","cssInterop","LottieView","cn","Text","jsx","_jsx","jsxs","_jsxs","className","SuccessPattern","successMessage","description","showAnimation","animationDuration","loop","autoplay","testID","onAnimationFinish","animationRef","useRef","useEffect","current","play","children","ref","source","require","autoPlay","duration","style","width","height","displayName"],"sourceRoot":"../../../../../src","sources":["patterns/pattern-components/SuccessPattern/SuccessPattern.tsx"],"mappings":";;AAAA;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,IAAIC,MAAM,QAAQ,cAAc;AAC7C,SAASC,UAAU,QAAQ,YAAY;AACvC,OAAOC,UAAU,MAAM,qBAAqB;AAC5C,SAASC,EAAE,QAAQ,uBAAoB;AACvC,SAASC,IAAI,QAAQ,wCAAqC;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE3DP,UAAU,CAACD,MAAM,EAAE;EAAES,SAAS,EAAE;AAAQ,CAAC,CAAC;AAE1C,MAAMV,IAAI,GAAGC,MAEZ;;AAED;AACA;AACA;;AAuBA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMU,cAAc,GAAGA,CAAC;EAC7BC,cAAc,GAAG,6BAA6B;EAC9CC,WAAW,GAAG,wCAAwC;EACtDC,aAAa,GAAG,IAAI;EACpBC,iBAAiB,GAAG,IAAI;EACxBC,IAAI,GAAG,KAAK;EACZC,QAAQ,GAAG,IAAI;EACfP,SAAS;EACTQ,MAAM;EACNC;AACmB,CAAC,KAAK;EACzB,MAAMC,YAAY,GAAGrB,KAAK,CAACsB,MAAM,CAAM,IAAI,CAAC;EAE5CtB,KAAK,CAACuB,SAAS,CAAC,MAAM;IACpB,IAAIL,QAAQ,IAAIG,YAAY,CAACG,OAAO,IAAIT,aAAa,EAAE;MACrDM,YAAY,CAACG,OAAO,CAACC,IAAI,CAAC,CAAC;IAC7B;EACF,CAAC,EAAE,CAACV,aAAa,EAAEG,QAAQ,CAAC,CAAC;EAE7B,oBACER,KAAA,CAACT,IAAI;IACHkB,MAAM,EAAEA,MAAO;IACfR,SAAS,EAAEN,EAAE,CACX,oDAAoD,EACpDM,SACF,CAAE;IAAAe,QAAA,GAGDX,aAAa,iBACZP,IAAA,CAACP,IAAI;MAACU,SAAS,EAAC,uCAAuC;MAAAe,QAAA,eACrDlB,IAAA,CAACJ,UAAU;QACTuB,GAAG,EAAEN,YAAa;QAClBO,MAAM,EAAEC,OAAO,CAAC,mCAAmC,CAAE;QACrDC,QAAQ,EAAEZ,QAAS;QACnBD,IAAI,EAAEA,IAAK;QACXc,QAAQ,EAAEf,iBAAkB;QAC5BI,iBAAiB,EAAEA,iBAAkB;QACrCY,KAAK,EAAE;UAAEC,KAAK,EAAE,GAAG;UAAEC,MAAM,EAAE;QAAI;MAAE,CACpC;IAAC,CACE,CACP,eAGDxB,KAAA,CAACT,IAAI;MAACU,SAAS,EAAC,iDAAiD;MAAAe,QAAA,gBAC/DlB,IAAA,CAACF,IAAI;QAACK,SAAS,EAAC,yCAAyC;QAAAe,QAAA,EACtDb;MAAc,CACX,CAAC,eACPL,IAAA,CAACF,IAAI;QAACK,SAAS,EAAC,yCAAyC;QAAAe,QAAA,EACtDZ;MAAW,CACR,CAAC;IAAA,CACH,CAAC;EAAA,CACH,CAAC;AAEX,CAAC;AAEDF,cAAc,CAACuB,WAAW,GAAG,gBAAgB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SuccessPattern"],"sourceRoot":"../../../../../src","sources":["patterns/pattern-components/SuccessPattern/index.ts"],"mappings":";;AAAA,SAASA,cAAc,QAAQ,qBAAkB","ignoreList":[]}
|
|
@@ -2,17 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
// @ts-nocheck
|
|
4
4
|
export * from "./AlertDialogPattern/index.js";
|
|
5
|
-
export * from
|
|
5
|
+
export * from "./DashboardPattern/index.js";
|
|
6
6
|
export * from "./EmptyState/index.js";
|
|
7
7
|
export * from "./DataListPattern/index.js";
|
|
8
8
|
export * from "./CardListPattern/index.js";
|
|
9
9
|
export * from "./AlertPattern/index.js";
|
|
10
10
|
export * from "./DialogPattern/index.js";
|
|
11
11
|
export * from "./SkeletonPattern/index.js";
|
|
12
|
+
export * from "./SuccessPattern/index.js";
|
|
12
13
|
export * from "./FormPattern/index.js";
|
|
13
14
|
export * from "./EntityPatternOverview/index.js";
|
|
14
15
|
export * from "./EntityPatternStructured/index.js";
|
|
15
|
-
export * from
|
|
16
|
-
export * from "./CalendarPattern/
|
|
16
|
+
export * from "./EntityPatternGuided/index.js";
|
|
17
|
+
export * from "./CalendarPattern/index.js";
|
|
17
18
|
export * from "./MonthlyCalendarPattern/index.js";
|
|
18
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["patterns/pattern-components/index.ts"],"mappings":";;AAAA;AACA,cAAc,+BAAsB;AACpC,cAAc,
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["patterns/pattern-components/index.ts"],"mappings":";;AAAA;AACA,cAAc,+BAAsB;AACpC,cAAc,6BAAoB;AAClC,cAAc,uBAAc;AAC5B,cAAc,4BAAmB;AACjC,cAAc,4BAAmB;AACjC,cAAc,yBAAgB;AAC9B,cAAc,0BAAiB;AAC/B,cAAc,4BAAmB;AACjC,cAAc,2BAAkB;AAChC,cAAc,wBAAe;AAC7B,cAAc,kCAAyB;AACvC,cAAc,oCAA2B;AACzC,cAAc,gCAAuB;AACrC,cAAc,4BAAmB;AACjC,cAAc,mCAA0B","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@campxdev/react-native-blueprint",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16",
|
|
4
4
|
"description": "This is a react-native package for mobile apps",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"files": [
|
|
16
16
|
"src",
|
|
17
17
|
"lib",
|
|
18
|
+
"global.css",
|
|
18
19
|
"android",
|
|
19
20
|
"ios",
|
|
20
21
|
"cpp",
|
|
@@ -42,7 +43,7 @@
|
|
|
42
43
|
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
43
44
|
"clean": "del-cli lib",
|
|
44
45
|
"prepare": "bob build --target module",
|
|
45
|
-
"build:full": "bob build",
|
|
46
|
+
"build:full": "bob build && cp global.css lib/",
|
|
46
47
|
"release": "release-it --only-version"
|
|
47
48
|
},
|
|
48
49
|
"keywords": [
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"v":"5.9.0","fr":29.9700012207031,"ip":0,"op":61.0000024845809,"w":480,"h":480,"nm":"Comp 1","ddd":0,"assets":[{"id":"comp_0","nm":"top bottom dots","fr":29.9700012207031,"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"small circle 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":0.621},"o":{"x":0.333,"y":0},"t":7,"s":[240,240,0],"to":[0,12.605,0],"ti":[0,-28.309,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0.175},"t":21,"s":[240,130,0],"to":[0,12.864,0],"ti":[0,-18.333,0]},{"t":27.0000010997325,"s":[240,240,0]}],"ix":2,"l":2},"a":{"a":0,"k":[10,5,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":0,"s":[0,0,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":7,"s":[100,100,100]},{"i":{"x":[0.833,0.833,0.833],"y":[1,1,1]},"o":{"x":[0.167,0.167,0.167],"y":[0,0,0]},"t":17,"s":[90,90,100]},{"t":27.0000010997325,"s":[90,90,100]}],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[44,44],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0.5333,0.6902,0.3255,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[10,5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":90.0000036657751,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"small circle 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":7,"s":[240,240,0],"to":[0,18.333,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":21,"s":[240,350,0],"to":[0,0,0],"ti":[0,18.333,0]},{"t":27.0000010997325,"s":[240,240,0]}],"ix":2,"l":2},"a":{"a":0,"k":[10,5,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":0,"s":[0,0,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":7,"s":[100,100,100]},{"t":17.0000006924242,"s":[90,90,100]}],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[44,44],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0.5333,0.6902,0.3255,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[10,5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":90.0000036657751,"st":0,"bm":0}]}],"layers":[{"ddd":0,"ind":2,"ty":0,"nm":"top bottom dots","refId":"comp_0","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":10,"s":[0]},{"t":20.0000008146167,"s":[90]}],"ix":10},"p":{"a":0,"k":[240,240,0],"ix":2,"l":2},"a":{"a":0,"k":[240,240,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"w":480,"h":480,"ip":0,"op":27.0000010997325,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"tick","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":22,"s":[0]},{"t":42.0000017106951,"s":[100]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[225,234,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0]],"v":[[-39,13],[-8,44],[71,-35]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":15,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":-8.00000032584668,"op":82.0000033399285,"st":-8.00000032584668,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"circle rotate 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":-76.213,"ix":10},"p":{"a":0,"k":[240,240,0],"ix":2,"l":2},"a":{"a":0,"k":[60,28,0],"ix":1,"l":2},"s":{"a":0,"k":[58,58,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[332,332],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.4245,0.584,0.216,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":5,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[60,28],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":10,"s":[0]},{"t":50.0000020365418,"s":[100]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[0]},{"t":40.0000016292334,"s":[100]}],"ix":2},"o":{"a":0,"k":-163,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":18.000000733155,"op":90.0000036657751,"st":0,"bm":0},{"ddd":0,"ind":5,"ty":4,"nm":"circle rotate","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":-76.213,"ix":10},"p":{"a":0,"k":[240,240,0],"ix":2,"l":2},"a":{"a":0,"k":[60,28,0],"ix":1,"l":2},"s":{"a":0,"k":[67,67,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[332,332],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.4245,0.584,0.216,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":5,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[60,28],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":10,"s":[0]},{"t":50.0000020365418,"s":[100]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[0]},{"t":40.0000016292334,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":18.000000733155,"op":90.0000036657751,"st":0,"bm":0},{"ddd":0,"ind":6,"ty":4,"nm":"star Outlines","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":22,"s":[0]},{"t":62.0000025253118,"s":[180]}],"ix":10},"p":{"a":0,"k":[240,240,0],"ix":2,"l":2},"a":{"a":0,"k":[251.841,245.65,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":22,"s":[0,0,100]},{"t":32.0000013033867,"s":[100,100,100]}],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-7.843,4.018],[0,0],[-7.636,-11.816],[-8.801,-0.442],[-0.706,-14.051],[-7.401,-4.783],[6.414,-12.521],[-4.018,-7.843],[11.816,-7.636],[0.442,-8.801],[14.051,-0.705],[4.783,-7.402],[12.521,6.415],[7.843,-4.018],[7.636,11.815],[8.801,0.442],[0.705,14.051],[7.401,4.784],[-6.415,12.521],[4.018,7.843],[-11.815,7.636],[-0.442,8.801],[-14.051,0.706],[-4.784,7.401],[-12.521,-6.414]],"o":[[0,0],[12.521,-6.414],[4.783,7.401],[14.051,0.706],[0.442,8.801],[11.816,7.636],[-4.018,7.843],[6.414,12.521],[-7.401,4.784],[-0.706,14.051],[-8.801,0.442],[-7.636,11.815],[-7.843,-4.018],[-12.521,6.415],[-4.784,-7.402],[-14.051,-0.705],[-0.442,-8.801],[-11.815,-7.636],[4.018,-7.843],[-6.415,-12.521],[7.401,-4.783],[0.705,-14.051],[8.801,-0.442],[7.636,-11.816],[7.843,4.018]],"v":[[12.492,-117.622],[12.492,-117.622],[47.993,-108.109],[69.629,-95.618],[95.618,-69.629],[108.109,-47.993],[117.622,-12.492],[117.622,12.491],[108.109,47.992],[95.618,69.628],[69.629,95.617],[47.993,108.109],[12.492,117.621],[-12.491,117.621],[-47.992,108.109],[-69.628,95.617],[-95.617,69.628],[-108.109,47.992],[-117.621,12.491],[-117.621,-12.492],[-108.109,-47.993],[-95.617,-69.629],[-69.628,-95.618],[-47.992,-108.109],[-12.491,-117.622]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.5333,0.6902,0.3255,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[251.84,245.65],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":22.0000008960784,"op":112.000004561854,"st":22.0000008960784,"bm":0}],"markers":[]}
|
|
@@ -11,6 +11,7 @@ export const Lotties = {
|
|
|
11
11
|
noTask: require('../no-task.json'),
|
|
12
12
|
noWifi: require('../no-wifi.json'),
|
|
13
13
|
loading: require('../Loading Animation.json'),
|
|
14
|
+
success: require('../Success-Tick.json'),
|
|
14
15
|
} as const;
|
|
15
16
|
|
|
16
17
|
export type LottieKey = keyof typeof Lotties;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import figma from '@figma/code-connect';
|
|
2
|
+
import { Banner } from './Banner';
|
|
3
|
+
|
|
4
|
+
const FIGMA_URL =
|
|
5
|
+
'https://www.figma.com/design/66WaqopqU3WXgwVtyQuTUf/React-Native-Blueprint-Library?node-id=454-8359';
|
|
6
|
+
|
|
7
|
+
figma.connect(Banner, FIGMA_URL, {
|
|
8
|
+
props: {
|
|
9
|
+
title: figma.string('Title'),
|
|
10
|
+
subtitle: figma.string('Subtitle'),
|
|
11
|
+
showBadge: figma.boolean('Show Badge'),
|
|
12
|
+
showActionItems: figma.boolean('Show ActionItems'),
|
|
13
|
+
showTrailing: figma.boolean('Show Trailing'),
|
|
14
|
+
},
|
|
15
|
+
example: (props) => (
|
|
16
|
+
<Banner
|
|
17
|
+
title={props.title}
|
|
18
|
+
subtitle={props.subtitle}
|
|
19
|
+
showBadge={props.showBadge}
|
|
20
|
+
badgeText="Badge"
|
|
21
|
+
showActionItems={props.showActionItems}
|
|
22
|
+
actionItems={['Action Item', 'Action Item', 'Action Item']}
|
|
23
|
+
showTrailing={props.showTrailing}
|
|
24
|
+
/>
|
|
25
|
+
),
|
|
26
|
+
});
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { View as RNView, Pressable as RNPressable } from 'react-native';
|
|
4
|
+
import { cssInterop } from 'nativewind';
|
|
5
|
+
import { LinearGradient } from 'expo-linear-gradient';
|
|
6
|
+
import { Plus } from 'lucide-react-native';
|
|
7
|
+
import { Text } from '../../Input/Text/Text';
|
|
8
|
+
import { Badge } from '../Badge/Badge';
|
|
9
|
+
import { Icon } from '../../ui/Icon';
|
|
10
|
+
|
|
11
|
+
cssInterop(RNView, { className: 'style' });
|
|
12
|
+
cssInterop(RNPressable, { className: 'style' });
|
|
13
|
+
cssInterop(LinearGradient, { className: 'style' });
|
|
14
|
+
|
|
15
|
+
const View = RNView as React.ComponentType<
|
|
16
|
+
React.ComponentProps<typeof RNView> & { className?: string }
|
|
17
|
+
>;
|
|
18
|
+
const Pressable = RNPressable as React.ComponentType<
|
|
19
|
+
React.ComponentProps<typeof RNPressable> & { className?: string }
|
|
20
|
+
>;
|
|
21
|
+
|
|
22
|
+
// ============================================================================
|
|
23
|
+
// TYPES
|
|
24
|
+
// ============================================================================
|
|
25
|
+
|
|
26
|
+
export interface BannerProps {
|
|
27
|
+
title?: string;
|
|
28
|
+
subtitle?: string;
|
|
29
|
+
showBadge?: boolean;
|
|
30
|
+
badgeText?: string;
|
|
31
|
+
showActionItems?: boolean;
|
|
32
|
+
actionItems?: string[];
|
|
33
|
+
showTrailing?: boolean;
|
|
34
|
+
onTrailingPress?: () => void;
|
|
35
|
+
testID?: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// ============================================================================
|
|
39
|
+
// MAIN COMPONENT
|
|
40
|
+
// ============================================================================
|
|
41
|
+
|
|
42
|
+
function Banner({
|
|
43
|
+
title = 'Banner Title',
|
|
44
|
+
subtitle = 'Subtitle of the banner goes here',
|
|
45
|
+
showBadge = true,
|
|
46
|
+
badgeText = 'Badge',
|
|
47
|
+
showActionItems = true,
|
|
48
|
+
actionItems = ['Action Item', 'Action Item', 'Action Item'],
|
|
49
|
+
showTrailing = true,
|
|
50
|
+
onTrailingPress,
|
|
51
|
+
testID,
|
|
52
|
+
}: BannerProps) {
|
|
53
|
+
return (
|
|
54
|
+
<LinearGradient
|
|
55
|
+
testID={testID}
|
|
56
|
+
colors={['#573dab', '#573dab33']}
|
|
57
|
+
start={{ x: 0, y: 0 }}
|
|
58
|
+
end={{ x: 1, y: 1 }}
|
|
59
|
+
className="w-full max-w-[400px] flex-row items-center justify-between gap-4 rounded-lg p-4"
|
|
60
|
+
>
|
|
61
|
+
{/* Main Content */}
|
|
62
|
+
<View className="flex-1 flex-col gap-5">
|
|
63
|
+
{/* Header with Title and Badge */}
|
|
64
|
+
<View className="flex-col gap-1">
|
|
65
|
+
<View className="flex-row items-center gap-2">
|
|
66
|
+
<Text className="font-semibold text-base text-white">{title}</Text>
|
|
67
|
+
{showBadge && (
|
|
68
|
+
<Badge variant="default" size="sm">
|
|
69
|
+
<Text>{badgeText}</Text>
|
|
70
|
+
</Badge>
|
|
71
|
+
)}
|
|
72
|
+
</View>
|
|
73
|
+
<Text className="font-medium text-xs text-white opacity-70">
|
|
74
|
+
{subtitle}
|
|
75
|
+
</Text>
|
|
76
|
+
</View>
|
|
77
|
+
|
|
78
|
+
{/* Action Items */}
|
|
79
|
+
{showActionItems && actionItems && actionItems.length > 0 && (
|
|
80
|
+
<View className="flex-row items-center gap-3">
|
|
81
|
+
{actionItems.map((item, index) => (
|
|
82
|
+
<React.Fragment key={index}>
|
|
83
|
+
{index > 0 && (
|
|
84
|
+
<View className="h-1 w-1 rounded-full bg-white" />
|
|
85
|
+
)}
|
|
86
|
+
<Text className="font-medium text-xs text-white">{item}</Text>
|
|
87
|
+
</React.Fragment>
|
|
88
|
+
))}
|
|
89
|
+
</View>
|
|
90
|
+
)}
|
|
91
|
+
</View>
|
|
92
|
+
|
|
93
|
+
{/* Trailing Icon */}
|
|
94
|
+
{showTrailing && (
|
|
95
|
+
<Pressable
|
|
96
|
+
onPress={onTrailingPress}
|
|
97
|
+
hitSlop={12}
|
|
98
|
+
className="flex-row items-center justify-center"
|
|
99
|
+
>
|
|
100
|
+
<Icon as={Plus} size={16} color="white" />
|
|
101
|
+
</Pressable>
|
|
102
|
+
)}
|
|
103
|
+
</LinearGradient>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export { Banner };
|
|
108
|
+
export default Banner;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import figma from '@figma/code-connect';
|
|
2
|
+
import { Greeting } from './Greeting';
|
|
3
|
+
|
|
4
|
+
const FIGMA_URL =
|
|
5
|
+
'https://www.figma.com/design/66WaqopqU3WXgwVtyQuTUf/React-Native-Blueprint-Library?node-id=448-8146';
|
|
6
|
+
|
|
7
|
+
figma.connect(Greeting, FIGMA_URL, {
|
|
8
|
+
props: {
|
|
9
|
+
showNextUp: figma.boolean('Show NextUp'),
|
|
10
|
+
},
|
|
11
|
+
example: (props) => <Greeting showNextUp={props.showNextUp} />,
|
|
12
|
+
});
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import {
|
|
4
|
+
Pressable as RNPressable,
|
|
5
|
+
StyleSheet,
|
|
6
|
+
View as RNView,
|
|
7
|
+
} from 'react-native';
|
|
8
|
+
import { cssInterop } from 'nativewind';
|
|
9
|
+
import { Calendar } from 'lucide-react-native';
|
|
10
|
+
import { cn } from '../../../lib/utils';
|
|
11
|
+
import { Text } from '../../Input/Text/Text';
|
|
12
|
+
import { Icon } from '../../ui/Icon';
|
|
13
|
+
|
|
14
|
+
cssInterop(RNView, { className: 'style' });
|
|
15
|
+
cssInterop(RNPressable, { className: 'style' });
|
|
16
|
+
|
|
17
|
+
const View = RNView as React.ComponentType<
|
|
18
|
+
React.ComponentProps<typeof RNView> & { className?: string }
|
|
19
|
+
>;
|
|
20
|
+
const Pressable = RNPressable as React.ComponentType<
|
|
21
|
+
React.ComponentProps<typeof RNPressable> & { className?: string }
|
|
22
|
+
>;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Props for the Greeting component
|
|
26
|
+
*/
|
|
27
|
+
export interface GreetingProps {
|
|
28
|
+
/** User's name to display in greeting */
|
|
29
|
+
userName?: string;
|
|
30
|
+
/** Greeting message (e.g., "Good Morning") */
|
|
31
|
+
greetingText?: string;
|
|
32
|
+
/** Subtitle/secondary text below greeting */
|
|
33
|
+
subtitle?: string;
|
|
34
|
+
/** Whether to show the schedule/calendar button */
|
|
35
|
+
showScheduleButton?: boolean;
|
|
36
|
+
/** Callback when schedule button is pressed */
|
|
37
|
+
onSchedulePress?: () => void;
|
|
38
|
+
/** Whether to show the "Next up" section */
|
|
39
|
+
showNextUp?: boolean;
|
|
40
|
+
/** Next class/course name */
|
|
41
|
+
nextUpTitle?: string;
|
|
42
|
+
/** Time for next class */
|
|
43
|
+
nextUpTime?: string;
|
|
44
|
+
/** Additional CSS classes for styling */
|
|
45
|
+
className?: string;
|
|
46
|
+
/** Test identifier */
|
|
47
|
+
testID?: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Greeting - A personalized greeting card with schedule information
|
|
52
|
+
*
|
|
53
|
+
* Displays a personalized greeting with user name, class information, and upcoming
|
|
54
|
+
* class details. Features a prominent purple schedule button with calendar icon,
|
|
55
|
+
* "Next up" section with course name and time, and flexible visibility controls.
|
|
56
|
+
*
|
|
57
|
+
* Design from Figma: node-id=448-8146
|
|
58
|
+
* - Header: "Hey {name}, {greeting}" + Subtitle
|
|
59
|
+
* - Schedule Button: Purple (#573dab) with calendar icon and shadow
|
|
60
|
+
* - Next Up: Course name + divider dot + time
|
|
61
|
+
*
|
|
62
|
+
* @component
|
|
63
|
+
* @example
|
|
64
|
+
* ```tsx
|
|
65
|
+
* <Greeting
|
|
66
|
+
* userName="Marshall"
|
|
67
|
+
* greetingText="Good Morning"
|
|
68
|
+
* subtitle="You have 3 Classes today"
|
|
69
|
+
* nextUpTitle="Digital Logic Design"
|
|
70
|
+
* nextUpTime="10:00 AM"
|
|
71
|
+
* showNextUp={true}
|
|
72
|
+
* onSchedulePress={() => navigate('Schedule')}
|
|
73
|
+
* />
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
export function Greeting({
|
|
77
|
+
userName = 'Marshall',
|
|
78
|
+
greetingText = 'Good Morning',
|
|
79
|
+
subtitle = 'You have 3 Classes today',
|
|
80
|
+
showScheduleButton = true,
|
|
81
|
+
onSchedulePress,
|
|
82
|
+
showNextUp = true,
|
|
83
|
+
nextUpTitle = 'Digital Logic Design',
|
|
84
|
+
nextUpTime = '10:00 AM',
|
|
85
|
+
className,
|
|
86
|
+
testID,
|
|
87
|
+
}: GreetingProps) {
|
|
88
|
+
return (
|
|
89
|
+
<View
|
|
90
|
+
testID={testID}
|
|
91
|
+
className={cn(
|
|
92
|
+
'w-full max-w-[400px] flex-col gap-4 items-start justify-end rounded-lg border border-border-default bg-surface-default px-3 py-4',
|
|
93
|
+
className
|
|
94
|
+
)}
|
|
95
|
+
>
|
|
96
|
+
{/* Header Section: Greeting + Schedule Button */}
|
|
97
|
+
<View className="w-full flex-row items-center justify-between">
|
|
98
|
+
{/* Header Content: Title and Subtitle */}
|
|
99
|
+
<View className="flex-1 flex-col gap-1">
|
|
100
|
+
<Text className="font-semibold text-base text-text-primary">
|
|
101
|
+
{`Hey ${userName}, ${greetingText}`}
|
|
102
|
+
</Text>
|
|
103
|
+
<Text className="font-medium text-xs text-text-secondary">
|
|
104
|
+
{subtitle}
|
|
105
|
+
</Text>
|
|
106
|
+
</View>
|
|
107
|
+
|
|
108
|
+
{/* Schedule Button with Calendar Icon */}
|
|
109
|
+
{showScheduleButton && (
|
|
110
|
+
<Pressable
|
|
111
|
+
onPress={onSchedulePress}
|
|
112
|
+
hitSlop={12}
|
|
113
|
+
className="ml-3 flex-row items-center justify-center rounded-lg bg-highlight-purple p-3"
|
|
114
|
+
style={styles.scheduleButton}
|
|
115
|
+
>
|
|
116
|
+
<Icon as={Calendar} size={16} color="white" />
|
|
117
|
+
</Pressable>
|
|
118
|
+
)}
|
|
119
|
+
</View>
|
|
120
|
+
|
|
121
|
+
{/* Next Up Section */}
|
|
122
|
+
{showNextUp && (
|
|
123
|
+
<View className="w-full flex-col gap-1">
|
|
124
|
+
<Text className="font-medium text-xs text-text-secondary">
|
|
125
|
+
Next up
|
|
126
|
+
</Text>
|
|
127
|
+
{/* Next Up Items: Course Name + Divider + Time */}
|
|
128
|
+
<View className="w-full flex-row items-center gap-3">
|
|
129
|
+
<Text className="font-semibold text-base text-text-primary">
|
|
130
|
+
{nextUpTitle}
|
|
131
|
+
</Text>
|
|
132
|
+
{/* Divider Dot */}
|
|
133
|
+
<View className="h-1.5 w-1.5 rounded-full bg-text-secondary" />
|
|
134
|
+
<Text className="font-semibold text-base text-text-primary">
|
|
135
|
+
{nextUpTime}
|
|
136
|
+
</Text>
|
|
137
|
+
</View>
|
|
138
|
+
</View>
|
|
139
|
+
)}
|
|
140
|
+
</View>
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
Greeting.displayName = 'Greeting';
|
|
145
|
+
|
|
146
|
+
const styles = StyleSheet.create({
|
|
147
|
+
scheduleButton: {
|
|
148
|
+
shadowColor: '#573dab',
|
|
149
|
+
shadowOffset: { width: 0, height: 0 },
|
|
150
|
+
shadowOpacity: 0.5,
|
|
151
|
+
shadowRadius: 12,
|
|
152
|
+
elevation: 8,
|
|
153
|
+
},
|
|
154
|
+
});
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import figma from '@figma/code-connect';
|
|
2
2
|
import { MonthCalendar } from './MonthCalendar';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
example: (props) => <MonthCalendar {...props} />,
|
|
12
|
-
}
|
|
13
|
-
);
|
|
4
|
+
const FIGMA_URL =
|
|
5
|
+
'https://www.figma.com/design/66WaqopqU3WXgwVtyQuTUf/React-Native-Blueprint-Library?node-id=306:9028';
|
|
6
|
+
|
|
7
|
+
figma.connect(MonthCalendar, FIGMA_URL, {
|
|
8
|
+
example: () => <MonthCalendar month="February 2024" />,
|
|
9
|
+
});
|
|
14
10
|
|
|
15
11
|
export default MonthCalendar;
|