blimpui 0.0.11 → 0.0.13

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.
@@ -1,5 +1,5 @@
1
- import * as React from "react";
2
1
  import type { LegendListProps, LegendListRef } from "@legendapp/list";
2
+ import * as React from "react";
3
3
  type ListComponent = (<T>(props: LegendListProps<T> & React.RefAttributes<LegendListRef>) => React.ReactNode) & {
4
4
  displayName?: string;
5
5
  };
@@ -1 +1 @@
1
- {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../$/components/primitives/list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EACX,eAAe,EACf,aAAa,EAEb,MAAM,iBAAiB,CAAC;AA4EzB,KAAK,aAAa,GAAG,CAAC,CAAC,CAAC,EACvB,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC,KAC1D,KAAK,CAAC,SAAS,CAAC,GAAG;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,QAAA,MAAM,IAAI,EA4HM,aAAa,CAAC;AAI9B,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,YAAY,EAAE,eAAe,IAAI,SAAS,EAAE,aAAa,IAAI,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../$/components/primitives/list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,eAAe,EACf,aAAa,EAEb,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA4E/B,KAAK,aAAa,GAAG,CAAC,CAAC,CAAC,EACvB,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC,KAC1D,KAAK,CAAC,SAAS,CAAC,GAAG;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,QAAA,MAAM,IAAI,EAgIM,aAAa,CAAC;AAI9B,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,YAAY,EAAE,eAAe,IAAI,SAAS,EAAE,aAAa,IAAI,OAAO,EAAE,CAAC"}
@@ -10,8 +10,8 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
- import * as React from "react";
14
13
  import { LegendList as LegendListBase } from "@legendapp/list";
14
+ import * as React from "react";
15
15
  import { Platform, StyleSheet } from "react-native";
16
16
  import { ScrollView } from "react-native-actions-sheet";
17
17
  function toNumber(value) {
@@ -150,7 +150,8 @@ var List = React.forwardRef(function List(props, forwardedRef) {
150
150
  return getFixedItemSize;
151
151
  return function () { return snapToInterval; };
152
152
  }, [getFixedItemSize, snapToInterval]);
153
- return (_jsx(LegendListBase, __assign({ ref: internalRef }, props, { getFixedItemSize: mergedGetFixedItemSize, renderItem: wrappedRenderItem, renderScrollComponent: function (props) { return _jsx(ScrollView, __assign({}, props)); }, children: wrappedChildren })));
153
+ var renderScrollView = React.useCallback(function (props) { return _jsx(ScrollView, __assign({}, props)); }, []);
154
+ return (_jsx(LegendListBase, __assign({ ref: internalRef }, props, { getFixedItemSize: mergedGetFixedItemSize, renderItem: wrappedRenderItem, renderScrollComponent: renderScrollView, children: wrappedChildren })));
154
155
  });
155
156
  List.displayName = "List";
156
157
  export { List };
@@ -1,5 +1,6 @@
1
1
  import * as PopoverPrimitive from "@rn-primitives/popover";
2
2
  import * as React from "react";
3
+ import { type StyleProp, type ViewStyle } from "react-native";
3
4
  declare const Popover: React.ForwardRefExoticComponent<import("react-native").ViewProps & {
4
5
  asChild?: boolean;
5
6
  } & {
@@ -11,7 +12,9 @@ declare const PopoverTrigger: React.ForwardRefExoticComponent<Omit<import("react
11
12
  onKeyDown?: (ev: React.KeyboardEvent) => void;
12
13
  onKeyUp?: (ev: React.KeyboardEvent) => void;
13
14
  } & React.RefAttributes<import("@rn-primitives/popover").TriggerRef>>;
14
- declare function PopoverContent({ className, align, sideOffset, portalHost, ...props }: PopoverPrimitive.ContentProps & React.RefAttributes<PopoverPrimitive.ContentRef> & {
15
+ declare function PopoverContent({ className, align, sideOffset, portalHost, overlayClassName, overlayStyle, ...props }: PopoverPrimitive.ContentProps & React.RefAttributes<PopoverPrimitive.ContentRef> & {
16
+ overlayClassName?: string;
17
+ overlayStyle?: StyleProp<ViewStyle>;
15
18
  portalHost?: string;
16
19
  }): import("react/jsx-runtime").JSX.Element;
17
20
  export { Popover, PopoverContent, PopoverTrigger };
@@ -1 +1 @@
1
- {"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../../$/components/primitives/popover.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,QAAA,MAAM,OAAO;;;;qDAAwB,CAAC;AAEtC,QAAA,MAAM,cAAc;;;;;qEAA2B,CAAC;AAKhD,iBAAS,cAAc,CAAC,EACvB,SAAS,EACT,KAAgB,EAChB,UAAc,EACd,UAAU,EACV,GAAG,KAAK,EACR,EAAE,gBAAgB,CAAC,YAAY,GAC/B,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,UAAU,CAAC,GAAG;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB,2CAkCD;AAED,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../../$/components/primitives/popover.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAGN,KAAK,SAAS,EACd,KAAK,SAAS,EACd,MAAM,cAAc,CAAC;AAItB,QAAA,MAAM,OAAO;;;;qDAAwB,CAAC;AAEtC,QAAA,MAAM,cAAc;;;;;qEAA2B,CAAC;AAKhD,iBAAS,cAAc,CAAC,EACvB,SAAS,EACT,KAAgB,EAChB,UAAc,EACd,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,GAAG,KAAK,EACR,EAAE,gBAAgB,CAAC,YAAY,GAC/B,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,UAAU,CAAC,GAAG;IAClD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB,2CAgED;AAED,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC"}
@@ -26,15 +26,32 @@ import { TextClassContext } from "../../../$/components/primitives/text";
26
26
  import { cn } from "../../../$/lib/utils";
27
27
  import * as PopoverPrimitive from "@rn-primitives/popover";
28
28
  import * as React from "react";
29
- import { Platform, StyleSheet } from "react-native";
29
+ import { Platform, StyleSheet, } from "react-native";
30
30
  import { FadeIn, FadeOut } from "react-native-reanimated";
31
31
  import { FullWindowOverlay as RNFullWindowOverlay } from "react-native-screens";
32
32
  var Popover = PopoverPrimitive.Root;
33
33
  var PopoverTrigger = PopoverPrimitive.Trigger;
34
34
  var FullWindowOverlay = Platform.OS === "ios" ? RNFullWindowOverlay : React.Fragment;
35
35
  function PopoverContent(_a) {
36
- var className = _a.className, _b = _a.align, align = _b === void 0 ? "center" : _b, _c = _a.sideOffset, sideOffset = _c === void 0 ? 4 : _c, portalHost = _a.portalHost, props = __rest(_a, ["className", "align", "sideOffset", "portalHost"]);
37
- return (_jsx(PopoverPrimitive.Portal, { hostName: portalHost, children: _jsx(FullWindowOverlay, { children: _jsx(PopoverPrimitive.Overlay, { style: Platform.select({ native: StyleSheet.absoluteFill }), children: _jsx(NativeOnlyAnimatedView, { entering: FadeIn.duration(200), exiting: FadeOut, children: _jsx(TextClassContext.Provider, { value: "text-popover-foreground", children: _jsx(PopoverPrimitive.Content, __assign({ align: align, sideOffset: sideOffset, className: cn("bg-popover border-border outline-hidden z-50 w-72 rounded-md border p-4 shadow-md shadow-black/5", Platform.select({
36
+ var className = _a.className, _b = _a.align, align = _b === void 0 ? "center" : _b, _c = _a.sideOffset, sideOffset = _c === void 0 ? 4 : _c, portalHost = _a.portalHost, overlayClassName = _a.overlayClassName, overlayStyle = _a.overlayStyle, props = __rest(_a, ["className", "align", "sideOffset", "portalHost", "overlayClassName", "overlayStyle"]);
37
+ return (_jsx(PopoverPrimitive.Portal, { hostName: portalHost, children: _jsx(FullWindowOverlay, { children: _jsx(PopoverPrimitive.Overlay, { style: Platform.select({
38
+ web: StyleSheet.flatten([
39
+ {
40
+ position: "fixed",
41
+ top: 0,
42
+ right: 0,
43
+ bottom: 0,
44
+ left: 0,
45
+ pointerEvents: "bounding-box",
46
+ },
47
+ overlayStyle,
48
+ ]),
49
+ native: StyleSheet.flatten([
50
+ StyleSheet.absoluteFill,
51
+ overlayStyle,
52
+ ]),
53
+ }), className: cn(Platform.select({ web: "fixed inset-0 z-[70]" }), overlayClassName), children: _jsx(NativeOnlyAnimatedView, { entering: FadeIn.duration(200), exiting: FadeOut, children: _jsx(TextClassContext.Provider, { value: "text-popover-foreground", children: _jsx(PopoverPrimitive.Content, __assign({ align: align, sideOffset: sideOffset, onPointerDownCapture: function (event) { var _a; return (_a = event === null || event === void 0 ? void 0 : event.stopPropagation) === null || _a === void 0 ? void 0 : _a.call(event); }, onWheel: function (event) { var _a; return (_a = event === null || event === void 0 ? void 0 : event.stopPropagation) === null || _a === void 0 ? void 0 : _a.call(event); },
54
+ onTouchMove: function (event) { var _a; return (_a = event === null || event === void 0 ? void 0 : event.stopPropagation) === null || _a === void 0 ? void 0 : _a.call(event); }, onPointerDown: function (event) { var _a; return (_a = event === null || event === void 0 ? void 0 : event.stopPropagation) === null || _a === void 0 ? void 0 : _a.call(event); }, onPointerMove: function (event) { var _a; return (_a = event === null || event === void 0 ? void 0 : event.stopPropagation) === null || _a === void 0 ? void 0 : _a.call(event); }, onPointerUp: function (event) { var _a; return (_a = event === null || event === void 0 ? void 0 : event.stopPropagation) === null || _a === void 0 ? void 0 : _a.call(event); }, className: cn("bg-popover border-border outline-hidden z-[71] w-72 rounded-md border p-4 shadow-md shadow-black/5", Platform.select({
38
55
  web: cn("animate-in fade-in-0 zoom-in-95 origin-(--radix-popover-content-transform-origin) cursor-auto", props.side === "bottom" && "slide-in-from-top-2", props.side === "top" && "slide-in-from-bottom-2"),
39
56
  }), className) }, props)) }) }) }) }) }));
40
57
  }
@@ -1 +1 @@
1
- {"version":3,"file":"datepicker.d.ts","sourceRoot":"","sources":["../../../../$/components/ui/datepicker.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAG9D,OAAO,EAAW,cAAc,EAAkB,MAAM,WAAW,CAAC;AAGpE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,KAAK,eAAe,GAAG,IAAI,CAC1B,cAAc,EACZ,UAAU,GACV,OAAO,GACP,cAAc,GACd,eAAe,GACf,SAAS,GACT,QAAQ,GACR,aAAa,CACf,GAAG;IACH,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,GAAG,SAAS,KAAK,IAAI,CAAC;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,GAAG,SAAS,KAAK,MAAM,CAAC;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC;IAC3C,aAAa,CAAC,EAAE,IAAI,CACnB,aAAa,EACb,OAAO,GAAG,cA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AC;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,GAAG,SAAS,KAAK,MAAM,CAAC;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC;IAC3C,aAAa,CAAC,EAAE,IAAI,CACnB,aAAa,EACb,OAAO,GAAG,cAAc,GAAG,eAAe,CAC1C,CAAC;IACF,mBAAmB,CAAC,EAAE,KAAK,CAAC,wBAAwB,CAAC,OAAO,cAAc,CAAC,CAAC;IAC5E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,YAAY,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IACzC,WAAW,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC;CACvC,CAAC;AAcF,iBAAS,UAAU,CAAC,EACnB,KAAK,EACL,YAAY,EACZ,aAAa,EACb,WAA6B,EAC7B,UAAU,EACV,MAAM,EACN,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,SAAS,EACT,cAAc,EACd,GAAG,cAAc,EACjB,EAAE,eAAe,2CAoHjB;kBArIQ,UAAU;;;AAyInB,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,YAAY,EAAE,eAAe,EAAE,CAAC"}
@@ -36,46 +36,47 @@ var buildDefaultFormatter = function (locale, formatOptions) {
36
36
  return function (date) { return (date ? formatter.format(date) : ""); };
37
37
  };
38
38
  function DatePicker(_a) {
39
- var value = _a.value, defaultValue = _a.defaultValue, onValueChange = _a.onValueChange, _b = _a.placeholder, placeholder = _b === void 0 ? "Select a date" : _b, formatDate = _a.formatDate, locale = _a.locale, formatOptions = _a.formatOptions, calendarProps = _a.calendarProps, popoverContentProps = _a.popoverContentProps, iconClassName = _a.iconClassName, onOpenChange = _a.onOpenChange, onFieldFocus = _a.onFieldFocus, onFieldBlur = _a.onFieldBlur, className = _a.className, fieldClassName = _a.fieldClassName, formFieldProps = __rest(_a, ["value", "defaultValue", "onValueChange", "placeholder", "formatDate", "locale", "formatOptions", "calendarProps", "popoverContentProps", "iconClassName", "onOpenChange", "onFieldFocus", "onFieldBlur", "className", "fieldClassName"]);
40
- var _c = useControllableState({
39
+ var _b;
40
+ var value = _a.value, defaultValue = _a.defaultValue, onValueChange = _a.onValueChange, _c = _a.placeholder, placeholder = _c === void 0 ? "Select a date" : _c, formatDate = _a.formatDate, locale = _a.locale, formatOptions = _a.formatOptions, calendarProps = _a.calendarProps, popoverContentProps = _a.popoverContentProps, iconClassName = _a.iconClassName, onOpenChange = _a.onOpenChange, onFieldFocus = _a.onFieldFocus, onFieldBlur = _a.onFieldBlur, className = _a.className, fieldClassName = _a.fieldClassName, formFieldProps = __rest(_a, ["value", "defaultValue", "onValueChange", "placeholder", "formatDate", "locale", "formatOptions", "calendarProps", "popoverContentProps", "iconClassName", "onOpenChange", "onFieldFocus", "onFieldBlur", "className", "fieldClassName"]);
41
+ var _d = useControllableState({
41
42
  value: value,
42
43
  defaultValue: defaultValue,
43
44
  onChange: onValueChange,
44
- }), selectedDate = _c[0], setSelectedDate = _c[1];
45
+ }), selectedDate = _d[0], setSelectedDate = _d[1];
45
46
  var popoverRef = React.useRef(null);
46
47
  var formatter = React.useMemo(function () { return formatDate !== null && formatDate !== void 0 ? formatDate : buildDefaultFormatter(locale, formatOptions); }, [formatDate, locale, formatOptions]);
47
48
  var displayValue = React.useMemo(function () { return formatter(selectedDate); }, [formatter, selectedDate]);
48
49
  var dimensions = useWindowDimensions();
49
50
  var isSmallerScreen = dimensions.width < 640;
50
- return (_jsx(FormField, __assign({}, formFieldProps, { className: className, fieldClassName: cn("h-16", fieldClassName), value: displayValue, placeholder: placeholder, onFocus: onFieldFocus, onBlur: onFieldBlur, children: function (_a) {
51
- var _b;
52
- var inputProps = _a.inputProps, isFocused = _a.isFocused, hasError = _a.hasError, hasSuccess = _a.hasSuccess;
53
- var handleOpenChange = function (nextOpen) {
54
- if (formFieldProps.disabled)
55
- return;
56
- if (nextOpen) {
57
- inputProps.onFocus();
58
- }
59
- else {
60
- inputProps.onBlur();
61
- }
62
- onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(nextOpen);
63
- };
64
- var handleDateChange = function (next) {
51
+ var handleOpenChange = function (nextOpen) {
52
+ if (formFieldProps.disabled)
53
+ return;
54
+ // if (nextOpen) {
55
+ // inputProps.onFocus();
56
+ // } else {
57
+ // inputProps.onBlur();
58
+ // }
59
+ onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(nextOpen);
60
+ };
61
+ var handleDateChange = function (next) {
62
+ var _a;
63
+ setSelectedDate(next);
64
+ (_a = popoverRef.current) === null || _a === void 0 ? void 0 : _a.close();
65
+ };
66
+ var resolvedPopoverContentClassName = cn("border-none bg-transparent p-0 shadow-none", popoverContentProps === null || popoverContentProps === void 0 ? void 0 : popoverContentProps.className);
67
+ return (_jsx(Popover, { onOpenChange: handleOpenChange, content: _jsx(Calendar, __assign({ value: selectedDate, onValueChange: handleDateChange }, calendarProps)), contentProps: __assign(__assign({}, popoverContentProps), { className: resolvedPopoverContentClassName, sideOffset: (_b = popoverContentProps === null || popoverContentProps === void 0 ? void 0 : popoverContentProps.sideOffset) !== null && _b !== void 0 ? _b : 8 }), triggerRef: popoverRef, type: isSmallerScreen ? "floating-sheet" : "popover", children: _jsx(FormField, __assign({}, formFieldProps, { className: className, fieldClassName: cn("h-16", fieldClassName), value: displayValue, placeholder: placeholder, onFocus: onFieldFocus, onBlur: onFieldBlur, onPress: function () {
65
68
  var _a;
66
- setSelectedDate(next);
67
- (_a = popoverRef.current) === null || _a === void 0 ? void 0 : _a.close();
68
- };
69
- var textToShow = displayValue || placeholder;
70
- var resolvedPopoverContentClassName = cn("border-none bg-transparent p-0 shadow-none", popoverContentProps === null || popoverContentProps === void 0 ? void 0 : popoverContentProps.className);
71
- return (_jsxs(_Fragment, { children: [_jsx(Popover, { onOpenChange: handleOpenChange, content: _jsx(Calendar, __assign({ value: selectedDate, onValueChange: handleDateChange }, calendarProps)), contentProps: __assign(__assign({}, popoverContentProps), { className: resolvedPopoverContentClassName, sideOffset: (_b = popoverContentProps === null || popoverContentProps === void 0 ? void 0 : popoverContentProps.sideOffset) !== null && _b !== void 0 ? _b : 8 }), triggerRef: popoverRef, type: isSmallerScreen ? "floating-sheet" : "popover" }), _jsxs(Pressable, { className: "flex-row items-center justify-between gap-2 py-1.5", disabled: formFieldProps.disabled, accessibilityState: {
69
+ (_a = popoverRef.current) === null || _a === void 0 ? void 0 : _a.open();
70
+ }, children: function (_a) {
71
+ var inputProps = _a.inputProps, isFocused = _a.isFocused, hasError = _a.hasError, hasSuccess = _a.hasSuccess;
72
+ var textToShow = displayValue || placeholder;
73
+ return (_jsx(_Fragment, { children: _jsxs(Pressable, { className: "flex-row items-center justify-between gap-2 py-1.5", disabled: formFieldProps.disabled, accessibilityState: {
72
74
  disabled: formFieldProps.disabled,
73
75
  }, onPress: function () {
74
- var _a, _b;
75
- console.log(popoverRef.current, (_a = popoverRef.current) === null || _a === void 0 ? void 0 : _a.open());
76
- (_b = popoverRef.current) === null || _b === void 0 ? void 0 : _b.open();
77
- }, children: [_jsx(View, { className: "flex-1", children: _jsx(Text, { className: cn("text-base", displayValue ? "text-foreground" : "text-muted-foreground"), numberOfLines: 1, ellipsizeMode: "tail", children: textToShow }) }), _jsx(Icon, { as: CalendarIcon, className: cn("size-5 text-muted-foreground", isFocused && !hasError && !hasSuccess && "text-foreground", hasError && "text-destructive", hasSuccess && "text-primary", iconClassName) })] })] }));
78
- } })));
76
+ var _a;
77
+ (_a = popoverRef.current) === null || _a === void 0 ? void 0 : _a.open();
78
+ }, children: [_jsx(View, { className: "flex-1", children: _jsx(Text, { className: cn("text-base", displayValue ? "text-foreground" : "text-muted-foreground"), numberOfLines: 1, ellipsizeMode: "tail", children: textToShow }) }), _jsx(Icon, { as: CalendarIcon, className: cn("size-5 text-muted-foreground", isFocused && !hasError && !hasSuccess && "text-foreground", hasError && "text-destructive", hasSuccess && "text-primary", iconClassName) })] }) }));
79
+ } })) }));
79
80
  }
80
81
  DatePicker.displayName = "DatePicker";
81
82
  export { DatePicker };
@@ -41,8 +41,9 @@ type FormFieldProps = {
41
41
  errorClassName?: string;
42
42
  successClassName?: string;
43
43
  children: (props: FormFieldRenderProps) => React.ReactNode;
44
+ onPress?: () => void;
44
45
  };
45
- declare function FormField({ variant, label, placeholder, helperText, error, success, startContent, endContent, value, defaultValue, onValueChange, onFocus, onBlur, disabled, required, labelPlacement, className, fieldClassName, labelClassName, contentClassName, messageClassName, errorClassName, successClassName, children, }: FormFieldProps): import("react/jsx-runtime").JSX.Element;
46
+ declare function FormField({ variant, label, placeholder, helperText, error, success, startContent, endContent, value, defaultValue, onValueChange, onFocus, onBlur, disabled, required, labelPlacement, className, fieldClassName, labelClassName, contentClassName, messageClassName, errorClassName, successClassName, children, onPress, }: FormFieldProps): import("react/jsx-runtime").JSX.Element;
46
47
  export { FormField };
47
48
  export type { FormFieldProps, FormFieldRenderProps };
48
49
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../$/components/ui/form-field/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAa,SAAS,EAAQ,MAAM,cAAc,CAAC;AAO1D,KAAK,oBAAoB,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IACrC,UAAU,EAAE;QACX,KAA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AAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,KAAK,CAAC,SAAS,CAAC;CAC3D,CAAC;AAEF,iBAAS,SAAS,CAAC,EAClB,OAAgB,EAChB,KAAK,EACL,WAAW,EACX,UAAU,EACV,KAAK,EACL,OAAO,EACP,YAAY,EACZ,UAAU,EACV,KAAK,EACL,YAAY,EACZ,aAAa,EACb,OAAO,EACP,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,cAAyB,EACzB,SAAS,EACT,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,QAAQ,GACR,EAAE,cAAc,2CA0JhB;AAED,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,YAAY,EAAE,cAAc,EAAE,oBAAoB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../$/components/ui/form-field/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAa,SAAS,EAAQ,MAAM,cAAc,CAAC;AAO1D,KAAK,oBAAoB,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IACrC,UAAU,EAAE;QACX,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,OAAO,EAAE,MAAM,IAAI,CAAC;QACpB,MAAM,EAAE,MAAM,IAAI,CAAC;QACnB,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;QACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;KACnB,CAAC;CACF,CAAC;AA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ACP,YAAY,EACZ,UAAU,EACV,KAAK,EACL,YAAY,EACZ,aAAa,EACb,OAAO,EACP,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,cAAyB,EACzB,SAAS,EACT,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,QAAQ,EACR,OAAO,GACP,EAAE,cAAc,2CA2JhB;AAED,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,YAAY,EAAE,cAAc,EAAE,oBAAoB,EAAE,CAAC"}
@@ -19,7 +19,7 @@ import { useFormField } from "./use-form-field";
19
19
  import { useFormFieldAnimation } from "./use-form-field-animation";
20
20
  function FormField(_a) {
21
21
  var _b, _c;
22
- var _d = _a.variant, variant = _d === void 0 ? "flat" : _d, label = _a.label, placeholder = _a.placeholder, helperText = _a.helperText, error = _a.error, success = _a.success, startContent = _a.startContent, endContent = _a.endContent, value = _a.value, defaultValue = _a.defaultValue, onValueChange = _a.onValueChange, onFocus = _a.onFocus, onBlur = _a.onBlur, disabled = _a.disabled, required = _a.required, _e = _a.labelPlacement, labelPlacement = _e === void 0 ? "inside" : _e, className = _a.className, fieldClassName = _a.fieldClassName, labelClassName = _a.labelClassName, contentClassName = _a.contentClassName, messageClassName = _a.messageClassName, errorClassName = _a.errorClassName, successClassName = _a.successClassName, children = _a.children;
22
+ var _d = _a.variant, variant = _d === void 0 ? "flat" : _d, label = _a.label, placeholder = _a.placeholder, helperText = _a.helperText, error = _a.error, success = _a.success, startContent = _a.startContent, endContent = _a.endContent, value = _a.value, defaultValue = _a.defaultValue, onValueChange = _a.onValueChange, onFocus = _a.onFocus, onBlur = _a.onBlur, disabled = _a.disabled, required = _a.required, _e = _a.labelPlacement, labelPlacement = _e === void 0 ? "inside" : _e, className = _a.className, fieldClassName = _a.fieldClassName, labelClassName = _a.labelClassName, contentClassName = _a.contentClassName, messageClassName = _a.messageClassName, errorClassName = _a.errorClassName, successClassName = _a.successClassName, children = _a.children, onPress = _a.onPress;
23
23
  var _f = useFormField({
24
24
  error: error,
25
25
  success: success,
@@ -29,6 +29,7 @@ function FormField(_a) {
29
29
  onFocus: onFocus,
30
30
  onBlur: onBlur,
31
31
  disabled: disabled,
32
+ onPress: onPress,
32
33
  }), inputRef = _f.inputRef, resolvedValue = _f.resolvedValue, isFocused = _f.isFocused, hasError = _f.hasError, hasSuccess = _f.hasSuccess, inputProps = _f.inputProps, focusInput = _f.focusInput;
33
34
  var hasPlaceholder = Boolean(placeholder);
34
35
  var hasValue = resolvedValue.length > 0;
@@ -8,8 +8,9 @@ type UseFormFieldProps = {
8
8
  onFocus?: () => void;
9
9
  onBlur?: () => void;
10
10
  disabled?: boolean;
11
+ onPress?: () => void;
11
12
  };
12
- export declare function useFormField({ error, success, value, defaultValue, onValueChange, onFocus, onBlur, disabled, }: UseFormFieldProps): {
13
+ export declare function useFormField({ error, success, value, defaultValue, onValueChange, onFocus, onBlur, disabled, onPress, }: UseFormFieldProps): {
13
14
  inputRef: import("react").RefObject<TextInput>;
14
15
  resolvedValue: string;
15
16
  isFocused: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"use-form-field.d.ts","sourceRoot":"","sources":["../../../../../$/components/ui/form-field/use-form-field.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,KAAK,iBAAiB,GAAG;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,wBAAgB,YAAY,CAAC,EAC5B,KAAK,EACL,OAAO,EACP,KAAK,EACL,YAAiB,EACjB,aAAa,EACb,OAAO,EACP,MAAM,EACN,QAAQ,GACR,EAAE,iBAAiB;;;;;;;;;;6BA4BX,MAAM;;;;EAgCd"}
1
+ {"version":3,"file":"use-form-field.d.ts","sourceRoot":"","sources":["../../../../../$/components/ui/form-field/use-form-field.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,KAAK,iBAAiB,GAAG;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,wBAAgB,YAAY,CAAC,EAC5B,KAAK,EACL,OAAO,EACP,KAAK,EACL,YAAiB,EACjB,aAAa,EACb,OAAO,EACP,MAAM,EACN,QAAQ,EACR,OAAO,GACP,EAAE,iBAAiB;;;;;;;;;;6BA4BX,MAAM;;;;EAkCd"}
@@ -1,6 +1,6 @@
1
1
  import { useCallback, useEffect, useRef, useState } from "react";
2
2
  export function useFormField(_a) {
3
- var error = _a.error, success = _a.success, value = _a.value, _b = _a.defaultValue, defaultValue = _b === void 0 ? "" : _b, onValueChange = _a.onValueChange, onFocus = _a.onFocus, onBlur = _a.onBlur, disabled = _a.disabled;
3
+ var error = _a.error, success = _a.success, value = _a.value, _b = _a.defaultValue, defaultValue = _b === void 0 ? "" : _b, onValueChange = _a.onValueChange, onFocus = _a.onFocus, onBlur = _a.onBlur, disabled = _a.disabled, onPress = _a.onPress;
4
4
  var inputRef = useRef(null);
5
5
  var isControlled = value !== undefined;
6
6
  var _c = useState(defaultValue), internalValue = _c[0], setInternalValue = _c[1];
@@ -35,7 +35,9 @@ export function useFormField(_a) {
35
35
  return;
36
36
  var node = inputRef.current;
37
37
  (_a = node === null || node === void 0 ? void 0 : node.focus) === null || _a === void 0 ? void 0 : _a.call(node);
38
- }, [disabled]);
38
+ onFocus === null || onFocus === void 0 ? void 0 : onFocus();
39
+ onPress === null || onPress === void 0 ? void 0 : onPress();
40
+ }, [disabled, onPress]);
39
41
  var inputProps = {
40
42
  value: resolvedValue,
41
43
  onFocus: handleFocus,
@@ -15,8 +15,9 @@ type PickerProps<TValue> = Omit<FormFieldProps, "children" | "value" | "defaultV
15
15
  onOpenChange?: (open: boolean) => void;
16
16
  onFieldFocus?: FormFieldProps["onFocus"];
17
17
  onFieldBlur?: FormFieldProps["onBlur"];
18
+ type?: "floating-sheet" | "popover";
18
19
  };
19
- declare function Picker<TValue>({ options, value, defaultValue, onValueChange, placeholder, formatOptionLabel, wheelPickerProps, popoverContentProps, iconClassName, onOpenChange, onFieldFocus, onFieldBlur, className, fieldClassName, ...formFieldProps }: PickerProps<TValue>): import("react/jsx-runtime").JSX.Element;
20
+ declare function Picker<TValue>({ options, value, defaultValue, onValueChange, placeholder, formatOptionLabel, wheelPickerProps, popoverContentProps, iconClassName, onOpenChange, onFieldFocus, onFieldBlur, className, fieldClassName, type, ...formFieldProps }: PickerProps<TValue>): import("react/jsx-runtime").JSX.Element;
20
21
  declare namespace Picker {
21
22
  var displayName: string;
22
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"picker.d.ts","sourceRoot":"","sources":["../../../../$/components/ui/picker.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEN,KAAK,eAAe,EACpB,KAAK,gBAAgB,IAAI,yBAAyB,EAClD,MAAM,eAAe,CAAC;AACvB,OAAO,EAAa,KAAK,cAAc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AAc,CAAC,CAAC;IAC5E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,YAAY,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IACzC,WAAW,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC;IACvC,IAAI,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;CACpC,CAAC;AAEF,iBAAS,MAAM,CAAC,MAAM,EAAE,EACvB,OAAO,EACP,KAAK,EACL,YAAY,EACZ,aAAa,EACb,WAAgC,EAChC,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,SAAS,EACT,cAAc,EACd,IAAI,EACJ,GAAG,cAAc,EACjB,EAAE,WAAW,CAAC,MAAM,CAAC,2CAuIrB;kBAxJQ,MAAM;;;AA4Jf,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,YAAY,EAAE,WAAW,EAAE,CAAC"}
@@ -32,18 +32,18 @@ import { ChevronDown } from "lucide-react-native";
32
32
  import * as React from "react";
33
33
  import { Pressable, useWindowDimensions, View } from "react-native";
34
34
  function Picker(_a) {
35
- var _b;
36
- var options = _a.options, value = _a.value, defaultValue = _a.defaultValue, onValueChange = _a.onValueChange, _c = _a.placeholder, placeholder = _c === void 0 ? "Select an option" : _c, formatOptionLabel = _a.formatOptionLabel, wheelPickerProps = _a.wheelPickerProps, popoverContentProps = _a.popoverContentProps, iconClassName = _a.iconClassName, onOpenChange = _a.onOpenChange, onFieldFocus = _a.onFieldFocus, onFieldBlur = _a.onFieldBlur, className = _a.className, fieldClassName = _a.fieldClassName, formFieldProps = __rest(_a, ["options", "value", "defaultValue", "onValueChange", "placeholder", "formatOptionLabel", "wheelPickerProps", "popoverContentProps", "iconClassName", "onOpenChange", "onFieldFocus", "onFieldBlur", "className", "fieldClassName"]);
35
+ var _b, _c, _d;
36
+ var options = _a.options, value = _a.value, defaultValue = _a.defaultValue, onValueChange = _a.onValueChange, _e = _a.placeholder, placeholder = _e === void 0 ? "Select an option" : _e, formatOptionLabel = _a.formatOptionLabel, wheelPickerProps = _a.wheelPickerProps, popoverContentProps = _a.popoverContentProps, iconClassName = _a.iconClassName, onOpenChange = _a.onOpenChange, onFieldFocus = _a.onFieldFocus, onFieldBlur = _a.onFieldBlur, className = _a.className, fieldClassName = _a.fieldClassName, type = _a.type, formFieldProps = __rest(_a, ["options", "value", "defaultValue", "onValueChange", "placeholder", "formatOptionLabel", "wheelPickerProps", "popoverContentProps", "iconClassName", "onOpenChange", "onFieldFocus", "onFieldBlur", "className", "fieldClassName", "type"]);
37
37
  var optionsMap = React.useMemo(function () { return new Map(options.map(function (option) { return [option.value, option]; })); }, [options]);
38
38
  var emitValueChange = React.useCallback(function (next) {
39
39
  var option = next !== undefined ? optionsMap.get(next) : undefined;
40
40
  onValueChange === null || onValueChange === void 0 ? void 0 : onValueChange(next, option);
41
41
  }, [onValueChange, optionsMap]);
42
- var _d = useControllableState({
42
+ var _f = useControllableState({
43
43
  value: value,
44
44
  defaultValue: defaultValue,
45
45
  onChange: emitValueChange,
46
- }), selectedValue = _d[0], setSelectedValue = _d[1];
46
+ }), selectedValue = _f[0], setSelectedValue = _f[1];
47
47
  var popoverRef = React.useRef(null);
48
48
  var dimensions = useWindowDimensions();
49
49
  var isSmallerScreen = dimensions.width < 640;
@@ -52,29 +52,37 @@ function Picker(_a) {
52
52
  ? (_b = formatOptionLabel === null || formatOptionLabel === void 0 ? void 0 : formatOptionLabel(selectedOption)) !== null && _b !== void 0 ? _b : selectedOption.label
53
53
  : "";
54
54
  var textToShow = displayLabel || placeholder;
55
- return (_jsx(FormField, __assign({}, formFieldProps, { className: className, fieldClassName: cn("h-16", fieldClassName), value: displayLabel, placeholder: placeholder, onFocus: onFieldFocus, onBlur: onFieldBlur, children: function (_a) {
56
- var _b, _c;
57
- var inputProps = _a.inputProps, isFocused = _a.isFocused, hasError = _a.hasError, hasSuccess = _a.hasSuccess;
58
- var handleOpenChange = function (nextOpen) {
59
- if (formFieldProps.disabled)
60
- return;
61
- if (nextOpen) {
62
- inputProps.onFocus();
63
- }
64
- else {
65
- inputProps.onBlur();
66
- }
67
- onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(nextOpen);
68
- };
69
- var handleValueChange = function (next) {
70
- setSelectedValue(next);
71
- };
72
- var resolvedPopoverContentClassName = cn("border-none bg-transparent p-0 shadow-none", popoverContentProps === null || popoverContentProps === void 0 ? void 0 : popoverContentProps.className);
73
- var overlayBgClassName = (_b = wheelPickerProps === null || wheelPickerProps === void 0 ? void 0 : wheelPickerProps.overlayBgColorClassName) !== null && _b !== void 0 ? _b : "bg-card/70";
74
- return (_jsxs(_Fragment, { children: [_jsx(Popover, { onOpenChange: handleOpenChange, content: _jsx(View, { className: "p-4 bg-card rounded-2xl border border-border", children: _jsx(WheelPicker, __assign({ items: options, value: selectedValue, onValueChange: handleValueChange }, wheelPickerProps, { overlayBgColorClassName: overlayBgClassName })) }), contentProps: __assign(__assign({}, popoverContentProps), { className: resolvedPopoverContentClassName, sideOffset: (_c = popoverContentProps === null || popoverContentProps === void 0 ? void 0 : popoverContentProps.sideOffset) !== null && _c !== void 0 ? _c : 8 }), triggerRef: popoverRef, type: isSmallerScreen ? "floating-sheet" : "popover" }), _jsxs(Pressable, { className: "flex-row items-center justify-between gap-2 py-1.5", disabled: formFieldProps.disabled, accessibilityState: {
75
- disabled: formFieldProps.disabled,
76
- }, onPress: function () { var _a; return (_a = popoverRef.current) === null || _a === void 0 ? void 0 : _a.open(); }, children: [_jsx(View, { className: "flex-1", children: _jsx(Text, { className: cn("text-base", displayLabel ? "text-foreground" : "text-muted-foreground"), numberOfLines: 1, ellipsizeMode: "tail", children: textToShow }) }), _jsx(Icon, { as: ChevronDown, className: cn("size-5 text-muted-foreground", isFocused && !hasError && !hasSuccess && "text-foreground", hasError && "text-destructive", hasSuccess && "text-primary", iconClassName) })] })] }));
77
- } })));
55
+ var resolvedPopoverContentClassName = cn("border-none bg-transparent p-0 shadow-none", popoverContentProps === null || popoverContentProps === void 0 ? void 0 : popoverContentProps.className);
56
+ var overlayBgClassName = (_c = wheelPickerProps === null || wheelPickerProps === void 0 ? void 0 : wheelPickerProps.overlayBgColorClassName) !== null && _c !== void 0 ? _c : "bg-card/70";
57
+ var handleValueChange = function (next) {
58
+ setSelectedValue(next);
59
+ };
60
+ var handleOpenChange = function (nextOpen) {
61
+ if (formFieldProps.disabled)
62
+ return;
63
+ // if (nextOpen) {
64
+ // inputProps.onFocus();
65
+ // } else {
66
+ // inputProps.onBlur();
67
+ // }
68
+ onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(nextOpen);
69
+ };
70
+ return (_jsx(_Fragment, { children: _jsx(Popover, { onOpenChange: handleOpenChange, content: _jsx(View, { className: "p-4 bg-card rounded-2xl border border-border", children: _jsx(WheelPicker, __assign({ items: options, value: selectedValue, onValueChange: handleValueChange }, wheelPickerProps, { overlayBgColorClassName: overlayBgClassName })) }), contentProps: __assign(__assign({}, popoverContentProps), { className: resolvedPopoverContentClassName, sideOffset: (_d = popoverContentProps === null || popoverContentProps === void 0 ? void 0 : popoverContentProps.sideOffset) !== null && _d !== void 0 ? _d : 8 }), className: className, triggerRef: popoverRef, type: type || (isSmallerScreen ? "floating-sheet" : "popover"), children: _jsx(FormField, __assign({}, formFieldProps, { className: className, fieldClassName: cn("h-16", fieldClassName), value: displayLabel, placeholder: placeholder, onFocus: onFieldFocus, onPress: function () {
71
+ var _a;
72
+ console.log("pressed");
73
+ (_a = popoverRef.current) === null || _a === void 0 ? void 0 : _a.open();
74
+ }, onBlur: onFieldBlur, children: function (_a) {
75
+ var inputProps = _a.inputProps, isFocused = _a.isFocused, hasError = _a.hasError, hasSuccess = _a.hasSuccess, inputRef = _a.inputRef;
76
+ return (_jsx(_Fragment, { children: _jsxs(Pressable, { className: "flex-row items-center justify-between gap-2 py-1.5", disabled: formFieldProps.disabled, onPress: function () {
77
+ var _a;
78
+ (_a = popoverRef.current) === null || _a === void 0 ? void 0 : _a.open();
79
+ }, children: [_jsx(View, { className: "flex-1", children: _jsx(Text, { className: cn("text-base", displayLabel
80
+ ? "text-foreground"
81
+ : "text-muted-foreground"), numberOfLines: 1, ellipsizeMode: "tail", children: textToShow }) }), _jsx(Icon, { as: ChevronDown, className: cn("size-5 text-muted-foreground", isFocused &&
82
+ !hasError &&
83
+ !hasSuccess &&
84
+ "text-foreground", hasError && "text-destructive", hasSuccess && "text-primary", iconClassName) })] }) }));
85
+ } })) }) }));
78
86
  }
79
87
  Picker.displayName = "Picker";
80
88
  export { Picker };
@@ -1 +1 @@
1
- {"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../../$/components/ui/popover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAoB,EAEnB,KAAK,gBAAgB,EACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAQ,IAAI,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EACN,OAAO,IAAI,WAAW,EACtB,cAAc,EACd,cAAc,EACd,MAAM,uBAAuB,CAAC;AAE/B,KAAK,qBAAqB,GAAG,IAAI,CAChC,KAAK,CAAC,wBAAwB,CAAC,OAAO,cAAc,CAAC,EACrD,UAAU,CACV,CAAC;AAEF,KAAK,qBAAqB,GAAG,KAAK,CAAC,wBAAwB,CAC1D,OAAO,cAAc,CACrB,CAAC;AAEF,KAAK,kBAAkB,GAAG,KAAK,CAAC,wBAAwB,CAAC,OAAO,WAAW,CAAC,CAAC;AAE7E,KAAK,kBAAkB,GAAG,gBAAgB,GAAG;IAC5C,YAAY,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC;CAC1D,CAAC;AAEF,K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  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
24
24
  import * as React from "react";
25
25
  import ActionSheet from "react-native-actions-sheet";
26
+ import { Platform, View } from "react-native";
26
27
  import { Popover as PopoverRoot, PopoverContent, PopoverTrigger, } from "../primitives/popover";
27
28
  var FloatingSheet = function (_a) {
28
29
  var content = _a.content, sheetProps = _a.sheetProps, children = _a.children, triggerProps = _a.triggerProps, triggerRef = _a.triggerRef;
@@ -36,21 +37,35 @@ var FloatingSheet = function (_a) {
36
37
  var child = children;
37
38
  return React.cloneElement(child, {
38
39
  onPress: function (event) {
39
- var _a, _b, _c, _d;
40
- (_b = (_a = child.props) === null || _a === void 0 ? void 0 : _a.onPress) === null || _b === void 0 ? void 0 : _b.call(_a, event);
41
- (_c = triggerProps === null || triggerProps === void 0 ? void 0 : triggerProps.onPress) === null || _c === void 0 ? void 0 : _c.call(triggerProps, event);
42
- (_d = sheetRef.current) === null || _d === void 0 ? void 0 : _d.show();
40
+ var _a, _b, _c, _d, _e, _f;
41
+ if (Platform.OS === "web" &&
42
+ event &&
43
+ typeof event === "object" &&
44
+ "stopPropagation" in event) {
45
+ (_b = (_a = event).stopPropagation) === null || _b === void 0 ? void 0 : _b.call(_a);
46
+ }
47
+ (_d = (_c = child.props) === null || _c === void 0 ? void 0 : _c.onPress) === null || _d === void 0 ? void 0 : _d.call(_c, event);
48
+ (_e = triggerProps === null || triggerProps === void 0 ? void 0 : triggerProps.onPress) === null || _e === void 0 ? void 0 : _e.call(triggerProps, event);
49
+ (_f = sheetRef.current) === null || _f === void 0 ? void 0 : _f.show();
43
50
  },
44
51
  });
45
52
  })()
46
53
  : children;
47
- return (_jsxs(_Fragment, { children: [trigger, _jsx(ActionSheet, __assign({ ref: sheetRef, gestureEnabled: false, indicatorStyle: { display: "none" }, containerStyle: {
54
+ var sheetContent = Platform.OS === "web" ? (_jsx(View, { onWheel: function (event) {
55
+ var _a;
56
+ (_a = event === null || event === void 0 ? void 0 : event.stopPropagation) === null || _a === void 0 ? void 0 : _a.call(event);
57
+ },
58
+ onTouchMove: function (event) {
59
+ var _a;
60
+ (_a = event === null || event === void 0 ? void 0 : event.stopPropagation) === null || _a === void 0 ? void 0 : _a.call(event);
61
+ }, children: content })) : (content);
62
+ return (_jsxs(_Fragment, { children: [trigger, _jsx(ActionSheet, __assign({ ref: sheetRef, gestureEnabled: false, indicatorStyle: { display: "none" }, disableElevation: true, zIndex: 99999, elevation: 999, containerStyle: {
48
63
  paddingHorizontal: 12,
49
64
  height: "40%",
50
65
  backgroundColor: "transparent",
51
66
  paddingBottom: 30,
52
67
  bottom: 20,
53
- } }, sheetProps, { children: content }))] }));
68
+ } }, sheetProps, { children: sheetContent }))] }));
54
69
  };
55
70
  var Popover = function (props) {
56
71
  if (props.type === "floating-sheet") {
@@ -1 +1 @@
1
- {"version":3,"file":"timepicker.d.ts","sourceRoot":"","sources":["../../../../$/components/ui/timepicker.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEN,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,IAAI,gBAAgB,EAC7C,KAAK,oBAAoB,EACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAG9D,OAAO,EAAW,cAAc,EAAE,MAAM,WAAW,CAAC;AAGpD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,KAAK,eAAe,GAAG,IAAI,CAC1B,cAAc,EACZ,UAAU,GACV,OAAO,GACP,cAAc,GACd,eAAe,GACf,SAAS,GACT,QAAQ,GACR,aAAa,CACf,GAAG;IACH,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAC7B,YAAY,CAAC,EAAE,oBAAoB,CAAC;IACpC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,GAAG,SAAS,KAAK,IAAI,CAAC;IAClE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,qBAAqB,CAAC;IA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AAE,CAAC"}
@@ -51,40 +51,42 @@ var buildDefaultFormatter = function (format) {
51
51
  };
52
52
  };
53
53
  function TimePicker(_a) {
54
- var value = _a.value, defaultValue = _a.defaultValue, onValueChange = _a.onValueChange, _b = _a.placeholder, placeholder = _b === void 0 ? "Select a time" : _b, _c = _a.format, format = _c === void 0 ? "24h" : _c, minuteStep = _a.minuteStep, formatTime = _a.formatTime, timeWheelPickerProps = _a.timeWheelPickerProps, popoverContentProps = _a.popoverContentProps, iconClassName = _a.iconClassName, onOpenChange = _a.onOpenChange, onFieldFocus = _a.onFieldFocus, onFieldBlur = _a.onFieldBlur, className = _a.className, fieldClassName = _a.fieldClassName, formFieldProps = __rest(_a, ["value", "defaultValue", "onValueChange", "placeholder", "format", "minuteStep", "formatTime", "timeWheelPickerProps", "popoverContentProps", "iconClassName", "onOpenChange", "onFieldFocus", "onFieldBlur", "className", "fieldClassName"]);
55
- var _d = useControllableState({
54
+ var _b;
55
+ var value = _a.value, defaultValue = _a.defaultValue, onValueChange = _a.onValueChange, _c = _a.placeholder, placeholder = _c === void 0 ? "Select a time" : _c, _d = _a.format, format = _d === void 0 ? "24h" : _d, minuteStep = _a.minuteStep, formatTime = _a.formatTime, timeWheelPickerProps = _a.timeWheelPickerProps, popoverContentProps = _a.popoverContentProps, iconClassName = _a.iconClassName, onOpenChange = _a.onOpenChange, onFieldFocus = _a.onFieldFocus, onFieldBlur = _a.onFieldBlur, className = _a.className, fieldClassName = _a.fieldClassName, formFieldProps = __rest(_a, ["value", "defaultValue", "onValueChange", "placeholder", "format", "minuteStep", "formatTime", "timeWheelPickerProps", "popoverContentProps", "iconClassName", "onOpenChange", "onFieldFocus", "onFieldBlur", "className", "fieldClassName"]);
56
+ var _e = useControllableState({
56
57
  value: value,
57
58
  defaultValue: defaultValue,
58
59
  onChange: onValueChange,
59
- }), selectedTime = _d[0], setSelectedTime = _d[1];
60
+ }), selectedTime = _e[0], setSelectedTime = _e[1];
60
61
  var popoverRef = React.useRef(null);
61
62
  var formatter = React.useMemo(function () { return formatTime !== null && formatTime !== void 0 ? formatTime : buildDefaultFormatter(format); }, [format, formatTime]);
62
63
  var displayValue = React.useMemo(function () { return formatter(selectedTime); }, [formatter, selectedTime]);
63
64
  var dimensions = useWindowDimensions();
64
65
  var isSmallerScreen = dimensions.width < 640;
65
- return (_jsx(FormField, __assign({}, formFieldProps, { className: className, fieldClassName: cn("h-16", fieldClassName), value: displayValue, placeholder: placeholder, onFocus: onFieldFocus, onBlur: onFieldBlur, children: function (_a) {
66
- var _b;
67
- var inputProps = _a.inputProps, isFocused = _a.isFocused, hasError = _a.hasError, hasSuccess = _a.hasSuccess;
68
- var handleOpenChange = function (nextOpen) {
69
- if (formFieldProps.disabled)
70
- return;
71
- if (nextOpen) {
72
- inputProps.onFocus();
73
- }
74
- else {
75
- inputProps.onBlur();
76
- }
77
- onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(nextOpen);
78
- };
79
- var handleTimeChange = function (next) {
80
- setSelectedTime(next);
81
- };
82
- var textToShow = displayValue || placeholder;
83
- var resolvedPopoverContentClassName = cn("border-none bg-transparent p-0 shadow-none", popoverContentProps === null || popoverContentProps === void 0 ? void 0 : popoverContentProps.className);
84
- return (_jsxs(_Fragment, { children: [_jsx(Popover, { onOpenChange: handleOpenChange, content: _jsx(TimeWheelPicker, __assign({ value: selectedTime, onValueChange: handleTimeChange, format: format, minuteStep: minuteStep }, timeWheelPickerProps, { className: cn("bg-card border border-border rounded-xl p-4", timeWheelPickerProps === null || timeWheelPickerProps === void 0 ? void 0 : timeWheelPickerProps.className), overlayBgColorClassName: "bg-card/70" })), contentProps: __assign(__assign({}, popoverContentProps), { className: resolvedPopoverContentClassName, sideOffset: (_b = popoverContentProps === null || popoverContentProps === void 0 ? void 0 : popoverContentProps.sideOffset) !== null && _b !== void 0 ? _b : 8 }), triggerRef: popoverRef, type: isSmallerScreen ? "floating-sheet" : "popover" }), _jsxs(Pressable, { className: "flex-row items-center justify-between gap-2 py-1.5", disabled: formFieldProps.disabled, accessibilityState: {
66
+ var resolvedPopoverContentClassName = cn("border-none bg-transparent p-0 shadow-none", popoverContentProps === null || popoverContentProps === void 0 ? void 0 : popoverContentProps.className);
67
+ var handleOpenChange = function (nextOpen) {
68
+ if (formFieldProps.disabled)
69
+ return;
70
+ // if (nextOpen) {
71
+ // inputProps.onFocus();
72
+ // } else {
73
+ // inputProps.onBlur();
74
+ // }
75
+ onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(nextOpen);
76
+ };
77
+ var handleTimeChange = function (next) {
78
+ setSelectedTime(next);
79
+ };
80
+ return (_jsx(Popover, { onOpenChange: handleOpenChange, content: _jsx(TimeWheelPicker, __assign({ value: selectedTime, onValueChange: handleTimeChange, format: format, minuteStep: minuteStep }, timeWheelPickerProps, { className: cn("bg-card border border-border rounded-xl p-4", timeWheelPickerProps === null || timeWheelPickerProps === void 0 ? void 0 : timeWheelPickerProps.className), overlayBgColorClassName: "bg-card/70" })), contentProps: __assign(__assign({}, popoverContentProps), { className: resolvedPopoverContentClassName, sideOffset: (_b = popoverContentProps === null || popoverContentProps === void 0 ? void 0 : popoverContentProps.sideOffset) !== null && _b !== void 0 ? _b : 8 }), triggerRef: popoverRef, type: isSmallerScreen ? "floating-sheet" : "popover", children: _jsx(FormField, __assign({}, formFieldProps, { className: className, fieldClassName: cn("h-16", fieldClassName), value: displayValue, placeholder: placeholder, onFocus: onFieldFocus, onBlur: onFieldBlur, onPress: function () {
81
+ var _a;
82
+ (_a = popoverRef === null || popoverRef === void 0 ? void 0 : popoverRef.current) === null || _a === void 0 ? void 0 : _a.open();
83
+ }, children: function (_a) {
84
+ var inputProps = _a.inputProps, isFocused = _a.isFocused, hasError = _a.hasError, hasSuccess = _a.hasSuccess;
85
+ var textToShow = displayValue || placeholder;
86
+ return (_jsx(_Fragment, { children: _jsxs(Pressable, { className: "flex-row items-center justify-between gap-2 py-1.5", disabled: formFieldProps.disabled, accessibilityState: {
85
87
  disabled: formFieldProps.disabled,
86
- }, onPress: function () { var _a; return (_a = popoverRef.current) === null || _a === void 0 ? void 0 : _a.open(); }, children: [_jsx(View, { className: "flex-1", children: _jsx(Text, { className: cn("text-base", displayValue ? "text-foreground" : "text-muted-foreground"), numberOfLines: 1, ellipsizeMode: "tail", children: textToShow }) }), _jsx(Icon, { as: Clock3, className: cn("size-5 text-muted-foreground", isFocused && !hasError && !hasSuccess && "text-foreground", hasError && "text-destructive", hasSuccess && "text-primary", iconClassName) })] })] }));
87
- } })));
88
+ }, onPress: function () { var _a; return (_a = popoverRef.current) === null || _a === void 0 ? void 0 : _a.open(); }, children: [_jsx(View, { className: "flex-1", children: _jsx(Text, { className: cn("text-base", displayValue ? "text-foreground" : "text-muted-foreground"), numberOfLines: 1, ellipsizeMode: "tail", children: textToShow }) }), _jsx(Icon, { as: Clock3, className: cn("size-5 text-muted-foreground", isFocused && !hasError && !hasSuccess && "text-foreground", hasError && "text-destructive", hasSuccess && "text-primary", iconClassName) })] }) }));
89
+ } })) }));
88
90
  }
89
91
  TimePicker.displayName = "TimePicker";
90
92
  export { TimePicker };
@@ -3,5 +3,5 @@ import { Toaster } from "../../$/components/ui/toast";
3
3
  import { PortalHost } from "@rn-primitives/portal";
4
4
  export function Provider(_a) {
5
5
  var children = _a.children;
6
- return (_jsxs(_Fragment, { children: [children, _jsx(PortalHost, {}), _jsx(Toaster, {})] }));
6
+ return (_jsxs(_Fragment, { children: [_jsx(PortalHost, {}), children, _jsx(Toaster, {})] }));
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blimpui",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -54,16 +54,16 @@
54
54
  "tailwind-merge": "^3.3.1"
55
55
  },
56
56
  "devDependencies": {
57
- "tsc-alias": "^1.8.10",
58
- "typescript": "^5.7.3",
59
- "react": "19.1.0",
57
+ "@legendapp/list": "^2.0.18",
60
58
  "@types/react": "~19.1.10",
59
+ "expo-haptics": "^15.0.8",
60
+ "react": "19.1.0",
61
61
  "react-native": "0.81.5",
62
62
  "react-native-reanimated": "~4.1.1",
63
63
  "react-native-screens": "~4.16.0",
64
- "expo-haptics": "^15.0.8",
65
- "@legendapp/list": "^2.0.18",
66
- "uniwind": "^1.2.2",
67
- "tailwindcss": "^4.1.17"
64
+ "tailwindcss": "^4.1.17",
65
+ "tsc-alias": "^1.8.10",
66
+ "typescript": "^5.7.3",
67
+ "uniwind": "^1.2.2"
68
68
  }
69
69
  }