@space-uy/pulsar-ui 0.11.1 → 0.11.3
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/module/components/Header.js +82 -14
- package/lib/module/components/Header.js.map +1 -1
- package/lib/module/components/Input.js +2 -0
- package/lib/module/components/Input.js.map +1 -1
- package/lib/module/components/InputContainer.js +3 -0
- package/lib/module/components/InputContainer.js.map +1 -1
- package/lib/module/components/OtpInput.js +173 -65
- package/lib/module/components/OtpInput.js.map +1 -1
- package/lib/module/components/TextArea.js +2 -0
- package/lib/module/components/TextArea.js.map +1 -1
- package/lib/module/index.js +0 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/components/Header.d.ts +6 -1
- package/lib/typescript/src/components/Header.d.ts.map +1 -1
- package/lib/typescript/src/components/Input.d.ts +1 -0
- package/lib/typescript/src/components/Input.d.ts.map +1 -1
- package/lib/typescript/src/components/InputContainer.d.ts +2 -1
- package/lib/typescript/src/components/InputContainer.d.ts.map +1 -1
- package/lib/typescript/src/components/OtpInput.d.ts +9 -2
- package/lib/typescript/src/components/OtpInput.d.ts.map +1 -1
- package/lib/typescript/src/components/TextArea.d.ts +1 -0
- package/lib/typescript/src/components/TextArea.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +0 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Header.tsx +141 -36
- package/src/components/Input.tsx +3 -0
- package/src/components/InputContainer.tsx +8 -0
- package/src/components/OtpInput.tsx +222 -93
- package/src/components/TextArea.tsx +3 -0
- package/src/index.tsx +0 -2
- package/lib/module/components/OtpInputContainer.js +0 -148
- package/lib/module/components/OtpInputContainer.js.map +0 -1
- package/lib/typescript/src/components/OtpInputContainer.d.ts +0 -17
- package/lib/typescript/src/components/OtpInputContainer.d.ts.map +0 -1
- package/src/components/OtpInputContainer.tsx +0 -196
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["default","Button","Tabs","Input","Text","Card","Select","useUIKitTheme","LoadingIndicator","Checkbox","Chip","Icon","IconButton","Header","Switch","ButtonContainer","ButtonVariant","ButtonSize","convertHexToRgba","BottomSheet","TextArea","
|
|
1
|
+
{"version":3,"names":["default","Button","Tabs","Input","Text","Card","Select","useUIKitTheme","LoadingIndicator","Checkbox","Chip","Icon","IconButton","Header","Switch","ButtonContainer","ButtonVariant","ButtonSize","convertHexToRgba","BottomSheet","TextArea","OtpInput","CalendarPicker","Accordion","AccordionItem","CopyToClipboard","Dialog","DialogHeader","DialogTitle","DialogDescription","DialogFooter","DialogAction","DialogCancel"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,OAAO,IAAIC,MAAM,QAAQ,wBAAqB;AACvD,SAASD,OAAO,IAAIE,IAAI,QAAkB,sBAAmB;AAC7D,SAASF,OAAO,IAAIG,KAAK,QAAQ,uBAAoB;AACrD,SAASH,OAAO,IAAII,IAAI,QAAQ,sBAAmB;AACnD,SAASJ,OAAO,IAAIK,IAAI,QAAQ,sBAAmB;AACnD,SAASL,OAAO,IAAIM,MAAM,QAA2B,wBAAqB;AAC1E,SAASN,OAAO,IAAIO,aAAa,QAAQ,qBAAkB;AAE3D,SAASP,OAAO,IAAIQ,gBAAgB,QAAQ,kCAA+B;AAC3E,SAASR,OAAO,IAAIS,QAAQ,QAAQ,0BAAuB;AAC3D,SAAST,OAAO,IAAIU,IAAI,QAAQ,sBAAmB;AACnD,SAASV,OAAO,IAAIW,IAAI,QAAuB,sBAAmB;AAClE,SAASX,OAAO,IAAIY,UAAU,QAAQ,4BAAyB;AAC/D,SAASZ,OAAO,IAAIa,MAAM,QAA4B,wBAAqB;AAC3E,SAASb,OAAO,IAAIc,MAAM,QAAQ,wBAAqB;AACvD,SACEd,OAAO,IAAIe,eAAe,EAC1BC,aAAa,EACbC,UAAU,QACL,iCAA8B;AACrC,SAASC,gBAAgB,QAAQ,oBAAiB;AAClD,SAASlB,OAAO,IAAImB,WAAW,QAAQ,6BAA0B;AACjE,SAASnB,OAAO,IAAIoB,QAAQ,QAAQ,0BAAuB;AAC3D,SAASC,QAAQ,QAAQ,0BAAuB;AAChD,SAASrB,OAAO,IAAIsB,cAAc,QAAQ,gCAA6B;AACvE,SAAStB,OAAO,IAAIuB,SAAS,EAAEC,aAAa,QAAQ,2BAAwB;AAC5E,SAASC,eAAe,QAAQ,iCAA8B;AAC9D,SACEzB,OAAO,IAAI0B,MAAM,EACjBC,YAAY,EACZC,WAAW,EACXC,iBAAiB,EACjBC,YAAY,EACZC,YAAY,EACZC,YAAY,QACP,wBAAqB","ignoreList":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type PropsWithChildren } from 'react';
|
|
2
2
|
import { type ViewStyle, type StyleProp } from 'react-native';
|
|
3
|
+
import { type SharedValue } from 'react-native-reanimated';
|
|
3
4
|
import { type IconName } from './Icon';
|
|
4
5
|
import type { ButtonVariant } from './ButtonContainer';
|
|
5
6
|
export type HeaderVariant = 'default' | 'secondary';
|
|
@@ -17,7 +18,11 @@ type Props = PropsWithChildren & {
|
|
|
17
18
|
rightButton?: HeaderButtonProps;
|
|
18
19
|
style?: StyleProp<ViewStyle>;
|
|
19
20
|
useInsets?: boolean;
|
|
21
|
+
/** When set with variant="secondary", header animates from large title to compact as user scrolls (iOS-style). Pass the scroll view's contentOffset.y (e.g. from useAnimatedScrollHandler). */
|
|
22
|
+
scrollY?: SharedValue<number>;
|
|
23
|
+
/** Scroll offset at which the header is fully collapsed. Ignored when scrollY is not provided. */
|
|
24
|
+
collapseThreshold?: number;
|
|
20
25
|
};
|
|
21
|
-
export default function Header({ title, variant, leftButton, rightButton, style, useInsets, children, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export default function Header({ title, variant, leftButton, rightButton, style, useInsets, children, scrollY, collapseThreshold, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
22
27
|
export {};
|
|
23
28
|
//# sourceMappingURL=Header.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../../src/components/Header.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAoB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../../src/components/Header.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAoB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAChF,OAAiB,EAGf,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAKvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,CAAC;AAIpD,KAAK,iBAAiB,GAAG;IACvB,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,OAAO,aAAa,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,KAAK,KAAK,GAAG,iBAAiB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,+LAA+L;IAC/L,OAAO,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC9B,kGAAkG;IAClG,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAIF,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,KAAK,EACL,OAAmB,EACnB,UAAU,EACV,WAAW,EACX,KAAK,EACL,SAAgB,EAChB,QAAQ,EACR,OAAO,EACP,iBAA8C,GAC/C,EAAE,KAAK,2CAoKP"}
|
|
@@ -11,6 +11,7 @@ export declare const Input: import("react").ForwardRefExoticComponent<TextInputP
|
|
|
11
11
|
hint?: string;
|
|
12
12
|
iconName?: IconName;
|
|
13
13
|
variant?: "text" | "password";
|
|
14
|
+
containerVariant?: "default" | "alternative";
|
|
14
15
|
clearable?: boolean;
|
|
15
16
|
} & import("react").RefAttributes<InputRef>>;
|
|
16
17
|
export default Input;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../../src/components/Input.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,cAAc,EAKpB,MAAM,cAAc,CAAC;AAItB,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../../src/components/Input.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,cAAc,EAKpB,MAAM,cAAc,CAAC;AAItB,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAiBvC,MAAM,MAAM,QAAQ,GAAG;IAAE,KAAK,EAAE,MAAM,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AAE/D,eAAO,MAAM,KAAK;YAZR,SAAS,CAAC,SAAS,CAAC;YACpB,OAAO;YACP,MAAM;WACP,MAAM;eACF,QAAQ;cACT,MAAM,GAAG,UAAU;uBACV,SAAS,GAAG,aAAa;gBAChC,OAAO;4CA6GpB,CAAC;AAUF,eAAe,KAAK,CAAC"}
|
|
@@ -11,12 +11,13 @@ type Props = PropsWithChildren & {
|
|
|
11
11
|
focused?: boolean;
|
|
12
12
|
disabled?: boolean;
|
|
13
13
|
size?: 'small' | 'default';
|
|
14
|
+
variant?: 'default' | 'alternative';
|
|
14
15
|
height?: number;
|
|
15
16
|
iconName?: IconName;
|
|
16
17
|
};
|
|
17
18
|
export type InputRef = {
|
|
18
19
|
focus: () => void;
|
|
19
20
|
};
|
|
20
|
-
export default function InputContainer({ style, contentContainerStyle, error, hint, label, onPress, focused, children, size, disabled, height, iconName, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export default function InputContainer({ style, contentContainerStyle, error, hint, label, onPress, focused, children, size, disabled, variant, height, iconName, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
21
22
|
export {};
|
|
22
23
|
//# sourceMappingURL=InputContainer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/InputContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAsB,MAAM,OAAO,CAAC;AACnE,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAUtB,OAAa,EAAE,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAI7C,KAAK,KAAK,GAAG,iBAAiB,GAAG;IAC/B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,qBAAqB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,C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CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IAAE,KAAK,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AAM7C,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,KAAK,EACL,qBAAqB,EACrB,KAAK,EACL,IAAI,EACJ,KAAK,EACL,OAAO,EACP,OAAO,EACP,QAAQ,EACR,IAAgB,EAChB,QAAQ,EACR,OAAmB,EACnB,MAAM,EACN,QAAQ,GACT,EAAE,KAAK,2CAwEP"}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
type OtpInputProps = {
|
|
2
|
+
length?: number;
|
|
3
|
+
value?: string;
|
|
4
|
+
onChange?: (code: string) => void;
|
|
5
|
+
secure?: boolean;
|
|
6
|
+
variant?: 'default' | 'alternative';
|
|
7
|
+
};
|
|
8
|
+
export declare function OtpInput({ length, value, onChange, secure, variant, }: OtpInputProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
3
10
|
//# sourceMappingURL=OtpInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OtpInput.d.ts","sourceRoot":"","sources":["../../../../src/components/OtpInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OtpInput.d.ts","sourceRoot":"","sources":["../../../../src/components/OtpInput.tsx"],"names":[],"mappings":"AAaA,KAAK,aAAa,GAAG;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;CACrC,CAAC;AAEF,wBAAgB,QAAQ,CAAC,EACvB,MAAU,EACV,KAAK,EACL,QAAQ,EACR,MAAc,EACd,OAAmB,GACpB,EAAE,aAAa,2CAmLf"}
|
|
@@ -11,6 +11,7 @@ export declare const TextArea: import("react").ForwardRefExoticComponent<TextInp
|
|
|
11
11
|
numberOfLines?: number;
|
|
12
12
|
maxLength?: number;
|
|
13
13
|
onChangeText?: (text: string) => void;
|
|
14
|
+
containerVariant?: "default" | "alternative";
|
|
14
15
|
} & import("react").RefAttributes<InputRef>>;
|
|
15
16
|
export default TextArea;
|
|
16
17
|
//# sourceMappingURL=TextArea.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.d.ts","sourceRoot":"","sources":["../../../../src/components/TextArea.tsx"],"names":[],"mappings":"AAOA,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,cAAc,EAKpB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"TextArea.d.ts","sourceRoot":"","sources":["../../../../src/components/TextArea.tsx"],"names":[],"mappings":"AAOA,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,cAAc,EAKpB,MAAM,cAAc,CAAC;AAoBtB,MAAM,MAAM,QAAQ,GAAG;IAAE,KAAK,EAAE,MAAM,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AAE/D,eAAO,MAAM,QAAQ;YAZX,SAAS,CAAC,SAAS,CAAC;YACpB,OAAO;YACP,MAAM;WACP,MAAM;oBACG,MAAM;gBACV,MAAM;mBACH,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI;uBAClB,SAAS,GAAG,aAAa;4CAsG7C,CAAC;AASF,eAAe,QAAQ,CAAC"}
|
|
@@ -17,9 +17,7 @@ export { default as ButtonContainer, ButtonVariant, ButtonSize, } from './compon
|
|
|
17
17
|
export { convertHexToRgba } from './utils/uiUtils';
|
|
18
18
|
export { default as BottomSheet } from './components/BottomSheet';
|
|
19
19
|
export { default as TextArea } from './components/TextArea';
|
|
20
|
-
export { OtpInputContainer } from './components/OtpInputContainer';
|
|
21
20
|
export { OtpInput } from './components/OtpInput';
|
|
22
|
-
export { type OtpInputContainerRef } from './components/OtpInputContainer';
|
|
23
21
|
export { default as CalendarPicker } from './components/CalendarPicker';
|
|
24
22
|
export { default as Accordion, AccordionItem } from './components/Accordion';
|
|
25
23
|
export { CopyToClipboard } from './components/CopyToClipboard';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,KAAK,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC5D,YAAY,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAA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E,OAAO,IAAI,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EACL,OAAO,IAAI,eAAe,EAC1B,aAAa,EACb,UAAU,GACX,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EACL,OAAO,IAAI,MAAM,EACjB,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,YAAY,GACb,MAAM,qBAAqB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { type PropsWithChildren } from 'react';
|
|
2
2
|
import { StyleSheet, View, type ViewStyle, type StyleProp } from 'react-native';
|
|
3
|
+
import Animated, {
|
|
4
|
+
interpolate,
|
|
5
|
+
useAnimatedStyle,
|
|
6
|
+
type SharedValue,
|
|
7
|
+
} from 'react-native-reanimated';
|
|
3
8
|
|
|
4
9
|
import Text from './Text';
|
|
5
10
|
import IconButton from './IconButton';
|
|
@@ -12,6 +17,8 @@ import type { ButtonVariant } from './ButtonContainer';
|
|
|
12
17
|
|
|
13
18
|
export type HeaderVariant = 'default' | 'secondary';
|
|
14
19
|
|
|
20
|
+
const DEFAULT_COLLAPSE_THRESHOLD = 80;
|
|
21
|
+
|
|
15
22
|
type HeaderButtonProps = {
|
|
16
23
|
iconName: IconName;
|
|
17
24
|
onPress?: () => void;
|
|
@@ -27,6 +34,10 @@ type Props = PropsWithChildren & {
|
|
|
27
34
|
rightButton?: HeaderButtonProps;
|
|
28
35
|
style?: StyleProp<ViewStyle>;
|
|
29
36
|
useInsets?: boolean;
|
|
37
|
+
/** When set with variant="secondary", header animates from large title to compact as user scrolls (iOS-style). Pass the scroll view's contentOffset.y (e.g. from useAnimatedScrollHandler). */
|
|
38
|
+
scrollY?: SharedValue<number>;
|
|
39
|
+
/** Scroll offset at which the header is fully collapsed. Ignored when scrollY is not provided. */
|
|
40
|
+
collapseThreshold?: number;
|
|
30
41
|
};
|
|
31
42
|
|
|
32
43
|
const HEADER_BASE_HEIGHT = 52;
|
|
@@ -39,10 +50,57 @@ export default function Header({
|
|
|
39
50
|
style,
|
|
40
51
|
useInsets = true,
|
|
41
52
|
children,
|
|
53
|
+
scrollY,
|
|
54
|
+
collapseThreshold = DEFAULT_COLLAPSE_THRESHOLD,
|
|
42
55
|
}: Props) {
|
|
43
56
|
const { colors, theme } = useTheme();
|
|
44
57
|
const topInset = useInsets ? theme.insets?.top || 0 : 0;
|
|
45
58
|
const isSecondary = variant === 'secondary';
|
|
59
|
+
const isCollapsible = isSecondary && scrollY != null;
|
|
60
|
+
|
|
61
|
+
const animatedHeaderStyle = useAnimatedStyle(() => {
|
|
62
|
+
if (!isCollapsible || scrollY == null) return {};
|
|
63
|
+
const progress = interpolate(
|
|
64
|
+
scrollY.value,
|
|
65
|
+
[0, collapseThreshold],
|
|
66
|
+
[0, 1],
|
|
67
|
+
'clamp'
|
|
68
|
+
);
|
|
69
|
+
return {
|
|
70
|
+
paddingBottom: interpolate(progress, [0, 1], [12, 0]),
|
|
71
|
+
};
|
|
72
|
+
}, [isCollapsible, collapseThreshold]);
|
|
73
|
+
|
|
74
|
+
const animatedTitleRowStyle = useAnimatedStyle(() => {
|
|
75
|
+
if (!isCollapsible || scrollY == null) return {};
|
|
76
|
+
const progress = interpolate(
|
|
77
|
+
scrollY.value,
|
|
78
|
+
[0, collapseThreshold],
|
|
79
|
+
[0, 1],
|
|
80
|
+
'clamp'
|
|
81
|
+
);
|
|
82
|
+
// Estimate: h1 fontSize 24 + line height ~16 + paddingTop 4 = ~44px
|
|
83
|
+
const titleRowHeight = 44;
|
|
84
|
+
return {
|
|
85
|
+
opacity: interpolate(progress, [0, 1], [1, 0]),
|
|
86
|
+
height: interpolate(progress, [0, 1], [titleRowHeight, 0]),
|
|
87
|
+
overflow: 'hidden' as const,
|
|
88
|
+
transform: [{ translateY: interpolate(progress, [0, 1], [0, -16]) }],
|
|
89
|
+
};
|
|
90
|
+
}, [isCollapsible, collapseThreshold]);
|
|
91
|
+
|
|
92
|
+
const animatedSmallTitleStyle = useAnimatedStyle(() => {
|
|
93
|
+
if (!isCollapsible || scrollY == null) return {};
|
|
94
|
+
const progress = interpolate(
|
|
95
|
+
scrollY.value,
|
|
96
|
+
[0, collapseThreshold],
|
|
97
|
+
[0, 1],
|
|
98
|
+
'clamp'
|
|
99
|
+
);
|
|
100
|
+
return {
|
|
101
|
+
opacity: interpolate(progress, [0, 1], [0, 1]),
|
|
102
|
+
};
|
|
103
|
+
}, [isCollapsible, collapseThreshold]);
|
|
46
104
|
|
|
47
105
|
const renderButton = (button: HeaderButtonProps) => {
|
|
48
106
|
return (
|
|
@@ -57,57 +115,104 @@ export default function Header({
|
|
|
57
115
|
);
|
|
58
116
|
};
|
|
59
117
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
backgroundColor: colors.background,
|
|
66
|
-
borderBottomColor: colors.border,
|
|
67
|
-
paddingTop: topInset,
|
|
68
|
-
},
|
|
69
|
-
isSecondary && styles.headerSecondary,
|
|
70
|
-
!!children && styles.paddingBottom,
|
|
71
|
-
style,
|
|
72
|
-
]}
|
|
73
|
-
>
|
|
118
|
+
const showSmallTitleInBar = !isSecondary || isCollapsible;
|
|
119
|
+
const showBigTitleRow = isSecondary;
|
|
120
|
+
|
|
121
|
+
const headerContent = (
|
|
122
|
+
<>
|
|
74
123
|
<View
|
|
75
124
|
style={[
|
|
76
125
|
styles.headerContent,
|
|
77
|
-
isSecondary && styles.headerContentSecondary,
|
|
126
|
+
isSecondary && !isCollapsible && styles.headerContentSecondary,
|
|
127
|
+
isCollapsible && styles.headerContentSecondary,
|
|
78
128
|
]}
|
|
79
129
|
>
|
|
80
130
|
<View style={[styles.slot, styles.leftSlot]}>
|
|
81
131
|
{leftButton && renderButton(leftButton)}
|
|
82
132
|
</View>
|
|
83
|
-
{
|
|
84
|
-
<View style={styles.titleContainer}>
|
|
133
|
+
{showSmallTitleInBar && (
|
|
134
|
+
<View style={styles.titleContainer} pointerEvents="none">
|
|
135
|
+
{isCollapsible ? (
|
|
136
|
+
<Animated.View
|
|
137
|
+
style={[styles.titleContainer, animatedSmallTitleStyle]}
|
|
138
|
+
>
|
|
139
|
+
<Text
|
|
140
|
+
variant="h3"
|
|
141
|
+
style={[styles.title, { color: colors.foreground }]}
|
|
142
|
+
numberOfLines={1}
|
|
143
|
+
ellipsizeMode="tail"
|
|
144
|
+
>
|
|
145
|
+
{title}
|
|
146
|
+
</Text>
|
|
147
|
+
</Animated.View>
|
|
148
|
+
) : (
|
|
149
|
+
<Text
|
|
150
|
+
variant="h3"
|
|
151
|
+
style={[styles.title, { color: colors.foreground }]}
|
|
152
|
+
numberOfLines={1}
|
|
153
|
+
ellipsizeMode="tail"
|
|
154
|
+
>
|
|
155
|
+
{title}
|
|
156
|
+
</Text>
|
|
157
|
+
)}
|
|
158
|
+
</View>
|
|
159
|
+
)}
|
|
160
|
+
<View style={[styles.slot, styles.rightSlot]}>
|
|
161
|
+
{rightButton && renderButton(rightButton)}
|
|
162
|
+
</View>
|
|
163
|
+
</View>
|
|
164
|
+
{showBigTitleRow &&
|
|
165
|
+
(isCollapsible ? (
|
|
166
|
+
<Animated.View style={[styles.titleRow, animatedTitleRowStyle]}>
|
|
167
|
+
<Text
|
|
168
|
+
variant="h1"
|
|
169
|
+
style={[styles.titleSecondary, { color: colors.foreground }]}
|
|
170
|
+
numberOfLines={1}
|
|
171
|
+
ellipsizeMode="tail"
|
|
172
|
+
>
|
|
173
|
+
{title}
|
|
174
|
+
</Text>
|
|
175
|
+
</Animated.View>
|
|
176
|
+
) : (
|
|
177
|
+
<View style={styles.titleRow}>
|
|
85
178
|
<Text
|
|
86
|
-
variant="
|
|
87
|
-
style={[styles.
|
|
179
|
+
variant="h1"
|
|
180
|
+
style={[styles.titleSecondary, { color: colors.foreground }]}
|
|
88
181
|
numberOfLines={1}
|
|
89
182
|
ellipsizeMode="tail"
|
|
90
183
|
>
|
|
91
184
|
{title}
|
|
92
185
|
</Text>
|
|
93
186
|
</View>
|
|
94
|
-
)}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
187
|
+
))}
|
|
188
|
+
</>
|
|
189
|
+
);
|
|
190
|
+
|
|
191
|
+
const staticHeaderStyle = [
|
|
192
|
+
styles.header,
|
|
193
|
+
{
|
|
194
|
+
backgroundColor: colors.background,
|
|
195
|
+
borderBottomColor: colors.border,
|
|
196
|
+
paddingTop: topInset,
|
|
197
|
+
},
|
|
198
|
+
isSecondary && !isCollapsible && styles.headerSecondary,
|
|
199
|
+
isCollapsible && styles.headerSecondary,
|
|
200
|
+
!!children && styles.paddingBottom,
|
|
201
|
+
style,
|
|
202
|
+
];
|
|
203
|
+
|
|
204
|
+
if (isCollapsible) {
|
|
205
|
+
return (
|
|
206
|
+
<Animated.View style={[staticHeaderStyle, animatedHeaderStyle]}>
|
|
207
|
+
{headerContent}
|
|
208
|
+
{children}
|
|
209
|
+
</Animated.View>
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
return (
|
|
214
|
+
<View style={staticHeaderStyle}>
|
|
215
|
+
{headerContent}
|
|
111
216
|
{children}
|
|
112
217
|
</View>
|
|
113
218
|
);
|
package/src/components/Input.tsx
CHANGED
|
@@ -26,6 +26,7 @@ type Props = TextInputProps & {
|
|
|
26
26
|
hint?: string;
|
|
27
27
|
iconName?: IconName;
|
|
28
28
|
variant?: 'text' | 'password';
|
|
29
|
+
containerVariant?: 'default' | 'alternative';
|
|
29
30
|
clearable?: boolean;
|
|
30
31
|
};
|
|
31
32
|
|
|
@@ -42,6 +43,7 @@ export const Input = forwardRef<InputRef, Props>(
|
|
|
42
43
|
label,
|
|
43
44
|
hint,
|
|
44
45
|
variant = 'text',
|
|
46
|
+
containerVariant = 'default',
|
|
45
47
|
onBlur,
|
|
46
48
|
onFocus,
|
|
47
49
|
iconName,
|
|
@@ -93,6 +95,7 @@ export const Input = forwardRef<InputRef, Props>(
|
|
|
93
95
|
focused={focused}
|
|
94
96
|
disabled={!editable}
|
|
95
97
|
iconName={iconName}
|
|
98
|
+
variant={containerVariant}
|
|
96
99
|
>
|
|
97
100
|
<TextInput
|
|
98
101
|
{...rest}
|
|
@@ -29,6 +29,7 @@ type Props = PropsWithChildren & {
|
|
|
29
29
|
focused?: boolean;
|
|
30
30
|
disabled?: boolean;
|
|
31
31
|
size?: 'small' | 'default';
|
|
32
|
+
variant?: 'default' | 'alternative';
|
|
32
33
|
height?: number;
|
|
33
34
|
iconName?: IconName;
|
|
34
35
|
};
|
|
@@ -50,6 +51,7 @@ export default function InputContainer({
|
|
|
50
51
|
children,
|
|
51
52
|
size = 'default',
|
|
52
53
|
disabled,
|
|
54
|
+
variant = 'default',
|
|
53
55
|
height,
|
|
54
56
|
iconName,
|
|
55
57
|
}: Props) {
|
|
@@ -96,6 +98,12 @@ export default function InputContainer({
|
|
|
96
98
|
animStyle,
|
|
97
99
|
styles.container,
|
|
98
100
|
{ height: containerHeight, borderRadius: theme.roundness },
|
|
101
|
+
{
|
|
102
|
+
backgroundColor:
|
|
103
|
+
variant === 'alternative'
|
|
104
|
+
? colors.background
|
|
105
|
+
: colors.altBackground,
|
|
106
|
+
},
|
|
99
107
|
contentContainerStyle,
|
|
100
108
|
]}
|
|
101
109
|
>
|