@avenue-ticketing/native 0.1.4 → 0.1.5

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.
@@ -0,0 +1,231 @@
1
+ import { createContext, useState, useEffect } from 'react';
2
+ import { useWindowDimensions, Modal } from 'react-native';
3
+ import { View, ScrollView, 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, FadeIn, FadeOut, FadeInDown, FadeOutDown } from 'react-native-reanimated';
7
+ import { XIcon } from 'phosphor-react-native/src/icons/X';
8
+ import { extendTailwindMerge } from 'tailwind-merge';
9
+ import { jsx, jsxs } from 'react/jsx-runtime';
10
+
11
+ // ../../native/components/base/select/popover.tsx
12
+ var twMerge = extendTailwindMerge({
13
+ extend: {
14
+ theme: {
15
+ text: ["display-xs", "display-sm", "display-md", "display-lg", "display-xl", "display-2xl"]
16
+ }
17
+ }
18
+ });
19
+ var cx = twMerge;
20
+ function sortCx(classes) {
21
+ return classes;
22
+ }
23
+
24
+ // ../core/src/dialog.ts
25
+ var DIALOG_SHEET_MOTION_MS = 175;
26
+ var DIALOG_SLIDE_OFFSET_PX = 120;
27
+ var DIALOG_ENTRY_EASING_BEZIER = [0.85, 0, 0.15, 1];
28
+ var DIALOG_EXIT_EASING_BEZIER = [0.85, 0, 1, 0.15];
29
+ var DIALOG_SHEET_RADIUS_PX = 16;
30
+ var dialogStyles = sortCx({
31
+ root: "flex",
32
+ rootFull: "h-full w-full flex-col bg-primary",
33
+ rootSheet: "flex-col justify-end",
34
+ rootModal: "flex-col items-center justify-center p-4",
35
+ overlay: "absolute inset-0 bg-overlay/70",
36
+ panel: "relative z-10 w-full overflow-hidden bg-primary",
37
+ panelElevated: "shadow-xl",
38
+ panelFull: "flex min-h-0 flex-1 flex-col",
39
+ /**
40
+ * Web sheet chrome (≤1024). Native pins the same chrome with RN layout styles
41
+ * (`DIALOG_SHEET_RADIUS_PX` + token colors) because NativeWind border/radius
42
+ * on sheets leave side gaps and bottom transparency.
43
+ */
44
+ panelSheet: "w-full max-h-[90%] rounded-t-2xl rounded-b-none border border-solid border-secondary border-x-0 border-b-0 border-t",
45
+ panelModal: "w-full rounded-2xl border border-solid border-secondary",
46
+ sizes: {
47
+ sm: "max-w-sm",
48
+ md: "max-w-md",
49
+ lg: "max-w-lg",
50
+ xl: "max-w-xl"
51
+ },
52
+ sizesLgOnly: {
53
+ sm: "lg:max-w-sm",
54
+ md: "lg:max-w-md",
55
+ lg: "lg:max-w-lg",
56
+ xl: "lg:max-w-xl"
57
+ },
58
+ sizesSmUp: {
59
+ sm: "sm:max-w-sm",
60
+ md: "sm:max-w-md",
61
+ lg: "sm:max-w-lg",
62
+ xl: "sm:max-w-xl"
63
+ },
64
+ header: "flex-col gap-1.5 p-6 pr-14",
65
+ headerFixed: "border-b border-solid border-secondary bg-primary",
66
+ footer: "flex-col-reverse gap-2 p-6",
67
+ footerFixed: "border-t border-solid border-secondary bg-primary",
68
+ title: "text-xl font-semibold text-primary",
69
+ description: "text-sm text-tertiary",
70
+ close: "size-12 items-center justify-center rounded-full bg-primary active:scale-[0.96] active:bg-primary_hover",
71
+ closePosition: "absolute top-4 right-4 z-20"
72
+ });
73
+
74
+ // ../core/src/select.ts
75
+ var menuMaxHeight = {
76
+ sm: "max-h-56",
77
+ md: "max-h-64",
78
+ lg: "max-h-80"
79
+ };
80
+ function resolveSelectMobileOptions(mobileOptions) {
81
+ const fullScreen = mobileOptions?.fullScreen ?? false;
82
+ return {
83
+ sheet: mobileOptions?.sheet ?? true,
84
+ fullScreen,
85
+ overlay: fullScreen ? false : mobileOptions?.overlay ?? true,
86
+ title: mobileOptions?.title,
87
+ sheetClassName: mobileOptions?.className,
88
+ contentClassName: mobileOptions?.contentClassName
89
+ };
90
+ }
91
+ createContext(null);
92
+ createContext({ size: "md" });
93
+ var ENTRY = Easing.bezier(...DIALOG_ENTRY_EASING_BEZIER);
94
+ var EXIT = Easing.bezier(...DIALOG_EXIT_EASING_BEZIER);
95
+ var overlayEntering = FadeIn.duration(DIALOG_SHEET_MOTION_MS).easing(ENTRY);
96
+ var overlayExiting = FadeOut.duration(DIALOG_SHEET_MOTION_MS).easing(EXIT);
97
+ var panelEntering = FadeInDown.duration(DIALOG_SHEET_MOTION_MS).easing(ENTRY).withInitialValues({ opacity: 0, transform: [{ translateY: DIALOG_SLIDE_OFFSET_PX }] });
98
+ var panelExiting = FadeOutDown.duration(DIALOG_SHEET_MOTION_MS).easing(EXIT).withTargetValues({ opacity: 0, transform: [{ translateY: DIALOG_SLIDE_OFFSET_PX }] });
99
+ function useSheetPresence(open) {
100
+ const [shouldRender, setShouldRender] = useState(open);
101
+ useEffect(() => {
102
+ if (open) {
103
+ setShouldRender(true);
104
+ return;
105
+ }
106
+ const hide = setTimeout(() => setShouldRender(false), DIALOG_SHEET_MOTION_MS);
107
+ return () => clearTimeout(hide);
108
+ }, [open]);
109
+ return shouldRender;
110
+ }
111
+ function overlayFill(color) {
112
+ const hex = /^#([\da-f]{6})$/i.exec(color);
113
+ if (!hex) return "rgba(10, 13, 18, 0.7)";
114
+ const value = parseInt(hex[1], 16);
115
+ return `rgba(${value >> 16 & 255}, ${value >> 8 & 255}, ${value & 255}, 0.7)`;
116
+ }
117
+ var HEADER_HEIGHT = 56;
118
+ var Popover = ({
119
+ open,
120
+ onClose,
121
+ size = "md",
122
+ mobileOptions,
123
+ compound = false,
124
+ className,
125
+ children
126
+ }) => {
127
+ const resolved = resolveSelectMobileOptions(mobileOptions);
128
+ if (!resolved.sheet) {
129
+ if (!open) return null;
130
+ return /* @__PURE__ */ jsx(
131
+ View,
132
+ {
133
+ className: cx(
134
+ "bg-primary overflow-hidden rounded-lg shadow-lg ring-1 ring-secondary_alt",
135
+ !compound && "py-1",
136
+ !compound && menuMaxHeight[size],
137
+ className
138
+ ),
139
+ children: compound ? children : /* @__PURE__ */ jsx(ScrollView, { keyboardShouldPersistTaps: "handled", nestedScrollEnabled: true, children })
140
+ }
141
+ );
142
+ }
143
+ return /* @__PURE__ */ jsx(
144
+ SelectSheet,
145
+ {
146
+ open,
147
+ onClose,
148
+ title: resolved.title,
149
+ fullScreen: resolved.fullScreen,
150
+ overlay: resolved.overlay,
151
+ className: cx(resolved.sheetClassName, resolved.contentClassName, className),
152
+ children
153
+ }
154
+ );
155
+ };
156
+ var SelectSheet = ({ open, onClose, title, fullScreen, overlay, className, children }) => {
157
+ const insets = useSafeAreaInsets();
158
+ const { width: windowWidth, height: windowHeight } = useWindowDimensions();
159
+ const shouldRender = useSheetPresence(open);
160
+ const fgPrimary = useNativeVariable("--color-fg-primary") ?? "#181d27";
161
+ const bgPrimary = useNativeVariable("--color-bg-primary") ?? "#ffffff";
162
+ const borderSecondary = useNativeVariable("--color-border-secondary") ?? "#e9eaeb";
163
+ const overlayColor = useNativeVariable("--color-bg-overlay") ?? "#0a0d12";
164
+ const sheetMax = fullScreen ? windowHeight : Math.round(windowHeight * 0.9);
165
+ const listMax = Math.max(0, sheetMax - HEADER_HEIGHT - (fullScreen ? insets.top : insets.bottom));
166
+ return /* @__PURE__ */ jsx(Modal, { visible: shouldRender, transparent: true, animationType: "none", presentationStyle: "overFullScreen", statusBarTranslucent: true, onRequestClose: onClose, children: /* @__PURE__ */ jsxs(View, { className: cx(dialogStyles.root, "h-full w-full flex-1", fullScreen ? dialogStyles.rootFull : dialogStyles.rootSheet), children: [
167
+ open && overlay ? /* @__PURE__ */ jsx(View, { className: dialogStyles.overlay, children: /* @__PURE__ */ jsx(Animated.View, { entering: overlayEntering, exiting: overlayExiting, style: { flex: 1, backgroundColor: overlayFill(overlayColor) }, children: /* @__PURE__ */ jsx(Pressable, { accessibilityRole: "button", accessibilityLabel: "Dismiss", onPress: onClose, className: "flex-1" }) }) }) : null,
168
+ open ? /* @__PURE__ */ jsxs(
169
+ Animated.View,
170
+ {
171
+ collapsable: false,
172
+ entering: panelEntering,
173
+ exiting: panelExiting,
174
+ style: fullScreen ? {
175
+ flex: 1,
176
+ width: windowWidth,
177
+ backgroundColor: bgPrimary,
178
+ paddingBottom: 12
179
+ } : {
180
+ position: "absolute",
181
+ left: 0,
182
+ right: 0,
183
+ bottom: 0,
184
+ width: windowWidth,
185
+ maxHeight: sheetMax,
186
+ zIndex: 10,
187
+ overflow: "hidden",
188
+ backgroundColor: bgPrimary,
189
+ borderTopLeftRadius: DIALOG_SHEET_RADIUS_PX,
190
+ borderTopRightRadius: DIALOG_SHEET_RADIUS_PX,
191
+ borderBottomLeftRadius: 0,
192
+ borderBottomRightRadius: 0,
193
+ borderTopWidth: 1,
194
+ borderLeftWidth: 0,
195
+ borderRightWidth: 0,
196
+ borderBottomWidth: 0,
197
+ borderTopColor: borderSecondary,
198
+ paddingBottom: insets.bottom
199
+ },
200
+ children: [
201
+ fullScreen ? /* @__PURE__ */ jsx(View, { style: { height: insets.top } }) : null,
202
+ /* @__PURE__ */ jsxs(View, { className: cx("w-full flex-row items-center pr-2 pl-4", title ? "justify-between" : "justify-end"), style: { height: HEADER_HEIGHT }, children: [
203
+ title ? /* @__PURE__ */ jsx(Text, { numberOfLines: 1, className: "text-primary min-w-0 flex-1 text-base font-semibold", children: title }) : null,
204
+ /* @__PURE__ */ jsx(
205
+ Pressable,
206
+ {
207
+ accessibilityRole: "button",
208
+ accessibilityLabel: "Close",
209
+ onPress: onClose,
210
+ className: "size-12 items-center justify-center rounded-full active:bg-primary_hover",
211
+ children: /* @__PURE__ */ jsx(XIcon, { size: 20, color: fgPrimary })
212
+ }
213
+ )
214
+ ] }),
215
+ /* @__PURE__ */ jsx(
216
+ ScrollView,
217
+ {
218
+ keyboardShouldPersistTaps: "handled",
219
+ style: fullScreen ? { flex: 1 } : { flexGrow: 0, flexShrink: 0, maxHeight: listMax },
220
+ children: /* @__PURE__ */ jsx(View, { className: cx("py-1", className), children })
221
+ }
222
+ )
223
+ ]
224
+ }
225
+ ) : null
226
+ ] }) });
227
+ };
228
+
229
+ export { Popover };
230
+ //# sourceMappingURL=popover.js.map
231
+ //# sourceMappingURL=popover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../core/src/cx.ts","../../core/src/dialog.ts","../../core/src/select.ts","../../../native/components/base/select/select-shared.tsx","../../../native/components/base/select/popover.tsx"],"names":["jsx"],"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;;;ACSO,IAAM,sBAAA,GAAyB,GAAA;AAE/B,IAAM,sBAAA,GAAyB,GAAA;AAkB/B,IAAM,0BAAA,GAA6B,CAAC,IAAA,EAAM,CAAA,EAAG,MAAM,CAAC,CAAA;AAEpD,IAAM,yBAAA,GAA4B,CAAC,IAAA,EAAM,CAAA,EAAG,GAAG,IAAI,CAAA;AAWnD,IAAM,sBAAA,GAAyB,EAAA;AAiG/B,IAAM,eAAe,MAAA,CAAO;AAAA,EAC/B,IAAA,EAAM,MAAA;AAAA,EACN,QAAA,EAAU,mCAAA;AAAA,EACV,SAAA,EAAW,sBAAA;AAAA,EACX,SAAA,EAAW,0CAAA;AAAA,EAEX,OAAA,EAAS,gCAAA;AAAA,EAET,KAAA,EAAO,iDAAA;AAAA,EACP,aAAA,EAAe,WAAA;AAAA,EACf,SAAA,EAAW,8BAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMX,UAAA,EACI,qHAAA;AAAA,EACJ,UAAA,EAAY,yDAAA;AAAA,EAEZ,KAAA,EAAO;AAAA,IACH,EAAA,EAAI,UAAA;AAAA,IACJ,EAAA,EAAI,UAAA;AAAA,IACJ,EAAA,EAAI,UAAA;AAAA,I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ACJ,GACA;AAAA,GAAA,EACR,CAAA,EACJ,CAAA;AAER,CAAA","file":"popover.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 DIALOG_SIZES = [\"sm\", \"md\", \"lg\", \"xl\", \"full\"] as const;\nexport type DialogSize = (typeof DIALOG_SIZES)[number];\n\nexport interface DialogMobileOptions {\n /** When `false`, keep the centered modal. Default `true` (bottom sheet on narrow / native). */\n sheet?: boolean;\n /** When `true`, the sheet uses the full viewport height. Default `false`. */\n fullScreen?: boolean;\n /** Dimmed backdrop on partial sheets. Default `true`. Ignored when `fullScreen` or `size` is `full`. */\n overlay?: boolean;\n /** Extra classes on the panel. */\n className?: string;\n}\n\n//////////////////////////////////////////////// MOTION / LAYOUT CONSTANTS\n// Shared by web CSS transitions and native Reanimated. Changing these changes\n// both shells — keep values identical to the previous web-local constants.\n\n/** Web desktop scale-fade / `slideEntrance` duration (ms). */\nexport const DIALOG_MOTION_MS = 200;\n/** Sheet / mobile enter-exit duration (ms). Same as select mobile sheet. */\nexport const DIALOG_SHEET_MOTION_MS = 175;\n/** Full-size / sheet enter travel (px). */\nexport const DIALOG_SLIDE_OFFSET_PX = 120;\n/** Shorter slide for sm–xl desktop `slideEntrance`. */\nexport const DIALOG_SLIDE_OFFSET_COMPACT_PX = 16;\n\nexport const DIALOG_SLIDE_OFFSET_BY_SIZE: Record<DialogSize, number> = {\n sm: DIALOG_SLIDE_OFFSET_COMPACT_PX,\n md: DIALOG_SLIDE_OFFSET_COMPACT_PX,\n lg: DIALOG_SLIDE_OFFSET_COMPACT_PX,\n xl: DIALOG_SLIDE_OFFSET_COMPACT_PX,\n full: DIALOG_SLIDE_OFFSET_PX,\n};\n\n/** CSS `transition-timing-function` — entry (open). */\nexport const DIALOG_ENTRY_MOTION_EASING = \"cubic-bezier(0.85, 0, 0.15, 1)\";\n/** CSS `transition-timing-function` — exit (close). */\nexport const DIALOG_EXIT_MOTION_EASING = \"cubic-bezier(0.85, 0, 1, 0.15)\";\n\n/** Bezier control points for `Easing.bezier(...DIALOG_ENTRY_EASING_BEZIER)`. */\nexport const DIALOG_ENTRY_EASING_BEZIER = [0.85, 0, 0.15, 1] as const;\n/** Bezier control points for `Easing.bezier(...DIALOG_EXIT_EASING_BEZIER)`. */\nexport const DIALOG_EXIT_EASING_BEZIER = [0.85, 0, 1, 0.15] as const;\n\n/** Matches `SHEET_MOBILE_MAX_WIDTH_PX` / select mobile sheet breakpoint. */\nexport const DIALOG_MOBILE_BOTTOM_SHEET_MAX_PX = 1024;\n\n/** Portal stacking: outermost dialog uses this z-index. */\nexport const DIALOG_Z_BASE = 50;\n/** Added per nested dialog depth beyond the first. */\nexport const DIALOG_Z_STEP = 10;\n\n/** Top corner radius for sheet chrome (`rounded-t-2xl` = 16). */\nexport const DIALOG_SHEET_RADIUS_PX = 16;\n\n//////////////////////////////////////////////// HELPERS\n\n/** Resolve `mobileOptions` — shared by web + native shells. */\nexport function resolveDialogMobileOptions(mobileOptions?: DialogMobileOptions) {\n const fullScreen = mobileOptions?.fullScreen ?? false;\n return {\n sheet: mobileOptions?.sheet ?? true,\n fullScreen,\n overlay: fullScreen ? false : (mobileOptions?.overlay ?? true),\n panelClassName: mobileOptions?.className,\n };\n}\n\n/** Nested portal z-index from dialog depth (1 = outermost). */\nexport function dialogPortalZIndex(depth: number): number {\n return DIALOG_Z_BASE + (depth - 1) * DIALOG_Z_STEP;\n}\n\n/** Entry vs exit CSS easing string. */\nexport function dialogMotionEasingCss(open: boolean): string {\n return open ? DIALOG_ENTRY_MOTION_EASING : DIALOG_EXIT_MOTION_EASING;\n}\n\n/**\n * Panel unmount / transition duration (ms).\n * Bottom-sheet motion and `slideEntrance` ignore the consumer `duration` prop.\n */\nexport function resolveDialogPanelCloseMs(options: {\n useBottomSheetMotion: boolean;\n slideEntrance: boolean;\n duration: number;\n}): number {\n if (options.useBottomSheetMotion) return DIALOG_SHEET_MOTION_MS;\n if (options.slideEntrance) return DIALOG_MOTION_MS;\n return options.duration;\n}\n\n/** Plain transition bag — assignable to web `CSSProperties` without importing React. */\nexport type DialogTransitionStyle = {\n transform?: string;\n opacity?: number;\n transitionProperty?: string;\n transitionDuration?: string;\n transitionTimingFunction?: string;\n willChange?: string;\n};\n\n/** Sheet panel slide + fade (web CSS). */\nexport function dialogSheetMotionStyle(\n isVisible: boolean,\n open: boolean,\n slideOffsetPx: number | \"full\" = DIALOG_SLIDE_OFFSET_PX,\n): DialogTransitionStyle {\n const hiddenTransform =\n slideOffsetPx === \"full\" ? \"translateY(100%)\" : `translateY(${slideOffsetPx}px)`;\n\n return {\n transform: isVisible ? \"translateY(0)\" : hiddenTransform,\n opacity: isVisible ? 1 : 0,\n transitionProperty: \"transform, opacity\",\n transitionDuration: `${DIALOG_SHEET_MOTION_MS}ms`,\n transitionTimingFunction: dialogMotionEasingCss(open),\n willChange: \"transform, opacity\",\n };\n}\n\n/** Sheet backdrop fade (web CSS). */\nexport function dialogSheetBackdropStyle(isVisible: boolean, open: boolean): DialogTransitionStyle {\n return {\n opacity: isVisible ? 1 : 0,\n transitionProperty: \"opacity\",\n transitionDuration: `${DIALOG_SHEET_MOTION_MS}ms`,\n transitionTimingFunction: dialogMotionEasingCss(open),\n };\n}\n\n/** Desktop `slideEntrance` panel transform + fade. */\nexport function dialogDesktopSlideStyle(\n isAnimating: boolean,\n open: boolean,\n slideOffsetPx: number,\n): DialogTransitionStyle {\n return {\n transform: isAnimating ? \"translateY(0)\" : `translateY(${slideOffsetPx}px)`,\n opacity: isAnimating ? 1 : 0,\n transitionProperty: \"transform, opacity\",\n transitionDuration: `${DIALOG_MOTION_MS}ms`,\n transitionTimingFunction: dialogMotionEasingCss(open),\n };\n}\n\n//////////////////////////////////////////////// SHARED STYLES\n// Visual contract for web + native. Native shells may pin sheet chrome with RN\n// layout styles where NativeWind width/border/radius are unreliable.\n\nexport const dialogStyles = sortCx({\n root: \"flex\",\n rootFull: \"h-full w-full flex-col bg-primary\",\n rootSheet: \"flex-col justify-end\",\n rootModal: \"flex-col items-center justify-center p-4\",\n\n overlay: \"absolute inset-0 bg-overlay/70\",\n\n panel: \"relative z-10 w-full overflow-hidden bg-primary\",\n panelElevated: \"shadow-xl\",\n panelFull: \"flex min-h-0 flex-1 flex-col\",\n /**\n * Web sheet chrome (≤1024). Native pins the same chrome with RN layout styles\n * (`DIALOG_SHEET_RADIUS_PX` + token colors) because NativeWind border/radius\n * on sheets leave side gaps and bottom transparency.\n */\n panelSheet:\n \"w-full max-h-[90%] rounded-t-2xl rounded-b-none border border-solid border-secondary border-x-0 border-b-0 border-t\",\n panelModal: \"w-full rounded-2xl border border-solid border-secondary\",\n\n sizes: {\n sm: \"max-w-sm\",\n md: \"max-w-md\",\n lg: \"max-w-lg\",\n xl: \"max-w-xl\",\n },\n sizesLgOnly: {\n sm: \"lg:max-w-sm\",\n md: \"lg:max-w-md\",\n lg: \"lg:max-w-lg\",\n xl: \"lg:max-w-xl\",\n },\n sizesSmUp: {\n sm: \"sm:max-w-sm\",\n md: \"sm:max-w-md\",\n lg: \"sm:max-w-lg\",\n xl: \"sm:max-w-xl\",\n },\n\n header: \"flex-col gap-1.5 p-6 pr-14\",\n headerFixed: \"border-b border-solid border-secondary bg-primary\",\n footer: \"flex-col-reverse gap-2 p-6\",\n footerFixed: \"border-t border-solid border-secondary bg-primary\",\n title: \"text-xl font-semibold text-primary\",\n description: \"text-sm text-tertiary\",\n close:\n \"size-12 items-center justify-center rounded-full bg-primary active:scale-[0.96] active:bg-primary_hover\",\n closePosition: \"absolute top-4 right-4 z-20\",\n});\n\n//////////////////////////////////////////////// WEB-ONLY STYLES\n// Extracted from the web dialog shell so class strings live in core. Native must\n// not apply these (`print:`, `sm:`/`lg:`, `hover:`, `cursor-pointer`, `dvh`, …).\n\nexport const dialogWebStyles = sortCx({\n root: \"fixed inset-0 print:static print:block print:h-auto print:overflow-visible print:p-0\",\n rootSheetResponsive:\n \"max-lg:flex-col max-lg:items-stretch max-lg:justify-end max-lg:p-0 lg:flex-col lg:items-center lg:justify-center lg:p-4\",\n overlay: \"fixed print:hidden\",\n overlayFade: \"transition-opacity ease-in-out\",\n panelPrint: \"print:static print:h-auto print:max-h-none print:max-w-none print:overflow-visible print:shadow-none\",\n panelFullViewport: \"min-h-dvh h-dvh max-h-dvh border-0\",\n panelScaleTransition: \"transition-all ease-in-out\",\n panelScaleOpen: \"scale-100 opacity-100\",\n panelScaleClosed: \"scale-95 opacity-0\",\n close:\n \"flex cursor-pointer text-fg-primary transition duration-100 ease-linear hover:bg-primary_hover hover:text-fg-primary focus-visible:outline-none focus-visible:[box-shadow:0px_0px_0px_2px_var(--color-bg-primary),0px_0px_0px_4px_var(--color-focus-ring)] print:hidden\",\n header: \"text-center sm:text-left\",\n footer: \"sm:flex-row sm:justify-end sm:gap-2 sm:space-x-0\",\n footerFixedSafe: \"pb-[max(1.5rem,env(safe-area-inset-bottom))]\",\n title: \"leading-none\",\n});\n","import { cx } from \"./cx\";\nimport { inputErrorFocusRingShadow, inputFocusRingShadow } from \"./input\";\n\n/**\n * Shared select logic for web and native.\n * Web `components/base/select` keeps its own class strings (`*:data-icon`); do not edit those files.\n * Native reads these maps. Icon pixel size is separate because React Native has no `data-icon`.\n */\n\n//////////////////////////////////////////////// TYPES\n\nexport const SELECT_SIZES = [\"sm\", \"md\", \"lg\"] as const;\nexport type SelectSize = (typeof SELECT_SIZES)[number];\n\n/** `Set` of item ids, or every item. */\nexport type SelectSelection = Set<string | number> | \"all\";\n\nexport type SelectTextItem = {\n id: string | number;\n label?: string;\n supportingText?: string;\n};\n\n/**\n * Narrow-screen menu. `sheet` defaults to `true` (web viewports ≤1024px, and every native screen).\n * `sheet: false` keeps the floating menu.\n */\nexport type SelectMobileOptions = {\n sheet?: boolean;\n fullScreen?: boolean;\n overlay?: boolean;\n title?: string;\n className?: string;\n contentClassName?: string;\n};\n\nexport type ResolvedSelectMobileOptions = {\n sheet: boolean;\n fullScreen: boolean;\n overlay: boolean;\n title?: string;\n sheetClassName?: string;\n contentClassName?: string;\n};\n\n//////////////////////////////////////////////// SIZES\n\nexport const sizes = {\n sm: { root: \"gap-2 py-2 pr-2.5 pl-3\", text: \"text-sm\", icon: 16, textGap: \"gap-x-1.5\" },\n md: { root: \"gap-2 px-3 py-2\", text: \"text-md\", icon: 20, textGap: \"gap-x-1.5\" },\n lg: { root: \"gap-2 px-3.5 py-2.5\", text: \"text-md\", icon: 20, textGap: \"gap-x-1.5\" },\n} as const;\n\nexport const itemSizes = {\n sm: { root: \"gap-2 p-2 pr-2.5\", text: \"text-sm\", icon: 16, textGap: \"gap-x-1.5\", check: 16, checkbox: \"sm\" as const },\n md: { root: \"gap-2 p-2 pr-2.5\", text: \"text-md\", icon: 20, textGap: \"gap-x-2\", check: 20, checkbox: \"sm\" as const },\n lg: { root: \"gap-2 py-2.5 pr-2.5 pl-2\", text: \"text-md\", icon: 20, textGap: \"gap-x-2\", check: 20, checkbox: \"md\" as const },\n} as const;\n\nexport const searchSizes = {\n sm: { wrapper: \"py-1\", root: \"gap-2 px-3 py-2\", text: \"text-sm\" },\n md: { wrapper: \"py-0.5\", root: \"gap-2 px-3 py-2\", text: \"text-md\" },\n lg: { wrapper: \"py-0.5\", root: \"gap-2 px-3.5 py-2.5\", text: \"text-md\" },\n} as const;\n\nexport const menuMaxHeight = {\n sm: \"max-h-56\",\n md: \"max-h-64\",\n lg: \"max-h-80\",\n} as const;\n\n//////////////////////////////////////////////// HELPERS\n\n/** Same defaults as web `resolveSelectMobileOptions`. */\nexport function resolveSelectMobileOptions(mobileOptions?: SelectMobileOptions): ResolvedSelectMobileOptions {\n const fullScreen = mobileOptions?.fullScreen ?? false;\n return {\n sheet: mobileOptions?.sheet ?? true,\n fullScreen,\n overlay: fullScreen ? false : (mobileOptions?.overlay ?? true),\n title: mobileOptions?.title,\n sheetClassName: mobileOptions?.className,\n contentClassName: mobileOptions?.contentClassName,\n };\n}\n\nexport function selectIdKey(id: string | number) {\n return String(id);\n}\n\nexport function selectionSet(selection: SelectSelection | undefined, items: { id: string | number }[]) {\n if (selection === \"all\") return new Set(items.map((item) => selectIdKey(item.id)));\n if (!selection) return new Set<string>();\n return new Set([...selection].map((id) => selectIdKey(id)));\n}\n\nexport function itemText(item: Pick<SelectTextItem, \"label\" | \"supportingText\">) {\n return item.supportingText ? `${item.label ?? \"\"} ${item.supportingText}` : (item.label ?? \"\");\n}\n\n/** Case-insensitive contains, matching the web select filter. */\nexport function itemMatches(item: Pick<SelectTextItem, \"label\" | \"supportingText\">, query: string) {\n const needle = query.trim().toLowerCase();\n if (!needle) return true;\n return itemText(item).toLowerCase().includes(needle);\n}\n\n/** Trigger shell — same border, focus ring, and error ring as the web select. */\nexport function selectFieldClassName(options: {\n size: SelectSize;\n focused?: boolean;\n isInvalid?: boolean;\n isDisabled?: boolean;\n className?: string;\n}) {\n return cx(\n \"bg-primary w-full flex-row items-center rounded-lg border border-solid shadow-xs\",\n sizes[options.size].root,\n options.isDisabled && \"opacity-50\",\n options.isInvalid && options.focused && inputErrorFocusRingShadow,\n options.isInvalid && !options.focused && \"border-error_subtle\",\n !options.isInvalid && options.focused && inputFocusRingShadow,\n !options.isInvalid && !options.focused && \"border-primary\",\n options.className,\n );\n}\n","import { createContext, isValidElement, type ComponentType, type FC, type ReactNode } from \"react\";\nimport {\n itemMatches,\n itemSizes,\n itemText,\n menuMaxHeight,\n resolveSelectMobileOptions,\n searchSizes,\n selectFieldClassName,\n selectIdKey,\n selectionSet,\n sizes,\n type ResolvedSelectMobileOptions,\n type SelectMobileOptions,\n type SelectSelection,\n type SelectSize,\n} from \"@avenue-ticketing/core/select\";\nimport { isReactComponent } from \"@avenue-ticketing/core/is-react-component\";\n\nexport {\n itemMatches,\n itemSizes,\n itemText,\n menuMaxHeight,\n resolveSelectMobileOptions,\n searchSizes,\n selectFieldClassName,\n selectIdKey,\n selectionSet,\n sizes,\n};\nexport type { ResolvedSelectMobileOptions, SelectMobileOptions, SelectSelection, SelectSize };\n\n//////////////////////////////////////////////// TYPES\n\nexport type SelectItemType = {\n id: string | number;\n label?: string;\n supportingText?: string;\n avatarUrl?: string;\n isDisabled?: boolean;\n icon?: ComponentType<{ size?: number; color?: string }> | ReactNode;\n};\n\nexport type CommonProps = {\n hint?: string;\n label?: string;\n size?: SelectSize;\n placeholder?: string;\n hideRequiredIndicator?: boolean;\n mobileOptions?: SelectMobileOptions;\n};\n\n//////////////////////////////////////////////// CONTEXT\n\nexport type SelectMenuContextValue = {\n size: SelectSize;\n isSelected: (id: string | number) => boolean;\n onSelect: (id: string | number) => void;\n /** Floating menu only. A sheet must wait for `onPress` so a drag does not select. */\n selectOnPressIn?: boolean;\n};\n\nexport const SelectMenuContext = createContext<SelectMenuContextValue | null>(null);\n\nexport const SelectContext = createContext<{ size: SelectSize }>({ size: \"md\" });\n\n//////////////////////////////////////////////// HELPERS\n\nexport const SelectGlyph: FC<{\n icon?: SelectItemType[\"icon\"];\n size: number;\n color: string;\n}> = ({ icon, size, color }) => {\n if (isReactComponent(icon)) {\n const Icon = icon;\n return <Icon size={size} color={color} />;\n }\n if (isValidElement(icon)) return icon;\n return null;\n};\n","import { useEffect, useState, type FC, type ReactNode } from \"react\";\nimport { Modal, useWindowDimensions } from \"react-native\";\nimport { Pressable, ScrollView, Text, View } from \"react-native-css/components\";\nimport { useNativeVariable } from \"react-native-css\";\nimport { useSafeAreaInsets } from \"react-native-safe-area-context\";\nimport Animated, { Easing, FadeIn, FadeInDown, FadeOut, FadeOutDown } from \"react-native-reanimated\";\nimport { XIcon } from \"phosphor-react-native/src/icons/X\";\nimport {\n DIALOG_ENTRY_EASING_BEZIER,\n DIALOG_EXIT_EASING_BEZIER,\n DIALOG_SHEET_MOTION_MS,\n DIALOG_SHEET_RADIUS_PX,\n DIALOG_SLIDE_OFFSET_PX,\n dialogStyles,\n} from \"@avenue-ticketing/core/dialog\";\nimport { cx } from \"@avenue-ticketing/core/cx\";\nimport {\n menuMaxHeight,\n resolveSelectMobileOptions,\n type SelectMobileOptions,\n type SelectSize,\n} from \"./select-shared\";\n\n//////////////////////////////////////////////// TYPES\n\nexport interface PopoverProps {\n open: boolean;\n onClose: () => void;\n size?: SelectSize;\n mobileOptions?: SelectMobileOptions;\n /** Search + list + footer manage their own scroll. */\n compound?: boolean;\n className?: string;\n children?: ReactNode;\n}\n\n//////////////////////////////////////////////// MOTION\n\nconst ENTRY = Easing.bezier(...DIALOG_ENTRY_EASING_BEZIER);\nconst EXIT = Easing.bezier(...DIALOG_EXIT_EASING_BEZIER);\n\nconst overlayEntering = FadeIn.duration(DIALOG_SHEET_MOTION_MS).easing(ENTRY);\nconst overlayExiting = FadeOut.duration(DIALOG_SHEET_MOTION_MS).easing(EXIT);\n\n/** Same enter/exit as the native dialog sheet: 175ms, 120px, fade. */\nconst panelEntering = FadeInDown.duration(DIALOG_SHEET_MOTION_MS)\n .easing(ENTRY)\n .withInitialValues({ opacity: 0, transform: [{ translateY: DIALOG_SLIDE_OFFSET_PX }] });\nconst panelExiting = FadeOutDown.duration(DIALOG_SHEET_MOTION_MS)\n .easing(EXIT)\n .withTargetValues({ opacity: 0, transform: [{ translateY: DIALOG_SLIDE_OFFSET_PX }] });\n\n/** Keep the modal mounted until the close animation finishes. */\nfunction useSheetPresence(open: boolean) {\n const [shouldRender, setShouldRender] = useState(open);\n\n useEffect(() => {\n if (open) {\n setShouldRender(true);\n return;\n }\n const hide = setTimeout(() => setShouldRender(false), DIALOG_SHEET_MOTION_MS);\n return () => clearTimeout(hide);\n }, [open]);\n\n return shouldRender;\n}\n\nfunction overlayFill(color: string) {\n const hex = /^#([\\da-f]{6})$/i.exec(color);\n if (!hex) return \"rgba(10, 13, 18, 0.7)\";\n const value = parseInt(hex[1], 16);\n return `rgba(${(value >> 16) & 255}, ${(value >> 8) & 255}, ${value & 255}, 0.7)`;\n}\n\nconst HEADER_HEIGHT = 56;\n\n//////////////////////////////////////////////// MENU\n\n/**\n * Floating menu, or the same bottom sheet as the native dialog: dim fades in\n * and the panel rises 120px. Height is the list, capped at 90% — it is not\n * written again after the slide starts.\n */\nexport const Popover: FC<PopoverProps> = ({\n open,\n onClose,\n size = \"md\",\n mobileOptions,\n compound = false,\n className,\n children,\n}) => {\n const resolved = resolveSelectMobileOptions(mobileOptions);\n\n if (!resolved.sheet) {\n if (!open) return null;\n return (\n <View\n className={cx(\n \"bg-primary overflow-hidden rounded-lg shadow-lg ring-1 ring-secondary_alt\",\n !compound && \"py-1\",\n !compound && menuMaxHeight[size],\n className,\n )}\n >\n {compound ? (\n children\n ) : (\n <ScrollView keyboardShouldPersistTaps=\"handled\" nestedScrollEnabled>\n {children}\n </ScrollView>\n )}\n </View>\n );\n }\n\n return (\n <SelectSheet\n open={open}\n onClose={onClose}\n title={resolved.title}\n fullScreen={resolved.fullScreen}\n overlay={resolved.overlay}\n className={cx(resolved.sheetClassName, resolved.contentClassName, className)}\n >\n {children}\n </SelectSheet>\n );\n};\n\nconst SelectSheet: FC<{\n open: boolean;\n onClose: () => void;\n title?: string;\n fullScreen: boolean;\n overlay: boolean;\n className?: string;\n children?: ReactNode;\n}> = ({ open, onClose, title, fullScreen, overlay, className, children }) => {\n const insets = useSafeAreaInsets();\n const { width: windowWidth, height: windowHeight } = useWindowDimensions();\n const shouldRender = useSheetPresence(open);\n const fgPrimary = useNativeVariable(\"--color-fg-primary\") ?? \"#181d27\";\n const bgPrimary = useNativeVariable(\"--color-bg-primary\") ?? \"#ffffff\";\n const borderSecondary = useNativeVariable(\"--color-border-secondary\") ?? \"#e9eaeb\";\n const overlayColor = useNativeVariable(\"--color-bg-overlay\") ?? \"#0a0d12\";\n const sheetMax = fullScreen ? windowHeight : Math.round(windowHeight * 0.9);\n const listMax = Math.max(0, sheetMax - HEADER_HEIGHT - (fullScreen ? insets.top : insets.bottom));\n\n return (\n <Modal visible={shouldRender} transparent animationType=\"none\" presentationStyle=\"overFullScreen\" statusBarTranslucent onRequestClose={onClose}>\n <View className={cx(dialogStyles.root, \"h-full w-full flex-1\", fullScreen ? dialogStyles.rootFull : dialogStyles.rootSheet)}>\n {open && overlay ? (\n <View className={dialogStyles.overlay}>\n <Animated.View entering={overlayEntering} exiting={overlayExiting} style={{ flex: 1, backgroundColor: overlayFill(overlayColor) }}>\n <Pressable accessibilityRole=\"button\" accessibilityLabel=\"Dismiss\" onPress={onClose} className=\"flex-1\" />\n </Animated.View>\n </View>\n ) : null}\n {open ? (\n <Animated.View\n collapsable={false}\n entering={panelEntering}\n exiting={panelExiting}\n style={\n fullScreen\n ? {\n flex: 1,\n width: windowWidth,\n backgroundColor: bgPrimary,\n paddingBottom: 12,\n }\n : {\n position: \"absolute\",\n left: 0,\n right: 0,\n bottom: 0,\n width: windowWidth,\n maxHeight: sheetMax,\n zIndex: 10,\n overflow: \"hidden\",\n backgroundColor: bgPrimary,\n borderTopLeftRadius: DIALOG_SHEET_RADIUS_PX,\n borderTopRightRadius: DIALOG_SHEET_RADIUS_PX,\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n borderTopWidth: 1,\n borderLeftWidth: 0,\n borderRightWidth: 0,\n borderBottomWidth: 0,\n borderTopColor: borderSecondary,\n paddingBottom: insets.bottom,\n }\n }\n >\n {fullScreen ? <View style={{ height: insets.top }} /> : null}\n <View className={cx(\"w-full flex-row items-center pr-2 pl-4\", title ? \"justify-between\" : \"justify-end\")} style={{ height: HEADER_HEIGHT }}>\n {title ? (\n <Text numberOfLines={1} className=\"text-primary min-w-0 flex-1 text-base font-semibold\">\n {title}\n </Text>\n ) : null}\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel=\"Close\"\n onPress={onClose}\n className=\"size-12 items-center justify-center rounded-full active:bg-primary_hover\"\n >\n <XIcon size={20} color={fgPrimary} />\n </Pressable>\n </View>\n <ScrollView\n keyboardShouldPersistTaps=\"handled\"\n style={fullScreen ? { flex: 1 } : { flexGrow: 0, flexShrink: 0, maxHeight: listMax }}\n >\n <View className={cx(\"py-1\", className)}>{children}</View>\n </ScrollView>\n </Animated.View>\n ) : null}\n </View>\n </Modal>\n );\n};\n"]}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Shared select logic for web and native.
3
+ * Web `components/base/select` keeps its own class strings (`*:data-icon`); do not edit those files.
4
+ * Native reads these maps. Icon pixel size is separate because React Native has no `data-icon`.
5
+ */
6
+ declare const SELECT_SIZES: readonly ["sm", "md", "lg"];
7
+ type SelectSize = (typeof SELECT_SIZES)[number];
8
+ /** `Set` of item ids, or every item. */
9
+ type SelectSelection = Set<string | number> | "all";
10
+ /**
11
+ * Narrow-screen menu. `sheet` defaults to `true` (web viewports ≤1024px, and every native screen).
12
+ * `sheet: false` keeps the floating menu.
13
+ */
14
+ type SelectMobileOptions = {
15
+ sheet?: boolean;
16
+ fullScreen?: boolean;
17
+ overlay?: boolean;
18
+ title?: string;
19
+ className?: string;
20
+ contentClassName?: string;
21
+ };
22
+
23
+ export type { SelectSelection as S, SelectSize as a, SelectMobileOptions as b };
@@ -0,0 +1,17 @@
1
+ import { ReactNode, FC } from 'react';
2
+ import { S as SelectItemType } from './select-shared-Ah_SqhzA.js';
3
+ import './select-BJtrES5I.js';
4
+
5
+ interface SelectItemProps extends SelectItemType {
6
+ selectionIndicator?: "checkmark" | "checkbox" | "none";
7
+ selectionIndicatorAlign?: "left" | "right";
8
+ className?: string;
9
+ children?: ReactNode;
10
+ }
11
+ /**
12
+ * Same row as the web select item: avatar or icon, label, supporting text,
13
+ * and a checkmark or checkbox when the row is selected.
14
+ */
15
+ declare const SelectItem: FC<SelectItemProps>;
16
+
17
+ export { SelectItem, type SelectItemProps };