@avenue-ticketing/native 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +9 -0
  2. package/dist/avatar.d.ts +75 -0
  3. package/dist/avatar.js +300 -0
  4. package/dist/avatar.js.map +1 -0
  5. package/dist/badge.d.ts +149 -0
  6. package/dist/badge.js +388 -0
  7. package/dist/badge.js.map +1 -0
  8. package/dist/button-group.d.ts +36 -0
  9. package/dist/button-group.js +186 -0
  10. package/dist/button-group.js.map +1 -0
  11. package/dist/button.d.ts +45 -0
  12. package/dist/button.js +357 -0
  13. package/dist/button.js.map +1 -0
  14. package/dist/checkbox.d.ts +31 -0
  15. package/dist/checkbox.js +212 -0
  16. package/dist/checkbox.js.map +1 -0
  17. package/dist/date-picker.d.ts +50 -0
  18. package/dist/date-picker.js +755 -0
  19. package/dist/date-picker.js.map +1 -0
  20. package/dist/dialog.d.ts +62 -0
  21. package/dist/dialog.js +325 -0
  22. package/dist/dialog.js.map +1 -0
  23. package/dist/dropdown.d.ts +85 -0
  24. package/dist/dropdown.js +977 -0
  25. package/dist/dropdown.js.map +1 -0
  26. package/dist/input-group-addon-context.d.ts +10 -0
  27. package/dist/input-group-addon-context.js +9 -0
  28. package/dist/input-group-addon-context.js.map +1 -0
  29. package/dist/input.d.ts +325 -0
  30. package/dist/input.js +7890 -0
  31. package/dist/input.js.map +1 -0
  32. package/dist/radio.d.ts +34 -0
  33. package/dist/radio.js +177 -0
  34. package/dist/radio.js.map +1 -0
  35. package/dist/sheet.d.ts +67 -0
  36. package/dist/sheet.js +277 -0
  37. package/dist/sheet.js.map +1 -0
  38. package/dist/slider.d.ts +22 -0
  39. package/dist/slider.js +197 -0
  40. package/dist/slider.js.map +1 -0
  41. package/dist/tabs.d.ts +69 -0
  42. package/dist/tabs.js +379 -0
  43. package/dist/tabs.js.map +1 -0
  44. package/dist/textarea.d.ts +23 -0
  45. package/dist/textarea.js +176 -0
  46. package/dist/textarea.js.map +1 -0
  47. package/dist/toast.d.ts +32 -0
  48. package/dist/toast.js +140 -0
  49. package/dist/toast.js.map +1 -0
  50. package/dist/toggle.d.ts +31 -0
  51. package/dist/toggle.js +205 -0
  52. package/dist/toggle.js.map +1 -0
  53. package/dist/tooltip.d.ts +44 -0
  54. package/dist/tooltip.js +293 -0
  55. package/dist/tooltip.js.map +1 -0
  56. package/package.json +93 -0
  57. package/theme-dark.css +362 -0
  58. package/theme.css +161 -0
@@ -0,0 +1,34 @@
1
+ import { ReactNode, FC } from 'react';
2
+
3
+ declare const RADIO_SIZES: readonly ["sm", "md"];
4
+ type RadioSize = (typeof RADIO_SIZES)[number];
5
+
6
+ interface RadioButtonBaseProps {
7
+ size?: RadioSize;
8
+ className?: string;
9
+ isSelected?: boolean;
10
+ isDisabled?: boolean;
11
+ }
12
+ interface RadioButtonProps {
13
+ value: string;
14
+ size?: RadioSize;
15
+ label?: ReactNode;
16
+ hint?: ReactNode;
17
+ isDisabled?: boolean;
18
+ className?: string;
19
+ }
20
+ interface RadioGroupProps {
21
+ children: ReactNode;
22
+ size?: RadioSize;
23
+ value?: string;
24
+ defaultValue?: string;
25
+ isDisabled?: boolean;
26
+ className?: string;
27
+ accessibilityLabel?: string;
28
+ onChange?: (value: string) => void;
29
+ }
30
+ declare const RadioButtonBase: FC<RadioButtonBaseProps>;
31
+ declare const RadioButton: FC<RadioButtonProps>;
32
+ declare const RadioGroup: FC<RadioGroupProps>;
33
+
34
+ export { RadioButton, RadioButtonBase, type RadioButtonBaseProps, type RadioButtonProps, RadioGroup, type RadioGroupProps, type RadioSize };
package/dist/radio.js ADDED
@@ -0,0 +1,177 @@
1
+ import { createContext, useContext, useState, useEffect } from 'react';
2
+ import { View, Pressable, Text } from 'react-native-css/components';
3
+ import Animated, { Easing, useSharedValue, withDelay, withTiming, useAnimatedStyle } from 'react-native-reanimated';
4
+ import { styled } from 'nativewind';
5
+ import { extendTailwindMerge } from 'tailwind-merge';
6
+ import { jsx, jsxs } from 'react/jsx-runtime';
7
+
8
+ // ../../native/components/base/radio-buttons/radio-buttons.tsx
9
+ var twMerge = extendTailwindMerge({
10
+ extend: {
11
+ theme: {
12
+ text: ["display-xs", "display-sm", "display-md", "display-lg", "display-xl", "display-2xl"]
13
+ }
14
+ }
15
+ });
16
+ var cx = twMerge;
17
+ function sortCx(classes) {
18
+ return classes;
19
+ }
20
+
21
+ // ../core/src/radio.ts
22
+ var radioStyles = sortCx({
23
+ base: {
24
+ root: "relative shrink-0 items-center justify-center rounded-full border border-solid border-primary bg-primary",
25
+ rootSelected: "border-transparent bg-brand-solid",
26
+ rootDisabled: "opacity-50",
27
+ rootDisabledUnchecked: "bg-tertiary",
28
+ dot: "rounded-full bg-fg-white"
29
+ },
30
+ sizes: {
31
+ sm: {
32
+ root: "size-4",
33
+ dot: "size-1.5",
34
+ stack: "gap-2",
35
+ textWrapper: "",
36
+ label: "text-sm font-medium",
37
+ hint: "text-sm",
38
+ baseOffset: "mt-0.5"
39
+ },
40
+ md: {
41
+ root: "size-5",
42
+ dot: "size-2",
43
+ stack: "gap-3",
44
+ textWrapper: "gap-0.5",
45
+ label: "text-md font-medium",
46
+ hint: "text-md",
47
+ baseOffset: "mt-0.5"
48
+ }
49
+ },
50
+ /** Label + hint stack beside the control. */
51
+ stack: "relative flex-row items-start",
52
+ label: "text-secondary",
53
+ hint: "text-tertiary",
54
+ group: "flex-col gap-4"
55
+ });
56
+ var RADIO_DOT_DELAY_MS = 60;
57
+ var RADIO_DOT_POP_MS = 100;
58
+ var RADIO_DOT_EASING = [0.45, 0, 0.2, 1];
59
+ var AnimatedView = styled(Animated.View);
60
+ var dotEasing = Easing.bezier(RADIO_DOT_EASING[0], RADIO_DOT_EASING[1], RADIO_DOT_EASING[2], RADIO_DOT_EASING[3]);
61
+ var RadioGroupContext = createContext(null);
62
+ var RADIO_TEXT_LINE_HEIGHT_PX = {
63
+ sm: 20,
64
+ md: 24
65
+ };
66
+ var radioTextStyle = (size) => ({
67
+ includeFontPadding: false,
68
+ lineHeight: RADIO_TEXT_LINE_HEIGHT_PX[size]
69
+ });
70
+ var RadioAnimatedDot = ({ className }) => {
71
+ const progress = useSharedValue(0);
72
+ useEffect(() => {
73
+ progress.value = 0;
74
+ progress.value = withDelay(
75
+ RADIO_DOT_DELAY_MS,
76
+ withTiming(1, { duration: RADIO_DOT_POP_MS, easing: dotEasing })
77
+ );
78
+ }, [progress]);
79
+ const animatedStyle = useAnimatedStyle(() => ({
80
+ opacity: progress.value,
81
+ transform: [{ scale: progress.value }]
82
+ }));
83
+ return /* @__PURE__ */ jsx(AnimatedView, { style: animatedStyle, className: cx(radioStyles.base.dot, className) });
84
+ };
85
+ var RadioButtonBase = ({
86
+ className,
87
+ isSelected,
88
+ isDisabled,
89
+ size = "sm"
90
+ }) => {
91
+ const sizeStyles = radioStyles.sizes[size];
92
+ return /* @__PURE__ */ jsx(
93
+ View,
94
+ {
95
+ className: cx(
96
+ "overflow-hidden",
97
+ radioStyles.base.root,
98
+ sizeStyles.root,
99
+ isSelected ? radioStyles.base.rootSelected : void 0,
100
+ isDisabled && radioStyles.base.rootDisabled,
101
+ isDisabled && !isSelected && radioStyles.base.rootDisabledUnchecked,
102
+ className
103
+ ),
104
+ children: isSelected && /* @__PURE__ */ jsx(RadioAnimatedDot, { className: sizeStyles.dot })
105
+ }
106
+ );
107
+ };
108
+ RadioButtonBase.displayName = "RadioButtonBase";
109
+ var RadioButton = ({
110
+ value,
111
+ label,
112
+ hint,
113
+ size = "sm",
114
+ isDisabled: isDisabledProp = false,
115
+ className
116
+ }) => {
117
+ const group = useContext(RadioGroupContext);
118
+ const resolvedSize = group?.size ?? size;
119
+ const sizeStyles = radioStyles.sizes[resolvedSize];
120
+ const isSelected = group?.value === value;
121
+ const isDisabled = Boolean(group?.isDisabled || isDisabledProp);
122
+ const select = () => {
123
+ if (isDisabled || isSelected) return;
124
+ group?.setValue(value);
125
+ };
126
+ return /* @__PURE__ */ jsxs(
127
+ Pressable,
128
+ {
129
+ accessibilityRole: "radio",
130
+ accessibilityState: { selected: isSelected, disabled: isDisabled },
131
+ disabled: isDisabled,
132
+ onPress: select,
133
+ className: cx(radioStyles.stack, sizeStyles.stack, className),
134
+ children: [
135
+ /* @__PURE__ */ jsx(
136
+ RadioButtonBase,
137
+ {
138
+ size: resolvedSize,
139
+ isSelected,
140
+ isDisabled,
141
+ className: label || hint ? sizeStyles.baseOffset : ""
142
+ }
143
+ ),
144
+ (label || hint) && /* @__PURE__ */ jsxs(View, { className: cx("flex-col", sizeStyles.textWrapper), children: [
145
+ label && (typeof label === "string" || typeof label === "number" ? /* @__PURE__ */ jsx(Text, { style: radioTextStyle(resolvedSize), className: cx(radioStyles.label, sizeStyles.label), children: label }) : label),
146
+ hint && (typeof hint === "string" || typeof hint === "number" ? /* @__PURE__ */ jsx(Pressable, { accessibilityRole: "text", onPress: () => {
147
+ }, children: /* @__PURE__ */ jsx(Text, { style: radioTextStyle(resolvedSize), className: cx(radioStyles.hint, sizeStyles.hint), children: hint }) }) : hint)
148
+ ] })
149
+ ]
150
+ }
151
+ );
152
+ };
153
+ RadioButton.displayName = "RadioButton";
154
+ var RadioGroup = ({
155
+ children,
156
+ size = "sm",
157
+ value: valueProp,
158
+ defaultValue,
159
+ isDisabled = false,
160
+ className,
161
+ accessibilityLabel,
162
+ onChange
163
+ }) => {
164
+ const [uncontrolled, setUncontrolled] = useState(defaultValue);
165
+ const isControlled = valueProp !== void 0;
166
+ const value = isControlled ? valueProp : uncontrolled;
167
+ const setValue = (next) => {
168
+ if (!isControlled) setUncontrolled(next);
169
+ onChange?.(next);
170
+ };
171
+ return /* @__PURE__ */ jsx(RadioGroupContext.Provider, { value: { size, value, isDisabled, setValue }, children: /* @__PURE__ */ jsx(View, { accessibilityRole: "radiogroup", accessibilityLabel, className: cx(radioStyles.group, className), children }) });
172
+ };
173
+ RadioGroup.displayName = "RadioGroup";
174
+
175
+ export { RadioButton, RadioButtonBase, RadioGroup };
176
+ //# sourceMappingURL=radio.js.map
177
+ //# sourceMappingURL=radio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../core/src/cx.ts","../../core/src/radio.ts","../../../native/components/base/radio-buttons/radio-buttons.tsx"],"names":[],"mappings":";;;;;;;;AAEA,IAAM,UAAU,mBAAA,CAAoB;AAAA,EAChC,MAAA,EAAQ;AAAA,IACJ,KAAA,EAAO;AAAA,MACH,MAAM,CAAC,YAAA,EAAc,cAAc,YAAA,EAAc,YAAA,EAAc,cAAc,aAAa;AAAA;AAC9F;AAER,CAAC,CAAA;AAGM,IAAM,EAAA,GAAK,OAAA;AAGX,SAAS,OAAsH,OAAA,EAAe;AACjJ,EAAA,OAAO,OAAA;AACX;;;ACNO,IAAM,cAAc,MAAA,CAAO;AAAA,EAC9B,IAAA,EAAM;AAAA,IACF,IAAA,EAAM,0GAAA;AAAA,IACN,YAAA,EAAc,mCAAA;AAAA,IACd,YAAA,EAAc,YAAA;AAAA,IACd,qBAAA,EAAuB,aAAA;AAAA,IACvB,GAAA,EAAK;AAAA,GACT;AAAA,EACA,KAAA,EAAO;AAAA,IACH,EAAA,EAAI;AAAA,MACA,IAAA,EAAM,QAAA;AAAA,MACN,GAAA,EAAK,UAAA;AAAA,MACL,KAAA,EAAO,OAAA;AAAA,MACP,WAAA,EAAa,EAAA;AAAA,MACb,KAAA,EAAO,qBAAA;AAAA,MACP,IAAA,EAAM,SAAA;AAAA,MACN,UAAA,EAAY;AAAA,KAChB;AAAA,IACA,EAAA,EAAI;AAAA,MACA,IAAA,EAAM,QAAA;AAAA,MACN,GAAA,EAAK,QAAA;AAAA,MACL,KAAA,EAAO,OAAA;AAAA,MACP,WAAA,EAAa,SAAA;AAAA,MACb,KAAA,EAAO,qBAAA;AAAA,MACP,IAAA,EAAM,SAAA;AAAA,MACN,UAAA,EAAY;AAAA;AAChB,GACJ;AAAA;AAAA,EAEA,KAAA,EAAO,+BAAA;AAAA,EACP,KAAA,EAAO,gBAAA;AAAA,EACP,IAAA,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EACJ,CAAA;AAER;AACA,UAAA,CAAW,WAAA,GAAc,YAAA","file":"radio.js","sourcesContent":["import { extendTailwindMerge } from \"tailwind-merge\";\n\nconst twMerge = extendTailwindMerge({\n extend: {\n theme: {\n text: [\"display-xs\", \"display-sm\", \"display-md\", \"display-lg\", \"display-xl\", \"display-2xl\"],\n },\n },\n});\n\n/** Merge Tailwind / NativeWind class strings. */\nexport const cx = twMerge;\n\n/** Identity helper so Tailwind IntelliSense can sort style maps. */\nexport function sortCx<T extends Record<string, string | number | Record<string, string | number | Record<string, string | number>>>>(classes: T): T {\n return classes;\n}\n","import { sortCx } from \"./cx\";\n\n//////////////////////////////////////////////// TYPES\n\nexport const RADIO_SIZES = [\"sm\", \"md\"] as const;\nexport type RadioSize = (typeof RADIO_SIZES)[number];\n\n//////////////////////////////////////////////// SHARED STYLES\n// Visual contract for web + native (including dot pop timing).\n\nexport const radioStyles = sortCx({\n base: {\n root: \"relative shrink-0 items-center justify-center rounded-full border border-solid border-primary bg-primary\",\n rootSelected: \"border-transparent bg-brand-solid\",\n rootDisabled: \"opacity-50\",\n rootDisabledUnchecked: \"bg-tertiary\",\n dot: \"rounded-full bg-fg-white\",\n },\n sizes: {\n sm: {\n root: \"size-4\",\n dot: \"size-1.5\",\n stack: \"gap-2\",\n textWrapper: \"\",\n label: \"text-sm font-medium\",\n hint: \"text-sm\",\n baseOffset: \"mt-0.5\",\n },\n md: {\n root: \"size-5\",\n dot: \"size-2\",\n stack: \"gap-3\",\n textWrapper: \"gap-0.5\",\n label: \"text-md font-medium\",\n hint: \"text-md\",\n baseOffset: \"mt-0.5\",\n },\n },\n /** Label + hint stack beside the control. */\n stack: \"relative flex-row items-start\",\n label: \"text-secondary\",\n hint: \"text-tertiary\",\n group: \"flex-col gap-4\",\n});\n\n/** Pop-in dot — same delay / duration / easing as the checkbox tick. */\nexport const RADIO_DOT_DELAY_MS = 60;\nexport const RADIO_DOT_POP_MS = 100;\n/** `cubic-bezier(0.45, 0, 0.2, 1)`. */\nexport const RADIO_DOT_EASING = [0.45, 0, 0.2, 1] as const;\n\n//////////////////////////////////////////////// WEB-ONLY STYLES\n\n/** Figma Focus rings/focus-ring — 2px surface gap + 4px brand ring (matches Button). */\nexport const radioWebFocusRingShadow =\n \"outline-none [box-shadow:0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)]\";\n\nexport const radioWebHoverUnchecked = \"group-hover:bg-primary_hover\";\n","import { createContext, useContext, useEffect, useState, type FC, type ReactNode } from \"react\";\nimport { Pressable, Text, View } from \"react-native-css/components\";\nimport Animated, { Easing, useAnimatedStyle, useSharedValue, withDelay, withTiming } from \"react-native-reanimated\";\nimport { styled } from \"nativewind\";\nimport {\n RADIO_DOT_DELAY_MS,\n RADIO_DOT_EASING,\n RADIO_DOT_POP_MS,\n radioStyles,\n type RadioSize,\n} from \"@avenue-ticketing/core/radio\";\nimport { cx } from \"@avenue-ticketing/core/cx\";\n\nexport type { RadioSize };\n\n//////////////////////////////////////////////// SETUP\n\nconst AnimatedView = styled(Animated.View);\n\nconst dotEasing = Easing.bezier(RADIO_DOT_EASING[0], RADIO_DOT_EASING[1], RADIO_DOT_EASING[2], RADIO_DOT_EASING[3]);\n\n//////////////////////////////////////////////// TYPES\n\nexport interface RadioButtonBaseProps {\n size?: RadioSize;\n className?: string;\n isSelected?: boolean;\n isDisabled?: boolean;\n}\n\nexport interface RadioButtonProps {\n value: string;\n size?: RadioSize;\n label?: ReactNode;\n hint?: ReactNode;\n isDisabled?: boolean;\n className?: string;\n}\n\nexport interface RadioGroupProps {\n children: ReactNode;\n size?: RadioSize;\n value?: string;\n defaultValue?: string;\n isDisabled?: boolean;\n className?: string;\n accessibilityLabel?: string;\n onChange?: (value: string) => void;\n}\n\ntype RadioGroupContextValue = {\n size: RadioSize;\n value?: string;\n isDisabled: boolean;\n setValue: (value: string) => void;\n};\n\n//////////////////////////////////////////////// CONTEXT\n\nconst RadioGroupContext = createContext<RadioGroupContextValue | null>(null);\n\n//////////////////////////////////////////////// HELPERS\n\nconst RADIO_TEXT_LINE_HEIGHT_PX: Record<RadioSize, number> = {\n sm: 20,\n md: 24,\n};\n\nconst radioTextStyle = (size: RadioSize) => ({\n includeFontPadding: false as const,\n lineHeight: RADIO_TEXT_LINE_HEIGHT_PX[size],\n});\n\n/** Pop-in dot — same delay / duration / easing as web. Remounts on each select. */\nconst RadioAnimatedDot: FC<{ className?: string }> = ({ className }) => {\n const progress = useSharedValue(0);\n\n useEffect(() => {\n progress.value = 0;\n progress.value = withDelay(\n RADIO_DOT_DELAY_MS,\n withTiming(1, { duration: RADIO_DOT_POP_MS, easing: dotEasing }),\n );\n }, [progress]);\n\n const animatedStyle = useAnimatedStyle(() => ({\n opacity: progress.value,\n transform: [{ scale: progress.value }],\n }));\n\n return <AnimatedView style={animatedStyle} className={cx(radioStyles.base.dot, className)} />;\n};\n\n//////////////////////////////////////////////// MAIN\n\nexport const RadioButtonBase: FC<RadioButtonBaseProps> = ({\n className,\n isSelected,\n isDisabled,\n size = \"sm\",\n}) => {\n const sizeStyles = radioStyles.sizes[size];\n\n return (\n <View\n className={cx(\n \"overflow-hidden\",\n radioStyles.base.root,\n sizeStyles.root,\n isSelected ? radioStyles.base.rootSelected : undefined,\n isDisabled && radioStyles.base.rootDisabled,\n isDisabled && !isSelected && radioStyles.base.rootDisabledUnchecked,\n className,\n )}\n >\n {isSelected && <RadioAnimatedDot className={sizeStyles.dot} />}\n </View>\n );\n};\nRadioButtonBase.displayName = \"RadioButtonBase\";\n\nexport const RadioButton: FC<RadioButtonProps> = ({\n value,\n label,\n hint,\n size = \"sm\",\n isDisabled: isDisabledProp = false,\n className,\n}) => {\n const group = useContext(RadioGroupContext);\n const resolvedSize = group?.size ?? size;\n const sizeStyles = radioStyles.sizes[resolvedSize];\n const isSelected = group?.value === value;\n const isDisabled = Boolean(group?.isDisabled || isDisabledProp);\n\n const select = () => {\n if (isDisabled || isSelected) return;\n group?.setValue(value);\n };\n\n return (\n <Pressable\n accessibilityRole=\"radio\"\n accessibilityState={{ selected: isSelected, disabled: isDisabled }}\n disabled={isDisabled}\n onPress={select}\n className={cx(radioStyles.stack, sizeStyles.stack, className)}\n >\n <RadioButtonBase\n size={resolvedSize}\n isSelected={isSelected}\n isDisabled={isDisabled}\n className={label || hint ? sizeStyles.baseOffset : \"\"}\n />\n {(label || hint) && (\n <View className={cx(\"flex-col\", sizeStyles.textWrapper)}>\n {label &&\n (typeof label === \"string\" || typeof label === \"number\" ? (\n <Text style={radioTextStyle(resolvedSize)} className={cx(radioStyles.label, sizeStyles.label)}>\n {label}\n </Text>\n ) : (\n label\n ))}\n {hint &&\n (typeof hint === \"string\" || typeof hint === \"number\" ? (\n <Pressable accessibilityRole=\"text\" onPress={() => {}}>\n <Text style={radioTextStyle(resolvedSize)} className={cx(radioStyles.hint, sizeStyles.hint)}>\n {hint}\n </Text>\n </Pressable>\n ) : (\n hint\n ))}\n </View>\n )}\n </Pressable>\n );\n};\nRadioButton.displayName = \"RadioButton\";\n\nexport const RadioGroup: FC<RadioGroupProps> = ({\n children,\n size = \"sm\",\n value: valueProp,\n defaultValue,\n isDisabled = false,\n className,\n accessibilityLabel,\n onChange,\n}) => {\n const [uncontrolled, setUncontrolled] = useState(defaultValue);\n const isControlled = valueProp !== undefined;\n const value = isControlled ? valueProp : uncontrolled;\n\n const setValue = (next: string) => {\n if (!isControlled) setUncontrolled(next);\n onChange?.(next);\n };\n\n return (\n <RadioGroupContext.Provider value={{ size, value, isDisabled, setValue }}>\n <View accessibilityRole=\"radiogroup\" accessibilityLabel={accessibilityLabel} className={cx(radioStyles.group, className)}>\n {children}\n </View>\n </RadioGroupContext.Provider>\n );\n};\nRadioGroup.displayName = \"RadioGroup\";\n"]}
@@ -0,0 +1,67 @@
1
+ import { FC, ReactNode } from 'react';
2
+
3
+ declare const SHEET_SIDES: readonly ["top", "right", "bottom", "left"];
4
+ type SheetSide = (typeof SHEET_SIDES)[number];
5
+ declare const SHEET_SIZES: readonly ["sm", "md", "lg", "xl", "full"];
6
+ type SheetSize = (typeof SHEET_SIZES)[number];
7
+
8
+ declare const SheetBoundary: FC<{
9
+ className?: string;
10
+ children?: ReactNode;
11
+ }>;
12
+ declare const Sheet: FC<{
13
+ children?: ReactNode;
14
+ open?: boolean;
15
+ onOpenChange?: (open: boolean) => void;
16
+ showBackdrop?: boolean;
17
+ }>;
18
+ declare const SheetTrigger: FC<{
19
+ children?: ReactNode;
20
+ asChild?: boolean;
21
+ }>;
22
+ declare const SheetClose: FC<{
23
+ children?: ReactNode;
24
+ asChild?: boolean;
25
+ afterClose?: () => void;
26
+ }>;
27
+ declare const SheetCloseButton: FC<{
28
+ className?: string;
29
+ onPress?: () => void;
30
+ }>;
31
+ declare const SheetHeader: FC<{
32
+ className?: string;
33
+ fixed?: boolean;
34
+ children?: ReactNode;
35
+ }>;
36
+ declare const SheetFooter: FC<{
37
+ className?: string;
38
+ fixed?: boolean;
39
+ children?: ReactNode;
40
+ }>;
41
+ declare const SheetTitle: FC<{
42
+ className?: string;
43
+ children?: ReactNode;
44
+ }>;
45
+ declare const SheetDescription: FC<{
46
+ className?: string;
47
+ children?: ReactNode;
48
+ }>;
49
+ declare const SheetNestedClose: FC<{
50
+ className?: string;
51
+ children?: ReactNode;
52
+ afterClose?: () => void;
53
+ onPress?: () => void;
54
+ }>;
55
+ declare const SheetContent: FC<{
56
+ children?: ReactNode;
57
+ side?: SheetSide;
58
+ size?: SheetSize;
59
+ className?: string;
60
+ swipeEnabled?: boolean;
61
+ showClose?: boolean;
62
+ elevated?: boolean;
63
+ duration?: number;
64
+ role?: string;
65
+ }>;
66
+
67
+ export { Sheet, SheetBoundary, SheetClose, SheetCloseButton, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetNestedClose, type SheetSide, type SheetSize, SheetTitle, SheetTrigger };
package/dist/sheet.js ADDED
@@ -0,0 +1,277 @@
1
+ import { createContext, useState, useRef, useCallback, useMemo, useContext, isValidElement, cloneElement, useEffect } from 'react';
2
+ import { useWindowDimensions, PanResponder, Modal } from 'react-native';
3
+ import { View, Pressable, Text } from 'react-native-css/components';
4
+ import { useNativeVariable } from 'react-native-css';
5
+ import { useSafeAreaInsets } from 'react-native-safe-area-context';
6
+ import Animated, { Easing, useSharedValue, withTiming, runOnJS, useAnimatedStyle } from 'react-native-reanimated';
7
+ import { ArrowLeftIcon } from 'phosphor-react-native/src/icons/ArrowLeft';
8
+ import { XIcon } from 'phosphor-react-native/src/icons/X';
9
+ import { extendTailwindMerge } from 'tailwind-merge';
10
+ import { jsx, jsxs } from 'react/jsx-runtime';
11
+
12
+ // ../../native/components/base/sheet/sheet.tsx
13
+ var twMerge = extendTailwindMerge({
14
+ extend: {
15
+ theme: {
16
+ text: ["display-xs", "display-sm", "display-md", "display-lg", "display-xl", "display-2xl"]
17
+ }
18
+ }
19
+ });
20
+ var cx = twMerge;
21
+ function sortCx(classes) {
22
+ return classes;
23
+ }
24
+
25
+ // ../core/src/sheet.ts
26
+ var SHEET_VELOCITY_THRESHOLD = 1;
27
+ var SHEET_PANEL_OPEN_MS = 280;
28
+ var SHEET_PANEL_CLOSE_MS_MOBILE = 220;
29
+ var SHEET_HANDOFF_AFTER_CLOSE_DELAY_MS = 80;
30
+ var SHEET_PANEL_OPEN_EASING_BEZIER = [0, 0.55, 0.45, 1];
31
+ var SHEET_PANEL_CLOSE_EASING_BEZIER = [0.55, 0, 1, 0.45];
32
+ var sheetStyles = sortCx({
33
+ boundary: "relative min-h-0 min-w-0",
34
+ close: "size-12 items-center justify-center rounded-full bg-primary active:scale-[0.96] active:bg-primary_hover",
35
+ panel: "bg-primary p-6",
36
+ header: "flex-col",
37
+ headerFixed: "border-b border-secondary bg-primary p-4",
38
+ footer: "flex-row",
39
+ footerFixed: "border-t border-secondary bg-primary p-4",
40
+ title: "text-lg font-semibold text-primary",
41
+ description: "text-sm text-tertiary",
42
+ nestedClose: "size-12 shrink-0 items-center justify-center rounded-full bg-primary active:scale-[0.96] active:bg-primary_hover"
43
+ });
44
+ var SheetContext = createContext(void 0);
45
+ function useSheetContext() {
46
+ const ctx = useContext(SheetContext);
47
+ if (!ctx) throw new Error("Sheet components must be used within a <Sheet />");
48
+ return ctx;
49
+ }
50
+ var OPEN_EASING = Easing.bezier(...SHEET_PANEL_OPEN_EASING_BEZIER);
51
+ var CLOSE_EASING = Easing.bezier(...SHEET_PANEL_CLOSE_EASING_BEZIER);
52
+ var SheetBoundary = ({ className, children }) => {
53
+ return /* @__PURE__ */ jsx(View, { className: cx(sheetStyles.boundary, className), children });
54
+ };
55
+ var Sheet = ({ children, open: controlledOpen, onOpenChange, showBackdrop = false }) => {
56
+ const [internalOpen, setInternalOpen] = useState(false);
57
+ const isControlled = controlledOpen !== void 0;
58
+ const open = isControlled ? controlledOpen : internalOpen;
59
+ const afterCloseRef = useRef(null);
60
+ const setOpen = useCallback(
61
+ (value2, options) => {
62
+ if (!value2 && options?.afterClose) afterCloseRef.current = options.afterClose;
63
+ if (value2) afterCloseRef.current = null;
64
+ if (!isControlled) setInternalOpen(value2);
65
+ onOpenChange?.(value2);
66
+ if (!value2 && options?.afterClose) {
67
+ const cb = options.afterClose;
68
+ setTimeout(() => {
69
+ cb();
70
+ afterCloseRef.current = null;
71
+ }, SHEET_HANDOFF_AFTER_CLOSE_DELAY_MS);
72
+ }
73
+ },
74
+ [isControlled, onOpenChange]
75
+ );
76
+ const value = useMemo(() => ({ open, setOpen, showBackdrop }), [open, setOpen, showBackdrop]);
77
+ return /* @__PURE__ */ jsx(SheetContext.Provider, { value, children });
78
+ };
79
+ function mergePress(children, asChild, action) {
80
+ if (asChild && isValidElement(children)) {
81
+ const child = children;
82
+ return cloneElement(child, {
83
+ onPress: (event) => {
84
+ child.props.onPress?.(event);
85
+ action();
86
+ }
87
+ });
88
+ }
89
+ return /* @__PURE__ */ jsx(Pressable, { accessibilityRole: "button", onPress: action, children });
90
+ }
91
+ var SheetTrigger = ({ children, asChild }) => {
92
+ const { setOpen } = useSheetContext();
93
+ const openSheet = useCallback(() => setOpen(true), [setOpen]);
94
+ return mergePress(children, asChild, openSheet);
95
+ };
96
+ var SheetClose = ({
97
+ children,
98
+ asChild,
99
+ afterClose
100
+ }) => {
101
+ const { setOpen } = useSheetContext();
102
+ const closeSheet = useCallback(
103
+ () => setOpen(false, afterClose ? { afterClose } : void 0),
104
+ [setOpen, afterClose]
105
+ );
106
+ return mergePress(children, asChild, closeSheet);
107
+ };
108
+ var SheetCloseButton = ({ className, onPress }) => {
109
+ const { setOpen } = useSheetContext();
110
+ const fgPrimary = useNativeVariable("--color-fg-primary") ?? "#181d27";
111
+ return /* @__PURE__ */ jsx(
112
+ Pressable,
113
+ {
114
+ accessibilityRole: "button",
115
+ accessibilityLabel: "Close",
116
+ onPress: onPress ?? (() => setOpen(false)),
117
+ className: cx(sheetStyles.close, className),
118
+ children: /* @__PURE__ */ jsx(XIcon, { size: 22, weight: "regular", color: fgPrimary })
119
+ }
120
+ );
121
+ };
122
+ var SheetHeader = ({
123
+ className,
124
+ fixed,
125
+ children
126
+ }) => {
127
+ return /* @__PURE__ */ jsx(View, { className: cx(sheetStyles.header, fixed && sheetStyles.headerFixed, className), children });
128
+ };
129
+ var SheetFooter = ({
130
+ className,
131
+ fixed,
132
+ children
133
+ }) => {
134
+ return /* @__PURE__ */ jsx(View, { className: cx(sheetStyles.footer, fixed && sheetStyles.footerFixed, className), children });
135
+ };
136
+ var SheetTitle = ({ className, children }) => {
137
+ return /* @__PURE__ */ jsx(Text, { className: cx(sheetStyles.title, className), children });
138
+ };
139
+ var SheetDescription = ({ className, children }) => {
140
+ return /* @__PURE__ */ jsx(Text, { className: cx(sheetStyles.description, className), children });
141
+ };
142
+ var SheetNestedClose = ({
143
+ className,
144
+ children,
145
+ afterClose,
146
+ onPress
147
+ }) => {
148
+ const fgPrimary = useNativeVariable("--color-fg-primary") ?? "#181d27";
149
+ return /* @__PURE__ */ jsx(SheetClose, { asChild: true, afterClose, children: /* @__PURE__ */ jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: "Back", onPress, className: cx(sheetStyles.nestedClose, className), children: children ?? /* @__PURE__ */ jsx(ArrowLeftIcon, { size: 22, weight: "regular", color: fgPrimary }) }) });
150
+ };
151
+ var SheetPanel = ({ side, size, className, duration, swipeEnabled, showClose, elevated, children }) => {
152
+ const { open, setOpen, showBackdrop } = useSheetContext();
153
+ const { width: windowWidth, height: windowHeight } = useWindowDimensions();
154
+ const insets = useSafeAreaInsets();
155
+ const bgPrimary = useNativeVariable("--color-bg-primary") ?? "#ffffff";
156
+ const borderSecondary = useNativeVariable("--color-border-secondary") ?? "#e9eaeb";
157
+ const overlayColor = useNativeVariable("--color-bg-overlay") ?? "#0a0d12";
158
+ const [mounted, setMounted] = useState(open);
159
+ const horizontal = side === "left" || side === "right";
160
+ const full = size === "full";
161
+ const customWidth = /(?:^|\s)(?:w-|max-w-)/.test(className ?? "");
162
+ const customHeight = /(?:^|\s)(?:h-|max-h-)/.test(className ?? "");
163
+ const travel = horizontal ? windowWidth : windowHeight;
164
+ const offset = useSharedValue(open ? 0 : travel);
165
+ const swipeClosing = useRef(false);
166
+ const finishSwipeClose = useCallback(() => {
167
+ swipeClosing.current = false;
168
+ setMounted(false);
169
+ setOpen(false);
170
+ }, [setOpen]);
171
+ useEffect(() => {
172
+ if (open) {
173
+ swipeClosing.current = false;
174
+ setMounted(true);
175
+ offset.value = withTiming(0, { duration, easing: OPEN_EASING });
176
+ return;
177
+ }
178
+ if (swipeClosing.current) return;
179
+ offset.value = withTiming(travel, { duration: SHEET_PANEL_CLOSE_MS_MOBILE, easing: CLOSE_EASING }, (finished) => {
180
+ if (finished) runOnJS(setMounted)(false);
181
+ });
182
+ }, [open, duration, offset, travel]);
183
+ const edgePan = useMemo(
184
+ () => PanResponder.create({
185
+ onStartShouldSetPanResponder: () => swipeEnabled && horizontal,
186
+ onMoveShouldSetPanResponder: () => swipeEnabled && horizontal,
187
+ onPanResponderMove: (_evt, gesture) => {
188
+ const raw = side === "right" ? gesture.dx : -gesture.dx;
189
+ offset.value = Math.min(Math.max(raw, 0), travel);
190
+ },
191
+ onPanResponderRelease: (_evt, gesture) => {
192
+ const raw = side === "right" ? gesture.dx : -gesture.dx;
193
+ const velocity = side === "right" ? gesture.vx : -gesture.vx;
194
+ const shouldClose = raw > travel * 0.35 || raw > 40 && velocity > SHEET_VELOCITY_THRESHOLD;
195
+ if (shouldClose) {
196
+ swipeClosing.current = true;
197
+ offset.value = withTiming(travel, { duration: SHEET_PANEL_CLOSE_MS_MOBILE, easing: CLOSE_EASING }, (finished) => {
198
+ if (finished) runOnJS(finishSwipeClose)();
199
+ });
200
+ return;
201
+ }
202
+ offset.value = withTiming(0, { duration, easing: OPEN_EASING });
203
+ },
204
+ onPanResponderTerminate: () => {
205
+ offset.value = withTiming(0, { duration, easing: OPEN_EASING });
206
+ }
207
+ }),
208
+ [swipeEnabled, horizontal, side, offset, travel, duration, finishSwipeClose]
209
+ );
210
+ const panelStyle = useAnimatedStyle(() => {
211
+ const translateX = side === "right" ? offset.value : side === "left" ? -offset.value : 0;
212
+ const translateY = side === "bottom" ? offset.value : side === "top" ? -offset.value : 0;
213
+ return { transform: [{ translateX }, { translateY }] };
214
+ });
215
+ const backdropStyle = useAnimatedStyle(() => ({
216
+ opacity: travel > 0 ? 0.4 * (1 - offset.value / travel) : 0
217
+ }));
218
+ if (!mounted) return null;
219
+ const edge = side === "right" ? { right: 0, top: 0, bottom: 0, borderLeftWidth: customWidth ? 1 : 0 } : side === "left" ? { left: 0, top: 0, bottom: 0, borderRightWidth: customWidth ? 1 : 0 } : side === "bottom" ? { left: 0, right: 0, bottom: 0, borderTopWidth: customHeight ? 1 : 0 } : { left: 0, right: 0, top: 0, borderBottomWidth: customHeight ? 1 : 0 };
220
+ return /* @__PURE__ */ jsx(Modal, { visible: true, transparent: true, animationType: "none", presentationStyle: "overFullScreen", statusBarTranslucent: true, onRequestClose: () => setOpen(false), children: /* @__PURE__ */ jsxs(View, { className: "h-full w-full flex-1", children: [
221
+ showBackdrop && !full && /* @__PURE__ */ jsx(Animated.View, { style: [{ position: "absolute", top: 0, right: 0, bottom: 0, left: 0, backgroundColor: overlayColor }, backdropStyle], children: /* @__PURE__ */ jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: "Dismiss", onPress: () => setOpen(false), className: "flex-1" }) }),
222
+ /* @__PURE__ */ jsx(
223
+ Animated.View,
224
+ {
225
+ style: [
226
+ panelStyle,
227
+ {
228
+ position: "absolute",
229
+ width: customWidth ? void 0 : windowWidth,
230
+ height: customHeight ? void 0 : windowHeight,
231
+ backgroundColor: bgPrimary,
232
+ borderColor: borderSecondary,
233
+ zIndex: 10,
234
+ ...elevated ? {
235
+ shadowColor: "#000000",
236
+ shadowOffset: {
237
+ width: side === "right" ? -12 : side === "left" ? 12 : 0,
238
+ height: side === "bottom" ? -12 : side === "top" ? 12 : 0
239
+ },
240
+ shadowOpacity: 0.16,
241
+ shadowRadius: 24,
242
+ elevation: 16
243
+ } : { elevation: 0 },
244
+ paddingTop: insets.top,
245
+ paddingBottom: insets.bottom,
246
+ ...edge
247
+ }
248
+ ],
249
+ children: /* @__PURE__ */ jsxs(View, { className: cx(sheetStyles.panel, "flex-1", className), children: [
250
+ children,
251
+ showClose && /* @__PURE__ */ jsx(View, { className: "absolute top-4 right-4 z-20", children: /* @__PURE__ */ jsx(SheetCloseButton, {}) })
252
+ ] })
253
+ }
254
+ ),
255
+ swipeEnabled && horizontal && /* @__PURE__ */ jsx(
256
+ View,
257
+ {
258
+ ...edgePan.panHandlers,
259
+ style: {
260
+ position: "absolute",
261
+ top: 0,
262
+ bottom: 0,
263
+ width: 28,
264
+ zIndex: 40,
265
+ ...side === "right" ? { left: 0 } : { right: 0 }
266
+ }
267
+ }
268
+ )
269
+ ] }) });
270
+ };
271
+ var SheetContent = ({ children, side = "right", size = "md", className, swipeEnabled = true, showClose = true, elevated = true, duration = SHEET_PANEL_OPEN_MS }) => {
272
+ return /* @__PURE__ */ jsx(SheetPanel, { side, size, className, duration, swipeEnabled, showClose, elevated, children });
273
+ };
274
+
275
+ export { Sheet, SheetBoundary, SheetClose, SheetCloseButton, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetNestedClose, SheetTitle, SheetTrigger };
276
+ //# sourceMappingURL=sheet.js.map
277
+ //# sourceMappingURL=sheet.js.map