@streamplace/components 0.7.0 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/chat/chat-box.js +46 -43
- package/dist/components/chat/chat-message.js +36 -33
- package/dist/components/chat/chat.js +31 -27
- package/dist/components/chat/mention-suggestions.js +16 -13
- package/dist/components/chat/mod-view.js +20 -17
- package/dist/components/mobile-player/fullscreen.js +21 -17
- package/dist/components/mobile-player/fullscreen.native.js +39 -35
- package/dist/components/mobile-player/player.js +38 -32
- package/dist/components/mobile-player/props.js +2 -1
- package/dist/components/mobile-player/shared.js +16 -13
- package/dist/components/mobile-player/ui/countdown.js +23 -19
- package/dist/components/mobile-player/ui/index.js +9 -5
- package/dist/components/mobile-player/ui/input.js +16 -12
- package/dist/components/mobile-player/ui/metrics.js +20 -16
- package/dist/components/mobile-player/ui/streamer-context-menu.js +6 -3
- package/dist/components/mobile-player/ui/viewer-context-menu.js +19 -16
- package/dist/components/mobile-player/ui/viewers.js +23 -0
- package/dist/components/mobile-player/use-webrtc.js +29 -24
- package/dist/components/mobile-player/video.js +109 -99
- package/dist/components/mobile-player/video.native.js +108 -84
- package/dist/components/mobile-player/webrtc-diagnostics.js +9 -5
- package/dist/components/mobile-player/webrtc-primitives.js +8 -6
- package/dist/components/mobile-player/webrtc-primitives.native.js +8 -1
- package/dist/components/ui/button.js +26 -23
- package/dist/components/ui/dialog.js +43 -40
- package/dist/components/ui/dropdown.js +121 -116
- package/dist/components/ui/icons.js +8 -5
- package/dist/components/ui/index.js +27 -19
- package/dist/components/ui/input.js +31 -28
- package/dist/components/ui/loader.js +9 -6
- package/dist/components/ui/primitives/button.js +33 -29
- package/dist/components/ui/primitives/input.js +44 -40
- package/dist/components/ui/primitives/modal.js +45 -41
- package/dist/components/ui/primitives/text.js +35 -29
- package/dist/components/ui/resizeable.js +54 -43
- package/dist/components/ui/text.js +50 -48
- package/dist/components/ui/textarea.js +13 -11
- package/dist/components/ui/toast.js +26 -23
- package/dist/components/ui/view.js +41 -39
- package/dist/hooks/index.js +12 -8
- package/dist/hooks/useAvatars.js +11 -8
- package/dist/hooks/useCameraToggle.js +7 -4
- package/dist/hooks/useKeyboard.js +13 -10
- package/dist/hooks/useKeyboardSlide.js +8 -5
- package/dist/hooks/useLivestreamInfo.js +17 -14
- package/dist/hooks/useOuterAndInnerDimensions.js +9 -6
- package/dist/hooks/usePlayerDimensions.js +9 -6
- package/dist/hooks/useSegmentDimensions.js +17 -0
- package/dist/hooks/useSegmentTiming.js +13 -10
- package/dist/index.js +24 -15
- package/dist/lib/facet.js +5 -1
- package/dist/lib/theme/atoms.js +153 -148
- package/dist/lib/theme/atoms.types.js +2 -1
- package/dist/lib/theme/index.js +31 -5
- package/dist/lib/theme/theme.js +91 -83
- package/dist/lib/theme/tokens.js +15 -12
- package/dist/lib/utils.js +22 -11
- package/dist/livestream-provider/index.js +19 -14
- package/dist/livestream-provider/websocket.js +14 -10
- package/dist/livestream-store/chat.js +26 -19
- package/dist/livestream-store/context.js +5 -2
- package/dist/livestream-store/index.js +7 -4
- package/dist/livestream-store/livestream-state.js +2 -1
- package/dist/livestream-store/livestream-store.js +31 -18
- package/dist/livestream-store/stream-key.js +22 -18
- package/dist/livestream-store/websocket-consumer.js +18 -14
- package/dist/player-store/context.js +5 -2
- package/dist/player-store/index.js +8 -5
- package/dist/player-store/player-provider.js +20 -15
- package/dist/player-store/player-state.js +9 -6
- package/dist/player-store/player-store.js +32 -21
- package/dist/player-store/single-player-provider.js +35 -23
- package/dist/streamplace-provider/context.js +5 -2
- package/dist/streamplace-provider/index.js +14 -10
- package/dist/streamplace-provider/poller.js +20 -17
- package/dist/streamplace-store/block.js +6 -3
- package/dist/streamplace-store/index.js +6 -3
- package/dist/streamplace-store/stream.js +14 -10
- package/dist/streamplace-store/streamplace-store.js +23 -13
- package/dist/streamplace-store/user.js +19 -14
- package/dist/streamplace-store/xrpc.js +10 -7
- package/node-compile-cache/v22.15.0-x64-92db9086-0/37be0eec +0 -0
- package/node-compile-cache/v22.15.0-x64-92db9086-0/56540125 +0 -0
- package/node-compile-cache/{v22.15.0-x64-efe9a9df-0 → v22.15.0-x64-92db9086-0}/67b1eb60 +0 -0
- package/node-compile-cache/{v22.15.0-x64-efe9a9df-0 → v22.15.0-x64-92db9086-0}/7c275f90 +0 -0
- package/package.json +6 -7
- package/src/components/mobile-player/ui/index.ts +1 -0
- package/src/components/mobile-player/ui/viewer-context-menu.tsx +5 -4
- package/src/components/mobile-player/ui/viewers.tsx +32 -0
- package/src/components/mobile-player/video.native.tsx +50 -5
- package/src/components/ui/resizeable.tsx +15 -3
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useSegmentDimensions.tsx +18 -0
- package/tsconfig.json +2 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/node-compile-cache/v22.15.0-x64-efe9a9df-0/37be0eec +0 -0
- package/node-compile-cache/v22.15.0-x64-efe9a9df-0/56540125 +0 -0
|
@@ -1,148 +1,153 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DropdownMenuInfo = exports.DropdownMenuGroup = exports.DropdownMenuSeparator = exports.DropdownMenuLabel = exports.DropdownMenuRadioItem = exports.DropdownMenuCheckboxItem = exports.DropdownMenuItem = exports.ResponsiveDropdownMenuContent = exports.DropdownMenuContent = exports.DropdownMenuSubContent = exports.DropdownMenuSubTrigger = exports.DropdownMenuBottomSheet = exports.DropdownMenuRadioGroup = exports.DropdownMenuSub = exports.DropdownMenuPortal = exports.DropdownMenuTrigger = exports.DropdownMenu = void 0;
|
|
4
|
+
exports.DropdownMenuShortcut = DropdownMenuShortcut;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const bottom_sheet_1 = tslib_1.__importStar(require("@gorhom/bottom-sheet"));
|
|
8
|
+
const DropdownMenuPrimitive = tslib_1.__importStar(require("@rn-primitives/dropdown-menu"));
|
|
9
|
+
const lucide_react_native_1 = require("lucide-react-native");
|
|
10
|
+
const react_1 = require("react");
|
|
11
|
+
const react_native_1 = require("react-native");
|
|
12
|
+
const atoms_1 = require("../../lib/theme/atoms");
|
|
13
|
+
const text_1 = require("./primitives/text");
|
|
14
|
+
exports.DropdownMenu = DropdownMenuPrimitive.Root;
|
|
15
|
+
exports.DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
16
|
+
exports.DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
17
|
+
exports.DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
18
|
+
exports.DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
19
|
+
exports.DropdownMenuBottomSheet = (0, react_1.forwardRef)(function DropdownMenuBottomSheet({ overlayStyle, portalHost, children }, _ref) {
|
|
15
20
|
// Use the primitives' context to know if open
|
|
16
21
|
const { open, onOpenChange } = DropdownMenuPrimitive.useRootContext();
|
|
17
|
-
const snapPoints = useMemo(() => ["25%", "50%", "80%"], []);
|
|
18
|
-
const sheetRef = useRef(null);
|
|
19
|
-
return (
|
|
22
|
+
const snapPoints = (0, react_1.useMemo)(() => ["25%", "50%", "80%"], []);
|
|
23
|
+
const sheetRef = (0, react_1.useRef)(null);
|
|
24
|
+
return ((0, jsx_runtime_1.jsx)(DropdownMenuPrimitive.Portal, { hostName: portalHost, children: (0, jsx_runtime_1.jsx)(bottom_sheet_1.default, { ref: sheetRef,
|
|
20
25
|
// why the heck is this 1-indexed
|
|
21
|
-
index: open ? 3 : -1, snapPoints: snapPoints, enablePanDownToClose: true, onClose: () => onOpenChange?.(false), style: [overlayStyle], backgroundStyle: [bg.black, a.radius.all.md, a.shadows.md, p[1]], handleIndicatorStyle: [
|
|
22
|
-
a.sizes.width[12],
|
|
23
|
-
a.sizes.height[1],
|
|
24
|
-
bg.gray[500],
|
|
25
|
-
], children:
|
|
26
|
+
index: open ? 3 : -1, snapPoints: snapPoints, enablePanDownToClose: true, onClose: () => onOpenChange?.(false), style: [overlayStyle], backgroundStyle: [atoms_1.bg.black, atoms_1.a.radius.all.md, atoms_1.a.shadows.md, atoms_1.p[1]], handleIndicatorStyle: [
|
|
27
|
+
atoms_1.a.sizes.width[12],
|
|
28
|
+
atoms_1.a.sizes.height[1],
|
|
29
|
+
atoms_1.bg.gray[500],
|
|
30
|
+
], children: (0, jsx_runtime_1.jsx)(bottom_sheet_1.BottomSheetView, { style: [atoms_1.px[2]], children: typeof children === "function"
|
|
26
31
|
? children({ pressed: true })
|
|
27
32
|
: children }) }) }));
|
|
28
33
|
});
|
|
29
|
-
|
|
34
|
+
exports.DropdownMenuSubTrigger = (0, react_1.forwardRef)(({ inset, children, ...props }, ref) => {
|
|
30
35
|
const { open } = DropdownMenuPrimitive.useSubContext();
|
|
31
|
-
const Icon = Platform.OS === "web" ? ChevronRight : open ? ChevronUp : ChevronDown;
|
|
32
|
-
return (
|
|
33
|
-
a.textColors.primary[500],
|
|
34
|
-
a.fontSize.base,
|
|
35
|
-
open && a.textColors.primary[700],
|
|
36
|
-
]), children:
|
|
37
|
-
inset && gap[2],
|
|
38
|
-
layout.flex.row,
|
|
39
|
-
layout.flex.alignCenter,
|
|
40
|
-
p[2],
|
|
41
|
-
pr[8],
|
|
42
|
-
], children: [children,
|
|
36
|
+
const Icon = react_native_1.Platform.OS === "web" ? lucide_react_native_1.ChevronRight : open ? lucide_react_native_1.ChevronUp : lucide_react_native_1.ChevronDown;
|
|
37
|
+
return ((0, jsx_runtime_1.jsx)(text_1.TextContext.Provider, { value: (0, text_1.objectFromObjects)([
|
|
38
|
+
atoms_1.a.textColors.primary[500],
|
|
39
|
+
atoms_1.a.fontSize.base,
|
|
40
|
+
open && atoms_1.a.textColors.primary[700],
|
|
41
|
+
]), children: (0, jsx_runtime_1.jsx)(DropdownMenuPrimitive.SubTrigger, { ref: ref, ...props, children: (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [
|
|
42
|
+
inset && atoms_1.gap[2],
|
|
43
|
+
atoms_1.layout.flex.row,
|
|
44
|
+
atoms_1.layout.flex.alignCenter,
|
|
45
|
+
atoms_1.p[2],
|
|
46
|
+
atoms_1.pr[8],
|
|
47
|
+
], children: [children, (0, jsx_runtime_1.jsx)(react_native_1.View, { style: [atoms_1.a.layout.position.absolute, atoms_1.a.position.right[1]], children: (0, jsx_runtime_1.jsx)(Icon, { size: 18, color: atoms_1.colors.gray[200] }) })] }) }) }));
|
|
43
48
|
});
|
|
44
|
-
|
|
45
|
-
return (
|
|
46
|
-
a.zIndex[50],
|
|
47
|
-
a.sizes.minWidth[32],
|
|
48
|
-
a.overflow.hidden,
|
|
49
|
-
a.radius.all.md,
|
|
50
|
-
a.borders.width.thin,
|
|
51
|
-
a.borders.color.gray[600],
|
|
52
|
-
mt[1],
|
|
53
|
-
bg.black,
|
|
54
|
-
p[1],
|
|
55
|
-
a.shadows.md,
|
|
49
|
+
exports.DropdownMenuSubContent = (0, react_1.forwardRef)((props, ref) => {
|
|
50
|
+
return ((0, jsx_runtime_1.jsx)(DropdownMenuPrimitive.SubContent, { ref: ref, style: [
|
|
51
|
+
atoms_1.a.zIndex[50],
|
|
52
|
+
atoms_1.a.sizes.minWidth[32],
|
|
53
|
+
atoms_1.a.overflow.hidden,
|
|
54
|
+
atoms_1.a.radius.all.md,
|
|
55
|
+
atoms_1.a.borders.width.thin,
|
|
56
|
+
atoms_1.a.borders.color.gray[600],
|
|
57
|
+
atoms_1.mt[1],
|
|
58
|
+
atoms_1.bg.black,
|
|
59
|
+
atoms_1.p[1],
|
|
60
|
+
atoms_1.a.shadows.md,
|
|
56
61
|
], ...props }));
|
|
57
62
|
});
|
|
58
|
-
|
|
59
|
-
return (
|
|
60
|
-
Platform.OS !== "web" ? StyleSheet.absoluteFill : undefined,
|
|
63
|
+
exports.DropdownMenuContent = (0, react_1.forwardRef)(({ overlayStyle, portalHost, ...props }, ref) => {
|
|
64
|
+
return ((0, jsx_runtime_1.jsx)(DropdownMenuPrimitive.Portal, { hostName: portalHost, children: (0, jsx_runtime_1.jsx)(DropdownMenuPrimitive.Overlay, { style: [
|
|
65
|
+
react_native_1.Platform.OS !== "web" ? react_native_1.StyleSheet.absoluteFill : undefined,
|
|
61
66
|
overlayStyle,
|
|
62
|
-
], children:
|
|
63
|
-
a.zIndex[50],
|
|
64
|
-
a.sizes.minWidth[32],
|
|
65
|
-
a.sizes.maxWidth[64],
|
|
66
|
-
a.overflow.hidden,
|
|
67
|
-
a.radius.all.md,
|
|
68
|
-
a.borders.width.thin,
|
|
69
|
-
a.borders.color.gray[800],
|
|
70
|
-
bg.gray[950],
|
|
71
|
-
p[2],
|
|
72
|
-
a.shadows.md,
|
|
67
|
+
], children: (0, jsx_runtime_1.jsx)(DropdownMenuPrimitive.Content, { ref: ref, style: [
|
|
68
|
+
atoms_1.a.zIndex[50],
|
|
69
|
+
atoms_1.a.sizes.minWidth[32],
|
|
70
|
+
atoms_1.a.sizes.maxWidth[64],
|
|
71
|
+
atoms_1.a.overflow.hidden,
|
|
72
|
+
atoms_1.a.radius.all.md,
|
|
73
|
+
atoms_1.a.borders.width.thin,
|
|
74
|
+
atoms_1.a.borders.color.gray[800],
|
|
75
|
+
atoms_1.bg.gray[950],
|
|
76
|
+
atoms_1.p[2],
|
|
77
|
+
atoms_1.a.shadows.md,
|
|
73
78
|
], ...props }) }) }));
|
|
74
79
|
});
|
|
75
|
-
|
|
76
|
-
const { width } = useWindowDimensions();
|
|
80
|
+
exports.ResponsiveDropdownMenuContent = (0, react_1.forwardRef)(({ children, ...props }, ref) => {
|
|
81
|
+
const { width } = (0, react_native_1.useWindowDimensions)();
|
|
77
82
|
// On web, you might want to always use the normal dropdown
|
|
78
|
-
const isBottomSheet = Platform.OS !== "web" && width < 800;
|
|
83
|
+
const isBottomSheet = react_native_1.Platform.OS !== "web" && width < 800;
|
|
79
84
|
if (isBottomSheet) {
|
|
80
|
-
return (
|
|
85
|
+
return ((0, jsx_runtime_1.jsx)(exports.DropdownMenuBottomSheet, { ref: ref, ...props, children: children }));
|
|
81
86
|
}
|
|
82
|
-
return (
|
|
87
|
+
return ((0, jsx_runtime_1.jsx)(exports.DropdownMenuContent, { ref: ref, ...props, children: children }));
|
|
83
88
|
});
|
|
84
|
-
|
|
85
|
-
return (
|
|
86
|
-
a.layout.flex.row,
|
|
87
|
-
a.layout.flex.alignCenter,
|
|
88
|
-
a.radius.all.sm,
|
|
89
|
-
py[1],
|
|
90
|
-
pl[2],
|
|
91
|
-
pr[2],
|
|
89
|
+
exports.DropdownMenuItem = (0, react_1.forwardRef)(({ inset, disabled, style, children, ...props }, ref) => {
|
|
90
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.Pressable, { ...props, children: (0, jsx_runtime_1.jsx)(text_1.TextContext.Provider, { value: (0, text_1.objectFromObjects)([atoms_1.a.textColors.gray[900], atoms_1.a.fontSize.base]), children: (0, jsx_runtime_1.jsx)(react_native_1.View, { style: [
|
|
91
|
+
atoms_1.a.layout.flex.row,
|
|
92
|
+
atoms_1.a.layout.flex.alignCenter,
|
|
93
|
+
atoms_1.a.radius.all.sm,
|
|
94
|
+
atoms_1.py[1],
|
|
95
|
+
atoms_1.pl[2],
|
|
96
|
+
atoms_1.pr[2],
|
|
92
97
|
], children: typeof children === "function"
|
|
93
98
|
? children({ pressed: true })
|
|
94
99
|
: children }) }) }));
|
|
95
100
|
});
|
|
96
|
-
|
|
97
|
-
return (
|
|
98
|
-
a.layout.flex.row,
|
|
99
|
-
a.layout.flex.alignCenter,
|
|
100
|
-
a.radius.all.sm,
|
|
101
|
-
py[1],
|
|
102
|
-
pl[2],
|
|
103
|
-
pr[2],
|
|
104
|
-
pr[8],
|
|
105
|
-
], children: [children,
|
|
101
|
+
exports.DropdownMenuCheckboxItem = (0, react_1.forwardRef)(({ children, checked, ...props }, ref) => {
|
|
102
|
+
return ((0, jsx_runtime_1.jsx)(DropdownMenuPrimitive.CheckboxItem, { ref: ref, checked: checked, closeOnPress: props.closeOnPress || false, ...props, children: (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [
|
|
103
|
+
atoms_1.a.layout.flex.row,
|
|
104
|
+
atoms_1.a.layout.flex.alignCenter,
|
|
105
|
+
atoms_1.a.radius.all.sm,
|
|
106
|
+
atoms_1.py[1],
|
|
107
|
+
atoms_1.pl[2],
|
|
108
|
+
atoms_1.pr[2],
|
|
109
|
+
atoms_1.pr[8],
|
|
110
|
+
], children: [children, (0, jsx_runtime_1.jsx)(react_native_1.View, { style: [atoms_1.pl[1], atoms_1.layout.position.absolute, atoms_1.right[1]], children: checked ? ((0, jsx_runtime_1.jsx)(lucide_react_native_1.CheckCircle, { size: 14, strokeWidth: 3, color: "white" })) : ((0, jsx_runtime_1.jsx)(lucide_react_native_1.Circle, { size: 14, strokeWidth: 3, color: atoms_1.a.colors.gray[400] })) })] }) }));
|
|
106
111
|
});
|
|
107
|
-
|
|
108
|
-
return (
|
|
109
|
-
a.layout.flex.row,
|
|
110
|
-
a.layout.flex.alignCenter,
|
|
111
|
-
a.radius.all.sm,
|
|
112
|
-
py[1],
|
|
113
|
-
pl[2],
|
|
114
|
-
pr[1],
|
|
115
|
-
], children: [
|
|
112
|
+
exports.DropdownMenuRadioItem = (0, react_1.forwardRef)(({ children, ...props }, ref) => {
|
|
113
|
+
return ((0, jsx_runtime_1.jsx)(DropdownMenuPrimitive.RadioItem, { ref: ref, closeOnPress: props.closeOnPress || false, ...props, children: (0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [
|
|
114
|
+
atoms_1.a.layout.flex.row,
|
|
115
|
+
atoms_1.a.layout.flex.alignCenter,
|
|
116
|
+
atoms_1.a.radius.all.sm,
|
|
117
|
+
atoms_1.py[1],
|
|
118
|
+
atoms_1.pl[2],
|
|
119
|
+
atoms_1.pr[1],
|
|
120
|
+
], children: [(0, jsx_runtime_1.jsx)(react_native_1.View, { style: [atoms_1.pl[1], atoms_1.layout.position.absolute, atoms_1.right[1]], children: (0, jsx_runtime_1.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: (0, jsx_runtime_1.jsx)(lucide_react_native_1.Check, { size: 14, strokeWidth: 3, color: "white" }) }) }), children] }) }));
|
|
116
121
|
});
|
|
117
|
-
|
|
118
|
-
return (
|
|
119
|
-
px[2],
|
|
120
|
-
py[2],
|
|
121
|
-
a.textColors.gray[200],
|
|
122
|
-
a.fontSize.base,
|
|
123
|
-
inset && gap[2],
|
|
122
|
+
exports.DropdownMenuLabel = (0, react_1.forwardRef)(({ inset, ...props }, ref) => {
|
|
123
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.Text, { ref: ref, style: [
|
|
124
|
+
atoms_1.px[2],
|
|
125
|
+
atoms_1.py[2],
|
|
126
|
+
atoms_1.a.textColors.gray[200],
|
|
127
|
+
atoms_1.a.fontSize.base,
|
|
128
|
+
inset && atoms_1.gap[2],
|
|
124
129
|
], ...props }));
|
|
125
130
|
});
|
|
126
|
-
|
|
127
|
-
return (
|
|
131
|
+
exports.DropdownMenuSeparator = (0, react_1.forwardRef)((props, ref) => {
|
|
132
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.View, { ref: ref, style: [atoms_1.mx[2], atoms_1.h[0.5] || { height: 0.5 }, atoms_1.bg.gray[800]], ...props }));
|
|
128
133
|
});
|
|
129
|
-
|
|
130
|
-
return (
|
|
131
|
-
ml.auto,
|
|
132
|
-
a.textColors.gray[500],
|
|
133
|
-
a.fontSize.sm,
|
|
134
|
-
a.letterSpacing.widest,
|
|
134
|
+
function DropdownMenuShortcut(props) {
|
|
135
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [
|
|
136
|
+
atoms_1.ml.auto,
|
|
137
|
+
atoms_1.a.textColors.gray[500],
|
|
138
|
+
atoms_1.a.fontSize.sm,
|
|
139
|
+
atoms_1.a.letterSpacing.widest,
|
|
135
140
|
], ...props }));
|
|
136
141
|
}
|
|
137
|
-
|
|
142
|
+
exports.DropdownMenuGroup = (0, react_1.forwardRef)((props, ref) => {
|
|
138
143
|
const { inset, title, children, ...rest } = props;
|
|
139
|
-
return (
|
|
140
|
-
bg.gray[900],
|
|
141
|
-
Platform.OS === "web" ? px[2] : p[2],
|
|
142
|
-
gap[2],
|
|
143
|
-
{ borderRadius: borderRadius.lg, gap: 10 },
|
|
144
|
+
return ((0, jsx_runtime_1.jsxs)(react_native_1.View, { style: [atoms_1.pt[2], inset ? atoms_1.gap[2] : atoms_1.gap[1]], ref: ref, ...rest, children: [title && ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [atoms_1.textColors.gray[400], atoms_1.pb[1], atoms_1.pl[2]], children: title })), (0, jsx_runtime_1.jsx)(react_native_1.View, { style: [
|
|
145
|
+
atoms_1.bg.gray[900],
|
|
146
|
+
react_native_1.Platform.OS === "web" ? atoms_1.px[2] : atoms_1.p[2],
|
|
147
|
+
atoms_1.gap[2],
|
|
148
|
+
{ borderRadius: atoms_1.borderRadius.lg, gap: 10 },
|
|
144
149
|
], children: children })] }));
|
|
145
150
|
});
|
|
146
|
-
|
|
147
|
-
return (
|
|
151
|
+
exports.DropdownMenuInfo = (0, react_1.forwardRef)(({ description, ...props }, ref) => {
|
|
152
|
+
return ((0, jsx_runtime_1.jsx)(react_native_1.Text, { style: [atoms_1.textColors.gray[400], atoms_1.pt[1], atoms_1.pl[2], atoms_1.pb[2], atoms_1.fontSize.sm], children: description }));
|
|
148
153
|
});
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createThemedIcon = createThemedIcon;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const theme_1 = require("../../lib/theme");
|
|
3
6
|
// Size mapping
|
|
4
7
|
const sizeMap = {
|
|
5
8
|
sm: 16,
|
|
@@ -8,15 +11,15 @@ const sizeMap = {
|
|
|
8
11
|
xl: 32,
|
|
9
12
|
};
|
|
10
13
|
// HOC to create themed icons
|
|
11
|
-
|
|
14
|
+
function createThemedIcon(IconComponent) {
|
|
12
15
|
return ({ variant = "default", size = "md", color, ...restProps }) => {
|
|
13
|
-
let theme = useTheme(); // Ensure theme is available
|
|
16
|
+
let theme = (0, theme_1.useTheme)(); // Ensure theme is available
|
|
14
17
|
// Calculate size
|
|
15
18
|
const iconSize = typeof size === "number" ? size : sizeMap[size];
|
|
16
19
|
// Calculate color if not provided using atoms
|
|
17
20
|
const iconColor = color ||
|
|
18
21
|
theme.theme.colors[variant] ||
|
|
19
22
|
theme.theme.colors.secondaryForeground;
|
|
20
|
-
return (
|
|
23
|
+
return ((0, jsx_runtime_1.jsx)(IconComponent, { size: iconSize, color: iconColor, ...restProps }));
|
|
21
24
|
};
|
|
22
25
|
}
|
|
@@ -1,22 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TextPrimitive = exports.ModalPrimitive = exports.InputPrimitive = exports.ButtonPrimitive = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
1
5
|
// Export primitive components
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
tslib_1.__exportStar(require("./primitives/button"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./primitives/input"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./primitives/modal"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./primitives/text"), exports);
|
|
6
10
|
// Export styled components
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
tslib_1.__exportStar(require("./button"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./dialog"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./dropdown"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./icons"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./input"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./loader"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("./resizeable"), exports);
|
|
18
|
+
tslib_1.__exportStar(require("./text"), exports);
|
|
19
|
+
tslib_1.__exportStar(require("./toast"), exports);
|
|
20
|
+
tslib_1.__exportStar(require("./view"), exports);
|
|
17
21
|
// Component collections for easy importing
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
var button_1 = require("./primitives/button");
|
|
23
|
+
Object.defineProperty(exports, "ButtonPrimitive", { enumerable: true, get: function () { return button_1.ButtonPrimitive; } });
|
|
24
|
+
var input_1 = require("./primitives/input");
|
|
25
|
+
Object.defineProperty(exports, "InputPrimitive", { enumerable: true, get: function () { return input_1.InputPrimitive; } });
|
|
26
|
+
var modal_1 = require("./primitives/modal");
|
|
27
|
+
Object.defineProperty(exports, "ModalPrimitive", { enumerable: true, get: function () { return modal_1.ModalPrimitive; } });
|
|
28
|
+
var text_1 = require("./primitives/text");
|
|
29
|
+
Object.defineProperty(exports, "TextPrimitive", { enumerable: true, get: function () { return text_1.TextPrimitive; } });
|
|
30
|
+
tslib_1.__exportStar(require("../../lib/theme"), exports);
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.inputVariants = exports.Input = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const class_variance_authority_1 = require("class-variance-authority");
|
|
7
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
8
|
+
const react_native_1 = require("react-native");
|
|
9
|
+
const theme_1 = require("../../lib/theme/theme");
|
|
10
|
+
const input_1 = require("./primitives/input");
|
|
11
|
+
const inputVariants = (0, class_variance_authority_1.cva)("", {
|
|
8
12
|
variants: {
|
|
9
13
|
variant: {
|
|
10
14
|
default: "default",
|
|
@@ -22,44 +26,45 @@ const inputVariants = cva("", {
|
|
|
22
26
|
size: "md",
|
|
23
27
|
},
|
|
24
28
|
});
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
+
exports.inputVariants = inputVariants;
|
|
30
|
+
exports.Input = (0, react_1.forwardRef)(({ variant = "default", size = "md", label, description, error, required = false, leftAddon, rightAddon, disabled = false, containerStyle, inputStyle, ...props }, ref) => {
|
|
31
|
+
const { theme } = (0, theme_1.useTheme)();
|
|
32
|
+
const [isFocused, setIsFocused] = react_1.default.useState(false);
|
|
33
|
+
const inputRef = react_1.default.useRef(null);
|
|
29
34
|
// Create dynamic styles based on theme
|
|
30
|
-
const styles =
|
|
35
|
+
const styles = react_1.default.useMemo(() => createStyles(theme), [theme]);
|
|
31
36
|
// Get variant and size styles
|
|
32
|
-
const containerStyles =
|
|
37
|
+
const containerStyles = react_1.default.useMemo(() => {
|
|
33
38
|
const variantStyle = styles[`${variant}Container`];
|
|
34
39
|
const sizeStyle = styles[`${size}Container`];
|
|
35
40
|
const focusStyle = isFocused ? styles.focusedContainer : null;
|
|
36
41
|
return [variantStyle, sizeStyle, focusStyle];
|
|
37
42
|
}, [variant, size, styles, isFocused]);
|
|
38
|
-
const textStyles =
|
|
43
|
+
const textStyles = react_1.default.useMemo(() => {
|
|
39
44
|
const variantTextStyle = styles[`${variant}Input`];
|
|
40
45
|
const sizeTextStyle = styles[`${size}Input`];
|
|
41
46
|
return [variantTextStyle, sizeTextStyle];
|
|
42
47
|
}, [variant, size, styles]);
|
|
43
|
-
const handleFocus =
|
|
48
|
+
const handleFocus = react_1.default.useCallback((event) => {
|
|
44
49
|
setIsFocused(true);
|
|
45
50
|
if (props.onFocus) {
|
|
46
51
|
props.onFocus(event);
|
|
47
52
|
}
|
|
48
53
|
}, [props.onFocus]);
|
|
49
|
-
const handleBlur =
|
|
54
|
+
const handleBlur = react_1.default.useCallback((event) => {
|
|
50
55
|
setIsFocused(false);
|
|
51
56
|
if (props.onBlur) {
|
|
52
57
|
props.onBlur(event);
|
|
53
58
|
}
|
|
54
59
|
}, [props.onBlur]);
|
|
55
|
-
const handleContainerPress =
|
|
60
|
+
const handleContainerPress = react_1.default.useCallback(() => {
|
|
56
61
|
if (inputRef.current && !disabled) {
|
|
57
62
|
inputRef.current.focus();
|
|
58
63
|
}
|
|
59
64
|
}, [disabled]);
|
|
60
65
|
const hasAddons = leftAddon || rightAddon;
|
|
61
66
|
if (hasAddons) {
|
|
62
|
-
return (
|
|
67
|
+
return ((0, jsx_runtime_1.jsxs)(input_1.InputPrimitive.Group, { children: [label && ((0, jsx_runtime_1.jsx)(input_1.InputPrimitive.Label, { required: required, disabled: disabled, error: !!error, children: label })), (0, jsx_runtime_1.jsx)(react_native_1.TouchableWithoutFeedback, { onPress: handleContainerPress, children: (0, jsx_runtime_1.jsxs)(input_1.InputPrimitive.Container, { focused: isFocused, error: !!error, disabled: disabled, style: [containerStyles, containerStyle, { padding: 0 }], children: [leftAddon && ((0, jsx_runtime_1.jsx)(input_1.InputPrimitive.Addon, { position: "left", children: leftAddon })), (0, jsx_runtime_1.jsx)(input_1.InputPrimitive.Root, { ref: (node) => {
|
|
63
68
|
inputRef.current = node;
|
|
64
69
|
if (ref) {
|
|
65
70
|
if (typeof ref === "function") {
|
|
@@ -74,9 +79,9 @@ export const Input = forwardRef(({ variant = "default", size = "md", label, desc
|
|
|
74
79
|
styles.inputInContainer,
|
|
75
80
|
inputStyle,
|
|
76
81
|
{ outline: "none" },
|
|
77
|
-
], placeholderTextColor: disabled ? theme.colors.textDisabled : theme.colors.textMuted, ...props }), rightAddon && (
|
|
82
|
+
], placeholderTextColor: disabled ? theme.colors.textDisabled : theme.colors.textMuted, ...props }), rightAddon && ((0, jsx_runtime_1.jsx)(input_1.InputPrimitive.Addon, { position: "right", children: rightAddon }))] }) }), description && !error && ((0, jsx_runtime_1.jsx)(input_1.InputPrimitive.Description, { disabled: disabled, children: description })), (0, jsx_runtime_1.jsx)(input_1.InputPrimitive.Error, { visible: !!error, children: error })] }));
|
|
78
83
|
}
|
|
79
|
-
return (
|
|
84
|
+
return ((0, jsx_runtime_1.jsxs)(input_1.InputPrimitive.Group, { children: [label && ((0, jsx_runtime_1.jsx)(input_1.InputPrimitive.Label, { required: required, disabled: disabled, error: !!error, children: label })), (0, jsx_runtime_1.jsx)(input_1.InputPrimitive.Root, { ref: (node) => {
|
|
80
85
|
inputRef.current = node;
|
|
81
86
|
if (ref) {
|
|
82
87
|
if (typeof ref === "function") {
|
|
@@ -86,12 +91,12 @@ export const Input = forwardRef(({ variant = "default", size = "md", label, desc
|
|
|
86
91
|
ref.current = node;
|
|
87
92
|
}
|
|
88
93
|
}
|
|
89
|
-
}, disabled: disabled, error: !!error, onFocus: handleFocus, onBlur: handleBlur, style: [containerStyles, textStyles, containerStyle, inputStyle], placeholderTextColor: disabled ? theme.colors.textDisabled : theme.colors.textMuted, ...props }), description && !error && (
|
|
94
|
+
}, disabled: disabled, error: !!error, onFocus: handleFocus, onBlur: handleBlur, style: [containerStyles, textStyles, containerStyle, inputStyle], placeholderTextColor: disabled ? theme.colors.textDisabled : theme.colors.textMuted, ...props }), description && !error && ((0, jsx_runtime_1.jsx)(input_1.InputPrimitive.Description, { disabled: disabled, children: description })), (0, jsx_runtime_1.jsx)(input_1.InputPrimitive.Error, { visible: !!error, children: error })] }));
|
|
90
95
|
});
|
|
91
|
-
Input.displayName = "Input";
|
|
96
|
+
exports.Input.displayName = "Input";
|
|
92
97
|
// Create theme-aware styles
|
|
93
98
|
function createStyles(theme) {
|
|
94
|
-
return StyleSheet.create({
|
|
99
|
+
return react_native_1.StyleSheet.create({
|
|
95
100
|
// Variant styles for containers
|
|
96
101
|
defaultContainer: {
|
|
97
102
|
backgroundColor: theme.colors.background,
|
|
@@ -145,7 +150,7 @@ function createStyles(theme) {
|
|
|
145
150
|
smInput: {
|
|
146
151
|
fontSize: 14,
|
|
147
152
|
lineHeight: 18,
|
|
148
|
-
...Platform.select({
|
|
153
|
+
...react_native_1.Platform.select({
|
|
149
154
|
ios: {
|
|
150
155
|
paddingVertical: 0,
|
|
151
156
|
},
|
|
@@ -158,7 +163,7 @@ function createStyles(theme) {
|
|
|
158
163
|
mdInput: {
|
|
159
164
|
fontSize: 16,
|
|
160
165
|
lineHeight: 20,
|
|
161
|
-
...Platform.select({
|
|
166
|
+
...react_native_1.Platform.select({
|
|
162
167
|
ios: {
|
|
163
168
|
paddingVertical: 0,
|
|
164
169
|
},
|
|
@@ -171,7 +176,7 @@ function createStyles(theme) {
|
|
|
171
176
|
lgInput: {
|
|
172
177
|
fontSize: 18,
|
|
173
178
|
lineHeight: 22,
|
|
174
|
-
...Platform.select({
|
|
179
|
+
...react_native_1.Platform.select({
|
|
175
180
|
ios: {
|
|
176
181
|
paddingVertical: 0,
|
|
177
182
|
},
|
|
@@ -198,5 +203,3 @@ function createStyles(theme) {
|
|
|
198
203
|
},
|
|
199
204
|
});
|
|
200
205
|
}
|
|
201
|
-
// Export input variants for external use
|
|
202
|
-
export { inputVariants };
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Loader = Loader;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_native_1 = require("react-native");
|
|
6
|
+
const theme_1 = require("../../lib/theme");
|
|
7
|
+
function Loader(props) {
|
|
8
|
+
const { theme } = (0, theme_1.useTheme)();
|
|
9
|
+
return (0, jsx_runtime_1.jsx)(react_native_1.ActivityIndicator, { color: theme.colors.primary, ...props });
|
|
7
10
|
}
|